Spec: 2026-11-05_blog-5n-admin-deep-optimization Co-authored-by: GLM-5.3
3782 lines
2.5 MiB
Plaintext
3782 lines
2.5 MiB
Plaintext
(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=s((e=>{
|
||
/**
|
||
* @license React
|
||
* react.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/
|
||
var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return E(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ue=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function de(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ue)}catch(e){ue(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function fe(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else de(fe.bind(null,e))}var pe={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=pe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=fe,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ne,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=de,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),f=s(((e,t)=>{t.exports=d()})),p=s(((e,t)=>{
|
||
/*
|
||
object-assign
|
||
(c) Sindre Sorhus
|
||
@license MIT
|
||
*/
|
||
var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),m=s(((e,t)=>{var n=p(),r={};function i(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}var a=`mixins`;function o(e){return e}function s(e,t,s){var c=[],l={mixins:`DEFINE_MANY`,statics:`DEFINE_MANY`,propTypes:`DEFINE_MANY`,contextTypes:`DEFINE_MANY`,childContextTypes:`DEFINE_MANY`,getDefaultProps:`DEFINE_MANY_MERGED`,getInitialState:`DEFINE_MANY_MERGED`,getChildContext:`DEFINE_MANY_MERGED`,render:`DEFINE_ONCE`,componentWillMount:`DEFINE_MANY`,componentDidMount:`DEFINE_MANY`,componentWillReceiveProps:`DEFINE_MANY`,shouldComponentUpdate:`DEFINE_ONCE`,componentWillUpdate:`DEFINE_MANY`,componentDidUpdate:`DEFINE_MANY`,componentWillUnmount:`DEFINE_MANY`,UNSAFE_componentWillMount:`DEFINE_MANY`,UNSAFE_componentWillReceiveProps:`DEFINE_MANY`,UNSAFE_componentWillUpdate:`DEFINE_MANY`,updateComponent:`OVERRIDE_BASE`},u={getDerivedStateFromProps:`DEFINE_MANY_MERGED`},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)p(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=n({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=n({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps=e.getDefaultProps?g(e.getDefaultProps,t):t},propTypes:function(e,t){e.propTypes=n({},e.propTypes,t)},statics:function(e,t){m(e,t)},autobind:function(){}};function f(e,t){var n=l.hasOwnProperty(t)?l[t]:null;S.hasOwnProperty(t)&&i(n===`OVERRIDE_BASE`,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&i(n===`DEFINE_MANY`||n===`DEFINE_MANY_MERGED`,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){i(typeof n!=`function`,`ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object.`),i(!t(n),`ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.`);var r=e.prototype,o=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(a)&&d.mixins(e,n.mixins),n)if(n.hasOwnProperty(s)&&s!==a){var c=n[s],u=r.hasOwnProperty(s);if(f(u,s),d.hasOwnProperty(s))d[s](e,c);else{var p=l.hasOwnProperty(s);if(typeof c==`function`&&!p&&!u&&n.autobind!==!1)o.push(s,c),r[s]=c;else if(u){var m=l[s];i(p&&(m===`DEFINE_MANY_MERGED`||m===`DEFINE_MANY`),`ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.`,m,s),m===`DEFINE_MANY_MERGED`?r[s]=g(r[s],c):m===`DEFINE_MANY`&&(r[s]=_(r[s],c))}else r[s]=c}}}}function m(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){if(i(!(n in d),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in e){i((u.hasOwnProperty(n)?u[n]:null)===`DEFINE_MANY_MERGED`,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=g(e[n],r);return}e[n]=r}}}function h(e,t){for(var n in i(e&&t&&typeof e==`object`&&typeof t==`object`,`mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.`),t)t.hasOwnProperty(n)&&(i(e[n]===void 0,"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function g(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(n==null)return r;if(r==null)return n;var i={};return h(i,n),h(i,r),i}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){return t.bind(e)}function y(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e[r]=v(e,i)}}var b={componentDidMount:function(){this.__isMounted=!0}},x={componentWillUnmount:function(){this.__isMounted=!1}},S={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},C=function(){};n(C.prototype,e.prototype,S);function w(e){var t=o(function(e,n,a){this.__reactAutoBindPairs.length&&y(this),this.props=e,this.context=n,this.refs=r,this.updater=a||s,this.state=null;var o=this.getInitialState?this.getInitialState():null;i(typeof o==`object`&&!Array.isArray(o),`%s.getInitialState(): must return an object or null`,t.displayName||`ReactCompositeComponent`),this.state=o});for(var n in t.prototype=new C,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],c.forEach(p.bind(null,t)),p(t,b),p(t,e),p(t,x),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),i(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),l)t.prototype[n]||(t.prototype[n]=null);return t}return w}t.exports=s})),h=u(s(((e,t)=>{var n=f(),r=m();if(n===void 0)throw Error(`create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.`);var i=new n.Component().updater;t.exports=r(n.Component,n.isValidElement,i)}))(),1);
|
||
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
|
||
function g(e,t){this.v=e,this.k=t}function _(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e){if(Array.isArray(e))return e}function y(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function b(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
|
||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||
function x(e,t){return v(e)||y(e,t)||S(e,t)||b()}function S(e,t){if(e){if(typeof e==`string`)return _(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function C(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof g;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}C.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},C.prototype.next=function(e){return this._invoke(`next`,e)},C.prototype.throw=function(e){return this._invoke(`throw`,e)},C.prototype.return=function(e){return this._invoke(`return`,e)};var w=Object.entries,T=Object.setPrototypeOf,ee=Object.isFrozen,E=Object.getPrototypeOf,te=Object.getOwnPropertyDescriptor,ne=Object.freeze,re=Object.seal,ie=Object.create,ae=typeof Reflect<`u`&&Reflect,oe=ae.apply,se=ae.construct;ne||=function(e){return e},re||=function(e){return e},oe||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},se||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var ce=Me(Array.prototype.forEach);Array.prototype.indexOf;var le=Me(Array.prototype.lastIndexOf),ue=Me(Array.prototype.pop),de=Me(Array.prototype.push),fe=Me(Array.prototype.slice),pe=Me(Array.prototype.splice),me=Array.isArray,he=Ne(Set),ge=Me(Set.prototype.add),_e=Me(Set.prototype.has),ve=Me(String.prototype.toLowerCase),ye=Me(String.prototype.toString),be=Me(String.prototype.match),xe=Me(String.prototype.replace),Se=Me(String.prototype.indexOf),Ce=Me(String.prototype.trim),we=Me(Number.prototype.toString),Te=Me(Boolean.prototype.toString),Ee=typeof BigInt>`u`?null:Me(BigInt.prototype.toString),De=typeof Symbol>`u`?null:Me(Symbol.prototype.toString),Oe=Me(Object.prototype.hasOwnProperty),ke=Me(Object.prototype.toString),Ae=Me(RegExp.prototype.test),je=Ne(TypeError);function Me(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return oe(e,t,r)}}function Ne(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return se(e,n)}}function Pe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ve;if(T&&T(e,null),!me(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ee(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Fe(e){for(let t=0;t<e.length;t++)Oe(e,t)||(e[t]=null);return e}function Ie(e){let t=ie(null);for(let r of w(e)){var n=x(r,2);let i=n[0],a=n[1];Oe(e,i)&&(t[i]=me(a)?Fe(a):a&&typeof a==`object`&&a.constructor===Object?Ie(a):a)}return t}function Le(e){switch(typeof e){case`string`:return e;case`number`:return we(e);case`boolean`:return Te(e);case`bigint`:return Ee?Ee(e):`0`;case`symbol`:return De?De(e):`Symbol()`;case`undefined`:return ke(e);case`function`:case`object`:{if(e===null)return ke(e);let t=e,n=Re(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:ke(e)}return ke(e)}default:return ke(e)}}function Re(e,t){for(;e!==null;){let n=te(e,t);if(n){if(n.get)return Me(n.get);if(typeof n.value==`function`)return Me(n.value)}e=E(e)}function n(){return null}return n}function ze(e,t){for(;e!==null;){let n=te(e,t);if(n)return n.get?Me(n.get):null;e=E(e)}return null}function Be(e){try{return Ae(e,``),!0}catch{return!1}}var Ve=ne(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),He=ne(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ue=ne([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),We=ne([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ge=ne(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ke=ne([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),qe=ne([`#text`]),Je=ne(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ye=ne(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Xe=ne(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ze=ne([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Qe=re(/{{[\w\W]*|^[\w\W]*}}/g),$e=re(/<%[\w\W]*|^[\w\W]*%>/g),eee=re(/\${[\w\W]*/g),et=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),tt=re(/^aria-[\-\w]+$/),nt=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rt=re(/^(?:\w+script|data):/i),it=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),at=re(/^html$/i),ot=re(/^[a-z][.\w]*(-[.\w]+)+$/i),st=re(/<[/\w!]/g),ct=re(/<[/\w]/g),tee=re(/<\/no(script|embed|frames)/i),lt=re(/\/>/i),ut={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nee=ne(Pe({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),ree=function(){return typeof window>`u`?null:window},iee=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},dt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ft=function(e,t,n,r){return Oe(e,t)&&me(e[t])?Pe(r.base?Ie(r.base):{},e[t],r.transform):n},pt=function(e,t,n){let r=Oe(e,t)?e[t]:void 0;return r&&typeof r==`object`?Ie(r):n()};function mt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ree(),t=e=>mt(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==ut.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Re(d,`cloneNode`),p=Re(d,`remove`),m=Re(d,`removeAttributeNode`),h=Re(d,`nextSibling`),g=Re(d,`childNodes`),_=Re(d,`parentNode`),v=Re(d,`shadowRoot`),y=Re(d,`attributes`),b=o&&o.prototype?Re(o.prototype,`nodeType`):null,x=o&&o.prototype?Re(o.prototype,`nodeName`):null,S=o&&o.prototype?Re(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},T=function(e){return x?x(e):e.nodeName},ee=ze(d,`namespaceURI`),E=function(e){return ee?ee(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let te,ae=``,oe,se=!1,we=0,Te=function(){if(we>0)throw je(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},Ee=function(e){Te(),we++;try{return te.createHTML(e)}finally{we--}},De=function(e){Te(),we++;try{return te.createScriptURL(e)}finally{we--}},ke=function(){return se||=(oe=iee(u,i),!0),oe},Me=n,Ne=Me.implementation,Fe=Me.createNodeIterator,ht=Me.createDocumentFragment,gt=Me.getElementsByTagName,_t=r.importNode,vt=dt();t.isSupported=typeof w==`function`&&typeof _==`function`&&Ne&&Ne.createHTMLDocument!==void 0;let yt=Qe,bt=$e,xt=eee,St=et,Ct=tt,wt=rt,Tt=it,Et=ot,Dt=nt,Ot=null,kt=Pe({},[...Ve,...He,...Ue,...Ge,...qe]),At=null,jt=Pe({},[...Je,...Ye,...Xe,...Ze]),Mt=Object.seal(ie(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Nt=null,Pt=null,Ft=Object.seal(ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),It=!0,Lt=!0,Rt=!1,zt=!0,Bt=!1,Vt=!0,Ht=!1,Ut=!1,Wt=null,Gt=null,Kt=!1,qt=!1,Jt=!1,Yt=!1,Xt=!0,Zt=!1,Qt=`user-content-`,$t=!0,en=!1,tn=null,nn={},rn=null,an=Pe({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),on=null,sn=Pe({},[`audio`,`video`,`img`,`source`,`image`,`track`]),cn=null,ln=Pe({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),un=`http://www.w3.org/1998/Math/MathML`,dn=`http://www.w3.org/2000/svg`,fn=`http://www.w3.org/1999/xhtml`,pn=fn,mn=!1,hn=null,aee=Pe({},[un,dn,fn],ye),gn=ne([`mi`,`mo`,`mn`,`ms`,`mtext`]),_n=Pe({},gn),vn=ne([`annotation-xml`]),yn=Pe({},vn),bn=Pe({},[`title`,`style`,`font`,`a`,`script`]),xn=null,Sn=[`application/xhtml+xml`,`text/html`],Cn=null,wn=null,Tn=n.createElement(`form`),En=function(e){return e instanceof RegExp||e instanceof Function},Dn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wn&&wn===e)return;e&&typeof e==`object`||(e={}),e=Ie(e),xn=Sn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Cn=xn===`application/xhtml+xml`?ye:ve,Ot=ft(e,`ALLOWED_TAGS`,kt,{transform:Cn}),At=ft(e,`ALLOWED_ATTR`,jt,{transform:Cn}),hn=ft(e,`ALLOWED_NAMESPACES`,aee,{transform:ye}),cn=ft(e,`ADD_URI_SAFE_ATTR`,ln,{transform:Cn,base:ln}),on=ft(e,`ADD_DATA_URI_TAGS`,sn,{transform:Cn,base:sn}),rn=ft(e,`FORBID_CONTENTS`,an,{transform:Cn}),Nt=ft(e,`FORBID_TAGS`,Ie({}),{transform:Cn}),Pt=ft(e,`FORBID_ATTR`,Ie({}),{transform:Cn}),nn=Oe(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ie(e.USE_PROFILES):e.USE_PROFILES:!1,It=e.ALLOW_ARIA_ATTR!==!1,Lt=e.ALLOW_DATA_ATTR!==!1,Rt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,zt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Bt=e.SAFE_FOR_TEMPLATES||!1,Vt=e.SAFE_FOR_XML!==!1,Ht=e.WHOLE_DOCUMENT||!1,qt=e.RETURN_DOM||!1,Jt=e.RETURN_DOM_FRAGMENT||!1,Yt=e.RETURN_TRUSTED_TYPE||!1,Kt=e.FORCE_BODY||!1,Xt=e.SANITIZE_DOM!==!1,Zt=e.SANITIZE_NAMED_PROPS||!1,$t=e.KEEP_CONTENT!==!1,en=e.IN_PLACE||!1,Dt=Be(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:nt,pn=typeof e.NAMESPACE==`string`?e.NAMESPACE:fn,_n=pt(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Pe({},gn)),yn=pt(e,`HTML_INTEGRATION_POINTS`,()=>Pe({},vn));let t=pt(e,`CUSTOM_ELEMENT_HANDLING`,()=>ie(null));if(Mt=ie(null),Oe(t,`tagNameCheck`)&&En(t.tagNameCheck)&&(Mt.tagNameCheck=t.tagNameCheck),Oe(t,`attributeNameCheck`)&&En(t.attributeNameCheck)&&(Mt.attributeNameCheck=t.attributeNameCheck),Oe(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Mt.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),re(Mt),Bt&&(Lt=!1),Jt&&(qt=!0),nn&&(Ot=Pe({},qe),At=ie(null),nn.html===!0&&(Pe(Ot,Ve),Pe(At,Je)),nn.svg===!0&&(Pe(Ot,He),Pe(At,Ye),Pe(At,Ze)),nn.svgFilters===!0&&(Pe(Ot,Ue),Pe(At,Ye),Pe(At,Ze)),nn.mathMl===!0&&(Pe(Ot,Ge),Pe(At,Xe),Pe(At,Ze))),Ft.tagCheck=null,Ft.attributeCheck=null,Oe(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ft.tagCheck=e.ADD_TAGS:me(e.ADD_TAGS)&&(Ot===kt&&(Ot=Ie(Ot)),Pe(Ot,e.ADD_TAGS,Cn))),Oe(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ft.attributeCheck=e.ADD_ATTR:me(e.ADD_ATTR)&&(At===jt&&(At=Ie(At)),Pe(At,e.ADD_ATTR,Cn))),Oe(e,`ADD_FORBID_CONTENTS`)&&me(e.ADD_FORBID_CONTENTS)&&(rn===an&&(rn=Ie(rn)),Pe(rn,e.ADD_FORBID_CONTENTS,Cn)),$t&&(Ot[`#text`]=!0),Ht&&Pe(Ot,[`html`,`head`,`body`]),Ot.table&&(Pe(Ot,[`tbody`]),delete Nt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw je(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw je(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=te;te=e.TRUSTED_TYPES_POLICY;try{ae=Ee(``)}catch(e){throw te=t,e}}else e.TRUSTED_TYPES_POLICY===null?(te=void 0,ae=``):(te===void 0&&(te=ke()),te&&typeof ae==`string`&&(ae=Ee(``)));ne&&ne(e),wn=e},On=Pe({},[...He,...Ue,...We]),kn=Pe({},[...Ge,...Ke]),An=function(e,t,n){return t.namespaceURI===fn?e===`svg`:t.namespaceURI===un?e===`svg`&&(n===`annotation-xml`||_n[n]):!!On[e]},jn=function(e,t,n){return t.namespaceURI===fn?e===`math`:t.namespaceURI===dn?e===`math`&&yn[n]:!!kn[e]},Mn=function(e,t,n){return t.namespaceURI===dn&&!yn[n]||t.namespaceURI===un&&!_n[n]?!1:!kn[e]&&(bn[e]||!On[e])},Nn=function(e){let t=E(e),n=ve(T(e)),r=_(e),i,a;return r&&C(r)===ut.element?(i={namespaceURI:E(r)},a=ve(T(r))):(i={namespaceURI:pn},a=`template`),hn[t]?t===dn?An(n,i,a):t===un?jn(n,i,a):t===fn?Mn(n,i,a):!!(xn===`application/xhtml+xml`&&hn[t]):!1},Pn=function(e){de(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw je(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Fn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},In=function(e){Bn(e);let t=g(e);t&&ce(fe(t),e=>{try{p(e)}catch{}});let n=C(e)===ut.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Fn(e,r,i)}},Ln=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}de(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(qt||Jt)try{Pn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Rn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||At[Cn(i)]||Fn(e,r,i)}},zn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===ut.element){let t=v(e);er(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Bn=function(e){zn(e,e=>{C(e)===ut.element&&Rn(e)})},Vn=function(e){let t=[];return zn(e,e=>{t.push(e)},!0),t},oee=function(e,t){let n=he();ce(Vn(e),e=>{C(e)===ut.element&&ge(n,e)}),ce(t,e=>{C(e)===ut.element&&!_e(n,e)&&Rn(e)})},Hn=function(e,n){let r=!1;return ce(t.removed,t=>{t.element&&(r||=t.element===e,Bn(t.element))}),oee(e,n),r},Un=function(e,t){let n=tn,r=null,i=()=>(r||(r=he(),ce(t,e=>{ge(r,e)})),r);for(let t=0;;t++){let r=Vn(e),a=[e],o=!1;if(ce(r,e=>{C(e)===ut.documentFragment?de(a,e):!o&&!_e(n,e)&&(o=_e(i(),e))}),!o)return;if(t>=8)throw je(`the tree kept changing during in-place sanitization; refusing to return it`);ce(a,(t,n)=>{Wn(t,n>0,e,i())})}},Wn=function(e,t,n,r){let i=Yn(e),a;for(;a=i.nextNode();)_e(r,a)&&!_e(tn,a)&&(t&&nr(vt.uponSanitizeShadowNode,a,null),cr(a,n),hr(a,n),er(a.content)&&gr(a.content))},Gn=function(e){tn&&ge(tn,e)},Kn=function(e,t){return Vt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},qn=function(e){Vt&&zn(e,e=>{let t=C(e);if(t===ut.processingInstruction||t===ut.comment&&Ae(ct,e.data)){try{p(e)}catch{}return!1}if(t===ut.element){let t=e,n=Cn(T(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Kn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Jn=function(e){let t=null,r=null;if(Kt)e=`<remove></remove>`+e;else{let t=be(e,/^[\r\n\t ]+/);r=t&&t[0]}xn===`application/xhtml+xml`&&pn===fn&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=te?Ee(e):e;if(pn===fn)try{t=new l().parseFromString(i,xn)}catch{}if(!t||!t.documentElement){t=Ne.createDocument(pn,`template`,null);try{t.documentElement.innerHTML=mn?ae:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),pn===fn?gt.call(t,Ht?`html`:`body`)[0]:Ht?t.documentElement:a},Yn=function(e){let t=S?S(e):e.ownerDocument;return Fe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Xn=function(e){return e=xe(e,yt,` `),e=xe(e,bt,` `),e=xe(e,xt,` `),e},Zn=function(e){Qn(e);let t=e.querySelectorAll?.call(e,`template`);t&&ce(t,e=>{er(e.content)&&Zn(e.content)})},Qn=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=Fe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Xn(r.data),r=n.nextNode()},$n=function(e){let t=x?x(e):null;return typeof t!=`string`||Cn(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},er=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===ut.documentFragment}catch{return!1}},tr=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function nr(e,n,r){e.length!==0&&ce(e,e=>{e.call(t,n,r,wn)})}let rr=function(e,t){return!!(Vt&&e.hasChildNodes()&&!tr(e.firstElementChild)&&Ae(st,e.textContent)&&Ae(st,e.innerHTML)||Vt&&nee[t]&&C(e)===ut.element&&E(e)===fn&&(tr(e.firstElementChild)||typeof e.textContent==`string`&&Ae(st,e.textContent))||e.nodeType===ut.processingInstruction||Vt&&e.nodeType===ut.comment&&Ae(ct,e.data))},ir=function(e,t){if(e instanceof RegExp)return Ae(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},ar=function(e,t,n){if(!Nt[t]&&dr(t)&&ir(Mt.tagNameCheck,t))return!1;if($t&&!rn[t]&&!rn[ve(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Pn(e),!0},or=function(e,t,n,r){return e.length===0?t:t===n||t===r?Ie(t):t},sr=function(e,t){return e===t||_(e)!==null?!1:(en&&Bn(e),!0)},cr=function(e,n){if(Gn(e),nr(vt.beforeSanitizeElements,e,null),sr(e,n))return!0;if($n(e))return Pn(e),!0;let r=Cn(T(e));if(Ot=or(vt.uponSanitizeElement,Ot,kt,Wt),nr(vt.uponSanitizeElement,e,{tagName:r,allowedTags:Ot}),sr(e,n))return!0;if(rr(e,r))return Pn(e),!0;if(Nt[r]||!(Ft.tagCheck instanceof Function&&Ft.tagCheck(r))&&!Ot[r]){let t=ar(e,r,n);return t===!1&&(nr(vt.afterSanitizeElements,e,null),sr(e,n))?!0:t}if(C(e)===ut.element&&!Nn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ae(tee,e.innerHTML))return Pn(e),!0;if(Bt&&e.nodeType===ut.text){let n=Xn(e.textContent);e.textContent!==n&&(de(t.removed,{element:e.cloneNode()}),e.textContent=n)}return nr(vt.afterSanitizeElements,e,null),sr(e,n)},lr=function(e,t,r){if(Pt[t]||Kn(t,e)||Xt&&(t===`id`||t===`name`)&&(r in n||r in Tn))return!1;let i=At[t]||Ft.attributeCheck instanceof Function&&Ft.attributeCheck(t,e);return Lt&&Ae(St,t)||It&&Ae(Ct,t)?!0:i?cn[t]||Ae(Dt,xe(r,Tt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Se(r,`data:`)===0&&on[e]||Rt&&!Ae(wt,xe(r,Tt,``))?!0:!r:dr(e)&&ir(Mt.tagNameCheck,e)&&ir(Mt.attributeNameCheck,t,e)||t===`is`&&Mt.allowCustomizedBuiltInElements&&ir(Mt.tagNameCheck,r)},ur=Pe({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),dr=function(e){return!ur[ve(e)]&&Ae(Et,e)},fr=function(e,t,n,r){if(te&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return Ee(r);case`TrustedScriptURL`:return De(r)}return r},pr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!$n(e)||(Pn(e),!1)}catch{return Ln(t,e),!1}},mr=function(e,t){return Vt&&Ae(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:ve(e)===`attributename`&&be(t,`href`)!==null},hr=function(e,n){if(nr(vt.beforeSanitizeAttributes,e,null),sr(e,n))return;let r=e.attributes;if(!r||$n(e))return;At=or(vt.uponSanitizeAttribute,At,jt,Gt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:At,forceKeepAttr:void 0},a=r.length,o=Cn(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Cn(s),d=l,f=s===`value`?d:Ce(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,nr(vt.uponSanitizeAttribute,e,i),f=i.attrValue,Zt&&(u===`id`||u===`name`)&&Se(f,Qt)!==0&&(Ln(s,e,n),f=Qt+f,p=!0),mr(s,f)?Ln(s,e,n):i.forceKeepAttr||(i.keepAttr?!zt&&Ae(lt,f)?Ln(s,e,n):(Bt&&(f=Xn(f)),lr(o,u,f)?(f=fr(o,u,c,f),f!==d&&pr(e,s,c,f)&&p&&ue(t.removed)):Ln(s,e,n)):Ln(s,e,n))}nr(vt.afterSanitizeAttributes,e,null),sr(e,n)},gr=function(e){let t=null,n=Yn(e);for(nr(vt.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(nr(vt.uponSanitizeShadowNode,t,null),cr(t,e),hr(t,e),er(t.content)&&gr(t.content),C(t)===ut.element){let e=v(t);er(e)&&(_r(e),gr(e))}Bt&&Qn(e),nr(vt.afterSanitizeShadowDOM,e,null)},_r=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){gr(e.shadow);continue}let n=e.node,r=C(n)===ut.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&Cn(e)===`template`){let e=n.content;er(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);er(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(mn=!e,mn&&(e=`<!-->`),typeof e!=`string`&&!tr(e)&&(e=Le(e),typeof e!=`string`))throw je(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ut?(Ot=Wt,At=Gt):Dn(n),(vt.uponSanitizeElement.length>0||vt.uponSanitizeAttribute.length>0)&&(Ot=Ie(Ot)),vt.uponSanitizeAttribute.length>0&&(At=Ie(At)),t.removed=[];let c=en&&typeof e!=`string`&&tr(e),l=[],u=tn;if(c){qn(e);let t=T(e);if(typeof t==`string`){let n=Cn(t);if(!Ot[n]||Nt[n])throw In(e),je(`root node is forbidden and cannot be sanitized in-place`)}if($n(e))throw In(e),je(`root node is clobbered and cannot be sanitized in-place`);l=Vn(e),tn=he()}else if(tr(e))i=Jn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===ut.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),_r(i);else{if(!qt&&!Bt&&!Ht&&e.indexOf(`<`)===-1)return te&&Yt?Ee(e):e;if(i=Jn(e),!i)return qt?null:Yt?ae:``}i&&Kt&&Pn(i.firstChild);let d=c?e:i;try{c&&_r(e);let t=Yn(d);for(;o=t.nextNode();)cr(o,d),hr(o,d),er(o.content)&&gr(o.content);c&&Un(e,l)}catch(t){throw c&&(In(e),Hn(e,l)),t}finally{tn=u}if(c){if(Hn(e,l))throw je(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Bt&&Zn(e),e}if(qt){if(Bt&&Zn(i),Jt)for(s=ht.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(At.shadowroot||At.shadowrootmode)&&(s=_t.call(r,s,!0)),s}let f=Ht?i.outerHTML:i.innerHTML;return Ht&&Ot[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ae(at,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
||
`+f),Bt&&(f=Xn(f)),te&&Yt?Ee(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dn(e),Ut=!0,Wt=Ot,Gt=At},t.clearConfig=function(){wn=null,Ut=!1,Wt=null,Gt=null,te=oe,ae=``},t.isValidAttribute=function(e,t,n){wn||Dn({});let r=Cn(e),i=Cn(t);return typeof n==`string`&&(mr(t,n)||!zt&&Ae(lt,n))?!1:lr(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Oe(vt,e)&&de(vt[e],t)},t.removeHook=function(e,t){if(Oe(vt,e)){if(t!==void 0){let n=le(vt[e],t);return n===-1?void 0:pe(vt[e],n,1)[0]}return ue(vt[e])}},t.removeHooks=function(e){Oe(vt,e)&&(vt[e]=[])},t.removeAllHooks=function(){vt=dt()},t}var ht=mt(),gt=ht,_t=ht.sanitize.bind(ht);ht.isSupported,ht.addHook.bind(ht),ht.removeHook.bind(ht),ht.removeHooks.bind(ht),ht.removeAllHooks.bind(ht),ht.setConfig.bind(ht),ht.clearConfig.bind(ht),ht.isValidAttribute.bind(ht),ht.version,ht.removed;function vt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yt=vt();function bt(e){yt=e}var xt={exec:()=>null};function St(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Ct(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Tt.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var wt=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Tt={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:St(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:St(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:St(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:St(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:St(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:St(e=>RegExp(`^ {0,${e}}(?:</?(?:${Bt})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:St(e=>RegExp(`^ {0,${e}}>`))},Et=/^(?:[ \t]*(?:\n|$))+/,Dt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ot=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,kt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,At=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,Nt=Ct(Mt).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Pt=Ct(Mt).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ft=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,It=/^[^\n]+/,Lt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Rt=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Lt).replace(`title`,/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),zt=Ct(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,jt).getRegex(),Bt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Vt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ht=Ct(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Vt).replace(`tag`,Bt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ut=e=>Ct(Ft).replace(`hr`,kt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Bt).getRegex(),Wt=Ut(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Gt=Ut(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Kt={blockquote:Ct(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Gt).getRegex(),code:Dt,def:Rt,fences:Ot,heading:At,hr:kt,html:Ht,lheading:Nt,list:zt,newline:Et,paragraph:Wt,table:xt,text:It},qt=Ct(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,kt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Bt).getRegex(),Jt={...Kt,lheading:Pt,table:qt,paragraph:Ct(Ft).replace(`hr`,kt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,qt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Bt).getRegex()},Yt={...Kt,html:Ct(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace(`comment`,Vt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(Ft).replace(`hr`,kt).replace(`heading`,` *#{1,6} *[^
|
||
]`).replace(`lheading`,Nt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Xt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,$t=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,en=/[\p{P}\p{S}]/u,tn=/[\s\p{P}\p{S}]/u,nn=/[^\s\p{P}\p{S}]/u,rn=Ct(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,tn).getRegex(),an=/[\p{Pi}\p{Ps}"']/u,on=/(?!~)[\p{P}\p{S}]/u,sn=/(?!~)[\s\p{P}\p{S}]/u,cn=/(?:[^\s\p{P}\p{S}]|~)/u,ln=Ct(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,wt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),un=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dn=Ct(un,`u`).replace(/punct/g,en).getRegex(),fn=Ct(un,`u`).replace(/punct/g,on).getRegex(),pn=Ct(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,an).replace(/punct/g,en).getRegex(),mn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,hn=Ct(mn,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),aee=Ct(mn,`gu`).replace(/notPunctSpace/g,cn).replace(/punctSpace/g,sn).replace(/punct/g,on).getRegex(),gn=Ct(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),_n=Ct(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),vn=Ct(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),yn=Ct(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,en).getRegex(),bn=Ct(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),xn=Ct(/\\(punct)/,`gu`).replace(/punct/g,en).getRegex(),Sn=Ct(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,en).getRegex(),Cn=Ct(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wn=Ct(Vt).replace(`(?:-->|$)`,`-->`).getRegex(),Tn=Ct(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,wn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),En=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Dn=Ct(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,En).getRegex(),On=Ct(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,Dn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),kn=Ct(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Dn).replace(`ref`,Lt).getRegex(),An=Ct(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Lt).getRegex(),jn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Mn=Ct(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,En).getRegex(),Nn=Ct(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ct(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Mn).replace(`ref`,jn).getRegex()).replace(`nolink`,Ct(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,jn).getRegex()).getRegex(),Pn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fn=Ct(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),In={_backpedal:xt,anyPunctuation:xn,anyPunctuationOutsideCode:Sn,autolink:Cn,blockSkip:ln,br:Qt,code:Zt,del:xt,delLDelim:xt,delRDelim:xt,emStrongLDelim:dn,emStrongRDelimAst:hn,emStrongRDelimUnd:_n,escape:Xt,link:On,nolink:An,punctuation:rn,reflink:kn,reflinkSearch:Nn,tag:Tn,text:$t,url:xt},Ln={...In,emStrongLDelim:pn,emStrongRDelimAst:gn,emStrongRDelimUnd:vn,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Dn).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Dn).getRegex()},Rn={...In,emStrongRDelimAst:aee,emStrongLDelim:fn,delLDelim:yn,delRDelim:bn,url:Ct(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Fn).replace(`protocol`,Pn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ct(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,Pn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(`wwwStart`,wt?`(?<![^\\s*_~(])www\\.`:`www\\.`).getRegex()},zn={...Rn,br:Ct(Qt).replace(`{2,}`,`*`).getRegex(),text:Ct(Rn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Bn={normal:Kt,gfm:Jt,pedantic:Yt},Vn={normal:In,gfm:Rn,breaks:zn,pedantic:Ln},oee={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Hn=e=>oee[e];function Un(e,t){if(t){if(Tt.escapeTest.test(e))return e.replace(Tt.escapeReplace,Hn)}else if(Tt.escapeTestNoEncode.test(e))return e.replace(Tt.escapeReplaceNoEncode,Hn);return e}function Wn(e){return Tt.numericCharacterReference.test(e)?e.replace(Tt.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&`:String.fromCodePoint(r)}):e}function Gn(e){try{e=encodeURI(e).replace(Tt.percentDecode,`%`)}catch{return null}return e}function Kn(e,t){let n=e.replace(Tt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Tt.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(Tt.slashPipe,`|`);return n}function qn(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Jn(e){let t=e.split(`
|
||
`),n=t.length-1;for(;n>=0&&Tt.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
||
`)}function Yn(e){return e.trim().replace(Tt.multipleSpaceGlobal,` `).toLowerCase().toUpperCase().toLowerCase()}function Xn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var Zn=new WeakMap;function Qn(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let a=e[i];if(a!==`*`&&a!==`_`&&a!==`~`)continue;let o=i===0?`
|
||
`:e[i-1],s=i+1;for(;s<r&&e[s]===a;)s++;o!==` `&&o!==` `&&o!==`
|
||
`&&o!==`\r`&&o!==`\f`&&(a===`~`?n=i:t[a]=i),i=s-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function $n(e,t){let n=Qn(t),r=Zn.get(e);r?r.push(n):Zn.set(e,[n])}function er(e){let t=Zn.get(e);t&&(t.pop(),t.length===0&&Zn.delete(e))}function tr(e,t,n){let r=Zn.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:Qn(t).lastPossibleEmStrongCloserIndex[n]}function nr(e,t){let n=Zn.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:Qn(t).lastPossibleDelCloserIndex}function rr(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function ir(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function ar(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
||
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
||
`)}function or(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var sr=class{options;rules;lexer;constructor(e){this.options=e||yt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Jn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ar(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=qn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:qn(t[0],`
|
||
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:qn(t[0],`
|
||
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=qn(t[0],`
|
||
`).split(`
|
||
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
||
`),c=s.replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>t+rr(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
||
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
||
${s}`:s,r=r?`${r}
|
||
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`||u?.type===`table`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
||
`),o=t.raw+`
|
||
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
|
||
`).length:0,d=l?e.slice(0,-l):e;if(d.length>0&&(n=`${n}
|
||
${d.join(`
|
||
`)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(d.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
||
`+e.join(`
|
||
`),o=this.list(a);i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(`
|
||
`).length:0;if(s>0){let t=e.slice(0,s).join(`
|
||
`);n=`${n}
|
||
${t}`,r=`${r}
|
||
${t}`}e=e.slice(s)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
|
||
`,1)[0],d=t[1].length,f=this.options.pedantic?rr(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>rr(e,d)),p=e.split(`
|
||
`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
|
||
`,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>rr(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
|
||
`+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||o.test(f)||n.test(f))break;let e=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f}
|
||
${p}`)?` ${l.replace(/^ {0,3}/,``)}`:p;a+=`
|
||
`+e}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Jn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Xn(t[2],`()`)!==-1)return;let e=Yn(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:qn(t[0],`
|
||
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Kn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
||
`):[],a={type:`table`,raw:qn(t[0],`
|
||
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Kn(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:qn(t[0],`
|
||
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
||
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&or(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=qn(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Xn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=qn(t[0].slice(0,-1),`\\`);if((t[0].length-i.length)%2==0)return;let a=t[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):``;return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),ir(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&or(e,n[1],r,this.rules))return;let i=t[Yn(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ir(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);s<o&&(n=c);let u=s<o?l:!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||``;if(!d||!n||u){let n=[...r[0]].length-1,u,f,p=n,m=0,h=o-s+n,g=!this.options.pedantic&&!!c.trim()&&(!!d||i===`*`&&!l);if(i!==`*`&&i!==`_`)return;let _=i===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,v=tr(this,t,i),y=t.length-e.length+n;if(v<y)return;t=t.slice(-1*e.length+n);let b=v-y;for(_.lastIndex=0;(r=_.exec(t))!==null&&!(r.index>b);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(f=[...u].length,r[3]||r[4]){p+=f;continue}if(r[5]||r[6]||g){if(a&&(r[5]||r[6]))break;if(h%3&&!((h+f)%3)){m+=f;continue}}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let t=[...r[0]][0].length,i=e.slice(0,n+r.index+t+f);if(Math.min(n,f)%2){let e=i.slice(1,-1);return{type:`em`,raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:`strong`,raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=nr(this,t),l=t.length-e.length+n;if(c<l)return;t=t.slice(-1*e.length+n);let u=c-l;for(s.lastIndex=0;(r=s.exec(t))!==null&&!(r.index>u);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Wn(t[0]),escaped:e}}}},cr=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yt,this.options.tokenizer=this.options.tokenizer||new sr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:Tt,block:Bn.normal,inline:Vn.normal};this.options.pedantic?(t.block=Bn.pedantic,t.inline=Vn.pedantic):this.options.gfm&&(t.block=Bn.gfm,t.inline=this.options.breaks?Vn.breaks:Vn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Bn,inline:Vn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Tt.carriageReturn,`
|
||
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Tt.tabCharGlobal,` `).replace(Tt.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
||
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
||
`)?``:`
|
||
`)+i.raw,n.text+=`
|
||
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
||
`)?``:`
|
||
`)+i.raw,n.text+=`
|
||
`+i.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}),t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
||
`)?``:`
|
||
`)+i.raw,r.text+=`
|
||
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
||
`)?``:`
|
||
`)+i.raw,n.text+=`
|
||
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Yn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`)||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==sr.prototype.emStrong||this.tokenizer.del!==sr.prototype.del?this.#n(e):e;$n(this.tokenizer,n);try{return this.#t(e,n,t)}finally{er(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(t=>(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Yn(t.slice(r+1,-1))))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=t.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},lr=class{options;parser;constructor(e){this.options=e||yt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Tt.notSpaceStart)?.[0],i=e?e.replace(Tt.endingNewline,``)+`
|
||
`:``;return r?`<pre><code class="language-`+Un(r)+`">`+(n?i:Un(i,!0))+`</code></pre>
|
||
`:`<pre><code>`+(n?i:Un(i,!0))+`</code></pre>
|
||
`}blockquote({tokens:e}){return`<blockquote>
|
||
${this.parser.parse(e)}</blockquote>
|
||
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
||
`}hr(e){return`<hr>
|
||
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
||
`+r+`</`+i+`>
|
||
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
||
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
||
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
||
<thead>
|
||
`+t+`</thead>
|
||
`+r+`</table>
|
||
`}tablerow({text:e}){return`<tr>
|
||
${e}</tr>
|
||
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
||
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Un(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Un(n,!0):this.parser.parseInline(r),o=Gn(e);if(o===null)return a;e=Un(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Un(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Gn(e);if(i===null)return Un(n);e=i;let a=`<img src="${Un(e)}" alt="${Un(n)}"`;return t&&(a+=` title="${Un(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Un(e.text)}},ur=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return``}checkbox({raw:e}){return e}},dr=class e{options;renderer;textRenderer;constructor(e){this.options=e||yt,this.options.renderer=this.options.renderer||new lr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ur,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},fr=class{options;block;constructor(e){this.options=e||yt}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?cr.lex:cr.lexInline}provideParser(e=this.block){return e?dr.parse:dr.parseInline}};function pr(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var mr=class{defaults=vt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=dr;Renderer=lr;TextRenderer=ur;Lexer=cr;Tokenizer=sr;Hooks=fr;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(pr(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)pr(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)pr(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;pr(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);pr(n,this.walkTokens(i,t))}):e.tokens&&pr(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new lr(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new sr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new fr;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=fr.passThroughHooks.has(n)?e=>{if(t.options.async&&fr.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return pr(n,r.call(this,e)),t&&pr(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return cr.lex(e,t??this.defaults)}parser(e,t){return dr.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?cr.lex:cr.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?dr.parse:dr.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?cr.lex:cr.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?dr.parse:dr.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
||
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Un(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},hr=new mr;function gr(e,t){return hr.parse(e,t)}gr.options=gr.setOptions=function(e){return hr.setOptions(e),gr.defaults=hr.defaults,bt(gr.defaults),gr},gr.getDefaults=vt,gr.defaults=yt;function _r(...e){return hr.use(...e),gr.defaults=hr.defaults,bt(gr.defaults),gr}gr.use=_r,gr.walkTokens=function(e,t){return hr.walkTokens(e,t)},gr.parseInline=hr.parseInline,gr.Parser=dr,gr.parser=dr.parse,gr.Renderer=lr,gr.TextRenderer=ur,gr.Lexer=cr,gr.lexer=cr.lex,gr.Tokenizer=sr,gr.Hooks=fr,gr.parse=gr,gr.options,gr.setOptions,gr.walkTokens;var vr=gr.parseInline,yr=gr;dr.parse;var see=cr.lex,br=u(f(),1),{dependencies:cee,version:xr}={name:`@sveltia/cms`,version:`0.259.0`,description:`Sveltia CMS is a modern, lightweight, Git-based headless content management system.`,keywords:[`svelte`,`cms`,`content-management-system`],homepage:`https://sveltiacms.app/en/`,repository:{type:`git`,url:`git+https://github.com/sveltia/sveltia-cms.git`},funding:{type:`github`,url:`https://github.com/sponsors/kyoshino`},license:`MIT`,author:{name:`Kohei Yoshino`,url:`https://github.com/kyoshino`},type:`module`,scripts:{bench:`playwright test -c bench/playwright.config.js`,"bench:compare":`node bench/compare.js`,"bench:profile":`node bench/summarize-profile.js`,build:`vite build`,"build:watch":`vite build --watch`,check:`pnpm run --no-bail '/^check:.*/'`,"check:audit":`pnpm audit --ignore-registry-errors`,"check:cspell":`cspell --no-progress`,"check:duplicates":`jscpd --silent`,"check:eslint":`eslint .`,"check:imports":`node scripts/find-unused-imports.js`,"check:l10n":`node scripts/check-locales.js`,"check:oxlint":`oxlint .`,"check:prettier":`prettier --check .`,"check:stylelint":`stylelint '**/*.{css,scss,svelte}'`,"check:svelte":`svelte-check`,dev:`vite`,format:`prettier --write .`,prepublishOnly:`vite build`,preview:`vite preview`,test:`NODE_OPTIONS=--no-experimental-webstorage vitest run`,"test:components":`NODE_OPTIONS=--no-experimental-webstorage vitest run --project browser`,"test:components:coverage":`NODE_OPTIONS=--no-experimental-webstorage vitest run --coverage --project browser --coverage.include='src/lib/components/**/*.svelte' --coverage.thresholds.branches=98.4`,"test:e2e":`playwright test -c e2e/playwright.config.js`,"test:e2e:ui":`playwright test -c e2e/playwright.config.js --ui`,"test:unit":`NODE_OPTIONS=--no-experimental-webstorage vitest run --project unit`,"test:unit:coverage":`NODE_OPTIONS=--no-experimental-webstorage vitest run --coverage --project unit`,"test:watch":`NODE_OPTIONS=--no-experimental-webstorage vitest`},dependencies:{"@cfworker/json-schema":`^4.1.6`,"@discourse/heic":`^1.0.0`,"@fastify/deepmerge":`^3.2.4`,"@jsquash/webp":`^1.5.0`,"@lexical/markdown":`^0.53.0`,"@sindresorhus/transliterate":`^3.0.0`,"@sveltia/i18n":`^1.5.0`,"@sveltia/ui":`^0.89.0`,"@sveltia/utils":`^0.13.2`,buffer:`^6.0.3`,"create-react-class":`^15.7.0`,dayjs:`^1.11.23`,exifr:`^7.1.3`,"fast-deep-equal":`^3.1.3`,flat:`^6.0.1`,htm:`^3.1.1`,immutable:`^5.1.9`,"isomorphic-dompurify":`^4.6.0`,"isomorphic-git":`^1.44.10`,leaflet:`^1.9.4`,lexical:`^0.53.0`,marked:`^18.1.3`,"marked-bidi":`^1.0.15`,mime:`^4.1.2`,"parse-entities":`^4.0.2`,"pdfjs-dist":`^6.5.438`,qrcode:`^1.5.4`,react:`^19.3.1`,"react-dom":`^19.3.1`,"sanitize-filename":`^1.6.4`,"smol-toml":`^1.9.1`,svgo:`^4.1.0`,"terra-draw":`^1.39.0`,"terra-draw-leaflet-adapter":`1.0.3`,turndown:`^7.2.4`,yaml:`^2.9.1`},devDependencies:{"@playwright/test":`^1.64.1`,"@stylistic/eslint-plugin":`^5.10.0`,"@sveltejs/vite-plugin-svelte":`^7.3.1`,"@types/leaflet":`^1.9.22`,"@types/node":`^26.6.6`,"@types/qrcode":`^1.5.6`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@vitest/browser-playwright":`^5.1.0`,"@vitest/coverage-v8":`^5.1.0`,cspell:`^10.4.0`,eslint:`^9.39.5`,"eslint-config-airbnb-extended":`^3.3.0`,"eslint-config-prettier":`^10.1.8`,"eslint-plugin-jsdoc":`^65.4.3`,"eslint-plugin-package-json":`^1.14.0`,"eslint-plugin-svelte":`^3.24.0`,"eslint-plugin-unused-imports":`^4.4.1`,globals:`^17.14.0`,"happy-dom":`^21.0.4`,jscpd:`^5.4.2`,messageformat:`^4.1.0`,oxlint:`^1.91.0`,playwright:`^1.64.1`,"postcss-html":`^2.0.0`,prettier:`^3.9.10`,"prettier-plugin-svelte":`^4.1.1`,sonda:`^0.14.0`,stylelint:`^18.0.0`,"stylelint-config-recommended":`^19.0.0`,svelte:`^5.57.3`,"svelte-check":`^4.7.8`,"ts-json-schema-generator":`^2.9.0`,typescript:`^6.0.3`,vite:`^8.3.5`,vitest:`^5.1.0`,"vitest-browser-svelte":`^3.1.0`},publishConfig:{directory:`package`}},lee=[`getBackend`,`getCustomFormats`,`getCustomFormatsExtensions`,`getCustomFormatsFormatters`,`getEditorComponents`,`getEventListeners`,`getLocale`,`getMediaLibrary`,`getPreviewStyles`,`getPreviewTemplate`,`getRemarkPlugins`,`getWidgetValueSerializer`,`getWidgets`,`invokeEvent`,`moment`,`registerBackend`,`registerMediaLibrary`,`registerWidgetValueSerializer`,`removeEventListener`,`resolveWidget`,`registerLocale`,`registerRemarkPlugin`],D=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Sr=e=>JSON.parse(JSON.stringify(e)),Cr=u(s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}))(),1),wr=Array.isArray,uee=Array.prototype.indexOf,Tr=Array.prototype.includes,Er=Array.from,Dr=Object.defineProperty,Or=Object.getOwnPropertyDescriptor,dee=Object.getOwnPropertyDescriptors,fee=Object.prototype,pee=Array.prototype,kr=Object.getPrototypeOf,mee=Object.isExtensible;function Ar(e){return typeof e==`function`}var jr=()=>{};function hee(e){return typeof e?.then==`function`}function gee(e){for(var t=0;t<e.length;t++)e[t]()}function Mr(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Nr(e,t,n=!1){return e===void 0?n?t():t:e}function Pr(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var Fr=Symbol(`$state`),Ir=Symbol(`component`),Lr=Symbol(`legacy props`),_ee=Symbol(``),Rr=Symbol(`attributes`),zr=Symbol(`class`),Br=Symbol(`style`),Vr=Symbol(`text`),Hr=Symbol(`form reset`),Ur=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Wr=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),Gr={},Kr=Symbol(`uninitialized`);function vee(){console.warn(`https://svelte.dev/e/derived_inert`)}function qr(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function yee(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function bee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var Jr=!1;function Yr(e){Jr=e}var Xr;function Zr(e){if(e===null)throw qr(),Gr;return Xr=e}function Qr(){return Zr(ua(Xr))}function O(e){if(Jr){if(ua(Xr)!==null)throw qr(),Gr;Xr=e}}function $r(e=1){if(Jr){for(var t=e,n=Xr;t--;)n=ua(n);Xr=n}}function ei(e=!0){for(var t=0,n=Xr;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ua(n);e&&n.remove(),n=i}}function ti(e){if(!e||e.nodeType!==8)throw qr(),Gr;return e.data}function ni(e){return e===this.v}function xee(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function ri(e){return!xee(e,this.v)}function ii(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function See(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Cee(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function wee(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Tee(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Eee(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Dee(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Oee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function kee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Aee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function jee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Mee(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Nee=[];function ai(e,t=!1,n=!1){return oi(e,new Map,``,Nee,null,n)}function oi(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(wr(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=oi(l,t,n,r,null,a))}return s}if(kr(e)===fee){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=oi(e[u],t,n,r,null,a);return s}if(e instanceof Date)return e.getTime(),structuredClone(e);if(typeof e.toJSON==`function`&&!a)return oi(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}function Pee(e){let t=e.p;for(;t!==null&&t.c===null;)t=t.p;return t?.c??null}function si(e,t){return e===null&&ii(t),e.c??=new Map(Pee(e)||void 0)}var ci=null;function li(e){ci=e}function ui(e){return si(ci,`getContext`).get(e)}function di(e,t){return si(ci,`setContext`).set(e,t),t}function Fee(){return si(ci,`getAllContexts`)}function k(e,t=!1,n){ci={p:ci,i:!1,c:null,e:null,s:e,x:null,r:Ha,l:null}}function A(e){var t=ci,n=t.e;if(n!==null){t.e=null;for(var r of n)ya(r)}return e!==void 0&&(t.x=e),t.i=!0,ci=t.p,fi(e)}function fi(e={}){return Dr(e,Ir,{value:!0}),e}function pi(){return!0}var mi=[];function hi(){var e=mi;mi=[],gee(e)}function gi(e){if(mi.length===0&&!Fi){var t=mi;queueMicrotask(()=>{t===mi&&hi()})}mi.push(e)}function Iee(){for(;mi.length>0;)hi()}var Lee=-7169;function _i(e,t){e.f=e.f&Lee|t}function vi(e){e.f&512||e.deps===null?_i(e,1024):_i(e,4096)}function Ree(e,t){e.f&2048?t.set(e,2048):e.f&4096&&t.get(e)!==2048&&t.set(e,4096),_i(e,1024)}function zee(e,t){if(t){let t=document.body;e.autofocus=!0,gi(()=>{document.activeElement===t&&e.focus()})}}function Bee(e){Jr&&la(e)!==null&&da(e)}var Vee=!1;function Hee(){Vee||(Vee=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Hr]?.()})},{capture:!0}))}function yi(e){var t=za,n=Ha;Va(null),Ua(null);try{return e()}finally{Va(t),Ua(n)}}function Uee(e,t,n,r=n){e.addEventListener(t,()=>yi(n));let i=e[Hr];e[Hr]=i?()=>{i(),r(!0)}:()=>r(!0),Hee()}function bi(e,t,n,r){let i=pi()?wi:Ei;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Ha,c=xi(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){ha(e,s)}Si()}}var d=Ci();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Wee(e))).then(u).catch(e=>ha(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),Si())}):f()}function xi(){var e=Ha,t=za,n=ci,r=ji;return function(i=!0){Ua(e),Va(t),li(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Si(e=!0){Ua(null),Va(null),li(null),e&&ji?.deactivate()}function Ci(){var e=Ha,t=e.b,n=ji,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function wi(e){return Ha!==null&&(Ha.f|=524288),{ctx:ci,deps:null,effects:null,equals:ni,f:2050,fn:e,reactions:null,rv:0,v:Kr,wv:0,parent:Ha,ac:null}}var Ti=Symbol(`obsolete`);function Wee(e,t,n){let r=Ha;r===null&&See();var i=void 0,a=Xi(Kr),o=!za,s=new Set;return ite(()=>{var t=Ha,n=Mr();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Ur&&n.reject(e)}).finally(Si)}catch(e){n.reject(e),Si()}var c=ji;if(o){if(t.f&32768)var l=Ci();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Ti);else for(let e of s.values())e.reject(Ti);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Ti&&(c.activate(),t?(a.f|=8388608,ea(a,t)):(a.f&8388608&&(a.f^=8388608),ea(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),va(()=>{for(let e of s)e.reject(Ti)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function j(e){let t=wi(e);return cte(t),t}function Ei(e){let t=wi(e);return t.equals=ri,t}function Gee(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ka(t[n])}}function Di(e){var t,n=Ha,r=e.parent;if(!La&&r!==null&&e.v!==Kr&&r.f&24576)return vee(),e.v;Ua(r);try{Gee(e),t=to(e)}finally{Ua(n)}return t}function Oi(e){var t=Di(e);!e.equals(t)&&(e.wv=Qa(),(!ji?.is_fork||e.deps===null)&&(ji===null?e.v=t:(ji.capture(e,t,!0),Mi?.capture(e,t,!0)),e.deps===null))?_i(e,1024):La||(Ni===null?vi(e):(_a()||ji?.is_fork)&&Ni.set(e,t))}function Kee(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&yi(()=>{t.ac.abort(Ur),t.ac=null}),t.fn!==null&&(t.teardown=jr),ro(t,0),Oa(t))}function ki(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&io(t)}var Ai=null,ji=null,Mi=null,Ni=null,Pi=null,Fi=!1,Ii=!1,Li=null,Ri=null,zi=0,qee=1,Bi=class e{id=qee++;started=!1;linked=!0;prev=null;next=null;async_deriveds=new Map;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=new Map;#i=null;#a=[];#o=[];#s=new Map;#c=new Map;#l=new Set;is_fork=!1;#u=!1;constructor(){Ai===null?Ai=this:(Ai.next=this,this.prev=Ai),Ai=this}#d(){if(this.is_fork)return!0;for(let e of this.#r.keys())if(!this.#f(e))return!0;return!1}#f(e){for(var t=e;t!==null;t=t.parent)if(this.#c.has(t))return!0;return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]}),this.#l.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#c.get(e);if(n){this.#c.delete(e);for(var r of n.d)_i(r,2048),t(r);for(r of n.m)_i(r,4096),t(r)}this.#l.add(e)}#p(){var e=[];for(let i of this.#a)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=1024}}n||e.push(t)}return this.#a=[],e}#m(){this.started=!0;for(let[e,t]of this.#s)_i(e,t),this.schedule(e);this.apply();for(var t=Li=[],n=[],r=Ri=[];this.#a.length>0;){zi++>1e3&&(this.#b(),Jee());for(let e of this.#p())try{this.#h(e,t,n)}catch(t){throw Ki(e),this.#d()||this.discard(),t}}if(ji=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Li=null,Ri=null,this.#d()){this.#y(n),this.#y(t);for(let[e,t]of this.#c)Gi(e,t);r.length>0&&ji.#m();return}let a=this.#g();if(a)this.#y(n),this.#y(t),a.#v(this);else{this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),Mi=this,Ui(n),Ui(t),Mi=null,this.#i?.resolve();var o=ji;this.#n===0&&(this.#a.length===0||o!==null)&&this.#b(),o!==null&&(Ji.clear(),o.#m())}}#h(e,t,n){e.f^=1024;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=1024:i&4?t.push(r):$a(r)&&(i&16&&this.add_dirty_reaction(r,4096),io(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#g(){for(var e=this.prev;e!==null;e=e.prev)if(!e.is_fork&&this.#_(e))return e;return null}#_(e){for(let[t,[,n]]of this.current)if(!n&&e.current.has(t))return!0;return!1}#v(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_reactions(e.#s);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#s.delete(i),_i(i,2048),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#b(),ji=this,this.#m()}#y(e){for(var t=0;t<e.length;t+=1)Ree(e[t],this.#s)}capture(e,t,n=!1){e.v!==Kr&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),Ni?.set(e,t)),this.is_fork||(e.v=t)}activate(){ji=this}deactivate(){ji=null,Ni=null}flush(){try{Ii=!0,ji=this,this.#m()}finally{zi=0,Pi=null,Li=null,Ri=null,Ii=!1,ji=null,Ni=null,Ji.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear();for(let e of this.async_deriveds.values())e.reject(Ti);this.#b(),this.#i?.resolve()}register_created_effect(e){this.#o.push(e)}increment(e,t){if(this.#n+=1,e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t){if(--this.#n,e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#u||(this.#u=!0,gi(()=>{this.#u=!1,this.linked&&this.flush()}))}transfer_reactions(e){for(let[t,n]of e)this.add_dirty_reaction(t,n);e.clear()}add_dirty_reaction(e,t){(t===2048||this.#s.get(e)!==2048)&&this.#s.set(e,t)}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=Mr()).promise}static ensure(){if(ji===null){let t=ji=new e;!Ii&&!Fi&&gi(()=>{t.started||t.flush()})}return ji}apply(){Ni=null}schedule(e){Pi=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#a.push(e)}#b(){if(this.linked){var e=this.prev,t=this.next;e===null||(e.next=t),t===null?Ai=e:t.prev=e,this.linked=!1}}};function Vi(e){var t=Fi,n=Mi;Mi=null,Fi=!0;try{var r;for(e&&(Vi(),r=e());;){if(Iee(),ji===null)return r;ji.flush()}}finally{Fi=t,Mi=n}}function Jee(){try{Dee()}catch(e){ha(e,Pi)}}var Hi=null;function Ui(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&$a(r)&&(Hi=new Set,io(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&ja(r),Hi?.size>0)){Ji.clear();for(let e of Hi){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Hi.has(n)&&(Hi.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||io(n)}}Hi.clear()}}Hi=null}}function Wi(e){ji.schedule(e)}function Gi(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),_i(e,1024);for(var n=e.first;n!==null;)Gi(n,t),n=n.next}}function Ki(e){_i(e,1024);for(var t=e.first;t!==null;)Ki(t),t=t.next}var qi=new Set,Ji=new Map,Yi=!1;function Xi(e,t){return{f:0,v:e,reactions:null,equals:ni,rv:0,wv:0}}function M(e,t){let n=Xi(e,t);return cte(n),n}function Zi(e,t=!1,n=!0){let r=Xi(e);return t||(r.equals=ri),r}function N(e,t,n=!1){return za!==null&&(!Ba||za.f&131072)&&pi()&&za.f&4325394&&(Wa===null||!Wa.has(e))&&jee(),ea(e,n?na(t):t,Ri)}var Qi=null,$i=0;function ea(e,t,n=null){if(!e.equals(t)){La?Ji.set(e,t):Ji.has(e)||Ji.set(e,e.v);var r=Bi.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Di(t),Ni===null&&vi(t)}e.wv=Qa(),Qi=null,$i=0,Xee(e,2048,n),Qi=null,pi()&&Ha!==null&&Ha.f&1024&&!(Ha.f&96)&&(qa===null?lte([e]):qa.push(e)),!r.is_fork&&qi.size>0&&!Yi&&Yee()}return t}function Yee(){Yi=!1;for(let e of qi){e.f&1024&&_i(e,4096);let t;try{t=$a(e)}catch{t=!0}t&&io(e)}qi.clear()}function ta(e){N(e,e.v+1)}function Xee(e,t,n){var r=e.reactions;if(r!==null){var i=pi(),a=r.length;if($i+=a,$i>1e5&&Qi===null&&(Qi=new Set),Qi!==null){if(Qi.has(e))return;Qi.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==Ha){var l=!(c&2048);if(l&&_i(s,t),c&131072)qi.add(s);else if(c&2){var u=s;Ni?.delete(u),Xee(u,4096,n)}else if(l){var d=s;c&16&&Hi!==null&&Hi.add(d),n===null?Wi(d):n.push(d)}}}}}function na(e){if(typeof e!=`object`||!e||Fr in e||Ir in e)return e;let t=kr(e);if(t!==fee&&t!==pee)return e;var n=new Map,r=wr(e),i=M(0),a=null,o=Xa,s=e=>{if(Xa===o)return e();var t=za,n=Xa;Va(null),Za(o);var r=e();return Va(t),Za(n),r};return r&&n.set(`length`,M(e.length,a)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&r.configurable!==!1&&r.enumerable!==!1&&r.writable!==!1||kee();var i=n.get(t);return i===void 0?s(()=>{var e=M(r.value,a);return n.set(t,e),e}):N(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>M(Kr,a));n.set(t,e),ta(i)}}else N(r,Kr),ta(i);return!0},get(t,r,i){if(r===Fr)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||Or(t,r)?.writable)&&(o=s(()=>M(na(c?t[r]:Kr),a)),n.set(r,o)),o!==void 0){var l=B(o);return l===Kr?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=B(i);if(a===Kr)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===Fr)return!0;var r=n.get(t),i=r!==void 0&&r.v!==Kr||Reflect.has(e,t);return(r!==void 0||(Ha!==null||za!==null)&&(!i||Or(e,t)?.writable))&&(r===void 0&&(r=s(()=>M(i?na(e[t]):Kr,a)),n.set(t,r)),B(r)===Kr)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>M(Kr,a)),n.set(d+``,f)):N(f,Kr)}if(l===void 0)(!u||Or(e,t)?.writable)&&(l=s(()=>M(void 0,a)),N(l,na(o)),n.set(t,l));else{u=l.v!==Kr;var p=s(()=>na(o));N(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&N(h,g+1)}ta(i)}return!0},ownKeys(e){B(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Kr});for(var[r,a]of n)a.v!==Kr&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Aee()}})}function Zee(e){try{if(typeof e==`object`&&e&&Fr in e)return e[Fr]}catch{}return e}function Qee(e,t){return Object.is(Zee(e),Zee(t))}var ra,ia,aa,oa,sa;function $ee(){if(ra===void 0){ra=window,ia=document,aa=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;oa=Or(t,`firstChild`).get,sa=Or(t,`nextSibling`).get,mee(e)&&(e[zr]=void 0,e[Rr]=null,e[Br]=void 0,e.__e=void 0),mee(n)&&(n[Vr]=void 0)}}function ca(e=``){return document.createTextNode(e)}function la(e){return oa.call(e)}function ua(e){return sa.call(e)}function P(e,t){if(!Jr)return la(e);var n=la(Xr);if(n===null)n=Xr.appendChild(ca());else if(t&&n.nodeType!==3){var r=ca();return n?.before(r),Zr(r),r}return t&&ma(n),Zr(n),n}function F(e,t=!1){if(!Jr){var n=la(e);return n instanceof Comment&&n.data===``?ua(n):n}if(t){if(Xr?.nodeType!==3){var r=ca();return Xr?.before(r),Zr(r),r}ma(Xr)}return Xr}function I(e,t=!1){if(!Jr)return la(e);var n=P(e,t);return O(e),n}function L(e,t=1,n=!1){let r=Jr?Xr:e;for(var i;t--;)i=r,r=ua(r);if(!Jr)return r;if(n){if(r?.nodeType!==3){var a=ca();return r===null?i?.after(a):r.before(a),Zr(a),a}ma(r)}return Zr(r),r}function da(e){e.textContent=``}function fa(){return!1}function pa(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function ma(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function ete(e){var t=Ha;if(t===null)return za.f|=8388608,e;if(!(t.f&32768)&&!(t.f&4))throw e;ha(e,t)}function ha(e,t){if(e===Gr)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function tte(e){Ha===null&&(za===null&&Eee(e),Tee()),La&&wee(e)}function nte(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ga(e,t){var n=Ha;n!==null&&n.f&8192&&(e|=8192);var r={ctx:ci,deps:null,nodes:null,f:e|2560,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};ji?.register_created_effect(r);var i=r;if(e&4)Li===null?Bi.ensure().schedule(r):Li.push(r);else if(t!==null){try{io(r)}catch(e){throw ka(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=n,n!==null&&nte(i,n),za!==null&&za.f&2&&!(e&64))){var a=za;(a.effects??=[]).push(i)}return r}function _a(){return za!==null&&!Ba}function va(e){let t=ga(8,null);return _i(t,1024),t.teardown=e,t}function R(e){tte(`$effect`);var t=Ha.f;if(!za&&t&32&&ci!==null&&!ci.i){var n=ci;(n.e??=[]).push(e)}else return ya(e)}function ya(e){return ga(1048580,e)}function ba(e){return tte(`$effect.pre`),ga(1048584,e)}function xa(e){Bi.ensure();let t=ga(524352,e);return()=>{ka(t)}}function rte(e){Bi.ensure();let t=ga(524352,e);return(e={})=>new Promise(n=>{e.outro?Ma(t,()=>{ka(t),n(void 0)}):(ka(t),n(void 0))})}function Sa(e){return ga(4,e)}function ite(e){return ga(4718592,e)}function Ca(e,t=0){return ga(8|t,e)}function z(e,t=[],n=[],r=[]){bi(r,t,n,t=>{ga(8,()=>{e(...t.map(B))})})}function ate(e,t=[],n=[],r=[]){bi(r,t,n,t=>{ga(4,()=>e(...t.map(B)))})}function wa(e,t=0){return ga(16|t,e)}function Ta(e,t=0){return ga(16777216|t,e)}function Ea(e){return ga(524320,e)}function Da(e){var t=e.teardown;if(t!==null){let n=La,r=za;Ra(!0),Va(null);try{t.call(null)}catch(t){ha(t,e.parent)}finally{Ra(n),Va(r)}}}function Oa(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&yi(()=>{e.abort(Ur)});var r=n.next;n.f&64?n.parent=null:ka(n,t),n=r}}function ote(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||ka(t),t=n}}function ka(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Aa(e.nodes.start,e.nodes.end),n=!0),e.f|=33554432,Oa(e,t&&!n),ro(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Da(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&ja(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Aa(e,t){for(;e!==null;){var n=e===t?null:ua(e);e.remove(),e=n}}function ja(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Ma(e,t,n=!0){var r=[];e.f|=256,Na(e,r,!0);var i=()=>{n&&ka(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Na(e,t,n){if(!(e.f&8192)){e.f^=8192;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Na(i,t,o?n:!1)}i=a}}}function Pa(e){e.f&=-257,Fa(e,!0)}function Fa(e,t){if(!(e.f&256)&&e.f&8192){e.f^=8192,e.f&1024||(_i(e,2048),Bi.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Fa(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Ia(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:ua(n);t.append(n),n=i}}var ste=null,La=!1;function Ra(e){La=e}var za=null,Ba=!1;function Va(e){za=e}var Ha=null;function Ua(e){Ha=e}var Wa=null;function cte(e){za!==null&&(za.f&2097152||za.f&2)&&(Wa??=new Set).add(e)}var Ga=null,Ka=0,qa=null;function lte(e){qa=e}var Ja=1,Ya=0,Xa=Ya;function Za(e){Xa=e}function Qa(){return++Ja}function $a(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if($a(a)&&Oi(a),a.wv>e.wv)return!0}t&512&&Ni===null&&_i(e,1024)}return!1}function eo(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Wa!==null&&Wa.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?eo(a,t,!1):t===a&&(n?_i(a,2048):a.f&1024&&_i(a,4096),Wi(a))}}function to(e){var t=Ga,n=Ka,r=qa,i=za,a=Wa,o=ci,s=Ba,c=Xa,l=e.f;Ga=null,Ka=0,qa=null,za=l&96?null:e,Wa=null,li(e.ctx),Ba=!1,Xa=++Ya,e.ac!==null&&(yi(()=>{e.ac.abort(Ur)}),e.ac=null);try{e.f|=2097152;var u=e.fn,d=u();e.f|=32768;var f=no(e);if(pi()&&qa!==null&&!Ba&&f!==null&&!(e.f&6146))for(var p=0;p<qa.length;p++)eo(qa[p],e);if(i!==null&&i!==e){if(Ya++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Ya;if(t!==null)for(let e of t)e.rv=Ya;qa!==null&&(r===null?r=qa:r.push(...qa))}return e.f&8388608&&(e.f^=8388608),d}catch(t){return no(e),ete(t)}finally{e.f^=2097152,Ga=t,Ka=n,qa=r,za=i,Wa=a,li(o),Ba=s,Xa=c}}function no(e){var t=e.deps,n=ji?.is_fork;if(Ga!==null){var r;if(n||ro(e,Ka),t!==null&&Ka>0)for(t.length=Ka+Ga.length,r=0;r<Ga.length;r++)t[Ka+r]=Ga[r];else e.deps=t=Ga;if(_a()&&e.f&512)for(r=Ka;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&Ka<t.length&&(ro(e,Ka),t.length=Ka);return t}function ute(e,t){let n=t.reactions;if(n!==null){var r=uee.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Ga===null||!Tr.call(Ga,t))){var a=t;a.f&512&&(a.f^=512),a.v!==Kr&&vi(a),a.ac!==null&&yi(()=>{a.ac.abort(Ur),a.ac=null,_i(a,2048)}),Kee(a),ro(a,0)}}function ro(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)ute(e,n[r])}function io(e){var t=e.f;if(!(t&16384)){_i(e,1024);var n=Ha;Ha=e;try{t&16777232?ote(e):Oa(e),Da(e);var r=to(e);e.teardown=typeof r==`function`?r:null,e.wv=Ja}finally{Ha=n}}}async function ao(){await Promise.resolve(),Vi()}function B(e){var t=!!(e.f&2);if(ste?.add(e),za!==null&&!Ba&&!(Ha!==null&&Ha.f&16384)&&(Wa===null||!Wa.has(e))){var n=za.deps;if(za.f&2097152)e.rv<Ya&&(e.rv=Ya,Ga===null&&n!==null&&n[Ka]===e?Ka++:Ga===null?Ga=[e]:Ga.push(e));else{za.deps??=[],Tr.call(za.deps,e)||za.deps.push(e);var r=e.reactions;r===null?e.reactions=[za]:Tr.call(r,za)||r.push(za)}}if(La&&Ji.has(e))return Ji.get(e);if(t){var i=e;if(La){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||so(i))&&(a=Di(i)),Ji.set(i,a),a}var o=!(i.f&512)&&!Ba&&za!==null&&!!(za.f&512),s=!(i.f&32768);$a(i)&&(o&&(i.f|=512),Oi(i)),o&&!s&&(ki(i),oo(i))}if(Ni?.has(e))return Ni.get(e);if(e.f&8388608)throw e.v;return e.v}function oo(e){if(e.f|=512,e.deps!==null)for(let n of e.deps){var t=n.reactions;t===null?n.reactions=[e]:Tr.call(t,e)||t.push(e),n.f&2&&!(n.f&512)&&(ki(n),oo(n))}}function so(e){if(e.v===Kr)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ji.has(t)||t.f&2&&so(t))return!0;return!1}function co(e){var t=Ba;try{return Ba=!0,e()}finally{Ba=t}}function lo(){return Symbol(`@attach`)}function dte(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var fte=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function pte(e){return fte.includes(e)}var mte=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),hte={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function gte(e){return e=e.toLowerCase(),hte[e]??e}[...mte];var _te=[`touchstart`,`touchmove`];function vte(e){return _te.includes(e)}var yte=[`textarea`,`script`,`style`,`title`];function bte(e){return yte.includes(e)}var uo=Symbol(`events`),fo=new Set,po=new Set;function xte(e){if(!Jr)return;e.removeAttribute(`onload`),e.removeAttribute(`onerror`);let t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function mo(e,t,n,r={}){function i(e){if(r.capture||xo.call(t,e),!e.cancelBubble)return yi(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,gi(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function ho(e,t,n,r={}){var i=mo(t,e,n,r);return()=>{i.__removed=!0,e.removeEventListener(t,i,r)}}function go(e,t,n,r,i){var a={capture:r,passive:i},o=mo(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&va(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function _o(e,t,n){(t[uo]??={})[e]=n}function vo(e){for(var t=0;t<e.length;t++)fo.add(e[t]);for(var n of po)n(e)}var yo=null,bo=!1;function xo(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;yo=e,bo||(bo=!0,setTimeout(()=>{bo=!1,yo=null}));var o=0,s=yo===e&&e[uo];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[uo]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){Dr(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=za,d=Ha;Va(null),Ua(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[uo]?.[r];m==null||a.disabled&&e.target!==a||m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[uo]=t,delete e.currentTarget,Va(u),Ua(d)}}}var Ste=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Cte(e){return Ste?.createHTML(e)??e}function wte(e){var t=pa(`template`);return t.innerHTML=Cte(e.replaceAll(`<!>`,`<!---->`)),t.content}function So(e,t){var n=Ha;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function V(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(Jr)return So(Xr,null),Xr;i===void 0&&(i=wte(a?e:`<!>`+e),n||(i=la(i)));var t=r||aa?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=la(t),s=t.lastChild;So(o,s)}else So(t,t);return t}}function H(e=``){if(!Jr){var t=ca(e+``);return So(t,t),t}var n=Xr;return n.nodeType===3?ma(n):(n.before(n=ca()),Zr(n)),So(n,n),n}function U(){if(Jr)return So(Xr,null),Xr;var e=document.createDocumentFragment(),t=document.createComment(``),n=ca();return e.append(t,n),So(t,n),e}function W(e,t){if(Jr){var n=Ha;n.f&32768&&n.nodes.end!==null||(n.nodes.end=Xr),Qr()}else e!==null&&e.before(t)}function Co(){if(Jr&&Xr&&Xr.nodeType===8&&Xr.textContent?.startsWith(`$`)){let e=Xr.textContent.substring(1);return Qr(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function Tte(e){let t=0,n=Xi(0),r;return()=>{_a()&&(B(n),Ca(()=>(t===0&&(r=co(()=>e(()=>ta(n)))),t+=1,()=>{gi(()=>{--t,t===0&&(r?.(),r=void 0,ta(n))})})))}}var Ete=589824;function wo(e,t,n,r){new Dte(e,t,n,r)}var Dte=class{parent;is_pending=!1;transform_error;#e;#t=Jr?Xr:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Map;#p=null;#m=Tte(()=>(this.#p=Xi(this.#l),()=>{this.#p=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Ha;t.b=this,t.f|=128,n(e)},this.parent=Ha.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=wa(()=>{if(Jr){let e=ti(this.#t);Qr();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#g(t)}else t?this.#y():this.#h()}else this.#b()},Ete),Jr&&(this.#e=Xr)}#h(){try{this.#a=Ea(()=>this.#r(this.#e))}catch(e){this.error(e)}}#g(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#_(e);gi(r),t&&(this.#s=Ea(()=>{t(this.#e,()=>e,()=>n)}))}#_(e){var t=!1,n=!1;let r=()=>{this.#v()||(t?bee():(t=!0,n&&Mee(),this.#s!==null&&Ma(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})))};return{reset:r,invoke_onerror:()=>{if(!this.#v())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){ha(e,this.#i&&this.#i.parent)}}}}#v(){return!!(this.#i.f&33570816)}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Ea(()=>e(this.#e)),gi(()=>{if(!this.#v()){var e=this.#c=document.createDocumentFragment(),t=ca(),n=!1;e.append(t),this.#a=this.#S(()=>{try{return Ea(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){ha(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#x(ji)):this.#u===0&&(this.#e.before(e),this.#c=null,Ma(this.#o,()=>{this.#o=null}),this.#x(ji))}}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Ea(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Ia(this.#a,e);let t=this.#n.pending;this.#o=Ea(()=>t(this.#e))}else this.#x(ji)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_reactions(this.#f)}defer_effect(e){Ree(e,this.#f)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=Ha,n=za,r=ci;Ua(this.#i),Va(this.#i),li(this.#i.ctx);try{return Bi.ensure(),e()}finally{Ua(t),Va(n),li(r)}}#C(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&Ma(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#C(e,t)}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!this.#p||this.#d||(this.#d=!0,gi(()=>{this.#d=!1,this.#p&&ea(this.#p,this.#l)}))}get_effect_pending(){return this.#m(),B(this.#p)}error(e){if(e===Gr||!this.#n.onerror&&!this.#n.failed)throw e;ji?.is_fork?(this.#a&&ji.skip_effect(this.#a),this.#o&&ji.skip_effect(this.#o),this.#s&&ji.skip_effect(this.#s),ji.oncommit(()=>{this.#v()||this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(ka(this.#a),null),this.#o&&=(ka(this.#o),null),this.#s&&=(ka(this.#s),null),Jr&&(Zr(this.#t),$r(),Zr(ei()));let t=this.#n.failed,n=e=>{if(this.#v())return;let{reset:n,invoke_onerror:r}=this.#_(e);r(),t&&!this.#v()&&(this.#s=this.#S(()=>{try{return Ea(()=>{var r=Ha;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return ha(e,this.#i.parent),null}}))};gi(()=>{if(!this.#v()){var t;try{t=this.transform_error(e)}catch(e){ha(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>ha(e,this.#i&&this.#i.parent)):n(t)}})}};function G(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[Vr]??=e.nodeValue)&&(e[Vr]=n,e.nodeValue=`${n}`)}function To(e,t){return Ote(e,t)}var Eo=new Map;function Ote(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){$ee();var c=void 0,l=rte(()=>{var o=n??t.appendChild(ca());wo(o,{pending:()=>{}},t=>{k({});var n=ci;if(a&&(n.c=a),i&&(r.$$events=i),Jr&&So(t,null),c=e(t,r)||fi(),Jr&&(Ha.nodes.end=Xr,Xr===null||Xr.nodeType!==8||Xr.data!==`]`))throw qr(),Gr;A()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=vte(r);for(let e of[t,document]){var a=Eo.get(e);a===void 0&&(a=new Map,Eo.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,xo,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(Er(fo)),po.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=Eo.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,xo),r.delete(e),r.size===0&&Eo.delete(n)):r.set(e,i)}po.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return Do.set(c,l),c}var Do=new WeakMap;function Oo(e,t){let n=Do.get(e);return n?(Do.delete(e),n(t)):Promise.resolve()}var ko=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Pa(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Pa(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(ka(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Ia(r,t),t.append(ca()),this.#n.set(e,{effect:r,fragment:t})}else ka(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Ma(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(ka(n.effect),this.#n.delete(e))};ensure(e,t){var n=ji,r=fa();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=ca();i.append(a),this.#n.set(e,{effect:Ea(()=>t(a)),fragment:i})}else this.#t.set(e,Ea(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else Jr&&(this.anchor=Xr),this.#a(n)}},Ao=0,jo=1,kte=2;function Mo(e,t,n,r,i){Jr&&Qr();var a=pi(),o=Kr,s=a?Xi(o):Zi(o,!1,!1),c=a?Xi(o):Zi(o,!1,!1),l=new ko(e);wa(()=>{var a=ji,o=t(),u=!1;let d=Jr&&hee(o)===(e.data===`[!`);if(d&&(Zr(ei()),Yr(!1)),hee(o)){var f=xi(),p=!1;let e=e=>{if(!u){p=!0,f(!1),ji===a&&a.deactivate(),Bi.ensure();try{e()}finally{Si(!1),Fi||Vi()}}};o.then(t=>{e(()=>{ea(s,t),l.ensure(jo,r&&(e=>r(e,s)))})},t=>{e(()=>{if(ea(c,t),l.ensure(kte,i&&(e=>i(e,c))),!i)throw c.v})}),Jr?l.ensure(Ao,n):gi(()=>{p||e(()=>{l.ensure(Ao,n)})})}else ea(s,o),l.ensure(jo,r&&(e=>r(e,s)));return d&&Yr(!0),()=>{u=!0}})}function K(e,t,n=!1){var r;Jr&&(r=Xr,Qr());var i=new ko(e),a=n?65536:0;function o(e,t){if(Jr){var n=ti(r);if(e!==parseInt(n.substring(1))){var a=ei();Zr(a),i.anchor=a,Yr(!1),i.ensure(e,t),Yr(!0);return}}i.ensure(e,t)}wa(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Ate=Symbol(`NaN`);function No(e,t,n){Jr&&Qr();var r=new ko(e),i=!pi();wa(()=>{var e=t();e!==e&&(e=Ate),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Po(e,t){Jr&&Zr(la(e)),Ca(()=>{var n=t();for(var r in n){var i=n[r];i==null||i===``?e.style.removeProperty(r):e.style.setProperty(r,i)}})}function Fo(e,t){return t}function jte(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Ma(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Io(e,Er(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;da(u),u.append(l),e.items.clear()}Io(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Io(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=33554432,Ia(a,document.createDocumentFragment())):ka(t[i],n)}}var Lo;function Ro(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=Jr?Zr(la(c)):c.appendChild(ca())}Jr&&Qr();var l=null,u=Ei(()=>{var e=n();return wr(e)?e:e==null?[]:Er(e)}),d=new Map,f=!0;function p(e){if(!(h.effect.f&16384)){h.pending.delete(e);var n=B(u);h.fallback=l,Mte(h,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=33554432,Bo(l,null,o)):Pa(l):Ma(l,()=>{l=null}))}}function m(e){h.pending.delete(e)}var h={effect:wa(()=>{var e=B(u),c=e.length;let h=!1;Jr&&ti(o)===`[!`!=(c===0)&&(o=ei(),Zr(o),Yr(!1),h=!0);for(var g=new Set,_=ji,v=fa(),y=0;y<c;y+=1){Jr&&Xr.nodeType===8&&Xr.data===`]`&&(o=Xr,h=!0,Yr(!1));var b=e[y],x=r(b,y),S=f?null:s.get(x);S?(S.v&&ea(S.v,b),S.i&&ea(S.i,y),v&&_.unskip_effect(S.e)):(S=Nte(s,f?o:Lo??=ca(),b,x,y,i,t,n),f||(S.e.f|=33554432),s.set(x,S)),g.add(x)}if(c===0&&a&&!l&&(f?l=Ea(()=>a(o)):(l=Ea(()=>a(Lo??=ca())),l.f|=33554432)),c>g.size&&Cee(``,``,``),Jr&&c>0&&Zr(ei()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(p),_.ondiscard(m)}else p(_)}h&&Yr(!0),B(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,Jr&&(o=Xr)}function zo(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Mte(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=zo(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(Pa(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432){if(g.f^=33554432,g===c)Bo(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Vo(e,u,g),Vo(e,g,v),Bo(g,v,n),u=g,f=[],p=[],c=zo(u.next);continue}}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],S=f[f.length-1];for(b=0;b<f.length;b+=1)Bo(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);Vo(e,x.prev,S.next),Vo(e,u,x),Vo(e,S,y),c=y,u=S,--_,f=[],p=[]}else l.delete(g),Bo(g,c,n),Vo(e,g.prev,g.next),Vo(e,g,u===null?e.effect.first:u.next),Vo(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=zo(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=zo(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Io(e,Er(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)g.f&8192||C.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=zo(c.next);var w=C.length;if(w>0){var T=r&4&&o===0?n:null;if(a){for(_=0;_<w;_+=1)C[_].nodes?.a?.measure();for(_=0;_<w;_+=1)C[_].nodes?.a?.fix()}jte(e,C,T)}}a&&gi(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Nte(e,t,n,r,i,a,o,s){var c=o&1?o&16?Xi(n):Zi(n,!1,!1):null,l=o&2?Xi(i):null;return{v:c,i:l,e:Ea(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Bo(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=ua(r);if(a.before(r),r===i)return;r=o}}function Vo(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ho(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;Jr&&(o=Zr(la(c)))}z(()=>{var e=Ha;if(s===(s=t()??``))Jr&&Qr();else if(n&&!Jr)e.nodes=null,c.innerHTML=s,s!==``&&So(la(c),c.lastChild);else if(e.nodes!==null&&(Aa(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(Jr){for(var a=Xr.data,l=Qr(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=ua(l);if(l===null)throw qr(),Gr;So(Xr,u),o=Zr(l)}else{var d=pa(r?`svg`:i?`math`:`template`,r?`http://www.w3.org/2000/svg`:i?`http://www.w3.org/1998/Math/MathML`:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(So(la(f),f.lastChild),r||i)for(;la(f);)o.before(la(f));else o.before(f)}}})}function Uo(e,t,...n){var r=new ko(e);wa(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},65536)}function Wo(e,t,n){var r;Jr&&(r=Xr,Qr());var i=new ko(e);wa(()=>{var e=t()??null;if(Jr&&ti(r)===`[`!=(e!==null)){var a=ei();Zr(a),i.anchor=a,Yr(!1),i.ensure(e,e&&(t=>n(t,e))),Yr(!0)}else i.ensure(e,e&&(t=>n(t,e)))},65536)}var Pte=()=>performance.now(),Go={tick:e=>requestAnimationFrame(e),now:()=>Pte(),tasks:new Set};function Ko(){let e=Go.now();Go.tasks.forEach(t=>{t.c(e)||(Go.tasks.delete(t),t.f())}),Go.tasks.size!==0&&Go.tick(Ko)}function Fte(e){let t;return Go.tasks.size===0&&Go.tick(Ko),{promise:new Promise(n=>{Go.tasks.add(t={c:e,f:n})}),abort(){Go.tasks.delete(t)}}}function Ite(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function qo(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=Ite(n.trim());t[i]=r.trim()}return t}var Lte=e=>e,Jo=null;function Yo(e){Jo=e}function Xo(e,t,n){var r=(Jo??Ha).nodes,i,a,o,s=null;r.a??={element:e,measure(){i=this.element.getBoundingClientRect()},apply(){if(o?.abort(),a=this.element.getBoundingClientRect(),i.left!==a.left||i.right!==a.right||i.top!==a.top||i.bottom!==a.bottom){let e=t()(this.element,{from:i,to:a},n?.());o=Zo(this.element,e,void 0,1,()=>{},()=>{o?.abort(),o=void 0})}},fix(){if(!e.getAnimations().length){var{position:t,width:n,height:r}=getComputedStyle(e);if(t!==`absolute`&&t!==`fixed`){var a=e.style;s={position:a.position,width:a.width,height:a.height,transform:a.transform},a.position=`absolute`,a.width=n,a.height=r;var o=e.getBoundingClientRect();if(i.left!==o.left||i.top!==o.top){var c=`translate(${i.left-o.left}px, ${i.top-o.top}px)`;a.transform=a.transform?`${a.transform} ${c}`:c}}}},unfix(){if(s){var t=e.style;t.position=s.position,t.width=s.width,t.height=s.height,t.transform=s.transform}}},r.a.element=e}function Zo(e,t,n,r,i,a){var o=r===1,s=!1;if(Ar(t)){var c;return gi(()=>{s||(c=Zo(e,t({direction:o?`in`:`out`}),n,r,i,a))}),{abort:()=>{s=!0,c?.abort()},deactivate:()=>c?.deactivate(),reset:()=>c?.reset(),t:()=>c?.t()??1-r}}if(n?.deactivate(),!t?.duration&&!t?.delay)return i(),a(),{abort:jr,deactivate:jr,reset:jr,t:()=>r};let{delay:l=0,css:u,tick:d,easing:f=Lte}=t;var p,m=()=>1-r;return gi(()=>{if(!s){var c=[];if(o&&n===void 0&&(d&&d(0,1),u)){var h=qo(u(0,1));c.push(h,h)}p=e.animate(c,{duration:l,fill:`forwards`}),p.onfinish=()=>{p.cancel(),i();var o=n?.t()??1-r;n?.abort();var s=r-o,c=t.duration*Math.abs(s),l=[];if(c>0){var h=!1;if(u)for(var g=Math.ceil(c/(1e3/60)),_=0;_<=g;_+=1){var v=o+s*f(_/g),y=qo(u(v,1-v));l.push(y),h||=y.overflow===`hidden`}h&&(e.style.overflow=`hidden`),m=()=>{var e=p.currentTime;return o+s*f(e/c)},d&&Fte(()=>{if(p.playState!==`running`)return!1;var e=m();return d(e,1-e),!0})}p=e.animate(l,{duration:c,fill:`forwards`}),p.onfinish=()=>{m=()=>r,d?.(r,1-r),a()}}}}),{abort:()=>{s=!0,p&&(p.cancel(),p.effect=null,p.onfinish=jr)},deactivate:()=>{a=jr},reset:()=>{r===0&&d?.(1,0)},t:()=>m()}}function Rte(e,t,n,r,i,a){let o=Jr;Jr&&Qr();var s=null;Jr&&Xr.nodeType===1&&(s=Xr,Qr());var c=Jr?Xr:e,l=Ha,u=new ko(c,!1);wa(()=>{let e=t()||null;var a=i?i():n||e===`svg`?`http://www.w3.org/2000/svg`:void 0;if(e===null)u.ensure(null,null);else return u.ensure(e,t=>{if(e){var n=Jr;if(s=Jr?s:pa(e,a),So(s,s),r){var i=null;Jr&&bte(e)&&s.append(i=document.createComment(``));var o=Jr?la(s):s.appendChild(ca());Jr&&(o===null?Yr(!1):Zr(o)),Yo(l),r(s,o),i?.remove(),Yo(null)}Ha.nodes.end=s,n||t.before(s)}Jr&&Zr(t)}),()=>{}},65536),va(()=>{}),o&&(Yr(!0),Zr(c))}function Qo(e,t){let n=null,r=Jr;var i;if(Jr){n=Xr;for(var a=la(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=ua(a);if(a===null)Yr(!1);else{var o=ua(a);a.remove(),Zr(o)}}Jr||(i=document.head.appendChild(ca()));try{wa(()=>{var e=Ea(()=>t(i));e.f|=262144,Jr||(e.nodes===null?e.nodes={start:i,end:i,a:null,t:null}:e.nodes.end=i)})}finally{r&&(Yr(!0),Zr(n))}}function q(e,t){Sa(()=>{e=Ha?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=pa(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function $o(e,t){var n=void 0,r;Ta(()=>{n!==(n=t())&&(r&&=(ka(r),null),n&&(r=Ea(()=>{Sa(()=>n(e))})))})}function es(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=es(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function zte(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=es(e))&&(r&&(r+=` `),r+=t);return r}function ts(e){return typeof e==`object`?zte(e):e??``}var Bte=[...`
|
||
\r\f\xA0\v`];function Vte(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Bte.includes(r[o-1]))&&(s===r.length||Bte.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Hte(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function ns(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Ute(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(ns)),i&&c.push(...Object.keys(i).map(ns));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=ns(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Hte(r)),i&&(n+=Hte(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function rs(e,t,n,r,i,a){var o=e[zr];if(Jr||o!==n||o===void 0){var s=Vte(n,r,a);Jr&&s===e.getAttribute(`class`)||(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[zr]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function is(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function as(e,t,n,r){var i=e[Br];if(Jr||i!==t){var a=Ute(t,r);Jr&&a===e.getAttribute(`style`)||(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[Br]=t}else r&&(Array.isArray(r)?(is(e,n?.[0],r[0]),is(e,n?.[1],r[1],`important`)):is(e,n,r));return r}function Wte(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function Gte(e,t){var n=!(`__defaultValue`in e);(n||e.__defaultValue!==t)&&(e.__defaultValue=t,Kte(e,!n||`__value`in e))}function Kte(e,t){var n=e.__defaultValue,r=e.multiple,i=r?n??[]:null;if(!r||wr(i)){var a=e.selectedIndex,o=t&&r?new Set(e.selectedOptions):null;for(var s of e.options){var c=ss(s);Wte(s,r?i.includes(c):Qee(c,n))}if(t){if(o!==null)for(s of e.options){var l=o.has(s);s.selected!==l&&(s.selected=l)}else e.selectedIndex!==a&&(e.selectedIndex=a)}}}function os(e,t,n=!1){if(e.multiple){if(t==null)return;if(!wr(t))return yee();for(var r of e.options)r.selected=t.includes(ss(r))}else{for(r of e.options)if(Qee(ss(r),t)){r.selected=!0;return}n&&t===void 0||(e.selectedIndex=-1)}}function qte(e){var t=new MutationObserver(t=>{t.every(Jte)||(`__defaultValue`in e&&Kte(e,!1),`__value`in e&&os(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),va(()=>{t.disconnect()})}function ss(e){return`__value`in e?e.__value:e.value}function Jte(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var cs=Symbol(`class`),ls=Symbol(`style`),Yte=Symbol(`is custom element`),Xte=Symbol(`is html`),Zte=Wr?`link`:`LINK`,Qte=Wr?`input`:`INPUT`,$te=Wr?`option`:`OPTION`,ene=Wr?`select`:`SELECT`,tne=Wr?`progress`:`PROGRESS`;function nne(e){if(Jr){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;J(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;J(e,`checked`,null),e.checked=r}}};e[Hr]=n,gi(n),Hee()}}function J(e,t,n,r){var i=ine(e);if(!(Jr&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Zte))){var a=i[t];a!==(i[t]=n)&&(t===`loading`&&(e[_ee]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&one(e).has(t)?e[t]=n:(!Jr||typeof n!=`number`&&typeof n!=`boolean`||a!==String(n))&&e.setAttribute(t,n))}}function rne(e,t,n,r,i=!1,a=!1){Jr&&i&&e.nodeName===Qte&&(`defaultValue`in n||`defaultChecked`in n||nne(e));var o=ine(e),s=o[Yte],c=!o[Xte];let l=Jr&&s;l&&Yr(!1);var u=t||{},d=e.nodeName===$te,f=e.nodeName===ene;try{for(var p in t)!(p in n)&&p[0]+p[1]!==`$$`&&(n[p]=null);n.class?n.class=ts(n.class):(r||n[cs])&&(n.class=null),n[ls]&&(n.style??=null);var m=one(e);if(e.nodeName===Qte&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==u.type||h===void 0&&e.hasAttribute(`type`))&&(u.type=h,J(e,`type`,h,a))}for(let i in n){let l=n[i];if(d&&i===`value`&&l==null)e.value=e.__value=``,u[i]=l;else if(i===`class`)rs(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,l,r,t?.[cs],n[cs]),u[i]=l,u[cs]=n[cs];else if(i===`style`)as(e,l,t?.[ls],n[ls]),u[i]=l,u[ls]=n[ls];else{var g=u[i];if(l!==g||l===void 0&&e.hasAttribute(i)){u[i]=l;var _=i[0]+i[1];if(_!==`$$`){if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=pte(r);if(dte(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(l!=null)continue;e.removeEventListener(r,u[n],t),u[n]=null}if(v)_o(r,e,l),vo([r]);else if(l!=null){function y(e){u[i].call(this,e)}u[n]=mo(r,e,y,t)}}else if(i===`style`)J(e,i,l);else if(i===`autofocus`)zee(e,!!l);else if(!s&&(i===`__value`||i===`value`&&l!=null))e.__value=l,(g==null||e.value!==l||l===0&&e.nodeName===tne)&&(e.value=l);else if(i===`selected`&&d)Wte(e,l);else{var b=i;c||(b=gte(b));var x=b===`defaultValue`||b===`defaultChecked`;if(f&&b===`defaultValue`)continue;if(l==null&&!s&&!x){if(o[i]=null,b===`value`||b===`checked`){let n=e,r=t===void 0;if(b===`value`){let e=n.defaultValue;n.removeAttribute(b),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(b),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i)}else x||(s||typeof l!=`string`)&&m.has(b)?(e[b]=l,b in o&&(o[b]=Kr)):typeof l!=`function`&&J(e,b,l,a)}}}}}}finally{l&&Yr(!0)}return u}function us(e,t,n=[],r=[],i=[],a,o=!1,s=!1){bi(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===ene,l=!1;if(Ta(()=>{var u=t(...n.map(B)),d=rne(e,r,u,a,o,s);if(l&&c){var f=e;`defaultValue`in u&&Gte(f,u.defaultValue),`value`in u&&os(f,u.value)}for(let e of Object.getOwnPropertySymbols(i))u[e]||ka(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var p=u[t];t.description!==`@attach`||r&&p===r[t]||(i[t]&&ka(i[t]),i[t]=Ea(()=>$o(e,()=>p))),d[t]=p}r=d}),c){var u=e;Sa(()=>{var e=r;`defaultValue`in e&&Gte(u,e.defaultValue),os(u,e.value,!0),qte(u)})}l=!0})}function ine(e){return e[Rr]??={[Yte]:e.nodeName.includes(`-`),[Xte]:e.namespaceURI===`http://www.w3.org/1999/xhtml`}}var ane=new Map;function one(e){var t=e.getAttribute(`is`)||e.nodeName,n=ane.get(t);if(n)return n;ane.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=dee(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=kr(i)}return n}function sne(e,t,n=t){var r=new WeakSet;Uee(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ds(e)?fs(a):a,n(a),ji!==null&&r.add(ji),await ao(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(Jr&&e.defaultValue!==e.value||co(t)==null&&e.value)&&(n(ds(e)?fs(e.value):e.value),ji!==null&&r.add(ji)),Ca(()=>{var n=t();if(e===document.activeElement){var i=ji;if(r.has(i))return}ds(e)&&n===fs(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function ds(e){var t=e.type;return t===`number`||t===`range`}function fs(e){return e===``?null:+e}var cne=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function lne(e,t,n){var r=cne.observe(e,()=>n(e[t]));Sa(()=>(co(()=>n(e[t])),r))}function ps(e,t){return e===t||e?.[Fr]===t}function ms(e=fi(),t,n,r){var i=ci.r,a=Ha;return Sa(()=>{var o,s;return Ca(()=>{o=s,s=r?.()||[],co(()=>{ps(n(...s),e)||(t(e,...s),o&&ps(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ps(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var hs=!1;function une(e){var t=hs;try{return hs=!1,[e(),hs]}finally{hs=t}}var dne={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return!e.exclude.has(t)&&t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function gs(e,t,n){return new Proxy({props:e,exclude:t},dne)}var fne={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Ar(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];Ar(i)&&(i=i());let a=Or(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Ar(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=Or(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===Fr||t===Lr)return!1;for(let n of e.props)if(Ar(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(Ar(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function _s(...e){return new Proxy({props:e},fne)}function Y(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=wi(r),B(l)):(c&&(c=!1,s=o?co(r):r),s);let d;if(a){var f=Fr in e||Lr in e;d=Or(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=une(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&Oee(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?wi:Ei)(()=>(_=!1,h()));a&&B(v);var y=Ha;return(function(e,t){if(arguments.length>0){let n=t?B(v):i&&a?na(e):e;return N(v,n),_=!0,s!==void 0&&(s=n),e}return La&&_||y.f&16384?v.v:B(v)})}function vs(e){ci===null&&ii(`onMount`),R(()=>{let t=co(e);if(typeof t==`function`)return t})}function ys(e){ci===null&&ii(`onDestroy`),vs(()=>()=>co(e))}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var bs=/^[\u061c\u200e\u200f\u2066-\u2069]+/,xs=/^[-.+0-9A-Z_a-z\u{a1}-\u{61b}\u{61d}-\u{167f}\u{1681}-\u{1fff}\u{200b}-\u{200d}\u{2010}-\u{2027}\u{2030}-\u{205e}\u{2060}-\u{2065}\u{206a}-\u{2fff}\u{3001}-\u{d7ff}\u{e000}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{1fffd}\u{20000}-\u{2fffd}\u{30000}-\u{3fffd}\u{40000}-\u{4fffd}\u{50000}-\u{5fffd}\u{60000}-\u{6fffd}\u{70000}-\u{7fffd}\u{80000}-\u{8fffd}\u{90000}-\u{9fffd}\u{a0000}-\u{afffd}\u{b0000}-\u{bfffd}\u{c0000}-\u{cfffd}\u{d0000}-\u{dfffd}\u{e0000}-\u{efffd}\u{f0000}-\u{ffffd}\u{100000}-\u{10fffd}]+/u,pne=/^[-.0-9]/;function mne(e,t){let n=t,r=e.slice(n).match(bs);r&&(n+=r[0].length);let i=e.slice(n).match(xs);if(!i)return null;let a=i[0];if(pne.test(a))return null;n+=a.length;let o=e.slice(n).match(bs);return o&&(n+=o[0].length),{value:a.normalize(),end:n}}var hne=(e,t)=>e.slice(t).match(xs)?.[0]??``,gne=Symbol.for(`CST`),Ss=class extends Error{type;constructor(e,t){super(t),this.type=e}},Cs=class extends Ss{start;end;constructor(e,t,n,r){let i=r?`Missing ${r}`:e;t>=0&&(i+=` at ${t}`),super(e,i),this.start=t,this.end=n??t+1}},_ne=class extends Cs{constructor(e,t){let{start:n,end:r}=t[gne]??{start:-1,end:-1};super(e,n,r)}},ws=class extends Ss{source;cause;constructor(e,t,n,r){super(e,t),this.source=n,r!==void 0&&(this.cause=r)}},Ts=class extends Ss{source;cause;constructor(e,t){super(e,t),this.source=`�`}},Es=new Set(``),Ds=new Set(`
|
||
\r `),Os,ks,As=(e,t)=>new Cs(`missing-syntax`,e,e+t.length,t),js=(...e)=>new Cs(...e);function Ms(e,t){if(ks.startsWith(e,Os))t&&(Os+=e.length);else throw As(Os,e)}function vne(e){Os=0,ks=e;let t=xne();if(ks.startsWith(`.match`,Os))return yne(t);let n=t.length>0||ks.startsWith(`{{`,Os);!n&&Os>0&&(Os=0);let r=Ns(n);if(n&&(Vs(),Os<ks.length))throw js(`extra-content`,Os,ks.length);return{type:`message`,declarations:t,pattern:r}}function yne(e){Os+=6,Vs(!0);let t=[];for(;ks[Os]===`$`;)t.push(Ls()),Vs(!0);if(t.length===0)throw js(`empty-token`,Os);let n=[];for(;Os<ks.length;)n.push(bne()),Vs();return{type:`select`,declarations:e,selectors:t,variants:n}}function bne(){let e=[];for(;Os<ks.length;){Vs(e.length?`{`:!1);let t=ks[Os];if(t===`{`)break;if(t===`*`)e.push({type:`*`}),Os+=1;else{let t=Rs(!0);t.value=t.value.normalize(),e.push(t)}}return{keys:e,value:Ns(!0)}}function Ns(e){if(e){if(ks.startsWith(`{{`,Os))Os+=2;else throw As(Os,`{{`)}let t=[];loop:for(;Os<ks.length;)switch(ks[Os]){case`{`:t.push(Ps(!0));break;case`}`:if(!e)throw js(`parse-error`,Os);break loop;default:t.push(Tne())}if(e){if(ks.startsWith(`}}`,Os))Os+=2;else throw As(Os,`}}`)}return t}function xne(){let e=[];Vs();loop:for(;ks[Os]===`.`;){switch(ks.substr(Os,6)){case`.input`:e.push(Sne());break;case`.local`:e.push(Cne());break;case`.match`:break loop;default:throw js(`parse-error`,Os)}Vs()}return e}function Sne(){Os+=6,Vs(),Ms(`{`,!1);let e=Os,t=Ps(!1);if(t.type===`expression`&&t.arg?.type===`variable`)return{type:`input`,name:t.arg.name,value:t};throw js(`bad-input-expression`,e,Os)}function Cne(){Os+=6,Vs(!0),Ms(`$`,!0);let e=Bs();return Vs(),Ms(`=`,!0),Vs(),Ms(`{`,!1),{type:`local`,name:e,value:Ps(!1)}}function Ps(e){let t=Os;Os+=1,Vs();let n=Is(!1);n&&Vs(`}`);let r=ks[Os],i,a;switch(r){case`@`:case`}`:break;case`:`:{Os+=1,i={type:`function`,name:zs()};let e=Fs();e&&(i.options=e);break}case`#`:case`/`:{if(n||!e)throw js(`parse-error`,Os);Os+=1,a={type:`markup`,kind:r===`#`?`open`:`close`,name:zs()};let t=Fs();t&&(a.options=t);break}default:throw js(`parse-error`,Os)}let o=wne();if(a?.kind===`open`&&ks[Os]===`/`&&(a.kind=`standalone`,Os+=1),Ms(`}`,!0),i){let e=n?{type:`expression`,arg:n,functionRef:i}:{type:`expression`,functionRef:i};return o&&(e.attributes=o),e}if(a)return o&&(a.attributes=o),a;if(!n)throw js(`empty-token`,t,Os);return o?{type:`expression`,arg:n,attributes:o}:{type:`expression`,arg:n}}function Fs(){Vs(`/}`);let e={},t=!0;for(;Os<ks.length;){let n=ks[Os];if(n===`@`||n===`/`||n===`}`)break;let r=Os,i=zs();if(Object.hasOwn(e,i))throw js(`duplicate-option-name`,r,Os);Vs(),Ms(`=`,!0),Vs(),e[i]=Is(!0),t=!1,Vs(`/}`)}return t?null:e}function wne(){let e={},t=!0;for(;ks[Os]===`@`;){let n=Os;Os+=1;let r=zs();if(Object.hasOwn(e,r))throw js(`duplicate-attribute`,n,Os);Vs(`=/}`),ks[Os]===`=`?(Os+=1,Vs(),e[r]=Rs(!0),Vs(`/}`)):e[r]=!0,t=!1}return t?null:e}function Tne(){let e=``,t=Os;loop:for(;t<ks.length;++t)switch(ks[t]){case`\\`:{let n=ks[t+1];if(!`\\{|}`.includes(n))throw js(`bad-escape`,t,t+2);e+=ks.substring(Os,t)+n,t+=1,Os=t+1;break}case`{`:case`}`:break loop}return e+=ks.substring(Os,t),Os=t,e}function Is(e){return ks[Os]===`$`?Ls():Rs(e)}function Ls(){return Os+=1,{type:`variable`,name:Bs()}}function Rs(e){if(ks[Os]===`|`)return Ene();let t=hne(ks,Os);if(t)return Os+=t.length,{type:`literal`,value:t};if(e)throw js(`empty-token`,Os)}function Ene(){Os+=1;let e=``;for(let t=Os;t<ks.length;++t)switch(ks[t]){case`\\`:{let n=ks[t+1];if(!`\\{|}`.includes(n))throw js(`bad-escape`,t,t+2);e+=ks.substring(Os,t)+n,t+=1,Os=t+1;break}case`|`:return e+=ks.substring(Os,t),Os=t+1,{type:`literal`,value:e}}throw As(ks.length,`|`)}function zs(){let e=Bs();return ks[Os]===`:`?(Os+=1,e+`:`+Bs()):e}function Bs(){let e=mne(ks,Os);if(!e)throw js(`empty-token`,Os);return Os=e.end,e.value}function Vs(e=!1){let t=ks[Os],n=!1;if(e){for(;Es.has(t);)t=ks[++Os];for(;Ds.has(t);)t=ks[++Os],n=!0}for(;Es.has(t)||Ds.has(t);)t=ks[++Os];if(e&&!n&&(e===!0||!e.includes(ks[Os])))throw As(Os,`' '`)}function Dne(e,t){let{node:n,pattern:r}=t,{functionRef:i=n,attributes:a=null,declaration:o=n,expression:s=n,key:c=n,markup:l=n,options:u=null,value:d=n,variant:f=n}=t,p=(e,t)=>{if(e){let n=u?.(e,t);if(d)for(let n of Object.values(e))d(n,t,`option`);n?.()}},m=(e,t)=>{if(e){let n=a?.(e,t);if(d)for(let n of Object.values(e))n!==!0&&d(n,t,`attribute`);n?.()}},h=(e,t)=>{if(typeof e==`object`){let n;switch(e.type){case`expression`:if(n=s?.(e,t),e.arg&&d?.(e.arg,t,`arg`),e.functionRef){let n=i?.(e.functionRef,t,e.arg);p(e.functionRef.options,t),n?.()}m(e.attributes,t);break;case`markup`:n=l?.(e,t),p(e.options,t),m(e.attributes,t)}n?.()}},g=e=>{let t=r?.(e);for(let t of e)h(t,`placeholder`);t?.()};for(let t of e.declarations){let e=o?.(t);t.value&&h(t.value,`declaration`),e?.()}if(e.type===`message`)g(e.pattern);else{if(d)for(let t of e.selectors)d(t,`selector`,`arg`);for(let t of e.variants){let e=f?.(t);c&&t.keys.forEach(c),g(t.value),e?.()}}}function One(e,t=(e,t)=>{throw new _ne(e,t)}){let n=0,r=null,i=new Set,a=new Set,o=new Set,s=new Set,c=new Set,l=new Set,u=!0;Dne(e,{declaration(e){if(e.name)return(e.value.functionRef||e.type===`local`&&e.value.arg?.type===`variable`&&i.has(e.value.arg.name))&&i.add(e.name),e.type===`local`&&s.add(e.name),u=e.type===`local`,()=>{a.has(e.name)?t(`duplicate-declaration`,e):a.add(e.name)}},expression({functionRef:e}){e&&o.add(e.name)},value(e,o,s){if(e.type===`variable`)switch(c.add(e.name),o){case`declaration`:(s!==`arg`||u)&&a.add(e.name);break;case`selector`:n+=1,r=e,i.has(e.name)||t(`missing-selector-annotation`,e)}},variant(e){let{keys:i}=e;i.length!==n&&t(`key-mismatch`,e);let a=JSON.stringify(i.map(e=>e.type===`literal`?e.value:0));l.has(a)?t(`duplicate-variant`,e):l.add(a),r&&=i.every(e=>e.type===`*`)?null:e}}),r&&t(`missing-fallback`,r);for(let e of s)c.delete(e);return{functions:o,variables:c}}var kne=`Adlm,Arab,Hebr,Mand,Nkoo,Rohg,Syrc,Thaa`;function Hs(e){if(e)try{typeof e==`string`&&(e=new Intl.Locale(e));let t=e.getTextInfo?.()??e.textInfo;if(t?.direction)return t.direction;let n=e.maximize().script;if(n)return kne.includes(n)?`rtl`:`ltr`}catch{}return`auto`}function Ane(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`boolean`)return e;if(e&&typeof e==`object`&&(e=String(e)),e===`true`)return!0;if(e===`false`)return!1;throw RangeError(`Not a boolean`)}function Us(e){if(e&&typeof e==`object`&&(e=e.valueOf()),e&&typeof e==`object`&&(e=String(e)),typeof e==`string`&&/^(0|[1-9][0-9]*)$/.test(e)&&(e=Number(e)),typeof e==`number`&&e>=0&&Number.isInteger(e))return e;throw RangeError(`Not a positive integer`)}function Ws(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`string`)return e;if(e&&typeof e==`object`)return String(e);throw RangeError(`Not a string`)}function Gs(e){let t;if(typeof e==`object`){let n=e?.valueOf;typeof n==`function`&&(t=e.options,e=n.call(e))}if(typeof e==`string`)try{e=JSON.parse(e)}catch{}if(typeof e!=`bigint`&&typeof e!=`number`)throw new Ts(`bad-operand`,`Input is not numeric`);return{value:e,options:t}}function Ks(e,t,n,r){let{dir:i,locales:a}=e;n.useGrouping===`never`&&(n.useGrouping=!1),r&&`select`in n&&!e.literalOptionKeys.has(`select`)&&(e.onError(`bad-option`,`The option select may only be set by a literal value`),r=!1);let o,s,c,l;return{type:`number`,get dir(){return i??=(o??=Intl.NumberFormat.supportedLocalesOf(a,n)[0],Hs(o)),i},get options(){return{...n}},selectKey:r?e=>{let r=t;n.style===`percent`&&(r*=typeof r==`bigint`?100n:100);let i=String(r);if(e.has(i))return i;if(n.select===`exact`)return null;let o=n.select?{...n,select:void 0,type:n.select}:n;return c??=new Intl.PluralRules(a,o).select(Number(r)),e.has(c)?c:null}:void 0,toParts(){s??=new Intl.NumberFormat(a,n);let e=s.formatToParts(t);return o??=s.resolvedOptions().locale,i??=Hs(o),i===`ltr`||i===`rtl`?[{type:`number`,dir:i,locale:o,parts:e}]:[{type:`number`,locale:o,parts:e}]},toString(){return s??=new Intl.NumberFormat(a,n),l??=s.format(t),l},valueOf:()=>t}}function qs(e,t,n){let r=Gs(n),i=r.value,a=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:a[n]=Us(r);break;case`roundingMode`:case`roundingPriority`:case`select`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:a[n]=Ws(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :number option ${n}`)}return Ks(e,i,a,!0)}function jne(e,t,n){let r=Gs(n),i=Number.isFinite(r.value)?Math.round(r.value):r.value,a=Object.assign({},r.options,{maximumFractionDigits:0,minimumFractionDigits:void 0,minimumSignificantDigits:void 0,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`maximumSignificantDigits`:a[n]=Us(r);break;case`select`:case`signDisplay`:case`useGrouping`:a[n]=Ws(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :integer option ${n}`)}return Ks(e,i,a,!0)}function Mne(e,t,n){let r=Gs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`currency`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`currency`:case`currencySign`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Ws(r);break;case`minimumIntegerDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Us(r);break;case`currencyDisplay`:{let t=Ws(r);t===`never`?e.onError(`unsupported-operation`,`Currency display "never" is not yet supported`):i[n]=t;break}case`fractionDigits`:{let e=Ws(r);if(e===`auto`)i.minimumFractionDigits=void 0,i.maximumFractionDigits=void 0;else{let t=Us(e);i.minimumFractionDigits=t,i.maximumFractionDigits=t}break}}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.currency)throw new Ts(`bad-operand`,`A currency code is required for :currency`);return Ks(e,r.value,i,!1)}var Nne=new Set([`weekday`,`day-weekday`,`month-day`,`month-day-weekday`,`year-month-day`,`year-month-day-weekday`]),Pne=new Set([`long`,`medium`,`short`]),Fne=new Set([`hour`,`minute`,`second`]),Ine=new Set([`long`,`short`]),Lne=(e,t,n)=>Js(`datetime`,e,t,n),Rne=(e,t,n)=>Js(`date`,e,t,n),zne=(e,t,n)=>Js(`time`,e,t,n);function Js(e,t,n,r){let i={localeMatcher:t.localeMatcher},a=r;if(typeof a==`object`&&a){let t=a.options;t&&(i.calendar=t.calendar,e!==`date`&&(i.hour12=t.hour12),i.timeZone=t.timeZone),typeof a.valueOf==`function`&&(a=a.valueOf())}switch(typeof a){case`number`:case`string`:a=new Date(a)}if(!(a instanceof Date)||isNaN(a.getTime()))throw new Ts(`bad-operand`,`Input is not a valid date`);if(n.calendar!==void 0)try{i.calendar=Ws(n.calendar)}catch{t.onError(`bad-option`,`Invalid :${e} calendar option value`)}if(n.hour12!==void 0&&e!==`date`)try{i.hour12=Ane(n.hour12)}catch{t.onError(`bad-option`,`Invalid :${e} hour12 option value`)}if(n.timeZone!==void 0){let r;try{r=Ws(n.timeZone)}catch{t.onError(`bad-option`,`Invalid :${e} timeZone option value`)}if(r===`input`)i.timeZone===void 0&&t.onError(`bad-operand`,`Missing input timeZone value for :${e}`);else if(r!==void 0){if(i.timeZone!==void 0&&r!==i.timeZone)throw new Ts(`bad-option`,`Time zone conversion is not supported`);i.timeZone=r}}if(e!==`time`){let r=e===`date`?`fields`:`dateFields`,a=e===`date`?`length`:`dateLength`,o=Ys(t,n,r,Nne)??`year-month-day`,s=Ys(t,n,a,Pne),c=new Set(o.split(`-`));c.has(`year`)&&(i.year=`numeric`),c.has(`month`)&&(i.month=s===`long`?`long`:s===`short`?`numeric`:`short`),c.has(`day`)&&(i.day=`numeric`),c.has(`weekday`)&&(i.weekday=s===`long`?`long`:`short`)}if(e!==`date`){switch(Ys(t,n,e===`time`?`precision`:`timePrecision`,Fne)){case`hour`:i.hour=`numeric`;break;case`second`:i.hour=`numeric`,i.minute=`numeric`,i.second=`numeric`;break;default:i.hour=`numeric`,i.minute=`numeric`}i.timeZoneName=Ys(t,n,`timeZoneStyle`,Ine)}let o=new Intl.DateTimeFormat(t.locales,i),s=t.dir,c,l;return{type:`datetime`,get dir(){return s??=(c??=o.resolvedOptions().locale,Hs(c)),s},get options(){return{...i}},toParts(){let e=o.formatToParts(a);return c??=o.resolvedOptions().locale,s??=Hs(c),s===`ltr`||s===`rtl`?[{type:`datetime`,dir:s,locale:c,parts:e}]:[{type:`datetime`,locale:c,parts:e}]},toString(){return l??=o.format(a),l},valueOf:()=>a}}function Ys(e,t,n,r){let i=t[n];if(i!==void 0)try{let e=Ws(i);if(r&&!r.has(e))throw Error();return e}catch{e.onError(`bad-option`,`Invalid value for ${n} option`)}}function Bne(e,t,n){let{value:r,options:i}=Gs(n),a;try{a=`add`in t?Us(t.add):-1}catch{throw new Ts(`bad-option`,`Value ${t.add} is not valid for :offset option add`)}let o;try{o=`subtract`in t?Us(t.subtract):-1}catch{throw new Ts(`bad-option`,`Value ${t.subtract} is not valid for :offset option subtract`)}if(a<0==o<0)throw new Ts(`bad-option`,`Exactly one of "add" or "subtract" is required as an :offset option`);let s=a<0?-o:a;return r+=typeof r==`number`?s:BigInt(s),qs(e,{},{valueOf:()=>r,options:i})}function Vne(e,t,n){let r=Gs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`percent`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`roundingMode`:case`roundingPriority`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Ws(r);break;case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:i[n]=Us(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :percent option ${n}`)}return Ks(e,r.value,i,!0)}function Xs(e,t,n){let r=n===void 0?``:String(n),i=r.normalize();return{type:`string`,dir:e.dir??`auto`,selectKey:e=>e.has(i)?i:null,toParts(){let{dir:t}=e,n=e.locales[0];return t===`ltr`||t===`rtl`?[{type:`string`,dir:t,locale:n,value:r}]:[{type:`string`,locale:n,value:r}]},toString:()=>r,valueOf:()=>r}}function Hne(e,t,n){let r=Gs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`unit`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`signDisplay`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`unit`:case`unitDisplay`:case`useGrouping`:i[n]=Ws(r);break;case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Us(r)}}catch(t){t instanceof Ss?e.onError(t):e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.unit)throw new Ts(`bad-operand`,`A unit identifier is required for :unit`);return Ks(e,r.value,i,!1)}var Zs={currency:Mne,integer:jne,number:qs,offset:Bne,percent:Vne,string:Xs};Zs=Object.freeze(Object.assign(Object.create(null),Zs));var Qs={date:Rne,datetime:Lne,time:zne,unit:Hne};Qs=Object.freeze(Object.assign(Object.create(null),Qs));var $s=Symbol(`bidi-isolate`),ec=(e=`�`)=>({type:`fallback`,source:e,toParts:()=>[{type:`fallback`,source:e}],toString:()=>`{${e}}`}),Une=(e,t)=>({type:`unknown`,source:e,dir:`auto`,toParts:()=>[{type:`unknown`,value:t}],toString:()=>String(t),valueOf:()=>t}),tc=class{#e;#t;#n;dir;id;constructor(e,t,n){this.#e=e,this.#n=t,this.dir=void 0;let r=n&&Object.hasOwn(n,`u:dir`)?n[`u:dir`]:void 0;if(r){let t=String(sc(e,r));if(t===`ltr`||t===`rtl`||t===`auto`)this.dir=t;else if(t!==`inherit`){let t=new Ts(`bad-option`,`Unsupported value for u:dir option`);t.source=cc(r),e.onError(t)}}let i=n&&Object.hasOwn(n,`u:id`)?n[`u:id`]:void 0;if(this.id=i?String(sc(e,i)):void 0,n){this.#t=new Set;for(let[e,t]of Object.entries(n))t.type===`literal`&&this.#t.add(e)}}get literalOptionKeys(){return new Set(this.#t)}get localeMatcher(){return this.#e.localeMatcher}get locales(){return this.#e.locales.map(String)}onError(e,t){let n;e instanceof Ts?n=e:typeof e==`string`&&typeof t==`string`?n=new Ts(e,t):(n=new Ts(`function-error`,String(e)),n.cause=e),n.source=this.#n,this.#e.onError(n)}};function Wne(e,t,{name:n,options:r}){let i=`:${n}`,a=cc(t)??i;try{let o=t?[sc(e,t)]:[],s=e.functions[n];if(!s)throw new ws(`unknown-function`,`Unknown function ${i}`,a);let c=new tc(e,a,r),l=s(c,Gne(e,r),...o);if(typeof l!=`object`||!l||typeof l.type!=`string`)throw new ws(`bad-function-result`,`Function ${i} did not return a MessageValue`,a);let u={source:a};return c.dir&&(u.dir=c.dir,u[$s]=!0),c.id&&typeof l.toParts==`function`&&(u.toParts=()=>{let e=l.toParts();for(let t of e)t.id=c.id;return e}),{...l,...u}}catch(t){return e.onError(t instanceof Ss?t:new ws(`bad-function-result`,String(t),a,t)),ec(a)}}function Gne(e,t){let n=Object.create(null);if(t)for(let[r,i]of Object.entries(t))r.startsWith(`u:`)||(n[r]=sc(e,i));return n}function nc(e,{arg:t,functionRef:n}){if(n)return Wne(e,t,n);switch(t?.type){case`literal`:{let n=`|${t.value}|`,r=Xs(new tc(e,n),{},t.value);return r.source=n,r}case`variable`:return oc(e,t);default:throw Error(`Unsupported expression: ${t?.type}`)}}var rc=class{expression;scope;constructor(e,t){this.expression=e,this.scope=t}},Kne=e=>e!==null&&(typeof e==`object`||typeof e==`function`);function ic(e,t){if(Kne(e)){if(t in e)return e[t];let n=t.split(`.`);for(let t=n.length-1;t>0;--t){let r=n.slice(0,t).join(`.`);if(r in e){let i=n.slice(t).join(`.`);return ic(e[r],i)}}for(let[n,r]of Object.entries(e))if(n.normalize()===t)return r}}function ac(e,{name:t}){let n=ic(e.scope,t);if(n===void 0){let n=`$`+t,r=`Variable not available: ${n}`;e.onError(new ws(`unresolved-variable`,r,n))}else if(n instanceof rc){let r=nc(n.scope?{...e,scope:n.scope}:e,n.expression);return e.scope[t]=r,e.localVars.add(r),r}return n}function oc(e,t){let n=`$`+t.name,r=ac(e,t);if(r===void 0)return ec(n);let i=typeof r;if(i===`object`){let t=r;if(t.type===`fallback`)return ec(n);if(e.localVars.has(t))return t.source=n,t;r instanceof Number?i=`number`:r instanceof String&&(i=`string`)}let a;switch(i){case`bigint`:case`number`:a=e.functions.number;break;case`string`:a=e.functions.string;break;default:return Une(n,r)}let o=new tc(e,n),s=a(o,{},r);return s.source=n,s}function sc(e,t){switch(t.type){case`literal`:return t.value;case`variable`:return ac(e,t);default:throw Error(`Unsupported value: ${t.type}`)}}function cc(e){switch(e?.type){case`literal`:return`|`+e.value.replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`)+`|`;case`variable`:return`$`+e.name;default:return}}function lc(e,{kind:t,name:n,options:r}){let i={type:`markup`,kind:t,name:n},a=r?Object.entries(r):null;if(a?.length){i.options={};for(let[t,n]of a)if(t===`u:dir`){let r=new Ts(`bad-option`,`The option ${t} is not valid for markup`);r.source=cc(n),e.onError(r)}else{let r=sc(e,n);typeof r==`object`&&typeof r?.valueOf==`function`&&(r=r.valueOf()),t===`u:id`?i.id=String(r):i.options[t]=r}}return i}function uc(e,t){if(t.type===`message`)return t.pattern;let n=t.selectors.map(t=>{let n=oc(e,t),r;return typeof n.selectKey==`function`?r=n.selectKey.bind(n):(e.onError(new ws(`bad-selector`,`Selector does not support selection`,n.source)),r=()=>null),{selectKey:r,source:n.source,best:null,keys:null}}),r=t.variants;loop:for(let i=0;i<n.length;++i){let a=n[i];if(!a.keys){a.keys=new Set;for(let{keys:e}of r){let t=e[i];if(!t)break loop;t.type!==`*`&&a.keys.add(t.value)}}try{a.best=a.keys.size?a.selectKey(a.keys):null}catch(t){e.onError(new ws(`bad-selector`,`Selection failed`,a.source,t)),a.selectKey=()=>null,a.best=null}if(r=r.filter(e=>{let t=e.keys[i];return t.type===`*`?a.best==null:a.best===t.value}),r.length===0){if(i===0)break;let e=n[i-1];e.best==null?e.keys?.clear():e.keys?.delete(e.best);for(let e=i;e<n.length;++e)n[e].keys=null;r=t.variants,i=-1}}let i=r[0];return i?i.value:(e.onError(new ws(`no-match`,`No variant was selected!?`,`.match`)),[])}Intl.MessageFormat??=class{#e;#t;#n;#r;#i;#a;constructor(e,t,n){this.#e=n?.bidiIsolation!==`none`,this.#n=n?.localeMatcher??`best fit`,this.#r=Array.isArray(e)?e.map(e=>new Intl.Locale(e)):e?[new Intl.Locale(e)]:[],this.#t=n?.dir??Hs(this.#r[0]),this.#i=typeof t==`string`?vne(t):t,One(this.#i),this.#a=n?.functions?Object.assign(Object.create(null),Zs,n.functions):Zs}format(e,t){let n=this.#o(e,t),r=``;for(let e of uc(n,this.#i))if(typeof e==`string`)r+=e;else if(e.type===`markup`)lc(n,e);else{let t;try{if(t=nc(n,e),typeof t.toString==`function`){if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[$s])){let e=t.dir===`ltr`?``:t.dir===`rtl`?``:``;r+=e+t.toString()+``}else r+=t.toString()}else{let e=new Ts(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i=`{${t?.source??`�`}}`;r+=this.#e?``+i+``:i}}return r}formatToParts(e,t){let n=this.#o(e,t),r=[];for(let e of uc(n,this.#i))if(typeof e==`string`)r.push({type:`text`,value:e});else if(e.type===`markup`)r.push(lc(n,e));else{let t;try{if(t=nc(n,e),typeof t.toParts==`function`){let e=t.toParts();if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[$s])){let n=t.dir===`ltr`?``:t.dir===`rtl`?``:``;r.push({type:`bidiIsolation`,value:n},...e,{type:`bidiIsolation`,value:``})}else r.push(...e)}else{let e=new Ts(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i={type:`fallback`,source:t?.source??`�`};this.#e?r.push({type:`bidiIsolation`,value:``},i,{type:`bidiIsolation`,value:``}):r.push(i)}}return r}#o(e,t=e=>{try{process.emitWarning(e)}catch{console.warn(e)}}){let n={...e};for(let t of this.#i.declarations)n[t.name]=new rc(t.value,t.type===`input`?e??{}:void 0);return{onError:t,localeMatcher:this.#n,locales:this.#r,localVars:new WeakSet,functions:this.#a,scope:n}}};var dc=M(``),fc=``,pc=na([]),mc=na({}),hc=``,gc=``,_c,vc={},qne={},yc,bc=(e,t)=>{if(typeof t!=`string`||!t)throw TypeError(`${e} must be a non-empty string (got ${JSON.stringify(t)})`)},xc=(e,t)=>{if(typeof t!=`string`)throw TypeError(`${e} must be a string (got ${typeof t})`)},Sc=(e,t)=>{if(typeof t!=`function`)throw TypeError(`${e} must be a function (got ${typeof t})`)},Cc=new Map,wc=e=>{if(!Cc.has(e))try{let t=new Intl.Locale(e),{language:n,script:r,region:i}=t,a=r&&i?void 0:t.maximize();Cc.set(e,{language:n,script:r??a?.script,region:i,preferredRegion:i??a?.region,anyScript:!r&&!i})}catch{Cc.set(e,void 0)}return Cc.get(e)},Tc=(e,t)=>{if(!e||!t.length||t.includes(e))return e;let n=wc(e);if(!n)return e;let{language:r,script:i,anyScript:a,preferredRegion:o}=n,s=t.filter(e=>{let t=wc(e);return!!t&&t.language===r&&(a||t.script===i)});if(s.length<2)return s[0]??e;let c=e=>e?s.find(t=>wc(t)?.region===e):void 0;return c(o)??c(wc(r)?.preferredRegion)??s[0]},Ec=(e,t=``)=>Object.entries(e).reduce((e,[n,r])=>{let i=t?`${t}.${n}`:n;return typeof r==`object`&&r&&!Array.isArray(r)?Object.assign(e,Ec(r,i)):e[i]=r,e},Object.create(null)),Dc=e=>{pc.includes(e)||(pc.push(e),gc=Tc(hc,pc))},Oc=e=>{if(!e||!pc.length)return e;let t=Tc(e,pc);return!pc.includes(t)&&gc&&pc.includes(gc)?gc:t},kc=()=>{fc&&Oc(fc)!==B(dc)&&Fc.set(fc)},Ac=(e,...t)=>{bc(`addMessages: localeCode`,e),t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`addMessages: maps[${t}] must be a plain object (got ${Array.isArray(e)?`array`:typeof e})`)}),Dc(e),mc[e]??={};let n=mc[e],r={...are,...qne};t.forEach(t=>{Object.entries(Ec(t)).forEach(([t,i])=>{n[t]=new Intl.MessageFormat(e,String(i),{functions:r})})}),kc()},jc=new Map,Mc=new Map,Nc=(e=B(dc))=>{if(xc(`waitLocale: localeCode`,e),!e)return Promise.resolve();let t=Mc.get(e);if(!t){let n=jc.get(e);t=n?Promise.resolve(n()).then(t=>{Ac(e,t)},()=>{if(Mc.delete(e),B(dc)===e&&!mc[e]&&gc&&gc!==e)return Fc.set(gc)}):Promise.resolve(),Mc.set(e,t)}return t},Pc=(e=B(dc))=>Hs(e)===`rtl`,Fc={get current(){return B(dc)},set(e){xc(`locale.set: value`,e),fc=e;let t=Oc(e);if(N(dc,t,!0),typeof document<`u`&&t){document.documentElement.lang=t;let e=Hs(t);e!==`auto`&&(document.documentElement.dir=e)}return Nc(t)}},Jne=(e,t)=>{bc(`register: localeCode`,e),Sc(`register: loader`,t),jc.set(e,t),Mc.delete(e),Dc(e),kc()},Yne=()=>{if(typeof navigator>`u`)return;let e=navigator.languages?.length?navigator.languages:[navigator.language];return e.map(e=>Tc(e,pc)).find(e=>pc.includes(e))??e[0]},Xne=e=>{if(!e||typeof e.fallbackLocale!=`string`)throw TypeError(`init: fallbackLocale must be a string (got ${JSON.stringify(e?.fallbackLocale)})`);e.initialLocale!==void 0&&xc(`init: initialLocale`,e.initialLocale),e.handleMissingMessage!==void 0&&Sc(`init: handleMissingMessage`,e.handleMissingMessage),hc=e.fallbackLocale,gc=Tc(hc,pc),_c=e.handleMissingMessage,vc=e.formats??{},e.initialLocale&&Fc.set(e.initialLocale)},Zne=(e,t)=>{let n=mc[e];return n&&Object.hasOwn(n,t)?n[t]:void 0},Qne=e=>{let t=e??B(dc);return t===gc?[t]:[t,gc]},X=(e,{values:t={},locale:n,default:r,formats:i}={})=>{if(e==null)throw TypeError(`format: key must be a string or message object (got ${JSON.stringify(e)})`);if(typeof e==`object`){let{id:t,...n}=e;return X(t,n)}let a=Qne(n),[o]=a,s=a.reduce((t,n)=>t??Zne(n,e),void 0);yc=i;let c;try{c=s?.format(t)}finally{yc=void 0}if(c!==void 0)return c;if(_c){let t=_c(e,o,r);if(t!==void 0)return t}return r??e},$ne=`_default`,ere={date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}},number:{currency:{style:`currency`},percent:{style:`percent`},scientific:{notation:`scientific`},engineering:{notation:`engineering`},compactLong:{notation:`compact`,compactDisplay:`long`},compactShort:{notation:`compact`,compactDisplay:`short`}}},tre=(e,t)=>vc[e]?.[t]??ere[e]?.[t],nre=e=>vc[e]?.[$ne],rre=e=>{let t=yc?.[e];return(typeof t==`string`?tre(e,t):t)??nre(e)},ire=(e,t,n)=>{let r=e.valueOf();return{...e,dir:n?Hs(n):e.dir,toString:()=>t.format(r)}},Ic=(e,t,n)=>(r,i,a)=>{let o=e(r,i,a),s=rre(t);if(!s)return o;let{locale:c,...l}=s;return ire(o,new n(c??r.locales,l),c)},are={...Qs,date:Ic(Qs.date,`date`,Intl.DateTimeFormat),time:Ic(Qs.time,`time`,Intl.DateTimeFormat),datetime:Ic(Qs.datetime,`datetime`,Intl.DateTimeFormat),number:Ic(Zs.number,`number`,Intl.NumberFormat),integer:Ic(Zs.integer,`number`,Intl.NumberFormat)},ore=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`name`]),sre=V(`<span> </span>`),cre={hash:`svelte-mf9rjk`,code:`.icon.small-arrow.svelte-mf9rjk {overflow:hidden;width:12px;text-indent:-6px;}`};function Lc(e,t){q(e,cre);let n=gs(t,ore);var r=sre();us(r,()=>({...n,class:`sui icon material-symbols-outlined ${t.class??``}`,"aria-hidden":!(`aria-label`in n)}),void 0,void 0,void 0,`svelte-mf9rjk`);var i=I(r,!0);z(()=>G(i,t.name)),W(e,r)}var lre=V(`<!> <span class="status-label svelte-wvtm40"> </span> <!>`,1),ure={hash:`svelte-wvtm40`,code:`.status-label.svelte-wvtm40 {position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;}`};function Rc(e,t){k(t,!0),q(e,ure);let n=Y(t,`children`,3,void 0),r=Y(t,`icon`,3,void 0);var i=lre(),a=F(i),o=e=>{var t=U();Uo(F(t),r),W(e,t)},s=e=>{{let n=j(()=>t.status===`success`?`check_circle`:t.status);Lc(e,{get name(){return B(n)}})}};K(a,e=>{r()?e(o):e(s,-1)});var c=L(a,2),l=I(c,!0);Uo(L(c,2),()=>n()??jr),z(e=>G(l,e),[()=>X(`_sui.alert.${t.status}`)]),W(e,i),A()}var zc=e=>e===`error`||e===`warning`?`alert`:`status`,Bc=(e,t)=>t??(e===`alert`?`assertive`:`polite`),dre=new Set([`$$slots`,`$$events`,`$$legacy`,`status`,`ariaLive`,`children`,`icon`]),fre=V(`<div><!></div>`),pre={hash:`svelte-1hkiqb4`,code:`.alert.svelte-1hkiqb4 {display:flex;align-items:center;gap:var(--gap, 8px);padding:var(--padding, 8px);border-width:var(--border-width, var(--sui-control-medium-border-width));border-style:var(--border-style, solid);border-radius:var(--border-radius, var(--sui-control-medium-border-radius));font-size:var(--font-size, var(--sui-font-size-default));}.alert.error.svelte-1hkiqb4 {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.alert.warning.svelte-1hkiqb4 {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.alert.info.svelte-1hkiqb4 {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.alert.success.svelte-1hkiqb4 {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}`};function Vc(e,t){k(t,!0),q(e,pre);let n=Y(t,`ariaLive`,3,void 0),r=gs(t,dre),i=j(()=>zc(t.status));var a=fre();us(a,e=>({...r,role:B(i),class:`sui alert ${t.status??``}`,"aria-live":e}),[()=>Bc(B(i),n())],void 0,void 0,`svelte-1hkiqb4`),Rc(P(a),{get status(){return t.status},get children(){return t.children},get icon(){return t.icon}}),O(a),W(e,a),A()}var Hc,Uc=()=>(Hc??=navigator.userAgentData?.platform===`macOS`||navigator.platform.startsWith(`Mac`),Hc),mre=new Set([`Ctrl`,`Meta`,`Alt`,`Shift`]),hre=new Set([`Control`,`Meta`,`Alt`,`Shift`]),gre=new Set([`Space`,`Enter`,`Escape`,`Tab`,`Backspace`,`Delete`,`Insert`,`Home`,`End`,`PageUp`,`PageDown`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,...Array.from({length:24},(e,t)=>`F${t+1}`)]),_re=e=>{if(/^\d$/.test(e)){let t=`Digit${e}`;return({code:e})=>e===t}if(gre.has(e)){let t=e===`Space`?` `:e;return({key:n,code:r})=>r===e||n===t}let t=e.toLowerCase();if(/^[a-z]$/i.test(e)){let n=`Key${e.toUpperCase()}`;return e=>{let{key:r,code:i}=e;return(r===`Dead`||r.length===1&&r.charCodeAt(0)>127)&&(Uc()||!e.getModifierState?.(`AltGraph`))?i===n:t===r.toLowerCase()}}return({key:e})=>t===e.toLowerCase()},Wc=e=>e.replace(/\bAccel\b/g,Uc()?`Meta`:`Ctrl`),Gc=new Map,Kc=e=>{let t=Gc.get(e);return t||(t=Wc(e).trim().split(/\s+/).filter(Boolean).map(e=>{let t=e.split(`+`).map(e=>e===`Control`?`Ctrl`:e);return{ctrl:t.includes(`Ctrl`),meta:t.includes(`Meta`),alt:t.includes(`Alt`),shift:t.includes(`Shift`),matchers:t.filter(e=>!mre.has(e)).map(_re)}}),Gc.set(e,t)),t},vre=(e,t)=>{let{ctrlKey:n,metaKey:r,altKey:i,shiftKey:a,key:o,code:s}=e;return!o&&!s||e.isComposing||e.keyCode===229?!1:t.some(({ctrl:t,meta:s,alt:c,shift:l,matchers:u})=>t===n&&s===r&&c===i&&l===a&&(u.length?u.every(t=>t(e)):hre.has(o)))},qc=(e,t)=>vre(e,Kc(t)),Jc=new Map,yre=(e,t)=>{let{disabled:n}=e;if(!e.getClientRects().length)return;let{top:r,left:i}=e.getBoundingClientRect();n&&e.style.setProperty(`pointer-events`,`auto`);let a=document.elementsFromPoint(i+4,r+4).includes(e);n&&e.style.removeProperty(`pointer-events`),a&&(t.preventDefault(),n||(e.focus(),e.click()))},bre=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]),xre=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&!bre.has(e.type)),Sre=e=>Uc()&&e.altKey&&!e.ctrlKey&&!e.metaKey&&xre(e.composedPath()[0]),Cre=e=>{Sre(e)||[...Jc.keys()].forEach(t=>{Jc.get(t)?.some(({parsedShortcuts:t})=>vre(e,t))&&yre(t,e)})},wre=(e,t)=>{t.length?e.setAttribute(`aria-keyshortcuts`,[...new Set(t.flatMap(({label:e})=>e.split(` `)))].join(` `)):e.removeAttribute(`aria-keyshortcuts`)},Tre=(e=``)=>{let t=Wc(e).trim().replace(/\s+/g,` `).replace(/\bCtrl\b/g,`Control`);if(!t)return()=>()=>{};let n=Kc(e);return e=>{Jc.size||globalThis.addEventListener(`keydown`,Cre,{capture:!0});let r={parsedShortcuts:n,label:t},i=Jc.get(e)??[];return i.push(r),Jc.set(e,i),wre(e,i),()=>{let t=i.indexOf(r);t!==-1&&(i.splice(t,1),wre(e,i),i.length||Jc.delete(e),Jc.size||globalThis.removeEventListener(`keydown`,Cre,{capture:!0}))}}},Yc=e=>e===null?`null`:typeof e,Ere=(e,t)=>{if(t===`number`){let t=Number(e);return Number.isNaN(t)?null:t}return t===`boolean`?e===`true`:t===`null`?null:t===`string`?e?String(e):``:e},Dre=V(`<span role="none" class="sui truncated-text svelte-1t9fkqv"><!></span>`),Ore={hash:`svelte-1t9fkqv`,code:`.truncated-text.svelte-1t9fkqv {display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;}`};function Xc(e,t){q(e,Ore);let n=Y(t,`lines`,3,1),r=Y(t,`children`,3,void 0);var i=Dre();let a;Uo(P(i),()=>r()??jr),O(i),z(()=>a=as(i,``,a,{"-webkit-line-clamp":n(),"line-clamp":n()})),W(e,i)}var Zc=(e=0)=>new Promise(t=>{globalThis.setTimeout(()=>{t(void 0)},e)}),kre=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,Qc=e=>{let t=globalThis.crypto.randomUUID();return e===`short`?t.split(`-`).pop():e===`shorter`?t.split(`-`).shift():typeof e==`number`?t.split(`-`).join(``).slice(0,e):t},Are=`abcdefghijklmnopqrstuvwxyz234567`,jre=e=>{let t=``,n=0,r=0;return e.forEach(e=>{for(n=n<<8|e,r+=8;r>=5;)r-=5,t+=Are[n>>>r&31]}),r>0&&(t+=Are[n<<5-r&31]),t},$c=()=>jre(Uint8Array.fromHex(Qc().replaceAll(`-`,``))),el=async(e,{algorithm:t=`SHA-1`,format:n=`hex`}={})=>{let r;if(typeof e==`string`)r=new TextEncoder().encode(e);else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e;else if(e&&typeof e.arrayBuffer==`function`)r=await e.arrayBuffer();else throw Error(`Unsupported input type for getHash`);let i=await globalThis.crypto.subtle.digest(t,r);return n===`binary`?Array.from(new Uint8Array(i),e=>String.fromCharCode(e)).join(``):new Uint8Array(i).toHex()},tl=new WeakMap,nl,rl=(e=`e`,t=7)=>[e,Qc(t)].join(`-`),il=e=>{tl.delete(e),nl?.unobserve(e)},Mre=()=>{if(`IntersectionObserver`in globalThis)return nl||(nl=new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{if(!e||!(t instanceof HTMLElement))return;let n=tl.get(t);n&&(n(),il(t))})}),nl)},Nre=new Map,Pre=e=>{if(!(`IntersectionObserver`in globalThis))return;let t=Nre.get(e);if(!t){let n=new Map,r=new Map;t={observer:new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{let i=n.get(t);i&&(r.set(t,e),[...i].forEach(t=>{i.has(t)&&t(e)}))})},{rootMargin:e}),listeners:n,states:r},Nre.set(e,t)}return t},Fre=(e,t,{rootMargin:n=`0px`}={})=>{let r=Pre(n);if(!r)return()=>{};let{observer:i,listeners:a,states:o}=r,s=a.get(e)??new Set;return s.size?o.has(e)&&!s.has(t)&&queueMicrotask(()=>{s.has(t)&&a.get(e)===s&&t(o.get(e))}):(a.set(e,s),i.observe(e)),s.add(t),()=>{s.delete(t),!s.size&&a.get(e)===s&&(a.delete(e),o.delete(e),i.unobserve(e))}},Ire=(e,t,{delay:n=100,...r}={})=>{if(!(`IntersectionObserver`in globalThis)){let e=!1;return queueMicrotask(()=>{e||t()}),()=>{e=!0}}let i,a=Fre(e,e=>{clearTimeout(i),e&&(i=setTimeout(()=>{a(),t()},n))},r);return()=>{clearTimeout(i),a()}},Lre=e=>{let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=globalThis;return r>0&&i>0&&t<a&&n<o},Rre=e=>{`requestAnimationFrame`in globalThis?globalThis.requestAnimationFrame(e):globalThis.setTimeout(e,16)},al=e=>{let t=Mre();if(t)return Lre(e)?Promise.resolve(void 0):new Promise(n=>{let r=tl.get(e);tl.set(e,r?()=>{r(),n()}:n),Rre(()=>{tl.has(e)&&t.observe(e)})})},zre=e=>{let t=e;return t.endsWith(`-left`)?t=t.replace(`-left`,`-right`):t.endsWith(`-right`)&&(t=t.replace(`-right`,`-left`)),t.startsWith(`left-`)?t=t.replace(`left-`,`right-`):t.startsWith(`right-`)&&(t=t.replace(`right-`,`left-`)),t},Bre=(e,t)=>{let n=Math.max(e.top,0),r=Math.max(e.left,0),i=Math.min(e.right,t.width),a=Math.min(e.bottom,t.height);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},ol=({position:e,from:t,to:n,size:r,room:i,otherRoom:a})=>r<=i?{position:e,cap:void 0}:a>i?{position:e.replace(t,n),cap:a}:{position:e,cap:i},Vre=({position:e,anchorRect:t,viewport:n,contentWidth:r,contentHeight:i})=>{let a=Bre(t,n),o=a.top-8,s=n.height-a.bottom-8,c=a.left-8,l=n.width-a.right-8,u=n.height-a.top-8,d=a.bottom-8,f=e,p,m=(e,t,n,r)=>{let a=ol({position:f,from:e,to:t,size:i,room:n,otherRoom:r});f=a.position,p=a.cap??p};return f.startsWith(`bottom-`)?m(`bottom-`,`top-`,s,o):f.startsWith(`top-`)&&m(`top-`,`bottom-`,o,s),f.endsWith(`-top`)?m(`-top`,`-bottom`,u,d):f.endsWith(`-bottom`)&&m(`-bottom`,`-top`,d,u),f.endsWith(`-left`)?{position:f}=ol({position:f,from:`-left`,to:`-right`,size:r,room:n.width-a.left-8,otherRoom:a.right-8}):f.endsWith(`-right`)&&({position:f}=ol({position:f,from:`-right`,to:`-left`,size:r,room:a.right-8,otherRoom:n.width-a.left-8})),f.startsWith(`right-`)?{position:f}=ol({position:f,from:`right-`,to:`left-`,size:r,room:l,otherRoom:c}):f.startsWith(`left-`)&&({position:f}=ol({position:f,from:`left-`,to:`right-`,size:r,room:c,otherRoom:l})),{inset:[f.startsWith(`bottom-`)?`${Math.round(a.bottom)}px`:f.endsWith(`-top`)?`${Math.round(a.top)}px`:`auto`,f.startsWith(`left-`)?`${Math.round(n.width-a.left)}px`:f.endsWith(`-right`)?`${Math.round(n.width-a.right)}px`:`auto`,f.startsWith(`top-`)?`${Math.round(n.height-a.top)}px`:f.endsWith(`-bottom`)?`${Math.round(n.height-a.bottom)}px`:`auto`,f.startsWith(`right-`)?`${Math.round(a.right)}px`:f.endsWith(`-left`)?`${Math.round(a.left)}px`:`auto`].join(` `),zIndex:1e3,minWidth:`${Math.round(a.width)}px`,maxWidth:f.startsWith(`right-`)?`${Math.round(l)}px`:f.startsWith(`left-`)?`${Math.round(c)}px`:f.endsWith(`-left`)?`${Math.round(n.width-a.left-8)}px`:`${Math.round(a.right-8)}px`,height:p?`${Math.round(p)}px`:void 0}},Hre=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&e[n]===t[n])},Ure=class{#e=M(!1);get open(){return B(this.#e)}set open(e){N(this.#e,e,!0),e?this.checkPosition():this.anchorElement.getAttribute(`aria-expanded`)===`true`&&window.requestAnimationFrame(()=>{let{activeElement:e}=document;(!e||e===document.body||this.popupElement?.contains(e))&&this.anchorElement.focus()}),this.anchorElement.setAttribute(`aria-expanded`,String(e))}#t=M(na({inset:void 0,zIndex:void 0,minWidth:void 0,maxWidth:void 0,height:void 0}));get style(){return B(this.#t)}set style(e){N(this.#t,e,!0)}popupElement=void 0;contentElement=void 0;nested=!1;#n=void 0;#r=[];_rafId=0;constructor(e,t,n,r){this.anchorElement=e,this.position=n,this.positionBaseElement=r??e,this.id=rl(`popup`),this.anchorElement.setAttribute(`aria-expanded`,`false`);let i=ho(e,`click`,t=>{!this.isDisabled&&!this.isReadOnly&&(this.open=t.detail&&e.matches(`[role="menuitem"]`)?!0:!this.open)}),a=ho(e,`keydown`,t=>{let{key:n,ctrlKey:r,metaKey:i,shiftKey:a,altKey:o}=t,s=a||o||r||i;this.isDisabled||this.isReadOnly||([`Enter`,` `].includes(n)&&!s?(t.preventDefault(),t.stopPropagation(),this.open=!this.open):![`ArrowDown`,`ArrowUp`].includes(n)||a||r||i||o&&n!==`ArrowDown`||![`listbox`,`menu`].includes(e.getAttribute(`aria-haspopup`)??``)||e.matches(`[role^="menuitem"]`)||this.open||(t.preventDefault(),t.stopPropagation(),this.open=!0))}),o=ho(e,`transitionstart`,()=>{this.anchorElement.closest(`.hiding, .hidden, [hidden]`)&&this.hideImmediately()});this.#r=[i,a,o],this.intersectionObserver=new IntersectionObserver(e=>{!e.at(-1)?.isIntersecting&&this.open&&this.hideImmediately()}),this.intersectionObserver.observe(this.anchorElement),this.resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>this.checkPosition())}),this.resizeObserver.observe(this.positionBaseElement),this.viewportResizeObserver=new ResizeObserver(()=>{this.open&&this.checkPosition()}),t&&this.attachPopupElement(t)}attachPopupElement(e,t,{nested:n=!1}={}){if(this.popupElement===e&&this.contentElement===t)return;this.detachPopupElement(),this.popupElement=e,this.contentElement=t,this.nested=n,this.viewportResizeObserver.observe(e);let r=t??e;r.id=this.id,this.anchorElement.setAttribute(`aria-controls`,this.id);let i=ho(e,`click`,e=>{e.stopPropagation();let t=e.target;this.open&&(t===this.popupElement||t.matches(`[role^="menuitem"], [role="option"]`))&&(this.open=!1)}),a=ho(e,`keydown`,e=>{let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e;t===`Escape`&&!(i||a||n||r)&&(e.preventDefault(),e.stopPropagation(),this.open=!1)});this.#n=()=>{i(),a()}}detachPopupElement(){this.#n?.(),this.#n=void 0,this.popupElement&&this.viewportResizeObserver.unobserve(this.popupElement),this.anchorElement.getAttribute(`aria-controls`)===this.id&&this.anchorElement.removeAttribute(`aria-controls`),this.popupElement=void 0,this.contentElement=void 0}get isDisabled(){return this.anchorElement.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.anchorElement.matches(`[aria-readonly="true"]`)}checkPosition(){if(!this.popupElement)return;let e=this.contentElement??this.popupElement?.querySelector(`.content`)??null;if(!e)return;let t=this.positionBaseElement.getBoundingClientRect(),{maxHeight:n,maxWidth:r}=e.style;e.style.maxHeight=``,e.style.maxWidth=``;let{scrollHeight:i,scrollWidth:a}=e;e.style.maxHeight=n,e.style.maxWidth=r;let o=Vre({position:Pc()?zre(this.position):this.position,anchorRect:t,viewport:{width:window.innerWidth,height:window.innerHeight},contentWidth:a,contentHeight:i});Hre(o,this.style)||(this.style=o)}async hideImmediately(){let e=this.nested?this.contentElement:this.popupElement;e&&(e.hidden=!0),this.open=!1,await Zc(50),e?.isConnected&&(e.hidden=!1)}destroy(){this.detachPopupElement(),this.#r.forEach(e=>e()),this.#r=[],this.intersectionObserver?.disconnect(),this.resizeObserver?.disconnect(),this.viewportResizeObserver?.disconnect(),this._rafId&&cancelAnimationFrame(this._rafId)}},Wre=(...e)=>new Ure(...e),Gre=e=>Math.max(0,...e.split(`,`).map(e=>Number.parseFloat(e)||0))*1e3,Kre=({transitionDuration:e,transitionDelay:t})=>Gre(e)+Gre(t)+100;function qre(e,t){var n=U();Uo(F(n),()=>t.children??jr),W(e,n)}var Jre=Symbol(`sui-modal-retainer`),Yre=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`dialog`,`class`,`role`,`showBackdrop`,`lightDismiss`,`escapeDismiss`,`keepContent`,`restoreFocus`,`children`,`extraContent`,`onOpening`,`onOpen`,`onClosing`,`onOk`,`onCancel`,`onClose`]),Xre=V(`<dialog><!> <!></dialog>`),Zre={hash:`svelte-1cwmgy1`,code:`dialog.svelte-1cwmgy1 {position:fixed;inset:0;z-index:9999999;display:flex;justify-content:center;align-items:center;overflow:hidden;outline:0;margin:0;border:0;padding:0;width:100dvw;max-width:100dvw;height:100dvh;max-height:100dvh;color:var(--sui-primary-foreground-color);background:transparent;-webkit-user-select:none;user-select:none;touch-action:none;pointer-events:all;cursor:default;}dialog.svelte-1cwmgy1::backdrop {background:transparent;}dialog.backdrop.svelte-1cwmgy1 {background-color:var(--sui-popup-backdrop-color);}dialog.open.svelte-1cwmgy1 {transition-duration:50ms;opacity:1;}dialog.svelte-1cwmgy1:not(.open) {transition-duration:400ms;opacity:0;}dialog[hidden].svelte-1cwmgy1 {transition-duration:1ms !important;}dialog.svelte-1cwmgy1:not(.active) {pointer-events:none !important;}dialog.svelte-1cwmgy1:not(.active) * {transition-duration:0ms !important;pointer-events:none !important;}`};function sl(e,t){k(t,!0),q(e,Zre);let n=e=>{var n=U(),l=F(n),u=e=>{var n=Xre(),l=({target:e})=>{C=e},u=({target:e})=>{let t=C;C=void 0,t&&t!==i()||i()&&s()&&e?.matches(`dialog`)&&(i(i().returnValue=`cancel`,!0),r(!1))},f=e=>{e.preventDefault(),i()&&c()&&(i(i().returnValue=`cancel`,!0),r(!1))},p=()=>{b&&i()?.isConnected&&!i().open&&(c()?r(!1):i().showModal())};us(n,()=>({tabindex:`-1`,...d,inert:!B(m),role:a(),class:`sui modal ${t.class??``}`,onpointerdown:l,onclick:u,oncancel:f,onclose:p,[cs]:{backdrop:o(),open:B(m),active:B(h)}}),void 0,void 0,void 0,`svelte-1cwmgy1`);var g=P(n);Uo(g,()=>t.extraContent??jr),Uo(L(g,2),()=>t.children??jr),O(n),ms(n,e=>i(e),()=>i()),W(e,n)};K(l,e=>{B(y)&&e(u)}),W(e,n)},r=Y(t,`open`,15,!1),i=Y(t,`dialog`,15),a=Y(t,`role`,3,`dialog`),o=Y(t,`showBackdrop`,3,!1),s=Y(t,`lightDismiss`,3,!1),c=Y(t,`escapeDismiss`,3,!0),l=Y(t,`keepContent`,3,!1),u=Y(t,`restoreFocus`,3,!0),d=gs(t,Yre),f=()=>{i()?.focus()},p=e=>{i()&&(i(i().returnValue=e,!0),r(!1))},m=M(!1),h=M(!1),g=M(!1),_=M(0),v=ui(Jre);di(Jre,{retain:()=>{co(()=>{N(_,B(_)+1)})},release:()=>{co(()=>{N(_,B(_)-1)})}});let y=j(()=>l()||B(g)||B(_)>0),b=!1,x=0,S,C,w,T=()=>{let e=S;S=void 0,u()&&e&&(w=window.setTimeout(()=>{let{activeElement:t}=document;e.isConnected&&(!t||t===document.body||i()?.contains(t))&&e.focus()}))},ee=async()=>{if(await ao(),!i())return;let e=Kre(getComputedStyle(i())),t=new AbortController,{signal:n}=t;i().addEventListener(`transitionend`,e=>{e.target===i()&&t.abort()},{signal:n});let r=window.setTimeout(()=>t.abort(),e);await new Promise(e=>{n.addEventListener(`abort`,()=>e(void 0))}),window.clearTimeout(r)},E=async()=>{if(b)return;b=!0,x+=1;let e=x,{activeElement:n}=document;window.clearTimeout(w),S=n instanceof HTMLElement?n:void 0,t.onOpening?.(new CustomEvent(`Opening`)),N(g,!0),await ao(),e===x&&i()&&!i().open&&(i().showModal(),t.onOpen?.(new CustomEvent(`Open`)),i().getBoundingClientRect(),N(m,!0),await ao(),e===x&&i()&&(i().contains(document.activeElement)||f(),await ee(),e===x&&N(h,!0)))},te=async()=>{if(!b)return;b=!1,x+=1;let e=x,n=B(m),r=i()?.returnValue??``;t.onClosing?.(new CustomEvent(`Closing`)),i()?.open&&(document.body.inert=!0,i().close(),document.body.inert=!1),T(),N(h,!1),N(m,!1),n&&await ee(),e===x&&(N(g,!1),r===`ok`&&t.onOk?.(new CustomEvent(`Ok`)),r===`cancel`&&t.onCancel?.(new CustomEvent(`Cancel`)),t.onClose?.(new CustomEvent(`Close`,{detail:{returnValue:r}})),i()&&i(i().returnValue=``,!0))},ne=Fee();return vs(()=>{let e=To(qre,{target:document.querySelector(`.sui.app-shell`)??document.body,props:{children:n},context:ne});return()=>{window.clearTimeout(w),i()?.close(),Oo(e)}}),R(()=>{r()?E():te()}),R(()=>{if(B(g))return v?.retain(),()=>{v?.release()}}),A({focus:f,close:p})}var Qre=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`hovered`,`content`,`class`,`showBackdrop`,`anchor`,`position`,`positionBaseElement`,`parentDialogElement`,`touchOptimized`,`children`,`onOpen`]),$re=V(`<div role="none"><!></div>`),eie={hash:`svelte-11fim4o`,code:`.content.svelte-11fim4o {position:absolute;overflow-y:auto;outline-width:0 !important;width:auto;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:opacity, transform;}.content.menu.svelte-11fim4o {border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.content.menu.svelte-11fim4o .sui.menu {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.listbox.svelte-11fim4o {border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);}.content.listbox.svelte-11fim4o .sui.listbox {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.tree.svelte-11fim4o {border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);}.content.tree.svelte-11fim4o .sui.tree {margin:0;border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.combobox.svelte-11fim4o {display:flex;flex-direction:column;overflow:hidden;}.content.touch.svelte-11fim4o {position:static;border-width:0 !important;border-radius:4px !important;padding:8px;min-width:320px !important;max-width:calc(100dvw - 32px) !important;max-height:calc(100dvh - 32px) !important;}dialog.open .content.touch.svelte-11fim4o {transform:scale(100%) !important;}dialog:not(.open) .content.touch.svelte-11fim4o {transform:scale(90%);}.content.touch.combobox.svelte-11fim4o .sui.listbox {gap:4px;padding:8px 4px !important;}dialog.open .content.svelte-11fim4o {transition-duration:50ms;opacity:1;transform:translateY(2px);}dialog:not(.open) .content.svelte-11fim4o {transition-duration:300ms;opacity:0;transform:translateY(-8px);}.content.nested.menu.svelte-11fim4o {margin-block:calc(-1 * (var(--sui-menu-border-width, 1px) + var(--sui-menu-padding, 4px)));}dialog.open .content.nested.menu.svelte-11fim4o {transform:none;}`};function cl(e,t){k(t,!0),q(e,eie);let n=e=>{var n=$re();let o,s;Uo(P(n),()=>t.children??jr),O(n),ms(n,e=>a(e),()=>a()),z(()=>{J(n,`hidden`,!r()),o=rs(n,1,`content ${t.class??``} ${B(m)??``}`,`svelte-11fim4o`,o,{touch:B(v),nested:!!l()}),s=as(n,``,s,{inset:B(h)?.style.inset,"z-index":B(h)?.style.zIndex,"min-width":B(h)?.style.minWidth,"max-width":B(h)?.style.maxWidth,"max-height":B(h)?.style.height,visibility:B(h)?.style.inset?void 0:`hidden`})}),go(`mouseenter`,n,()=>{i(!0),l()&&window.clearTimeout(g)}),go(`mouseleave`,n,()=>{i(!1),l()&&(g=window.setTimeout(()=>{r(!1)},200))}),W(e,n)},r=Y(t,`open`,15,!1),i=Y(t,`hovered`,15,!1),a=Y(t,`content`,15,void 0),o=Y(t,`showBackdrop`,3,void 0),s=Y(t,`position`,3,`bottom-left`),c=Y(t,`positionBaseElement`,3,void 0),l=Y(t,`parentDialogElement`,3,void 0),u=Y(t,`touchOptimized`,3,!1),d=gs(t,Qre),f=M(void 0),p=M(!1),m=M(void 0),h=M(void 0),g=0,_=({tabStopOnly:e=!1}={})=>{if(!a())return!1;let t=[...a().querySelectorAll(`[tabindex="0"]:not([aria-disabled="true"])`),...e?[]:a().querySelectorAll(`[tabindex]:not([aria-disabled="true"])`)].some(e=>(e.focus(),document.activeElement===e));return!t&&!e&&(a(a().tabIndex=-1,!0),a().focus()),t};R(()=>{B(h)&&r(B(h).open)}),R(()=>{B(h)&&B(h).open!==r()&&(B(h).open=r())}),R(()=>{l()&&!B(f)&&a()&&(N(f,l()),B(f).append(a()))}),R(()=>{t.anchor&&!B(h)&&(N(h,Wre(t.anchor,void 0,s(),c()),!0),N(m,t.anchor.getAttribute(`aria-haspopup`)??void 0,!0))}),R(()=>{if(B(h)&&B(f)&&a())return B(h).attachPopupElement(B(f),a(),{nested:!!l()}),()=>{B(h)?.detachPopupElement()}}),R(()=>{r()&&B(f)&&B(h)?.checkPosition()});let v=j(()=>u()&&B(p));vs(()=>(N(p,globalThis.matchMedia(`(pointer: coarse)`).matches,!0),()=>{B(h)?.destroy?.(),globalThis.clearTimeout(g)}));var y=U(),b=F(y),x=e=>{n(e)},S=e=>{{let i=j(()=>o()??B(v));sl(e,_s(()=>d,{role:`none`,class:`popup`,get showBackdrop(){return B(i)},lightDismiss:!0,onOpen:async e=>{t.onOpen?.(e),await ao(),a()&&!_({tabStopOnly:!0})&&(await Zc(100),a()&&!a().contains(document.activeElement)&&_())},get dialog(){return B(f)},set dialog(e){N(f,e,!0)},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}}))}};K(b,e=>{l()?e(x):e(S,-1)}),W(e,y),A()}var tie=new Set(`$$slots.$$events.$$legacy.element.class.type.role.name.value.valueType.hidden.disabled.readonly.pressed.keyShortcuts.label.labelDir.lines.variant.size.iconic.pill.flex.popupPosition.showPopupBackdrop.children.startIcon.endIcon.popup`.split(`.`)),nie=V(`<span role="none" class="label svelte-si31ue"><!></span>`),rie=V(`<!> <!>`,1),iie=V(`<button><!> <!> <!></button> <!>`,1),aie={hash:`svelte-si31ue`,code:`button.svelte-si31ue {flex:none;display:inline-flex;align-items:center;gap:4px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color, inherit);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;transition:all 200ms;}button[hidden].svelte-si31ue {display:none !important;}button.svelte-si31ue:not(:disabled):focus-visible {z-index:1;}button.svelte-si31ue:is(.primary:where(.svelte-si31ue), .secondary:where(.svelte-si31ue), .tertiary:where(.svelte-si31ue), .ghost:where(.svelte-si31ue)) {justify-content:center;border-width:1px;}button.svelte-si31ue:is(.primary:where(.svelte-si31ue), .secondary:where(.svelte-si31ue), .tertiary:where(.svelte-si31ue), .ghost:where(.svelte-si31ue)) .label:where(.svelte-si31ue):only-child {padding:0 4px;}button.primary.svelte-si31ue {border-width:var(--sui-button-primary-border-width, 1px);border-style:var(--sui-button-primary-border-style, solid);border-color:var(--sui-button-primary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted));background-color:var(--sui-button-primary-background-color, var(--sui-primary-accent-color));font-weight:var(--sui-button-primary-font-weight, var(--sui-font-weight-normal, normal));}button.primary.svelte-si31ue:is(:where(.svelte-si31ue):hover, :where(.svelte-si31ue):focus-visible, [aria-expanded=true]:where(.svelte-si31ue)) {color:var(--sui-button-primary-foreground-color-focus, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-focus, var(--sui-primary-accent-color-light));}button.primary.svelte-si31ue:active {color:var(--sui-button-primary-foreground-color-active, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-active, var(--sui-primary-accent-color-dark));}button.secondary.svelte-si31ue {border-width:var(--sui-button-secondary-border-width, 1px);border-style:var(--sui-button-secondary-border-style, solid);border-color:var(--sui-button-secondary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text));background-color:var(--sui-button-secondary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-secondary-font-weight, var(--sui-font-weight-normal, normal));}button.secondary.svelte-si31ue:is(:where(.svelte-si31ue):hover, :where(.svelte-si31ue):focus-visible, [aria-expanded=true]:where(.svelte-si31ue)) {color:var(--sui-button-secondary-foreground-color-focus, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-focus, var(--sui-hover-background-color));}button.secondary.svelte-si31ue:active {color:var(--sui-button-secondary-foreground-color-active, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-active, var(--sui-active-background-color));}button.secondary[aria-pressed=true].svelte-si31ue {color:var(--sui-button-secondary-foreground-color-pressed);background-color:var(--sui-button-secondary-background-color-pressed, var(--sui-primary-accent-color));}button.tertiary.svelte-si31ue {border-width:var(--sui-button-tertiary-border-width, 1px);border-style:var(--sui-button-tertiary-border-style, solid);border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(--sui-button-tertiary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-tertiary-font-weight, var(--sui-font-weight-normal, normal));}button.tertiary.svelte-si31ue:is(:where(.svelte-si31ue):hover, :where(.svelte-si31ue):focus-visible, [aria-expanded=true]:where(.svelte-si31ue)) {color:var(--sui-button-tertiary-foreground-color-focus, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-focus, var(--sui-hover-background-color));}button.tertiary.svelte-si31ue:active {color:var(--sui-button-tertiary-foreground-color-active, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-active, var(--sui-active-background-color));}button.tertiary[aria-pressed=true].svelte-si31ue {color:var(--sui-button-tertiary-foreground-color-pressed);background-color:var(--sui-button-tertiary-background-color-pressed, var(--sui-selected-background-color));}button.ghost.svelte-si31ue {font-weight:var(--sui-button-ghost-font-weight, var(--sui-font-weight-normal, normal));}button.ghost.svelte-si31ue:is(:where(.svelte-si31ue):hover, :where(.svelte-si31ue):focus-visible, [aria-expanded=true]:where(.svelte-si31ue)) {color:var(--sui-button-ghost-foreground-color-focus);background-color:var(--sui-button-ghost-background-color-focus, var(--sui-hover-background-color));}button.ghost.svelte-si31ue:active {color:var(--sui-button-ghost-foreground-color-active);background-color:var(--sui-button-ghost-background-color-active, var(--sui-active-background-color));}button.ghost[aria-pressed=true].svelte-si31ue {color:var(--sui-button-ghost-foreground-color-pressed);background-color:var(--sui-button-ghost-background-color-pressed, var(--sui-selected-background-color));}button.link.svelte-si31ue {margin:0;padding:0 !important;height:auto !important;color:var(--sui-button-link-foreground-color, var(--sui-primary-accent-color-text));}button.link.svelte-si31ue:hover .label:where(.svelte-si31ue) {outline:none !important;text-decoration:underline;}button.link.svelte-si31ue .label:where(.svelte-si31ue) {padding:0;line-height:var(--sui-line-height-compact);text-decoration:var(--sui-button-link-text-decoration, none);text-underline-offset:2px;white-space:normal;}:is(:root, :host)[data-underline-links='true'] button.link.svelte-si31ue .label:where(.svelte-si31ue) {text-decoration:underline;}button.small.svelte-si31ue {border-radius:var(--sui-button-small-border-radius);padding:var(--sui-button-small-padding);height:var(--sui-button-small-height);font-size:var(--sui-button-small-font-size, var(--sui-font-size-small));}button.small.svelte-si31ue .icon {font-size:var(--sui-font-size-large);}button.medium.svelte-si31ue {border-radius:var(--sui-button-medium-border-radius);padding:var(--sui-button-medium-padding);height:var(--sui-button-medium-height);font-size:var(--sui-button-medium-font-size, var(--sui-font-size-default));}button.large.svelte-si31ue {border-radius:var(--sui-button-large-border-radius);padding:var(--sui-button-large-padding);height:var(--sui-button-large-height);font-size:var(--sui-button-large-font-size, var(--sui-font-size-large));}button.pill.svelte-si31ue {border-radius:80px;padding:var(--sui-button-medium-pill-padding, 0 12px);}button.flex.svelte-si31ue:not([hidden]) {display:inline-flex;flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;}button.iconic.svelte-si31ue {justify-content:center;padding:0;aspect-ratio:1/1;}button.danger.svelte-si31ue {background-color:var(--sui-error-background-color);}button.svelte-si31ue .label:where(.svelte-si31ue) {padding:0 4px;}button.svelte-si31ue > * {pointer-events:none;}`};function ll(e,t){k(t,!0),q(e,aie);let n=e=>{var t=nie();Xc(P(t),{get lines(){return _()},children:(e,t)=>{$r();var n=H();z(()=>G(n,h())),W(e,n)},$$slots:{default:!0}}),O(t),z(()=>{J(t,`dir`,g()),t.dir=t.dir}),W(e,t)},r=Y(t,`element`,15),i=Y(t,`class`,3,``),a=Y(t,`type`,3,`button`),o=Y(t,`role`,3,`button`),s=Y(t,`name`,3,void 0),c=Y(t,`value`,3,void 0),l=Y(t,`valueType`,19,()=>Yc(c())),u=Y(t,`hidden`,3,!1),d=Y(t,`disabled`,3,!1),f=Y(t,`readonly`,3,!1),p=Y(t,`pressed`,3,void 0),m=Y(t,`keyShortcuts`,3,void 0),h=Y(t,`label`,3,``),g=Y(t,`labelDir`,3,void 0),_=Y(t,`lines`,3,1),v=Y(t,`variant`,3,void 0),y=Y(t,`size`,3,`medium`),b=Y(t,`iconic`,3,!1),x=Y(t,`pill`,3,!1),S=Y(t,`flex`,3,!1),C=Y(t,`popupPosition`,3,`bottom-left`),w=Y(t,`showPopupBackdrop`,3,!1),T=gs(t,tie);var ee=iie(),E=F(ee);us(E,()=>({...T,class:[`sui`,`button`,v(),y(),i()],type:a(),name:s(),value:c(),hidden:u(),disabled:d(),role:o(),"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f()||void 0,"aria-pressed":p(),"data-type":l(),"data-name":s(),"data-label":h(),"data-value":c(),[cs]:{iconic:b(),pill:x(),flex:S()}}),void 0,void 0,void 0,`svelte-si31ue`);var te=P(E);Uo(te,()=>t.startIcon??jr);var ne=L(te,2),re=e=>{var r=U(),i=F(r),a=e=>{n(e)},o=e=>{var n=nie();Uo(P(n),()=>t.children??jr),O(n),W(e,n)};K(i,e=>{h()?e(a):e(o,-1)}),W(e,r)},ie=e=>{var r=rie(),i=F(r),a=e=>{n(e)};K(i,e=>{h()&&e(a)}),Uo(L(i,2),()=>t.children??jr),W(e,r)};K(ne,e=>{v()===`link`?e(re):e(ie,-1)}),Uo(L(ne,2),()=>t.endIcon??jr),O(E),ms(E,e=>r(e),()=>r()),$o(E,()=>m()&&Tre(m()));var ae=L(E,2),oe=e=>{cl(e,{get anchor(){return r()},get position(){return C()},get showBackdrop(){return w()},touchOptimized:!0,children:(e,n)=>{var r=U();Uo(F(r),()=>t.popup),W(e,r)},$$slots:{default:!0}})};K(ae,e=>{t.popup&&e(oe)}),W(e,ee),A()}var oie=V(`<div role="none"><!></div>`),sie=V(`<div role="none"><div class="message svelte-yyked3"><!></div> <!></div>`),cie={hash:`svelte-yyked3`,code:`.infobar.svelte-yyked3 {flex:none;display:flex;align-items:center;gap:var(--sui-infobar-gap, 8px);border-width:var(--sui-infobar-border-width, 0 0 1px);border-style:var(--sui-infobar-border-style, solid);padding:var(--sui-infobar-padding, 0);min-height:var(--sui-infobar-min-height, 32px);font-size:var(--sui-infobar-font-size, var(--sui-font-size-small));}.infobar.info.svelte-yyked3 {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.infobar.warning.svelte-yyked3 {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.infobar.error.svelte-yyked3 {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.infobar.success.svelte-yyked3 {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}.message.svelte-yyked3 {flex:auto;display:flex;align-items:center;justify-content:var(--sui-infobar-message-justify-content, start);gap:var(--sui-infobar-message-gap, 6px);padding:var(--sui-infobar-message-padding, 6px);}.message.svelte-yyked3 button {font-size:inherit !important;}.message.svelte-yyked3 .icon {font-size:16px; /* !hardcoded */}`};function ul(e,t){k(t,!0),q(e,cie);let n=Y(t,`show`,15,!0),r=Y(t,`dismissible`,3,!0),i=Y(t,`status`,3,`info`),a=Y(t,`ariaLive`,3,void 0),o=Y(t,`children`,3,void 0),s=Y(t,`icon`,3,void 0),c=j(()=>zc(i()));var l=U(),u=F(l),d=e=>{var l=sie(),u=P(l);Rc(P(u),{get status(){return i()},get children(){return o()},get icon(){return s()}}),O(u);var d=L(u,2),f=e=>{var r=oie(),i=P(r);{let e=j(()=>X(`_sui.dismiss`));ll(i,{iconic:!0,size:`small`,variant:`ghost`,get"aria-label"(){return B(e)},onclick:()=>{n(!1),t.onDismiss?.()},children:(e,t)=>{Lc(e,{name:`close`})},$$slots:{default:!0}})}O(r),W(e,r)};K(d,e=>{r()&&e(f)}),O(l),z(e=>{rs(l,1,ts([`infobar`,i()]),`svelte-yyked3`),J(u,`role`,B(c)),J(u,`aria-live`,e)},[()=>Bc(B(c),a())]),W(e,l)};K(u,e=>{n()&&e(d)}),W(e,l),A()}var lie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),uie=V(`<div><!></div>`),die={hash:`svelte-19v7sys`,code:`.bottom-navigation.svelte-19v7sys {height:var(--sui-bottom-navigation-height, var(--sui-primary-toolbar-size));border-top-width:var(--sui-bottom-navigation-border-color, 1px);border-top-style:var(--sui-bottom-navigation-border-style, solid);border-top-color:var(--sui-bottom-navigation-border-color, var(--sui-secondary-border-color));}.bottom-navigation.svelte-19v7sys:is([inert]:where(.svelte-19v7sys), [hidden]:where(.svelte-19v7sys)) {display:none;}.bottom-navigation.svelte-19v7sys .buttons {flex:auto;display:flex;align-items:center;justify-content:space-evenly;}`};function fie(e,t){q(e,die);let n=gs(t,lie);var r=uie();us(r,()=>({role:`none`,class:`sui bottom-navigation ${t.class??``}`,...n}),void 0,void 0,void 0,`svelte-19v7sys`),Uo(P(r),()=>t.children??jr),O(r),W(e,r)}var pie=V(`<div role="none" class="sui floating-action-button-wrapper svelte-18ubeee"><!></div>`),mie={hash:`svelte-18ubeee`,code:`.floating-action-button-wrapper.svelte-18ubeee {display:contents;}
|
||
@media (width < 768px) {.floating-action-button-wrapper.svelte-18ubeee {display:block;position:fixed;inset-inline-end:16px;inset-block-end:72px;z-index:100;}.floating-action-button-wrapper.svelte-18ubeee button {border-radius:50%;height:56px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.4);}.floating-action-button-wrapper.svelte-18ubeee button .icon {font-size:32px;}
|
||
}`};function dl(e,t){q(e,mie);let n=Y(t,`children`,3,void 0);var r=pie();Uo(P(r),()=>n()??jr),O(r),W(e,r)}var fl=e=>{try{e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`auto`})}catch{e.scrollIntoView(!0)}},pl=Symbol(`sui-option-registry`),hie=class{#e=M(!1);get expanded(){return B(this.#e)}set expanded(e){N(this.#e,e,!0)}#t=new Set;#n=M(0);#r=[];#i=-1;get#a(){return this.#i!==B(this.#n)&&(this.#r=[...this.#t],this.#i=B(this.#n)),this.#r}get count(){return this.#a.length}get entries(){return this.#a}get selectedEntry(){return this.#a.find(e=>e.selected)}register(e){return this.#t.add(e),N(this.#n,B(this.#n)+1),()=>{this.#t.delete(e),N(this.#n,B(this.#n)+1)}}find(e){return this.#a.find(t=>t.value===e)}selectOnly(e){this.#a.forEach(t=>{let n=t.value===e;t.selected!==n&&(t.selected=n)})}},gie=()=>di(pl,new hie),_ie=()=>ui(pl),ml=e=>{let{type:t=`string`,name:n,label:r}=e.dataset;return{target:e,type:t,name:n,label:r,value:Ere(e.dataset.value,t)}},vie=/\p{Diacritic}/gu,hl=e=>e.normalize(`NFD`).replace(vie,``).toLocaleLowerCase(),gl=e=>hl(e.trim()),_l=(e,t)=>e===`horizontal`?t?{prevKey:`ArrowRight`,nextKey:`ArrowLeft`}:{prevKey:`ArrowLeft`,nextKey:`ArrowRight`}:{prevKey:`ArrowUp`,nextKey:`ArrowDown`},yie=({key:e,index:t,count:n,prevKey:r,nextKey:i})=>e===r?t>0?t-1:n-1:e===i?t<n-1?t+1:0:-1,bie=({key:e,index:t,count:n,columnCount:r,prevKey:i,nextKey:a})=>{let o=n-1,s=e===`ArrowUp`||e===i,c=e===`ArrowDown`||e===a;return t===-1?c?0:s?o:-1:s&&t>0?e===`ArrowUp`?Math.max(t-r,0):t-1:c&&t<o?e===`ArrowDown`?Math.min(t+r,o):t+1:-1},vl=class{#e=``;#t=0;push(e){return globalThis.clearTimeout(this.#t),this.#e+=hl(e),this.#t=globalThis.setTimeout(()=>{this.#e=``},500),this.#e}reset(){globalThis.clearTimeout(this.#t),this.#e=``}},yl=(e,t,n)=>{if(!t)return-1;let r=t.length>1&&[...t].every(e=>e===t[0]),i=r?t[0]:t,a=t.length===1||r?n+1:Math.max(n,0),{length:o}=e;for(let t=0;t<o;t+=1){let n=(a+t)%o;if(e[n].startsWith(i))return n}return-1},bl=(e,t)=>n=>{e.activate(),t(n)},xl=async(e,t)=>{await Zc(100),t()||e.activate()},Sl=`[aria-disabled="true"], [aria-hidden="true"]`,Cl=(e,t)=>{e.getAttribute(`tabindex`)!==String(t)&&(e.tabIndex=t)},xie={grid:{orientation:`vertical`,childRoles:[`row`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},listbox:{orientation:`vertical`,childRoles:[`option`],childSelectedAttr:`aria-selected`,focusChild:!1,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},menu:{orientation:`vertical`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},menubar:{orientation:`horizontal`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},radiogroup:{orientation:`horizontal`,childRoles:[`radio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},tablist:{orientation:`horizontal`,childRoles:[`tab`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!0,controlsPanel:!0,rovingTabStop:`selected`}},Sie=`a[href], button, input, select, textarea, summary, [tabindex]`,Cie=(e,t)=>{let n=[...document.querySelectorAll(Sie)].filter(t=>t===e||t.tabIndex>=0&&!t.matches(`:disabled, [aria-disabled="true"], [hidden], [inert], [inert] *`)),r=n.indexOf(e);if(r===-1)return;let i=t?-1:1;for(let e=r+i;e>=0&&e<n.length;e+=i)if(n[e].getClientRects().length){n[e].focus();return}},wl=e=>{let t=e;for(;t;){if(t.id){let e=document.querySelector(`[aria-haspopup="menu"][aria-controls="${CSS.escape(t.id)}"]`);if(e)return e}t=t.parentElement}return null},Tl=(e,t=e.getAttribute(`role`))=>t!==`menuitem`&&e.dataset.selectable!==`false`,wie=class{activated=!1;selectionObserver=void 0;#e=!1;#t=void 0;#n=void 0;#r=new WeakMap;#i=new WeakMap;#a=new vl;#o=!1;#s(e){let t=e.dataset.searchValue??e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent,n=this.#r.get(e);if(n?.raw===t)return n.normalized;let r=gl(t);return this.#r.set(e,{raw:t,normalized:r}),r}#c(e){let t=this.controlsPanel?e.getAttribute(`aria-controls`):null;return t?document.getElementById(t):null}#l(e,t){e.inert=!t,e.setAttribute(`aria-hidden`,String(!t))}constructor(e,{clickToSelect:t=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.role=e.getAttribute(`role`),this.multi=this.parent.getAttribute(`aria-multiselectable`)===`true`,this.id=rl(this.role),this.parentGroupSelector=`[role="group"], [role="${this.role}"]`,this.clickToSelect=t,this._onClick=bl(this,e=>this.onClick(e)),this._onKeyDown=bl(this,e=>this.onKeyDown(e));let{orientation:n,childRoles:r,childSelectedAttr:i,focusChild:a,selectFirst:o,controlsPanel:s,rovingTabStop:c}=xie[this.role];this.orientation=this.grid?`horizontal`:this.parent.getAttribute(`aria-orientation`)??n,this.childRoles=r,this.childSelectedAttr=i,this.childSelectedProp=i.replace(`aria-`,``),this.focusChild=a,this.selectFirst=o,this.controlsPanel=s,this.rovingTabStop=c,this.parent.tabIndex=a?-1:0,this.observer=new globalThis.MutationObserver(e=>{this.#d(e)&&(this.#n=void 0,this.activated&&e.some(({type:e})=>e===`childList`)&&this.updateTabStop())}),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`aria-disabled`,`aria-hidden`]}),(s||a&&c===`selected`)&&(this.selectionObserver=new globalThis.MutationObserver(()=>{this.activated&&this.syncSelection()}),this.selectionObserver.observe(e,{subtree:!0,attributes:!0,attributeFilter:[i]})),e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),xl(this,()=>this.#e)}activate(){if(this.activated)return;let{parent:e,allMembers:t,selected:n}=this;this.activated=!0,t.forEach((e,t)=>{let r=e.getAttribute(this.childSelectedAttr)===`true`||(n?e===n:this.selectFirst&&t===0),i=this.#c(e);e.id||=`${this.id}-item-${t+1}`,Tl(e)&&e.setAttribute(this.childSelectedAttr,String(r)),i&&(i.setAttribute(`aria-labelledby`,e.id),this.#l(i,r),r&&globalThis.setTimeout(()=>{fl(i)},300))}),this.updateTabStop(),e.dispatchEvent(new CustomEvent(`Initialized`))}updateTabStop(){let{allMembers:e,activeMembers:t}=this;if(!this.focusChild){e.forEach(e=>{e.tabIndex=-1});return}let{activeElement:n}=document,r=t.find(e=>e===n||e.contains(n)),i=t.filter(e=>e.getAttribute(`tabindex`)===`0`),a=r??(i.length===1?i[0]:(this.rovingTabStop===`selected`?this.selected:void 0)??t.find(e=>e.dataset.selectable!==`false`)??t[0]);e.forEach(e=>{Cl(e,e===a?0:-1)})}syncSelection(){let{allMembers:e,parent:t}=this;if(this.controlsPanel&&e.forEach(e=>{let t=this.#c(e);t&&this.#l(t,e.getAttribute(this.childSelectedAttr)===`true`)}),this.focusChild&&!t.contains(document.activeElement)){let{selected:t}=this;t&&e.forEach(e=>{Cl(e,e===t?0:-1)})}}get columnCount(){let e=this.allMembers.filter(e=>e.getClientRects().length),t=e[0]?.getBoundingClientRect().top,n=e.findIndex(e=>Math.abs(e.getBoundingClientRect().top-t)>1);return Math.max(1,n===-1?e.length:n)}get selector(){return this.childRoles.map(e=>`[role="${e}"]`).join(`,`)}get#u(){if(this.#d(this.observer.takeRecords())&&(this.#n=void 0),!this.#n){let e=[...this.parent.querySelectorAll(this.selector)];this.#n={all:e,active:e.filter(e=>!e.matches(Sl))}}return this.#n}#d(e){let{selector:t}=this,n=e=>e instanceof Element&&(e.matches(t)||!!e.querySelector(t));return e.some(({type:e,target:r,addedNodes:i,removedNodes:a})=>e===`attributes`?r instanceof Element&&r.matches(t):[...i].some(n)||[...a].some(n))}get allMembers(){return this.#u.all}get activeMembers(){return this.#u.active}get opener(){return wl(this.parent)}get parentMenuItem(){let{opener:e}=this;return e?.matches(`[role^="menuitem"]`)?e:null}closeMenuChain(){let{opener:e}=this,t=e,n=null;for(let e=0;e<10&&t;e+=1){n=t,t.getAttribute(`aria-expanded`)===`true`&&t.click();let e=t.closest(`[role="menu"], [role="menubar"]`);t=e?wl(e):null}return n}async leaveMenu(e){let t=this.closeMenuChain();t&&(t.focus(),await Zc(50),Cie(t,e))}async enterSubmenu(e){let t=e.getAttribute(`aria-controls`);if(!t)return;e.getAttribute(`aria-expanded`)!==`true`&&e.click();let n=document.getElementById(t);for(let e=0;e<20;e+=1){let e=[...n?.querySelectorAll(this.selector)??[]].find(e=>!e.matches(Sl));if(e?.focus(),e&&document.activeElement===e)return;await Zc(20)}}leaveSubmenu(e){e.getAttribute(`aria-expanded`)===`true`&&e.click(),e.focus()}get selected(){return this.activeMembers.find(e=>e.getAttribute(this.childSelectedAttr)===`true`)}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get grid(){return this.role===`grid`||this.role===`listbox`&&this.parent.matches(`.grid`)}#f(e,t){e.setAttribute(this.childSelectedAttr,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{[this.childSelectedProp]:t}}))}#p(e){this.#o=!0;try{e.click()}finally{this.#o=!1}}#m(e,t,{role:n,isTarget:r,targetSelectable:i,selecting:a}){let o=n===`menuitemradio`,s=Tl(t,n),c=s&&(n===`menuitemcheckbox`||this.multi),l=s&&i&&(o||!c),u=t.getAttribute(this.childSelectedAttr)===`true`,d=!1;return n===`menuitem`&&r&&a&&(d=!0,t.dispatchEvent(new CustomEvent(`Select`))),c&&r&&a&&(d=!0,this.#f(t,!u),u||t.dispatchEvent(new CustomEvent(`Select`))),l&&u!==r&&(!o||a)&&(d=!0,this.#f(t,r),r&&(e.type===`keydown`&&n===`radio`&&this.#p(t),t.dispatchEvent(new CustomEvent(`Select`)))),d}#h(e,t,n){let r=this.#c(e);this.focusChild||(e.classList.toggle(`focused`,t),t&&e.dispatchEvent(new CustomEvent(`Focus`))),r&&(this.#l(r,t),t&&n.push(r)),t&&(this.parent.setAttribute(`aria-activedescendant`,e.id),n.push(e))}#g(e,t,n){e.forEach(e=>{Cl(e,e===t?0:-1)}),n&&(t.focus(),t.dispatchEvent(new CustomEvent(`Focus`)))}selectTarget(e,t){if(this.isDisabled||this.isReadOnly){e.preventDefault();return}let n=t.getAttribute(`role`),r=t.closest(this.parentGroupSelector),i=Tl(t,n),a=e.type===`click`||e.type===`keydown`&&e.key===` `,o=[],s=!1,c=[],l=!1;this.activeMembers.forEach(u=>{let d=u.getAttribute(`role`);if((d===`menuitemcheckbox`||d===`menuitemradio`)&&(d!==n||u.closest(this.parentGroupSelector)!==r))return;let f=u===t;o.push(u),s||=f,this.#m(e,u,{role:d,isTarget:f,targetSelectable:i,selecting:a})&&(l=!0),this.#h(u,f,c)}),c.length&&this.scrollIntoViewLater(c),this.focusChild&&this.#g(o,t,s),l&&this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:ml(t)}))}scrollIntoViewLater(e){globalThis.clearTimeout(this.#t),this.#t=globalThis.setTimeout(()=>{this.#t=void 0,e.forEach(fl)},300)}onClick(e){let t=e.target,n=t.matches(this.selector)?t:t.closest(this.selector);!n||e.button!==0||!this.clickToSelect||this.#o||(this.selectTarget(e,n),!this.focusChild&&document.activeElement!==this.parent&&n.contains(document.activeElement)&&this.parent.focus({preventScroll:!0}))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,o=i||a||n||r,s=this.childRoles.includes(`menuitem`);if(t===`Tab`&&s&&!n&&!r&&!a){e.preventDefault(),this.leaveMenu(i);return}if(o)return;let c=e.target,{activeMembers:l}=this;if(c!==this.parent&&c.matches(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)&&t!==`Escape`&&t!==`Tab`)return;let u=this.#_(c);[`Enter`,` `,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(t)&&e.preventDefault();let d=c===this.parent||c.matches(this.selector);if(t===`Home`||t===`End`){if(!d)return;e.preventDefault();let n=l[t===`Home`?0:l.length-1];n&&n!==u&&this.selectTarget(e,n);return}if(t.length===1&&t!==` `&&d&&(this.role===`listbox`||s)){e.preventDefault();let n=this.#v(t,u);n&&n!==u&&this.selectTarget(e,n);return}if(t===`Enter`){u?.click();return}if(t===` `){u&&this.selectTarget(e,u);return}if(t===`Escape`&&s){let{parentMenuItem:t}=this;if(t){e.preventDefault(),e.stopPropagation(),this.leaveSubmenu(t);return}}let f=Pc();if(this.orientation===`vertical`&&s){let{prevKey:e,nextKey:n}=_l(`horizontal`,f);if(t===n&&u?.getAttribute(`aria-haspopup`)===`menu`){this.enterSubmenu(u);return}if(t===e){let{parentMenuItem:e}=this;if(e){this.leaveSubmenu(e);return}}}let p=this.#y(t,u,f);p&&p!==u&&this.selectTarget(e,p)}#_(e){if(!this.focusChild)return this.activeMembers.find(e=>e.matches(`.focused`));let t=e.closest(this.selector);return t&&this.parent.contains(t)?t:void 0}#v(e,t){let{activeMembers:n}=this,r=yl(n.map(e=>gl(e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent??``)),this.#a.push(e),t?n.indexOf(t):-1);return r===-1?void 0:n[r]}#y(e,t,n){let{allMembers:r,activeMembers:i}=this;if(!this.grid){let r=t?i.indexOf(t):-1,a=_l(this.orientation,n);return i[yie({key:e,index:r,count:i.length,...a})]}let{columnCount:a}=this,o=r.filter(e=>e.getAttribute(`aria-hidden`)!==`true`),s=t?o.indexOf(t):-1,c=s===-1?i:o,l=_l(`horizontal`,n),u=c[bie({key:e,index:s,count:c.length,columnCount:a,...l})];return u?.matches(`[aria-disabled="true"]`)?void 0:u}destroy(){this.#e=!0,globalThis.clearTimeout(this.#t),this.#a.reset(),this.observer.disconnect(),this.selectionObserver?.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown)}onUpdate({searchTerms:e}){let t=gl(e),n=t?t.split(/\s+/):[],{allMembers:r,parent:i}=this,a=r.map(e=>{let t=this.#s(e),r=!n.every(e=>t.includes(e));return this.#i.get(e)!==r&&(this.#i.set(e,r),e.dispatchEvent(new CustomEvent(`Toggle`,{detail:{hidden:r}}))),r}).filter(e=>!e).length;i.dispatchEvent(new CustomEvent(`Filter`,{detail:{matched:a,total:r.length}}))}},El=e=>t=>{let n=typeof e==`function`,r=new wie(t,n?co(()=>e()):e);return n&&R(()=>{r.onUpdate(e())}),()=>{r.destroy()}},Tie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`]),Eie=V(`<div><div role="none" class="inner svelte-1muyued"><!></div></div>`),Die={hash:`svelte-1muyued`,code:`.select-button-group.svelte-1muyued {flex:none;display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);}.select-button-group.svelte-1muyued:focus-visible {outline-width:0 !important;}.select-button-group.svelte-1muyued button {margin:0 !important;border-radius:0 !important;color:var(--sui-primary-foreground-color);}.select-button-group.svelte-1muyued button:first-child {border-start-start-radius:4px !important;border-end-start-radius:4px !important;}.select-button-group.svelte-1muyued button:not(:first-child) {border-inline-start-width:0;}.select-button-group.svelte-1muyued button:last-child {border-start-end-radius:4px !important;border-end-end-radius:4px !important;}.select-button-group.svelte-1muyued button[aria-checked=true] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}.select-button-group[aria-invalid=true].svelte-1muyued button {border-color:var(--sui-error-border-color);}.select-button-group[aria-disabled=false].svelte-1muyued button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.select-button-group[aria-disabled=false].svelte-1muyued button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.select-button-group[aria-readonly=true].svelte-1muyued button {pointer-events:none;}.inner.svelte-1muyued {display:contents;}`};function Dl(e,t){k(t,!0),q(e,Die);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`readonly`,3,!1),a=Y(t,`required`,3,!1),o=Y(t,`invalid`,3,!1),s=Y(t,`ariaLabel`,3,void 0),c=gs(t,Tie);var l=Eie();us(l,()=>({...c,role:`radiogroup`,class:`sui select-button-group ${t.class??``}`,hidden:n(),tabindex:`-1`,"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-label":s()}),void 0,void 0,void 0,`svelte-1muyued`);var u=P(l);Uo(P(u),()=>t.children??jr),O(u),O(l),$o(l,El),z(()=>u.inert=r()),W(e,l),A()}var Oie=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`class`,`onChange`]);function Ol(e,t){k(t,!0);let n=Y(t,`selected`,15,!1),r=gs(t,Oie);ll(e,_s(()=>r,{role:`radio`,get class(){return`sui select-button ${t.class??``}`},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)}})),A()}var kie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`popupPosition`,`popupPositionBaseElement`,`showPopupBackdrop`,`label`,`variant`,`size`,`iconic`,`children`,`startIcon`,`endIcon`,`popup`]),Aie=V(`<!> <!>`,1);function kl(e,t){k(t,!0);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`popupPosition`,3,`bottom-left`),a=Y(t,`popupPositionBaseElement`,3,void 0),o=Y(t,`showPopupBackdrop`,3,!1),s=Y(t,`label`,3,``),c=Y(t,`variant`,3,void 0),l=Y(t,`size`,3,`medium`),u=Y(t,`iconic`,3,!1),d=gs(t,kie),f=M(void 0);var p={focus:()=>{B(f)?.focus()}},m=Aie(),h=F(m);return ll(h,_s(()=>d,{get class(){return`sui menu-button ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get label(){return s()},get variant(){return c()},get size(){return l()},get iconic(){return u()},"aria-haspopup":`menu`,get element(){return B(f)},set element(e){N(f,e,!0)},startIcon:e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},children:e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)},endIcon:e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.endIcon),W(e,n)},a=e=>{Lc(e,{name:`more_vert`})},o=e=>{Lc(e,{name:`arrow_drop_down`,class:`small-arrow`})};K(r,e=>{t.endIcon?e(i):u()?e(a,1):e(o,-1)}),W(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),cl(L(h,2),{get anchor(){return B(f)},get position(){return i()},get positionBaseElement(){return a()},get showBackdrop(){return o()},children:(e,n)=>{var r=U();Uo(F(r),()=>t.popup??jr),W(e,r)},$$slots:{default:!0}}),W(e,m),A(p)}var jie=new Set([`$$slots`,`$$events`,`$$legacy`,`hidden`,`disabled`,`label`,`variant`,`size`,`popupPosition`,`showPopupBackdrop`,`chevronIcon`,`popup`]),Mie=V(`<div role="group" class="sui split-button svelte-3n9pfd"><!> <!></div>`),Nie={hash:`svelte-3n9pfd`,code:`.split-button.svelte-3n9pfd {flex:none;display:inline-flex;margin:var(--sui-focus-ring-width);}.split-button.svelte-3n9pfd button {margin:0;}.split-button.svelte-3n9pfd button.menu-button {border-inline-start-width:0;border-start-start-radius:0;border-end-start-radius:0;aspect-ratio:3/4;}.split-button.svelte-3n9pfd button:not(.menu-button) {border-start-end-radius:0;border-end-end-radius:0;}`};function Al(e,t){k(t,!0),q(e,Nie);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`label`,3,``),a=Y(t,`variant`,3,void 0),o=Y(t,`size`,3,`medium`),s=Y(t,`popupPosition`,3,`bottom-left`),c=Y(t,`showPopupBackdrop`,3,!1),l=gs(t,jie),u=M(void 0);var d=Mie(),f=P(d);ll(f,_s(()=>l,{get hidden(){return n()},get disabled(){return r()},get label(){return i()},get variant(){return a()},get size(){return o()}}));var p=L(f,2);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{Lc(e,{name:`arrow_drop_down`,class:`small-arrow`})};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),W(e,n)},i=e=>{var n=U();Uo(F(n),()=>t.popup??jr),W(e,n)},l=j(()=>X(`_sui.split_button.more_options`));kl(p,{iconic:!0,get hidden(){return n()},get disabled(){return r()},get variant(){return a()},get size(){return o()},get"aria-label"(){return B(l)},get popupPosition(){return s()},get popupPositionBaseElement(){return B(u)},get showPopupBackdrop(){return c()},endIcon:e,popup:i,$$slots:{endIcon:!0,popup:!0}})}O(d),ms(d,e=>N(u,e),()=>B(u)),z(e=>{J(d,`hidden`,n()),J(d,`aria-hidden`,n()),J(d,`aria-disabled`,r()),J(d,`aria-label`,e)},[()=>X(`_sui.split_button.x_options`,{values:{name:i()}})]),W(e,d),A()}var Pie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`ariaLabel`,`children`]),Fie=V(`<div><div role="none" class="inner svelte-w8d0de"><!></div></div>`),Iie={hash:`svelte-w8d0de`,code:`.checkbox-group.svelte-w8d0de {display:inline-flex;}.checkbox-group.horizontal.svelte-w8d0de {gap:8px;align-items:center;flex-wrap:wrap;}.checkbox-group.vertical.svelte-w8d0de {gap:4px;flex-direction:column;}
|
||
@media (pointer: coarse) {.checkbox-group.vertical.svelte-w8d0de {gap:8px;}
|
||
}.inner.svelte-w8d0de {display:contents;}`};function Lie(e,t){k(t,!0),q(e,Iie);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`orientation`,3,`horizontal`),a=Y(t,`ariaLabel`,3,void 0),o=gs(t,Pie);var s=Fie();us(s,e=>({...o,role:`group`,class:[`sui`,`checkbox-group`,t.class,i()],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-roledescription":e,"aria-label":a()}),[()=>X(`_sui.role_descriptions.checkbox_group`)],void 0,void 0,`svelte-w8d0de`);var c=P(s);Uo(P(c),()=>t.children??jr),O(c),O(s),z(()=>c.inert=r()),W(e,s),A()}var Rie=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`name`,`value`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`label`,`ariaLabel`,`group`,`onChange`,`children`,`checkIcon`]),zie=V(`<label class="svelte-1qs7yhc"><!></label>`),Bie=V(`<div role="none"><div role="none" class="inner svelte-1qs7yhc"><!> <!></div></div>`),Vie={hash:`svelte-1qs7yhc`,code:`.checkbox.svelte-1qs7yhc {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.checkbox.svelte-1qs7yhc:hover button {background-color:var(--sui-hover-background-color);}.checkbox.svelte-1qs7yhc:hover button[aria-checked=true] {background-color:var(--sui-primary-accent-color-light);}.checkbox.svelte-1qs7yhc:active button {background-color:var(--sui-active-background-color);}.checkbox.svelte-1qs7yhc:active button[aria-checked=true] {background-color:var(--sui-primary-accent-color-dark);}.checkbox.svelte-1qs7yhc button {flex:none;align-items:center;justify-content:center;overflow:hidden;margin:0 !important;border-width:var(--sui-checkbox-border-width, 1.5px);border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-border-radius);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);color:var(--sui-primary-accent-text-color);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.checkbox.svelte-1qs7yhc button[aria-checked=true] {border-color:var(--sui-checkbox-border-color-checked, var(--sui-primary-accent-color));color:var(--sui-checkbox-foreground-color-checked, var(--sui-primary-accent-color-inverted));background-color:var(--sui-checkbox-background-color-checked, var(--sui-primary-accent-color));}.checkbox.svelte-1qs7yhc button[aria-invalid=true] {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);}.checkbox.svelte-1qs7yhc button[aria-checked=true][aria-invalid=true] {background-color:var(--sui-checkbox-background-color);}.checkbox.svelte-1qs7yhc button .icon {font-size:calc(var(--sui-checkbox-height) - 2px);}.checkbox.svelte-1qs7yhc label:where(.svelte-1qs7yhc) {cursor:inherit;}.checkbox.readonly.svelte-1qs7yhc {cursor:default;}.checkbox.readonly.svelte-1qs7yhc button, .checkbox.readonly.svelte-1qs7yhc:is(:where(.svelte-1qs7yhc):hover, :where(.svelte-1qs7yhc):active) button {background-color:var(--sui-checkbox-background-color);}.checkbox.readonly.svelte-1qs7yhc button[aria-checked='true']:not([aria-invalid='true']), .checkbox.readonly.svelte-1qs7yhc:is(:where(.svelte-1qs7yhc):hover, :where(.svelte-1qs7yhc):active) button[aria-checked='true']:not([aria-invalid='true']) {border-color:var(--sui-readonly-accent-color);color:var(--sui-readonly-accent-color-inverted);background-color:var(--sui-readonly-accent-color);}.inner.svelte-1qs7yhc {display:contents;}`};function jl(e,t){let n=Co();k(t,!0),q(e,Vie);let r=Y(t,`checked`,15,!1),i=Y(t,`name`,3,void 0),a=Y(t,`value`,3,void 0),o=Y(t,`hidden`,3,!1),s=Y(t,`disabled`,3,!1),c=Y(t,`readonly`,3,!1),l=Y(t,`required`,3,!1),u=Y(t,`invalid`,3,!1),d=Y(t,`label`,3,void 0),f=Y(t,`ariaLabel`,3,void 0),p=Y(t,`group`,15),m=gs(t,Rie),h=M(void 0),g=j(()=>f()??m[`aria-label`]),_=j(()=>!!(t.children||d())),v=j(()=>r()===`mixed`);R(()=>{Array.isArray(p())&&(p().includes(a())?r()!==!0&&r(!0):r()!==!1&&r(!1))});var y=Bie();let b;var x=P(y),S=P(x);{let e=e=>{var n=U(),i=F(n),a=e=>{var n=U();Uo(F(n),()=>t.checkIcon),W(e,n)},o=e=>{Lc(e,{name:`remove`})},s=e=>{Lc(e,{name:`check`})};K(i,e=>{t.checkIcon?e(a):B(v)?e(o,1):r()&&e(s,2)}),W(e,n)},d=j(()=>B(g)||void 0),f=j(()=>!B(g)&&B(_)?`${n}-label`:void 0);ll(S,_s(()=>m,{role:`checkbox`,get id(){return n},get name(){return i()},get value(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get"aria-required"(){return l()},get"aria-invalid"(){return u()},get"aria-checked"(){return r()},get"aria-label"(){return B(d)},get"aria-labelledby"(){return B(f)},onclick:e=>{e.preventDefault(),e.stopPropagation(),s()||c()||(r(B(v)?!0:!r()),Array.isArray(p())&&(r()?p().includes(a())||p([...p(),a()]):p().includes(a())&&p(p().filter(e=>e!==a()))),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:r()}})))},get element(){return B(h)},set element(e){N(h,e,!0)},startIcon:e,$$slots:{startIcon:!0}}))}var C=L(S,2),w=e=>{var r=zie(),i=P(r),a=e=>{var n=U();Uo(F(n),()=>t.children),W(e,n)},o=e=>{var t=H();z(()=>G(t,d())),W(e,t)};K(i,e=>{t.children?e(a):e(o,-1)}),O(r),z(()=>J(r,`id`,`${n}-label`)),W(e,r)};K(C,e=>{B(_)&&e(w)}),O(x),O(y),z(()=>{b=rs(y,1,`sui checkbox ${t.class??``}`,`svelte-1qs7yhc`,b,{checked:r(),indeterminate:B(v),disabled:s(),readonly:c()}),J(y,`hidden`,o()),x.inert=s()}),_o(`click`,y,e=>{e.preventDefault(),e.stopPropagation(),e.target.matches(`button`)||B(h)?.click()}),W(e,y),A()}vo([`click`]);var Hie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`flex`]),Uie=V(`<div></div>`),Wie={hash:`svelte-91ytvl`,code:`.spacer.flex.svelte-91ytvl:not([hidden]) {display:block;flex:auto;}.spacer.svelte-91ytvl:not(.flex) {width:8px;height:8px;}`};function Ml(e,t){q(e,Wie);let n=Y(t,`flex`,3,!1),r=gs(t,Hie);var i=Uie();us(i,()=>({...r,role:`none`,class:`sui spacer ${t.class??``}`,[cs]:{flex:n()}}),void 0,void 0,void 0,`svelte-91ytvl`),W(e,i)}function Nl(e,t){k(t,!0);let n=Y(t,`class`,3,void 0),r=Y(t,`closeIcon`,3,void 0);{let i=e=>{var t=U(),n=F(t),i=e=>{var t=U();Uo(F(t),r),W(e,t)},a=e=>{Lc(e,{name:`close`})};K(n,e=>{r()?e(i):e(a,-1)}),W(e,t)},a=j(()=>X(`_sui.close`));ll(e,{variant:`ghost`,iconic:!0,get class(){return n()},get"aria-label"(){return B(a)},get"aria-controls"(){return t.controls},onclick:()=>{t.onClose()},startIcon:i,$$slots:{startIcon:!0}})}A()}var Gie=new Set(`$$slots.$$events.$$legacy.open.value.title.ariaLabelledby.role.size.class.showClose.showOk.showCancel.okLabel.okShortcuts.okDisabled.cancelLabel.cancelShortcuts.cancelDisabled.focusInput.children.header.headerExtra.footer.footerExtra.closeIcon.input`.split(`.`)),Kie=V(`<div role="none" class="title svelte-i5bh32"> </div> <!> <!> <!>`,1),qie=V(`<div role="none" class="header svelte-i5bh32"><!></div>`),Jie=V(`<!> <!> <!> <!>`,1),Yie=V(`<div role="none" class="footer svelte-i5bh32"><!></div>`),Xie=V(`<div role="none"><!> <div role="none" class="body svelte-i5bh32"><!></div> <!></div>`),Zie={hash:`svelte-i5bh32`,code:`.content.svelte-i5bh32 {position:relative;display:flex;flex-direction:column;overflow:hidden;border-width:var(--sui-dialog-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-dialog-content-border-color, var(--sui-primary-border-color));border-radius:var(--sui-dialog-content-border-radius, 4px);max-width:calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);background-color:var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));box-shadow:var(--sui-dialog-content-box-shadow, 0 8px 16px var(--sui-popup-shadow-color));-webkit-backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));transition-property:transform;}dialog.open .content.svelte-i5bh32 {transition-duration:150ms;transform:scale(100%);}dialog:not(.open) .content.svelte-i5bh32 {transition-duration:300ms;transform:scale(90%);}.content.x-small.svelte-i5bh32 {width:var(--sui-dialog-x-small-content-width, var(--sui-dialog-content-width, 300px));max-height:var(--sui-dialog-x-small-content-max-height, var(--sui-dialog-content-max-height, 300px));--sui-textbox-singleline-min-width: 0;}
|
||
@media (max-height: 300px) {.content.x-small.svelte-i5bh32 {max-height:calc(100dvh - 32px);}
|
||
}.content.small.svelte-i5bh32 {width:var(--sui-dialog-small-content-width, var(--sui-dialog-content-width, 400px));max-height:var(--sui-dialog-small-content-max-height, var(--sui-dialog-content-max-height, 400px));}
|
||
@media (max-height: 400px) {.content.small.svelte-i5bh32 {max-height:calc(100dvh - 32px);}
|
||
}.content.medium.svelte-i5bh32 {width:var(--sui-dialog-medium-content-width, var(--sui-dialog-content-width, 600px));max-height:var(--sui-dialog-medium-content-max-height, var(--sui-dialog-content-max-height, 600px));}
|
||
@media (max-height: 600px) {.content.medium.svelte-i5bh32 {max-height:calc(100dvh - 32px);}
|
||
}.content.large.svelte-i5bh32 {width:var(--sui-dialog-large-content-width, var(--sui-dialog-content-width, 800px));max-height:var(--sui-dialog-large-content-max-height, var(--sui-dialog-content-max-height, 800px));}
|
||
@media (max-height: 800px) {.content.large.svelte-i5bh32 {max-height:calc(100dvh - 32px);}
|
||
}.content.x-large.svelte-i5bh32 {width:var(--sui-dialog-x-large-content-width, var(--sui-dialog-content-width, 1000px));max-height:var(--sui-dialog-x-large-content-max-height, var(--sui-dialog-content-max-height, 1000px));}
|
||
@media (max-height: 1000px) {.content.x-large.svelte-i5bh32 {max-height:calc(100dvh - 32px);}
|
||
}:is(.header.svelte-i5bh32, .footer.svelte-i5bh32) {display:flex;align-items:center;gap:4px;}.header.svelte-i5bh32 {box-sizing:content-box;margin:var(--sui-dialog-header-margin, 0 16px);border-width:var(--sui-dialog-header-border-width, 0 0 1px);border-color:var(--sui-dialog-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-dialog-header-padding, 16px 8px);height:var(--sui-dialog-header-height, 32px);}.header.svelte-i5bh32 .title:where(.svelte-i5bh32) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-i5bh32 {margin:var(--sui-dialog-footer-margin, 0 24px 24px);}
|
||
@media (width < 768px) {.footer.svelte-i5bh32 {margin:var(--sui-dialog-footer-margin, 0 16px 16px);}
|
||
}.body.svelte-i5bh32 {overflow:auto;margin:var(--sui-dialog-body-margin, 24px 24px);white-space:normal;line-height:var(--sui-line-height-compact);}
|
||
@media (width < 768px) {.body.svelte-i5bh32 {margin:var(--sui-dialog-body-margin, 16px 16px);}
|
||
}`};function Pl(e,t){let n=Co();k(t,!0),q(e,Zie);let r=Y(t,`open`,15,!1);Y(t,`value`,11,``);let i=Y(t,`ariaLabelledby`,3,void 0),a=Y(t,`role`,3,`dialog`),o=Y(t,`size`,3,`medium`),s=Y(t,`showClose`,3,!1),c=Y(t,`showOk`,3,!0),l=Y(t,`showCancel`,3,!0),u=Y(t,`okLabel`,3,``),d=Y(t,`okShortcuts`,3,void 0),f=Y(t,`okDisabled`,3,!1),p=Y(t,`cancelLabel`,3,``),m=Y(t,`cancelShortcuts`,3,void 0),h=Y(t,`cancelDisabled`,3,!1),g=Y(t,`focusInput`,3,!0),_=gs(t,Gie),v=j(()=>i()??(!t.header&&t.title?`${n}-title`:void 0)),y=j(()=>B(v)?void 0:t.title||void 0),b=M(void 0),x=M(void 0);R(()=>{if(r()&&B(x)){let e=!1;return(async()=>{if(await Zc(50),e||B(x)?.contains(document.activeElement))return;let t=g()?B(x)?.querySelector(`input, button.primary`):null;t?(t.focus(),t instanceof HTMLInputElement&&t.select()):B(b)?.focus()})(),()=>{e=!0}}}),ms(sl(e,_s(()=>_,{get role(){return a()},get id(){return n},class:`dialog`,get"aria-label"(){return B(y)},get"aria-labelledby"(){return B(v)},get"aria-describedby"(){return`${n}-body`},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=Xie(),a=P(i),g=e=>{var r=qie(),i=P(r),a=e=>{var n=U();Uo(F(n),()=>t.header),W(e,n)},o=e=>{var r=Kie(),i=F(r),a=I(i,!0),o=L(i,2);Ml(o,{flex:!0});var c=L(o,2);Uo(c,()=>t.headerExtra??jr);var l=L(c,2),u=e=>{Nl(e,{get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{B(b)?.close(`close`)}})};K(l,e=>{s()&&e(u)}),z(()=>{J(i,`id`,`${n}-title`),G(a,t.title)}),W(e,r)};K(i,e=>{t.header?e(a):e(o,-1)}),O(r),W(e,r)};K(a,e=>{(t.title||s()||t.header||t.headerExtra)&&e(g)});var _=L(a,2);Uo(P(_),()=>t.children??jr),O(_);var v=L(_,2),y=e=>{var n=Yie(),r=P(n),i=e=>{var n=U();Uo(F(n),()=>t.footer??jr),W(e,n)},a=e=>{var n=Jie(),r=F(n);Uo(r,()=>t.footerExtra??jr);var i=L(r,2);Ml(i,{flex:!0});var a=L(i,2),o=e=>{{let t=j(()=>u()||X(`_sui.ok`));ll(e,{variant:`primary`,get label(){return B(t)},get keyShortcuts(){return d()},get disabled(){return f()},onclick:()=>{B(b)?.close(`ok`)}})}};K(a,e=>{c()&&e(o)});var s=L(a,2),g=e=>{{let t=j(()=>p()||X(`_sui.cancel`));ll(e,{variant:`secondary`,get label(){return B(t)},get keyShortcuts(){return m()},get disabled(){return h()},onclick:()=>{B(b)?.close(`cancel`)}})}};K(s,e=>{l()&&e(g)}),W(e,n)};K(r,e=>{t.footer?e(i):e(a,-1)}),O(n),W(e,n)};K(v,e=>{(c()||l()||t.footer||t.footerExtra)&&e(y)}),O(i),ms(i,e=>N(x,e),()=>B(x)),z(()=>{rs(i,1,ts([`content`,t.class,o()]),`svelte-i5bh32`),J(_,`id`,`${n}-body`)}),W(e,i)},$$slots:{default:!0}})),e=>N(b,e,!0),()=>B(b)),A()}var Qie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Fl(e,t){k(t,!0);let n=Y(t,`open`,15,!1),r=gs(t,Qie);Pl(e,_s(()=>r,{role:`alertdialog`,showCancel:!1,get open(){return n()},set open(e){n(e)}})),A()}var $ie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Il(e,t){k(t,!0);let n=Y(t,`open`,15,!1),r=gs(t,$ie);Pl(e,_s(()=>r,{role:`alertdialog`,get open(){return n()},set open(e){n(e)}})),A()}var eae=`boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.paddingTop.paddingRight.paddingBottom.paddingLeft.fontFamily.fontSize.fontStretch.fontStyle.fontVariant.fontWeight.letterSpacing.lineHeight.tabSize.textAlign.textIndent.textTransform.wordBreak.wordSpacing.overflowWrap.direction`.split(`.`),tae=(e,t,n)=>{let r=e.getBoundingClientRect();if(!r.width&&!r.height)return;let i=globalThis.getComputedStyle(e),a=e.tagName===`INPUT`,o=document.createElement(`div`),s=document.createElement(`span`);eae.forEach(e=>{o.style[e]=i[e]}),Object.assign(o.style,{position:`absolute`,top:`0`,left:`0`,height:`auto`,minHeight:`0`,maxHeight:`none`,overflow:`hidden`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:a?`pre`:`pre-wrap`}),o.setAttribute(`aria-hidden`,`true`),o.textContent=e.value.slice(0,t),s.textContent=e.value.slice(t,n)||``,o.append(s),document.body.append(o);let c=o.getBoundingClientRect(),l=s.getClientRects(),u=l[l.length-1]??s.getBoundingClientRect(),d=u.top-c.top,f=u.left-c.left,p=u.right-c.left,m=u.height||Number.parseFloat(i.lineHeight)||0;o.remove();let h=r.top+d-e.scrollTop,g=r.left+f-e.scrollLeft,_=r.left+p-e.scrollLeft;return{top:h,bottom:h+m,left:g,right:_}},nae=/(?<=^|[\s([{"'«])(?::)(?<query>[a-zA-Z0-9_+-]{1,64})$/,Ll=/[-_]/,Rl,rae=e=>e.split(`
|
||
`).map(e=>{let[t,n,r=``]=e.split(` `),[i,...a]=n.split(` `);return{emoji:t,name:i,aliases:[...a,...r?r.split(` `):[]]}}),zl=(e,t)=>{let n=e.split(Ll);return e===t?0:e.startsWith(t)&&Ll.test(e.charAt(t.length))?1:n.includes(t)?2:e.startsWith(t)||n.some(e=>e.startsWith(t))?4:9},iae=(e,t)=>e.includes(t)?3:e.some(e=>e.startsWith(t))?5:9,aae=({name:e,aliases:t},n)=>{let r=zl(e,n),i=iae(t,n);return{rank:Math.min(r,i),nameRank:r}},oae=({name:e,aliases:t},n)=>{if(zl(e,n)<9)return e.split(Ll).length;let r=t.findIndex(e=>e===n||e.startsWith(n));return(r>-1?r:t.length)*100+t.length},sae=e=>{let t=e.toLowerCase();return t?(Rl??=rae(`😀 grinning face
|
||
😃 smiley smiling face open mouth
|
||
😄 smile smiling face open mouth eyes
|
||
😁 grin grinning face smiling eyes
|
||
😆 laughing satisfied smiling face open mouth tightly-closed eyes
|
||
😅 sweat_smile smiling face open mouth cold
|
||
🤣 rolling_on_the_floor_laughing
|
||
😂 joy face tears
|
||
🙂 slightly_smiling_face
|
||
🙃 upside_down_face upside-down
|
||
🫠 melting_face
|
||
😉 wink winking face
|
||
😊 blush smiling face eyes
|
||
😇 innocent smiling face halo
|
||
🥰 smiling_face_with_3_hearts eyes three
|
||
😍 heart_eyes smiling face heart-shaped
|
||
🤩 star-struck grinning_face_with_star_eyes
|
||
😘 kissing_heart face throwing kiss
|
||
😗 kissing face
|
||
☺️ relaxed white smiling face
|
||
😚 kissing_closed_eyes face
|
||
😙 kissing_smiling_eyes face
|
||
🥲 smiling_face_with_tear
|
||
😋 yum face savouring delicious food
|
||
😛 stuck_out_tongue face stuck-out
|
||
😜 stuck_out_tongue_winking_eye face stuck-out
|
||
🤪 zany_face grinning_face_with_one_large_and_one_small_eye
|
||
😝 stuck_out_tongue_closed_eyes face stuck-out tightly-closed
|
||
🤑 money_mouth_face money-mouth
|
||
🤗 hugging_face
|
||
🤭 face_with_hand_over_mouth smiling_face_with_smiling_eyes_and_hand_covering_mouth
|
||
🫢 face_with_open_eyes_and_hand_over_mouth
|
||
🫣 face_with_peeking_eye
|
||
🤫 shushing_face face_with_finger_covering_closed_lips
|
||
🤔 thinking_face
|
||
🫡 saluting_face
|
||
🤐 zipper_mouth_face zipper-mouth
|
||
🤨 face_with_raised_eyebrow face_with_one_eyebrow_raised
|
||
😐 neutral_face
|
||
😑 expressionless face
|
||
😶 no_mouth face without
|
||
🫥 dotted_line_face
|
||
😶🌫️ face_in_clouds
|
||
😏 smirk smirking face
|
||
😒 unamused face
|
||
🙄 face_with_rolling_eyes
|
||
😬 grimacing face
|
||
😮💨 face_exhaling
|
||
🤥 lying_face
|
||
🫨 shaking_face
|
||
🙂↔️ head_shaking_horizontally
|
||
🙂↕️ head_shaking_vertically
|
||
😌 relieved face
|
||
😔 pensive face
|
||
😪 sleepy face
|
||
🤤 drooling_face
|
||
😴 sleeping face
|
||
face_with_bags_under_eyes
|
||
😷 mask face medical
|
||
🤒 face_with_thermometer
|
||
🤕 face_with_head_bandage head-bandage
|
||
🤢 nauseated_face
|
||
🤮 face_vomiting face_with_open_mouth_vomiting
|
||
🤧 sneezing_face
|
||
🥵 hot_face overheated
|
||
🥶 cold_face freezing
|
||
🥴 woozy_face uneven eyes wavy mouth
|
||
😵 dizzy_face
|
||
😵💫 face_with_spiral_eyes
|
||
🤯 exploding_head shocked_face_with_exploding_head
|
||
🤠 face_with_cowboy_hat
|
||
🥳 partying_face party horn hat
|
||
🥸 disguised_face
|
||
😎 sunglasses smiling face
|
||
🤓 nerd_face
|
||
🧐 face_with_monocle
|
||
😕 confused face
|
||
🫤 face_with_diagonal_mouth
|
||
😟 worried face
|
||
🙁 slightly_frowning_face
|
||
☹️ white_frowning_face
|
||
😮 open_mouth face
|
||
😯 hushed face
|
||
😲 astonished face
|
||
😳 flushed face
|
||
🥺 pleading_face eyes
|
||
🥹 face_holding_back_tears
|
||
😦 frowning face open mouth
|
||
😧 anguished face
|
||
😨 fearful face
|
||
😰 cold_sweat face open mouth
|
||
😥 disappointed_relieved but face
|
||
😢 cry crying face
|
||
😭 sob loudly crying face
|
||
😱 scream face screaming fear
|
||
😖 confounded face
|
||
😣 persevere persevering face
|
||
😞 disappointed face
|
||
😓 sweat face cold
|
||
😩 weary face
|
||
😫 tired_face
|
||
🥱 yawning_face
|
||
😤 triumph face look
|
||
😡 rage pouting face
|
||
😠 angry face
|
||
🤬 face_with_symbols_on_mouth serious_face_with_symbols_covering_mouth
|
||
😈 smiling_imp face horns
|
||
👿 imp
|
||
💀 skull
|
||
☠️ skull_and_crossbones
|
||
💩 hankey poop shit pile poo
|
||
🤡 clown_face
|
||
👹 japanese_ogre
|
||
👺 japanese_goblin
|
||
👻 ghost
|
||
👽 alien extraterrestrial
|
||
👾 space_invader alien monster
|
||
🤖 robot_face
|
||
😺 smiley_cat smiling face open mouth
|
||
😸 smile_cat grinning face smiling eyes
|
||
😹 joy_cat face tears
|
||
😻 heart_eyes_cat smiling face heart-shaped
|
||
😼 smirk_cat face wry smile
|
||
😽 kissing_cat face closed eyes
|
||
🙀 scream_cat weary face
|
||
😿 crying_cat_face
|
||
😾 pouting_cat face
|
||
🙈 see_no_evil see-no-evil monkey
|
||
🙉 hear_no_evil hear-no-evil monkey
|
||
🙊 speak_no_evil speak-no-evil monkey
|
||
💌 love_letter
|
||
💘 cupid heart arrow
|
||
💝 gift_heart ribbon
|
||
💖 sparkling_heart
|
||
💗 heartpulse growing heart
|
||
💓 heartbeat beating heart
|
||
💞 revolving_hearts
|
||
💕 two_hearts
|
||
💟 heart_decoration
|
||
❣️ heavy_heart_exclamation_mark_ornament
|
||
💔 broken_heart
|
||
❤️🔥 heart_on_fire
|
||
❤️🩹 mending_heart
|
||
❤️ heart heavy black
|
||
🩷 pink_heart
|
||
🧡 orange_heart
|
||
💛 yellow_heart
|
||
💚 green_heart
|
||
💙 blue_heart
|
||
🩵 light_blue_heart
|
||
💜 purple_heart
|
||
🤎 brown_heart
|
||
🖤 black_heart
|
||
🩶 grey_heart
|
||
🤍 white_heart
|
||
💋 kiss mark
|
||
💯 100 hundred points symbol
|
||
💢 anger symbol
|
||
💥 boom collision symbol
|
||
💫 dizzy symbol
|
||
💦 sweat_drops splashing symbol
|
||
💨 dash symbol
|
||
🕳️ hole
|
||
💬 speech_balloon
|
||
👁️🗨️ eye-in-speech-bubble
|
||
🗨️ left_speech_bubble
|
||
🗯️ right_anger_bubble
|
||
💭 thought_balloon
|
||
💤 zzz sleeping symbol
|
||
👋 wave waving hand sign
|
||
🤚 raised_back_of_hand
|
||
🖐️ raised_hand_with_fingers_splayed
|
||
✋ hand raised_hand
|
||
🖖 spock-hand raised part between middle ring fingers
|
||
🫱 rightwards_hand
|
||
🫲 leftwards_hand
|
||
🫳 palm_down_hand
|
||
🫴 palm_up_hand
|
||
🫷 leftwards_pushing_hand
|
||
🫸 rightwards_pushing_hand
|
||
👌 ok_hand sign
|
||
🤌 pinched_fingers
|
||
🤏 pinching_hand
|
||
✌️ v victory hand
|
||
🤞 crossed_fingers hand_with_index_and_middle_fingers_crossed
|
||
🫰 hand_with_index_finger_and_thumb_crossed
|
||
🤟 i_love_you_hand_sign
|
||
🤘 the_horns sign_of_the_horns
|
||
🤙 call_me_hand
|
||
👈 point_left white pointing backhand index
|
||
👉 point_right white pointing backhand index
|
||
👆 point_up_2 white pointing backhand index
|
||
🖕 middle_finger reversed_hand_with_middle_finger_extended
|
||
👇 point_down white pointing backhand index
|
||
☝️ point_up white pointing index
|
||
🫵 index_pointing_at_the_viewer
|
||
👍 +1 thumbsup thumbs up sign
|
||
👎 -1 thumbsdown thumbs down sign
|
||
✊ fist raised
|
||
👊 facepunch punch fisted hand sign
|
||
🤛 left-facing_fist left-facing
|
||
🤜 right-facing_fist right-facing
|
||
👏 clap clapping hands sign
|
||
🙌 raised_hands person raising both celebration
|
||
🫶 heart_hands
|
||
👐 open_hands sign
|
||
🤲 palms_up_together
|
||
🤝 handshake
|
||
🙏 pray person folded hands
|
||
✍️ writing_hand
|
||
💅 nail_care polish
|
||
🤳 selfie
|
||
💪 muscle flexed biceps
|
||
🦾 mechanical_arm
|
||
🦿 mechanical_leg
|
||
🦵 leg
|
||
🦶 foot
|
||
👂 ear
|
||
🦻 ear_with_hearing_aid
|
||
👃 nose
|
||
🧠 brain
|
||
🫀 anatomical_heart
|
||
🫁 lungs
|
||
🦷 tooth
|
||
🦴 bone
|
||
👀 eyes
|
||
👁️ eye
|
||
👅 tongue
|
||
👄 lips mouth
|
||
🫦 biting_lip
|
||
👶 baby
|
||
🧒 child
|
||
👦 boy
|
||
👧 girl
|
||
🧑 adult
|
||
👱 person_with_blond_hair
|
||
👨 man
|
||
🧔 bearded_person
|
||
🧔♂️ man_with_beard
|
||
🧔♀️ woman_with_beard
|
||
👨🦰 red_haired_man hair
|
||
👨🦱 curly_haired_man hair
|
||
👨🦳 white_haired_man hair
|
||
👨🦲 bald_man
|
||
👩 woman
|
||
👩🦰 red_haired_woman hair
|
||
🧑🦰 red_haired_person hair
|
||
👩🦱 curly_haired_woman hair
|
||
🧑🦱 curly_haired_person hair
|
||
👩🦳 white_haired_woman hair
|
||
🧑🦳 white_haired_person hair
|
||
👩🦲 bald_woman
|
||
🧑🦲 bald_person
|
||
👱♀️ blond-haired-woman hair
|
||
👱♂️ blond-haired-man hair
|
||
🧓 older_adult
|
||
👴 older_man
|
||
👵 older_woman
|
||
🙍 person_frowning
|
||
🙍♂️ man-frowning
|
||
🙍♀️ woman-frowning
|
||
🙎 person_with_pouting_face
|
||
🙎♂️ man-pouting
|
||
🙎♀️ woman-pouting
|
||
🙅 no_good face gesture
|
||
🙅♂️ man-gesturing-no
|
||
🙅♀️ woman-gesturing-no
|
||
🙆 ok_woman face gesture
|
||
🙆♂️ man-gesturing-ok
|
||
🙆♀️ woman-gesturing-ok
|
||
💁 information_desk_person
|
||
💁♂️ man-tipping-hand
|
||
💁♀️ woman-tipping-hand
|
||
🙋 raising_hand happy person one
|
||
🙋♂️ man-raising-hand
|
||
🙋♀️ woman-raising-hand
|
||
🧏 deaf_person
|
||
🧏♂️ deaf_man
|
||
🧏♀️ deaf_woman
|
||
🙇 bow person bowing deeply
|
||
🙇♂️ man-bowing
|
||
🙇♀️ woman-bowing
|
||
🤦 face_palm
|
||
🤦♂️ man-facepalming
|
||
🤦♀️ woman-facepalming
|
||
🤷 shrug
|
||
🤷♂️ man-shrugging
|
||
🤷♀️ woman-shrugging
|
||
🧑⚕️ health_worker
|
||
👨⚕️ male-doctor man health worker
|
||
👩⚕️ female-doctor woman health worker
|
||
🧑🎓 student
|
||
👨🎓 male-student man
|
||
👩🎓 female-student woman
|
||
🧑🏫 teacher
|
||
👨🏫 male-teacher man
|
||
👩🏫 female-teacher woman
|
||
🧑⚖️ judge
|
||
👨⚖️ male-judge man
|
||
👩⚖️ female-judge woman
|
||
🧑🌾 farmer
|
||
👨🌾 male-farmer man
|
||
👩🌾 female-farmer woman
|
||
🧑🍳 cook
|
||
👨🍳 male-cook man
|
||
👩🍳 female-cook woman
|
||
🧑🔧 mechanic
|
||
👨🔧 male-mechanic man
|
||
👩🔧 female-mechanic woman
|
||
🧑🏭 factory_worker
|
||
👨🏭 male-factory-worker man
|
||
👩🏭 female-factory-worker woman
|
||
🧑💼 office_worker
|
||
👨💼 male-office-worker man
|
||
👩💼 female-office-worker woman
|
||
🧑🔬 scientist
|
||
👨🔬 male-scientist man
|
||
👩🔬 female-scientist woman
|
||
🧑💻 technologist
|
||
👨💻 male-technologist man
|
||
👩💻 female-technologist woman
|
||
🧑🎤 singer
|
||
👨🎤 male-singer man
|
||
👩🎤 female-singer woman
|
||
🧑🎨 artist
|
||
👨🎨 male-artist man
|
||
👩🎨 female-artist woman
|
||
🧑✈️ pilot
|
||
👨✈️ male-pilot man
|
||
👩✈️ female-pilot woman
|
||
🧑🚀 astronaut
|
||
👨🚀 male-astronaut man
|
||
👩🚀 female-astronaut woman
|
||
🧑🚒 firefighter
|
||
👨🚒 male-firefighter man
|
||
👩🚒 female-firefighter woman
|
||
👮 cop police officer
|
||
👮♂️ male-police-officer man
|
||
👮♀️ female-police-officer woman
|
||
🕵️ sleuth_or_spy detective
|
||
🕵️♂️ male-detective man
|
||
🕵️♀️ female-detective woman
|
||
💂 guardsman
|
||
💂♂️ male-guard man
|
||
💂♀️ female-guard woman
|
||
🥷 ninja
|
||
👷 construction_worker
|
||
👷♂️ male-construction-worker man
|
||
👷♀️ female-construction-worker woman
|
||
🫅 person_with_crown
|
||
🤴 prince
|
||
👸 princess
|
||
👳 man_with_turban
|
||
👳♂️ man-wearing-turban
|
||
👳♀️ woman-wearing-turban
|
||
👲 man_with_gua_pi_mao
|
||
🧕 person_with_headscarf
|
||
🤵 person_in_tuxedo man
|
||
🤵♂️ man_in_tuxedo
|
||
🤵♀️ woman_in_tuxedo
|
||
👰 bride_with_veil
|
||
👰♂️ man_with_veil
|
||
👰♀️ woman_with_veil
|
||
🤰 pregnant_woman
|
||
🫃 pregnant_man
|
||
🫄 pregnant_person
|
||
🤱 breast-feeding
|
||
👩🍼 woman_feeding_baby
|
||
👨🍼 man_feeding_baby
|
||
🧑🍼 person_feeding_baby
|
||
👼 angel baby
|
||
🎅 santa father christmas
|
||
🤶 mrs_claus mother_christmas
|
||
🧑🎄 mx_claus
|
||
🦸 superhero
|
||
🦸♂️ male_superhero man
|
||
🦸♀️ female_superhero woman
|
||
🦹 supervillain
|
||
🦹♂️ male_supervillain man
|
||
🦹♀️ female_supervillain woman
|
||
🧙 mage
|
||
🧙♂️ male_mage man
|
||
🧙♀️ female_mage woman
|
||
🧚 fairy
|
||
🧚♂️ male_fairy man
|
||
🧚♀️ female_fairy woman
|
||
🧛 vampire
|
||
🧛♂️ male_vampire man
|
||
🧛♀️ female_vampire woman
|
||
🧜 merperson
|
||
🧜♂️ merman
|
||
🧜♀️ mermaid
|
||
🧝 elf
|
||
🧝♂️ male_elf man
|
||
🧝♀️ female_elf woman
|
||
🧞 genie
|
||
🧞♂️ male_genie man
|
||
🧞♀️ female_genie woman
|
||
🧟 zombie
|
||
🧟♂️ male_zombie man
|
||
🧟♀️ female_zombie woman
|
||
🧌 troll
|
||
💆 massage face
|
||
💆♂️ man-getting-massage
|
||
💆♀️ woman-getting-massage
|
||
💇 haircut
|
||
💇♂️ man-getting-haircut
|
||
💇♀️ woman-getting-haircut
|
||
🚶 walking pedestrian
|
||
🚶♂️ man-walking
|
||
🚶♀️ woman-walking
|
||
🚶➡️ person_walking_facing_right
|
||
🚶♀️➡️ woman_walking_facing_right
|
||
🚶♂️➡️ man_walking_facing_right
|
||
🧍 standing_person
|
||
🧍♂️ man_standing
|
||
🧍♀️ woman_standing
|
||
🧎 kneeling_person
|
||
🧎♂️ man_kneeling
|
||
🧎♀️ woman_kneeling
|
||
🧎➡️ person_kneeling_facing_right
|
||
🧎♀️➡️ woman_kneeling_facing_right
|
||
🧎♂️➡️ man_kneeling_facing_right
|
||
🧑🦯 person_with_probing_cane white
|
||
🧑🦯➡️ person_with_white_cane_facing_right
|
||
👨🦯 man_with_probing_cane white
|
||
👨🦯➡️ man_with_white_cane_facing_right
|
||
👩🦯 woman_with_probing_cane white
|
||
👩🦯➡️ woman_with_white_cane_facing_right
|
||
🧑🦼 person_in_motorized_wheelchair
|
||
🧑🦼➡️ person_in_motorized_wheelchair_facing_right
|
||
👨🦼 man_in_motorized_wheelchair
|
||
👨🦼➡️ man_in_motorized_wheelchair_facing_right
|
||
👩🦼 woman_in_motorized_wheelchair
|
||
👩🦼➡️ woman_in_motorized_wheelchair_facing_right
|
||
🧑🦽 person_in_manual_wheelchair
|
||
🧑🦽➡️ person_in_manual_wheelchair_facing_right
|
||
👨🦽 man_in_manual_wheelchair
|
||
👨🦽➡️ man_in_manual_wheelchair_facing_right
|
||
👩🦽 woman_in_manual_wheelchair
|
||
👩🦽➡️ woman_in_manual_wheelchair_facing_right
|
||
🏃 runner running
|
||
🏃♂️ man-running
|
||
🏃♀️ woman-running
|
||
🏃➡️ person_running_facing_right
|
||
🏃♀️➡️ woman_running_facing_right
|
||
🏃♂️➡️ man_running_facing_right
|
||
💃 dancer
|
||
🕺 man_dancing
|
||
🕴️ man_in_business_suit_levitating person
|
||
👯 dancers woman bunny ears
|
||
👯♂️ men-with-bunny-ears-partying man-with-bunny-ears-partying
|
||
👯♀️ women-with-bunny-ears-partying woman-with-bunny-ears-partying
|
||
🧖 person_in_steamy_room
|
||
🧖♂️ man_in_steamy_room
|
||
🧖♀️ woman_in_steamy_room
|
||
🧗 person_climbing
|
||
🧗♂️ man_climbing
|
||
🧗♀️ woman_climbing
|
||
🤺 fencer
|
||
🏇 horse_racing
|
||
⛷️ skier
|
||
🏂 snowboarder
|
||
🏌️ golfer person golfing
|
||
🏌️♂️ man-golfing
|
||
🏌️♀️ woman-golfing
|
||
🏄 surfer
|
||
🏄♂️ man-surfing
|
||
🏄♀️ woman-surfing
|
||
🚣 rowboat
|
||
🚣♂️ man-rowing-boat
|
||
🚣♀️ woman-rowing-boat
|
||
🏊 swimmer
|
||
🏊♂️ man-swimming
|
||
🏊♀️ woman-swimming
|
||
⛹️ person_with_ball bouncing
|
||
⛹️♂️ man-bouncing-ball
|
||
⛹️♀️ woman-bouncing-ball
|
||
🏋️ weight_lifter person lifting weights
|
||
🏋️♂️ man-lifting-weights
|
||
🏋️♀️ woman-lifting-weights
|
||
🚴 bicyclist
|
||
🚴♂️ man-biking
|
||
🚴♀️ woman-biking
|
||
🚵 mountain_bicyclist
|
||
🚵♂️ man-mountain-biking
|
||
🚵♀️ woman-mountain-biking
|
||
🤸 person_doing_cartwheel
|
||
🤸♂️ man-cartwheeling
|
||
🤸♀️ woman-cartwheeling
|
||
🤼 wrestlers
|
||
🤼♂️ man-wrestling men
|
||
🤼♀️ woman-wrestling women
|
||
🤽 water_polo
|
||
🤽♂️ man-playing-water-polo
|
||
🤽♀️ woman-playing-water-polo
|
||
🤾 handball
|
||
🤾♂️ man-playing-handball
|
||
🤾♀️ woman-playing-handball
|
||
🤹 juggling
|
||
🤹♂️ man-juggling
|
||
🤹♀️ woman-juggling
|
||
🧘 person_in_lotus_position
|
||
🧘♂️ man_in_lotus_position
|
||
🧘♀️ woman_in_lotus_position
|
||
🛀 bath
|
||
🛌 sleeping_accommodation
|
||
🧑🤝🧑 people_holding_hands
|
||
👭 two_women_holding_hands women_holding_hands
|
||
👫 man_and_woman_holding_hands woman_and_man_holding_hands couple
|
||
👬 two_men_holding_hands men_holding_hands
|
||
💏 couplekiss kiss
|
||
👩❤️💋👨 woman-kiss-man
|
||
👨❤️💋👨 man-kiss-man
|
||
👩❤️💋👩 woman-kiss-woman
|
||
💑 couple_with_heart
|
||
👩❤️👨 woman-heart-man couple
|
||
👨❤️👨 man-heart-man couple
|
||
👩❤️👩 woman-heart-woman couple
|
||
👨👩👦 man-woman-boy family
|
||
👨👩👧 man-woman-girl family
|
||
👨👩👧👦 man-woman-girl-boy family
|
||
👨👩👦👦 man-woman-boy-boy family
|
||
👨👩👧👧 man-woman-girl-girl family
|
||
👨👨👦 man-man-boy family
|
||
👨👨👧 man-man-girl family
|
||
👨👨👧👦 man-man-girl-boy family
|
||
👨👨👦👦 man-man-boy-boy family
|
||
👨👨👧👧 man-man-girl-girl family
|
||
👩👩👦 woman-woman-boy family
|
||
👩👩👧 woman-woman-girl family
|
||
👩👩👧👦 woman-woman-girl-boy family
|
||
👩👩👦👦 woman-woman-boy-boy family
|
||
👩👩👧👧 woman-woman-girl-girl family
|
||
👨👦 man-boy family
|
||
👨👦👦 man-boy-boy family
|
||
👨👧 man-girl family
|
||
👨👧👦 man-girl-boy family
|
||
👨👧👧 man-girl-girl family
|
||
👩👦 woman-boy family
|
||
👩👦👦 woman-boy-boy family
|
||
👩👧 woman-girl family
|
||
👩👧👦 woman-girl-boy family
|
||
👩👧👧 woman-girl-girl family
|
||
🗣️ speaking_head_in_silhouette
|
||
👤 bust_in_silhouette
|
||
👥 busts_in_silhouette
|
||
🫂 people_hugging
|
||
👪 family
|
||
🧑🧑🧒 family_adult_adult_child
|
||
🧑🧑🧒🧒 family_adult_adult_child_child
|
||
🧑🧒 family_adult_child
|
||
🧑🧒🧒 family_adult_child_child
|
||
👣 footprints
|
||
fingerprint
|
||
🐵 monkey_face
|
||
🐒 monkey
|
||
🦍 gorilla
|
||
🦧 orangutan
|
||
🐶 dog face
|
||
🐕 dog2 dog
|
||
🦮 guide_dog
|
||
🐕🦺 service_dog
|
||
🐩 poodle
|
||
🐺 wolf face
|
||
🦊 fox_face
|
||
🦝 raccoon
|
||
🐱 cat face
|
||
🐈 cat2 cat
|
||
🐈⬛ black_cat
|
||
🦁 lion_face
|
||
🐯 tiger face
|
||
🐅 tiger2 tiger
|
||
🐆 leopard
|
||
🐴 horse face
|
||
🫎 moose
|
||
🫏 donkey
|
||
🐎 racehorse horse
|
||
🦄 unicorn_face
|
||
🦓 zebra_face
|
||
🦌 deer
|
||
🦬 bison
|
||
🐮 cow face
|
||
🐂 ox
|
||
🐃 water_buffalo
|
||
🐄 cow2 cow
|
||
🐷 pig face
|
||
🐖 pig2 pig
|
||
🐗 boar
|
||
🐽 pig_nose
|
||
🐏 ram
|
||
🐑 sheep
|
||
🐐 goat
|
||
🐪 dromedary_camel
|
||
🐫 camel bactrian
|
||
🦙 llama
|
||
🦒 giraffe_face
|
||
🐘 elephant
|
||
🦣 mammoth
|
||
🦏 rhinoceros
|
||
🦛 hippopotamus
|
||
🐭 mouse face
|
||
🐁 mouse2 mouse
|
||
🐀 rat
|
||
🐹 hamster face
|
||
🐰 rabbit face
|
||
🐇 rabbit2 rabbit
|
||
🐿️ chipmunk
|
||
🦫 beaver
|
||
🦔 hedgehog
|
||
🦇 bat
|
||
🐻 bear face
|
||
🐻❄️ polar_bear
|
||
🐨 koala
|
||
🐼 panda_face
|
||
🦥 sloth
|
||
🦦 otter
|
||
🦨 skunk
|
||
🦘 kangaroo
|
||
🦡 badger
|
||
🐾 feet paw_prints
|
||
🦃 turkey
|
||
🐔 chicken
|
||
🐓 rooster
|
||
🐣 hatching_chick
|
||
🐤 baby_chick
|
||
🐥 hatched_chick front-facing baby
|
||
🐦 bird
|
||
🐧 penguin
|
||
🕊️ dove_of_peace
|
||
🦅 eagle
|
||
🦆 duck
|
||
🦢 swan
|
||
🦉 owl
|
||
🦤 dodo
|
||
🪶 feather
|
||
🦩 flamingo
|
||
🦚 peacock
|
||
🦜 parrot
|
||
🪽 wing
|
||
🐦⬛ black_bird
|
||
🪿 goose
|
||
🐦🔥 phoenix
|
||
🐸 frog face
|
||
🐊 crocodile
|
||
🐢 turtle
|
||
🦎 lizard
|
||
🐍 snake
|
||
🐲 dragon_face
|
||
🐉 dragon
|
||
🦕 sauropod
|
||
🦖 t-rex
|
||
🐳 whale spouting
|
||
🐋 whale2 whale
|
||
🐬 dolphin flipper
|
||
🦭 seal
|
||
🐟 fish
|
||
🐠 tropical_fish
|
||
🐡 blowfish
|
||
🦈 shark
|
||
🐙 octopus
|
||
🐚 shell spiral
|
||
🪸 coral
|
||
🪼 jellyfish
|
||
🦀 crab
|
||
🦞 lobster
|
||
🦐 shrimp
|
||
🦑 squid
|
||
🦪 oyster
|
||
🐌 snail
|
||
🦋 butterfly
|
||
🐛 bug
|
||
🐜 ant
|
||
🐝 bee honeybee
|
||
🪲 beetle
|
||
🐞 ladybug lady_beetle
|
||
🦗 cricket
|
||
🪳 cockroach
|
||
🕷️ spider
|
||
🕸️ spider_web
|
||
🦂 scorpion
|
||
🦟 mosquito
|
||
🪰 fly
|
||
🪱 worm
|
||
🦠 microbe
|
||
💐 bouquet
|
||
🌸 cherry_blossom
|
||
💮 white_flower
|
||
🪷 lotus
|
||
🏵️ rosette
|
||
🌹 rose
|
||
🥀 wilted_flower
|
||
🌺 hibiscus
|
||
🌻 sunflower
|
||
🌼 blossom
|
||
🌷 tulip
|
||
🪻 hyacinth
|
||
🌱 seedling
|
||
🪴 potted_plant
|
||
🌲 evergreen_tree
|
||
🌳 deciduous_tree
|
||
🌴 palm_tree
|
||
🌵 cactus
|
||
🌾 ear_of_rice
|
||
🌿 herb
|
||
☘️ shamrock
|
||
🍀 four_leaf_clover
|
||
🍁 maple_leaf
|
||
🍂 fallen_leaf
|
||
🍃 leaves leaf fluttering wind
|
||
🪹 empty_nest
|
||
🪺 nest_with_eggs
|
||
🍄 mushroom
|
||
leafless_tree
|
||
🍇 grapes
|
||
🍈 melon
|
||
🍉 watermelon
|
||
🍊 tangerine
|
||
🍋 lemon
|
||
🍋🟩 lime
|
||
🍌 banana
|
||
🍍 pineapple
|
||
🥭 mango
|
||
🍎 apple red
|
||
🍏 green_apple
|
||
🍐 pear
|
||
🍑 peach
|
||
🍒 cherries
|
||
🍓 strawberry
|
||
🫐 blueberries
|
||
🥝 kiwifruit
|
||
🍅 tomato
|
||
🫒 olive
|
||
🥥 coconut
|
||
🥑 avocado
|
||
🍆 eggplant aubergine
|
||
🥔 potato
|
||
🥕 carrot
|
||
🌽 corn ear maize
|
||
🌶️ hot_pepper
|
||
🫑 bell_pepper
|
||
🥒 cucumber
|
||
🥬 leafy_green
|
||
🥦 broccoli
|
||
🧄 garlic
|
||
🧅 onion
|
||
🥜 peanuts
|
||
🫘 beans
|
||
🌰 chestnut
|
||
🫚 ginger_root
|
||
🫛 pea_pod
|
||
🍄🟫 brown_mushroom
|
||
root_vegetable
|
||
🍞 bread
|
||
🥐 croissant
|
||
🥖 baguette_bread
|
||
🫓 flatbread
|
||
🥨 pretzel
|
||
🥯 bagel
|
||
🥞 pancakes
|
||
🧇 waffle
|
||
🧀 cheese_wedge
|
||
🍖 meat_on_bone
|
||
🍗 poultry_leg
|
||
🥩 cut_of_meat
|
||
🥓 bacon
|
||
🍔 hamburger
|
||
🍟 fries french
|
||
🍕 pizza slice
|
||
🌭 hotdog hot dog
|
||
🥪 sandwich
|
||
🌮 taco
|
||
🌯 burrito
|
||
🫔 tamale
|
||
🥙 stuffed_flatbread
|
||
🧆 falafel
|
||
🥚 egg
|
||
🍳 fried_egg cooking
|
||
🥘 shallow_pan_of_food
|
||
🍲 stew pot food
|
||
🫕 fondue
|
||
🥣 bowl_with_spoon
|
||
🥗 green_salad
|
||
🍿 popcorn
|
||
🧈 butter
|
||
🧂 salt shaker
|
||
🥫 canned_food
|
||
🍱 bento box
|
||
🍘 rice_cracker
|
||
🍙 rice_ball
|
||
🍚 rice cooked
|
||
🍛 curry rice
|
||
🍜 ramen steaming bowl
|
||
🍝 spaghetti
|
||
🍠 sweet_potato roasted
|
||
🍢 oden
|
||
🍣 sushi
|
||
🍤 fried_shrimp
|
||
🍥 fish_cake swirl design
|
||
🥮 moon_cake
|
||
🍡 dango
|
||
🥟 dumpling
|
||
🥠 fortune_cookie
|
||
🥡 takeout_box
|
||
🍦 icecream soft ice cream
|
||
🍧 shaved_ice
|
||
🍨 ice_cream
|
||
🍩 doughnut
|
||
🍪 cookie
|
||
🎂 birthday cake
|
||
🍰 cake shortcake
|
||
🧁 cupcake
|
||
🥧 pie
|
||
🍫 chocolate_bar
|
||
🍬 candy
|
||
🍭 lollipop
|
||
🍮 custard
|
||
🍯 honey_pot
|
||
🍼 baby_bottle
|
||
🥛 glass_of_milk
|
||
☕ coffee hot beverage
|
||
🫖 teapot
|
||
🍵 tea teacup without handle
|
||
🍶 sake bottle cup
|
||
🍾 champagne bottle popping cork
|
||
🍷 wine_glass
|
||
🍸 cocktail glass
|
||
🍹 tropical_drink
|
||
🍺 beer mug
|
||
🍻 beers clinking beer mugs
|
||
🥂 clinking_glasses
|
||
🥃 tumbler_glass
|
||
🫗 pouring_liquid
|
||
🥤 cup_with_straw
|
||
🧋 bubble_tea
|
||
🧃 beverage_box
|
||
🧉 mate_drink
|
||
🧊 ice_cube
|
||
🥢 chopsticks
|
||
🍽️ knife_fork_plate
|
||
🍴 fork_and_knife
|
||
🥄 spoon
|
||
🔪 hocho knife
|
||
🫙 jar
|
||
🏺 amphora
|
||
🌍 earth_africa globe europe-africa
|
||
🌎 earth_americas globe
|
||
🌏 earth_asia globe asia-australia
|
||
🌐 globe_with_meridians
|
||
🗺️ world_map
|
||
🗾 japan silhouette
|
||
🧭 compass
|
||
🏔️ snow_capped_mountain snow-capped
|
||
⛰️ mountain
|
||
🌋 volcano
|
||
🗻 mount_fuji
|
||
🏕️ camping
|
||
🏖️ beach_with_umbrella
|
||
🏜️ desert
|
||
🏝️ desert_island
|
||
🏞️ national_park
|
||
🏟️ stadium
|
||
🏛️ classical_building
|
||
🏗️ building_construction
|
||
🧱 bricks brick
|
||
🪨 rock
|
||
🪵 wood
|
||
🛖 hut
|
||
🏘️ house_buildings houses
|
||
🏚️ derelict_house_building
|
||
🏠 house building
|
||
🏡 house_with_garden
|
||
🏢 office building
|
||
🏣 post_office japanese
|
||
🏤 european_post_office
|
||
🏥 hospital
|
||
🏦 bank
|
||
🏨 hotel
|
||
🏩 love_hotel
|
||
🏪 convenience_store
|
||
🏫 school
|
||
🏬 department_store
|
||
🏭 factory
|
||
🏯 japanese_castle
|
||
🏰 european_castle
|
||
💒 wedding
|
||
🗼 tokyo_tower
|
||
🗽 statue_of_liberty
|
||
⛪ church
|
||
🕌 mosque
|
||
🛕 hindu_temple
|
||
🕍 synagogue
|
||
⛩️ shinto_shrine
|
||
🕋 kaaba
|
||
⛲ fountain
|
||
⛺ tent
|
||
🌁 foggy
|
||
🌃 night_with_stars
|
||
🏙️ cityscape
|
||
🌄 sunrise_over_mountains
|
||
🌅 sunrise
|
||
🌆 city_sunset cityscape at dusk
|
||
🌇 city_sunrise sunset over buildings
|
||
🌉 bridge_at_night
|
||
♨️ hotsprings hot springs
|
||
🎠 carousel_horse
|
||
🛝 playground_slide
|
||
🎡 ferris_wheel
|
||
🎢 roller_coaster
|
||
💈 barber pole
|
||
🎪 circus_tent
|
||
🚂 steam_locomotive
|
||
🚃 railway_car
|
||
🚄 bullettrain_side high-speed train
|
||
🚅 bullettrain_front high-speed train bullet nose
|
||
🚆 train2 train
|
||
🚇 metro
|
||
🚈 light_rail
|
||
🚉 station
|
||
🚊 tram
|
||
🚝 monorail
|
||
🚞 mountain_railway
|
||
🚋 train tram car
|
||
🚌 bus
|
||
🚍 oncoming_bus
|
||
🚎 trolleybus
|
||
🚐 minibus
|
||
🚑 ambulance
|
||
🚒 fire_engine
|
||
🚓 police_car
|
||
🚔 oncoming_police_car
|
||
🚕 taxi
|
||
🚖 oncoming_taxi
|
||
🚗 car red_car automobile
|
||
🚘 oncoming_automobile
|
||
🚙 blue_car recreational vehicle
|
||
🛻 pickup_truck
|
||
🚚 truck delivery
|
||
🚛 articulated_lorry
|
||
🚜 tractor
|
||
🏎️ racing_car
|
||
🏍️ racing_motorcycle
|
||
🛵 motor_scooter
|
||
🦽 manual_wheelchair
|
||
🦼 motorized_wheelchair
|
||
🛺 auto_rickshaw
|
||
🚲 bike bicycle
|
||
🛴 scooter
|
||
🛹 skateboard
|
||
🛼 roller_skate
|
||
🚏 busstop bus stop
|
||
🛣️ motorway
|
||
🛤️ railway_track
|
||
🛢️ oil_drum
|
||
⛽ fuelpump fuel pump
|
||
🛞 wheel
|
||
🚨 rotating_light police cars revolving
|
||
🚥 traffic_light horizontal
|
||
🚦 vertical_traffic_light
|
||
🛑 octagonal_sign
|
||
🚧 construction sign
|
||
⚓ anchor
|
||
🛟 ring_buoy
|
||
⛵ boat sailboat
|
||
🛶 canoe
|
||
🚤 speedboat
|
||
🛳️ passenger_ship
|
||
⛴️ ferry
|
||
🛥️ motor_boat
|
||
🚢 ship
|
||
✈️ airplane
|
||
🛩️ small_airplane
|
||
🛫 airplane_departure
|
||
🛬 airplane_arriving
|
||
🪂 parachute
|
||
💺 seat
|
||
🚁 helicopter
|
||
🚟 suspension_railway
|
||
🚠 mountain_cableway
|
||
🚡 aerial_tramway
|
||
🛰️ satellite
|
||
🚀 rocket
|
||
🛸 flying_saucer
|
||
🛎️ bellhop_bell
|
||
🧳 luggage
|
||
⌛ hourglass
|
||
⏳ hourglass_flowing_sand
|
||
⌚ watch
|
||
⏰ alarm_clock
|
||
⏱️ stopwatch
|
||
⏲️ timer_clock
|
||
🕰️ mantelpiece_clock
|
||
🕛 clock12 clock face twelve oclock
|
||
🕧 clock1230 clock face twelve-thirty
|
||
🕐 clock1 clock face one oclock
|
||
🕜 clock130 clock face one-thirty
|
||
🕑 clock2 clock face two oclock
|
||
🕝 clock230 clock face two-thirty
|
||
🕒 clock3 clock face three oclock
|
||
🕞 clock330 clock face three-thirty
|
||
🕓 clock4 clock face four oclock
|
||
🕟 clock430 clock face four-thirty
|
||
🕔 clock5 clock face five oclock
|
||
🕠 clock530 clock face five-thirty
|
||
🕕 clock6 clock face six oclock
|
||
🕡 clock630 clock face six-thirty
|
||
🕖 clock7 clock face seven oclock
|
||
🕢 clock730 clock face seven-thirty
|
||
🕗 clock8 clock face eight oclock
|
||
🕣 clock830 clock face eight-thirty
|
||
🕘 clock9 clock face nine oclock
|
||
🕤 clock930 clock face nine-thirty
|
||
🕙 clock10 clock face ten oclock
|
||
🕥 clock1030 clock face ten-thirty
|
||
🕚 clock11 clock face eleven oclock
|
||
🕦 clock1130 clock face eleven-thirty
|
||
🌑 new_moon symbol
|
||
🌒 waxing_crescent_moon symbol
|
||
🌓 first_quarter_moon symbol
|
||
🌔 moon waxing_gibbous_moon symbol
|
||
🌕 full_moon symbol
|
||
🌖 waning_gibbous_moon symbol
|
||
🌗 last_quarter_moon symbol
|
||
🌘 waning_crescent_moon symbol
|
||
🌙 crescent_moon
|
||
🌚 new_moon_with_face
|
||
🌛 first_quarter_moon_with_face
|
||
🌜 last_quarter_moon_with_face
|
||
🌡️ thermometer
|
||
☀️ sunny black sun rays
|
||
🌝 full_moon_with_face
|
||
🌞 sun_with_face
|
||
🪐 ringed_planet
|
||
⭐ star white medium
|
||
🌟 star2 glowing star
|
||
🌠 stars shooting star
|
||
🌌 milky_way
|
||
☁️ cloud
|
||
⛅ partly_sunny sun behind cloud
|
||
⛈️ thunder_cloud_and_rain lightning
|
||
🌤️ mostly_sunny sun_small_cloud behind
|
||
🌥️ barely_sunny sun_behind_cloud large
|
||
🌦️ partly_sunny_rain sun_behind_rain_cloud
|
||
🌧️ rain_cloud
|
||
🌨️ snow_cloud
|
||
🌩️ lightning lightning_cloud
|
||
🌪️ tornado tornado_cloud
|
||
🌫️ fog
|
||
🌬️ wind_blowing_face
|
||
🌀 cyclone
|
||
🌈 rainbow
|
||
🌂 closed_umbrella
|
||
☂️ umbrella
|
||
☔ umbrella_with_rain_drops
|
||
⛱️ umbrella_on_ground
|
||
⚡ zap high voltage sign
|
||
❄️ snowflake
|
||
☃️ snowman
|
||
⛄ snowman_without_snow
|
||
☄️ comet
|
||
🔥 fire
|
||
💧 droplet
|
||
🌊 ocean water wave
|
||
🎃 jack_o_lantern jack-o-lantern
|
||
🎄 christmas_tree
|
||
🎆 fireworks
|
||
🎇 sparkler firework
|
||
🧨 firecracker
|
||
✨ sparkles
|
||
🎈 balloon
|
||
🎉 tada party popper
|
||
🎊 confetti_ball
|
||
🎋 tanabata_tree
|
||
🎍 bamboo pine decoration
|
||
🎎 dolls japanese
|
||
🎏 flags carp streamer
|
||
🎐 wind_chime
|
||
🎑 rice_scene moon viewing ceremony
|
||
🧧 red_envelope gift
|
||
🎀 ribbon
|
||
🎁 gift wrapped present
|
||
🎗️ reminder_ribbon
|
||
🎟️ admission_tickets
|
||
🎫 ticket
|
||
🎖️ medal military
|
||
🏆 trophy
|
||
🏅 sports_medal
|
||
🥇 first_place_medal
|
||
🥈 second_place_medal
|
||
🥉 third_place_medal
|
||
⚽ soccer ball
|
||
⚾ baseball
|
||
🥎 softball
|
||
🏀 basketball hoop
|
||
🏐 volleyball
|
||
🏈 football american
|
||
🏉 rugby_football
|
||
🎾 tennis racquet ball
|
||
🥏 flying_disc
|
||
🎳 bowling
|
||
🏏 cricket_bat_and_ball
|
||
🏑 field_hockey_stick_and_ball
|
||
🏒 ice_hockey_stick_and_puck
|
||
🥍 lacrosse stick ball
|
||
🏓 table_tennis_paddle_and_ball
|
||
🏸 badminton_racquet_and_shuttlecock
|
||
🥊 boxing_glove
|
||
🥋 martial_arts_uniform
|
||
🥅 goal_net
|
||
⛳ golf flag hole
|
||
⛸️ ice_skate
|
||
🎣 fishing_pole_and_fish
|
||
🤿 diving_mask
|
||
🎽 running_shirt_with_sash
|
||
🎿 ski boot
|
||
🛷 sled
|
||
🥌 curling_stone
|
||
🎯 dart direct hit
|
||
🪀 yo-yo
|
||
🪁 kite
|
||
🔫 gun pistol
|
||
🎱 8ball billiards
|
||
🔮 crystal_ball
|
||
🪄 magic_wand
|
||
🎮 video_game
|
||
🕹️ joystick
|
||
🎰 slot_machine
|
||
🎲 game_die
|
||
🧩 jigsaw puzzle piece
|
||
🧸 teddy_bear
|
||
🪅 pinata
|
||
🪩 mirror_ball
|
||
🪆 nesting_dolls
|
||
♠️ spades black spade suit
|
||
♥️ hearts black heart suit
|
||
♦️ diamonds black diamond suit
|
||
♣️ clubs black club suit
|
||
♟️ chess_pawn
|
||
🃏 black_joker playing card
|
||
🀄 mahjong tile red dragon
|
||
🎴 flower_playing_cards
|
||
🎭 performing_arts
|
||
🖼️ frame_with_picture framed
|
||
🎨 art artist palette
|
||
🧵 thread spool
|
||
🪡 sewing_needle
|
||
🧶 yarn ball
|
||
🪢 knot
|
||
👓 eyeglasses
|
||
🕶️ dark_sunglasses
|
||
🥽 goggles
|
||
🥼 lab_coat
|
||
🦺 safety_vest
|
||
👔 necktie
|
||
👕 shirt tshirt t-shirt
|
||
👖 jeans
|
||
🧣 scarf
|
||
🧤 gloves
|
||
🧥 coat
|
||
🧦 socks
|
||
👗 dress
|
||
👘 kimono
|
||
🥻 sari
|
||
🩱 one-piece_swimsuit one-piece
|
||
🩲 briefs
|
||
🩳 shorts
|
||
👙 bikini
|
||
👚 womans_clothes
|
||
🪭 folding_hand_fan
|
||
👛 purse
|
||
👜 handbag
|
||
👝 pouch
|
||
🛍️ shopping_bags
|
||
🎒 school_satchel
|
||
🩴 thong_sandal
|
||
👞 mans_shoe shoe
|
||
👟 athletic_shoe
|
||
🥾 hiking_boot
|
||
🥿 womans_flat_shoe
|
||
👠 high_heel high-heeled shoe
|
||
👡 sandal womans
|
||
🩰 ballet_shoes
|
||
👢 boot womans boots
|
||
🪮 hair_pick
|
||
👑 crown
|
||
👒 womans_hat
|
||
🎩 tophat top hat
|
||
🎓 mortar_board graduation cap
|
||
🧢 billed_cap
|
||
🪖 military_helmet
|
||
⛑️ helmet_with_white_cross rescue worker s
|
||
📿 prayer_beads
|
||
💄 lipstick
|
||
💍 ring
|
||
💎 gem stone
|
||
🔇 mute speaker cancellation stroke
|
||
🔈 speaker
|
||
🔉 sound speaker one wave
|
||
🔊 loud_sound speaker three waves
|
||
📢 loudspeaker public address
|
||
📣 mega cheering megaphone
|
||
📯 postal_horn
|
||
🔔 bell
|
||
🔕 no_bell cancellation stroke
|
||
🎼 musical_score
|
||
🎵 musical_note
|
||
🎶 notes multiple musical
|
||
🎙️ studio_microphone
|
||
🎚️ level_slider
|
||
🎛️ control_knobs
|
||
🎤 microphone
|
||
🎧 headphones headphone
|
||
📻 radio
|
||
🎷 saxophone
|
||
🪗 accordion
|
||
🎸 guitar
|
||
🎹 musical_keyboard
|
||
🎺 trumpet
|
||
🎻 violin
|
||
🪕 banjo
|
||
🥁 drum_with_drumsticks
|
||
🪘 long_drum
|
||
🪇 maracas
|
||
🪈 flute
|
||
harp
|
||
📱 iphone mobile phone
|
||
📲 calling mobile phone rightwards arrow at left
|
||
☎️ phone telephone black
|
||
📞 telephone_receiver
|
||
📟 pager
|
||
📠 fax machine
|
||
🔋 battery
|
||
🪫 low_battery
|
||
🔌 electric_plug
|
||
💻 computer personal
|
||
🖥️ desktop_computer
|
||
🖨️ printer
|
||
⌨️ keyboard
|
||
🖱️ three_button_mouse computer
|
||
🖲️ trackball
|
||
💽 minidisc
|
||
💾 floppy_disk
|
||
💿 cd optical disc
|
||
📀 dvd
|
||
🧮 abacus
|
||
🎥 movie_camera
|
||
🎞️ film_frames
|
||
📽️ film_projector
|
||
🎬 clapper board
|
||
📺 tv television
|
||
📷 camera
|
||
📸 camera_with_flash
|
||
📹 video_camera
|
||
📼 vhs videocassette
|
||
🔍 mag left-pointing magnifying glass
|
||
🔎 mag_right right-pointing magnifying glass
|
||
🕯️ candle
|
||
💡 bulb electric light
|
||
🔦 flashlight electric torch
|
||
🏮 izakaya_lantern lantern
|
||
🪔 diya_lamp
|
||
📔 notebook_with_decorative_cover
|
||
📕 closed_book
|
||
📖 book open_book
|
||
📗 green_book
|
||
📘 blue_book
|
||
📙 orange_book
|
||
📚 books
|
||
📓 notebook
|
||
📒 ledger
|
||
📃 page_with_curl
|
||
📜 scroll
|
||
📄 page_facing_up
|
||
📰 newspaper
|
||
🗞️ rolled_up_newspaper rolled-up
|
||
📑 bookmark_tabs
|
||
🔖 bookmark
|
||
🏷️ label
|
||
💰 moneybag money bag
|
||
🪙 coin
|
||
💴 yen banknote sign
|
||
💵 dollar banknote sign
|
||
💶 euro banknote sign
|
||
💷 pound banknote sign
|
||
💸 money_with_wings
|
||
💳 credit_card
|
||
🧾 receipt
|
||
💹 chart upwards trend yen sign
|
||
✉️ email envelope
|
||
📧 e-mail symbol
|
||
📨 incoming_envelope
|
||
📩 envelope_with_arrow downwards above
|
||
📤 outbox_tray
|
||
📥 inbox_tray
|
||
📦 package
|
||
📫 mailbox closed raised flag
|
||
📪 mailbox_closed lowered flag
|
||
📬 mailbox_with_mail open raised flag
|
||
📭 mailbox_with_no_mail open lowered flag
|
||
📮 postbox
|
||
🗳️ ballot_box_with_ballot
|
||
✏️ pencil2 pencil
|
||
✒️ black_nib
|
||
🖋️ lower_left_fountain_pen
|
||
🖊️ lower_left_ballpoint_pen
|
||
🖌️ lower_left_paintbrush
|
||
🖍️ lower_left_crayon
|
||
📝 memo pencil
|
||
💼 briefcase
|
||
📁 file_folder
|
||
📂 open_file_folder
|
||
🗂️ card_index_dividers
|
||
📅 date calendar
|
||
📆 calendar tear-off
|
||
🗒️ spiral_note_pad notepad
|
||
🗓️ spiral_calendar_pad
|
||
📇 card_index
|
||
📈 chart_with_upwards_trend
|
||
📉 chart_with_downwards_trend
|
||
📊 bar_chart
|
||
📋 clipboard
|
||
📌 pushpin
|
||
📍 round_pushpin
|
||
📎 paperclip
|
||
🖇️ linked_paperclips
|
||
📏 straight_ruler
|
||
📐 triangular_ruler
|
||
✂️ scissors black
|
||
🗃️ card_file_box
|
||
🗄️ file_cabinet
|
||
🗑️ wastebasket
|
||
🔒 lock
|
||
🔓 unlock open lock
|
||
🔏 lock_with_ink_pen
|
||
🔐 closed_lock_with_key
|
||
🔑 key
|
||
🗝️ old_key
|
||
🔨 hammer
|
||
🪓 axe
|
||
⛏️ pick
|
||
⚒️ hammer_and_pick
|
||
🛠️ hammer_and_wrench
|
||
🗡️ dagger_knife
|
||
⚔️ crossed_swords
|
||
💣 bomb
|
||
🪃 boomerang
|
||
🏹 bow_and_arrow
|
||
🛡️ shield
|
||
🪚 carpentry_saw
|
||
🔧 wrench
|
||
🪛 screwdriver
|
||
🔩 nut_and_bolt
|
||
⚙️ gear
|
||
🗜️ compression clamp
|
||
⚖️ scales balance scale
|
||
🦯 probing_cane
|
||
🔗 link symbol
|
||
⛓️💥 broken_chain
|
||
⛓️ chains
|
||
🪝 hook
|
||
🧰 toolbox
|
||
🧲 magnet
|
||
🪜 ladder
|
||
shovel
|
||
⚗️ alembic
|
||
🧪 test_tube
|
||
🧫 petri_dish
|
||
🧬 dna double helix
|
||
🔬 microscope
|
||
🔭 telescope
|
||
📡 satellite_antenna
|
||
💉 syringe
|
||
🩸 drop_of_blood
|
||
💊 pill
|
||
🩹 adhesive_bandage
|
||
🩼 crutch
|
||
🩺 stethoscope
|
||
🩻 x-ray
|
||
🚪 door
|
||
🛗 elevator
|
||
🪞 mirror
|
||
🪟 window
|
||
🛏️ bed
|
||
🛋️ couch_and_lamp
|
||
🪑 chair
|
||
🚽 toilet
|
||
🪠 plunger
|
||
🚿 shower
|
||
🛁 bathtub
|
||
🪤 mouse_trap
|
||
🪒 razor
|
||
🧴 lotion_bottle
|
||
🧷 safety_pin
|
||
🧹 broom
|
||
🧺 basket
|
||
🧻 roll_of_paper
|
||
🪣 bucket
|
||
🧼 soap bar
|
||
🫧 bubbles
|
||
🪥 toothbrush
|
||
🧽 sponge
|
||
🧯 fire_extinguisher
|
||
🛒 shopping_trolley
|
||
🚬 smoking symbol
|
||
⚰️ coffin
|
||
🪦 headstone
|
||
⚱️ funeral_urn
|
||
🧿 nazar_amulet
|
||
🪬 hamsa
|
||
🗿 moyai
|
||
🪧 placard
|
||
🪪 identification_card
|
||
🏧 atm automated teller machine
|
||
🚮 put_litter_in_its_place symbol
|
||
🚰 potable_water symbol
|
||
♿ wheelchair symbol
|
||
🚹 mens symbol
|
||
🚺 womens symbol
|
||
🚻 restroom
|
||
🚼 baby_symbol
|
||
🚾 wc water closet
|
||
🛂 passport_control
|
||
🛃 customs
|
||
🛄 baggage_claim
|
||
🛅 left_luggage
|
||
⚠️ warning sign
|
||
🚸 children_crossing
|
||
⛔ no_entry
|
||
🚫 no_entry_sign
|
||
🚳 no_bicycles
|
||
🚭 no_smoking symbol
|
||
🚯 do_not_litter symbol
|
||
🚱 non-potable_water non-potable symbol
|
||
🚷 no_pedestrians
|
||
📵 no_mobile_phones
|
||
🔞 underage no one under eighteen symbol
|
||
☢️ radioactive_sign
|
||
☣️ biohazard_sign
|
||
⬆️ arrow_up upwards black
|
||
↗️ arrow_upper_right north east
|
||
➡️ arrow_right black rightwards
|
||
↘️ arrow_lower_right south east
|
||
⬇️ arrow_down downwards black
|
||
↙️ arrow_lower_left south west
|
||
⬅️ arrow_left leftwards black
|
||
↖️ arrow_upper_left north west
|
||
↕️ arrow_up_down
|
||
↔️ left_right_arrow
|
||
↩️ leftwards_arrow_with_hook
|
||
↪️ arrow_right_hook rightwards
|
||
⤴️ arrow_heading_up pointing rightwards then curving upwards
|
||
⤵️ arrow_heading_down pointing rightwards then curving downwards
|
||
🔃 arrows_clockwise downwards upwards open circle
|
||
🔄 arrows_counterclockwise anticlockwise downwards upwards open circle
|
||
🔙 back leftwards arrow above
|
||
🔚 end leftwards arrow above
|
||
🔛 on exclamation mark left right arrow above
|
||
🔜 soon rightwards arrow above
|
||
🔝 top upwards arrow above
|
||
🛐 place_of_worship
|
||
⚛️ atom_symbol
|
||
🕉️ om_symbol
|
||
✡️ star_of_david
|
||
☸️ wheel_of_dharma
|
||
☯️ yin_yang
|
||
✝️ latin_cross
|
||
☦️ orthodox_cross
|
||
☪️ star_and_crescent
|
||
☮️ peace_symbol
|
||
🕎 menorah_with_nine_branches
|
||
🔯 six_pointed_star middle dot
|
||
🪯 khanda
|
||
♈ aries
|
||
♉ taurus
|
||
♊ gemini
|
||
♋ cancer
|
||
♌ leo
|
||
♍ virgo
|
||
♎ libra
|
||
♏ scorpius
|
||
♐ sagittarius
|
||
♑ capricorn
|
||
♒ aquarius
|
||
♓ pisces
|
||
⛎ ophiuchus
|
||
🔀 twisted_rightwards_arrows
|
||
🔁 repeat clockwise rightwards leftwards open circle arrows
|
||
🔂 repeat_one clockwise rightwards leftwards open circle arrows circled overlay
|
||
▶️ arrow_forward black right-pointing triangle
|
||
⏩ fast_forward black right-pointing double triangle
|
||
⏭️ black_right_pointing_double_triangle_with_vertical_bar next track button
|
||
⏯️ black_right_pointing_triangle_with_double_vertical_bar play pause button
|
||
◀️ arrow_backward black left-pointing triangle
|
||
⏪ rewind black left-pointing double triangle
|
||
⏮️ black_left_pointing_double_triangle_with_vertical_bar last track button
|
||
🔼 arrow_up_small up-pointing red triangle
|
||
⏫ arrow_double_up black up-pointing triangle
|
||
🔽 arrow_down_small down-pointing red triangle
|
||
⏬ arrow_double_down black down-pointing triangle
|
||
⏸️ double_vertical_bar pause button
|
||
⏹️ black_square_for_stop button
|
||
⏺️ black_circle_for_record button
|
||
⏏️ eject button
|
||
🎦 cinema
|
||
🔅 low_brightness symbol
|
||
🔆 high_brightness symbol
|
||
📶 signal_strength antenna bars
|
||
🛜 wireless
|
||
📳 vibration_mode
|
||
📴 mobile_phone_off
|
||
♀️ female_sign
|
||
♂️ male_sign
|
||
⚧️ transgender_symbol
|
||
✖️ heavy_multiplication_x
|
||
➕ heavy_plus_sign
|
||
➖ heavy_minus_sign
|
||
➗ heavy_division_sign
|
||
🟰 heavy_equals_sign
|
||
♾️ infinity
|
||
‼️ bangbang double exclamation mark
|
||
⁉️ interrobang exclamation question mark
|
||
❓ question black mark ornament
|
||
❔ grey_question white mark ornament
|
||
❕ grey_exclamation white mark ornament
|
||
❗ exclamation heavy_exclamation_mark symbol
|
||
〰️ wavy_dash
|
||
💱 currency_exchange
|
||
💲 heavy_dollar_sign
|
||
⚕️ medical_symbol staff_of_aesculapius
|
||
♻️ recycle black universal recycling symbol
|
||
⚜️ fleur_de_lis fleur-de-lis
|
||
🔱 trident emblem
|
||
📛 name_badge
|
||
🔰 beginner japanese symbol
|
||
⭕ o heavy large circle
|
||
✅ white_check_mark heavy
|
||
☑️ ballot_box_with_check
|
||
✔️ heavy_check_mark
|
||
❌ x cross mark
|
||
❎ negative_squared_cross_mark
|
||
➰ curly_loop
|
||
➿ loop double curly
|
||
〽️ part_alternation_mark
|
||
✳️ eight_spoked_asterisk
|
||
✴️ eight_pointed_black_star
|
||
❇️ sparkle
|
||
©️ copyright sign
|
||
®️ registered sign
|
||
™️ tm trade mark sign
|
||
splatter
|
||
#️⃣ hash key
|
||
*️⃣ keycap_star
|
||
0️⃣ zero keycap 0
|
||
1️⃣ one keycap 1
|
||
2️⃣ two keycap 2
|
||
3️⃣ three keycap 3
|
||
4️⃣ four keycap 4
|
||
5️⃣ five keycap 5
|
||
6️⃣ six keycap 6
|
||
7️⃣ seven keycap 7
|
||
8️⃣ eight keycap 8
|
||
9️⃣ nine keycap 9
|
||
🔟 keycap_ten
|
||
🔠 capital_abcd input symbol latin letters
|
||
🔡 abcd input symbol latin small letters
|
||
🔢 1234 input symbol numbers
|
||
🔣 symbols input symbol
|
||
🔤 abc input symbol latin letters
|
||
🅰️ a negative squared latin capital letter
|
||
🆎 ab negative squared
|
||
🅱️ b negative squared latin capital letter
|
||
🆑 cl squared
|
||
🆒 cool squared
|
||
🆓 free squared
|
||
ℹ️ information_source
|
||
🆔 id squared
|
||
Ⓜ️ m circled latin capital letter
|
||
🆕 new squared
|
||
🆖 ng squared
|
||
🅾️ o2 negative squared latin capital letter o
|
||
🆗 ok squared
|
||
🅿️ parking negative squared latin capital letter p
|
||
🆘 sos squared
|
||
🆙 up squared exclamation mark
|
||
🆚 vs squared
|
||
🈁 koko squared katakana
|
||
🈂️ sa squared katakana
|
||
🈷️ u6708 squared cjk unified ideograph-6708
|
||
🈶 u6709 squared cjk unified ideograph-6709
|
||
🈯 u6307 squared cjk unified ideograph-6307
|
||
🉐 ideograph_advantage circled
|
||
🈹 u5272 squared cjk unified ideograph-5272
|
||
🈚 u7121 squared cjk unified ideograph-7121
|
||
🈲 u7981 squared cjk unified ideograph-7981
|
||
🉑 accept circled ideograph
|
||
🈸 u7533 squared cjk unified ideograph-7533
|
||
🈴 u5408 squared cjk unified ideograph-5408
|
||
🈳 u7a7a squared cjk unified ideograph-7a7a
|
||
㊗️ congratulations circled ideograph congratulation
|
||
㊙️ secret circled ideograph
|
||
🈺 u55b6 squared cjk unified ideograph-55b6
|
||
🈵 u6e80 squared cjk unified ideograph-6e80
|
||
🔴 red_circle large
|
||
🟠 large_orange_circle
|
||
🟡 large_yellow_circle
|
||
🟢 large_green_circle
|
||
🔵 large_blue_circle
|
||
🟣 large_purple_circle
|
||
🟤 large_brown_circle
|
||
⚫ black_circle medium
|
||
⚪ white_circle medium
|
||
🟥 large_red_square
|
||
🟧 large_orange_square
|
||
🟨 large_yellow_square
|
||
🟩 large_green_square
|
||
🟦 large_blue_square
|
||
🟪 large_purple_square
|
||
🟫 large_brown_square
|
||
⬛ black_large_square
|
||
⬜ white_large_square
|
||
◼️ black_medium_square
|
||
◻️ white_medium_square
|
||
◾ black_medium_small_square
|
||
◽ white_medium_small_square
|
||
▪️ black_small_square
|
||
▫️ white_small_square
|
||
🔶 large_orange_diamond
|
||
🔷 large_blue_diamond
|
||
🔸 small_orange_diamond
|
||
🔹 small_blue_diamond
|
||
🔺 small_red_triangle up-pointing
|
||
🔻 small_red_triangle_down down-pointing
|
||
💠 diamond_shape_with_a_dot_inside
|
||
🔘 radio_button
|
||
🔳 white_square_button
|
||
🔲 black_square_button
|
||
🏁 checkered_flag chequered
|
||
🚩 triangular_flag_on_post
|
||
🎌 crossed_flags
|
||
🏴 waving_black_flag
|
||
🏳️ waving_white_flag
|
||
🏳️🌈 rainbow-flag
|
||
🏳️⚧️ transgender_flag
|
||
🏴☠️ pirate_flag
|
||
🇦🇨 flag-ac ascension island
|
||
🇦🇩 flag-ad andorra
|
||
🇦🇪 flag-ae united arab emirates
|
||
🇦🇫 flag-af afghanistan
|
||
🇦🇬 flag-ag antigua barbuda
|
||
🇦🇮 flag-ai anguilla
|
||
🇦🇱 flag-al albania
|
||
🇦🇲 flag-am armenia
|
||
🇦🇴 flag-ao angola
|
||
🇦🇶 flag-aq antarctica
|
||
🇦🇷 flag-ar argentina
|
||
🇦🇸 flag-as american samoa
|
||
🇦🇹 flag-at austria
|
||
🇦🇺 flag-au australia
|
||
🇦🇼 flag-aw aruba
|
||
🇦🇽 flag-ax land islands
|
||
🇦🇿 flag-az azerbaijan
|
||
🇧🇦 flag-ba bosnia herzegovina
|
||
🇧🇧 flag-bb barbados
|
||
🇧🇩 flag-bd bangladesh
|
||
🇧🇪 flag-be belgium
|
||
🇧🇫 flag-bf burkina faso
|
||
🇧🇬 flag-bg bulgaria
|
||
🇧🇭 flag-bh bahrain
|
||
🇧🇮 flag-bi burundi
|
||
🇧🇯 flag-bj benin
|
||
🇧🇱 flag-bl st barth lemy
|
||
🇧🇲 flag-bm bermuda
|
||
🇧🇳 flag-bn brunei
|
||
🇧🇴 flag-bo bolivia
|
||
🇧🇶 flag-bq caribbean netherlands
|
||
🇧🇷 flag-br brazil
|
||
🇧🇸 flag-bs bahamas
|
||
🇧🇹 flag-bt bhutan
|
||
🇧🇻 flag-bv bouvet island
|
||
🇧🇼 flag-bw botswana
|
||
🇧🇾 flag-by belarus
|
||
🇧🇿 flag-bz belize
|
||
🇨🇦 flag-ca canada
|
||
🇨🇨 flag-cc cocos keeling islands
|
||
🇨🇩 flag-cd congo - kinshasa
|
||
🇨🇫 flag-cf central african republic
|
||
🇨🇬 flag-cg congo - brazzaville
|
||
🇨🇭 flag-ch switzerland
|
||
🇨🇮 flag-ci c te d ivoire
|
||
🇨🇰 flag-ck cook islands
|
||
🇨🇱 flag-cl chile
|
||
🇨🇲 flag-cm cameroon
|
||
🇨🇳 cn flag-cn china
|
||
🇨🇴 flag-co colombia
|
||
🇨🇵 flag-cp clipperton island
|
||
🇨🇶 flag-sark
|
||
🇨🇷 flag-cr costa rica
|
||
🇨🇺 flag-cu cuba
|
||
🇨🇻 flag-cv cape verde
|
||
🇨🇼 flag-cw cura ao
|
||
🇨🇽 flag-cx christmas island
|
||
🇨🇾 flag-cy cyprus
|
||
🇨🇿 flag-cz czechia
|
||
🇩🇪 de flag-de germany
|
||
🇩🇬 flag-dg diego garcia
|
||
🇩🇯 flag-dj djibouti
|
||
🇩🇰 flag-dk denmark
|
||
🇩🇲 flag-dm dominica
|
||
🇩🇴 flag-do dominican republic
|
||
🇩🇿 flag-dz algeria
|
||
🇪🇦 flag-ea ceuta melilla
|
||
🇪🇨 flag-ec ecuador
|
||
🇪🇪 flag-ee estonia
|
||
🇪🇬 flag-eg egypt
|
||
🇪🇭 flag-eh western sahara
|
||
🇪🇷 flag-er eritrea
|
||
🇪🇸 es flag-es spain
|
||
🇪🇹 flag-et ethiopia
|
||
🇪🇺 flag-eu european union
|
||
🇫🇮 flag-fi finland
|
||
🇫🇯 flag-fj fiji
|
||
🇫🇰 flag-fk falkland islands
|
||
🇫🇲 flag-fm micronesia
|
||
🇫🇴 flag-fo faroe islands
|
||
🇫🇷 fr flag-fr france
|
||
🇬🇦 flag-ga gabon
|
||
🇬🇧 gb uk flag-gb united kingdom
|
||
🇬🇩 flag-gd grenada
|
||
🇬🇪 flag-ge georgia
|
||
🇬🇫 flag-gf french guiana
|
||
🇬🇬 flag-gg guernsey
|
||
🇬🇭 flag-gh ghana
|
||
🇬🇮 flag-gi gibraltar
|
||
🇬🇱 flag-gl greenland
|
||
🇬🇲 flag-gm gambia
|
||
🇬🇳 flag-gn guinea
|
||
🇬🇵 flag-gp guadeloupe
|
||
🇬🇶 flag-gq equatorial guinea
|
||
🇬🇷 flag-gr greece
|
||
🇬🇸 flag-gs south georgia sandwich islands
|
||
🇬🇹 flag-gt guatemala
|
||
🇬🇺 flag-gu guam
|
||
🇬🇼 flag-gw guinea-bissau
|
||
🇬🇾 flag-gy guyana
|
||
🇭🇰 flag-hk hong kong sar china
|
||
🇭🇲 flag-hm heard mcdonald islands
|
||
🇭🇳 flag-hn honduras
|
||
🇭🇷 flag-hr croatia
|
||
🇭🇹 flag-ht haiti
|
||
🇭🇺 flag-hu hungary
|
||
🇮🇨 flag-ic canary islands
|
||
🇮🇩 flag-id indonesia
|
||
🇮🇪 flag-ie ireland
|
||
🇮🇱 flag-il israel
|
||
🇮🇲 flag-im isle man
|
||
🇮🇳 flag-in india
|
||
🇮🇴 flag-io british indian ocean territory
|
||
🇮🇶 flag-iq iraq
|
||
🇮🇷 flag-ir iran
|
||
🇮🇸 flag-is iceland
|
||
🇮🇹 it flag-it italy
|
||
🇯🇪 flag-je jersey
|
||
🇯🇲 flag-jm jamaica
|
||
🇯🇴 flag-jo jordan
|
||
🇯🇵 jp flag-jp japan
|
||
🇰🇪 flag-ke kenya
|
||
🇰🇬 flag-kg kyrgyzstan
|
||
🇰🇭 flag-kh cambodia
|
||
🇰🇮 flag-ki kiribati
|
||
🇰🇲 flag-km comoros
|
||
🇰🇳 flag-kn st kitts nevis
|
||
🇰🇵 flag-kp north korea
|
||
🇰🇷 kr flag-kr south korea
|
||
🇰🇼 flag-kw kuwait
|
||
🇰🇾 flag-ky cayman islands
|
||
🇰🇿 flag-kz kazakhstan
|
||
🇱🇦 flag-la laos
|
||
🇱🇧 flag-lb lebanon
|
||
🇱🇨 flag-lc st lucia
|
||
🇱🇮 flag-li liechtenstein
|
||
🇱🇰 flag-lk sri lanka
|
||
🇱🇷 flag-lr liberia
|
||
🇱🇸 flag-ls lesotho
|
||
🇱🇹 flag-lt lithuania
|
||
🇱🇺 flag-lu luxembourg
|
||
🇱🇻 flag-lv latvia
|
||
🇱🇾 flag-ly libya
|
||
🇲🇦 flag-ma morocco
|
||
🇲🇨 flag-mc monaco
|
||
🇲🇩 flag-md moldova
|
||
🇲🇪 flag-me montenegro
|
||
🇲🇫 flag-mf st martin
|
||
🇲🇬 flag-mg madagascar
|
||
🇲🇭 flag-mh marshall islands
|
||
🇲🇰 flag-mk north macedonia
|
||
🇲🇱 flag-ml mali
|
||
🇲🇲 flag-mm myanmar burma
|
||
🇲🇳 flag-mn mongolia
|
||
🇲🇴 flag-mo macao sar china
|
||
🇲🇵 flag-mp northern mariana islands
|
||
🇲🇶 flag-mq martinique
|
||
🇲🇷 flag-mr mauritania
|
||
🇲🇸 flag-ms montserrat
|
||
🇲🇹 flag-mt malta
|
||
🇲🇺 flag-mu mauritius
|
||
🇲🇻 flag-mv maldives
|
||
🇲🇼 flag-mw malawi
|
||
🇲🇽 flag-mx mexico
|
||
🇲🇾 flag-my malaysia
|
||
🇲🇿 flag-mz mozambique
|
||
🇳🇦 flag-na namibia
|
||
🇳🇨 flag-nc new caledonia
|
||
🇳🇪 flag-ne niger
|
||
🇳🇫 flag-nf norfolk island
|
||
🇳🇬 flag-ng nigeria
|
||
🇳🇮 flag-ni nicaragua
|
||
🇳🇱 flag-nl netherlands
|
||
🇳🇴 flag-no norway
|
||
🇳🇵 flag-np nepal
|
||
🇳🇷 flag-nr nauru
|
||
🇳🇺 flag-nu niue
|
||
🇳🇿 flag-nz new zealand
|
||
🇴🇲 flag-om oman
|
||
🇵🇦 flag-pa panama
|
||
🇵🇪 flag-pe peru
|
||
🇵🇫 flag-pf french polynesia
|
||
🇵🇬 flag-pg papua new guinea
|
||
🇵🇭 flag-ph philippines
|
||
🇵🇰 flag-pk pakistan
|
||
🇵🇱 flag-pl poland
|
||
🇵🇲 flag-pm st pierre miquelon
|
||
🇵🇳 flag-pn pitcairn islands
|
||
🇵🇷 flag-pr puerto rico
|
||
🇵🇸 flag-ps palestinian territories
|
||
🇵🇹 flag-pt portugal
|
||
🇵🇼 flag-pw palau
|
||
🇵🇾 flag-py paraguay
|
||
🇶🇦 flag-qa qatar
|
||
🇷🇪 flag-re r union
|
||
🇷🇴 flag-ro romania
|
||
🇷🇸 flag-rs serbia
|
||
🇷🇺 ru flag-ru russia
|
||
🇷🇼 flag-rw rwanda
|
||
🇸🇦 flag-sa saudi arabia
|
||
🇸🇧 flag-sb solomon islands
|
||
🇸🇨 flag-sc seychelles
|
||
🇸🇩 flag-sd sudan
|
||
🇸🇪 flag-se sweden
|
||
🇸🇬 flag-sg singapore
|
||
🇸🇭 flag-sh st helena
|
||
🇸🇮 flag-si slovenia
|
||
🇸🇯 flag-sj svalbard jan mayen
|
||
🇸🇰 flag-sk slovakia
|
||
🇸🇱 flag-sl sierra leone
|
||
🇸🇲 flag-sm san marino
|
||
🇸🇳 flag-sn senegal
|
||
🇸🇴 flag-so somalia
|
||
🇸🇷 flag-sr suriname
|
||
🇸🇸 flag-ss south sudan
|
||
🇸🇹 flag-st s o tom pr ncipe
|
||
🇸🇻 flag-sv el salvador
|
||
🇸🇽 flag-sx sint maarten
|
||
🇸🇾 flag-sy syria
|
||
🇸🇿 flag-sz eswatini
|
||
🇹🇦 flag-ta tristan da cunha
|
||
🇹🇨 flag-tc turks caicos islands
|
||
🇹🇩 flag-td chad
|
||
🇹🇫 flag-tf french southern territories
|
||
🇹🇬 flag-tg togo
|
||
🇹🇭 flag-th thailand
|
||
🇹🇯 flag-tj tajikistan
|
||
🇹🇰 flag-tk tokelau
|
||
🇹🇱 flag-tl timor-leste
|
||
🇹🇲 flag-tm turkmenistan
|
||
🇹🇳 flag-tn tunisia
|
||
🇹🇴 flag-to tonga
|
||
🇹🇷 flag-tr t rkiye
|
||
🇹🇹 flag-tt trinidad tobago
|
||
🇹🇻 flag-tv tuvalu
|
||
🇹🇼 flag-tw taiwan
|
||
🇹🇿 flag-tz tanzania
|
||
🇺🇦 flag-ua ukraine
|
||
🇺🇬 flag-ug uganda
|
||
🇺🇲 flag-um u s outlying islands
|
||
🇺🇳 flag-un united nations
|
||
🇺🇸 us flag-us united states
|
||
🇺🇾 flag-uy uruguay
|
||
🇺🇿 flag-uz uzbekistan
|
||
🇻🇦 flag-va vatican city
|
||
🇻🇨 flag-vc st vincent grenadines
|
||
🇻🇪 flag-ve venezuela
|
||
🇻🇬 flag-vg british virgin islands
|
||
🇻🇮 flag-vi u s virgin islands
|
||
🇻🇳 flag-vn vietnam
|
||
🇻🇺 flag-vu vanuatu
|
||
🇼🇫 flag-wf wallis futuna
|
||
🇼🇸 flag-ws samoa
|
||
🇽🇰 flag-xk kosovo
|
||
🇾🇪 flag-ye yemen
|
||
🇾🇹 flag-yt mayotte
|
||
🇿🇦 flag-za south africa
|
||
🇿🇲 flag-zm zambia
|
||
🇿🇼 flag-zw zimbabwe
|
||
🏴 flag-england
|
||
🏴 flag-scotland
|
||
🏴 flag-wales`),Rl.map(e=>{let{rank:n,nameRank:r}=aae(e,t);return{entry:e,rank:n,nameRank:r,centrality:oae(e,t)}}).filter(({rank:e})=>e<9).sort((e,t)=>e.rank-t.rank||e.nameRank-t.nameRank||e.centrality-t.centrality).slice(0,50).map(({entry:e})=>e)):[]},Bl=(e,t)=>/^\s/.test(t)?e:`${e} `,Vl=e=>e.match(nae)?.groups?.query,Hl=({anchorRect:e,listMaxHeight:t,viewport:n,rtl:r,listWidth:i=280})=>{let{width:a,height:o}=n,s=o-e.bottom,c=e.top,l=s<t+8&&c>s,u=r?e.right-i:e.left;return{top:l?void 0:`${Math.round(e.bottom+4)}px`,bottom:l?`${Math.round(o-e.top+4)}px`:void 0,left:`${Math.round(Math.max(8,Math.min(u,a-i-8)))}px`,maxHeight:`${Math.round(Math.min(t,(l?c:s)-4-8))}px`}},cae=V(`<div role="option" class="option svelte-6dhkew" tabindex="-1"><span role="none" class="emoji svelte-6dhkew"> </span> <span role="none" class="name svelte-6dhkew"> </span></div>`),lae=V(`<div role="listbox" class="sui emoji-suggestions svelte-6dhkew" popover="manual"></div>`),uae={hash:`svelte-6dhkew`,code:`.emoji-suggestions.svelte-6dhkew {position:fixed;inset:auto;z-index:1000;display:flex;flex-direction:column;overflow-y:auto;margin:0;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);width:280px;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;}.option.svelte-6dhkew {flex:none;display:flex;align-items:center;gap:8px;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);min-height:var(--sui-option-height);cursor:default;}.option[aria-selected=true].svelte-6dhkew {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-6dhkew .emoji:where(.svelte-6dhkew) {flex:none;width:1.5em;font-size:var(--sui-font-size-large);text-align:center;}.option.svelte-6dhkew .name:where(.svelte-6dhkew) {flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}`};function Ul(e,t){let n=Co();k(t,!0),q(e,uae);let r=Y(t,`ariaOwner`,3,void 0),i=M(void 0),a=M(na([])),o=M(0),s=M(void 0),c=M(void 0),l=M(void 0),u=j(()=>!!B(i)&&!!B(a).length),d=M(0),f=M(0),p=j(()=>B(d)?B(d)*5+B(f):180),m=j(()=>B(s)?Hl({anchorRect:B(s),listMaxHeight:B(p),viewport:{width:window.innerWidth,height:window.innerHeight},rtl:Pc()}):void 0),h=()=>B(u),g=(e=!1)=>{co(()=>{N(l,e&&B(i)?B(i).id:void 0,!0),N(i,void 0),N(a,[],!0),N(o,0),N(s,void 0)})},_=e=>{if(!e){(B(i)||B(l))&&g();return}if(B(l)===e.id)return;let{id:n,query:r}=e;N(l,void 0),N(s,t.getAnchorRect(e),!0),B(i)?.id===n&&B(i).query===r?N(i,e,!0):(N(i,e,!0),N(a,sae(r),!0),N(o,0))},v=e=>{let{length:t}=B(a);t&&N(o,(B(o)+e+t)%t)},y=()=>{let e=B(a)[B(o)];e&&B(i)&&t.onSelect(e,B(i)),g()},b=e=>{let{key:t,altKey:n,ctrlKey:r,metaKey:i,shiftKey:a}=e;if(!B(u)||n||r||i)return!1;if(t===`ArrowDown`||t===`ArrowUp`)v(t===`ArrowDown`?1:-1);else if((t===`Enter`||t===`Tab`)&&!a)y();else if(t===`Escape`)g(!0);else return!1;return e.preventDefault(),!0};R(()=>{if(B(a),!B(c))return;B(c).matches(`:popover-open`)||B(c).showPopover?.();let e=B(c).querySelector(`.option`);if(e){let{paddingTop:t,paddingBottom:n,borderTopWidth:r,borderBottomWidth:i}=getComputedStyle(B(c));N(d,e.getBoundingClientRect().height,!0),N(f,Number.parseFloat(t)+Number.parseFloat(n)+Number.parseFloat(r)+Number.parseFloat(i))}}),R(()=>{if(!r())return;let e=r();return e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-haspopup`,`listbox`),()=>{e.removeAttribute(`aria-autocomplete`),e.removeAttribute(`aria-haspopup`)}}),R(()=>{if(!r())return;let e=r();return B(u)?(e.setAttribute(`aria-controls`,n),e.setAttribute(`aria-activedescendant`,`${n}-option-${B(o)}`)):(e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)),()=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)}}),R(()=>{B(o),B(c)?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`,behavior:`instant`})}),vs(()=>{let e=()=>{B(i)&&N(s,t.getAnchorRect(B(i)),!0)},n=({target:e})=>{let t=e;!B(u)||B(c)?.contains(t)||r()?.contains(t)||g()};return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e,{passive:!0}),document.addEventListener(`pointerdown`,n,{capture:!0}),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e),document.removeEventListener(`pointerdown`,n,{capture:!0})}});var x={isOpen:h,close:g,update:_,moveSelection:v,selectHighlighted:y,handleKeyDown:b},S=U(),C=F(S),w=e=>{var t=lae();let r;Ro(t,23,()=>B(a),e=>e.emoji,(e,t,r)=>{var i=cae(),a=P(i),s=I(a,!0),c=I(L(a,2),!0);O(i),z(()=>{J(i,`id`,`${n}-option-${B(r)}`),J(i,`aria-selected`,B(r)===B(o)),G(s,B(t).emoji),G(c,`:${B(t).name}:`)}),go(`mouseenter`,i,()=>{N(o,B(r),!0)}),_o(`mousedown`,i,e=>{e.preventDefault(),N(o,B(r),!0),y()}),W(e,i)}),O(t),ms(t,e=>N(c,e),()=>B(c)),z(e=>{J(t,`id`,n),J(t,`aria-label`,e),r=as(t,``,r,{top:B(m).top,bottom:B(m).bottom,left:B(m).left,"max-height":B(m).maxHeight})},[()=>X(`_sui.emoji_suggestions`)]),W(e,t)};return K(C,e=>{B(u)&&B(m)&&e(w)}),W(e,S),A(x)}vo([`mousedown`]);function Wl(e,t){k(t,!0);let n=Y(t,`element`,3,void 0),r=M(void 0),i=()=>{if(!n()||n().disabled||n().readOnly)return;let{value:e,selectionStart:t,selectionEnd:r}=n();if(t===null||t!==r)return;let i=Vl(e.slice(0,t));if(i===void 0)return;let a=t-i.length-1;return{id:String(a),query:i,start:a,end:t}},a=e=>{let{start:t,end:r}=e;return n()?tae(n(),t,r):void 0},o=(e,t)=>{let{query:r,start:i,end:a}=t;if(!n()||n().value.slice(i,a)!==`:${r}`)return;let o=Bl(e.emoji,n().value.slice(a));n().focus(),n().setSelectionRange(i,a);let s=!1;try{s=document.execCommand(`insertText`,!1,o)}catch{s=!1}s||(n().setRangeText(o,i,a,`end`),n().dispatchEvent(new Event(`input`,{bubbles:!0})))},s=e=>{B(r)?.handleKeyDown(e)};R(()=>{if(!n()||!B(r))return;let e=n(),t=()=>{B(r)?.update(i())},a=()=>{B(r)?.close()};return e.addEventListener(`keydown`,s),e.addEventListener(`keyup`,t),e.addEventListener(`input`,t),e.addEventListener(`mouseup`,t),e.addEventListener(`blur`,a),()=>{e.removeEventListener(`keydown`,s),e.removeEventListener(`keyup`,t),e.removeEventListener(`input`,t),e.removeEventListener(`mouseup`,t),e.removeEventListener(`blur`,a),B(r)?.close()}}),ms(Ul(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return n()}}),e=>N(r,e,!0),()=>B(r)),A()}var dae=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`role`,`keyShortcuts`,`dir`,`name`,`showInlineLabel`,`inputmode`,`flex`,`monospace`,`debounce`,`useEmojiAutocomplete`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`oninput`]),fae=V(`<span aria-hidden="true"><!></span>`),pae=V(`<div role="none"><input/> <!> <!></div>`),mae={hash:`svelte-16h9hre`,code:`.text-input.svelte-16h9hre {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.text-input.flex.svelte-16h9hre:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.text-input.monospace.svelte-16h9hre {--sui-textbox-font-family: var(--sui-font-family-monospace, monospace);}input.svelte-16h9hre:is(:where(.svelte-16h9hre):-webkit-autofill, :where(.svelte-16h9hre):-webkit-autofill:focus) {transition:background-color 0s 600000s, color 0s 600000s;}input.svelte-16h9hre {display:inline-block;flex:auto;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);min-width:0;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);letter-spacing:var(--sui-textbox-letter-spacing, normal);word-spacing:var(--sui-word-spacing-normal, normal);transition:all 200ms;}input.svelte-16h9hre:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}input.svelte-16h9hre:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}input.svelte-16h9hre:is(:where(.svelte-16h9hre):disabled, :where(.svelte-16h9hre):read-only) {background-color:var(--sui-disabled-background-color);}input[aria-invalid=true].svelte-16h9hre {border-color:var(--sui-error-border-color);}input.svelte-16h9hre ~ button {flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);height:var(--sui-textbox-height);aspect-ratio:1/1;}input.svelte-16h9hre ~ button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}input.svelte-16h9hre ~ button .icon {font-size:var(--sui-font-size-xx-large);}.label.svelte-16h9hre {position:absolute;inset:var(--sui-textbox-singleline-padding);z-index:2;display:flex;align-items:center;justify-content:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));pointer-events:none;}.label.hidden.svelte-16h9hre {opacity:0;}input.svelte-16h9hre:focus + .label:where(.svelte-16h9hre) {opacity:0;}input.svelte-16h9hre::placeholder,
|
||
.label.svelte-16h9hre {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 0.5);font-family:var(--sui-textbox-placeholder-font-family, var(--sui-textbox-font-family));font-size:var(--sui-textbox-placeholder-font-size, var(--sui-textbox-font-size));line-height:var(--sui-textbox-placeholder-singleline-line-height, var(--sui-textbox-singleline-line-height));font-weight:var(--sui-textbox-placeholder-font-weight, var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal)));text-align:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));text-indent:var(--sui-textbox-placeholder-text-indent, var(--sui-textbox-text-indent, 0));letter-spacing:var(--sui-textbox-placeholder-letter-spacing, var(--sui-textbox-letter-spacing, normal));}`};function Gl(e,t){let n=Co();k(t,!0),q(e,mae);let r=Y(t,`value`,15),i=Y(t,`element`,15),a=Y(t,`role`,3,`textbox`),o=Y(t,`keyShortcuts`,3,void 0),s=Y(t,`dir`,3,void 0),c=Y(t,`name`,3,void 0),l=Y(t,`showInlineLabel`,3,!1),u=Y(t,`inputmode`,3,`text`),d=Y(t,`flex`,3,!1),f=Y(t,`monospace`,3,!1),p=Y(t,`debounce`,3,!1),m=Y(t,`useEmojiAutocomplete`,3,!1),h=Y(t,`hidden`,3,!1),g=Y(t,`disabled`,3,!1),_=Y(t,`readonly`,3,!1),v=Y(t,`required`,3,!1),y=Y(t,`invalid`,3,!1),b=Y(t,`ariaLabel`,3,void 0),x=gs(t,dae),S=j(()=>typeof p()==`number`?p():300),C=j(()=>b()??x[`aria-label`]),w=0;R(()=>()=>{clearTimeout(w)});let T=e=>{r(i()?.value),t.oninput?.(e)},ee=e=>{let t=e;p()?(clearTimeout(w),w=setTimeout(()=>{T(t)},B(S))):T(t)};var E=pae();let te;var ne=P(E);us(ne,()=>({type:`text`,...x,value:r(),role:a(),dir:s(),name:c(),tabindex:g()?-1:0,disabled:g()||void 0,readonly:_()||void 0,inputmode:u(),"aria-label":B(C),"aria-hidden":h(),"aria-disabled":g(),"aria-readonly":_(),"aria-required":v(),"aria-invalid":y(),oninputcapture:ee}),void 0,void 0,void 0,`svelte-16h9hre`,!0),ms(ne,e=>i(e),()=>i()),$o(ne,()=>Tre(o()));var re=L(ne,2),ie=e=>{Wl(e,{get element(){return i()}})};K(re,e=>{m()&&!g()&&!_()&&e(ie)});var ae=L(re,2),oe=e=>{var t=fae();let i;Xc(P(t),{children:(e,t)=>{$r();var n=H();z(()=>G(n,B(C))),W(e,n)},$$slots:{default:!0}}),O(t),z(()=>{J(t,`id`,`${n}-label`),i=rs(t,1,`label svelte-16h9hre`,null,i,{hidden:!!r()})}),W(e,t)};K(ae,e=>{B(C)&&l()&&e(oe)}),O(E),z(()=>{te=rs(E,1,`sui text-input ${t.class??``}`,`svelte-16h9hre`,te,{flex:d(),monospace:f(),disabled:g(),readonly:_()}),J(E,`hidden`,h()),ne.dir=ne.dir}),W(e,E),A()}var hae=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`value`,`title`,`textboxAttrs`,`children`,`input`,`onkeydown`,`onkeyup`,`onkeypress`,`oninput`]),gae=V(`<!> <div class="input-outer svelte-116nsvd"><!></div>`,1),_ae={hash:`svelte-116nsvd`,code:`.input-outer.svelte-116nsvd {margin:12px 0 0;}`};function Kl(e,t){k(t,!0),q(e,_ae);let n=Y(t,`open`,15,!1),r=Y(t,`value`,15,``),i=Y(t,`textboxAttrs`,19,()=>({})),a=gs(t,hae);Pl(e,_s(()=>a,{get title(){return t.title},role:`alertdialog`,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var a=gae(),o=F(a);Uo(o,()=>t.children??jr);var s=L(o,2),c=P(s),l=e=>{var n=U();Uo(F(n),()=>t.input),W(e,n)},u=e=>{{let n=j(()=>`aria-labelledby`in i()?void 0:t.title);Gl(e,_s({dir:`auto`,flex:!0,autofocus:!0,get"aria-label"(){return B(n)}},i,{get onkeydown(){return t.onkeydown},get onkeyup(){return t.onkeyup},get onkeypress(){return t.onkeypress},get oninput(){return t.oninput},get value(){return r()},set value(e){r(e)}}))}};K(c,e=>{t.input?e(l):e(u,-1)}),O(s),W(e,a)},$$slots:{default:!0}})),A()}var vae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`orientation`,`ariaLabel`]),yae=V(`<div></div>`),bae={hash:`svelte-1almmfc`,code:`.divider.svelte-1almmfc {flex:none;background-color:var(--sui-secondary-border-color);}.divider[aria-orientation=horizontal].svelte-1almmfc {margin:8px 0;width:100%;height:1px;}.divider[aria-orientation=vertical].svelte-1almmfc {margin:0 8px;width:1px;height:100%;}`};function ql(e,t){q(e,bae);let n=Y(t,`hidden`,3,!1),r=Y(t,`orientation`,3,`horizontal`),i=Y(t,`ariaLabel`,3,void 0),a=gs(t,vae);var o=yae();us(o,()=>({...a,role:`separator`,class:`sui divider ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-orientation":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-1almmfc`),W(e,o)}var xae=(e,t)=>e===`top`||e===`bottom`?{axis:`Y`,sign:e===`bottom`?1:-1}:{axis:`X`,sign:e===`right`===t?-1:1},Sae=(e,t)=>Math.max(0,e*t),Cae=(e,t)=>[...e.filter(({time:e})=>t.time-e<=100),t],wae=e=>{let t=e[0],n=e[e.length-1];return!t||!n||n.time<=t.time?0:(n.offset-t.offset)/(n.time-t.time)},Tae=({offset:e,size:t,velocity:n})=>e>0&&(e>=t*.3||e>=16&&n>=.5),Eae=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`class`,`title`,`ariaLabelledby`,`position`,`size`,`showClose`,`swipeDismiss`,`children`,`header`,`headerExtra`,`footer`,`closeIcon`]),Dae=V(`<div role="none" class="handle svelte-1aqkku8"></div>`),Oae=V(`<div role="none" class="header svelte-1aqkku8"><div role="none" class="title svelte-1aqkku8"> </div> <!> <!> <!></div>`),kae=V(`<div role="none" class="footer svelte-1aqkku8"><!></div>`),Aae=V(`<div role="none"><!> <div role="none" class="extra-control svelte-1aqkku8"><!></div> <!> <div role="none" class="main svelte-1aqkku8"><!></div> <!> <!></div>`),jae={hash:`svelte-1aqkku8`,code:`.content.svelte-1aqkku8 {position:absolute;display:flex;flex-direction:column;max-width:100dvw;max-height:100dvh;border-width:var(--sui-drawer-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-drawer-content-border-color, var(--sui-primary-border-color));background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:transform;}.content.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {position:absolute;}.content.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) button.close {margin:8px;}dialog.open .content.svelte-1aqkku8 {transition-duration:150ms;transform:translateX(0%);}dialog:not(.open) .content.svelte-1aqkku8 {transition-duration:300ms;}.content.right.svelte-1aqkku8 {inset-block:var(--sui-drawer-right-content-inset-block, 0);inset-inline:var(--sui-drawer-right-content-inset-inline, auto 0);border-start-start-radius:var(--sui-drawer-right-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-right-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-right-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-right-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.right.full.svelte-1aqkku8 {border-radius:var(--sui-drawer-right-full-content-border-radius, var(--sui-drawer-right-content-border-radius, 0));}.content.right.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {inset-block-start:0;inset-inline-end:100%;}dialog:not(.open) .content.right.svelte-1aqkku8:dir(ltr) {transform:translateX(105%);}dialog:not(.open) .content.right.svelte-1aqkku8:dir(rtl) {transform:translateX(-105%);}.content.left.svelte-1aqkku8 {inset-block:var(--sui-drawer-left-content-inset-block, 0);inset-inline:var(--sui-drawer-left-content-inset-inline, 0 auto);border-start-start-radius:var(--sui-drawer-left-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-left-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-left-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-left-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.left.full.svelte-1aqkku8 {border-radius:var(--sui-drawer-left-full-content-border-radius, var(--sui-drawer-left-content-border-radius, 0));}.content.left.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {inset-block-start:0;inset-inline-start:100%;}dialog:not(.open) .content.left.svelte-1aqkku8:dir(ltr) {transform:translateX(-105%);}dialog:not(.open) .content.left.svelte-1aqkku8:dir(rtl) {transform:translateX(105%);}dialog.open .content.vertical.svelte-1aqkku8 {transform:translateX(0%);}.content.vertical.small.svelte-1aqkku8 {width:var(--sui-drawer-vertical-small-width, var(--sui-drawer-vertical-width, 400px));max-width:var(--sui-drawer-vertical-small-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-small-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.medium.svelte-1aqkku8 {width:var(--sui-drawer-vertical-medium-width, var(--sui-drawer-vertical-width, 600px));max-width:var(--sui-drawer-vertical-medium-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-medium-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.large.svelte-1aqkku8 {width:var(--sui-drawer-vertical-large-width, var(--sui-drawer-vertical-width, 800px));max-width:var(--sui-drawer-vertical-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.x-large.svelte-1aqkku8 {width:var(--sui-drawer-vertical-x-large-width, var(--sui-drawer-vertical-width, 1000px));max-width:var(--sui-drawer-vertical-x-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-x-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.full.svelte-1aqkku8 {width:100dvw;max-width:100dvw;height:100dvh;}.content.top.svelte-1aqkku8 {inset-block-start:var(--sui-drawer-top-content-inset-block, 0);inset-inline:var(--sui-drawer-top-content-inset-inline, 0 0);border-start-start-radius:var(--sui-drawer-top-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-top-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-top-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-top-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.top.full.svelte-1aqkku8 {border-radius:var(--sui-drawer-top-full-content-border-radius, var(--sui-drawer-top-content-border-radius, 0));}.content.top.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {inset-block-start:100%;inset-inline-end:0;}dialog:not(.open) .content.top.svelte-1aqkku8 {transform:translateY(-105%);}.content.bottom.svelte-1aqkku8 {inset-block:var(--sui-drawer-bottom-content-inset-block, auto 0);inset-inline:var(--sui-drawer-bottom-content-inset-inline, 0);border-start-start-radius:var(--sui-drawer-bottom-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-bottom-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-bottom-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-bottom-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.bottom.full.svelte-1aqkku8 {border-radius:var(--sui-drawer-bottom-full-content-border-radius, var(--sui-drawer-bottom-content-border-radius, 0));}.content.bottom.svelte-1aqkku8 .extra-control:where(.svelte-1aqkku8) {inset-block-end:100%;inset-inline-end:0;}dialog:not(.open) .content.bottom.svelte-1aqkku8 {transform:translateY(105%);}dialog.open .content.horizontal.svelte-1aqkku8 {transform:translateY(0%);}.content.horizontal.small.svelte-1aqkku8 {width:var(--sui-drawer-horizontal-small-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-small-height, var(--sui-drawer-horizontal-height, 400px));max-height:var(--sui-drawer-horizontal-small-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.medium.svelte-1aqkku8 {width:var(--sui-drawer-horizontal-medium-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-medium-height, var(--sui-drawer-horizontal-height, 600px));max-height:var(--sui-drawer-horizontal-medium-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.large.svelte-1aqkku8 {width:var(--sui-drawer-horizontal-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-large-height, var(--sui-drawer-horizontal-height, 800px));max-height:var(--sui-drawer-horizontal-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.x-large.svelte-1aqkku8 {width:var(--sui-drawer-horizontal-x-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-x-large-height, var(--sui-drawer-horizontal-height, 1000px));max-height:var(--sui-drawer-horizontal-x-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.full.svelte-1aqkku8 {width:100dvw;height:100dvh;max-height:100dvh;}.content.swipe-dismiss.svelte-1aqkku8 > :not(.main, .footer, .extra-control) {touch-action:none;user-select:none;}.content.swipe-dismiss.swiping.svelte-1aqkku8, .content.swipe-dismiss.swiping.svelte-1aqkku8 .handle:where(.svelte-1aqkku8) {cursor:grabbing;}.handle.svelte-1aqkku8 {flex:none;display:flex;justify-content:center;padding:8px 0;cursor:grab;}.handle.svelte-1aqkku8::before {content:"";border-radius:2px;width:32px;height:4px;background-color:var(--sui-drawer-handle-color, var(--sui-secondary-foreground-color));opacity:0.5;}:is(.header.svelte-1aqkku8, .footer.svelte-1aqkku8) {display:flex;align-items:center;gap:8px;}.header.svelte-1aqkku8 {flex-direction:var(--sui-drawer-header-flex-direction, row);box-sizing:content-box;margin:var(--sui-drawer-header-margin, 0 16px);border-width:var(--sui-drawer-header-border-width, 0 0 1px);border-color:var(--sui-drawer-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-drawer-header-padding, 16px 8px);height:var(--sui-drawer-header-height, 32px);}.header.svelte-1aqkku8 .title:where(.svelte-1aqkku8) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-1aqkku8 {margin:0 24px 24px;}.main.svelte-1aqkku8 {flex:auto;overflow:auto;padding:var(--sui-drawer-main-padding, 24px);white-space:normal;}`};function Mae(e,t){let n=Co();k(t,!0),q(e,jae);let r=Y(t,`open`,15,!1),i=Y(t,`title`,3,``),a=Y(t,`ariaLabelledby`,3,void 0),o=Y(t,`position`,3,`right`),s=Y(t,`size`,3,`small`),c=Y(t,`showClose`,3,`outside`),l=Y(t,`swipeDismiss`,3,!1),u=gs(t,Eae),d=M(void 0),f=j(()=>o()===`right`||o()===`left`?`vertical`:`horizontal`),p=M(void 0),m=M(void 0),h=M(0),g=e=>{let{button:t,isPrimary:n,pointerId:r,target:i,clientX:a,clientY:s}=e;if(!l()||!B(p)||B(m)||t!==0||!n)return;let c=i.closest(`.main, .footer, .extra-control, a, button, input, select, textarea, [contenteditable], [tabindex]`);if(c&&B(p).contains(c))return;let{axis:u,sign:d}=xae(o(),B(p).matches(`:dir(rtl)`));N(m,{pointerId:r,axis:u,sign:d,start:u===`Y`?s:a,samples:[]}),N(h,0),B(p).setPointerCapture(r)},_=e=>{let{pointerId:t,clientX:n,clientY:r,timeStamp:i}=e;B(m)&&t===B(m).pointerId&&(N(h,Sae((B(m).axis===`Y`?r:n)-B(m).start,B(m).sign),!0),B(m).samples=Cae(B(m).samples,{offset:B(h),time:i}))},v=e=>{if(!B(m)||!B(p)||e.pointerId!==B(m).pointerId)return;let{width:t,height:n}=B(p).getBoundingClientRect(),r=Cae(B(m).samples,{offset:B(h),time:e.timeStamp}),i=e.type===`pointerup`&&Tae({offset:B(h),size:B(m).axis===`Y`?n:t,velocity:wae(r)});N(m,void 0),N(h,0),i&&B(d)?.close(`close`)};R(()=>{r()||co(()=>{N(m,void 0),N(h,0)})});let y=j(()=>a()??(!t.header&&i()?`${n}-title`:void 0)),b=j(()=>B(y)?void 0:i()||void 0);ms(sl(e,_s(()=>u,{get id(){return n},class:`drawer`,get"aria-label"(){return B(b)},get"aria-labelledby"(){return B(y)},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var a=Aae();let u;var y=P(a),b=e=>{W(e,Dae())};K(y,e=>{l()&&o()===`bottom`&&e(b)});var x=L(y,2),S=P(x),C=e=>{Nl(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{B(d)?.close(`close`)}})};K(S,e=>{c()===`outside`&&e(C)}),O(x);var w=L(x,2),T=e=>{var r=U(),a=F(r),o=e=>{var n=U();Uo(F(n),()=>t.header),W(e,n)},s=e=>{var r=Oae(),a=P(r),o=I(a,!0),s=L(a,2);Ml(s,{flex:!0});var l=L(s,2);Uo(l,()=>t.headerExtra??jr);var u=L(l,2),f=e=>{Nl(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{B(d)?.close(`close`)}})};K(u,e=>{c()===`inside`&&e(f)}),O(r),z(()=>{J(a,`id`,`${n}-title`),G(o,i())}),W(e,r)};K(a,e=>{t.header?e(o):e(s,-1)}),W(e,r)};K(w,e=>{(i()||c()===`inside`||t.header||t.headerExtra)&&e(T)});var ee=L(w,2);Uo(P(ee),()=>t.children??jr),O(ee);var E=L(ee,2),te=e=>{var n=kae();Uo(P(n),()=>t.footer??jr),O(n),W(e,n)};K(E,e=>{t.footer&&e(te)});var ne=L(E,2),re=e=>{W(e,Dae())};K(ne,e=>{l()&&o()===`top`&&e(re)}),O(a),ms(a,e=>N(p,e),()=>B(p)),z(()=>{rs(a,1,ts([`content`,t.class,s(),o(),B(f),{"swipe-dismiss":l(),swiping:!!B(m)}]),`svelte-1aqkku8`),u=as(a,``,u,{transform:B(m)?`translate${B(m).axis}(${B(m).sign*B(h)}px)`:void 0,"transition-duration":B(m)?`0s`:void 0})}),_o(`pointerdown`,a,g),_o(`pointermove`,a,_),_o(`pointerup`,a,v),go(`pointercancel`,a,v),W(e,a)},$$slots:{default:!0}})),e=>N(d,e,!0),()=>B(d)),A()}vo([`pointerdown`,`pointermove`,`pointerup`]);var Nae=V(`<input class="sui file-picker" type="file" hidden=""/>`);function Jl(e,t){k(t,!0);let n=Y(t,`accept`,3,void 0),r=Y(t,`multiple`,3,!1),i=Y(t,`onSelect`,3,void 0),a=Y(t,`onCancel`,3,void 0),o=M(void 0);var s={open:()=>{B(o)?.click()}},c=Nae();return ms(c,e=>N(o,e),()=>B(o)),z(()=>{J(c,`accept`,n()),c.multiple=r()}),_o(`change`,c,({target:e})=>{let t=e,n=[...t.files];t.value=``,i()?.({files:n,file:n[0]})}),go(`cancel`,c,e=>{e.stopPropagation(),a()?.()}),W(e,c),A(s)}vo([`change`]);var Pae=new Set([`$$slots`,`$$events`,`$$legacy`,`expanded`,`class`,`label`,`collapsible`,`children`,`chevronIcon`,`onChange`]),Fae=V(`<span role="none" class="chevron svelte-1rk1blz"><!></span>`),Iae=V(`<div role="row" class="row-group-caption svelte-1rk1blz" data-selectable="false"><!></div>`),Lae=V(`<div><!> <!></div>`),Rae={hash:`svelte-1rk1blz`,code:`[role=rowgroup].svelte-1rk1blz {display:table-row-group;}[role=row].svelte-1rk1blz {display:table-row;}[role=columnheader].svelte-1rk1blz {display:table-cell;padding:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);text-align:start;}[role=columnheader].svelte-1rk1blz:has(> .expander) {padding:0;}[role=columnheader].svelte-1rk1blz .expander {justify-content:flex-start;margin:0;border-radius:0;padding:4px 8px 4px 4px;width:100%;height:auto;color:inherit;font-size:inherit;text-align:start;}.chevron.svelte-1rk1blz {flex:none;display:flex;align-items:center;justify-content:center;transition:transform 200ms;}.expander[aria-expanded='true'] > .chevron.svelte-1rk1blz:dir(ltr) {transform:rotate(90deg);}.expander[aria-expanded='true'] > .chevron.svelte-1rk1blz:dir(rtl) {transform:rotate(-90deg);}`};function Yl(e,t){let n=Co();k(t,!0),q(e,Rae);let r=Y(t,`expanded`,15,!0),i=Y(t,`label`,3,``),a=Y(t,`collapsible`,3,!1),o=gs(t,Pae),s=j(()=>a()&&!!i()),c=()=>{r(!r()),t.onChange?.(new CustomEvent(`Change`,{detail:{expanded:r()}}))},l=e=>{let t=t=>{B(s)&&t.target===e&&c()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var u=Lae();us(u,e=>({...o,role:`rowgroup`,class:`sui grid-body row-group ${t.class??``}`,"aria-labelledby":i()?`${n}-label`:void 0,"aria-roledescription":e}),[()=>X(`_sui.role_descriptions.grid_body`)],void 0,void 0,`svelte-1rk1blz`);var d=P(u),f=e=>{var a=Iae();Rte(P(a),()=>`th`,!1,(e,a)=>{us(e,()=>({role:`columnheader`,id:`${n}-label`,colspan:`9999`,class:``}),void 0,void 0,void 0,`svelte-1rk1blz`);var o=U(),l=F(o),u=e=>{ll(e,{class:`expander`,get label(){return i()},tabindex:`-1`,get"aria-expanded"(){return r()},onclick:c,startIcon:e=>{var n=Fae(),r=P(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{{let t=j(()=>Pc()?`chevron_left`:`chevron_right`);Lc(e,{get name(){return B(t)}})}};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),O(n),W(e,n)},$$slots:{startIcon:!0}})},d=e=>{var t=H();z(()=>G(t,i())),W(e,t)};K(l,e=>{B(s)?e(u):e(d,-1)}),W(a,o)}),O(a),$o(a,()=>l),W(e,a)};K(d,e=>{i()&&e(f)});var p=L(d,2),m=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(p,e=>{(!B(s)||r())&&e(m)}),O(u),W(e,u),A()}var zae=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`kind`,`class`,`children`]),Bae=V(`<div><!></div>`),Vae={hash:`svelte-777mc6`,code:`.table-head.svelte-777mc6,
|
||
.grid-head.svelte-777mc6 {display:table-header-group;}.table-foot.svelte-777mc6,
|
||
.grid-foot.svelte-777mc6 {display:table-footer-group;}.table-row.svelte-777mc6,
|
||
.grid-row.svelte-777mc6 {display:table-row;height:var(--sui-primary-row-height);}.table-col-header.svelte-777mc6,
|
||
.grid-col-header.svelte-777mc6,
|
||
.table-cell.svelte-777mc6,
|
||
.grid-cell.svelte-777mc6 {display:table-cell;}.table-row-header.svelte-777mc6,
|
||
.grid-row-header.svelte-777mc6 {display:table-cell;height:var(--sui-secondary-row-height);}`};function Xl(e,t){q(e,Vae);let n=gs(t,zae);var r=Bae();us(r,()=>({...n,role:t.role,class:`sui ${t.kind??``} ${t.class??``}`}),void 0,void 0,void 0,`svelte-777mc6`),Uo(P(r),()=>t.children??jr),O(r),W(e,r)}var Hae=new Set([`$$slots`,`$$events`,`$$legacy`]);function Zl(e,t){let n=gs(t,Hae);Xl(e,_s(()=>n,{role:`gridcell`,kind:`grid-cell`}))}var Uae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`sortOrder`,`children`,`onSort`]),Wae={hash:`svelte-mv7bmv`,code:`:where(.sui.grid-col-header.sortable) {position:relative;}.sui.grid-col-header.sortable > .sui.button.sort-button {justify-content:flex-start;margin:0;border-radius:0;padding:0;width:100%;height:auto;color:inherit;font:inherit;text-align:start;}.sui.grid-col-header.sortable > .sui.button.sort-button::after {position:absolute;inset:0;content:"";}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon {flex:none;font-size:16px;transition:opacity 200ms;}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0;}.sui.grid-col-header.sortable > .sui.button.sort-button:is(:hover, :focus-visible) .sort-icon.none {opacity:0.4;}
|
||
@media (hover: none) {.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0.4;}
|
||
}`};function Ql(e,t){k(t,!0),q(e,Wae);let n=Y(t,`sortOrder`,3,void 0),r=gs(t,Uae),i=e=>{let r=e=>{e.stopPropagation(),t.onSort?.(new CustomEvent(`Sort`,{detail:{sortOrder:n()===`ascending`?`descending`:`ascending`}}))},i=e=>{let{key:t}=e;(t===`Enter`||t===` `)&&e.stopPropagation()};return e.addEventListener(`click`,r),e.addEventListener(`keydown`,i),()=>{e.removeEventListener(`click`,r),e.removeEventListener(`keydown`,i)}};var a=U(),o=F(a),s=e=>{Xl(e,_s(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return t.class},children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{default:!0}}))},c=e=>{{let a=j(()=>t.class?`sortable ${t.class}`:`sortable`),o=j(()=>n()===`none`?void 0:n());Xl(e,_s(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return B(a)},get"aria-sort"(){return B(o)},children:(e,r)=>{{let r=e=>{{let t=j(()=>n()===`descending`?`arrow_downward`:`arrow_upward`);Lc(e,{get class(){return`sort-icon ${n()??``}`},get name(){return B(t)}})}};ll(e,{class:`sort-button`,[lo()]:i,endIcon:r,children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{endIcon:!0,default:!0}})}},$$slots:{default:!0}}))}};K(o,e=>{n()===void 0?e(s):e(c,-1)}),W(e,a),A()}var Gae=new Set([`$$slots`,`$$events`,`$$legacy`]);function Kae(e,t){k(t,!0);let n=gs(t,Gae);di(`sui:grid-unselectable-rows`,!0);{let t=j(()=>X(`_sui.role_descriptions.grid_head`));Xl(e,_s(()=>n,{role:`rowgroup`,kind:`grid-head`,get"aria-roledescription"(){return B(t)}}))}A()}var qae=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`]);function $l(e,t){k(t,!0);let n=Y(t,`selected`,3,!1),r=gs(t,qae),i=ui(`sui:grid-unselectable-rows`)===!0,a=j(()=>{if(!i)return{...r,"aria-selected":n()};let{"aria-selected":e,...t}=r;return{...t,"data-selectable":`false`}}),o=e=>{let t=t=>{let n=e.querySelector(`.sort-button`);t.target===e&&n&&(t.stopPropagation(),n.focus())};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var s=U(),c=F(s),l=e=>{Xl(e,_s(()=>B(a),{role:`row`,kind:`grid-row`,tabindex:`0`,[lo()]:o}))},u=e=>{Xl(e,_s(()=>B(a),{role:`row`,kind:`grid-row`,tabindex:`0`}))};K(c,e=>{i?e(l):e(u,-1)}),W(e,s),A()}var Jae=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`multiple`,`clickToSelect`,`ariaLabel`,`children`,`onChange`]),Yae=V(`<div><!></div>`),Xae={hash:`svelte-o5vcva`,code:`.grid.svelte-o5vcva {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.grid.data.svelte-o5vcva {border-collapse:collapse;}.grid.data.svelte-o5vcva :is(.grid-col-header, .grid-row-header, .grid-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function Zae(e,t){k(t,!0),q(e,Xae);let n=Y(t,`element`,15),r=Y(t,`multiple`,3,!1),i=Y(t,`clickToSelect`,3,!0),a=Y(t,`ariaLabel`,3,void 0),o=gs(t,Jae);di(`sui:grid-unselectable-rows`,!1);var s=Yae(),c=e=>{t.onChange?.(e)};us(s,()=>({...o,role:`grid`,class:`sui grid ${t.class??``}`,"aria-multiselectable":r(),"aria-label":a(),onChange:c}),void 0,void 0,void 0,`svelte-o5vcva`),Uo(P(s),()=>t.children??jr),O(s),ms(s,e=>n(e),()=>n()),$o(s,()=>El({clickToSelect:i()})),W(e,s),A()}var Qae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`multiple`,`searchTerms`,`ariaLabel`,`children`,`onFilter`]),$ae=V(`<div><div role="none" class="inner svelte-1gip2n8"><!></div></div>`),eoe={hash:`svelte-1gip2n8`,code:`[role=listbox].svelte-1gip2n8 {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);min-width:var(--sui-listbox-min-width, calc(var(--sui-option-height) * 5));color:var(--sui-listbox-foreground-color);background-color:var(--sui-listbox-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}[role=listbox].svelte-1gip2n8 [role=separator] {margin:4px 0;background-color:var(--sui-control-border-color);}[role=listbox][aria-invalid=true].svelte-1gip2n8 {border-color:var(--sui-error-border-color);}[role=listbox].tabs.svelte-1gip2n8 {padding:0;border-block-start-width:0;border-block-end-width:0;border-inline-end-width:1px;border-inline-start-width:0;border-color:var(--sui-control-border-color);}[role=listbox].tabs.svelte-1gip2n8 .option button {justify-content:flex-start;border-width:0;border-inline-end-width:2px;border-color:transparent;padding:0 12px;border-start-end-radius:0;border-end-end-radius:0;height:var(--sui-tab-medium-height);}[role=listbox].tabs.svelte-1gip2n8 .option button[aria-selected=true] {border-color:var(--sui-primary-accent-color-light);}[role=listbox].tabs.svelte-1gip2n8 .option button .icon {display:none;}[role=listbox].tabs[aria-readonly=true].svelte-1gip2n8 .option button[aria-selected='true'] {border-color:var(--sui-readonly-accent-color);}[role=listbox].in-combobox.svelte-1gip2n8:focus-visible, [role=listbox].svelte-1gip2n8:focus-visible:has(.focused) {outline-color:transparent;}[role=listbox].filtered.svelte-1gip2n8 [role=separator] {display:none;}.inner.svelte-1gip2n8 {display:contents;}`};function eu(e,t){k(t,!0),q(e,eoe);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`readonly`,3,!1),a=Y(t,`required`,3,!1),o=Y(t,`invalid`,3,!1),s=Y(t,`multiple`,3,!1),c=Y(t,`searchTerms`,3,``),l=Y(t,`ariaLabel`,3,void 0),u=gs(t,Qae),d=M(!1);var f=$ae(),p=e=>{let{detail:{matched:n,total:r}}=e;N(d,n!==r),t.onFilter?.(e)};us(f,()=>({...u,role:`listbox`,class:`sui listbox ${t.class??``}`,tabindex:r()?-1:0,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-multiselectable":s(),"aria-label":l(),onFilter:p,[cs]:{filtered:B(d)}}),void 0,void 0,void 0,`svelte-1gip2n8`);var m=P(f);Uo(P(m),()=>t.children??jr),O(m),O(f),$o(f,()=>El(()=>({searchTerms:c()}))),z(()=>m.inert=r()),W(e,f),A()}var toe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`label`,`children`]),noe=V(`<div><div role="none" class="label svelte-vkzbak"><!></div> <div role="none" class="inner svelte-vkzbak"><!></div></div>`),roe={hash:`svelte-vkzbak`,code:`.option-group.svelte-vkzbak:not(:first-child) {margin:12px 0 0;}.label.svelte-vkzbak {margin:8px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.inner.svelte-vkzbak {display:contents;}`};function tu(e,t){let n=Co();k(t,!0),q(e,roe);let r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`label`,3,``),o=gs(t,toe);var s=noe();us(s,e=>({...o,role:`group`,id:n,class:`sui option-group ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-labelledby":`${n}-label`,"aria-roledescription":e}),[()=>X(`_sui.role_descriptions.option_group`)],void 0,void 0,`svelte-vkzbak`);var c=P(s);Xc(P(c),{children:(e,t)=>{$r();var n=H();z(()=>G(n,a())),W(e,n)},$$slots:{default:!0}}),O(c);var l=L(c,2);Uo(P(l),()=>t.children??jr),O(l),O(s),z(()=>{J(c,`id`,`${n}-label`),l.inert=i()}),W(e,s),A()}var ioe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`hidden`,`class`,`disabled`,`label`,`value`,`searchValue`,`wrap`,`children`,`checkIcon`,`startIcon`,`onChange`,`onToggle`]),aoe=V(`<!> <!>`,1),ooe=V(`<div role="none"><!></div>`),soe={hash:`svelte-16etwr2`,code:`.option.svelte-16etwr2 {display:contents;}.option.svelte-16etwr2:focus-visible {outline-width:0 !important;}.option.wrap.svelte-16etwr2 button {white-space:normal;}.option.svelte-16etwr2 button {flex:none;display:flex;gap:4px;margin:0 !important;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);width:100%;height:auto;min-height:var(--sui-option-height);}.option.svelte-16etwr2 button:active {background-color:var(--sui-active-background-color);}.option.svelte-16etwr2 button[aria-selected=true] .icon.check {color:var(--sui-primary-accent-color-text);}.option.svelte-16etwr2 button * {flex:none;}.option.svelte-16etwr2 button .label {flex:auto;}.option.svelte-16etwr2 :is(.focused, button:hover) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-16etwr2 .icon.check {margin:-2px;}[role='listbox']:focus-visible .option.svelte-16etwr2 .focused {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role='listbox'][aria-readonly='true'] .option.svelte-16etwr2 button {cursor:default;}[role='listbox'][aria-readonly='true'] .option.svelte-16etwr2 button:not(.focused):is(:hover, :active) {color:var(--sui-control-foreground-color);background-color:transparent;}[role='listbox'][aria-readonly='true'] .option.svelte-16etwr2 button[aria-selected=true] .icon.check {color:var(--sui-readonly-accent-color);}`};function nu(e,t){let n=Co();k(t,!0),q(e,soe);let r=Y(t,`selected`,15,!1),i=Y(t,`hidden`,15,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`value`,3,void 0),s=Y(t,`searchValue`,3,void 0),c=Y(t,`wrap`,3,!1),l=gs(t,ioe),u=j(()=>o()===void 0?t.label:o()),d=j(()=>s()===void 0?t.label:s()),f=_ie();f&&ys(f.register({get value(){return B(u)},get label(){return t.label},get name(){return t.name},get type(){return t.valueType??Yc(B(u))},get selected(){return r()},set selected(e){r(e)},get disabled(){return a()}}));let p=j(()=>!f||f.expanded);var m=U(),h=F(m),g=e=>{var o=ooe();let s;var f=P(o);{let e=e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},o=j(()=>t.id??n);ll(f,_s(()=>l,{role:`option`,get id(){return B(o)},tabindex:`-1`,get"aria-selected"(){return r()},get label(){return t.label},get value(){return B(u)},get hidden(){return i()},get disabled(){return a()},get"data-search-value"(){return B(d)},onChange:e=>{r(e.detail.selected),t.onChange?.(e)},onToggle:e=>{i(e.detail.hidden),i()&&r(!1),t.onToggle?.(e)},startIcon:e,children:(e,n)=>{var i=aoe(),a=F(i),o=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.checkIcon),W(e,n)},a=e=>{Lc(e,{class:`check`,name:`check`})};K(r,e=>{t.checkIcon?e(i):e(a,-1)}),W(e,n)};K(a,e=>{r()&&e(o)}),Uo(L(a,2),()=>t.children??jr),W(e,i)},$$slots:{startIcon:!0,default:!0}}))}O(o),z(()=>{s=rs(o,1,`sui option ${t.class??``}`,`svelte-16etwr2`,s,{wrap:c()}),J(o,`hidden`,i())}),W(e,o)};K(h,e=>{B(p)&&e(g)}),W(e,m),A()}var coe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`,`onChange`]),loe=V(`<div><!></div>`),uoe={hash:`svelte-1j927nc`,code:`.menu.svelte-1j927nc {display:flex;flex-direction:column;margin:0;border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.menu.svelte-1j927nc [role=separator] {margin:var(--sui-menu-divider-margin, 4px);width:auto;background-color:var(--sui-menu-divider-color, var(--sui-control-border-color));}`};function ru(e,t){k(t,!0),q(e,uoe);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`ariaLabel`,3,void 0),a=gs(t,coe);var o=loe(),s=e=>{t.onChange?.(e)};us(o,()=>({...a,role:`menu`,class:`sui menu ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i(),onChange:s}),void 0,void 0,void 0,`svelte-1j927nc`),Uo(P(o),()=>t.children??jr),O(o),$o(o,El),W(e,o),A()}var doe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`role`,`hidden`,`disabled`,`label`,`labelDir`,`popupPosition`,`children`,`startIcon`,`endIcon`,`chevronIcon`,`items`,`onmouseenter`,`onmouseleave`,`onclick`,`onChange`,`onSelect`]),foe=V(`<span role="none" class="icon-outer svelte-1bqx3r4"><!></span>`),poe=V(`<div role="none"><!></div> <!>`,1),moe=V(`<div role="none"><!> <!></div>`),hoe={hash:`svelte-1bqx3r4`,code:`.menuitem.svelte-1bqx3r4 {position:relative;}.menuitem.svelte-1bqx3r4 button {display:flex;gap:var(--sui-menuitem-gap, 4px);align-items:var(--sui-menuitem-align-items, center);border-radius:var(--sui-menuitem-border-radius, var(--sui-option-border-radius, 4px));margin:0 !important;padding:var(--sui-menuitem-padding, 0 16px);width:100%;min-width:var(--sui-menuitem-min-width, 160px);height:var(--sui-menuitem-height, var(--sui-option-height));color:var(--sui-menuitem-foreground-color, var(--sui-control-foreground-color, inherit));background-color:var(--sui-menuitem-background-color, transparent);font-size:var(--sui-menuitem-font-size, var(--sui-option-font-size));font-weight:var(--sui-menuitem-font-weight, var(--sui-option-font-weight, var(--sui-font-weight-normal, normal)));}.menuitem.svelte-1bqx3r4 button[aria-checked=true] .icon {color:var(--sui-primary-accent-color-text);}.menuitem.svelte-1bqx3r4 button:hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.menuitem.svelte-1bqx3r4 button:active {background-color:var(--sui-active-background-color);}.content.svelte-1bqx3r4 {flex:auto;}.icon-outer.svelte-1bqx3r4 {flex:none;width:24px;height:24px;}`};function iu(e,t){k(t,!0),q(e,hoe);let n=Y(t,`role`,3,`menuitem`),r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`label`,3,``),o=Y(t,`labelDir`,3,void 0),s=Y(t,`popupPosition`,3,`right-top`),c=gs(t,doe),l=M(!1),u=M(!1),d,f=M(void 0),p=M(void 0),m=j(()=>n()===`menuitem`&&!!t.items),h=e=>{window.clearTimeout(d),d=window.setTimeout(e,200)};vs(()=>(N(p,B(f)?.closest(`dialog`)??void 0,!0),()=>{window.clearTimeout(d)}));var g=moe(),_=P(g);{let e=e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},s=e=>{var n=poe(),r=F(n);let i;var s=P(r),c=e=>{var t=H();z(()=>G(t,a())),W(e,t)},l=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(s,e=>{a()?e(c):e(l,-1)}),O(r);var u=L(r,2),d=e=>{var n=foe(),r=P(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{{let t=j(()=>Pc()?`chevron_left`:`chevron_right`);Lc(e,{get name(){return B(t)}})}};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),O(n),W(e,n)};K(u,e=>{B(m)&&e(d)}),z(()=>{i=rs(r,1,`content svelte-1bqx3r4`,null,i,{label:!!a()}),J(r,`dir`,a()?o():void 0),r.dir=r.dir}),W(e,n)},p=e=>{var n=U();Uo(F(n),()=>t.endIcon??jr),W(e,n)},g=j(()=>B(m)?`menu`:void 0),v=j(()=>B(m)?B(l):void 0);ll(_,_s(()=>c,{get role(){return n()},get hidden(){return r()},get disabled(){return i()},get"aria-haspopup"(){return B(g)},get"aria-expanded"(){return B(v)},onmouseenter:e=>{B(m)&&h(()=>{N(l,!0)}),t.onmouseenter?.(e)},onmouseleave:e=>{B(m)&&h(()=>{B(u)||N(l,!1)}),t.onmouseleave?.(e)},onclick:e=>{B(m)&&(e.preventDefault(),e.stopPropagation(),window.clearTimeout(d),N(l,e.detail?!0:!B(l),!0)),t.onclick?.(e)},get onChange(){return t.onChange},get onSelect(){return t.onSelect},get element(){return B(f)},set element(e){N(f,e,!0)},startIcon:e,children:s,endIcon:p,$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var v=L(_,2),y=e=>{cl(e,{get anchor(){return B(f)},get parentDialogElement(){return B(p)},get position(){return s()},get open(){return B(l)},set open(e){N(l,e,!0)},get hovered(){return B(u)},set hovered(e){N(u,e,!0)},children:(e,n)=>{ru(e,{children:(e,n)=>{var r=U();Uo(F(r),()=>t.items??jr),W(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(v,e=>{B(m)&&B(f)&&B(p)&&e(y)}),O(g),z(()=>{rs(g,1,`sui menuitem ${t.class??``}`,`svelte-1bqx3r4`),J(g,`hidden`,r())}),W(e,g),A()}var goe=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`checked`,`class`,`hidden`,`disabled`,`label`,`children`,`startIcon`,`onChange`]);function au(e,t){k(t,!0);let n=Y(t,`checked`,15),r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`label`,3,``),o=gs(t,goe),s=j(()=>t.role===`menuitemradio`?`menu-item-radio`:`menu-item-checkbox`);iu(e,_s(()=>o,{get role(){return t.role},get class(){return`sui ${B(s)??``} ${t.class??``}`},get label(){return a()},get hidden(){return r()},get disabled(){return i()},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)},startIcon:e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},children:e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)},endIcon:e=>{var t=U(),r=F(t),i=e=>{Lc(e,{name:`check`})};K(r,e=>{n()&&e(i)}),W(e,t)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),A()}var _oe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function ou(e,t){k(t,!0);let n=Y(t,`checked`,15),r=gs(t,_oe);au(e,_s(()=>r,{role:`menuitemcheckbox`,get checked(){return n()},set checked(e){n(e)}})),A()}var voe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function su(e,t){k(t,!0);let n=Y(t,`checked`,15),r=gs(t,voe);au(e,_s(()=>r,{role:`menuitemradio`,get checked(){return n()},set checked(e){n(e)}})),A()}var yoe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`now`,`min`,`max`,`text`,`ariaLabel`]),boe=V(`<div><div role="none" class="svelte-1t6ns2s"></div></div>`),xoe={hash:`svelte-1t6ns2s`,code:`.progressbar.svelte-1t6ns2s {overflow:hidden;border-width:var(--sui-progressbar-border-width, 1px);border-style:var(--sui-progressbar-border-style, solid);border-color:var(--sui-progressbar-border-color, var(--sui-control-border-color));border-radius:var(--sui-progressbar-border-radius, 16px);width:var(--sui-progressbar-width, 240px);height:var(--sui-progressbar-height, 10px);background-color:var(--sui-progressbar-background-color, var(--sui-secondary-background-color));}.progressbar.svelte-1t6ns2s div:where(.svelte-1t6ns2s) {height:100%;background-color:var(--sui-progressbar-foreground-color, var(--sui-primary-accent-color-light));transition:width 250ms;}`};function Soe(e,t){q(e,xoe);let n=Y(t,`now`,3,0),r=Y(t,`min`,3,0),i=Y(t,`max`,3,100),a=Y(t,`ariaLabel`,3,void 0),o=gs(t,yoe),s=j(()=>i()>r()?Math.min(Math.max((n()-r())/(i()-r())*100,0),100):0);var c=boe();us(c,()=>({...o,role:`progressbar`,class:`sui progressbar ${t.class??``}`,"aria-valuenow":n(),"aria-valuemin":r(),"aria-valuemax":i(),"aria-valuetext":t.text,"aria-label":a()}),void 0,void 0,void 0,`svelte-1t6ns2s`);var l=P(c);let u;O(c),z(()=>u=as(l,``,u,{width:`${B(s)}%`})),W(e,c)}var Coe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`orientation`,`ariaLabel`,`children`,`onChange`]),woe=V(`<div><div role="none" class="inner svelte-1v5wx8a"><!></div></div>`),Toe={hash:`svelte-1v5wx8a`,code:`.radio-group.svelte-1v5wx8a {display:inline-flex;}.radio-group.svelte-1v5wx8a:focus-visible {outline-width:0 !important;}.radio-group.horizontal.svelte-1v5wx8a {gap:8px;align-items:center;flex-wrap:wrap;}.radio-group.vertical.svelte-1v5wx8a {gap:4px;flex-direction:column;}
|
||
@media (pointer: coarse) {.radio-group.vertical.svelte-1v5wx8a {gap:8px;}
|
||
}.radio-group[aria-invalid=true].svelte-1v5wx8a button {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-1v5wx8a button[aria-checked=true] {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-1v5wx8a button[aria-checked=true]::before {background-color:var(--sui-error-border-color);}.inner.svelte-1v5wx8a {display:contents;}`};function cu(e,t){k(t,!0),q(e,Toe);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`readonly`,3,!1),a=Y(t,`required`,3,!1),o=Y(t,`invalid`,3,!1),s=Y(t,`orientation`,3,`horizontal`),c=Y(t,`ariaLabel`,3,void 0),l=gs(t,Coe);var u=woe(),d=e=>{t.onChange?.(e)};us(u,()=>({...l,role:`radiogroup`,class:[`sui`,`radio-group`,t.class,s()],tabindex:`-1`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-orientation":s(),"aria-label":c(),onChange:d}),void 0,void 0,void 0,`svelte-1v5wx8a`);var f=P(u);Uo(P(f),()=>t.children??jr),O(f),O(u),$o(u,El),z(()=>f.inert=r()),W(e,u),A()}var Eoe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`hidden`,`disabled`,`name`,`value`,`valueType`,`label`,`ariaLabel`,`group`,`children`,`onChange`,`onSelect`]),Doe=V(`<label class="svelte-1p416ls"><!></label>`),Ooe=V(`<span role="none"><!> <!></span>`),koe={hash:`svelte-1p416ls`,code:`.radio.svelte-1p416ls {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.radio.svelte-1p416ls:hover button {background-color:var(--sui-hover-background-color);}.radio.svelte-1p416ls:hover button[aria-checked=true] {border-color:var(--sui-primary-accent-color-light);color:var(--sui-primary-accent-color-text);}.radio.svelte-1p416ls:hover button[aria-checked=true]::before {background-color:var(--sui-primary-accent-color-light);}.radio.svelte-1p416ls:active button {background-color:var(--sui-active-background-color);}.radio.svelte-1p416ls:active button[aria-checked=true] {border-color:var(--sui-primary-accent-color-dark);color:var(--sui-primary-accent-color-dark);}.radio.svelte-1p416ls button {flex:none;justify-content:center;overflow:hidden;margin:0 !important;border-width:1.5px;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.radio.svelte-1p416ls button::before {content:"";border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 7px);height:calc(var(--sui-checkbox-height) - 7px);background-color:var(--sui-primary-accent-color);opacity:0;transition:all 200ms;will-change:opacity;}.radio.svelte-1p416ls button[aria-checked=true] {border-color:var(--sui-primary-accent-color);}.radio.svelte-1p416ls button[aria-checked=true]::before {opacity:1;}.radio.svelte-1p416ls label:where(.svelte-1p416ls) {cursor:inherit;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls {cursor:default;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls button, [role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls:is(:where(.svelte-1p416ls):hover, :where(.svelte-1p416ls):active) button {background-color:var(--sui-checkbox-background-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls button[aria-checked='true'], [role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls:is(:where(.svelte-1p416ls):hover, :where(.svelte-1p416ls):active) button[aria-checked='true'] {border-color:var(--sui-readonly-accent-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls button[aria-checked='true']::before, [role='radiogroup'][aria-readonly='true'] .radio.svelte-1p416ls:is(:where(.svelte-1p416ls):hover, :where(.svelte-1p416ls):active) button[aria-checked='true']::before {background-color:var(--sui-readonly-accent-color);}`};function lu(e,t){let n=Co();k(t,!0),q(e,koe);let r=Y(t,`checked`,7,!1),i=Y(t,`hidden`,3,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`name`,3,void 0),s=Y(t,`value`,3,void 0),c=Y(t,`valueType`,3,void 0),l=Y(t,`label`,3,void 0),u=Y(t,`ariaLabel`,3,void 0),d=Y(t,`group`,15),f=gs(t,Eoe),p=M(void 0),m=j(()=>u()??f[`aria-label`]),h=j(()=>!!(t.children||l())),g=()=>!!B(p)?.closest(`[role="radiogroup"]`)?.matches(`[aria-readonly="true"]`);R(()=>{typeof d()==`string`&&(d()===s()?r()||r(!0):r()&&r(!1))});var _=Ooe();let v;var y=P(_);{let e=j(()=>B(m)||void 0),l=j(()=>!B(m)&&B(h)?`${n}-label`:void 0);ll(y,_s(()=>f,{role:`radio`,get id(){return n},get hidden(){return i()},get disabled(){return a()},get name(){return o()},get value(){return s()},get valueType(){return c()},get"aria-checked"(){return r()},get"aria-label"(){return B(e)},get"aria-labelledby"(){return B(l)},onclick:e=>{e.preventDefault(),a()||r()||g()||(r(!0),typeof d()==`string`&&d(s()))},onChange:e=>{r(e.detail.checked),r()&&typeof d()==`string`&&d(s()),t.onChange?.(e)},get onSelect(){return t.onSelect},get element(){return B(p)},set element(e){N(p,e,!0)}}))}var b=L(y,2),x=e=>{var r=Doe(),i=P(r),a=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)},o=e=>{var t=H();z(()=>G(t,l())),W(e,t)};K(i,e=>{t.children?e(a):e(o,-1)}),O(r),z(()=>J(r,`id`,`${n}-label`)),W(e,r)};K(b,e=>{(t.children||l())&&e(x)}),O(_),z(()=>{v=rs(_,1,`sui radio ${t.class??``}`,`svelte-1p416ls`,v,{disabled:a()}),J(_,`hidden`,i())}),_o(`click`,_,e=>{e.target.matches(`button`)||B(p)?.click()}),W(e,_),A()}vo([`click`]);var uu=(e,t,n)=>{if(typeof e==`number`)return e;if(!e||typeof e!=`string`)return t;let r=e.trim(),i=r.match(/^(-?\d+(?:\.\d+)?)%$/);if(i)return Number(i[1]);let{containerSize:a}=n;if(!a)return t;let o=r.match(/^(-?\d+(?:\.\d+)?)px$/i);if(o)return Number(o[1])/a*100;let s=r.match(/^(-?\d+(?:\.\d+)?)(dvw|vw|dvh|vh)$/i);if(s){let e=Number(s[1]),t=s[2].toLowerCase().endsWith(`w`)?n.viewportWidth:n.viewportHeight;return e/100*t/a*100}return t},du=(e,t)=>{if(!e)return{minSize:0,maxSize:100};let n=Math.max(0,uu(e.minSize,0,t)),r=Math.min(100,uu(e.maxSize,100,t));return{minSize:n,maxSize:Math.max(n,r)}},fu=(e,t,n,r)=>{let i=r,a=n;for(;a.length&&Math.abs(i)>1e-9;){let n=i/a.length,r=a.map(r=>{let{minSize:i,maxSize:a}=t[r],o=Math.min(a,Math.max(i,e[r]+n)),s=o-e[r];return e[r]=o,s});i-=r.reduce((e,t)=>e+t,0),a=a.filter(r=>n>0?e[r]<t[r].maxSize:e[r]>t[r].minSize)}return i},Aoe=(e,t)=>{let n=e.filter(e=>!Number.isNaN(e)),r=n.reduce((e,t)=>e+t,0),i=e.length-n.length,a=Math.max(0,100-r),o=i>0?a/i:0,s=e.map(e=>Number.isNaN(e)?o:e);if(!t)return s;let c=s.reduce((e,t)=>e+t,0),l=s.map((e,n)=>t[n]??{minSize:0,maxSize:100}),u=s.map((e,t)=>Math.min(l[t].maxSize,Math.max(l[t].minSize,e))),d=s.map((e,t)=>t);return fu(u,l,d,fu(u,l,d.filter(t=>Number.isNaN(e[t])),c-u.reduce((e,t)=>e+t,0))),u},joe=(e,{sizeBefore:t,sizeAfter:n,constraintsBefore:r,constraintsAfter:i})=>{let a=Math.max(0,Math.min(r.maxSize-t,n-i.minSize)),o=Math.max(0,Math.min(t-r.minSize,i.maxSize-n));return e>0?Math.min(e,a):-Math.min(-e,o)},Moe=({key:e,shiftKey:t,isHorizontal:n,rtl:r})=>{if(e===`Enter`)return{type:`toggle`};if(e===`Home`)return{type:`resize`,delta:-100};if(e===`End`)return{type:`resize`,delta:100};let i=t?10:1,{prevKey:a,nextKey:o}=_l(n?`horizontal`:`vertical`,r);if(e===a)return{type:`resize`,delta:-i};if(e===o)return{type:`resize`,delta:i}},Noe=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`showHandleBar`,`class`,`ariaLabel`,`children`,`onResizeStart`,`onResizeEnd`]),Poe=V(`<div role="none" class="handle-bar svelte-isbt3i"></div>`),Foe=V(`<div><!></div>`),Ioe={hash:`svelte-isbt3i`,code:`.resizable-handle.svelte-isbt3i {position:relative;flex:0 0 auto;display:flex;align-items:center;justify-content:center;touch-action:none;outline-offset:0;background-color:transparent;transition:background-color 200ms;}.resizable-handle.svelte-isbt3i:focus-visible, .resizable-handle.svelte-isbt3i:hover, .resizable-handle.dragging.svelte-isbt3i {outline:none;z-index:1;background-color:var(--sui-primary-accent-color-translucent-light);}.resizable-handle.svelte-isbt3i:focus-visible .handle-bar:where(.svelte-isbt3i), .resizable-handle.svelte-isbt3i:hover .handle-bar:where(.svelte-isbt3i), .resizable-handle.dragging.svelte-isbt3i .handle-bar:where(.svelte-isbt3i) {background-color:var(--sui-primary-accent-color);}.resizable-handle.disabled.svelte-isbt3i {pointer-events:none;opacity:0.4;}.resizable-handle.svelte-isbt3i::before {content:"";position:absolute;inset:0;z-index:1;}.resizable-handle.horizontal.svelte-isbt3i {width:var(--sui-resizable-handle-size, 4px);height:100%;cursor:col-resize;}.resizable-handle.horizontal.svelte-isbt3i::before {inset-inline:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.horizontal.svelte-isbt3i .handle-bar:where(.svelte-isbt3i) {width:2px;height:40%;min-height:20px;}.resizable-handle.vertical.svelte-isbt3i {width:100%;height:var(--sui-resizable-handle-size, 4px);cursor:row-resize;}.resizable-handle.vertical.svelte-isbt3i::before {inset-block:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.vertical.svelte-isbt3i .handle-bar:where(.svelte-isbt3i) {height:2px;width:40%;min-width:20px;}.resizable-handle.svelte-isbt3i .handle-bar:where(.svelte-isbt3i) {border-radius:1px;background-color:hsl(var(--sui-border-color-1-hsl));transition:background-color 200ms;}`};function pu(e,t){k(t,!0),q(e,Ioe);let n=Y(t,`disabled`,3,!1),r=Y(t,`showHandleBar`,3,!1),i=Y(t,`ariaLabel`,3,void 0),a=gs(t,Noe),o=ui(`paneGroup`);if(!o)throw Error(`<ResizableHandle> must be used inside a <ResizablePaneGroup>`);let s=M(void 0),c=o.registerHandle(()=>B(s)),l=j(()=>c.index);ys(()=>{c.unregister()});let u=j(()=>o.direction===`horizontal`),d=j(()=>o.sizes),f=j(()=>B(d)[B(l)]??0),p=j(()=>o.getPaneConstraints(B(l))),m=j(()=>o.getPaneConstraints(B(l)+1)),h=j(()=>B(f)+(B(d)[B(l)+1]??0)),g=j(()=>Math.max(B(p).minSize,B(h)-B(m).maxSize)),_=j(()=>Math.min(B(p).maxSize,B(h)-B(m).minSize)),v=M(!1),y=M(0),b=0,x=M(0),S=M(!1),C=0,w=e=>{let{screenX:t,screenY:r,pointerId:i}=e;if(n()||!B(v)||i!==B(x))return;e.preventDefault(),e.stopPropagation();let a=(B(u)?t:r)-B(y);if(!C)return;let s=a/C*100;B(u)&&Pc()&&(s=-s),o.resize(B(l),b+s-(B(d)[B(l)]??0))},T=e=>{let{pointerId:n}=e;B(v)&&n===B(x)&&(B(s)?.releasePointerCapture(n),N(v,!1),N(y,0),N(x,0),t.onResizeEnd?.(),document.removeEventListener(`pointermove`,w),document.removeEventListener(`pointerup`,T),document.removeEventListener(`pointercancel`,T))},ee=e=>{if(n())return;e.preventDefault(),e.stopPropagation();let{screenX:r,screenY:i,pointerId:a}=e;N(v,!0),N(y,B(u)?r:i,!0),b=B(d)[B(l)]??0,N(x,a,!0),C=o.measurePaneSpace(),B(s)?.setPointerCapture(a),t.onResizeStart?.(),document.addEventListener(`pointermove`,w),document.addEventListener(`pointerup`,T),document.addEventListener(`pointercancel`,T)},E=e=>{if(n())return;let{key:r,shiftKey:i}=e,a=Moe({key:r,shiftKey:i,isHorizontal:B(u),rtl:Pc()});a&&(e.preventDefault(),e.stopPropagation(),a.type===`toggle`?o.toggleCollapse(B(l)):(r!==`Home`&&r!==`End`&&!B(S)&&(N(S,!0),t.onResizeStart?.()),o.resize(B(l),a.delta)))},te=()=>{B(S)&&(N(S,!1),t.onResizeEnd?.())};R(()=>()=>{document.removeEventListener(`pointermove`,w),document.removeEventListener(`pointerup`,T),document.removeEventListener(`pointercancel`,T)});var ne=Foe();us(ne,e=>({...a,role:`separator`,tabindex:n()?-1:0,"aria-orientation":B(u)?`vertical`:`horizontal`,"aria-valuenow":e,"aria-valuemin":B(g),"aria-valuemax":B(_),"aria-controls":o.paneDefs[B(l)]?.id,"aria-disabled":n()||void 0,"aria-label":i(),class:`sui resizable-handle ${t.class??``}`,onpointerdown:ee,onkeydown:E,onblur:te,[cs]:{horizontal:B(u),vertical:!B(u),disabled:n(),dragging:B(v)}}),[()=>Math.round(B(f))],void 0,void 0,`svelte-isbt3i`);var re=P(ne),ie=e=>{var n=U();Uo(F(n),()=>t.children),W(e,n)},ae=e=>{W(e,Poe())};K(re,e=>{t.children?e(ie):r()&&e(ae,1)}),O(ne),ms(ne,e=>N(s,e),()=>B(s)),W(e,ne),A()}var Loe=new Set([`$$slots`,`$$events`,`$$legacy`,`direction`,`class`,`children`,`onResize`]),Roe=V(`<div><!></div>`),zoe={hash:`svelte-8hr7aw`,code:`.resizable-pane-group.svelte-8hr7aw {display:flex;overflow:hidden;}.resizable-pane-group.horizontal.svelte-8hr7aw {flex-direction:row;width:100%;height:100%;}.resizable-pane-group.vertical.svelte-8hr7aw {flex-direction:column;width:100%;height:100%;}`};function mu(e,t){k(t,!0),q(e,zoe);let n=Y(t,`direction`,3,`horizontal`),r=gs(t,Loe),i=M([]),a=M([]),o=M(void 0),s=na([]),c=na([]),l=()=>{if(!B(o))return 0;let e=n()===`horizontal`,t=e?B(o).clientWidth:B(o).clientHeight,r=[...B(o).querySelectorAll(`:scope > .resizable-handle`)].reduce((t,n)=>t+(e?n.offsetWidth:n.offsetHeight),0);return Math.max(t-r,0)},u=()=>({containerSize:l(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}),d=e=>du(B(i)[e],u()),f=``,p=()=>{if(!B(i).length)return;let e=u(),t=B(i).map(t=>t.defaultSize===void 0?NaN:uu(t.defaultSize,NaN,e)),n=B(i).map(t=>du(t,e));s.splice(0,s.length,...Aoe(t,n)),f=s.map(e=>Number(e.toFixed(1))).join()},m=()=>{let e=s.map(e=>Number(e.toFixed(1))),n=e.join();n!==f&&(f=n,t.onResize?.({sizes:e}))},h=(e,t)=>{let n=e,r=e+1;if(n<0||r>=s.length)return;let i=s[n],a=s[r],o=joe(t,{sizeBefore:i,sizeAfter:a,constraintsBefore:d(n),constraintsAfter:d(r)});s[n]=i+o,s[r]=a-o,m()},g=e=>{let{minSize:t}=d(e);if(c[e]!==void 0&&Math.abs(s[e]-t)<.1){let t=c[e]-s[e];c[e]=void 0,h(e,t)}else c[e]=s[e],h(e,-(s[e]-t))},_=(e,t,n)=>{let r=t;return[...e,...s.map((e,t)=>t)].forEach(e=>{if(Math.abs(r)<.001||e===n||s[e]===void 0)return;let{minSize:t,maxSize:i}=d(e),a=Math.min(Math.max(s[e]+r,t),i);r-=a-s[e],s[e]=a}),r},v=()=>{if(!B(o)||!s.length)return;let e=[...B(o).querySelectorAll(`:scope > .resizable-pane`)].map(({id:e})=>e),t=t=>{let n=e.indexOf(t.id);return n===-1?1/0:n},n=B(i).toSorted((e,n)=>t(e)-t(n)),r=n.map(e=>s[B(i).indexOf(e)]);n.some((e,t)=>e!==B(i)[t])&&(N(i,n),s.splice(0,s.length,...r),c.length=0),s.forEach((e,t)=>{if(!Number.isNaN(e))return;let n=u(),r=B(i)[t],{minSize:a,maxSize:o}=du(r,n),c=r.defaultSize===void 0?NaN:uu(r.defaultSize,NaN,n),l=Math.min(Math.max(Number.isNaN(c)?100/s.length:c,a),o);s[t]=0,s[t]=l+_([t-1,t+1],-l,t)});let l=[...B(o).querySelectorAll(`:scope > .resizable-handle`)],d=e=>{let t=l.indexOf(e());return t===-1?1/0:t},f=B(a).toSorted((e,t)=>d(e)-d(t));f.some((e,t)=>e!==B(a)[t])&&(N(a,f),c.length=0),s.some(e=>Number.isNaN(e))||m()};di(`paneGroup`,{get direction(){return n()},sizes:s,registerPane:e=>(N(i,[...B(i),e]),s.length&&s.push(NaN),{get index(){return B(i).indexOf(e)},unregister:()=>{let t=B(i).indexOf(e);if(t!==-1&&(N(i,B(i).toSpliced(t,1)),s.length)){let[e]=s.splice(t,1);c.length=0,s.length&&!Number.isNaN(e)&&_([t-1,t],e)}}}),registerHandle:e=>(N(a,[...B(a),e]),{get index(){return B(a).indexOf(e)},unregister:()=>{N(a,B(a).filter(t=>t!==e)),c.length=0}}),resize:h,toggleCollapse:g,getPaneConstraints:d,measurePaneSpace:l,get paneDefs(){return B(i)}}),R(()=>{B(i).length&&!s.length&&p()}),R(()=>{if(!B(o))return;let e=new MutationObserver(()=>v());return e.observe(B(o),{childList:!0}),()=>{e.disconnect()}});var y=Roe();us(y,()=>({...r,role:`none`,class:[`sui`,`resizable-pane-group`,n(),t.class],"data-direction":n()}),void 0,void 0,void 0,`svelte-8hr7aw`),Uo(P(y),()=>t.children??jr),O(y),ms(y,e=>N(o,e),()=>B(o)),W(e,y),A()}var Boe=new Set([`$$slots`,`$$events`,`$$legacy`,`defaultSize`,`minSize`,`maxSize`,`class`,`children`,`onResize`]),Voe=V(`<div><!></div>`);function hu(e,t){let n=Co();k(t,!0);let r=Y(t,`defaultSize`,3,void 0),i=Y(t,`minSize`,3,0),a=Y(t,`maxSize`,3,100),o=gs(t,Boe),s=ui(`paneGroup`);if(!s)throw Error(`<ResizablePane> must be used inside a <ResizablePaneGroup>`);let c=s.registerPane({id:n,get defaultSize(){return r()},get minSize(){return i()},get maxSize(){return a()}}),l=j(()=>s.direction),u=j(()=>s.sizes[c.index]),d=j(()=>B(u)!==void 0&&!Number.isNaN(B(u))?`${B(u)}%`:typeof r()==`number`?`${r()}%`:r()??`0%`);ys(()=>{c.unregister()}),R(()=>{B(u)!==void 0&&!Number.isNaN(B(u))&&co(()=>t.onResize?.({size:Number(B(u).toFixed(1))}))});var f=Voe();us(f,()=>({...o,id:n,role:`none`,class:`sui resizable-pane ${t.class??``}`,[ls]:{"flex-basis":B(d),"flex-grow":`0`,"flex-shrink":`1`,"overflow-x":B(l)===`horizontal`?`auto`:void 0,"overflow-y":B(l)===`vertical`?`auto`:void 0}})),Uo(P(f),()=>t.children??jr),O(f),W(e,f),A()}var Hoe=V(`<div role="none" class="spinner svelte-pmsr8z"></div>`),Uoe=V(`<!> <!>`,1),Woe={hash:`svelte-pmsr8z`,code:`.spinner.svelte-pmsr8z {height:1px;}`};function gu(e,t){k(t,!0),q(e,Woe);let n=Y(t,`itemChunkSize`,3,25),r=M(na(n())),i=M(void 0),a=j(()=>t.items.length>B(r)),o=null,s=!1,c=e=>{if(s)return o;let t=null;o=null;for(let n=e.parentElement;n;n=n.parentElement)if(/^(auto|scroll)$/.test(getComputedStyle(n).overflowY)&&(t??=n,n.scrollHeight-n.clientHeight>1)){o=n;break}return s=o===t,o};R(()=>{if(B(r),!B(i))return;let e=new IntersectionObserver(e=>{e.at(-1)?.isIntersecting&&B(a)&&N(r,B(r)+n())},{root:c(B(i)),rootMargin:`0px 0px 500px 0px`});return e.observe(B(i)),()=>{e.disconnect()}});var l=Uoe(),u=F(l);Ro(u,19,()=>t.items.slice(0,B(r)),(e,n)=>e[t.itemKey]??n,(e,n,r)=>{var i=U();Uo(F(i),()=>t.renderItem,()=>B(n),()=>B(r)),W(e,i)});var d=L(u,2),f=e=>{var t=Hoe();ms(t,e=>N(i,e),()=>B(i)),W(e,t)};K(d,e=>{B(a)&&e(f)}),W(e,l),A()}function Goe(e){let t=e-1;return t*t*t+1}function _u(e,{from:t,to:n},r={}){var{delay:i=0,duration:a=e=>Math.sqrt(e)*120,easing:o=Goe}=r,s=getComputedStyle(e),c=s.transform===`none`?``:s.transform,[l,u]=s.transformOrigin.split(` `).map(parseFloat);l/=e.clientWidth,u/=e.clientHeight;var d=Koe(e),f=e.clientWidth/n.width/d,p=e.clientHeight/n.height/d,m=t.left+t.width*l,h=t.top+t.height*u,g=n.left+n.width*l,_=n.top+n.height*u,v=(m-g)*f,y=(h-_)*p,b=t.width/n.width,x=t.height/n.height;return{delay:i,duration:typeof a==`function`?a(Math.sqrt(v*v+y*y)):a,easing:o,css:(e,t)=>`transform: ${c} translate(${t*v}px, ${t*y}px) scale(${e+t*b}, ${e+t*x});`}}function Koe(e){if(`currentCSSZoom`in e)return e.currentCSSZoom;for(var t=e,n=1;t!==null;)n*=+getComputedStyle(t).zoom,t=t.parentElement;return n}var qoe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`flex`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`searchIcon`,`closeIcon`,`onClear`]),Joe=V(`<div><span role="none" class="svelte-5ubm3c"><!></span> <!> <!></div>`),Yoe={hash:`svelte-5ubm3c`,code:`.search-bar.svelte-5ubm3c {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.search-bar.flex.svelte-5ubm3c:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.search-bar.svelte-5ubm3c > span:where(.svelte-5ubm3c) {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;z-index:2;display:flex;align-items:center;justify-content:center;width:var(--sui-button-medium-height);height:var(--sui-button-medium-height);}.search-bar.svelte-5ubm3c .icon {font-size:calc(var(--sui-textbox-height) * 0.6);opacity:0.5;}.search-bar.svelte-5ubm3c > button {position:absolute;inset-block:0;inset-inline-start:auto;inset-inline-end:0;z-index:2;margin:0 !important;height:var(--sui-button-medium-height);}.search-bar.svelte-5ubm3c .label {--sui-textbox-singleline-padding: 0 36px;}.search-bar.svelte-5ubm3c .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.search-bar.svelte-5ubm3c input {z-index:1;padding:0 var(--sui-button-medium-height) !important;width:100%;}.search-bar.svelte-5ubm3c:dir(rtl) {--sui-textbox-text-align: right;}`};function vu(e,t){let n=Co();k(t,!0),q(e,Yoe);let r=Y(t,`value`,15),i=Y(t,`flex`,3,!1),a=Y(t,`hidden`,3,!1),o=Y(t,`disabled`,3,!1),s=Y(t,`readonly`,3,!1),c=Y(t,`required`,3,!1),l=Y(t,`invalid`,3,!1),u=gs(t,qoe),d=M(void 0);var f={focus:()=>{B(d)?.focus()}},p=Joe();let m;var h=P(p),g=P(h),_=e=>{var n=U();Uo(F(n),()=>t.searchIcon),W(e,n)},v=e=>{Lc(e,{name:`search`})};K(g,e=>{t.searchIcon?e(_):e(v,-1)}),O(h);var y=L(h,2);Gl(y,_s({dir:`auto`},()=>u,{role:`searchbox`,get id(){return n},get flex(){return i()},get hidden(){return a()},get disabled(){return o()},get readonly(){return s()},get required(){return c()},get invalid(){return l()},inputmode:`search`,get element(){return B(d)},set element(e){N(d,e,!0)},get value(){return r()},set value(e){r(e)}}));var b=L(y,2),x=e=>{{let i=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.closeIcon),W(e,n)},a=e=>{Lc(e,{name:`close`})};K(r,e=>{t.closeIcon?e(i):e(a,-1)}),W(e,n)},a=j(()=>o()||s()),c=j(()=>X(`_sui.clear`));ll(e,{iconic:!0,get disabled(){return B(a)},get"aria-label"(){return B(c)},get"aria-controls"(){return n},onclick:()=>{r(``),B(d)?.focus(),t.onClear?.()},startIcon:i,$$slots:{startIcon:!0}})}};return K(b,e=>{r()&&e(x)}),O(p),z(()=>{J(p,`role`,a()?void 0:`none`),m=rs(p,1,`sui search-bar ${t.class??``}`,`svelte-5ubm3c`,m,{flex:i(),disabled:o(),readonly:s()}),J(p,`hidden`,a()),J(p,`aria-hidden`,a())}),W(e,p),A(f)}var Xoe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`editable`,`position`,`filterThreshold`,`ariaLabel`,`children`,`chevronIcon`,`onChange`]),Zoe=V(`<div><div role="none" class="label svelte-5gd2qh"><!></div></div>`),Qoe=V(`<div role="status" class="no-options svelte-5gd2qh"> </div>`),$oe=V(`<div role="none" class="combobox-inner svelte-5gd2qh"><!> <div role="none" class="listbox-slot svelte-5gd2qh"></div> <!></div>`),ese=V(`<div role="none"><!> <!></div> <div role="none" class="idle-host" hidden=""><div role="none" class="option-host svelte-5gd2qh"><!></div></div> <!>`,1),tse={hash:`svelte-5gd2qh`,code:`:is(.option-host.svelte-5gd2qh, .listbox-slot.svelte-5gd2qh) {display:contents;}.combobox.svelte-5gd2qh {margin:var(--sui-focus-ring-width);display:flex;align-items:center;position:relative;min-width:var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));}.combobox.svelte-5gd2qh div[role=combobox]:where(.svelte-5gd2qh) {display:flex;align-items:center;border-width:1px;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-block:0;padding-inline-start:calc(var(--sui-textbox-height) / 4);padding-inline-end:var(--sui-textbox-height);width:100%;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;cursor:pointer;transition:all 200ms;}.combobox.svelte-5gd2qh div[role=combobox]:where(.svelte-5gd2qh):not(.selected) {font-style:italic;}.combobox.svelte-5gd2qh div[role=combobox]:where(.svelte-5gd2qh):is(:where(.svelte-5gd2qh):hover, :where(.svelte-5gd2qh):focus) {background-color:var(--sui-hover-background-color);}.combobox.svelte-5gd2qh div[role=combobox][aria-readonly=true]:where(.svelte-5gd2qh) {cursor:default;}.combobox.svelte-5gd2qh div[role=combobox][aria-readonly=true]:where(.svelte-5gd2qh):is(:where(.svelte-5gd2qh):hover, :where(.svelte-5gd2qh):focus):not(:focus-visible) {background-color:var(--sui-disabled-background-color);}.combobox.svelte-5gd2qh div[role=combobox][aria-invalid=true]:where(.svelte-5gd2qh) {border-color:var(--sui-error-border-color);}.combobox.svelte-5gd2qh div[role=combobox]:where(.svelte-5gd2qh) .label:where(.svelte-5gd2qh) {width:100%;}.combobox.svelte-5gd2qh .icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.combobox.svelte-5gd2qh > button {position:absolute;inset-block-start:0;inset-inline-end:0;z-index:1;margin:0 !important;border-start-start-radius:0;border-end-start-radius:0;background-color:transparent !important;}.combobox.svelte-5gd2qh > button[tabindex="-1"] {pointer-events:none;}.combobox.svelte-5gd2qh .text-input {margin:0 !important;width:100% !important;}.combobox.svelte-5gd2qh input {padding-block:0;padding-inline:8px 32px;width:0;}.combobox-inner.svelte-5gd2qh {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.combobox-inner.svelte-5gd2qh .sui.search-bar {flex:none;margin-bottom:calc(8px - var(--sui-focus-ring-width));}.combobox-inner.svelte-5gd2qh .sui.listbox {flex:auto;overflow-y:auto;}.combobox-inner.svelte-5gd2qh .no-options:where(.svelte-5gd2qh) {flex:none;display:flex;align-items:center;padding:var(--sui-option-padding);height:var(--sui-option-height);color:var(--sui-tertiary-foreground-color);}`};function nse(e,t){let n=Co();k(t,!0),q(e,tse);let r=Y(t,`value`,15),i=Y(t,`hidden`,3,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`readonly`,3,!1),s=Y(t,`required`,3,!1),c=Y(t,`invalid`,3,!1),l=Y(t,`editable`,3,!0),u=Y(t,`position`,3,`bottom-left`),d=Y(t,`filterThreshold`,3,5),f=Y(t,`ariaLabel`,3,void 0),p=gs(t,Xoe),m=M(!1),h=M(void 0),g=M(void 0),_=M(void 0),v=M(void 0),y=M(void 0),b=M(void 0),x=M(``),S=M(!1),C=M(``),w=M(0),T=j(()=>!B(C)||B(w)>0),ee=j(()=>B(h)??B(g)),E=gie(),te=()=>{let e=E.find(r());N(x,e?.label??``,!0),E.selectOnly(r())},ne=({type:e,name:n,label:r,value:i})=>{t.onChange?.(new CustomEvent(`Change`,{detail:{target:void 0,type:e,name:n,label:r,value:i}}))},re=e=>{let n=ml(e);r(n.value),te(),t.onChange?.(new CustomEvent(`Change`,{detail:n}))},ie=e=>{let{target:n}=e;r(n.value),te(),t.oninput?.(e),t.onChange?.(new CustomEvent(`Change`,{detail:{target:n,type:`string`,name:void 0,label:n.value,value:r()}}))},ae=new vl,oe=e=>{let{key:t,ctrlKey:n,metaKey:i,altKey:s}=e;if(a()||o()||B(m)||t.length!==1||t===` `||n||i||s)return;e.preventDefault();let c=E.entries.filter(e=>!e.disabled),l=yl(c.map(e=>gl(e.label??``)),ae.push(t),c.findIndex(e=>e.value===r()));if(l===-1)return;let u=c[l];u.value!==r()&&(r(u.value),te(),ne(u))},se=()=>B(y)?.querySelector(`[role="listbox"]`),ce=()=>{let e=se(),t=e?.querySelector(`[role="option"][aria-selected="true"]`);e&&t&&(t.classList.add(`focused`),e.setAttribute(`aria-activedescendant`,t.id),t.scrollIntoView(!0))};R(()=>{E.expanded=B(m)}),R(()=>{if(!B(m))return;let e=globalThis.setTimeout(ce,150);return()=>{globalThis.clearTimeout(e),se()?.removeAttribute(`aria-activedescendant`)}}),R(()=>{if(!B(y))return;let e=B(m)?B(b):B(v);e&&B(y).parentElement!==e&&e.append(B(y))}),vs(()=>{let e=E.selectedEntry;e&&(r(e.value),N(x,e.label,!0),ne(e))}),R(()=>{r(),te()});var le=ese(),ue=F(le);let de;var fe=P(ue),pe=e=>{var t=Zoe();us(t,()=>({...p,role:`combobox`,id:n,tabindex:a()?-1:0,"aria-expanded":B(m),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-haspopup":`listbox`,"aria-label":f(),onkeydown:oe,[cs]:{selected:r()!==void 0}}),void 0,void 0,void 0,`svelte-5gd2qh`);var l=P(t);Xc(P(l),{children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>r()===void 0?X(`_sui.combobox.select_an_option`):B(x)]),W(e,n)},$$slots:{default:!0}}),O(l),O(t),ms(t,e=>N(h,e),()=>B(h)),W(e,t)},me=e=>{{let t=j(()=>r()===void 0?``:String(r()));Gl(e,_s(()=>p,{dir:`auto`,role:`combobox`,get id(){return n},get value(){return B(t)},get hidden(){return i()},get disabled(){return a()},get readonly(){return o()},get required(){return s()},get invalid(){return c()},get"aria-expanded"(){return B(m)},"aria-haspopup":`listbox`,get ariaLabel(){return f()},oninput:ie,get element(){return B(g)},set element(e){N(g,e,!0)}}))}};K(fe,e=>{l()?e(me,-1):e(pe)});var he=L(fe,2);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{Lc(e,{name:`expand_more`})};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),W(e,n)},r=j(()=>!l()||o()||a()?-1:0),s=j(()=>B(m)?X(`_sui.collapse`):X(`_sui.expand`)),c=j(()=>B(m)?`${n}-popup`:void 0);ll(he,{variant:`ghost`,iconic:!0,get hidden(){return i()},get disabled(){return a()},get tabindex(){return B(r)},get"aria-label"(){return B(s)},get"aria-controls"(){return B(c)},get"aria-expanded"(){return B(m)},onclick:e=>{e.preventDefault(),e.stopPropagation(),!a()&&!o()&&N(m,!B(m))},startIcon:e,$$slots:{startIcon:!0}})}O(ue);var ge=L(ue,2),_e=P(ge);eu(P(_e),{get id(){return`${n}-listbox`},class:`in-combobox`,get searchTerms(){return B(C)},onclick:e=>{e.target.matches(`[role="option"]`)&&re(e.target)},onFilter:e=>{N(w,e.detail.matched,!0)},children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{default:!0}}),O(_e),ms(_e,e=>N(y,e),()=>B(y)),O(ge),ms(ge,e=>N(v,e),()=>B(v)),cl(L(ge,2),{get id(){return`${n}-popup`},class:`combobox`,get anchor(){return B(ee)},get position(){return u()},touchOptimized:!0,onOpen:()=>{N(S,d()!==-1&&E.count>d(),!0),N(C,``)},get content(){return B(_)},set content(e){N(_,e,!0)},get open(){return B(m)},set open(e){N(m,e,!0)},children:(e,t)=>{var r=$oe(),i=P(r),a=e=>{{let t=j(()=>X(`_sui.combobox.filter_options`));vu(e,{flex:!0,get"aria-label"(){return B(t)},get"aria-controls"(){return`${n}-listbox`},onkeydown:e=>{[`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),B(_)?.querySelector(`.sui.listbox`)?.dispatchEvent(new KeyboardEvent(`keydown`,e)))},get value(){return B(C)},set value(e){N(C,e,!0)}})}};K(i,e=>{B(S)&&e(a)});var o=L(i,2);ms(o,e=>N(b,e),()=>B(b));var s=L(o,2),c=e=>{var t=Qoe(),n=I(t,!0);z(e=>G(n,e),[()=>X(`_sui.combobox.no_matching_options`)]),W(e,t)};K(s,e=>{B(T)||e(c)}),O(r),W(e,r)},$$slots:{default:!0}}),z(()=>{de=rs(ue,1,`sui combobox ${t.class??``}`,`svelte-5gd2qh`,de,{editable:l()}),J(ue,`hidden`,i())}),W(e,le),A()}var rse=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`]);function yu(e,t){k(t,!0);let n=Y(t,`value`,15),r=gs(t,rse);nse(e,_s(()=>r,{get class(){return`sui select ${t.class??``}`},editable:!1,get value(){return n()},set value(e){n(e)}})),A()}var ise=(e,t,n)=>{if(t===n)return e;let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r},ase=({key:e,index:t,length:n,rtl:r})=>e===(r?`ArrowRight`:`ArrowLeft`)&&t>0?t-1:e===(r?`ArrowLeft`:`ArrowRight`)&&t<n-1?t+1:e===`Home`&&t>0?0:e===`End`&&t<n-1?n-1:-1,ose=({index:e,clientX:t,rect:n,rtl:r})=>t<n.left+n.width/2===r?e+1:e,sse=(e,t)=>{if(t!==e&&t!==e+1)return t>e?t-1:t},cse=new Set([`$$slots`,`$$events`,`$$legacy`,`values`,`options`,`max`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`onAddValue`,`onRemoveValue`,`onReorder`]),lse=V(`<span role="gridcell" class="svelte-c0or8s"><!></span>`),use=V(`<span role="row"><span class="label svelte-c0or8s" role="gridcell"> </span> <!></span>`),dse=V(`<div role="none"><span role="grid" class="svelte-c0or8s"></span> <!></div>`),fse={hash:`svelte-c0or8s`,code:`.select-tags.svelte-c0or8s {display:flex;flex-wrap:wrap;align-items:center;}.select-tags.disabled.svelte-c0or8s {pointer-events:none;}.select-tags.disabled.svelte-c0or8s > :where(.svelte-c0or8s) {opacity:0.5;}.select-tags.svelte-c0or8s span[role=grid]:where(.svelte-c0or8s) {display:contents;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);padding:0;padding-inline-start:8px;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-secondary-background-color);cursor:grab;outline:none;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s):focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.select-tags.svelte-c0or8s span[draggable].drag-source:where(.svelte-c0or8s) {opacity:0.4;cursor:grabbing;}.select-tags.svelte-c0or8s span[draggable].drop-before:where(.svelte-c0or8s)::before, .select-tags.svelte-c0or8s span[draggable].drop-after:where(.svelte-c0or8s)::after {content:"";position:absolute;top:0;bottom:0;margin-inline-start:-1px;border-radius:1px;width:4px;background-color:var(--sui-primary-accent-color);pointer-events:none;}.select-tags.svelte-c0or8s span[draggable].drop-before:where(.svelte-c0or8s)::before {inset-inline-start:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-c0or8s span[draggable].drop-after:where(.svelte-c0or8s)::after {inset-inline-end:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) .label:where(.svelte-c0or8s) {outline:none;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) span[role=gridcell]:where(.svelte-c0or8s):not(.label) {display:contents;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) button {outline-offset:-2px;}.select-tags.svelte-c0or8s span[draggable]:where(.svelte-c0or8s) .icon {font-size:var(--sui-font-size-large);}`};function pse(e,t){k(t,!0),q(e,fse);let n=Y(t,`values`,31,()=>na([])),r=Y(t,`max`,3,void 0),i=Y(t,`hidden`,3,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`readonly`,3,!1),s=Y(t,`required`,3,!1),c=Y(t,`invalid`,3,!1),l=gs(t,cse),u=j(()=>new Map(t.options.map(e=>[e.value,e]))),d=j(()=>new Set(n())),f=j(()=>t.options.some(({value:e})=>!B(d).has(e))),p=M(void 0),m=M(void 0),h=M(void 0),g=M(void 0),_=(e,r)=>{if(e===r)return;let i=ise(n(),e,r);n(i),t.onReorder?.(new CustomEvent(`Reorder`,{detail:{values:i}}))},v=async(e,t)=>{_(e,t),await ao(),(B(p)?.querySelectorAll(`.label[tabindex]`)?.[t])?.focus()};var y=dse();let b;var x=P(y);Ro(x,30,n,e=>e,(e,r,i)=>{let s=j(()=>B(u).get(r)),c=j(()=>B(s)?.label||B(s)?.value||r);var l=use();let d;var f=P(l),p=I(f,!0),m=L(f,2),_=e=>{var i=lse(),s=P(i);{let e=e=>{Lc(e,{name:`close`})},i=j(()=>a()||o()),l=j(()=>X(`_sui.select_tags.remove_x`,{values:{name:B(c)}}));ll(s,{iconic:!0,size:`small`,get disabled(){return B(i)},get"aria-label"(){return B(l)},onclick:()=>{n(n().filter(e=>e!==r)),t.onRemoveValue?.(new CustomEvent(`RemoveValue`,{detail:{value:r}}))},startIcon:e,$$slots:{startIcon:!0}})}O(i),W(e,i)};K(m,e=>{B(s)&&e(_)}),O(l),z(()=>{J(l,`draggable`,!a()&&!o()),d=rs(l,1,`svelte-c0or8s`,null,d,{"drag-source":B(h)===B(i),"drop-before":B(g)===B(i)&&B(h)!==B(i)&&B(h)!==B(i)-1,"drop-after":B(g)===n().length&&B(i)===n().length-1&&B(h)!==n().length-1}),J(f,`tabindex`,a()||o()?void 0:0),G(p,B(c))}),go(`dragstart`,l,e=>{N(h,B(i),!0),e.dataTransfer&&(e.dataTransfer.setData(`text/plain`,B(c)),e.dataTransfer.effectAllowed=`move`)}),go(`dragover`,l,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),N(g,ose({index:B(i),clientX:e.clientX,rect:e.currentTarget.getBoundingClientRect(),rtl:Pc()}),!0)}),go(`drop`,l,async e=>{e.preventDefault();let t=B(h),n=B(g);if(N(h,void 0),N(g,void 0),t===void 0||n===void 0)return;let r=sse(t,n);r!==void 0&&await v(t,r)}),go(`dragend`,l,()=>{N(h,void 0),N(g,void 0)}),_o(`keydown`,f,async e=>{let t=ase({key:e.key,index:B(i),length:n().length,rtl:Pc()});t!==-1&&(e.preventDefault(),await v(B(i),t))}),Xo(l,()=>_u,()=>({duration:200})),W(e,l)}),O(x);var S=L(x,2),C=e=>{{let r=j(()=>a()||o());yu(e,_s(()=>l,{get disabled(){return B(r)},get readonly(){return o()},get required(){return s()},get invalid(){return c()},onChange:()=>{B(m)!==void 0&&(n([...n(),B(m)]),t.onAddValue?.(new CustomEvent(`AddValue`,{detail:{value:B(m)}})),N(m,void 0))},get value(){return B(m)},set value(e){N(m,e,!0)},children:(e,n)=>{var r=U();Ro(F(r),17,()=>t.options,({label:e,value:t,searchValue:n})=>t,(e,t)=>{let n=()=>B(t).label,r=()=>B(t).value,i=()=>B(t).searchValue;var a=U(),o=F(a),s=e=>{nu(e,{get label(){return n()},get value(){return r()},get searchValue(){return i()}})},c=j(()=>!B(d).has(r()));K(o,e=>{B(c)&&e(s)}),W(e,a)}),W(e,r)},$$slots:{default:!0}}))}};K(S,e=>{(typeof r()!=`number`||n().length<r())&&B(f)&&e(C)}),O(y),ms(y,e=>N(p,e),()=>B(p)),z(e=>{b=rs(y,1,`sui select-tags ${t.class??``}`,`svelte-c0or8s`,b,{disabled:a()||o()}),J(y,`hidden`,i()),J(x,`aria-label`,e)},[()=>X(`_sui.select_tags.selected_options`)]),W(e,y),A()}vo([`keydown`]);var bu=e=>{let[t,n=`0`]=String(e).split(`e`);return Math.min(Math.max((t.split(`.`)[1]??``).length-Number(n),0),100)},mse=({min:e,max:t,step:n,barWidth:r})=>{let i=(t-e)/n,a=Math.floor(i+1e-9)+1,o=r/i,s=Array.from({length:a}),c=Math.max(bu(e),bu(n));return{valueList:s.map((t,r)=>Number((r*n+e).toFixed(c))),positionList:s.map((e,t)=>t*o)}},xu=(e,t,n)=>Math.min(t,Math.max(0,n?t-e:e)),Su=(e,t)=>{let n=e.findLastIndex(e=>e<=t),r=e.findIndex(e=>t<=e);return n===-1?r:r===-1||Math.abs(e[n]-t)<Math.abs(e[r]-t)?n:r},Cu=(e,t)=>{let{prevKey:n,nextKey:r}=_l(`horizontal`,t);return e===`ArrowUp`||e===r?1:e===`ArrowDown`||e===n?-1:0},hse=({key:e,rtl:t,currentIndex:n,length:r})=>{let i=r-1,a=Math.max(1,Math.round(r/10)),o;if(e===`Home`)o=0;else if(e===`End`)o=i;else if(e===`PageUp`)o=n+a;else if(e===`PageDown`)o=n-a;else{let r=Cu(e,t);if(!r)return-1;o=n+r}return o=Math.min(i,Math.max(0,o)),o===n?-1:o},wu=({valueIndex:e,targetPosition:t,sliderPositions:n})=>e===0&&n[1]<=t||e===1&&n[0]>=t,gse=({valueList:e,value:t,decreasing:n})=>{let r=e.indexOf(t);if(r!==-1)return r;if(n){let n=e.findIndex(e=>e>t);return n===-1?e.length:n}return e.findLastIndex(e=>e<t)},_se=(e,t)=>{let[n,r]=e,i=Math.abs(n-t),a=Math.abs(r-t);return i===a?+(t>r):+(a<i)},vse=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`min`,`max`,`sliderLabel`,`ariaLabelledby`,`values`,`sliderLabels`,`step`,`optionLabels`,`class`,`hidden`,`disabled`,`readonly`,`invalid`,`children`,`onChange`]),yse=V(`<div role="slider" class="svelte-6vjmsg"></div>`),bse=V(`<span role="none" class="label svelte-6vjmsg"> </span>`),xse=V(`<div><div role="none" class="base svelte-6vjmsg"><div role="none" class="base-bar svelte-6vjmsg"></div> <div class="slider-bar svelte-6vjmsg"></div> <div role="slider" class="svelte-6vjmsg"></div> <!> <!></div></div>`),Sse={hash:`svelte-6vjmsg`,code:`.slider.svelte-6vjmsg {position:relative;display:inline-block;margin:var(--sui-focus-ring-width);padding:4px 6px;touch-action:none;}.slider.svelte-6vjmsg:hover .base-bar:where(.svelte-6vjmsg) {background-color:var(--sui-hover-background-color);}.slider.svelte-6vjmsg:active .base-bar:where(.svelte-6vjmsg) {background-color:var(--sui-active-background-color);}.slider.readonly.svelte-6vjmsg .base-bar:where(.svelte-6vjmsg), .slider.readonly.svelte-6vjmsg:is(:where(.svelte-6vjmsg):hover, :where(.svelte-6vjmsg):active) .base-bar:where(.svelte-6vjmsg) {background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));}.slider.readonly.svelte-6vjmsg .base:where(.svelte-6vjmsg),
|
||
.slider.readonly.svelte-6vjmsg [role=slider]:where(.svelte-6vjmsg) {cursor:default;}.slider.readonly.svelte-6vjmsg:not(.invalid) .slider-bar:where(.svelte-6vjmsg) {background-color:var(--sui-readonly-accent-color);}.slider.readonly.svelte-6vjmsg:not(.invalid) [role=slider]:where(.svelte-6vjmsg) {border-color:var(--sui-readonly-accent-color);}.base.svelte-6vjmsg {position:relative;width:var(--sui-slider-base-width, 240px);height:calc(var(--sui-checkbox-height) / 2);cursor:pointer;}.base-bar.svelte-6vjmsg {border-width:1px;border-style:solid;border-color:var(--sui-control-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));transition:all 200ms;width:100%;height:100%;}.slider-bar.svelte-6vjmsg {position:absolute;top:0;height:calc(var(--sui-checkbox-height) / 2);border-radius:var(--sui-checkbox-height);background-color:var(--sui-primary-accent-color-light);}.invalid.svelte-6vjmsg .slider-bar:where(.svelte-6vjmsg) {background-color:var(--sui-error-border-color);}[role=slider].svelte-6vjmsg {position:absolute;top:0;border:3px solid var(--sui-primary-accent-color-light);border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 2px);height:calc(var(--sui-checkbox-height) - 2px);background-color:var(--sui-primary-accent-color-inverted);cursor:pointer;}[role=slider].svelte-6vjmsg::before {content:"";position:absolute;inset:-4px;border-radius:inherit;}[role=slider].svelte-6vjmsg:dir(ltr) {transform:translate(calc((var(--sui-checkbox-height) / 2 - 1px) * -1), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}[role=slider].svelte-6vjmsg:dir(rtl) {transform:translate(calc(var(--sui-checkbox-height) / 2 - 1px), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}.invalid.svelte-6vjmsg [role=slider]:where(.svelte-6vjmsg) {border-color:var(--sui-error-border-color);}.label.svelte-6vjmsg {position:absolute;top:calc(var(--sui-checkbox-height) / 2 + 8px);font-size:var(--sui-font-size-x-small);}.label.svelte-6vjmsg:dir(ltr) {transform:translateX(-50%);}.label.svelte-6vjmsg:dir(rtl) {transform:translateX(50%);}`};function Cse(e,t){k(t,!0),q(e,Sse);let n=Y(t,`value`,15,0),r=Y(t,`min`,3,0),i=Y(t,`max`,3,100),a=Y(t,`sliderLabel`,3,``),o=Y(t,`ariaLabelledby`,3,void 0),s=Y(t,`values`,15,void 0),c=Y(t,`sliderLabels`,3,void 0),l=Y(t,`step`,3,1),u=Y(t,`optionLabels`,19,()=>[]),d=Y(t,`hidden`,3,!1),f=Y(t,`disabled`,3,!1),p=Y(t,`readonly`,3,!1),m=Y(t,`invalid`,3,!1),h=gs(t,vse),g=j(()=>Array.isArray(s())),_=M(void 0),v=M(0),y=M(na([])),b=M(na([])),x=e=>{if(u().length!==B(b).length||e===void 0)return;let t=B(b).indexOf(e);return t===-1?void 0:String(u()[t])},S=M(0),C=M(0),w=na([0,0]),T=M(!1),ee=M(0),E=M(0),te=(e,r)=>{let i=s();(B(g)?i[e]:n())!==r&&(B(g)?(i[e]=r,s([...i]),t.onChange?.({values:s()})):(n(r),t.onChange?.({value:n()})))},ne=e=>{let t=Su(B(y),xu(e,B(v),Pc()));B(g)&&wu({valueIndex:B(E),targetPosition:B(y)[t],sliderPositions:w})||te(B(E),B(b)[t])},re=(e,t=0)=>{let{key:r,ctrlKey:i,metaKey:a,shiftKey:o,altKey:c}=e,l=o||c||i||a;if(f()||p()||l)return;let u=B(g)?s()[t]:n(),d=Pc(),m=hse({key:r,rtl:d,currentIndex:gse({valueList:B(b),value:u,decreasing:r===`PageDown`||Cu(r,d)===-1}),length:B(b).length});m===-1?[`Home`,`End`,`PageUp`,`PageDown`].includes(r)&&e.preventDefault():(e.preventDefault(),e.stopPropagation(),B(g)&&wu({valueIndex:t,targetPosition:B(y)[m],sliderPositions:w})||te(t,B(b)[m]))},ie=e=>{let{screenX:t,pointerId:n}=e;if(f()||p()||!B(T)||n!==B(ee))return;e.preventDefault(),e.stopPropagation();let r=t-B(C),i=B(S)+r;ne(i)},ae=e=>{let{pointerId:t,target:n}=e;if(f()||p()||!B(T)||t!==B(ee))return;e.stopPropagation();let r=n;if(r.matches(`.base-bar, .slider-bar`)){let t=B(_).getBoundingClientRect(),n=e.clientX-t.left;ne(n)}r.releasePointerCapture(t),N(T,!1),N(S,0),N(C,0),N(ee,0),N(E,0),document.removeEventListener(`pointermove`,ie),document.removeEventListener(`pointerup`,ae),document.removeEventListener(`pointercancel`,ae)},oe=(e,t)=>{if(f()||p())return;e.preventDefault(),e.stopPropagation(),N(T,!0);let{clientX:n,screenX:r,pointerId:i,target:a}=e,o=a,s=B(_).getBoundingClientRect();N(S,n-s.left),N(C,r,!0),N(ee,i,!0),N(E,t??(B(g)?_se(w,xu(B(S),B(v),Pc())):0),!0),o.setPointerCapture(i),document.addEventListener(`pointermove`,ie),document.addEventListener(`pointerup`,ae),document.addEventListener(`pointercancel`,ae)},se=e=>B(y)[Su(B(b),e)]??0,ce=()=>{if(B(g)){let[e,t]=s();w[0]=se(e),w[1]=se(t)}else w[0]=se(n())},le=()=>{B(_)&&(N(v,B(_).clientWidth,!0),(e=>{N(b,e.valueList,!0),N(y,e.positionList,!0)})(mse({min:r(),max:i(),step:l(),barWidth:B(v)})),ce())};vs(()=>{let e=new ResizeObserver(()=>le()),t=globalThis.matchMedia(`(pointer: coarse)`);return e.observe(B(_)),t.addEventListener(`change`,le),le(),()=>{e.disconnect(),t.removeEventListener(`change`,le),document.removeEventListener(`pointermove`,ie),document.removeEventListener(`pointerup`,ae),document.removeEventListener(`pointercancel`,ae)}}),R(()=>{n(),s(),ce()}),R(()=>{r(),i(),l(),co(le)});var ue=xse();go(`click`,ia.body,()=>{N(T,!1)}),us(ue,()=>({...h,role:`none`,class:`sui slider ${t.class??``}`,hidden:d(),[cs]:{disabled:f(),readonly:p(),invalid:m()}}),void 0,void 0,void 0,`svelte-6vjmsg`);var de=P(ue),fe=L(P(de),2);let pe;var me=L(fe,2);let he;var ge=L(me,2),_e=e=>{var t=yse();let n;z(e=>{J(t,`tabindex`,f()?-1:0),J(t,`aria-label`,c()?.[1]||void 0),J(t,`aria-hidden`,d()),J(t,`aria-disabled`,f()),J(t,`aria-readonly`,p()),J(t,`aria-invalid`,m()),J(t,`aria-valuemin`,r()),J(t,`aria-valuemax`,i()),J(t,`aria-valuenow`,s()?.[1]),J(t,`aria-valuetext`,e),n=as(t,``,n,{"inset-inline-start":`${w[1]}px`})},[()=>x(s()?.[1])]),_o(`pointerdown`,t,e=>oe(e,1)),_o(`keydown`,t,e=>re(e,1)),W(e,t)};K(ge,e=>{B(g)&&e(_e)});var ve=L(ge,2),ye=e=>{var t=U();Ro(F(t),19,u,(e,t)=>`${t}-${e}`,(e,t,n)=>{var r=bse();let i;var a=I(r,!0);z(()=>{i=as(r,``,i,{"inset-inline-start":`${B(v)/(u().length-1)*B(n)}px`}),G(a,B(t))}),W(e,r)}),W(e,t)};K(ve,e=>{u().length&&e(ye)}),O(de),ms(de,e=>N(_,e),()=>B(_)),O(ue),z(e=>{pe=as(fe,``,pe,{"inset-inline-start":`${B(g)?w[0]:0}px`,width:`${B(g)?w[1]-w[0]:w[0]}px`}),J(me,`tabindex`,f()?-1:0),J(me,`aria-label`,(B(g)?c()?.[0]:a())||void 0),J(me,`aria-labelledby`,B(g)?void 0:o()),J(me,`aria-hidden`,d()),J(me,`aria-disabled`,f()),J(me,`aria-readonly`,p()),J(me,`aria-invalid`,m()),J(me,`aria-valuemin`,r()),J(me,`aria-valuemax`,i()),J(me,`aria-valuenow`,B(g)?s()?.[0]:n()),J(me,`aria-valuetext`,e),he=as(me,``,he,{"inset-inline-start":`${w[0]}px`})},[()=>x(B(g)?s()?.[0]:n())]),_o(`pointerdown`,de,e=>oe(e)),_o(`pointerdown`,me,e=>oe(e,0)),_o(`keydown`,me,e=>re(e,0)),W(e,ue),A()}vo([`pointerdown`,`keydown`]);var wse=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`label`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`onChange`]),Tse=V(`<button><span role="none" class="svelte-1kefyv2"></span> <!></button>`),Ese={hash:`svelte-1kefyv2`,code:`button.svelte-1kefyv2 {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;}button[aria-invalid=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-error-border-color) !important;}button:hover[aria-checked=false].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-hover-background-color);}button:hover[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-primary-accent-color-light);}button:active[aria-checked=false].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-active-background-color);}button:active[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-primary-accent-color-dark);}button.svelte-1kefyv2:focus-visible {outline:0;}button.svelte-1kefyv2:focus-visible span:where(.svelte-1kefyv2) {outline-color:var(--sui-focus-ring-color);}button[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-primary-accent-color);border-color:transparent;}button[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2)::before {--translateX: var(--sui-checkbox-height) * 2 - var(--sui-checkbox-height);border-color:var(--sui-primary-accent-color);background-color:var(--sui-primary-accent-color-inverted);}button[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2):dir(ltr)::before {transform:translateX(calc(var(--translateX)));}button[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2):dir(rtl)::before {transform:translateX(calc((var(--translateX)) * -1));}button[aria-readonly=true].svelte-1kefyv2 {cursor:default;}button[aria-readonly=true][aria-checked=false].svelte-1kefyv2 span:where(.svelte-1kefyv2), button[aria-readonly=true]:is(:where(.svelte-1kefyv2):hover, :where(.svelte-1kefyv2):active)[aria-checked=false].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-control-background-color);}button[aria-readonly=true][aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2), button[aria-readonly=true]:is(:where(.svelte-1kefyv2):hover, :where(.svelte-1kefyv2):active)[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2) {background-color:var(--sui-readonly-accent-color);}button[aria-readonly=true][aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2)::before, button[aria-readonly=true]:is(:where(.svelte-1kefyv2):hover, :where(.svelte-1kefyv2):active)[aria-checked=true].svelte-1kefyv2 span:where(.svelte-1kefyv2)::before {border-color:var(--sui-readonly-accent-color);background-color:var(--sui-readonly-accent-color-inverted);}span.svelte-1kefyv2 {position:relative;width:calc(var(--sui-checkbox-height) * 2);height:var(--sui-checkbox-height);padding:0 2px;display:inline-flex;align-items:center;border-width:1.5px;border-style:solid;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-control-background-color);transition:all 200ms;}span.svelte-1kefyv2::before {display:inline-block;width:calc(var(--sui-checkbox-height) - 6px);height:calc(var(--sui-checkbox-height) - 6px);border-radius:var(--sui-checkbox-height);background-color:var(--sui-checkbox-border-color);transition:all 200ms;content:"";}`};function Tu(e,t){k(t,!0),q(e,Ese);let n=Y(t,`checked`,15,!1),r=Y(t,`label`,3,void 0),i=Y(t,`hidden`,3,!1),a=Y(t,`disabled`,3,!1),o=Y(t,`readonly`,3,!1),s=Y(t,`required`,3,!1),c=Y(t,`invalid`,3,!1),l=Y(t,`ariaLabel`,3,void 0),u=gs(t,wse);var d=Tse(),f=()=>{!a()&&!o()&&(n(!n()),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:n()}})))};us(d,()=>({...u,role:`switch`,class:`sui switch ${t.class??``}`,type:`button`,hidden:i(),disabled:a()||void 0,"aria-checked":n(),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-label":l(),onclick:f}),void 0,void 0,void 0,`svelte-1kefyv2`);var p=L(P(d),2),m=e=>{var t=H();z(()=>G(t,r())),W(e,t)},h=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(p,e=>{r()?e(m):e(h,-1)}),O(d),W(e,d),A()}var Dse=new Set([`$$slots`,`$$events`,`$$legacy`]);function Eu(e,t){let n=gs(t,Dse);Xl(e,_s(()=>n,{role:`cell`,kind:`table-cell`}))}var Ose=new Set([`$$slots`,`$$events`,`$$legacy`]);function kse(e,t){let n=gs(t,Ose);Xl(e,_s(()=>n,{role:`row`,kind:`table-row`}))}var Ase=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),jse=V(`<div><!></div>`),Mse={hash:`svelte-1hmxz0`,code:`.table.svelte-1hmxz0 {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.table.data.svelte-1hmxz0 {border-collapse:collapse;}.table.data.svelte-1hmxz0 :is(.table-col-header, .table-row-header, .table-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function Nse(e,t){q(e,Mse);let n=Y(t,`ariaLabel`,3,void 0),r=gs(t,Ase);var i=jse();us(i,()=>({...r,role:`table`,class:`sui table ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-1hmxz0`),Uo(P(i),()=>t.children??jr),O(i),W(e,i)}var Pse=({offsetTop:e,offsetLeft:t,offsetWidth:n,offsetHeight:r})=>Object.entries({top:e,left:t,width:n,height:r}).map(([e,t])=>`${e}: ${t}px`).join(`; `),Fse=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`name`,`ariaLabel`,`children`,`onChange`]),Ise=V(`<div><div role="none" class="inner svelte-1eozzeg"><!></div> <div role="none" class="indicator svelte-1eozzeg"></div></div>`),Lse={hash:`svelte-1eozzeg`,code:`.tab-list.svelte-1eozzeg {flex:none;position:relative;display:flex;align-items:center;margin:var(--sui-tab-list-margin, var(--sui-focus-ring-width));border-color:var(--sui-tab-list-border-color, var(--sui-control-border-color));border-radius:var(--sui-tab-list-border-radius, 0);background-color:var(--sui-tab-list-background-color, transparent);}.tab-list[aria-orientation=horizontal].svelte-1eozzeg {gap:var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));margin-block:var(--sui-horizontal-tab-list-margin-block, 0 32px);margin-inline:var(--sui-horizontal-tab-list-margin-inline, 0);border-block-width:var(--sui-horizontal-tab-list-border-block-width, 0 1px);border-inline-width:var(--sui-horizontal-tab-list-border-inline-width, 0 0);padding:var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));}.tab-list[aria-orientation=horizontal].svelte-1eozzeg button {width:var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));height:var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));justify-content:var(--sui-horizontal-tab-justify-content, center);}.tab-list[aria-orientation=horizontal].svelte-1eozzeg .indicator:where(.svelte-1eozzeg) {border-block-width:var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);border-inline-width:var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);}.tab-list[aria-orientation=vertical].svelte-1eozzeg {gap:var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));flex-direction:column;margin-block:var(--sui-vertical-tab-list-margin-block, 0);margin-inline:var(--sui-vertical-tab-list-margin-inline, 0 32px);border-block-width:var(--sui-vertical-tab-list-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-border-inline-width, 0 1px);padding:var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));width:var(--sui-vertical-tab-list-width, auto);}.tab-list[aria-orientation=vertical].svelte-1eozzeg button {justify-content:var(--sui-vertical-tab-justify-content, flex-start);padding-inline-end:32px;width:var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));height:var(--sui-vertical-tab-height, var(--sui-tab-height, auto));}.tab-list[aria-orientation=vertical].svelte-1eozzeg .indicator:where(.svelte-1eozzeg) {border-block-width:var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);}.tab-list.svelte-1eozzeg button {position:relative;z-index:1;border-color:transparent;margin:0 !important;border-radius:var(--sui-tab-border-radius, 0);font-family:var(--sui-tab-font-family, var(--sui-control-font-family, inherit));font-size:var(--sui-tab-font-size, var(--sui-control-font-size, inherit));font-weight:var(--sui-tab-font-weight, var(--sui-control-font-weight, var(--sui-font-weight-normal, normal)));}.inner.svelte-1eozzeg {display:contents;}.indicator.svelte-1eozzeg {position:absolute;z-index:0;inset:auto;border-radius:var(--sui-tab-list-indicator-border-radius, 0);border-color:var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));background-color:var(--sui-tab-list-indicator-background-color, transparent);box-shadow:var(--sui-tab-list-indicator-box-shadow, none);pointer-events:none;transition:var(--sui-tab-list-indicator-transition, all 200ms);}`};function Rse(e,t){k(t,!0),q(e,Lse);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`orientation`,3,`horizontal`),a=Y(t,`name`,3,void 0),o=Y(t,`ariaLabel`,3,void 0),s=gs(t,Fse),c=M(void 0),l=M(void 0),u=()=>{globalThis.requestAnimationFrame(()=>{let e=B(c)?.querySelector(`[role="tab"][aria-selected="true"]`);N(l,e?Pse(e):void 0,!0)})};vs(()=>{let e=new ResizeObserver(()=>{u()}),t=new MutationObserver(()=>{u()});return e.observe(B(c)),t.observe(B(c),{subtree:!0,attributes:!0,attributeFilter:[`aria-selected`]}),()=>{e.disconnect(),t.disconnect()}});var d=Ise(),f=()=>{u()},p=e=>{u(),t.onChange?.(e)};us(d,()=>({...s,role:`tablist`,class:`sui tab-list ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o(),"data-name":a()||void 0,onInitialized:f,onChange:p}),void 0,void 0,void 0,`svelte-1eozzeg`);var m=P(d);Uo(P(m),()=>t.children??jr),O(m);var h=L(m,2);O(d),ms(d,e=>N(c,e),()=>B(c)),$o(d,El),z(()=>{m.inert=r(),as(h,B(l))}),W(e,d),A()}var zse=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),Bse=V(`<div><!></div>`),Vse={hash:`svelte-129mcam`,code:`.tab-panel.svelte-129mcam {flex:auto;transition:all 200ms;}.tab-panel[aria-hidden=true].svelte-129mcam, .tab-panel.svelte-129mcam:not([aria-hidden]) {display:none;}`};function Hse(e,t){q(e,Vse);let n=gs(t,zse);var r=Bse();us(r,()=>({...n,role:`tabpanel`,class:`sui tab-panel ${t.class??``}`}),void 0,void 0,void 0,`svelte-129mcam`),Uo(P(r),()=>t.children??jr),O(r),W(e,r)}var Use=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`selected`,`children`,`startIcon`,`endIcon`]);function Wse(e,t){let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`selected`,3,!1),a=gs(t,Use);ll(e,_s(()=>a,{role:`tab`,get class(){return`sui tab ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get"aria-selected"(){return i()},startIcon:e=>{var n=U();Uo(F(n),()=>t.startIcon??jr),W(e,n)},children:e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)},endIcon:e=>{var n=U();Uo(F(n),()=>t.endIcon??jr),W(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var Du=[],Gse=()=>(Du.splice(0,Du.length,...Du.filter(e=>e.isConnected&&e.matches(`:modal`))),Du.at(-1)??document.querySelector(`.sui.app-shell`)??document.body),Ou=e=>{e.showPopover&&(e.matches(`:popover-open`)&&e.hidePopover(),e.querySelector(`.toast`)&&e.showPopover())},ku=e=>{let t=Gse();if(e.parentElement===t)return!1;let{moveBefore:n}=t;return typeof n==`function`&&e.isConnected?n.call(t,e,null):t.appendChild(e),!0},Kse=(e,t)=>{let n=[...e.children].find(e=>e.dataset.position===t);return n||(n=document.createElement(`div`),n.setAttribute(`role`,`none`),n.className=`toast-lane ${t}`,n.dataset.position=t,e.appendChild(n)),n},Au,ju=0,Mu=e=>{let{target:t,newState:n}=e;Au&&t instanceof HTMLDialogElement&&n===`open`&&t.matches(`:modal`)&&!Du.includes(t)&&(Du.push(t),ku(Au),Ou(Au))},Nu=e=>{let{target:t}=e;if(!Au||!(t instanceof HTMLDialogElement)||e.type===`beforetoggle`&&e.newState!==`closed`)return;let n=Du.indexOf(t);n>-1&&Du.splice(n,1),t.contains(Au)&&ku(Au)&&!Au.matches(`:popover-open`)&&Ou(Au)},qse=()=>(ju+=1,Au||(Au=document.createElement(`div`),Au.setAttribute(`role`,`none`),Au.className=`sui toast-base enabled`,Au.popover=`manual`,Du.push(...document.querySelectorAll(`dialog:modal`)),document.addEventListener(`toggle`,Mu,!0),document.addEventListener(`beforetoggle`,Nu,!0),document.addEventListener(`close`,Nu,!0)),ku(Au),Au),Jse=()=>{--ju,ju>0||!Au||(document.removeEventListener(`toggle`,Mu,!0),document.removeEventListener(`beforetoggle`,Nu,!0),document.removeEventListener(`close`,Nu,!0),Au.remove(),Au=void 0,Du.length=0)},Yse=new Set([`$$slots`,`$$events`,`$$legacy`,`show`,`id`,`duration`,`position`,`children`]),Xse=V(`<div><!></div>`),Zse={hash:`svelte-1eyhuzs`,code:`.sui.toast-base {position:fixed;inset:16px;z-index:99999;overflow:visible;margin:0;border:0;padding:0;width:auto;height:auto;background-color:transparent;font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);text-align:center;pointer-events:none;-webkit-user-select:none;user-select:none;}body:has(.sui.bottom-navigation:not([inert]:not([hidden]))) .toast-base {bottom:calc(var(--sui-bottom-navigation-height) + 16px);}.sui.toast-base > .toast-lane {position:absolute;display:flex;flex-direction:column;margin-block:-4px;max-width:100%;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.top-right {inset-block-start:0;}.sui.toast-base > .toast-lane.bottom-left, .sui.toast-base > .toast-lane.bottom-center, .sui.toast-base > .toast-lane.bottom-right {inset-block-end:0;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.bottom-left {inset-inline-start:0;align-items:flex-start;}.sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.bottom-center {inset-inline:0;align-items:center;}.sui.toast-base > .toast-lane.top-right, .sui.toast-base > .toast-lane.bottom-right {inset-inline-end:0;align-items:flex-end;}.toast.svelte-1eyhuzs {margin-block:4px;width:max-content;max-width:80dvw;height:auto;overflow:clip;opacity:1;transition-duration:250ms;will-change:opacity;}
|
||
@starting-style {.toast.svelte-1eyhuzs {opacity:0;}
|
||
}.toast.svelte-1eyhuzs {pointer-events:auto;}.toast[aria-hidden=true].svelte-1eyhuzs {display:block;opacity:0;pointer-events:none;}
|
||
@supports (interpolate-size: allow-keywords) {.toast.svelte-1eyhuzs {interpolate-size:allow-keywords;}
|
||
@starting-style {.toast.svelte-1eyhuzs {margin-block:0;height:0;}
|
||
}.toast[aria-hidden=true].svelte-1eyhuzs {margin-block:0;height:0;}
|
||
}.toast.svelte-1eyhuzs:has(.alert) {filter:drop-shadow(0 8px 8px var(--sui-popup-shadow-color));}`};function Pu(e,t){k(t,!0),q(e,Zse);let n=Y(t,`show`,15,!1),r=Y(t,`id`,3,void 0),i=Y(t,`duration`,3,5e3),a=Y(t,`position`,7,`auto`),o=gs(t,Yse),s=M(void 0),c=M(void 0),l=M(!1),u=M(!1),d=j(()=>B(l)||B(u)),f=M(!1);vs(()=>(N(s,qse(),!0),()=>{B(c)?.remove(),Jse()})),vs(()=>{if(a()!==`auto`)return;let e=globalThis.matchMedia(`(width < 1024px)`),t=()=>{a(e.matches?`bottom-center`:`bottom-right`)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}),R(()=>{if(!B(s)||!B(c))return;if(!B(f)){B(c).remove(),N(l,!1),N(u,!1),!B(s).querySelector(`.toast`)&&B(s).matches(`:popover-open`)&&B(s).hidePopover();return}ku(B(s));let e=Kse(B(s),a());a().startsWith(`top-`)?e.prepend(B(c)):e.append(B(c)),Ou(B(s))}),R(()=>{if(n()){N(f,!0);return}let e=globalThis.setTimeout(()=>{N(f,!1)},250);return()=>{globalThis.clearTimeout(e)}}),R(()=>{if(r(),n(),i(),B(d),!n()||!i()||B(d))return;let e=globalThis.setTimeout(()=>{n(!1)},i());return()=>{globalThis.clearTimeout(e)}});var p=Xse(),m=()=>{N(l,!0)},h=()=>{N(l,!1)},g=()=>{N(u,!0)},_=e=>{N(u,!!e.relatedTarget&&!!B(c)?.contains(e.relatedTarget),!0)};us(p,()=>({...o,class:[`sui`,`toast`,a()],"aria-hidden":!n(),onpointerenter:m,onpointerleave:h,onfocusin:g,onfocusout:_}),void 0,void 0,void 0,`svelte-1eyhuzs`);var v=P(p),y=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(v,e=>{B(f)&&e(y)}),O(p),ms(p,e=>N(c,e),()=>B(c)),W(e,p),A()}var Fu="```",Qse=(e,t)=>t?`${Fu}${e}\n${t}\n${Fu}`:`${Fu}${e}\n${Fu}`,$se=e=>{let{lang:t=`plain`,code:n=``}=e.match(/^```(?<lang>[^\s`]+)?\n(?:(?<code>.*)\n)?```/s)?.groups??{};return{lang:t,code:n}};function Iu(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Lu(e,...t){throw Iu(e,...t)}function Ru(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ece(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var zu=ece();function tce(){return zu&&`documentMode`in document?document.documentMode:null}var nce=tce();function rce(e){return zu&&e.test(navigator.platform)}function Bu(e){return zu&&e.test(navigator.userAgent)}var Vu=rce(/Mac|iPod|iPhone|iPad/),Hu=Bu(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function ice(){return!(!zu||!(`InputEvent`in window)||nce)&&`getTargetRanges`in new window.InputEvent(`input`)}var Uu=ice();function ace(){return zu&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var Wu=ace(),Gu=Bu(/Android/),Ku=Bu(/Version\/[\d.]+.*Safari/)&&!Gu,qu=Bu(/^(?=.*Chrome).*/i),Ju=zu&&Gu&&qu,Yu=Bu(/AppleWebKit\/[\d.]+/)&&Vu&&!qu;function oce(){return 2047}var sce=oce(),Xu=Ku||Wu||Yu?`\xA0`:``,Zu=`
|
||
|
||
`,Qu=Hu?`\xA0`:Xu,cce=`֑-߿יִ-﷽ﹰ-ﻼ`,lce=`A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--`;function uce(e,t){return RegExp(`^[^`+e+`]*[`+t+`]`)}var dce=uce(lce,cce),fce=uce(cce,lce),$u={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},pce={directionless:1,unmergeable:2},ed={center:2,end:6,justify:4,left:1,right:3,start:5};function mce(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var hce=mce(ed),td={normal:0,segmented:2,token:1},gce=mce(td),_ce=Symbol.for(`@lexical/ctrlOrOtherKey`),nd=`$config`;function vce(e){return()=>{}}function rd(e){return{type:e}}var id=rd(`SELECTION_CHANGE_COMMAND`),ad=rd(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),od=rd(`CLICK_COMMAND`),sd=rd(`BEFORE_INPUT_COMMAND`),cd=rd(`INPUT_COMMAND`),ld=rd(`COMPOSITION_START_COMMAND`),ud=rd(`COMPOSITION_END_COMMAND`),dd=rd(`DELETE_CHARACTER_COMMAND`),fd=rd(`INSERT_LINE_BREAK_COMMAND`),pd=rd(`INSERT_PARAGRAPH_COMMAND`),md=rd(`CONTROLLED_TEXT_INSERTION_COMMAND`),hd=rd(`PASTE_COMMAND`),gd=rd(`REMOVE_TEXT_COMMAND`),_d=rd(`DELETE_WORD_COMMAND`),vd=rd(`DELETE_LINE_COMMAND`),yd=rd(`FORMAT_TEXT_COMMAND`),yce=rd(`SET_TEXT_FORMAT_COMMAND`),bd=rd(`UNDO_COMMAND`),xd=rd(`REDO_COMMAND`),Sd=rd(`KEYDOWN_COMMAND`),Cd=rd(`KEY_ARROW_RIGHT_COMMAND`),wd=rd(`MOVE_TO_END`),Td=rd(`KEY_ARROW_LEFT_COMMAND`),Ed=rd(`MOVE_TO_START`),Dd=rd(`KEY_ARROW_UP_COMMAND`),Od=rd(`KEY_ARROW_DOWN_COMMAND`),kd=rd(`KEY_ENTER_COMMAND`),Ad=rd(`KEY_SPACE_COMMAND`),jd=rd(`KEY_BACKSPACE_COMMAND`),Md=rd(`KEY_ESCAPE_COMMAND`),Nd=rd(`KEY_DELETE_COMMAND`),Pd=rd(`KEY_TAB_COMMAND`),Fd=rd(`INSERT_TAB_COMMAND`),Id=rd(`INDENT_CONTENT_COMMAND`),Ld=rd(`OUTDENT_CONTENT_COMMAND`),Rd=rd(`DROP_COMMAND`),zd=rd(`FORMAT_ELEMENT_COMMAND`),Bd=rd(`DRAGSTART_COMMAND`),Vd=rd(`DRAGOVER_COMMAND`),bce=rd(`DRAGEND_COMMAND`),Hd=rd(`COPY_COMMAND`),Ud=rd(`CUT_COMMAND`),Wd=rd(`SELECT_ALL_COMMAND`),xce=rd(`CLEAR_EDITOR_COMMAND`),Sce=rd(`CLEAR_HISTORY_COMMAND`),Gd=rd(`CAN_REDO_COMMAND`),Kd=rd(`CAN_UNDO_COMMAND`),qd=rd(`FOCUS_COMMAND`),Cce=rd(`BLUR_COMMAND`),wce=rd(`KEY_MODIFIER_COMMAND`);function Jd(e,t){return{...t,[_ce]:e}}var Yd=Jd(`metaKey`,{ctrlKey:!Vu,metaKey:Vu}),Xd=Jd(`altKey`,{altKey:Vu,ctrlKey:!Vu}),Zd=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function Qd(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var Tce=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||Lu(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of Zd){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))Qd(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?Qd(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&Qd(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of Zd)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function Ece(e){let t=new Tce;for(let n of e)t.add(n);return t}function Dce(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function Oce(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var $d=Oce(),ef=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},tf=null;function nf(e,t=1e3){return e instanceof rf?e.clone():e.size<t?new Map(e):new rf().init(new Map(e),void 0,e.size)}var rf=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===tf?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===tf?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==tf&&n!==void 0||(this._size++,n===tf&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,tf),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==tf&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===tf||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},af=!1;function kce(e,t,...n){let r=af,i;try{af=e,i=t()}finally{af=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||Lu(421),i}function Ace(){return af}function of(e){let t=e.exportJSON(af),n=e.constructor;return t.type!==n.getType()&&Lu(130,n.name),Z(e)&&!Array.isArray(t.children)&&Lu(59,n.name),t}function sf(){return Lg()._blockCursorElement}function cf(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var jce=Yu||Wu||Ku;function lf(){let e=Cg().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function uf(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var df=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&Lu(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&Lu(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&Lu(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=ff(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=ff(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function ff(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var pf=class e extends df{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;cf(t);)e=t,t=t.nextSibling;uf(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===sf()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;cf(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===sf()&&(t=t.previousSibling);return uf(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(lf(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(lf(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&cf(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&jce;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=Cg().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=Cg().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=sf(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=mf(t,n);i.push(r);let a=mf(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function mf(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&Lu(225),n.reverse()}var hf=!1,gf=0;function Mce(){gf=performance.now()}function _f(e){return jg(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function Nce(e,t,n){let r=vg(sg(n)),i=r&&Eg(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&Vh(t,s,a,o,!1)}function Pce(e,t,n){if(Q(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return hh(t)&&n.isAttached()}function Fce(e,t,n){for(let r=e;r&&!Jg(r);r=$h(r)){let e=Dh(r,t);if(e!==void 0){let t=wh(e,n);if(t)return Sm(t)||!jg(r)?void 0:[r,t]}}}function vf(e,t,n,r){hf=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-gf>100;try{fv(e,()=>{let a=$()||function(e){return e.read(`latest`,()=>{let e=$();return e===null?null:e.clone()})}(e),o=new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=Fce(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?Fm(m)&&m.isAttached()&&m.markDirty():i&&Fm(m)&&hh(d)&&Pce(a,d,m)&&Nce(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=Dh(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&jg(t)&&t.hasAttribute(`data-lexical-slot`)||Jg(t)))){if(Hu){let e=(jg(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||uf(e)||_f(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||Dh(n,e)||_f(n)||n.remove();n.takeRecords(),a!==null&&(l&&Nh(a),Hu&&Xh(e)&&a.insertRawText(u))})}finally{hf=!1}}function yf(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&vf(e,i,r,t)}}function bf(e){(function(e){sg(e).addEventListener(`textInput`,Mce,!0)})(e),e._observer=new MutationObserver((t,n)=>{vf(e,t,n)})}function xf(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Sf(e,t){return xf(e,t,e.defaultValue)}function Cf(e){return typeof e==`object`&&!!e}function wf(e,t){let n=kf(e,t).getter;return Cf(n)&&n.getterTable!==void 0||Lu(405,t),Of(n.getterTable)}function Tf(e,t){let n=kf(e,t).setter;return Cf(n)&&n.setterTable!==void 0||Lu(406,t),Of(n.setterTable)}function Ef(e,t,n){let{meta:r}=kf(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return Of(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:Lu(407,t,String(n))}function Df(e,t){let n=kf(e,t),{setter:r}=n;Cf(r)&&r.setterTable!==void 0||Lu(408,t);let i=String(n.defaultValue);return If(r.setterTable,i)||Lu(409,t,i),r.setterTable[i]}function Of(e){return Object.assign(Object.create(null),e)}function kf(e,t){let n=e.get(t);return n===void 0&&Lu(410,t),n}function Af(e,t,n,r,i){i!==void 0&&Ice.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&Mf(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var Ice=new WeakSet,jf=new WeakSet;function Lce(e){return typeof e==`object`&&e&&jf.add(e),e}function Mf(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!jf.has(e)){Object.freeze(e);for(let t of Object.values(e))Mf(t)}}function Nf(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function Pf(e,t){return n=>t(n)||Ff(e,n)}function Ff(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return Ff(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Sf(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function If(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lf(e=``){return Af(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var Rce=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Rf(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&Rce.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return Af(t=>{let n=o(t);return r&&s(n)?i!==void 0&&n<i?i:a!==void 0&&n>a?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function zf(e=!1){return Af(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function Bf(e,...t){let n=Lce(t.length===0?e[0]:t[0]),r=new Set(e);return Af(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function Vf(e,t={}){let{defaultAsNull:n}=t;return Af(t=>{if(t==null)return null;let r=e(t);return n&&Sf(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,Nf(e),Pf(e,e=>e==null))}function Hf(e,t={}){let{omitDefault:n}=t;return Af(t=>{if(t===void 0)return;let r=e(t);return n&&Sf(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,Nf(e),Pf(e,e=>e===void 0))}function Uf(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function Wf(e,t){let n=e=>typeof e==`string`&&If(t,e);return Af(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||Ff(e,t))}function zce(e){return Af(t=>{if(!Array.isArray(t))return[];let n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e(t[r]);return n},{item:e,kind:`array`},void 0,(t,n)=>{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!xf(e,t[r],n[r]))return!1;return!0},e=>Array.isArray(e))}function Gf(e,t){return qf(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function Kf(e,t){return qf(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function qf(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var Jf=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Hce).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>xf(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Yf(e,t){return new Jf(e,t)}function Xf(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function Zf(e,t,n){let r;if(q_(),typeof n==`function`){let i=e.getLatest(),a=Xf(i,t);if(r=Qf(t,n(a)),t.isEqual(a,r))return i}else r=Qf(t,n);let i=e.getWritable();return ep(i).updateFromKnown(t,r),i}function Qf(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function Bce(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of m_(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var $f=new Set([`__proto__`,`constructor`,`prototype`]),Vce=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return np(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if($f.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=np(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if($f.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function ep(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Vce(t,function(e){return e.__state?e.__state.sharedNodeState:Mle(Lg(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function tp(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&ep(e).updateFromJSON(r),n}function np(e){if(e)for(let t in e)return e}function Hce(e){return e}function rp(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ip(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function ap(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function op(e){return!Tm(e)&&e.getTextContent!==bm.prototype.getTextContent}var sp=Symbol.for(`@lexical/CachedTextSize`);function cp(e,t){return wp.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=Cp.get(r);if(i===void 0&&Lu(345,r),Z(i)){let a=Tp.get(r);if(a!==void 0&&Z(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=Ep.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&Lu(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else if(Vp(i).size>0)n+=i.getTextContentSize();else{let e=i[sp];e===void 0&&Lu(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:dp})}function lp(e){Z(e)||Vp(e).size>0||e[sp]===void 0&&(e[sp]=Fm(e)?e.__text.length:e.getTextContentSize())}var Uce=4,up,dp,fp,pp=``,mp=null,hp=null,gp=null;function _p(){return{firstTextKey:gp,format:mp,style:hp}}function vp(e){e.firstTextKey!==null&&(mp=e.format,hp=e.style,gp=e.firstTextKey)}function yp(e){if(gp!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&Lu(348),t===null)return;let n=Tp.get(t);Fm(n)&&(mp=n.getFormat(),hp=n.getStyle(),gp=t)}var bp,xp,Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap=!1,jp=!1;function Mp(e,t){let n=Cp.get(e),r=Tp.has(e);if(t!==null){let n=tm(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(dp._keyToDOMMap.delete(e),Z(n)){let e=__(n,Cp);Np(e,0,e.length-1,null)}if(n!==void 0){for(let e of Vp(n).values()){let t=Up(e);Mp(e,null),t!==null&&t.remove()}qh(Op,fp,bp,n,`destroyed`)}}}function Np(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Mp(t,r)}}function Pp(e,t){e.setProperty(`text-align`,t)}var Wce=`40px`;function Fp(e,t){let n=up.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${Wce}))`),Gh(e,`class`),Gh(e,`style`)}function Ip(e,t){let n=e.style;t===0?Pp(n,``):t===1?Pp(n,`left`):t===2?Pp(n,`center`):t===3?Pp(n,`right`):t===4?Pp(n,`justify`):t===5?Pp(n,`start`):t===6&&Pp(n,`end`),Gh(e,`style`)}function Lp(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(Tm(e))return null;let n=e.getParent();return n===null||dg(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Rp(e){let t=Cg().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function zp(e,t,n){t||e.contentEditable===`false`?Qle(n,dp):n.removeAttribute(`contenteditable`)}function Bp(e,t,n){let r=pp,i=_p();pp=``;let a=``,o=Sm(e);for(let[r,i]of n){let n=Rp(r);zp(t,o,n),t.appendChild(n),pp=``;let s=_p();Gp(i,zg(e,n,dp)),vp(s),Hp(e,r,t,n),a+=pp}return vp(i),pp=r,a}function Vp(e){return Zy(e)&&e.__slots!==null?e.__slots:Xy}function Hp(e,t,n,r){let i=kp.$getSlotTargetElement(e,t,n,dp);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function Up(e){let t=Ep.get(e);return t===void 0?null:t.parentElement}function Wp(e,t,n){let r=Vp(e),i=Vp(t);for(let[e,t]of r)if(!i.has(e)){let e=Up(t);Mp(t,null),e!==null&&e.remove()}let a=pp,o=_p(),s=``,c=null,l=Sm(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:Up(i);pp=``;let u=_p();if(o===null){o=Rp(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),Gp(a,zg(t,o,dp))}else i===a?Zp(a,o):(i!==void 0&&Mp(i,o),Gp(a,zg(t,o,dp)));if(vp(u),zp(n,l,o),Hp(t,e,n,o),s+=pp,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return vp(o),pp=a,s}function Gp(e,t){let n=Tp.get(e);if(n===void 0&&Lu(60),t!==null){let r=Cp.get(e);if(r!==void 0){let i=Ep.get(e);if(i!==void 0){let a=Qy(r)?r.__slotHost:null,o=Qy(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),Zp(e,t.element)}}}let r=kp.$createDOM(n,dp);if(function(e,t,n){let r=n._keyToDOMMap;Eh(t,n,e),r.set(e,t)}(e,r,dp),Fm(n)?r.setAttribute(`data-lexical-text`,`true`):Sm(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),qg(r,{captureSelection:!0})),Z(n)){let e=pp,t=n.__indent,i=n.__size;Lp(r,n),t!==0&&Fp(r,t);let a=Vp(n),o=a.size>0?Bp(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,pp+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if(Kp(__(n,Tp),n,0,t,zg(n,r,dp)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,pp=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(op(n)){let t=n.getTextContent();r.__lexicalTextContent=t,pp=e+t}let s=n.__format;s!==0&&Ip(r,s),n.isInline()||(Yp(0,n,r),Jp(n,r))}else{let t=n.getTextContent();if(Sm(n)){let t=n.decorate(dp,up);t!==null&&Qp(e,t),r.contentEditable=`false`;let i=Vp(n);i.size>0&&Bp(n,r,i)}pp+=t}return t!==null&&t.insertChild(r),kp.$decorateDOM(n,null,r,dp),lp(n),qh(Op,fp,bp,n,`created`),r}function Kp(e,t,n,r,i){let a=pp,o=_p();pp=``,mp=null,hp=null,gp=null;let s=n;for(;s<=r;++s){let t=_p();Gp(e[s],i);let n=Tp.get(e[s]);n!==null&&Fm(n)?mp===null&&(mp=n.getFormat(),hp=n.getStyle(),gp=n.__key):Z(n)&&s<r&&!n.isInline()&&(pp+=Zu),vp(t)}let c=dp._keyToDOMMap.get(t.__key);c===void 0&&Lu(349,t.__key),c.__lexicalTextContent=pp,c.__lexicalFirstTextKey=gp,pp=a+pp,vp(o)}function qp(e){return Sm(e)&&!e.isInline()}function Jp(e,t,n=zg(e,t,dp)){n.setDecoratorBoundaryAnchor(`leading`,qp(e.getFirstChild())),n.setDecoratorBoundaryAnchor(`trailing`,qp(e.getLastChild()))}function Yp(e,t,n){let r=zg(t,n,dp),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return E_(e)?`line-break`:Sm(e)&&e.isInline()?`decorator`:null}return`empty`}return null}(t,Tp);r.setManagedLineBreak(i)}function Xp(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=Tp.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=Tp.get(r);if(Fm(e))return mp=e.getFormat(),void(hp=e.getStyle())}}t.__lexicalFirstTextKey=gp}function Zp(e,t){let n=Cp.get(e),r=Tp.get(e);n!==void 0&&r!==void 0||Lu(61);let i=Ap||Sp.has(e)||xp.has(e),a=Qh(dp,e);if(n===r&&!i){let e;if(Z(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&Lu(355,n.getType()),e=t,yp(a)}else e=n.getTextContent();return pp+=e,a}if(n!==r&&i&&qh(Op,fp,bp,r,`updated`),kp.$updateDOM(r,n,a,dp)){let n=Gp(e,null);return t===null&&Lu(62),t.replaceChild(n,a),Mp(e,null),n}if(Z(n)){Z(r)||Lu(334,e);let t=r.__indent;(Ap||t!==n.__indent)&&Fp(a,t);let o=r.__format;(Ap||o!==n.__format)&&Ip(a,o);let s=i&&(Vp(r).size>0||Vp(n).size>0)?Wp(n,r,a):``;if(i){let e=pp;if(function(e,t,n){var r;mp=null,hp=null,gp=null,function(e,t,n){let r=pp,i=e.__size,a=t.__size;pp=``;let o=n.element,s=dp._keyToDOMMap.get(t.__key);s===void 0&&Lu(351,t.__key);let c=a-i;if(!Ap&&Math.abs(c)<=1&&i>=Uce&&e.__first===t.__first&&(c!==0||!dp._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=Dp.get(e.__key);if(!Ap&&!op(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=Tp.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=cp(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=Tp.get(n);if(e===void 0)break;let t=_p();Zp(n,o),Fm(e)&&mp===null&&(mp=e.getFormat(),hp=e.getStyle(),gp=e.__key),vp(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=Tp.get(n);if(e===void 0)break;let t;if(Z(e)){let r=dp._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&Lu(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&Z(e)&&!e.isInline()&&(d+=Zu),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,pp=r+m,Xp(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=Cp.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=Tp.get(a),d=Cp.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=Tp.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=Cp.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=cp(l,c);for(let e of _){let t=_p();if(e.kind===`reconcile`)Zp(e.key,n.element);else if(e.kind===`destroy`)Mp(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=dp._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}Gp(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=Tp.get(e.key);t&&Fm(t)&&mp===null&&(mp=t.getFormat(),hp=t.getStyle(),gp=t.__key)}vp(t)}let x=``;for(let e=0;e<o;e++){let t=Tp.get(f[e]);if(t===void 0)return!1;let n;if(Z(t)){let r=dp._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&Lu(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&Z(t)&&!t.isInline()&&(x+=Zu)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&Lu(353),pp=r+e,Xp(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=Tp.get(t);if(e===void 0)break;let r=Ap||Sp.has(t)||xp.has(t),i=_p();if(r)Zp(t,o);else{let n,r;if(Z(e)){r=Ep.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&Lu(354,e.getType()),n=i}else n=e.getTextContent();pp+=n,r!==void 0&&yp(r)}Fm(e)?mp===null&&(mp=e.getFormat(),hp=e.getStyle(),gp=e.__key):Z(e)&&n<a-1&&!e.isInline()&&(pp+=Zu),vp(i),t=e.__next,n++}s.__lexicalTextContent=pp,s.__lexicalFirstTextKey=gp,pp=r+pp;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)Zp(r,o);else{let e=tm(r),t=Gp(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}Mp(r,null)}let a=Tp.get(i);Fm(a)&&mp===null&&(mp=a.getFormat(),hp=a.getStyle(),gp=a.__key)}else{let r=__(e,Cp),s=__(t,Tp);if(r.length!==i&&Lu(227),s.length!==a&&Lu(228),i===0)a!==0&&Kp(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&Vp(t).size===0&&n.element.__lexicalLineBreak==null;Np(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=_p();if(e===r)u=$p(Zp(r,a.element)),d++,f++;else{if(l===void 0&&(l=em(n,f)),c===void 0)c=em(t,d);else if(!c.has(e)){d++,vp(i);continue}if(!l.has(e)){let t=tm(e);t.parentNode===a.element&&(u=$p(t)),Mp(e,a.element),d++,c.delete(e),vp(i);continue}if(c.has(r)){let e=Qh(dp,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=$p(Zp(r,a.element)),d++,f++}else Gp(r,a.withBefore(u??a.before)),f++}let o=Tp.get(r);o!==null&&Fm(o)?mp===null&&(mp=o.getFormat(),hp=o.getStyle(),gp=o.__key):Z(o)&&f<=s&&!o.isInline()&&(pp+=Zu),vp(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:dp.getElementByKey(t);Kp(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&Np(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=pp,s.__lexicalFirstTextKey=gp,pp=r+pp}(e,t,zg(t,n,dp)),dg(t)||(r=t,mp==null||mp===r.__textFormat||jp||r.setTextFormat(mp),function(e){hp==null||hp===e.__textStyle||jp||e.setTextStyle(hp)}(t))}(n,r,a),r.isInline()||(Tm(r)||Yp(0,r,a),Jp(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,pp=e+s+t,a.__lexicalSlotTextLength=s.length}else(Vp(r).size>0||Vp(n).size>0)&&(a.__lexicalSlotTextLength=0);if(op(r)){let t=r.getTextContent();a.__lexicalTextContent=t,pp=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&Lu(356,n.getType()),pp+=e,yp(a)}if((Ap||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Lp(a,r),Tm(r)&&!Ap))for(let e of r.getChildren())Z(e)&&Lp(Qh(dp,e.getKey()),e)}else{let t=r.getTextContent();if(Sm(r)){let t=r.decorate(dp,up);t!==null&&Qp(e,t),i&&(Vp(r).size>0||Vp(n).size>0)&&Wp(n,r,a)}pp+=t}if(!jp&&Tm(r)){let e=r.getLatest();if(e.__cachedText!==pp){let t=e.getWritable();t.__cachedText=pp,r=t}}return kp.$decorateDOM(r,n,a,dp),lp(r),a}function Qp(e,t){let n=dp._pendingDecorators,r=dp._decorators;if(n===null){if(r[e]===t)return;n=kh(dp)}n[e]=t}function $p(e){let t=e.nextSibling;return t!==null&&t===dp._blockCursorElement&&(t=t.nextSibling),t}function em(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function Gce(e,t,n,r,i,a){pp=``,mp=null,hp=null,gp=null,Ap=r===2,dp=n,up=n._config,kp=n._config.dom||j_,fp=n._nodes,bp=dp._listeners.mutation,xp=i,Sp=a,Cp=e._nodeMap,wp=e,Tp=t._nodeMap,jp=t._readOnly,Ep=nf(n._keyToDOMMap),Dp=function(){let e=new Map,t=t=>{for(let n of t){let t=Tp.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(xp.keys()),t(Sp),e}();let o=new Map;return Op=o,Zp(`root`,null),dp=void 0,fp=void 0,xp=void 0,Sp=void 0,Cp=void 0,wp=void 0,Tp=void 0,up=void 0,Ep=void 0,Dp=void 0,Op=void 0,kp=j_,o}function tm(e){let t=Ep.get(e);return t===void 0&&Lu(75,e),t}function nm(e,t,n){q_();let r=e.__key,i=e.getParent();if(i===null)return void($y(e)!==null&&Lu(367,r,String($y(e))));let a=function(e){let t=$();if(!Q(t)||!Z(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return ag(i,e)&&n.set(e.__key,0,`element`),ag(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(Q(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Ay(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Ay(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else ty(a)&&t&&e.isSelected()&&e.selectPrevious();Ky(e.getWritable(),t&&!o&&Q(a)?a:null),n||dg(i)||i.canBeEmpty()||!i.isEmpty()||nm(i,t),t&&a&&Tm(i)&&i.isEmpty()&&i.selectEnd()}function rm(e){return e}var im=Symbol.for(`ephemeral`);function am(e){return e[im]||!1}var om={configurable:!0,enumerable:!1,value:void 0,writable:!0},sm=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=u_(this);return e===void 0&&Lu(64,this.name),e}static clone(e){Lu(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||v_(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",om),Object.defineProperty(this,sp,om),yh(this,e)}getType(){return this.__type}isInline(){Lu(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=wh(e);if(t===null)break;e=t.__parent===null?$y(t):t.__parent}return!1}isSelected(e){let t=e||$();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(Fm(this))return n;if(Q(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Sm(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:wh(e)}getParentOrThrow(){let e=this.getParent();return e===null&&Lu(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(dg(t)||$y(e)!==null)return Z(e)||e===this&&Sm(e)||Lu(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&Lu(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:wh(e)}getPreviousSiblings(){return Yy(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:wh(e)}getNextSiblings(){return Yy(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=kb(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?fde(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&Lu(279),!1)))}isParentOf(e){return ag(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&Z(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=X_()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(am(this))return this;let e=wh(this.__key);return e===null&&Lu(442,this.__key,this.__type),e}getWritable(){if(am(this))return this;q_();let e=Y_(),t=X_(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return bh(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&Lu(442,n,this.__type);let c=Ug(s);return r.set(n,c),o.set(n,c),bh(c),c}getTextContent(){return Xue(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Lu(70)}updateDOM(e,t,n){Lu(71)}getDOMSlot(e){return new df(e)}exportDOM(e){return{element:Rg(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=$g(Qg(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return Z(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i];if(r&&a.derived)continue;let o;if(a.kind===`ownField`){let t=s_(e)[a.field];o=a.getterTable===void 0?t:If(a.getterTable,t)?a.getterTable[t]:void 0}else o=a.getter.call(e);a.kind===`ownField`&&a.when!==void 0&&(!c_(a,o)&&a.when.call(e)||(o=void 0)),r&&c_(a,o)||(n[a.key]=o)}}(e,t,r,n),n||(r.type=e.__type,r.version=1),r}(e,n.getters,t):t?a(e,i):a(e)}(this,e),n=this.__state?this.__state.toJSON():void 0;return n!==void 0&&Object.assign(t,n),t}static importJSON(e){Lu(18,this.name)}updateFromJSON(e){return l_(tp(this,e),e)}static transform(){return null}remove(e){nm(this,!0,e)}replace(e,t){q_();let n=$();n!==null&&(n=n.clone()),mg(this,e);let r=this.getLatest(),i=this.__key,a=eb(r);a!==null&&Lu(400,i,r.getType(),a.getKey(),a.getType());let o=e.__key,s=e.getWritable(),c=this.getParentOrThrow().getWritable(),l=c.__size,u=s.getParent();Ky(s,Q(n)?n:null);let d=r.getPreviousSibling(),f=r.getNextSibling();nm(r,!1,!0),Wy(c,s,d&&d.getWritable(),f&&f.getWritable()),c.__size=u!==null&&u.is(c)?l-1:l;let p=0;if(t&&(Z(this)&&Z(s)||Lu(139),p=s.getChildrenSize(),s.splice(p,0,this.getChildren())),Q(n)){Nh(n);for(let e of[n.anchor,n.focus])e.key===i&&(t&&e.type===`element`?e.set(s.__key,p+e.offset,`element`):Lue(e,s))}return Sh()===i&&xh(o),s}insertAfter(e,t=!0){return qy(this,`next`,e,t)}insertBefore(e,t=!0){return qy(this,`previous`,e,t)}isParentRequired(){return!1}createParentElementNode(){return Qm()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){return Jy(_b(this,`previous`),e,t)}selectNext(e,t){return Jy(_b(this,`next`),e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function cm(e){return e instanceof sm}function lm(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&rp(n,e,t)||t&&rp(n,t,e)||e&&ip(n,e,t)||t&&ip(n,t,e))}(c,l))}function um(e,t){let n=e.mergeWithSibling(t),r=X_()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function dm(e){let t,n,r=e;if(!Ch(r)){if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&Fm(t)&&t.isSimpleText()&&!t.isUnmergeable()&&!Ch(t);){if(t.__text!==``){if(lm(t,r)){r=um(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&Fm(n)&&n.isSimpleText()&&!n.isUnmergeable()&&!Ch(n);){if(n.__text!==``){if(lm(r,n)){r=um(r,n);break}break}n.remove()}}else r.remove()}}function fm(e){return pm(e.anchor),pm(e.focus),e}function pm(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),Fm(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!Z(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var Kce=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function mm(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Kce.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function hm(e,t,n,r,i){let a=mm(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}var qce=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=hm(t.indent,0,0,1/0),e.__textFormat=mm(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function Jce(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var Yce=e=>{let t=wf(e,`mode`),n=Ef(e,`detail`,0),r=Ef(e,`format`,0),i=Tf(e,`mode`),a=Df(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:mm(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:mm(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:Jce}},Xce=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=hm(t.indent,0,0,1/0),e.__textFormat=mm(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Zce=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),Qce=e=>{let t=wf(e,`mode`),n=Ef(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:mm(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}},gm=new WeakMap;function _m(e,t){for(let n=e;n!==null&&n!==t;n=Object.getPrototypeOf(n)){let t=n.prototype;if(t!==void 0&&Object.prototype.hasOwnProperty.call(t,`isInline`)&&typeof t.isInline==`function`&&!oue(t.isInline))try{let t=e.prototype.isInline.call(Object.create(e.prototype));return typeof t==`boolean`?t:null}catch{return null}}}function $ce(e){for(let{ownNodeConfig:t}of m_(e))if(t&&t.children!==void 0)return t.children}function ele(e){let t=gm.get(e);if(t===void 0){let n={},r={},i=!1;for(let{klass:t,ownNodeConfig:a}of m_(e))a&&(r.inline===void 0&&a.inline!==void 0&&(n.inline=a.inline,r.inline=t),r.children===void 0&&a.children!==void 0&&(n.children=a.children,r.children=t),i||a.mergeAdjacent===void 0||(i=!0,!1!==a.mergeAdjacent&&(n.mergeAdjacent=a.mergeAdjacent,r.mergeAdjacent=t)));let a=function(e){let t=new Set,n=o_(e);for(let e of Object.keys(n))!0===n[e].derived&&t.add(e);for(let{ownNodeConfig:n}of m_(e)){let e=n&&n.stateConfigs;if(e)for(let n of e){let e=n instanceof Jf?n:n.stateConfig;e.derived&&t.add(e.key)}}return t}(e);r.inline!==void 0&&r.inline!==e&&_m(e,r.inline)!==void 0&&_m(e,r.inline)!==n.inline&&(delete n.inline,delete r.inline),r.mergeAdjacent===void 0||r.mergeAdjacent===e||function(e,t,n){let r=o_(e);for(let e of t.by)if(typeof e==`string`){if(!(e in r))return{entry:e,reason:`unknown`};if(n.has(e))return{entry:e,reason:`derived`}}else if(e.derived)return{entry:String(e.key),reason:`derived-state`};return null}(e,n.mergeAdjacent,a)===null&&function(e,t){if(!Array.isArray(t)||t.includes(`inline`))return null;for(let n of t){if(n===`inline`)continue;let t=$ce(n);if(!(t===`inline`||Array.isArray(t)&&t.includes(`inline`)&&t.every(t=>t===`inline`||t===e||e.prototype instanceof t)))return n}return null}(e,n.children)===null||(delete n.mergeAdjacent,delete r.mergeAdjacent),t=Object.freeze({...n,declaredBy:Object.freeze(r),derived:a,derivedNames:a}),gm.set(e,t)}return t}function tle(e){let{derivedNames:t,...n}=ele(e);return Object.freeze({...n,derived:new Set(t)})}var vm;function ym(e){return vm!==void 0&&vm.has(e)}function nle(){return{...hce,0:``}}function rle(){return{...ed,"":0}}var ile=nle(),ale=rle(),ole=Uf()({direction:Gf(Bf([null,`ltr`,`rtl`]),{field:`__dir`}),format:Gf(Bf([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:ile,setter:`setFormat`,setterTable:ale}),indent:Gf(Rf(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:Kf(Rf(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:Kf(Lf(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function sle(e){if(dg(e)&&!ym(X_())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var bm=class extends sm{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:sle,extends:sm,generated:qce,json:ole})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Lu(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return hce[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return Yy(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&ib(this).length===0}isDirty(){let e=X_()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of ib(this)){let n=ab(this,t);if(Z(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(Fm(t)&&e.push(t),Z(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Z(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Z(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return Z(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:wh(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&Lu(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:wh(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&Lu(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Xue(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),Z(i)&&r!==n-1&&!i.isInline()&&(e+=Zu)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of rb(e).values()){let e=wh(n);e!==null&&(t+=e.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),Z(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=ed[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=$u[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return vh(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){q_();let n=$(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(Fm(e)||Z(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(Fm(e)||Z(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return Q(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):xy(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&ed[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){am(this)&&Lu(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||Lu(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e<n;e++){a===null&&Lu(100);let e=a.getNextSibling();i.push(a.getWritable()),a=e}return Hy(e,r&&r.getWritable(),a&&a.getWritable()),e.__size-=i.length,i.map(e=>(Uy(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,Gy(t);let n=e.__key;Wy(i,t,d,c&&c.getWritable()),e.__key===a&&Lu(76),o.push(n),d=t}if(i.__size=u,s.length){let e=$();if(Q(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])cle(r,t,n)&&Ay(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||dg(this)||this.remove()}}return i}getDOMSlot(e){return new pf(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(jg(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(dg(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(Fm(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=zg(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=Dh(s,t))&&Jg(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}Jp(this,e,n)})}};function Z(e){return e instanceof bm}function cle(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var xm=class extends sm{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Lu(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Sm(e){return e instanceof xm}function Cm(e){let t=e.getLatest().__cachedText;return t===null||!K_()&&X_()._dirtyType!==0?null:t}var wm=class extends bm{__cachedText;$config(){return this.config(`root`,{extends:bm})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){Lu(51)}getTextContent(){let e=Cm(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=Cm(this);return e===null?super.getTextContentSize():e.length}remove(){Lu(52)}replace(e){Lu(53)}insertBefore(e){Lu(54)}insertAfter(e){Lu(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)Z(e)||Sm(e)||Lu(282);return super.splice(e,t,n)}static importJSON(e){return jh().updateFromJSON(e)}collapseAtStart(){return!0}};function Tm(e){return e instanceof wm}function Em(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function lle(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function Dm(e,t,n=``){if(t===n)return;let r=Em(n),i=Em(t);for(let t in i)delete r[t],lle(e,t,i[t]);for(let t in r)e.removeProperty(t)}var ule=Uf()({detail:Gf(Wf(Rf(),pce),{field:`__detail`}),format:Gf(Wf(Rf(),$u),{field:`__format`}),mode:Gf(Bf([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:gce,setterTable:td}),style:Gf(Lf(),{field:`__style`}),text:Gf(Lf(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function Om(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function km(e,t){return 1&t?`strong`:2&t?`em`:`span`}function dle(e,t,n,r,i){let a=r.classList,o=Kh(i,`base`);o!==void 0&&a.add(...o),o=Kh(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in $u){let r=$u[e];if(o=Kh(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}Gh(r,`class`)}function fle(e,t,n){let r=n.isComposing(),i=e+(r?Xu:``),a=Lg(),o=Rg(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(Cg().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Hu||qu){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);c.replaceData(e,t,n)}else c.nodeValue=i}}function ple(e,t,n,r,i,a){fle(i,e,t);let o=a.theme.text;o!==void 0&&dle(0,0,r,e,o)}function Am(e,t){let n=Cg().createElement(t);return n.appendChild(e),n}function jm(e){return e!=null&&!0===e.__isInlineFormattable}var Mm=class extends sm{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config(`text`,{extends:sm,generated:Yce,importDOM:{"#text":()=>({conversion:vle,priority:0}),b:()=>({conversion:hle,priority:0}),code:()=>({conversion:Nm,priority:0}),em:()=>({conversion:Nm,priority:0}),i:()=>({conversion:Nm,priority:0}),mark:()=>({conversion:Nm,priority:0}),s:()=>({conversion:Nm,priority:0}),span:()=>({conversion:mle,priority:0}),strong:()=>({conversion:Nm,priority:0}),sub:()=>({conversion:Nm,priority:0}),sup:()=>({conversion:Nm,priority:0}),u:()=>({conversion:Nm,priority:0})},json:ule})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return gce[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Sh()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=$u[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return vh(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Om(0,n),i=km(0,n),a=r===null?i:r,o=Cg().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=Cg().createElement(i),o.appendChild(s)),ple(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&Dm(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Om(0,i),s=Om(0,a),c=km(0,i),l=km(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??Lu(48);let i=Cg().createElement(l);return ple(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??Lu(49)),fle(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&dle(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(Dm(t.style,p,f),Gh(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return jg(t)||Lu(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=Am(t,`b`)),this.hasFormat(`italic`)&&(t=Am(t,`i`)),this.hasFormat(`strikethrough`)&&(t=Am(t,`s`)),this.hasFormat(`underline`)&&(t=Am(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?$u[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?pce[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=vh(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=td[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){q_();let n=e,r=t,i=$(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!Q(i))return xy(o,n,o,r,`text`,`text`);{let e=Sh();e!==i.anchor.key&&e!==i.focus.key||xh(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=$();if(r&&Q(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){q_();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=Sh(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=$();if(Q(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=Pm(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=ap(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=Pm(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=ap(t,n);let a=n.__key;i===r&&xh(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&bh(t),n!==null&&bh(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Q(v)&&ky(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Lu(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;Sh()===r&&xh(n);let o=$();if(Q(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&jy(i,t,n,e,a),s!==null&&s.key===r&&jy(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function mle(e){return{forChild:Im(e.style),node:null}}function hle(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Im(t.style,n?void 0:`bold`),node:null}}var gle=new WeakMap;function _le(e){if(!jg(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function vle(e){let t=e;e.parentElement===null&&Lu(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=gle.get(n))===void 0&&!_le(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)gle.set(r[e],i);return i}(t)!==null)return{node:Iy(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=yle(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=yle(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:Pm(n)}}function yle(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,jg(n)){let e=n.style.display;if(e===``&&!Pg(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(hh(n))return n;if(n.nodeName===`BR`)return null}}var ble={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Nm(e){let t=ble[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Im(e.style,t),node:null}}function Pm(e=``){return pg(new Mm(e))}function Fm(e){return e instanceof Mm}function Im(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((Fm(e)||jm(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function Lm(e,t){let{type:n,key:r,offset:i}=e,a=hg(e.key);return n===`text`?(Fm(a)||Lu(266,a.getType(),r),vb(a,t,i)):(Z(a)||Lu(267,a.getType(),r),qm(a,e.offset,t))}function Rm(e,t){let{origin:n,direction:r}=t,i=r===`next`;mb(t)?e.set(n.getKey(),t.offset,`text`):hb(t)?Fm(n)?e.set(n.getKey(),yb(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(gb(t)&&Z(n)||Lu(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function zm(e){let t=$(),n=Q(t)?t:Sy();return Bm(n,e),Nh(n),n}function Bm(e,t){Rm(e.anchor,t.anchor),Rm(e.focus,t.focus)}function Vm(e){let{anchor:t,focus:n}=e,r=Lm(t,`next`),i=Lm(n,`next`),a=Db(r,i)<=0?`next`:`previous`;return Tb(Sb(r,a),Sb(i,a))}function Hm(e){let{direction:t,origin:n}=e,r=_b(n,ub(t)).getNodeAtCaret();return r?_b(r,t):bb(n.getParentOrThrow(),t)}function xle(e,t=`root`){let n=[e];for(let r=gb(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Hm(r));return n}function Sle(e){return!!e&&e.origin.isAttached()}function Cle(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Km(e,r),o=a.anchor.origin;for(;o!==null&&!dg(o);)o=o.getParent();let s=Z(o)?o.getFirstChild():null,c=xle(a.anchor,n),l=xle(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if(gb(e))u.add(e.origin.getKey());else if(hb(e)){let{origin:t}=e;Z(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),Ile(e)}for(let e of f)!e.canBeEmpty()&&!dg(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Hm(_b(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=Pm(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=vb(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=Um(c),m=Um(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&kb(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(dg(i))return;t&&!n.has(i.__key)||!Ig(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&ib(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;bb(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(gb(e)){let t=e.origin;if(Ig(t))return t}else{let t=e.getParentAtCaret();if(t&&Ig(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(ug);if(e&&t&&!Tm(t)&&e.isEmpty()&&u.has(e.getKey())&&ib(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!Tm(n)&&n.isEmpty();){let e=n.getParent();if(e&&Tm(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}Mh(o,s)!==null||o===null||o.isAttached()||Mh(jh(),null);let g=Um([p,m,...c,...l]);if(g)return wb(Sb(g,e.direction));Lu(269,JSON.stringify(c.map(e=>e.origin.__key)))}function Um(e){let t=e.find(Sle);return t&&Wm(t)}function Wm(e){let t=function(e){let t=e;for(;gb(t);){let e=xb(t);if(!gb(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(Fm(t.origin))return mb(t)?t:vb(t.origin,n,n);let r=t.getAdjacentCaret();return hb(r)&&Fm(r.origin)?vb(r.origin,n,ub(n)):t}function Gm(e){return mb(e)&&e.offset!==yb(e.origin,e.direction)}function Km(e,t){return e.direction===t?e:Tb(Sb(e.focus,t),Sb(e.anchor,t))}function qm(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?bb(e,n):_b(a,n)}function Jm(e,t=`root`){let n=0,r=e,i=xb(r);for(;i===null;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=xb(r)}return i&&[i,n]}function wle(e){let{origin:t,offset:n,direction:r}=e;if(n===yb(t,r))return e.getSiblingCaret();if(n===yb(t,ub(r)))return Hm(e.getSiblingCaret());let[i]=t.splitText(n);return Fm(i)||Lu(281),Sb(_b(i,`next`),r)}function Ym(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function Tle(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&Oy(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==$()&&ky(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function Ele(e,t){return!0}function Dle(e,{$copyElementNode:t=fg,$splitTextPointCaretNext:n=wle,rootMode:r=`shadowRoot`,$shouldSplit:i=Ele,removeEmptyDestination:a=!1}={}){if(mb(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(gb(e)){let e=Hm(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=Yy((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function Xm(e,t,n){let r=Sb(t,`next`);mb(r)&&(r.offset===0?r=_b(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=_b(r.origin,`next`))),r.origin.is(e)&&(hb(r)||Lu(342,e.getKey(),e.getType()),r=Hm(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Dle(e,n))r=e;return mb(r)&&Lu(283),r.insert(e.isInline()?Qm().append(e):e),Sb(_b(e.getLatest(),`next`),t.direction)}function Ole(e,t){let n=Km(Q(t)?Vm(t):t,`next`),r=tb(n.anchor.origin),i=tb(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=Wm(bb(e,`next`)),o=Sb(Wm(bb(e,`previous`)),`next`);return Db(n.anchor,a)<=0&&Db(n.focus,o)>=0}var Zm=class extends bm{$config(){return this.config(`paragraph`,{children:`inline`,extends:bm,generated:Xce,importDOM:{p:()=>({conversion:kle,priority:0})}})}createDOM(e){let t=Cg().createElement(`p`),n=Kh(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(jg(t)){this.isEmpty()&&t.append(Cg().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(Fm),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!Q(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(Ole(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=Qm();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>Fm(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function kle(e){let t=Qm();if(Kg(t,e),Wg(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in ed&&t.setFormat(n)}return Gg(t,e),{node:t}}function Qm(){return pg(new Zm)}function $m(e){return e instanceof Zm}var Ale=Uf()({detail:Kf(Rf(2),{getter:{field:`__detail`},setter:null}),mode:Kf(Bf([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:Kf(Lf(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),eh=class extends Mm{$config(){return this.config(`tab`,{extends:Mm,generated:Qce,json:Ale})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=Kh(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||Lu(286),this}setDetail(e){return e!==2&&Lu(127),this}setMode(e){return e!==`normal`&&Lu(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function th(){return pg(new eh)}function nh(e){return e instanceof eh}var rh=null;function ih(e){rh=e}var ah=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),jle=1;function Mle(e,t){let n=oh(e,t);return n===void 0&&Lu(30,t),n}function oh(e,t){return e._nodes.get(t)}var Nle=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function sh(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return gh(t)||yg(t)?Og(t):null})():t;if(!jg(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=Oh(n),i=n.nodeName;return cm(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&fh(n)==null)}function ch(e){let t=e===null?null:kg(e);return Mg(t)&&sh(t)}function lh(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return dh(t)===e&&e.read(`latest`,()=>!sh(t))}function uh(e){return e instanceof P_}function dh(e){let t=e;for(;t!=null;){let e=fh(t);if(uh(e))return e;t=$h(t)}return null}function fh(e){return e?e.__lexicalEditor:null}function Ple(e){return dce.test(e)?`rtl`:fce.test(e)?`ltr`:null}function ph(e){return nh(e)||e.isToken()}function mh(e){return ph(e)||e.isSegmented()}function hh(e){return Mg(e)&&e.nodeType===3}function gh(e){return Mg(e)&&e.nodeType===9}function _h(e){let t=e;for(;t!=null;){if(hh(t))return t;t=t.firstChild}return null}function vh(e,t,n){let r=$u[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~$u.superscript:t===`superscript`?i&=~$u.subscript:t===`lowercase`?(i&=~$u.uppercase,i&=~$u.capitalize):t===`uppercase`?(i&=~$u.lowercase,i&=~$u.capitalize):t===`capitalize`&&(i&=~$u.lowercase,i&=~$u.uppercase),i}function Fle(e){return Fm(e)||E_(e)||Sm(e)}function yh(e,t){let n=function(){let e=rh;return rh=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);q_(),J_();let r=X_(),i=Y_(),a=``+jle++;i._nodeMap.set(a,e),Z(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function Ile(e){Gy(e.getParent()===null?e:e.getWritable())}function bh(e){J_(),am(e)&&Lu(323,e.__key,e.__type);let t=e.__parent===null?Qy(e)?e.__slotHost:null:e.__parent,n=Y_(),r=X_(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Qy(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),Z(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function xh(e){q_();let t=X_(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=wh(n);e!==null&&e.getWritable()}if(e!==null){let t=wh(e);t!==null&&t.getWritable()}}}function Sh(){return K_()?null:X_()._compositionKey}function Ch(e){return!Wu&&(Ku||Yu)&&e.__text===``&&e.__key===X_()._compositionKey}function wh(e,t){let n=(t||Y_())._nodeMap.get(e);return n===void 0?null:n}function Th(e,t){let n=Dh(e,X_());return n===void 0?null:wh(n,t)}function Eh(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Dh(e,t){return e[`__lexicalKey_${t._key}`]}function Oh(e,t){let n=e;for(;n!=null;){let e=Th(n,t);if(e!==null)return e;n=$h(n)}return null}function kh(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Ah(e){return e.read(()=>jh().getTextContent())}function Lle(e,t){let n=Hg(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=wh(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function jh(){return Y_()._nodeMap.get(`root`)}function Mh(e,t){if(!(dg(e)&&e.isAttached()&&(Tm(e)?e.getChildrenSize()===0:e.isEmpty())&&(Tm(e)||t!==null&&Ig(t))))return null;let n=Qm();return e.append(n),n}function Nh(e){q_();let t=Y_();e!==null&&(e.dirty=!0,e.setCachedNodes(null),Q(e)&&X_()._slotsUsed&&_y(e)),t._selection=e}function Ph(e){q_(),yf(X_(),e)}function Fh(e){let t=function(e,t){let n=e;for(;n!=null;){let e=Dh(n,t);if(e!==void 0)return e;n=$h(n)}return null}(e,X_());return t===null?null:wh(t)}function Ih(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Lh(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var Rle=0;function Rh(){return zu?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++Rle).toString(36)}`}function zh(e){return hh(e)?e.nodeValue:null}function Bh(e,t,n){let r=vg(sg(t));if(r===null)return;let i=Eg(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=zh(a),r=Oh(a);if(t!==null&&Fm(r)){if((t===Xu||t===Qu)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&Vh(r,t,o,s,e)}}}function Vh(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!Wu&&(Ku||Yu);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(Xu)||s&&t===a.getTextContent()||(c=t.slice(0,-Xu.length)),i&&!s)){let e=Qu,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=$();if(c===``){if(o&&!i&&s)return void Hh(a,``,t);if(xh(null),Ku||Wu||Yu)a.remove();else{let e=X_();Hh(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=Dy(),d=a.getTextContentSize(),f=Sh(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||Q(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!Q(t)||n===null||r===null)return void Hh(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=Pm(a.getTextContent());a.replace(e),a=e}Hh(a,c,t)}}}function Hh(e,t,n){if(e.setTextContent(t),Q(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=yb(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function Uh(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(Tm(e))return t;t=e}return null}function Wh(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(fm(e),!Tm(t))return e;let u=Uh(n.getNode());return Z(u)&&u.isShadowRoot()&&u.is(Uh(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function zle(e){let t=jh();if(Q(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(Tm(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),Wh(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(Z(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),Wh(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),Wh(e,a),e)}{let e=t.select(0,t.getChildrenSize());return Nh(Wh(e,t)),e}}function Gh(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function Kh(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=jb(i);return n[t]=e,e}return i}function qh(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&Lu(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function Jh(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function Yh(e,t){let n=e.offset;if(e.type===`element`)return Jh(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?Jh(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function Xh(e){let t=sg(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function Zh(e,t,...n){return cv(e,t,n[0],e)}function Qh(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&Lu(75,t),n}function $h(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return yg(n)?n.host:null}function eg(e){return gh(e)?e:jg(e)?e.ownerDocument:null}function tg(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function Ble(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+tg(o.scrollPaddingLeft,i)*l,p=d+(i-tg(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(m<f?g=m-f:h>p&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)<Math.abs(_)&&m+x>=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function ng(e){return X_()._updateTags.has(e)}function rg(e){q_(),X_()._updateTags.add(e)}function ig(e){q_(),X_()._deferred.push(e)}function ag(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function og(e){let t=eg(e);return t?t.defaultView:null}function sg(e){let t=e._window;return t===null&&Lu(78),t}function cg(e){return Z(e)&&e.isInline()||Sm(e)&&e.isInline()}function lg(e){let t=e.getLatest();for(;t!==null;){if($y(t)!==null&&Z(t))return t;let e=t.getParentOrThrow();if(dg(e))return e;t=e}return t}function ug(e){return Z(e)&&e.isShadowRoot()}function dg(e){return Tm(e)||ug(e)}function fg(e,t=!1){let n=e.constructor.clone(e,ah);return yh(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function pg(e){let t=X_(),n=e.getType(),r=oh(t,n);r===void 0&&Lu(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||Lu(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||Lu(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&Lu(203,e.constructor.name,n,r.name,r.getType()),t}return e}function mg(e,t){!Tm(e.getParent())||Z(t)||Sm(t)||Lu(99)}function hg(e){let t=wh(e);return t===null&&Lu(63,e),t}function gg(e){if(!e||e.isInline())return!1;if(Sm(e))return!0;if(Z(e)){if(e.isShadowRoot()){let t=e.getParent();return!(Z(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function _g(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function vg(e){return zu?(e||window).getSelection():null}function Vle(e){let t=og(e);return t?t.getSelection():null}function yg(e){return Ng(e)&&`host`in e}var Hle=[];function bg(e){let t=e.getRootNode();if(t===e||!yg(t))return Hle;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!yg(e))break;n.push(e),r=e.host}return n}function*xg(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(gh(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function Sg(e){return e===null?document:e.ownerDocument}function Cg(){let e=$_();return Sg(e===null?null:e._rootElement)}function wg(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=bg(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function Tg(e,t){let n=wg(e,t);if(n!==null){let e=Ule(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function Eg(e,t){let n=wg(e,t);return n===null?e:Wle(n,Gle(e))}function Ule(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Wle(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function Gle(e){return e.direction}function Dg(e){let t=e.getRootNode();return gh(t)||yg(t)?t.activeElement:null}function Og(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function kg(e){let t=e.target;if(t!==null&&jg(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function Ag(e){return jg(e)&&e.tagName===`A`}function Kle(e){return jg(e)&&e.tagName===`TR`}function jg(e){return Mg(e)&&e.nodeType===1}function Mg(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Ng(e){return Mg(e)&&e.nodeType===11}var qle=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function Pg(e){return!(!jg(e)||!e.style.display.startsWith(`inline`))||qle.test(e.nodeName)}var Jle=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function Fg(e){return(!jg(e)||!e.style.display.startsWith(`inline`))&&Jle.test(e.nodeName)}function Ig(e){if(Sm(e)&&!e.isInline())return!0;if(!Z(e)||dg(e))return!1;let t=e.getFirstChild(),n=t===null||E_(t)||Fm(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Lg(){return X_()}function Rg(e=Lg()){return e._config.dom||j_}function zg(e,t,n=Lg()){let r=Rg(n).$getDOMSlot(e,t,n);return Z(e)&&(Yle(r)||Lu(344,e.getKey(),e.getType())),r}function Yle(e){return e instanceof pf}function Bg(e,t,n=Lg()){return _h(zg(e,t,n).element)}var Vg=new WeakMap,Xle=new Map;function Hg(e){if(!e._readOnly&&e.isEmpty())return Xle;e._readOnly||Lu(192);let t=Vg.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),Vg.set(e,t)),t}function Ug(e){let t=e.constructor.clone(e,ah);return t.afterCloneFrom(e),t}function Zle(e){return(t=Ug(e))[im]=!0,t;var t}function Wg(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function Gg(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function Kg(e,t){let n=t.style.textAlign;return n&&n in ed?e.setFormat(n):e}function qg(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function Jg(e){return!0===e.__lexicalUnmanaged}function Qle(e,t=Lg()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function Yg(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(jg(n)&&n.hasAttribute(`data-lexical-slot`)||Dh(n,t)!==void 0)return!1;n=$h(n)}return!1}function Xg(e,t){return If(e,t)&&e[t]!==sm[t]}var Zg=new WeakMap;function Qg(e){let t=Zg.get(e);return t===void 0?function(e){let t=e.prototype!=null&&nd in e.prototype?e.prototype[nd]():void 0,n=function(e){if(!(e===sm||e.prototype instanceof sm)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{P_.version&&(n=JSON.parse(P_.version))}catch{}Lu(290,e.name,t,n)}return e===xm||e===bm||e===sm}(e),r=!n&&Xg(e,`getType`)?e.getType:void 0,i=r&&!(e_ in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:If(e.prototype,nd),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};Zg.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=a_(e);for(let[i,a]of r){let r=rue(e,i,a);if(r===null)continue;if(Cf(r)){let t=r.field;if(t===`__proto__`&&Lu(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])If(t,String(r))||Lu(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&Lu(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?$le:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of a_(e).fieldsDerivedFirst){let a=nue(e,r,i);if(a===null)continue;if(Cf(a)){let o=a.field;o===`__proto__`&&Lu(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&Lu(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&Lu(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?tue:[...n.values()]}(e),i=a_(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of m_(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n<e.getters.length;n++){let r=e.getters[n],i=t.getters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.derived!==i.derived||r.isEqual!==i.isEqual||!Object.is(r.defaultValue,i.defaultValue)||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.getterTable===void 0!=(i.getterTable===void 0)))return!1}for(let n=0;n<e.setters.length;n++){let r=e.setters[n],i=t.setters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.setterTable===void 0!=(i.setterTable===void 0)))return!1}return!0}(n,$g(Qg(i)))?r:null}(e,0,{getters:r,setters:t});s.compiled={flatStates:i.flatStates,generated:c===null?null:c(i.fields),getters:r,isCompactDefault:iue(r),setters:t},function(e,t,n,r){if(!t&&n){if(!Xg(e,`getType`)){let t=e,r=function(){return this===t?n:sm.getType.call(this)};r[e_]=!0,e.getType=r}if(Xg(e,`clone`)||(e.clone=(t,n)=>{ih(t);let r=new e;return n!==ah&&r.afterCloneFrom(t),r}),Xg(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=h_(e);return n.updateFromJSON===sm.prototype.updateFromJSON?function(e,t){return l_(e.__state||t.$!==void 0?tp(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!Xg(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;If(t,`getTextContent`)&&!If(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=sm.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of m_(e)){let e=t.prototype;if(If(e,`afterCloneFrom`))continue;let r=lue(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?$g(Qg(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e<r.length;e++){let t=r[e];n[t]=i[t]}});e.afterCloneFrom=function(e){i.afterCloneFrom.call(this,e),o(this,e)},e.afterCloneFrom[cue]=!0}}(e),function(e,t){t&&t.inline!==void 0&&If(e.prototype,nd)&&!Object.prototype.hasOwnProperty.call(e.prototype,`isInline`)&&Object.defineProperty(e.prototype,"isInline",{configurable:!0,value:t.inline?d_:f_,writable:!0})}(e,a)}catch(t){throw Zg.delete(e),t}return s}(e):t}function $g(e){let{compiled:t}=e;return t===void 0&&Lu(422,e.config.klass.name),t}var e_=Symbol(`lexical.synthesizedGetType`),$le=[];function t_(e,t,n,r){let i=n.method===void 0?r:n.method,a=a_(e).declaredBy.get(t);if(a===void 0)return n;let o=e.prototype,s=a.prototype;return n_(o,s,i)&&n_(o,s,r)?n:i}function n_(e,t,n){return e[n]===t[n]}function r_(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function i_(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var eue={declaredBy:new Map,fields:new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function a_(e){let t=Qg(e);return t.composed===void 0&&(t.composed=function(e){let t=[],n=[],r=[];for(let{klass:i,ownNodeConfig:a}of m_(e)){let e=a&&a.json;n.push(i),t.push(e&&e.meta.kind===`node`?Object.entries(e.meta.fields):[]);let o=[];if(a&&a.stateConfigs)for(let e of a.stateConfigs)`stateConfig`in e&&e.flat&&o.push(e.stateConfig);r.push(o)}let i=new Map;for(let e=0;e<t.length;e++)for(let[n,r]of t[e])i.has(n)||i.set(n,r);let a=new Map,o=new Map,s=new Map;for(let e=t.length-1;e>=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?eue:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}function o_(e){let{fieldsDerivedFirst:t,flatStates:n}=a_(e),r={};for(let e of n)e.schema&&(r[e.key]=e.schema);for(let[e,n]of t)r[e]=n;return r}var tue=[];function nue(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?i_(t):r;return Cf(i)?t_(e,t,i,i_(t)):i}function rue(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?r_(t):r;return Cf(i)?t_(e,t,i,r_(t)):i}function s_(e){return e}function c_(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function iue(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&c_(i,r)}}function aue(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function l_(e,t){let{flatStates:n,generated:r,setters:i}=$g(Qg(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;e<n.length;e++){let i=n[e],a=t[i.key];if(a!==void 0){let e=i.parse(a);r=Zf(r,i,()=>e)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=i.schema(t[i.key]);i.kind===`ownField`?s_(e)[i.field]=i.setterTable===void 0?a:If(i.setterTable,a)?i.setterTable[a]:aue(i):i.setter.call(e,a)}return e}(a,t,i)}function u_(e){return Qg(e).config}function d_(){return!0}function f_(){return!1}function oue(e){return e===d_||e===f_}function sue(e){let t=[];for(let n of[e.getter,e.setter])Cf(n)&&n.field!==`__proto__`&&!t.includes(n.field)&&t.push(n.field);return t}var cue=`__lexicalSynthesizedAfterCloneFrom`;function p_(e){let{declaredBy:t,fieldsBaseFirst:n}=a_(e),r=[];for(let[i,a]of n)if(t.get(i)===e)for(let e of sue(a))r.includes(e)||r.push(e);return r}function lue(e){let t=p_(e);if(t.length===0)return t;let n=new Set;for(let{klass:t}of m_(e))if(t!==e)for(let e of p_(t))n.add(e);return n.size===0?t:t.filter(e=>!n.has(e))}function*m_(e){for(let t=e;t&&(t===sm||cm(t.prototype));){let e=u_(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||v_(t)}}function h_(e){let t=Lg();q_();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:pg(r)}var g_=(e,t)=>{let n=e;for(;n!=null&&!Tm(n);){if(t(n))return n;n=n.getParent()}return null};function __(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?wh(r):t.get(r);e??Lu(174),n.push(r),r=e.__next}return n}function v_(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function y_(e){return new S_(nf(e._nodeMap),null,e._slotsUsed)}function b_(){return new S_(new Map([[`root`,new wm]]),null,!1)}function x_(e){let t=e.constructor,n=of(e);if(Z(e)){let t=n.children,r=e.getChildren();for(let e=0;e<r.length;e++)t.push(x_(r[e]))}let r=ib(e);if(r.length>0){let i={};for(let n of r){let r=ab(e,n);r===null&&Lu(366,t.name,n),i[n]=x_(r)}n.$slots=i}return n}function uue(e){return e instanceof S_}var S_=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return iv(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return kce(typeof e==`boolean`&&e,()=>iv(null,this,()=>({root:x_(jh())})))}},C_=class extends bm{$config(){return this.config(`artificial`,{extends:bm})}createDOM(e){return Cg().createElement(`div`)}},w_=class extends sm{$config(){return this.config(`linebreak`,{extends:sm,generated:Zce,importDOM:{br:e=>D_(e)||O_(e)?null:{conversion:due,priority:0}}})}getTextContent(){return`
|
||
`}createDOM(){return Cg().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function due(e){return{node:T_()}}function T_(){return pg(new w_)}function E_(e){return e instanceof w_}function D_(e){let t=e.parentElement;if(t!==null&&Fg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&k_(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&k_(n))return!0}}return!1}function O_(e){let t=e.parentElement;if(t!==null&&Fg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&k_(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&k_(r))return!0}return!1}function k_(e){return hh(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function fue(e){console.warn(e)}function A_(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=b_(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&Dv(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),Eh(n,e,`root`))}function pue(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of m_(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var j_={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=oh(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>Z(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>Z(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function M_(e){let t=e||{},n=$_(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=b_(),s=t.namespace||(i===null?Rh():i._config.namespace),c=t.editorState,l=[wm,Mm,w_,eh,Zm,C_,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===sm||n.prototype instanceof sm)){let r=`<unknown>`;try{r=JSON.parse($d)}catch{}Lu(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}u_(n);let a=n.getType(),o=pue(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Bce(l[e]),transforms:o})}}let h=new P_(o,i,m,{disableEvents:a,dom:{...j_,...e&&e.dom},namespace:s,theme:r},u||console.error,d||fue,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(sd,wue,0),e.registerCommand(cd,Eue,0),e.registerCommand(ld,Oue,0),e.registerCommand(ud,kue,0),e.registerCommand(Sd,Nue,0)}(h),h}function mue(e,t){let n=e.get(t);e.delete(t),n&&n()}function N_(e,t,n){return e.set(t,n),mue.bind(null,e,t)}var P_=class{static version=$d;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new rf,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Rh(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return N_(this._listeners.update,e)}registerEditableListener(e){return N_(this._listeners.editable,e)}registerDecoratorListener(e){return N_(this._listeners.decorator,e)}registerTextContentListener(e){return N_(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return pv(N_(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&Lu(35);let r=this._commands;r.has(e)||r.set(e,[new ef,new ef,new ef,new ef,new ef]);let i=r.get(e);i===void 0&&Lu(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&Lu(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Hg(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return Lle(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return Zh(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=Kh(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,A_(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=_v.get(e);if(t===void 0)return void Kv();let n=vv.get(t);if(n===void 0)return void Kv();_v.delete(e);let r=fh(e);uh(r)?(function(e){if(e._parentEditor!==null){let t=Lh(e),n=t[t.length-1]._key;Wv.get(n)===e&&Wv.delete(n)}else Wv.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&Lu(198);let i=Hv(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}(t),n!=null&&t.classList.remove(...n)),e!==null){let t=og(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,bf(this),this._updateTags.add(`history-merge`),av(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;_v.set(e,n);let r=vv.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},vv.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=Hv(e);i.push(vue.register(n));let a={blur:Cce,click:yue,compositionend:Aue,compositionstart:Due,copy:Hd,cut:Ud,dragend:bce,dragover:Vd,dragstart:Bd,drop:Rd,focus:qd,input:Tue,keydown:jue,paste:hd,pointerdown:Sue,...Uu&&{beforeinput:Cue},...Wu&&{keyup:Mue,mousedown:xue}};for(let[n,r]of Object.entries(a))i.push(mv(e,n,i=>{Fue(i)||(Pue(i),n===`blur`&&(Dv(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):Zh(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,fv(t,()=>{let o=vg(sg(t));if(a.type!==`mousedown`){let r=c&&o&&Q($())&&Ty(Dy(),o,t,new Event(`selectionchange`));return r&&Nh(r),kv(t,n,c&&o?Eg(o,e).focusNode:null)}let l=wy(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){Uv(t,o,new Event(`selectionchange`),r),kv(t,a,Eg(o,e).focusNode);let n=$();Q(n)&&n.isCollapsed()&&!n.is(Dy())&&wv(t,n)}})};i.push(hv(n,{pointercancel:c,pointermove:c,pointerup:c},!0),mv(sg(t),`blur`,s),t.registerEditableListener(s),hv(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||Yg(kg(e),t)?null:e}}),mv(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),Wu&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return pv(mv(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),mv(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=Tv&&Math.abs(r.clientY-n.y)<=Tv&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(Ev(e,t,n)||(Og(n.ownerDocument)===n&&n.blur(),Dv(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(`history-merge`),av(this);ov(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=y_(e),r._selection=e._selection?e._selection.clone():null),yf(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),av(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,fv(this,()=>{if(a&&this._updateTags.add(a),n&&(Ru(38),jh().append(Qm())),e._parsed)for(let[e,t]of r._nodeMap.entries())Z(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=b_(),i=I_,a=R_,o=L_,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,I_=r,R_=!1,L_=t,ih(null);try{let i=t._nodes;rv(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,I_=i,R_=a,L_=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(U_.has(this)||av(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):dv(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),fv(this,()=>{let r=$(),i=jh();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||Nh(r.clone()),rg(`focus`),ig(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=vg(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,ov(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>Z_()))}toJSON(){return{editorState:this._editorState.toJSON(Ace())}}};function F_(e,t,n,r,i,a){if(Z(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=Z(e);e.__parent!==t||s&&a.has(o)||((s||Zy(e)&&e.__slots!==null)&&F_(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of Zy(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Qy(e)&&e.__slotHost===t&&((Z(e)||Zy(e)&&e.__slots!==null)&&F_(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var I_=null,L_=null,R_=!1,z_=!1,B_=!1,V_=new Set,H_=new Set,U_=new Set,W_=0,G_={characterData:!0,childList:!0,subtree:!0};function K_(){return R_||I_!==null&&I_._readOnly}function q_(){R_&&Lu(13)}function J_(){W_>99&&Lu(14)}function Y_(){return I_===null&&Lu(195,Q_()),I_}function hue(e){Y_()!==null&&L_===null&&(L_=e),L_!==e&&Ru(378)}function X_(){return L_===null&&Lu(337,Q_()),L_}function Z_(){X_()._dirtyType=2}function Q_(){let e=0,t=new Set,n=P_.version;if(typeof window<`u`)for(let r of xg(document)){let i=fh(r);if(uh(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function $_(){return L_}function ev(e,t,n){let r=t.__type,i=Mle(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function tv(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function nv(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function gue(e){return rv(e,X_()._nodes)}function rv(e,t){let n=e.type,r=t.get(n);r===void 0&&Lu(17,n);let i=r.klass;e.type!==i.getType()&&Lu(18,i.name);let a=i.importJSON(e),o=e.children;if(Z(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=rv(o[e],t);a.append(n)}let s=e.$slots;if(s){Zy(a)||Lu(379,i.name);for(let e in s)Que(a,e,rv(s[e],t))}return a}function iv(e,t,n){let r=I_,i=R_,a=L_;I_=t,R_=!0,L_=e;try{return n()}finally{I_=r,R_=i,L_=a}}function av(e,t){e._pendingEditorState!==null&&L_!==e&&yf(e,!1,!0);let n=B_;B_=!0;try{let n=function(e){if(H_.has(e))return!1;H_.add(e);try{for(let t=0;e._pendingEditorState!==null;t++){let n=e._pendingEditorState._selection,r=e._rootElement;if(!sv(e,n))return!1;let i=(n===null||Q(n))&&(e._headless||r===null||!r.isConnected);if(i||t===100)return e._lastNotifiedSelection=n===null?null:n.clone(),!i;dv(e,()=>e.dispatchCommand(id),void 0,!0)}return!1}finally{H_.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&lv(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=I_,u=R_,d=L_,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){L_=e,I_=n,R_=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=Gce(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),z_)throw t;A_(e,null,r,n),bf(e),e._dirtyType=2,z_=!0,av(e,a),z_=!1;return}finally{p.observe(r,G_),e._updating=f,I_=l,R_=u,L_=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=kh(e)),delete r[a])}(e,n);let b=i?null:vg(sg(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){L_=e,I_=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&_g(t,e,r),Hue(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(Q(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(Dg(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())gg(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&gg(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=zg(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=Cg().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=jb(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&_g(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,G_),L_=d,I_=l}}let x=U_.has(e);U_.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a);let r=e._pendingDecorators;r!==null&&(e._decorators=r,e._pendingDecorators=null,ov(`decorator`,e,!0,r)),function(e,t,n){let r=Ah(t),i=Ah(n);r!==i&&ov(`textcontent`,e,!0,i)}(e,t||a,n),ov(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v})}finally{x||U_.delete(e)}f||lv(e,y),function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){V_.has(e)||(V_.add(e),setTimeout(()=>{V_.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(Iu(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;dv(e,t,r)}}(e)})(e,t),n&&e._onWarn(Iu(436))}finally{B_=n}}function ov(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function sv(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function cv(e,t,n,r){let i=Lh(e),a;if(!B_)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);if(t===id){if(L_!==e||R_){let i=!1;return fv(e,()=>{i=cv(e,t,n,r)}),i}let i=Y_()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(fv(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{cv(a,t,n,r)}),!1}function lv(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function uv(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&Lu(191),a._flushSync=!0),o&&e._deferred.push(o),nv(e,i.tag)),a==null?dv(e,n,i):n()}}return r}function _ue(){let e=Y_();q_(),e._flushSync=!0}function dv(e,t,n,r=!1){let i=e._updateTags,a,o=!1,s=!1;n!==void 0&&(a=n.onUpdate,nv(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),a&&e._deferred.push(a);let c=e._editorState,l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=y_(l||c),u=!0),l._flushSync=s;let d=I_,f=R_,p=L_,m=e._updating,h=e._lastNotifiedSelection;I_=l,R_=!1,e._updating=!0,L_=e;let g=e._headless||e.getRootElement()===null;ih(null);try{u&&(g?c._selection!==null&&(l._selection=c._selection.clone()):l._selection=function(e,t){let n=e.getEditorState()._selection,r=vg(sg(e));return Q(n)||n==null?Ty(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),o=uv(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(Q(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),e._dirtyType!==0&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);Fm(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&dm(t)}}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=Sh(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);Fm(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&dm(r),r!==void 0&&tv(r,a)&&ev(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){W_++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&tv(c,a)&&ev(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,W_++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),uv(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(Z(t)&&F_(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(Zy(t)&&t.__slots!==null&&F_(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=X_(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(Q(i)){e._slotsUsed&&_y(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||Lu(19)}else ty(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),av(e);return}finally{I_=d,R_=f,L_=p,e._updating=m,W_=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,av(e)):u&&Nle(()=>{av(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function fv(e,t,n){L_===e&&n===void 0?K_()?dv(e,t,n):t():dv(e,t,n)}function pv(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function mv(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function hv(e,t,n){return pv(...Object.entries(t).map(([t,r])=>mv(e,t,r,n)))}var gv=30,_v=new WeakMap,vv=new WeakMap,vue=Dce(e=>(e.addEventListener(`selectionchange`,Gv),()=>e.removeEventListener(`selectionchange`,Gv)));function yv(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=X_(),u;if(a!==void 0)u=a;else{let e=vg(sg(l));u=e===null?null:Eg(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!Fm(c)||(!i&&(!Uu||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||Ih(n))&&o.offset!==s.offset&&!c.isComposing()||mh(c)||c.isDirty()&&m>1||(i||!Uu)&&p!==null&&!c.isComposing()&&d!==Bg(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=ph(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(Fm(t)||Z(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function bv(e,t){return hh(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function xv(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=Eg(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,bv(r,i)&&bv(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}fv(t,()=>{if(!n)return void Nh(null);if(!lh(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||kv(t,c,a);let l=Ov.has(c),u=$();if(s.postDeleteSelectionToRestore&&Q(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),Nh(u))}if(s.postDeleteSelectionToRestore=null,Q(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),wv(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=sce,v=!1;for(let e=0;e<s;e++){let t=a[e],n=t.getTextContentSize();if(Fm(t)&&n!==0&&!(e===0&&t.__key===h&&p===n||e===s-1&&t.__key===g&&m===0)&&(v=!0,_&=t.getFormat(),_===0))break}u.format=v?_:0}}(function(e,t,n=!1){(n||sv(e,t))&&e.dispatchCommand(id)})(t,u,u!==null&&(u.dirty&&!l||!Q(u)))})}function Sv(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Cv(e,t){Sv(e,t.getFormat(),t.getStyle())}function wv(e,t){let n=t.anchor,r=n.getNode(),i=sg(e).event,a=i?i.timeStamp:performance.now(),{format:o,style:s,offset:c,key:l,timeStamp:u}=e._inputState.collapsedSelectionFormat;a<u+200&&n.offset===c&&n.key===l?Sv(t,o,s):n.type===`text`?(Fm(r)||Lu(141),Cv(t,r)):(e.isComposing()||jh().getTextContent()!==``)&&(Z(r)||Lu(259),r.isEmpty()?Ey(t,``):Sv(t,t.format,``))}function yue(e,t){fv(t,()=>{let n=$(),r=vg(sg(t)),i=Dy();if(r){if(Q(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!Tm(t)&&jh().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||Wu&&t._inputState.lastPointerType!==`mouse`){let n=Eg(r,t._rootElement).anchorNode;(jg(n)||hh(n))&&Nh(Ty(i,r,t,e))}}if(Hu&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(jg(t)){let n=t.getBoundingClientRect();if(a<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=Ty(i,r,t,e);s===null?r.removeAllRanges():Nh(s)}}Zh(t,od,e)})}var Tv=10,bue=`input:not(:disabled),textarea:not(:disabled),select:not(:disabled),button:not(:disabled),a[href],area[href],label,summary,iframe,object,embed,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])`;function xue(e,t){let n=t.getRootElement();n!==null&&(Ev(e,t,n)?(e.preventDefault(),Og(n.ownerDocument)!==n&&(t._inputState.savedInputMode===void 0&&(t._inputState.savedInputMode=n.getAttribute(`inputmode`)),n.setAttribute(`inputmode`,`none`),n.focus({preventScroll:!0}))):Dv(t,n))}function Ev(e,t,n){if(t._inputState.lastPointerType===`mouse`)return!1;let r=kg(e);if(!Mg(r))return!1;let i=!1;for(let e=r;e!==null;e=$h(e)){if(e===n)return i;if(e.nodeType===1){let t=e;if(t.matches(bue))return!1;t.getAttribute(`data-lexical-decorator`)===`true`&&(i=!0)}}return!1}function Dv(e,t){let n=e._inputState.savedInputMode;n!==void 0&&(e._inputState.savedInputMode=void 0,n===null?t.removeAttribute(`inputmode`):t.setAttribute(`inputmode`,n))}function Sue(e,t){let n=kg(e),r=e.pointerType;Mg(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&fv(t,()=>{Yg(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var Ov=new WeakSet;function kv(e,t,n=null){let r=$(),i=r&&r.clone();(function(e,t,n){let r=Dy(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&Oh(n);Sm(o)&&(i?a&&o.isInline()&&o.selectPrevious():Q(r)&&Nh(r.clone()));let s=$(),c=s||(a?Sy():Q(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!Q(c)||a&&!c.isCollapsed()||!gh(u)&&!yg(u))return;let{anchor:d,focus:f}=c;if(!i&&Q(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&Oh(h),_=(e,t)=>Z(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=Z(g)&&!g.isInline()&&(Tm(g)?g_(f.getNode(),by):g);for(let e of y?bb(y,`next`):[])v.push(_b(e.origin,`previous`),e);let b=sg(e),x=b.document.createRange(),S=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!Sm(n)||!n.isInline()||n===S)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(m<v||m>l)){S=n;continue}let y=b.getComputedStyle($h(r)||r).direction===`rtl`,C=2*p>u+h!==y,w=C?`next`:`previous`,T=t&&t.getNodeAtCaret(),ee=T&&e.getElementByKey(T.getKey()),E=ee?ee.getClientRects():[],te=E[C?0:E.length-1];if(!t||t.direction===w&&b.getComputedStyle(r).cssFloat===`none`&&(!T||E_(T)||te&&(C===y?2*te.right>u+h:2*te.left<u+h))){if(!n.is(_(Yh(f,C),w))){let e=_b(n,w);Rm(f,e),a&&Rm(d,e)}s||Nh(c);return}}if(Sm(o)&&!i){let t=b.document,n=t.caretPositionFromPoint&&t.caretPositionFromPoint(p,m,{shadowRoots:yg(u)?[u]:[]}),r=n&&fy(n.offsetNode,n.offset,null,e);if(r){let[{key:e,offset:t,type:n}]=r;f.set(e,t,n)}}})(e,t,n);let a=$(),o=e._inputState.mouseDrag;o&&a&&!a.is(i)&&Ov.add(o),t.type===`mousedown`&&Q(a)&&Ey(a,Q(i)?i.anchor.key:``)}function Av(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function jv(e){let{lastKeyCode:t}=X_()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
|
||
`:t===`Tab`?` `:null;if(!n)return;let r=$();if(!Q(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!Fm(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
|
||
`){if(Wu)return;if(E_(e))e.selectEnd();else if(!e){let e=g_(i,by),t=e&&e.getNextSibling();Z(t)&&t.selectStart()}}else n===` `?nh(e)&&e.selectEnd():Fm(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function Mv(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function Nv(e){Vu&&!Wu&&qu&&(Mv(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Mv(e),0))}function Pv(e,t){let n=kg(e);if(jg(n)&&Yg(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=Og(r.ownerDocument);return i!==null&&r.contains(i)&&(Yg(i,t)||sh(r,i))}function Cue(e,t){let n=e.inputType;n===`deleteCompositionText`||Hu&&Xh(t)||n!==`insertCompositionText`&&fv(t,()=>{Pv(e,t)||Zh(t,sd,e)},{event:e})}function wue(e){let t=e.inputType,n=Av(e),r=X_(),i=r._inputState,a=$();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(Mv(i),e.preventDefault(),Q(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=Dy();if(!Q(e))return!0;Nh(e.clone())}if(Q(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+gv}(i,e.timeStamp)&&r.isComposing()&&t){if(xh(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{fv(r,()=>{xh(null)})},gv),Q(a)){let e=a.anchor.getNode();e.markDirty(),Fm(e)||Lu(142),Cv(a,e)}}else{if(xh(null),Wu&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=Ju&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!Sm(Yh(a.anchor,!0))),!u){Zh(r,dd,!0);let e=$();Ju&&Q(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Q(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),Zh(r,t===`historyUndo`?bd:xd)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&Bh(!1,r,i.unprocessedBeforeInputData);let s=!1;if((!a.dirty||i.unprocessedBeforeInputData!==null)&&a.isCollapsed()&&!Tm(a.anchor.getNode())&&n!==null){let{key:e,offset:i,type:o}=a.anchor,c=r._slotsUsed&&my(a.anchor);a.applyDOMRange(n);let l=t.endsWith(`Forward`);if(!1!==c&&(l||t.endsWith(`Backward`))){let n=qv(e,i,o),{anchor:r,focus:u}=a,d=!gy(my(r),c)||!gy(my(u),c),f=!d&&c!==null&&(l?r.isBefore(n)||u.isBefore(n):n.isBefore(r)||n.isBefore(u));(d||f)&&(r.set(e,i,o),u.set(e,i,o),s=f&&t===`deleteContentForward`)}}i.unprocessedBeforeInputData=null;let c=a.anchor,l=a.focus,u=c.getNode(),d=l.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
|
||
`)e.preventDefault(),Zh(r,fd,!1);else if(o===Zu)e.preventDefault(),Zh(r,pd);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&yv(a,n,o,e.timeStamp,!0)?(e.preventDefault(),Zh(r,md,o),jv(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:Zh(r,md,e),jv((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{i.compositionPhase=`idle`;let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;xh(null),t||Zh(r,md,e),Fv(n);break}case`insertLineBreak`:xh(null),i.isInsertLineBreak=!1,Zh(r,fd,!1);break;case`insertParagraph`:xh(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,Zh(r,fd,!1)):Zh(r,pd);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:Zh(r,hd,e);break;case`deleteByComposition`:(function(e,t){return e!==t||Z(e)||Z(t)||!ph(e)||!ph(t)})(u,d)&&Zh(r,gd,e);break;case`deleteByDrag`:rg(`skip-selection-focus`),Zh(r,gd,e);break;case`deleteByCut`:Zh(r,gd,e);break;case`deleteContent`:Zh(r,dd,!1);break;case`deleteWordBackward`:Zh(r,_d,!0);break;case`deleteWordForward`:Zh(r,_d,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:Zh(r,vd,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:Zh(r,s?dd:vd,!1);break;case`formatStrikeThrough`:Zh(r,yd,`strikethrough`);break;case`formatBold`:Zh(r,yd,`bold`);break;case`formatItalic`:Zh(r,yd,`italic`);break;case`formatUnderline`:Zh(r,yd,`underline`);break;case`historyUndo`:Zh(r,bd);break;case`historyRedo`:Zh(r,xd)}return!0}function Tue(e,t){e.stopPropagation();let n=t._inputState;Mv(n),fv(t,()=>{Pv(e,t)||t.dispatchCommand(cd,e)},{event:e}),n.unprocessedBeforeInputData=null}function Eue(e){let t=X_(),n=t._inputState,r=$(),i=e.data,a=Av(e),o=!1,s=!1;if(i!=null&&Q(r)){let c=vg(sg(t)),l=c===null?null:Eg(c,t._rootElement),u=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);let d=r.anchor.getNode(),f=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&Fm(d)&&mh(d);if(!u&&!f&&yv(r,a,i,e.timeStamp,!1,l)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=Iv(t,i);if(n.compositionPhase=`idle`,e)return rg(`composition-end`),Ph(),!0}let a=r.anchor.getNode();if(c===null||l===null)return!0;let u=r.isBackward(),d=u?r.anchor.offset:r.focus.offset,f=u?r.focus.offset:r.anchor.offset;Uu&&!r.isCollapsed()&&Fm(a)&&l.anchorNode!==null&&a.getTextContent().slice(0,d)+i+a.getTextContent().slice(d+f)===zh(l.anchorNode)||(Zh(t,md,i),s=e.inputType===`insertText`);let p=i.length;Hu&&p>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=p,r._cachedNodes=null,r._cachedIsBackward=null),Ju&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,xh(null))}}return o||(Bh(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(Iv(t,i||void 0),rg(`composition-end`),n.compositionPhase=`idle`)),Ph(s),!0}function Due(e,t){Zh(t,ld,e)}function Oue(e){let t=X_(),n=t._inputState,r=$();if(Q(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(xh(i.key),rg(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+gv||i.type===`element`||!r.isCollapsed()||!Ju&&(a.getFormat()!==r.format||Fm(a)&&a.getStyle()!==r.style)||Fm(a)&&(mh(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){Wu||!Ku&&!Yu?Zh(t,md,Qu):function(e){Xv(e,``,!0)}(r);let e=$();Q(e)&&xh(e.anchor.key)}}return!0}function kue(e){let t=X_();return t._inputState.compositionPhase=`idle`,Iv(t,e.data),rg(`composition-end`),!0}function Fv(e){let t=X_()._inputState,n=t.composedSegmentedKey;if(t.composedSegmentedKey=null,e===null||e!==n)return;let r=wh(e);if(!Fm(r)||r.getType()===`text`||mh(r)||!r.isAttached())return;let i=$(),a=Q(i)&&i.anchor.key===e?i.anchor.offset:null,o=Pm(r.getTextContent());if(o.setFormat(r.getFormat()),o.setStyle(r.getStyle()),r.replace(o),a!==null){let e=Math.min(a,o.getTextContentSize());o.select(e,e)}}function Iv(e,t){let n=e._compositionKey;if(xh(null),n!==null&&t!=null){if(t===``){let t=wh(n),r=e.getElementByKey(n),i=r!==null&&Fm(t)?Bg(t,r,e):null;if(i!==null&&i.nodeValue!==null&&Fm(t)){let n=vg(sg(e)),r=n&&Eg(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),Vh(t,i.nodeValue,a,o,!0)}return Fv(n),!1}if(t[t.length-1]===`
|
||
`){let t=$();if(Q(t)||ty(t)){if(Q(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return Zh(e,kd,null),Fv(n),!1}}let r=wh(n);if(r!==null&&Fm(r)&&mh(r)){r.markDirty();let e=$(),i=r.getTextContentSize(),a=Q(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return Bh(!0,e,t),Fv(n),!1}function Aue(e,t){let n=t._inputState;Hu?n.compositionPhase=`ending-firefox`:(e.data===``||Wu||!Ku&&!Yu)&&Zh(t,ud,e)}function jue(e,t){let n=t._inputState;Wu&&(n.isShiftKeyDown=e.key===`Shift`||n.isShiftKeyDown&&e.shiftKey&&e.key!==`CapsLock`),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&Mv(n),t.isComposing()||!Wu&&(Ku||Yu)&&e.keyCode===229||Zh(t,Sd,e)}function Mue(e,t){e.shiftKey&&e.key!==`CapsLock`||(t._inputState.isShiftKeyDown=!1)}var Lv={altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:`any`},Rv={ctrlKey:!0},zv={metaKey:!0},Bv={shiftKey:`any`},Vv={altKey:`any`,shiftKey:`any`};function Nue(e){let t=X_();if(e.key==null)return!0;let n=t._keyDownShortcuts;n===null&&(n=Ece(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{Zh(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),Zh(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!Wu||r.isShiftKeyDown),Zh(n,kd,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:Yd,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||Q(r)||ch(e)||(e.preventDefault(),Zh(n,t,e))}});return[e(`ArrowRight`,Bv,Cd),e(`ArrowLeft`,Bv,Td),e(`ArrowUp`,Vv,Dd),e(`ArrowDown`,Vv,Od),n({...Lv,shiftKey:!0},!0),n({...Lv,shiftKey:!1},!1),e(` `,Lv,Ad),{key:`Backspace`,modifiers:Bv,onMatch:(e,t)=>{Zh(t,jd,e)&&Nv(t._inputState)}},e(`Escape`,Lv,Md),e(`Delete`,{},Nd),t(`Backspace`,Xd,_d,!0),t(`Delete`,Xd,_d,!1),t(`b`,Yd,yd,`bold`),t(`u`,Yd,yd,`underline`),t(`i`,Yd,yd,`italic`),e(`Tab`,Bv,Pd),t(`z`,Yd,bd,void 0),t(`z`,{...Yd,shiftKey:!0},xd,void 0),...Vu?[{key:`o`,modifiers:Rv,onMatch:(e,t)=>{e.preventDefault(),Zh(t,fd,!0)}},e(`ArrowLeft`,{metaKey:!0,...Bv},Ed),e(`ArrowRight`,{metaKey:!0,...Bv},wd),t(`h`,Rv,dd,!0),t(`d`,Rv,dd,!1),t(`Backspace`,zv,vd,!0),t(`Delete`,zv,vd,!1),t(`k`,Rv,vd,!1)]:[e(`Home`,Bv,Ed),e(`End`,Bv,wd),t(`y`,Rv,xd,void 0)],{key:`a`,modifiers:Yd,onMatch:(e,t)=>{e.preventDefault(),Zh(t,Wd,e)&&Nv(t._inputState)}},r(`c`,Hd),r(`x`,Ud)]}()),t._keyDownShortcuts=n);let r=n.match(e);return r&&r.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(wce,e),!0}function Hv(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}function Uv(e,t,n,r){if(r!==void 0)for(let e of r.editors)e._inputState.isSelectionChangeFromMouseDown=!1;let i=Eg(t,e._rootElement).anchorNode;(jg(i)||hh(i))&&Nh(Ty(Dy(),t,e,n))}var Wv=new Map;function Gv(e){let t=e.target;if(jg(t)&&(t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`))return;let n=Vle(t);if(n===null)return;let r=eg(t),i=null,a=r===null?void 0:vv.get(r);if(r!==null){if(a!==void 0){let e=a.editors,t=a.hasShadowEditor;if(t===void 0){t=!1;for(let n of e)if(n._rootElement!==null&&yg(n._rootElement.getRootNode())){t=!0;break}a.hasShadowEditor=t}if(t){let t=null;for(let r of e){let e=r._rootElement;if(e===null)continue;let a=Eg(n,e).anchorNode;if(a!==null&&dh(a)===r){if(yg(e.getRootNode())){i=r;break}t===null&&(t=r)}}i===null&&t!==null&&(i=t)}else{let e=n.anchorNode;e===null||jg(e)&&e.shadowRoot!==null||(i=dh(e))}}if(i===null){let e=Og(r);i=e===null?null:dh(e)}}if(i===null)return;i._inputState.isSelectionChangeFromMouseDown&&fv(i,()=>Uv(i,n,e,a));let o=Lh(i),s=o[o.length-1],c=s._key,l=Wv.get(c),u=l||s;u!==i&&xv(n,u,!1),xv(n,i,!0),i===s?l&&Wv.delete(c):Wv.set(c,i)}function Pue(e){e._lexicalHandled=!0}function Fue(e){return!0===e._lexicalHandled}var Kv=vce(),Iue=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Db(Wm(Lm(this,`next`)),Wm(Lm(e,`next`)))<0}getNode(){let e=wh(this.key);return e===null&&Lu(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,K_()||(Sh()===a&&xh(e),i!==null&&(i.setCachedNodes(null),Q(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function qv(e,t,n){return new Iue(e,t,n)}function Jv(e,t){let n=t.__key,r=e.offset,i=`element`;if(Fm(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!Z(t)){let e=t.getNextSibling();if(Fm(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Lue(e,t){if(Z(t)){let n=t.getLastDescendant();Z(n)||Fm(n)?Jv(e,n):Jv(e,t)}else Jv(e,t)}function Yv(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=Pm();if(o.setFormat(n),o.setStyle(r),$m(a))a.splice(0,0,[o]);else if(a!==null){let e=dg(i)?Qm().append(o):o;a.insertBefore(e)}else if(dg(i)){let e=i.getLastChild();Z(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(Qm().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function Xv(e,t,n){let r=e.format,i=e.style;if(!e.isCollapsed()){let a=(e.focus.isBefore(e.anchor)?e.focus:e.anchor).getNode();if(Fm(a)&&(r=a.getFormat(),i=a.getStyle()),e.removeText(),e.format=r,e.style=i,t===``&&!n)return;if(Sh()===null)return e.anchor.type===`element`&&Yv(e.anchor,e.focus,r,i),void Zv(e,t,r,i)}e.anchor.type===`element`&&Yv(e.anchor,e.focus,r,i);let a=e.anchor.getNode();Fm(a)||Lu(398);let o=e.anchor.offset,s=a.getParentOrThrow(),c=a.getTextContentSize();if(mh(a)||o===0&&(!a.canInsertTextBefore()||!s.canInsertTextBefore()&&!a.__prev)||o===c&&(!a.canInsertTextAfter()||!s.canInsertTextAfter()&&!a.__next)){if(a.isSegmented()&&o!==0&&o!==c){if(Sh()!==null)a.setMode(`normal`).setFormat(r).setStyle(i),X_()._inputState.composedSegmentedKey=a.getKey();else{let t=Pm(a.getTextContent());t.setFormat(r),t.setStyle(i);let n=$()===e;a.replace(t),e.setTextNodeRange(t,o,t,o),n&&$()!==e&&Nh(e)}(t!==``||n)&&Xv(e,t,n);return}if(t===``&&!n)return;if(o===0||o===c){let c=o===0,l=c?`previous`:`next`,u=_b(a,l).getNodeAtCaret(),d;Fm(u)&&(c?u.canInsertTextAfter():u.canInsertTextBefore())&&!mh(u)?d=u:(d=Pm().setFormat(r).setStyle(i),_b((c?s.canInsertTextBefore():s.canInsertTextAfter())?a:s,l).insert(d));let f=c?void 0:0;d.select(f,f),Xv(e,t,n);return}let l=Pm(t);l.setFormat(r),l.setStyle(i),a.replace(l),l.select();return}if(t===``&&!n)return;let l=s.isInline()&&o===0&&!a.__prev,u=s.isInline()&&o===c&&!a.__next,d=a.getFormat()!==r||a.getStyle()!==i;if(l||u||d){if(a.getTextContent()!==``||l||u)return void Zv(e,t,r,i);a.setFormat(r),a.setStyle(i)}a.spliceText(o,0,t,!0),a.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}function Zv(e,t,n,r){let i=e.anchor.getNode();Fm(i)||Lu(398);let a=e.anchor.offset,o=Pm(t).setFormat(n).setStyle(r),s=i.getParentOrThrow(),c=a===0,l=c||a===i.getTextContentSize();if(l&&s.isInline()&&!(c?i.__prev:i.__next))_b(s,c?`previous`:`next`).insert(o);else{let e=l?i:i.splitText(a)[0];c?e.insertBefore(o,!1):e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var Qv=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ty(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>$y(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(Fm(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=wh(e);t!==null&&n.push(t)}return K_()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>$y(e)===null);if(($()||Dy())===this&&e[0]){let t=_b(e[0],`next`);zm(Tb(t,t))}for(let t of e)t.remove();$v()}};function $v(){let e=jh();if(e.getChildrenSize()===0&&nb($())===null){let t=Qm();e.append(t),t.select()}}function Q(e){return e instanceof ey}var ey=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Q(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=0;for(let n of e)if(gb(n)){let{origin:e}=n;t.length===0?i.add(e):(a++,t.push(e))}else{let{origin:e}=n;Z(e)&&a!==0?a--:t.push(e)}if(r&&t.push(r.caret.origin),hb(e.focus)&&Z(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=bb(e.focus.origin,`previous`);gb(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=xb(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!Z(e)||a>0||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Wm(e.anchor),r=Wm(e.anchor.getFlipped()),i=e=>mb(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Km(Vm(this),`next`));return K_()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){if(this.isCollapsed())return``;let e=this.getNodes(),t=Vm(this).getTextSlices(),n=``,r=!0;for(let i=0;i<e.length;i++){let a=e[i];if(Z(a)&&!a.isInline()){r||(n+=`
|
||
`);let e=``;for(let t of ib(a)){let n=ab(a,t);n!==null&&(e+=n.getTextContent())}e===``?r=!a.isEmpty():(n+=e,r=!1)}else if(r=!1,Fm(a)){let e=Ym(t,a);n+=e?e.getTextContent():a.getTextContent()}else(Sm(a)||E_(a))&&(n+=a.getTextContent())}return n}applyDOMRange(e){let t=X_(),n=t.getEditorState()._selection,r=yy(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),fm(this)}clone(){let t=this.anchor,n=this.focus;return new e(qv(t.key,t.offset,t.type),qv(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=vh(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=$u[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(Iy(e))}insertText(e){Xv(this,e,!1)}removeText(){let e=$()===this,t=this.anchor.key;Bm(this,Cle(Vm(this))),this.isCollapsed()&&Ey(this,t),e&&$()!==this&&Nh(this)}formatText(e,t=null){iy(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&Z(t)&&t.isShadowRoot()&&$y(t)!==null){let n=t.getFirstChild()??t.append(Qm()).getFirstChild();if(n!==null&&!Z(n)){let e=Qm();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=$();return Q(t)||Lu(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&dg(t)){let n=By(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=this.isBackward()?this.focus:this.anchor,r=n.getNode(),i=g_(r,Ig),a=e[e.length-1];if(Z(i)&&`__language`in i){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let[,t]=Ry(this);i.splice(t,0,e),a.selectEnd()}return}if(!e.some(e=>(Z(e)||Sm(e))&&!e.isInline())){Z(i)||Lu(211,r.constructor.name,r.getType());let[t,n]=Ry(this,!0);(Z(t)?t:i).splice(n,0,e),a.selectEnd();return}if(i===null){let t=By(e),n=t.getLastDescendant(),r=Lm(this.anchor,`next`);for(let e of t.getChildren())r=Xm(e,r);n!==null&&n.selectEnd();return}if(Z(i)&&($y(i)!==null||!i.isParentRequired()&&!dg(i.getParentOrThrow()))){let[,t]=Ry(this),n=Ly(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=By(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&Z(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!Ig(e)&&!dg(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return E_(t)&&E_(t.getPreviousSibling())}(n),u=Z(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=g_(r,Ig));let d=c[c.length-1],f=c[0];var p=f;l||!Z(p)||!Ig(p)||p.isEmpty()||!Z(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(Z(i)||Lu(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&Lu(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||Lu(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=g_(s,Ig),h=s.selectEnd();u&&(Z(m)&&(u.canMergeWhenEmpty()||Ig(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),Z(i)&&i.isEmpty()&&i.remove();let g=Z(i)?i.getLastChild():null;E_(g)&&m!==i&&g.remove();let _=Wm(Lm(h.anchor,`next`));Rm(h.anchor,_),Rm(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&dg(e)){let t=Qm();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=Ry(this),n=g_(this.anchor.getNode(),Ig);if(n!==null&&$y(n)!==null)return null;Z(n)||Lu(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=T_();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes();if(this.isCollapsed())return[...e];let t=this.isBackward(),n=Vm(this).getTextSlices(),r=[];for(let t of e){let e=Ym(n,t),i=e?Tle(e,this):t;i!==null&&r.push(i)}if(e.length===1&&r.length===1&&Fm(r[0])){let e=r[0],[n,i]=t?[this.focus,this.anchor]:[this.anchor,this.focus];n.set(e.getKey(),0,`text`),i.set(e.getKey(),e.getTextContentSize(),`text`)}return r}modify(e,t,n){if(Vy(this,e,t,n))return;let r=e===`move`,i=X_(),a=vg(sg(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!Z(c)||c.isInline()||c.canBeEmpty()||_g(o,i,s);let l=Qh(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=Fm(c)?Bg(c,l,i):null),this.dirty){let e=Qh(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=Fm(n)?Bg(n,e,i):null}t&&u&&My(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&Fm(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=_b(c,t?`previous`:`next`).getNodeAtCaret();if(Fm(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?Bg(e,n,i):null;if(r){let e=t?r.length:0;My(a,r,e,r,e)}}}}if(sy(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=wg(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=Tm(o)?o:lg(o);this.applyDOMRange(n),this.dirty=!0,r||(cy(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||oy(this))}n===`lineboundary`&&Vy(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&Z(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(Z(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=Z(n)?n.getNextSibling():null;if(!(Z(n)&&n.isEmpty()&&Z(e)&&e.isShadowRoot()))return}let r=Lm(t,e?`previous`:`next`),i=Cb(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if(Z(e)&&gg(e)){let t=e.getParent();e.remove();let n=Mh(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(gb(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(Z(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=Wm(t);Bm(this,Tb(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(hb(t)){if(Z(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Sm(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&Z(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=Cy();e.add(t.origin.getKey()),Nh(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=Mh(n,e);r!==null&&r.selectStart()}}return}if(E_(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return ib(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Bm(this,Tb(!t.origin.isEmpty()&&n.isEmpty()?Hm(_b(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if($y(e)!==null)return;if(Z(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(ly(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if(Z(n)){if(n.collapseAtStart(e))return!0;if(dg(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void dy(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void dy(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e<o,c=s?e:o,l=s?o:e,u=l-1;c!==u&&!Ih(a=i.getTextContent().slice(c,l))&&!Bue(a)&&(t?r.set(r.key,u,r.type):n.set(n.key,u,n.type))}var a})(this,e)}}t||ay(this),this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0&&$v()}deleteLine(e){ny(this,e,`lineboundary`)}deleteWord(e){ny(this,e,`word`)}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return K_()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function ty(e){return e instanceof Qv}function ny(e,t,n){let r=e.isCollapsed(),{anchor:i,focus:a}=e,o=!1;if(r){if(n===`word`&&e.forwardDeletion(i,i.getNode(),t))return;o=ly(e,t,n),n===`lineboundary`&&function(e){for(let t of Vm(e).iterNodeCarets(`shadowRoot`))if(hb(t)&&E_(t.origin))return void Rm(e.focus,Hm(t))}(e)}n!==`lineboundary`||e.isCollapsed()||g_(i.getNode(),Ig)===g_(a.getNode(),Ig)||a.set(i.key,i.offset,i.type),e.isCollapsed()?o||e.deleteCharacter(t):(r||ay(e),e.removeText())}function ry(e,t){if(ty(e)){for(let n of e.getNodes())jm(n)&&n.setFormat(t(n.getFormat()));return}let n=e.isCollapsed()?[]:e.getNodes(),r=n.length?Vm(e).getTextSlices():[],i,a,o,s=!1,c=0;for(let l of n)if(Fm(l)){i&&a&&(i.set(a.__key,0,`text`),i=void 0);let n=Ym(r,l);if(!s&&n&&n.distance===0){let t=e.isBackward()?e.focus:e.anchor;t.type===`text`&&t.key===l.__key&&(i=t)}if(s=!0,n&&n.distance===0)continue;let u=t(l.getFormat()),d=i?l.getTextContentSize():0,f=n&&!mh(l)?Tle(n,e):l;f!==null&&(f.setFormat(u),o===void 0&&(o=u,a=f,i&&f.getTextContentSize()!==d&&(i.set(f.__key,0,`text`),i=void 0)),c=u)}else Z(l)?l.setTextFormat(t(l.getTextFormat())):jm(l)&&l.setFormat(t(l.getFormat()));s?o!==void 0&&(e.format=o|c):(e.setFormat(t(e.format)),xh(null))}function Rue(e,t){let n=[];for(let[e,r]of Object.entries(t))typeof r==`boolean`&&n.push([e,r]);n.length!==0&&ry(e,e=>{for(let[t,r]of n)e=vh(e,t,r?$u[t]:0);return e})}function iy(e,t,n=null){let r=n===null&&Q(e)?vh(e.format,t,null):n;ry(e,e=>vh(e,t,r))}function ay(e){let t=jh();!t.isEmpty()&&Ole(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function oy(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function sy(e,t,n,r,i){let a=r===`character`?Eg(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&t<e.length)}(o,s,n))return;let c=Eg(e,i);c.focusNode===o&&c.focusOffset===s&&e.modify(t,n,r)}function cy(e,t,n){let r=e.getNodes(),i=r.filter(e=>ag(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=Z(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function ly(e,t,n){if(Vy(e,`extend`,t,n))return!1;let r=X_(),i=vg(sg(r));if(!i||typeof i.modify!=`function`)return!1;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!Z(c)||c.isInline()||c.canBeEmpty()||_g(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&Fm(t)?Bg(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return!1;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return!1;let g=m.offset;if(My(i,h,g,h,g),sy(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return!1;let _=wg(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&hh(v)&&dh(v)===r){let e=Fh(v);if(Sm(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&Fm(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=_b(u,t?`previous`:`next`).getNodeAtCaret();if(Fm(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,`text`),e.dirty=!0,!1}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0),!1}let b=r._slotsUsed&&Oh(v),x=b?tb(u):null,S=b?tb(b):null;if(b&&!gy(S,x)&&uy(e.focus,u,x,S,`deletion`,()=>!t))return!0;let[C,w,T,ee]=t?[v,y,d,f]:[d,f,v,y],E=Tm(u)?u:lg(u);return e.applyDOMRange({collapsed:!1,endContainer:T,endOffset:ee,startContainer:C,startOffset:w}),e.dirty=!0,!cy(e,t,E)&&t&&oy(e),!1}function uy(e,t,n,r,i,a){let o=r&&function(e,t){for(let n=eb(e);n!==null;){let e=tb(n);if(gy(e,t))return e!==null||n.isAttached()?n:null;n=e&&eb(e)}return null}(r,n);if(o===null&&n===null)return!1;let s=a(),c=o&&o.getParent(),l,u;if(o===null||c===null||t!==null&&(o.is(t)||o.isParentOf(t))){let t=o||n;if(!Z(t))return t!==null&&function(e,t,n){Z(t)?e.set(t.getKey(),n?t.getChildrenSize():0,`element`):e.set(t.getKey(),n?t.getTextContentSize():0,`text`)}(e,t,s),!0;l=t,u=s?t.getChildrenSize():0}else l=c,u=o.getIndexWithinParent()+ +(s===(i===`selection`));return i===`deletion`?function(e,t,n,r){for(;;){let i=t.getChildAtIndex(r?n:n-1);if(Fm(i))return void e.set(i.getKey(),r?0:i.getTextContentSize(),`text`);if(!Z(i)||dg(i))break;t=i,n=r?0:i.getChildrenSize()}e.set(t.getKey(),n,`element`)}(e,l,u,!s):e.set(l.getKey(),u,`element`),!0}function zue(){try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var Bue=zue();function dy(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function fy(e,t,n,r){let i,a=t,o=!1;if(jg(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),Dh(e,r)!==void 0||Yg(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=Fh(d),Fm(i))a=yb(i,s?`next`:`previous`);else{let c=Fh(e);if(c===null)return null;if(Z(c)){let o=r.getElementByKey(c.getKey());o===null&&Lu(214);let l=zg(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),Z(c)||Lu(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(Z(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=Z(u)?u:u.getParentOrThrow()),a=0}Fm(u)?(i=u,c=null,a=yb(u,s?`next`:`previous`)):u!==c&&s&&!f&&(Z(c)||Lu(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=eb(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&Fh(e)===c){let n=zg(c,s,r);n.element===s?t===0&&Sm(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(Z(c))return[qv(c.__key,a,`element`),o]}}else i=Fh(e);return Fm(i)?[qv(i.__key,yb(i,a,`clamp`),`text`),o]:null}function py(e,t,n){let r=e.getNode();if(Ch(r))return;let i=e.offset===0;if(!i&&e.offset!==r.getTextContent().length)return;let a=i?`previous`:`next`,o=_b(r,a).getNodeAtCaret();if(i===t||!Z(o)||!o.isInline()||i&&n){if(i&&!t)Fm(o)&&!r.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,`text`);else if(o===null&&(n||!i&&t)){let t=r.getParent();if(Z(t)&&t.isInline()&&(i||!t.canInsertTextAfter()&&t.getTextContentSize()>1)){let n=_b(t,a).getNodeAtCaret();Fm(n)&&e.set(n.__key,i?n.getTextContent().length:0,`text`)}}}else e.set(o.__key,i?o.getChildrenSize():0,`element`)}function my(e){let t=wh(e.key);return t===null?null:tb(t)}function hy(e,t,n){let r=my(e),i=my(t);return!gy(r,i)&&uy(t,wh(e.key),r,i,`selection`,n)}function gy(e,t){return e===null?t===null:e.is(t)}function _y(e){let t=hy(e.anchor,e.focus,()=>function(e,t){let n=function(e,t){let n=new Map;for(let t=null,r=e;r!==null;t=r,r=ude(r))n.set(r.getKey(),t);for(let e=null,r=t;r!==null;e=r,r=ude(r)){let t=n.get(r.getKey());if(t===void 0)continue;let i=r.getLatest();return t===null?e===null?{commonAncestor:i,type:`same`}:{b:e,commonAncestor:i,type:`ancestor`}:e===null?{a:t,commonAncestor:i,type:`descendant`}:{a:t,b:e,commonAncestor:i,type:`branch`}}return null}(e.origin,t.origin);if(n===null)return null;switch(n.type){case`same`:return dde(e,t);case`ancestor`:return e.type===`child`&&$y(n.b)===null?-1:1;case`descendant`:return t.type===`child`&&$y(n.a)===null?1:-1;case`branch`:{let e=$y(n.a)&&n.a.getKey(),t=$y(n.b)&&n.b.getKey();if(e&&t){for(let r of rb(n.commonAncestor).values())if(r===e||r===t)return r===e?-1:1}return e?-1:t?1:n.a.isBefore(n.b)?-1:1}}}(Lm(e.anchor,`next`),Lm(e.focus,`next`))!==1);return t&&(e.dirty=!0),t}function vy(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;let r=0;for(let e=n&&n.previousSibling;e;e=e.previousSibling)r++;return r}function yy(e,t,n,r,i,a){if(e===null||n===null||!lh(i,e,n))return null;let o=fy(e,t,Q(a)?a.anchor:null,i);if(o===null)return null;let s=fy(n,r,Q(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=Fh(e),r=Fh(n);if(Sm(t)&&Sm(r))return null}let f=i._slotsUsed&&hy(c,u,()=>function(e,t,n,r){if(e===n)return r>=t;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_CONTAINED_BY?vy(e,n)>=t:i&Node.DOCUMENT_POSITION_CONTAINS?r>vy(n,e):(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0}(e,t,n,r));return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);py(e,n,r),py(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function by(e){return Z(e)&&!e.isInline()}function xy(e,t,n,r,i,a){let o=Y_(),s=new ey(qv(e,t,i),qv(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Sy(){return new ey(qv(`root`,0,`element`),qv(`root`,0,`element`),0,``)}function Cy(){return new Qv(new Set)}function wy(e,t){return Ty(null,e,t,null)}var Vue=new Set([` `,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Backspace`,`Delete`,`End`,`Enter`,`Home`,`Tab`]);function Ty(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=o===`keydown`&&a,l=c&&kg(c),u=c&&(c.ctrlKey||c.metaKey||Vue.has(c.key))&&Mg(l)&&dh(l)===n,d=!hf&&(s||u||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),f,p,m,h;if(Q(e)&&!d)return e.clone();{if(t===null)return null;let r=Eg(t,n._rootElement);if(f=r.anchorNode,p=r.focusNode,m=r.anchorOffset,h=r.focusOffset,(s||u||o===void 0)&&Q(e)&&!lh(n,f,p))return e.clone()}let g=yy(f,m,p,h,n,e);if(g===null)return null;let[_,v,y]=g,b=Q(e)?e:null,x=new ey(_,v,b?b.format:0,b?b.style:``);return b&&Ey(x,b.anchor.key),x.dirty=y,x}function Ey(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;Fm(r)?(i=r.getFormat(),a=r.getStyle()):Z(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}function $(){return Y_()._selection}function Dy(){return X_()._editorState._selection}function Oy(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function ky(e,t,n,r=1){if(Oy(e,t))for(let i of[e.anchor,e.focus]){i.key===t.__key&&(n<=i.offset&&r>0||n<i.offset&&r<0)&&i.set(t.__key,Math.max(0,i.offset+r),`element`);let e=i.getNode();if(Z(e)){let t=e.getChildrenSize(),n=i.offset>=t,r=e.getChildAtIndex(n?t-1:i.offset);Fm(r)&&i.set(r.__key,n?r.getTextContentSize():0,`text`)}}}function Ay(e,t,n,r,i){let a=r||i;if(Fm(a)||Z(a)){let t=Fm(a);e.set(a.__key,r===null?0:t?a.getTextContentSize():a.getChildrenSize(),t?`text`:`element`)}else{let r=t.getIndexWithinParent();e.set(n.__key,r===-1?n.getChildrenSize():r,`element`)}}function jy(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function My(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Ny(e,t,n){let r=Qh(e,t.getKey());if(Z(t)){let i=zg(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Hue(e,t,n,r,i,a){let o=a.getRootNode(),s=gh(o)||yg(o)?Og(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&sh(s,s))return;let c=Eg(r,a),l;if(!Q(t))return void(e!==null&&lh(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=Ny(n,f,u.offset),[g,_]=Ny(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=Fm(f)?Bg(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):Q(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=Fm(p)?Bg(p,g,n):null),x===null||S===null)return;let w=b&&Fm(p)&&Ch(p)&&hh(S)&&S.nodeValue===Xu?Xu.length:_;if(b&&(e===null||C||Q(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,u.offset,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===w&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:dh(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(My(r,x,h,S,w),Hu&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=Dg(a);if(e===null||!a.contains(e)){let e=Og(a.ownerDocument),t=e===null?null:dh(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===Dg(a)){let e=Q(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!jg(r))return r||null;let i=Dh(r,e),a=i===void 0?null:wh(i);return a===null||Z(a)?r:zg(a,r,e).element}(n,x,h):(l===void 0&&(l=Tg(r,a)),l);if(e!==null){let t;if(hh(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=jg(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!hh(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=eg(n),a=og(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom<o.top)return;if(r!==null&&t.height>0){let{left:e,right:i}=t,o=jg(r)?r:$h(r);for(;o!==null&&n.contains(o);){let t=Ble(a,o,e,i);e-=t,i-=t,o=o===n?null:$h(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=sg(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(s<l?r=-(l-s):c>u&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=$h(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,w)}function Py(e){let t=$()||Dy();t===null&&(t=jh().selectEnd()),t.insertNodes(e)}function Fy(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
|
||
`||n===`\r
|
||
`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function Iy(e){let t=[];return Fy(e,{linebreak:()=>t.push(T_()),tab:()=>t.push(th()),text:e=>t.push(Pm(e))}),t}function Uue(){let e=$();return e===null?``:e.getTextContent()}function Ly(e){let t=[];for(let n of e)E_(n)||(!Z(n)&&!Sm(n)||n.isInline()?t.push(n):Z(n)&&t.push(...Ly(n.getChildren())));return t}function Ry(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=$();Q(r)&&(n=r),Q(n)||Lu(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!Ig(a)&&$y(a)===null;){let e=a;if([a,o]=Wue(a,o,t),e.is(a))break}return[a,o]}function Wue(e,t,n=!1){let r=e.getParent();if(!r){let e=Qm();return jh().append(e),e.select(),[jh(),0]}if(Fm(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!Z(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new ey(qv(e.__key,t,`element`),qv(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function zy(e){return E_(e)||cg(e)||Fm(e)||e.isParentRequired()}function By(e){let t=Qm(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(zy(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(E_(i)&&(a===void 0||!zy(a)))continue}n.append(i)}else t.append(i),n=null}return t}function Vy(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=Lm(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`,u=!1;if(!Gm(c)){for(let e of c){l=!1;let{origin:t}=e;if(Sm(t)){if(t.isIsolated()){u=!0;break}if(c=e,o&&t.isInline())continue}break}if(u)return!0;if(l)for(let e of Cb(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(gb(e))e.origin.isInline()||(c=e);else{if(Z(e.origin))continue;Sm(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&Sm(c.origin)&&c.origin.isKeyboardSelectable()){let e=Cy();return e.add(c.origin.getKey()),Nh(e),!0}return c=Wm(c),s&&Rm(e.anchor,c),Rm(e.focus,c),l||!o}function Hy(e,t,n){let r=t===null?null:t.__key,i=n===null?null:n.__key;t===null?e.__first=i:t.__next=i,n===null?e.__last=r:n.__prev=r}function Uy(e){let t=X_();if(!t._recordNodeMoves)return;let n=t._editorState._nodeMap;if(n.has(e.__key)){let t=Y_(),r=t._movedNodes||=new WeakMap,i=r.get(n);i===void 0&&(i=new Set,r.set(n,i)),i.add(e.__key)}}function Wy(e,t,n,r){let i=t.__key;n===null?e.__first=i:n.__next=i,r===null?e.__last=i:r.__prev=i,t.__prev=n===null?null:n.__key,t.__next=r===null?null:r.__key,t.__parent=e.__key}function Gy(e){$y(e)!==null&&Lu(380,e.__key,String($y(e)));let t=e.getParent();if(t!==null){let n=t.getWritable();Uy(e);let r=e.getPreviousSibling(),i=e.getNextSibling();Hy(n,r&&r.getWritable(),i&&i.getWritable()),e.__prev=null,e.__next=null,e.__parent=null,n.__size--}}function Ky(e,t){let n=t&&e.getParent(),r=t&&n&&Oy(t,n)?e.getIndexWithinParent():-1,i=t&&n&&r!==-1?[t.anchor,t.focus].filter(e=>e.type===`element`&&e.key===n.__key&&e.offset===r+1):null;return t&&n&&r!==-1&&t.isBackward(),Gy(e),t&&n&&r!==-1&&ky(t,n,r,-1),t&&(t._cachedIsBackward=null),i}function qy(e,t,n,r){q_();let i=t===`next`;mg(e,n);let a=e.getWritable(),o=n.getWritable();e.getParentOrThrow();let s=$(),c=r&&Q(s)?s:null,l=Ky(o,c),u=e.getParentOrThrow().getWritable(),d=c&&(i&&l!==null&&l.length>0||Oy(c,u))?e.getIndexWithinParent()+ +!!i:-1,f=i?e.getNextSibling():e.getPreviousSibling(),p=f&&f.getWritable();if(Wy(u,o,i?a:p,i?p:a),u.__size++,c&&d!==-1&&(ky(c,u,d),i&&l!==null))for(let e of l)e.set(u.__key,d+1,`element`);return n}function Jy(e,t,n){q_();let{origin:r,direction:i}=e,a=i===`next`,o=eb(r);if(o!==null)return a?o.selectNext(t,n):o.selectPrevious(t,n);let s=e.getNodeAtCaret(),c=r.getParentOrThrow();if(s===null)return a?c.select():c.select(0,0);if(Z(s))return a?s.select(0,0):s.select();if(Fm(s))return s.select(t,n);let l=s.getIndexWithinParent()+ +!a;return c.select(l,l)}function Yy(e,t){let n=[];for(let r=e;r!==null;r=t===`next`?r.getNextSibling():r.getPreviousSibling())n.push(r);return n}var Xy=new Map;function Zy(e){return Z(e)||Sm(e)}function Qy(e){return Z(e)||Sm(e)}function $y(e){let t=e.getLatest();return Qy(t)?t.__slotHost:null}function eb(e){let t=$y(e);if(t===null)return null;let n=wh(t);return Z(n)||Sm(n)||Lu(370),n}function Gue(e){let t=eb(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of rb(t))if(r===n)return e;return null}function tb(e){let t=e.getLatest();for(;t!==null;){if($y(t)!==null)return t;t=t.getParent()}return null}function nb(e){if(e===null)return null;let t=Q(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:tb(t)}function rb(e){let t=e.getLatest();return Zy(t)&&t.__slots!==null?t.__slots:Xy}function ib(e){return Array.from(rb(e).keys())}function ab(e,t){let n=rb(e).get(t);return n===void 0?null:wh(n)}var Kue=[`__proto__`,`constructor`,`prototype`],ob=Symbol(`slotMapOwner`);function sb(e){let t=e.__slots;return t!==null&&t[ob]===e||(t=new Map(t),t[ob]=e,e.__slots=t),t}var que=new WeakMap,Jue=[];function Yue(e){for(let{ownNodeConfig:t}of m_(e)){let e=t&&t.slots;if(e)return e}return Jue}function Xue(e){let t=``;for(let n of rb(e).values()){let e=wh(n);e!==null&&(t+=e.getTextContent())}return t}function Zue(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function Que(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||Lu(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!Z(n)&&!Sm(n)||n.isInline())&&Lu(374,n.__key);let i=e.getWritable(),a=sb(i),o=a.get(t);o!==void 0&&$ue(o);let s=n.getWritable(),c=eb(s);if(c!==null){let e=Gue(s);e!==null&&sb(c.getWritable()).delete(e),s.__slotHost=null}return Gy(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=que.get(e);if(t===void 0){let n=Yue(e),r=new Map;for(let t of n)Kue.includes(t)&&Lu(371,e.name,t),r.has(t)&&Lu(372,e.name,t),r.set(t,r.size);t=r,que.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&Zue(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>Zue(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),X_()._slotsUsed=!0,Y_()._slotsUsed=!0,i}function $ue(e){let t=wh(e);if(t===null)return;let n=t.getWritable();Qy(n)||Lu(377,e),n.__slotHost=null,n.remove()}var ede={next:`previous`,previous:`next`},cb=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Eb({hasNext:hb,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return _b(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return _b(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&Lu(263,Array.from(o).join(` `))}else i.insert(e);i=_b(e,this.direction)}for(let e of o.values())e.remove();return this}},lb=class e extends cb{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:bb(e,this.direction)}getParentCaret(e=`root`){return _b(db(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ub(this.direction);return _b(this.getNodeAtCaret(),e)||bb(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},tde={root:Tm,shadowRoot:dg};function ub(e){return ede[e]}function db(e,t=`root`){return e===null||tde[t](e)?null:$y(e)===null?e:null}var fb=class e extends cb{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:_b(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Z(this.origin)?bb(this.origin,this.direction):null}getParentCaret(e=`root`){return _b(db(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ub(this.direction);return _b(this.getNodeAtCaret(),e)||bb(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof pb)&&this.direction===t.direction&&this.origin.is(t.origin)}},pb=class e extends cb{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:vb(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return _b(db(this.getParentAtCaret(),e),this.direction)}getFlipped(){return vb(this.origin,ub(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof fb||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return _b(this.origin,this.direction)}};function mb(e){return e instanceof pb}function hb(e){return e instanceof fb}function gb(e){return e instanceof lb}var nde={next:class extends pb{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends pb{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},rde={next:class extends fb{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends fb{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},ide={next:class extends lb{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends lb{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function _b(e,t){return e?new rde[t](e):null}function vb(e,t,n){return e?new nde[t](e,yb(e,n)):null}function yb(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Ru(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function ade(e,t){return new cde(e,t)}function bb(e,t){return Z(e)?new ide[t](e):null}function ode(e){return e&&e.getChildCaret()||e}function xb(e){return e&&ode(e.getAdjacentCaret())}var sde=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return mb(e)&&mb(t)&&e.isSameNodeCaret(t)?[ade(e,t.offset-e.offset),null]:[mb(e)?lde(e,`anchor`):null,mb(t)?lde(t,`focus`):null]}iterNodeCarets(e=`root`){let t=mb(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=mb(n),i=t=>t.isSameNodeCaret(n)?null:xb(t)||t.getParentCaret(e);return Eb({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},cde=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return vb(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function lde(e,t){let{direction:n,origin:r}=e;return ade(e,yb(r,t===`focus`?ub(n):n)-e.offset)}function Sb(e,t){return e.direction===t?e:e.getFlipped()}function Cb(e){return Tb(e,Sb(bb(jh(),ub(e.direction)),e.direction))}function wb(e){return Tb(e,e)}function Tb(e,t){return e.direction!==t.direction&&Lu(265),new sde(e,t,e.direction)}function Eb(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function Db(e,t){let n=kb(e.origin,t.origin);switch(n===null&&Lu(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:return dde(e,t);case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return fde(n)}}function ude(e){return e.getParent()||eb(e)}function dde(e,t){let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}function fde(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function Ob(e,t){return t.is(e)}function pde(e){return Z(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function kb(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=pde(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=pde(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(Ob(e,r)||Lu(276),{commonAncestor:r,type:`ancestor`}):i===null?(Ob(t,r)||Lu(277),{commonAncestor:r,type:`descendant`}):((Z(a)||Ob(e,a))&&(Z(i)||Ob(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||Lu(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function mde(e){return e}function hde(...e){return e}function Ab(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function jb(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function Mb(e,...t){let n=jb(...t);n.length>0&&e.classList.add(...n)}function Nb(e,...t){let n=jb(...t);n.length>0&&e.classList.remove(...n)}function gde(e,t,n){let r=e.getElementByKey(t.getKey());if(r===null||Fm(t))return[_h(r),n];let i=r.parentNode;return i&&r.nodeName===`BR`?[i,Array.from(i.childNodes).indexOf(r)]:e.read(`latest`,()=>Ny(e,t,n))}function _de(e,t,n,r,i){let a=Sg(e.getRootElement()).createRange(),[o,s]=gde(e,t,n),[c,l]=gde(e,r,i),u=l;if(o===null||c===null)return null;let d=o.firstChild;o===c&&d!=null&&d.nodeName===`BR`&&s===0&&u===0&&(u=1);try{a.setStart(o,s),a.setEnd(c,u)}catch{return null}return!a.collapsed||s===u&&t.is(r)||(a.setStart(c,u),a.setEnd(o,s)),a}function vde(e){let t=Lg().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function yde(e){let t=Tm(e)?e:e.getParent();return t&&vde(t)}function Pb(e){let t=yde(e);return t!==null&&t.direction===`rtl`}function bde(e,t,n=`self`){let r=e.getStartEndPoints();if(r!==null&&t.isSelected(e)&&!mh(t)){let[i,a]=e.isBackward()?[r[1],r[0]]:r,o=!Q(e)||i.type!==`element`&&a.type!==`element`?void 0:Ym(Vm(e).getTextSlices(),t),[s,c]=o?o.getSliceIndices():[t.__key===i.key?i.offset:0,t.__key===a.key?a.offset:void 0],l=t.__text.slice(s,c);l!==t.__text&&(n===`clone`&&(t=Zle(t)),t.__text=l)}return t}function xde(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function Fb(e,t,n){let r=Lm(e,n);if(Gm(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function Sde(e,t,n=xde){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=g_(t.getNode(),Ig);a=g_(n.getNode(),Ig);let c=e.isBackward()?`previous`:`next`;i=Z(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!Z(r)||!r.isEmpty())&&Fb(e,t,n)}(n,a,ub(c)),Z(s)&&o.set(s.getKey(),s),Z(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if(Z(t)&&Ig(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=g_(t,Ig);Z(e)&&o.set(e.getKey(),e)}for(let e of o.values()){if(eb(e)!==null)continue;let r=t();n(e,r),e.replace(r,!0)}}function Cde(e){let t=wde(e);return t!==null&&t.writingMode===`vertical-rl`}function wde(e){let t=e.anchor.getNode();return Z(t)?vde(t):yde(t)}function Tde(e,t){let n=Cde(e)?!t:t;Dde(e)&&(n=!n);let r=Lm(e.focus,n?`previous`:`next`);if(Gm(r))return!1;if(mb(r)&&!nh(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(Fm(e)&&!nh(e))return!0}for(let e of Cb(r)){if(gb(e))return!e.origin.isInline();if(!Z(e.origin)){if(Sm(e.origin))return!0;break}}return!1}function Ede(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function Dde(e){let t=wde(e);return t!==null&&t.direction===`rtl`}function Ode(e,t,n){let r=Dde(e),i;i=Cde(e)||r?!n:n,Ede(e,t,i,`character`)}function kde(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Ade(e,t){return Array.from(jde(e,t))}function jde(e,t){return Nde(`next`,e,t)}function Mde(e,t){let n=Jm(_b(e,t));return n&&n[0]}function Nde(e,t,n){let r=jh(),i=t||r,a=Z(i)?bb(i,e):_b(i,e),o=Pde(i),s=n?xb(ode(_b(n,e)))||Mde(n,e):Mde(i,e),c=o;return Eb({hasNext:e=>e!==null,initial:a,map:e=>({depth:c,node:e.origin}),step:e=>{if(e.isSameNodeCaret(s))return null;gb(e)&&c++;let t=Jm(e);return!t||t[0].isSameNodeCaret(s)?null:(c+=t[1],t[0])}})}function Pde(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??eb(n))t++;return t}function Ib(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function Fde(e){let t=g_(e,e=>Z(e)&&!e.isInline());return Z(t)||kde(4,e.__key),t}function Lb(e){let t=$()||Dy(),n;if(Q(t))n=Lm(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=_b(r,`next`))}n||=bb(jh(),`previous`).getFlipped().insert(Qm())}let r=Xm(e,n,Gm(i=n)||Jm(mb(i)?i.getSiblingCaret():i,`shadowRoot`)!==null?{$shouldSplit:(e,t)=>t!==`last`}:void 0);var i;let a=xb(r);return zm(wb(gb(a)?Wm(a):r)),e.getLatest()}function Rb(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function zb(e){let t=null;if(Rb(e,DragEvent)?t=e.dataTransfer:Rb(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function Ide(e){let t=$();if(!Q(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=g_(i,e=>Z(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function Lde(e,t){bb(e,`next`).insert(t)}function Rde(e,t){return zde(e,t,null)}function zde(e,t,n){let r=!1;for(let i of Bde(e))t(i)?n!==null&&n(i):(r=!0,Z(i)&&zde(i,t,n||(e=>i.insertAfter(e))),i.remove());return r}function Bb(e,t){let n=[],r=Array.from(e).reverse();for(let e=r.pop();e!==void 0;e=r.pop())if(t(e))n.push(e);else if(Z(e))for(let t of Bde(e))r.push(t);return n}function Bde(e){return Vde(bb(e,`previous`))}function Vde(e){return Eb({hasNext:hb,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function Hde(e){Hm(_b(e,`next`)).splice(1,e.getChildren())}function Ude(e,t){let n=$();if(Q(n)&&n.isCollapsed()){let r=g_(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getFirstChild()===r&&Gde(n.anchor,r))return r.insertBefore(Qm()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function Wde(e,t){let n=$();if(Q(n)&&n.isCollapsed()){let r=g_(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getLastChild()===r&&Kde(n.anchor,r))return r.insertAfter(Qm()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function Gde(e,t){return Fb(e,t,`previous`)}function Kde(e,t){return Fb(e,t,`next`)}function qde(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var Jde={tag:`history-merge`};function Yde(){let e=jh();e.isEmpty()&&e.append(Qm())}var Xde={config:{setOptions:Jde,updateOptions:Jde},init:({$initialEditorState:e=Yde})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(uue(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[wm,Mm,w_,eh,Zm]};function Vb(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Zde(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var Qde=Zde(),$de=new Set([`__proto__`,`constructor`,`prototype`]);function efe(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!$de.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=efe(n[e],r[e]));return e}return t}function Hb(e){return e.id===0}function tfe(e){return e.id===2}var nfe=new Set,rfe=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Ab;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;tfe(t)||Vb(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&Vb(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&Vb(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&Vb(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&Vb(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&Vb(311),this._signal}getInitResult(){this.extension.init===void 0&&Vb(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||Vb(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||Vb(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Vb(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Vb(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||Vb(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||nfe}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||Vb(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},ife=Symbol.for(`@lexical/extension/LexicalBuilder`);function afe(...e){return cfe.fromExtensions(e).buildEditor()}function ofe(){}function sfe(e){throw e}function Ub(e){return Array.isArray(e)?e:[e]}var Wb=Qde,cfe=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Wb,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[Ub(Xde)];for(let e of t)n.push(Ub(e));return new e(n)}static maybeFromEditor(t){let n=t[ife];return n&&(n.PACKAGE_VERSION!==Wb&&Vb(292,n.PACKAGE_VERSION,Wb),n instanceof e||Vb(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Vb(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(M_({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[ife]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=ofe;function t(){try{e()}finally{e=ofe}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=pv(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Vb(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Vb(296);let[t]=Ub(e);typeof t.name!=`string`&&Vb(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Vb(298,t.name),!n){n=new rfe(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Vb(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Vb(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=Ub(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(tfe(i))return;let a=n.extension.name;var o;Hb(i)||Vb(300,a,r||`[unknown]`),Hb(o=i)||Vb(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||Vb(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Hb(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Vb(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return pv(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of qde(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Vb(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&efe(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=sfe,e}};function Gb(e,t){let n=cfe.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}var lfe=Symbol.for(`preact-signals`);function Kb(){if(Zb>1)Zb--;else{var e,t=!1;for((function(){var e=ex;for(ex=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();Xb!==void 0;){var n=Xb;for(Xb=void 0,Qb++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&pfe(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Qb=0,Zb--,t)throw e}}function ufe(e){if(Zb>0)return e();$b=++dfe,Zb++;try{return e()}finally{Kb()}}var qb,Jb=void 0;function Yb(e){var t=Jb,n=qb;Jb=void 0,qb=void 0;try{return e()}finally{Jb=t,qb=n}}var Xb=void 0,Zb=0,Qb=0,dfe=0,$b=0,ex=void 0,tx=0;function ffe(e){if(Jb!==void 0){var t=e.n;if(t===void 0||t.t!==Jb)return t={i:0,S:e,p:Jb.s,n:void 0,t:Jb,e:void 0,x:void 0,r:t},Jb.s!==void 0&&(Jb.s.n=t),Jb.s=t,e.n=t,32&Jb.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Jb.s,t.n=void 0,Jb.s.n=t,Jb.s=t),t}}function nx(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}nx.prototype.brand=lfe,nx.prototype.h=function(){return!0},nx.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?Yb(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},nx.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Yb(function(){var e;(e=t.Z)==null||e.call(t)}))}},nx.prototype.subscribe=function(e){var t=this;return sx(function(){var n=t.value;Yb(function(){return e(n)})},{name:`sub`})},nx.prototype.valueOf=function(){return this.value},nx.prototype.toString=function(){return this.value+``},nx.prototype.toJSON=function(){return this.value},nx.prototype.peek=function(){var e=this;return Yb(function(){return e.value})},Object.defineProperty(nx.prototype,"value",{get:function(){var e=ffe(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Qb>100)throw Error(`Cycle detected`);(function(e){Zb!==0&&Qb===0&&e.l!==$b&&(e.l=$b,ex={S:e,v:e.v,i:e.i,o:ex})})(this),this.v=e,this.i++,tx++,Zb++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Kb()}}}});function rx(e,t){return new nx(e,t)}function pfe(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function mfe(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function hfe(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function ix(e,t){nx.call(this,void 0,t),this.x=e,this.s=void 0,this.g=tx-1,this.f=4}ix.prototype=new nx,ix.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===tx))return!0;if(this.g=tx,this.f|=1,this.i>0&&!pfe(this))return this.f&=-2,!0;var e=Jb;try{mfe(this),Jb=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Jb=e,hfe(this),this.f&=-2,!0},ix.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}nx.prototype.S.call(this,e)},ix.prototype.U=function(e){if(this.t!==void 0&&(nx.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},ix.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(ix.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=ffe(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function gfe(e,t){return new ix(e,t)}function _fe(e){var t=e.j;if(e.j=void 0,typeof t==`function`){Zb++;var n=Jb;Jb=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,ax(e),t}finally{Jb=n,Kb()}}}function ax(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,_fe(e)}function vfe(e){if(Jb!==this)throw Error(`Out-of-order effect`);hfe(this),Jb=e,this.f&=-2;try{8&this.f&&ax(this)}finally{Kb()}}function ox(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,qb&&qb.push(this)}ox.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.j=t)}finally{e()}},ox.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,_fe(this),mfe(this),Zb++;var e=Jb;return Jb=this,vfe.bind(this,e)},ox.prototype.N=function(){2&this.f||(this.f|=2,this.u=Xb,Xb=this)},ox.prototype.d=function(){this.f|=8,1&this.f||ax(this)},ox.prototype.dispose=function(){this.d()};function sx(e,t){var n=new ox(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function cx(e,t){let n;return rx(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var lx={build:e=>cx(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`},yfe=new Set,bfe={build(e,t,n){let r=n.getDependency(lx).output,i=rx({watchedNodeKeys:new Map}),a=cx(()=>{},()=>sx(()=>{let e=a.peek(),{watchedNodeKeys:t}=i.value,n,o=!1;r.value.read(()=>{if($())for(let[r,i]of t.entries()){if(i.size===0){t.delete(r);continue}let a=wh(r),s=a&&a.isSelected()||!1;o||=s!==(!!e&&e.has(r)),s&&(n||=new Set,n.add(r))}}),!o&&n&&e&&n.size===e.size||(a.value=n)}));return{watchNodeKey:function(e){let t=gfe(()=>(a.value||yfe).has(e)),{watchedNodeKeys:n}=i.peek(),r=n.get(e),o=r!==void 0;return r||=new Set,r.add(t),o||(n.set(e,r),i.value={watchedNodeKeys:n}),t}}},dependencies:[lx],name:`@lexical/extension/NodeSelection`},xfe=rd(`INSERT_HORIZONTAL_RULE_COMMAND`),ux=class extends xm{$config(){return this.config(`horizontalrule`,{extends:xm,importDOM:{hr:()=>({conversion:Sfe,priority:0})}})}exportDOM(){return{element:Cg().createElement(`hr`)}}createDOM(e){let t=Cg().createElement(`hr`);return Mb(t,e.theme.hr),t}getTextContent(){return`
|
||
`}isInline(){return!1}updateDOM(){return!1}};function Sfe(){return{node:dx()}}function dx(){return h_(ux)}function fx(e){return e instanceof ux}var Cfe={dependencies:[lx,bfe],name:`@lexical/extension/HorizontalRule`,nodes:()=>[ux],register(e,t,n){let{watchNodeKey:r}=n.getDependency(bfe).output,i=rx({nodeSelections:new Map}),a=e._config.theme.hrSelected??`selected`;return pv(e.registerCommand(xfe,e=>{let t=$();return Q(t)?(t.focus.getNode()!==null&&Lb(dx()),!0):!1},0),e.registerCommand(od,e=>{if(Mg(e.target)){let t=Th(e.target);if(fx(t))return function(e,t=!1){let n=$(),r=e.isSelected(),i=e.getKey(),a;t&&ty(n)?a=n:(a=Cy(),Nh(a)),r?a.delete(i):a.add(i)}(t,e.shiftKey),!0}return!1},1),e.registerMutationListener(ux,(t,n)=>{ufe(()=>{let n=!1,{nodeSelections:a}=i.peek();for(let[i,o]of t.entries())if(o===`destroyed`)a.delete(i),n=!0;else{let t=a.get(i),o=e.getElementByKey(i);t?t.domNode.value=o:(n=!0,a.set(i,{domNode:rx(o),selectedSignal:r(i)}))}n&&(i.value={nodeSelections:a})})}),sx(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of i.value.nodeSelections.values())e.push(sx(()=>{let e=t.value;e&&(n.value?Mb(e,a):Nb(e,a))}));return pv(...e)}))}};function wfe(e){return Gb(Lg(),e)}function px(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Tfe=(e,t,n)=>{mx(e),n()};function mx(e){if(!gh(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(let e of Array.from(t.styleSheets)){let n;try{n=e.cssRules}catch{continue}for(let e of Array.from(n)){if(!Rb(e,CSSStyleRule))continue;let n;try{n=t.querySelectorAll(e.selectorText)}catch{continue}for(let t of Array.from(n)){if(!jg(t))continue;let n=r(t);for(let r=0;r<e.style.length;r++){let i=e.style[r];n.has(i)||t.style.setProperty(i,e.style.getPropertyValue(i),e.style.getPropertyPriority(i))}}}}}catch{}}var hx;function gx(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function _x(e){return hx&&hx.editor===e?hx:void 0}function vx(e,t){let n=_x(t);return n&&n[e]}function Efe(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(gx(e,n))]}return t}function yx(e,t){let n=t;for(let r of e){let[e,i]=Efe(n,r),a=e.key;if(n===t&&gx(n,e)===i)continue;let o=n===t||n===void 0?Dfe(t):n;o[a]=i,n=o}return n}function Dfe(e){return Object.create(e||null)}function bx(e,t){return[e,t]}function xx(e,t,n,r=Lg()){let i=hx,a=_x(r);try{return hx={...a,editor:r,[e]:t},n()}finally{hx=i}}function Sx(e,t=()=>{}){return(n,r=Lg())=>i=>{let a=_x(r),o=a&&a[e],s=yx(n,o||t(r));return s&&s!==o?xx(e,s,i,r):i()}}function Ofe(e,t,n,r){return Object.assign(Yf(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var kfe=`@lexical/html/DOM`,Afe=Symbol.for(`@lexical/html/DOMExportContext`),Cx=`@lexical/html/DOMImport`,wx=Symbol.for(`@lexical/html/DOMImportContext`);function jfe(e,t,n){return Ofe(Afe,e,t,n)}var Mfe=jfe(`isExport`,Boolean);function Nfe(e){let t=Gb(e,kfe);return t?t.output.defaults:void 0}function Pfe(e){let t=Gb(e,kfe);return t?t.output.runtime:void 0}function Ffe(e=Lg()){let t=Pfe(e);return t?t.getSessionConfig():Rg(e)}var Ife=Sx(Afe,Nfe),Tx=Symbol.for(`@lexical/html/SelectorImpl`);function Ex(e,t){let n={kind:`element`,predicate:(r=t,r.length===0?jg:r.length===1?r[0]:(e,t)=>{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>Ex(e,[...t,n]);return{[Tx]:n,attr:(e,t,n)=>i(kx(e,t,n)),classAll:(...e)=>i(Ox(e)),classAny:(...e)=>i(function(e){let t=Dx(e);return t.length===0?()=>!1:e=>{if(!jg(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>jg(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!jg(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}px(362,JSON.stringify(e))}(e,t,n))}}function Dx(e){let t=[];for(let n of e)n&&t.push(n);return t}function Ox(e){let t=Dx(e);return t.length===0?()=>!0:e=>{if(!jg(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function kx(e,t,n){if(!0===t)return t=>jg(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>jg(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!jg(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}px(361,JSON.stringify(e))}function Ax(e){return{[Tx]:e}}var Lfe=Ax({kind:`text`,predicate:hh,tags:new Set}),Rfe=Ax({kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set});function jx(){return Ex(new Set,[])}function Mx(){return Rfe}function Nx(...e){e.length>0||px(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return Ex(t,[])}function Px(){return Lfe}var Fx={any:jx,comment:Mx,tag:Nx,text:Px},Ix=/[A-Za-z0-9_-]/,zfe=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&Ix.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||px(364,String(this.pos+1),t,this.source)}};function Bfe(e){let t=new Set,n=[],r=[],i=!1;if(e.skipWhitespace(),e.peek()===`*`)e.consume(),i=!0;else if(Ix.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(kx(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(kx(t,r))}}}return r.length>0&&n.push(Ox(r)),e.assert(i||t.size>0||n.length>0,`expected a selector`),{predicates:n,tags:t}}function Vfe(e){let t=new zfe(e,0),n=[];for(;n.push(Bfe(t)),t.skipWhitespace(),!t.eof();)t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace();if(n.length===1)return Ex(n[0].tags,n[0].predicates);let r=new Set;if(n.every(e=>e.tags.size>0))for(let e of n)for(let t of e.tags)r.add(t);return Ex(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}function Lx(e,t,n){return Ofe(wx,e,t,n)}var Rx=Lx(`textFormat`,()=>0),zx=Lx(`textStyle`,()=>({}));function Hfe(e){if(!jg(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Ufe(e){if(hh(e))return!0;if(!jg(e))return!1;let t=e.style.display;return t?t.startsWith(`inline`):!Fg(e)&&Pg(e)}var Wfe=Lx(`whitespaceConfig`,()=>({isInline:Ufe,preservesWhitespace:Hfe})),Bx=Lx(`importOverlays`,()=>[]),Gfe=class{constructor(e){this.record=e}get(e){return gx(this.record,e)}set(e,t){this.record[e.key]=t}update(e,t){this.record[e.key]=t(gx(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}};function Vx(e){let t=Gb(e,Cx);return t?t.output.defaults:void 0}function Kfe(e,t=Lg()){return gx(function(e){return vx(wx,e)||Vx(e)}(t),e)}var Hx=Sx(wx,Vx);function Ux(e){return by(e)||Sm(e)&&!e.isInline()}function Wx(e,t){if(!jg(t))return e;let n=t.style.textAlign;if(!qx(n))return e;for(let t of e)by(t)&&t.getFormatType()===``&&t.setFormat(n);return e}function Gx(e,t,n){e.length===1&&E_(e[0])&&(e=[]);let r=Qm();if(jg(n)){let e=n.style.textAlign;qx(e)&&r.setFormat(e)}return[r.splice(0,0,e)]}var qfe={$accepts:Ux,$packageRun:Gx,name:`BlockSchema`},Jfe={$accepts:Ux,$packageRun:Gx,name:`RootSchema`},Kx=Fx,Yfe=new Set([`center`,`end`,`justify`,`left`,`right`,`start`]);function qx(e){return Yfe.has(e)}var Xfe={B:{fontWeight:`bold`},EM:{fontStyle:`italic`},I:{fontStyle:`italic`},S:{textDecoration:`line-through`},STRONG:{fontWeight:`bold`},SUB:{verticalAlign:`sub`},SUP:{verticalAlign:`super`},U:{textDecoration:`underline`}},Zfe={CODE:16,MARK:128},Qfe=new Set([`font-weight`,`font-style`,`text-decoration`,`text-transform`,`vertical-align`]),$fe={$import:(e,t)=>{let n=e.get(Rx),r=Xfe[t.nodeName],i=function(e){return{fontStyle:e.style.fontStyle,fontWeight:e.style.fontWeight,textDecoration:e.style.textDecoration,textTransform:e.style.textTransform,verticalAlign:e.style.verticalAlign}}(t);var a,o;let s=n&~(c=function(e){let t=0,n=0,{fontWeight:r,fontStyle:i,textDecoration:a,textTransform:o,verticalAlign:s}=e;if(r===`700`||r===`bold`?t|=1:r!==`normal`&&r!==`400`||(n|=1),i===`italic`?t|=2:i===`normal`&&(n|=2),a){let e=a.split(` `);e.includes(`underline`)&&(t|=8),e.includes(`line-through`)&&(t|=4),e.includes(`none`)&&(n|=12)}return o===`lowercase`?(t|=$u.lowercase,n|=$u.uppercase|$u.capitalize):o===`uppercase`?(t|=$u.uppercase,n|=$u.lowercase|$u.capitalize):o===`capitalize`?(t|=$u.capitalize,n|=$u.lowercase|$u.uppercase):o===`none`&&(n|=$u.lowercase|$u.uppercase|$u.capitalize),s===`sub`?(t|=32,n|=64):s===`super`?(t|=64,n|=32):s===`baseline`&&(n|=96),{clear:n,set:t}}(r?(a=r,{fontStyle:(o=i).fontStyle||a.fontStyle,fontWeight:o.fontWeight||a.fontWeight,textDecoration:o.textDecoration||a.textDecoration,textTransform:o.textTransform||a.textTransform,verticalAlign:o.verticalAlign||a.verticalAlign}):i)).clear|c.set;var c;let l=Zfe[t.nodeName];return l&&(s|=l),s===n?e.$importChildren(t):e.$importChildren(t,{context:[bx(Rx,s)]})},match:Kx.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),name:`@lexical/html/inline-format`};function Jx(e,t,n){let r=e;for(;;){let e=null;for(;(e=t?r.nextSibling:r.previousSibling)===null;){let e=r.parentNode;if(e===null)return null;r=e}if(r=e,!n.isInline(r))return null;let i=r;for(;(i=t?r.firstChild:r.lastChild)!==null;)r=i;if(hh(r))return r;if(r.nodeName===`BR`)return null}}function Yx(e,t){return t!==0&&Fm(e)?e.setFormat(t):e}function Xx(e,t){if(Fm(e)){let n=function(e){let t=``;for(let n in e)Qfe.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);n!==``&&e.setStyle(n)}return e}var epe={$import:(e,t)=>{let n=e.get(Rx),r=e.get(zx),i=e.get(Wfe);if(function(e,t){let n=e.parentNode;for(;n!==null;){if(t.preservesWhitespace(n))return!0;n=n.parentNode}return!1}(t,i)){let e=Iy(t.textContent||``);for(let t of e)Yx(t,n),Xx(t,r);return e}let a=function(e,t){let n=(e.textContent||``).replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(n.length===0)return``;if(n[0]===` `){let r=e,i=!0;for(;r!==null&&(r=Jx(r,!1,t))!==null;){let e=r.textContent||``;if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n.length>0&&n[n.length-1]===` `){let r=e,i=!0;for(;r!==null&&(r=Jx(r,!0,t))!==null;)if((r.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){i=!1;break}i&&(n=n.slice(0,-1))}return n}(t,i);if(a===``)return[];let o=Pm(a);return Yx(o,n),Xx(o,r),[o]},match:Kx.text(),name:`@lexical/html/#text`},tpe={$import:()=>[],match:Kx.tag(`script`,`style`),name:`@lexical/html/script-style-ignore`},npe={$import:(e,t)=>D_(t)||O_(t)?[]:[T_()],match:Kx.tag(`br`),name:`@lexical/html/br`},rpe=[tpe,{$import:(e,t)=>{let n=Qm();if(Kg(n,t),Wg(t,n),n.getFormatType()===``){let e=t.getAttribute(`align`);e&&qx(e)&&n.setFormat(e)}return Gg(n,t),[n.splice(0,0,e.$importChildren(t))]},match:Kx.tag(`p`),name:`@lexical/html/p`},{$import:(e,t,n)=>Lg().hasNode(ux)?[dx()]:n(),match:Kx.tag(`hr`),name:`@lexical/html/hr`},{$import:(e,t,n)=>Fg(t)?Wx(e.$importChildren(t,{schema:qfe}),t):n(),match:Kx.any(),name:`@lexical/html/transparent-block`},epe,npe,$fe];function ipe(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;)e[r]<=t[i]?n.push(e[r++]):n.push(t[i++]);for(;r<e.length;)n.push(e[r++]);for(;i<t.length;)n.push(t[i++]);return n}function Zx(e){let t=[],n=new Map,r=[],i=[],a=[],o=new Set;e.forEach((e,s)=>{let c=function(e){let t=e[Tx];return t===void 0&&px(360),t}(e.match),l=e.name||function(e,t){return e.kind===`text`?`#text@${t}`:e.kind===`comment`?`#comment@${t}`:e.tags.size===0?`*@${t}`:`${Array.from(e.tags).join(`,`).toLowerCase()}@${t}`}(c,s);if(e.name&&o.add(e.name),t.push({$import:e.$import,name:l,predicate:c.predicate}),c.kind===`text`)i.push(s);else if(c.kind===`comment`)a.push(s);else if(c.tags.size===0)r.push(s);else for(let e of c.tags){let t=n.get(e);t||(t=[],n.set(e,t)),t.push(s)}});let s=new Map;if(r.length===0)for(let[e,t]of n)s.set(e,t);else for(let[e,t]of n)s.set(e,ipe(t,r));return{byTag:s,commentIndices:a,rules:t,textIndices:i,wildcardIndices:r}}function Qx(e,t){return hh(t)?e.textIndices:t.nodeType===8?e.commentIndices:jg(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:ape}var ape=Object.freeze([]);function $x(e){let t=[];for(let n of e)if(ope(n))for(let e of n.rules)t.push(e);else t.push(n);return t}function ope(e){return typeof e==`object`&&!!e&&`__type`in e&&e.__type===`CompiledOverlayRules`}function spe(e){let t=$x(e);return{__type:`CompiledOverlayRules`,dispatch:Zx(t),rules:t}}var cpe=Object.freeze({});function lpe(e,t){return{$importChildren:(t,n)=>function(e,t,n){let r=n&&n.rules?n.rules.dispatch:void 0;r&&e.overlays.push(r);try{let r=()=>upe(e,t,n);return n&&n.context?Hx(n.context,e.editor)(r):r()}finally{r&&e.overlays.pop()}}(e,t,n),$importOne:(t,n)=>eS(e,t,n),captures:t,get:t=>Kfe(t,e.editor),session:e.session}}function upe(e,t,n){let r=n&&n.$onChild,i=[];for(let n of Array.from(t.childNodes)){let t=eS(e,n,void 0);for(let e of t){let t=r?r(e):e;t!=null&&i.push(t)}}let a=n&&n.$after?n.$after(i):i,o=n&&n.schema;return o?function(e,t,n,r){let i=[],a=null,o=()=>{if(a===null)return;let t=a;if(a=null,e.$packageRun){let a=e.$packageRun(t,n,r);if(a.length>0){for(let e of a)i.push(e);return}}if(e.onReject===`hoist`)for(let e of t)i.push(e)};for(let r of t)e.$accepts(r,n)?(o(),i.push(r)):(a===null&&(a=[]),a.push(r));return o(),e.$finalize?e.$finalize(i,n):i}(o,a,null,t):a}function eS(e,t,n){let r=()=>function(e,t){let n=function(e,t){let n=[];for(let r=e.overlays.length-1;r>=0;r--){let i=e.overlays[r],a=Qx(i,t);a.length>0&&n.push({dispatch:i,indices:a})}let r=Qx(e.dispatch,t);return r.length>0&&n.push({dispatch:e.dispatch,indices:r}),n}(e,t);if(n.length===0)return dpe(e,t);let r=0,i=0,a=()=>{for(;r<n.length;){let{dispatch:o,indices:s}=n[r];for(;i<s.length;){let n=s[i++],r=o.rules[n],c={};if(r.predicate(t,c)){let n=lpe(e,Object.keys(c).length===0?cpe:c);try{return r.$import(n,t,a)}catch(e){throw e}}}r++,i=0}return dpe(e,t)};return a()}(e,t);return n&&n.context?Hx(n.context,e.editor)(r):r()}function dpe(e,t){if(t.childNodes.length===0)return[];let n=[];for(let r of Array.from(t.childNodes)){let t=eS(e,r,void 0);for(let e of t)n.push(e)}return n}var tS={build(e,t){let n=Zx($x(t.rules)),r=yx(t.contextDefaults,void 0),i=t.preprocess;return{$generateNodesFromDOM:(t,a)=>{let o=vx(wx,e)||r,s=a&&a.context?yx(a.context,o):o,c=s!==void 0&&s!==o?s:Object.create(o||null),l=new Gfe(c),u={session:l};return function(e,t,n){let r=e.length-1,i=()=>{for(;r>=0;)return void(0,e[r--])(t,n,i)};i()}(a&&a.preprocess?[...i,...a.preprocess]:i,t,u),xx(wx,c,()=>function(e,t,n,r){return upe({dispatch:e,editor:t,overlays:r.get(Bx).map(e=>e.dispatch),session:r},gh(n)?n.body:n,{schema:Jfe})}(n,e,t,l),e)},defaults:r}},config:{contextDefaults:[],preprocess:[Tfe],rules:[{$import:(e,t)=>e.$importChildren(t),match:Fx.any(),name:`@lexical/html/default-hoist`}]},mergeConfig:(e,t)=>Ab(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:Cx},fpe={dependencies:[[tS,{rules:rpe}]],name:`@lexical/html/CoreImport`},nS={any:jx,comment:Mx,css:Vfe,tag:Nx,text:Px},ppe=new Set([`STYLE`,`SCRIPT`]);function mpe(e,t){mx(t);let n=gh(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!ppe.has(t.nodeName)){let n=rS(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof C_&&t.insertAfter(T_());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function hpe(e,t=null,n=Lg()){return Ife([bx(Mfe,!0)],n)(()=>{let r=jh(),i=Ffe(n),a=nb(t),o=e.append.bind(e);for(let e of(Z(a)?a:r).getChildren())_pe(n,e,o,t,i);return e})}function gpe(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&px(338),hue(e),hpe(Cg().createElement(`div`),t,e).innerHTML}function _pe(e,t,n,r=null,i=Rg(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&Fm(t)&&(s=bde(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=Cg().createDocumentFragment(),p=d?d():Z(s)?s.getChildren():[],m=a&&ty(r)&&Z(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=_pe(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((jg(c)||Ng(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(E_(t)&&jg(e)&&Fg(e)&&n!==null&&n.nodeName===`BR`){let t=Cg().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),Ng(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function rS(e,t,n,r,i=new Map,a){let o=[];if(ppe.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!dg(s))&&(s!=null&&by(s)||r);for(let e=0;e<d.length;e++)f.push(...rS(d[e],t,n,p,new Map(i),s));if(u!=null&&(f=u(f)),Fg(e)&&(f=function(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(by(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&by(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}(e,f,p?()=>{let e=new C_;return n.push(e),e}:Qm)),s==null){if(f.length>0)for(let e of f)o.push(e);else Fg(e)&&function(e){return e.nextSibling!=null&&e.previousSibling!=null&&Pg(e.nextSibling)&&Pg(e.previousSibling)}(e)&&o.push(T_())}else Z(s)&&s.append(...f);return o}function vpe(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=rx(i===void 0?e[r]:i)}return n}function ype(e){return()=>{}}function iS(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function aS(e,t){let n=e;for(let r=_b(e,t);r&&(ES(r.origin)||nh(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function oS(e){return aS(e,`previous`)}function sS(e){return aS(e,`next`)}function bpe(e){let t=oS(e),n=sS(e),r=t;for(;r!==null;){if(ES(r)){let e=Ple(r.getTextContent());if(e!==null)return e}if(r===n)break;r=r.getNextSibling()}let i=t.getParent();if(Z(i)){let e=i.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function xpe(e,t){let n=null,r=null,i=e,a=t,o=e.getTextContent();for(;;){if(a===0){let e=i.getPreviousSibling();if(e===null){i=null;break}if(ES(e)||nh(e)||E_(e)||iS(167),i=e,E_(i)){n={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else a--;let e=o[a];ES(i)&&e!==` `&&(r={node:i,offset:a})}if(r!==null)return r;let s=null;if(t<e.getTextContentSize())ES(e)&&(s=e.getTextContent()[t]);else{let t=e.getNextSibling();ES(t)&&(s=t.getTextContent()[0])}if(s!==null&&s!==` `)return n;{let r=function(e,t){let n=e,r=t,i=e.getTextContent(),a=e.getTextContentSize();for(;;){if(!ES(n)||r===a){if(n=n.getNextSibling(),n===null||E_(n))return null;ES(n)&&(r=0,i=n.getTextContent(),a=n.getTextContentSize())}if(ES(n)){if(i[r]!==` `)return{node:n,offset:r};r++}}}(e,t);return r===null?n:r}}function Spe(e){let t=sS(e);return E_(t)&&iS(168),t}function cS(e){let t=[];return Fy(e,{linebreak:()=>t.push(T_()),tab:()=>t.push(th()),text:e=>t.push(TS(e))}),t}function lS(e,t,n){if(!Number.isInteger(t)||t<=0)return!1;let r=e.getTextContent(),i=/^ +/.exec(r);if(!i)return!1;let a=Math.min(t,i[0].length),o=e.getKey(),s=n.anchor.key===o&&n.anchor.type===`text`?n.anchor.offset:null,c=n.focus.key===o&&n.focus.type===`text`?n.focus.offset:null;return e.spliceText(0,a,``),s!==null&&n.anchor.set(o,Math.max(0,s-a),`text`),c!==null&&n.focus.set(o,Math.max(0,c-a),`text`),!0}var Cpe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function uS(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Cpe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}var wpe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],language:e.__language,theme:e.__theme,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__language;o!==void 0&&(a.language=o);let s=e.__theme;s!==void 0&&(a.theme=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=function(e){let t=uS(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=uS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.language;e.setLanguage(s==null||typeof s==`string`?s:``);let c=t.theme;return e.setTheme(c===void 0?void 0:typeof c==`string`?c:``),e}}};function Tpe(e,t){e.__highlightType=t.__highlightType}var Epe=e=>{let t=wf(e,`mode`),n=Ef(e,`detail`,0),r=Ef(e,`format`,0),i=Tf(e,`mode`),a=Df(e,`mode`);return{exportJSON:function(e){return{highlightType:e.__highlightType,detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__highlightType;r!==void 0&&(n.highlightType=r);let i=e.__detail;i!==void 0&&i!==0&&(n.detail=i);let a=e.__format;a!==void 0&&a!==0&&(n.format=a);let o=t[e.__mode];o!==void 0&&o!==`normal`&&(n.mode=o);let s=e.__style;s!==void 0&&s!==``&&(n.style=s);let c=e.__text;return c!==void 0&&c!==``&&(n.text=c),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:uS(o,0);let s=t.format;e.setFormat(typeof s==`string`&&s in r?r[s]:uS(s,0));let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;e.__text=typeof u==`string`?u:``;let d=t.highlightType;return e.setHighlightType(d==null||typeof d==`string`?d:``),e},afterCloneFrom:Tpe}},Dpe=Uf()({language:Kf(Hf(Vf(Lf())),{getter:{field:`__language`}}),theme:Kf(Hf(Lf()),{getter:{field:`__theme`}})});function dS(e,t){for(let n of e.childNodes)if(jg(n)&&n.tagName===t||dS(n,t))return!0;return!1}var fS=`data-language`,pS=`data-highlight-language`,mS=`data-theme`,Ope=ype(),hS=class extends bm{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config(`code`,{children:`inline`,extends:bm,generated:wpe,importDOM:{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||dS(e,`BR`))?{conversion:vS,priority:1}:null,div:()=>({conversion:kpe,priority:1}),pre:()=>({conversion:vS,priority:0}),table:e=>xS(e)?{conversion:Ape,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&xS(n)?{conversion:yS,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&xS(t)?{conversion:yS,priority:3}:null}},json:Dpe})}constructor(e=void 0,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),function(e,t){e.__language=t.__language,e.__theme=t.__theme}(this,e),this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=Cg().createElement(`code`);Mb(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(fS,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(pS,n));let r=this.getTheme();r&&t.setAttribute(mS,r);let i=this.getStyle();return i&&Dm(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(fS,r):i&&t.removeAttribute(fS);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(pS,r):t.removeAttribute(pS):a&&r&&t.setAttribute(pS,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(mS,o):s&&t.removeAttribute(mS);let c=this.__style,l=e.__style;return c!==l&&Dm(t.style,c,l),!1}exportDOM(e){let t=Cg().createElement(`pre`);Mb(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(fS,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(pS,n));let r=this.getTheme();r&&t.setAttribute(mS,r);let i=this.getStyle();return i&&Dm(t.style,i),{element:t}}insertNewAfter(e,t=!0){if(!Gb(Lg(),`@lexical/code`)){Ope();let t=SS(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(Fm(i)){let e=oS(i),t=[];for(;;)if(nh(e))t.push(th()),e=e.getNextSibling();else{if(!ES(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push(TS(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let r=i.splitText(n.offset)[0],a=n.offset===0?0:1,o=r.getIndexWithinParent()+a,s=i.getParentOrThrow(),c=[T_(),...t];s.splice(o,0,c);let l=t[t.length-1];l?l.select():n.offset===0?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(_S(i)){let{offset:t}=e.anchor;i.splice(t,0,[T_()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=Qm();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function gS(e,t){return h_(hS).setLanguage(e).setTheme(t)}function _S(e){return e instanceof hS}function vS(e){return{node:gS(e.getAttribute(fS),e.getAttribute(mS))}}function kpe(e){let t=e,n=bS(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(bS(t))return!0;t=t.parentElement}return!1}(t)?{node:n?gS():null}:{node:null}}function Ape(){return{node:gS()}}function yS(){return{node:null}}function bS(e){return e.style.fontFamily.match(`monospace`)!==null}function xS(e){return e.classList.contains(`js-file-line-container`)}function SS(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type===`element`){let e=t.getNode();if(_S(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(E_(t)&&E_(t.getPreviousSibling())){let t=Qm();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}var jpe=Uf()({highlightType:Kf(Hf(Vf(Lf())),{getter:{field:`__highlightType`}})}),CS=class extends Mm{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}$config(){return this.config(`code-highlight`,{extends:Mm,generated:Epe,json:jpe})}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return Mb(t,wS(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=wS(n.theme,e.__highlightType),a=wS(n.theme,this.__highlightType);return i!==a&&(i&&Nb(t,i),a&&Mb(t,a)),r}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return gS()}};function wS(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function TS(e=``,t){return pg(new CS(e,t))}function ES(e){return e instanceof CS}var DS=`data-language`,OS=`data-theme`;function kS(e){let t=[],n=!1;for(let r=0;r<e.length;r++){let i=e[r],a=Ux(i);r>0&&(a||n)&&t.push(`
|
||
`),t.push(i.getTextContent()),n=a}return cS(t.join(``))}function AS(e){return e.style.fontFamily.match(`monospace`)!==null}function jS(e){let t=e.parentElement;for(;t!==null;){if(AS(t))return!0;t=t.parentElement}return!1}var Mpe=spe([{$import:(e,t)=>e.$importChildren(t),match:nS.tag(`tr`,`td`),name:`@lexical/code/github-code-table/unwrap`}]),Npe={$import:(e,t)=>[gS(t.getAttribute(DS),t.getAttribute(OS)).splice(0,0,kS(e.$importChildren(t)))],match:nS.tag(`pre`),name:`@lexical/code/pre`},Ppe={$import:(e,t,n)=>{let r=t.textContent||``;return/\r?\n/.test(r)||t.querySelector(`br`)!==null?[gS(t.getAttribute(DS),t.getAttribute(OS)).splice(0,0,kS(e.$importChildren(t)))]:n()},match:nS.tag(`code`),name:`@lexical/code/code-multiline`};function MS(e){if(!jg(e))return!1;let t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t==`string`&&/monospace/i.test(t)&&typeof n==`string`&&n.startsWith(`pre`)}function NS(e){let t=!1,n=[],r=``,i=!1,a=()=>{i&&=(n.push(r),r=``,!1)};for(let o of Array.from(e.childNodes))if(jg(o))o.tagName===`DIV`?(a(),n.push(o.textContent||``),t=!0):o.tagName===`BR`?(a(),n.push(``),t=!0):(r+=o.textContent||``,i=!0);else if(hh(o)){let e=o.textContent||``;e.length>0&&(r+=e,i=!0)}return a(),t?n:null}function PS(e){for(let t of Array.from(e.children))if(jg(t)&&MS(t)){if(NS(t)!==null)return!0;let e=t.nextElementSibling;if(e&&MS(e))return!0}else if(PS(t))return!0;return!1}var Fpe=spe([{$import:(e,t,n)=>{if(!MS(t)||jS(t))return n();let r=NS(t);return r===null||r.length===0?n():[gS().splice(0,0,cS(r.join(`
|
||
`)))]},match:nS.tag(`div`),name:`@lexical/code/vscode-wrapper`},{$import:(e,t,n)=>{if(!MS(t)||jS(t))return n();let r=t.previousElementSibling;if(r&&MS(r))return[];let i=[],a=t;for(;a&&MS(a);)i.push(a.tagName===`BR`?``:a.textContent||``),a=a.nextElementSibling;return i.length<2?n():[gS().splice(0,0,cS(i.join(`
|
||
`)))]},match:nS.tag(`div`,`br`),name:`@lexical/code/vscode-line-run`}]),Ipe={$import:(e,t,n)=>AS(t)?[gS().splice(0,0,kS(e.$importChildren(t)))]:n(),match:nS.tag(`div`),name:`@lexical/code/div`},Lpe={dependencies:[fpe,[tS,{preprocess:[(e,t,n)=>{PS(gh(e)?e.body:e)&&t.session.update(Bx,e=>[...e,Fpe]),n()}],rules:[{$import:(e,t)=>[gS().splice(0,0,kS(e.$importChildren(t,{rules:Mpe})))],match:nS.tag(`table`).classAll(`js-file-line-container`),name:`@lexical/code/github-code-table`},{$import:(e,t)=>e.$importChildren(t),match:nS.tag(`td`).classAll(`js-file-line`),name:`@lexical/code/github-code-cell-by-class`},Ppe,Npe,Ipe]}]],name:`@lexical/code`,nodes:()=>[hS,CS],register:e=>pv(e.registerCommand(kd,e=>{let t=$();return!(!Q(t)||!SS(t)||(e!==null&&e.preventDefault(),0))},1),e.registerNodeTransform(eh,e=>{e.getFormat()!==0&&_S(e.getParent())&&e.setFormat(0)}))};function FS(e){if(!Q(e))return!1;let t=e.anchor.getNode(),n=_S(t)?t:t.getParent(),r=e.focus.getNode(),i=_S(r)?r:r.getParent();return _S(n)&&n.is(i)}function IS(e){let t=e.getNodes(),n=[];if(t.length===1&&_S(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){let i=t[e];ES(i)||nh(i)||E_(i)||iS(169),E_(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){let t=e.isBackward()?e.anchor:e.focus,i=qv(r[0].getKey(),0,`text`);t.is(i)||n.push(r)}return n}function LS(e,t){let n=$();if(!Q(n)||!FS(n))return!1;let r=IS(n),i=r.length;if(i===0&&n.isCollapsed())return e===Id?n.insertNodes([th()]):function(e,t){let n=e.anchor.getNode();if(!ES(n)&&!nh(n))return;let r=oS(n);nh(r)?r.remove():t!==void 0&&ES(r)&&lS(r,t,e)}(n,t),!0;if(i===0&&e===Id&&n.getTextContent()===`
|
||
`){let e=th(),t=T_(),r=n.isBackward()?`previous`:`next`;return n.insertNodes([e,t]),zm(Km(Tb(vb(e,`next`,0),Wm(_b(t,`next`))),r)),!0}for(let a=0;a<i;a++){let i=r[a];if(i.length>0){let r=i[0];if(a===0&&(r=oS(r)),e===Id){let e=th();if(r.insertBefore(e),a===0){let t=n.isBackward()?`focus`:`anchor`,i=qv(r.getKey(),0,`text`);n[t].is(i)&&n[t].set(e.getKey(),0,`text`)}}else nh(r)?r.remove():t!==void 0&&ES(r)&&lS(r,t,n)}}return!0}function RS(e,t){let n=$();if(!Q(n))return!1;let{anchor:r,focus:i}=n,a=r.offset,o=i.offset,s=r.getNode(),c=i.getNode(),l=e===Dd;if(!FS(n)||!ES(s)&&!nh(s)||!ES(c)&&!nh(c))return!1;if(!t.altKey){if(n.isCollapsed()){let e=s.getParentOrThrow();if(l&&a===0&&s.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),t.preventDefault(),!1}else if(!l&&a===s.getTextContentSize()&&s.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),t.preventDefault(),!1}return!1}let u,d;if(s.isBefore(c)?(u=oS(s),d=sS(c)):(u=oS(c),d=sS(s)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let e=0;e<f.length;e++){let t=f[e];if(!ES(t)&&!nh(t)&&!E_(t))return!1}t.preventDefault(),t.stopPropagation();let p=l?u.getPreviousSibling():d.getNextSibling();if(!E_(p))return!0;let m=l?p.getPreviousSibling():p.getNextSibling();if(m==null)return!0;let h=E_(m),g=(h||!ES(m)&&!nh(m)?null:l?oS(m):sS(m))??m;return p.remove(),f.forEach(e=>e.remove()),h?(f.forEach(e=>{g.insertAfter(e),g=e}),g.insertAfter(p)):e===Dd?(f.forEach(e=>g.insertBefore(e)),g.insertBefore(p)):(g.insertAfter(p),g=p,f.forEach(e=>{g.insertAfter(e),g=e})),n.setTextNodeRange(s,a,c,o),!0}function zS(e,t){let n=$();if(!Q(n))return!1;let{anchor:r,focus:i}=n,a=r.getNode(),o=i.getNode(),s=e===Ed;if(!FS(n)||!ES(a)&&!nh(a)||!ES(o)&&!nh(o))return!1;let c=o,l=bpe(c)===`rtl`?!s:s,u=r.key,d=r.offset,f=r.type;if(l){let e=xpe(c,i.offset);if(e!==null){let{node:t,offset:r}=e;E_(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else c.getParentOrThrow().selectStart()}else Spe(c).select();return t.shiftKey&&n.anchor.set(u,d,f),t.preventDefault(),t.stopPropagation(),!0}function Rpe(e,t,n){return pv(...n?[e.registerCommand(Od,e=>!e.altKey&&Wde(_S,e),1),e.registerCommand(Cd,e=>Wde(_S,e),1),e.registerCommand(Dd,e=>!e.altKey&&Ude(_S,e),1),e.registerCommand(Td,e=>Ude(_S,e),1)]:[],e.registerCommand(Pd,t=>{let n=function(e){let t=$();if(!Q(t)||!FS(t))return null;let n=e?Ld:Id,r=e?Ld:Fd,i=t.anchor,a=t.focus;if(i.is(a))return r;let o=IS(t);if(o.length!==1)return n;let s=o[0],c,l;s.length===0&&iS(285),t.isBackward()?(c=a,l=i):(c=i,l=a);let u=oS(s[0]),d=sS(s[0]),f=qv(u.getKey(),0,`text`),p=qv(d.getKey(),d.getTextContentSize(),`text`);return c.isBefore(f)||p.isBefore(l)?n:f.isBefore(c)||l.isBefore(p)?r:n}(t.shiftKey);return n!==null&&(t.preventDefault(),e.dispatchCommand(n),!0)},1),e.registerCommand(Fd,()=>!!FS($())&&(Py([th()]),!0),1),e.registerCommand(Id,()=>LS(Id),1),e.registerCommand(Ld,()=>LS(Ld,t),1),e.registerCommand(Dd,e=>{let t=$();if(!Q(t))return!1;let{anchor:n}=t,r=n.getNode();if(!FS(t))return!1;let i=r.getParent();return t.isCollapsed()&&n.offset===0&&r.getPreviousSibling()===null&&_S(i)&&i.getPreviousSibling()===null?(e.preventDefault(),!0):RS(Dd,e)},1),e.registerCommand(Od,e=>{let t=$();if(!Q(t))return!1;let{anchor:n}=t,r=n.getNode();return!!FS(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&r.getNextSibling()===null&&_S(r.getParentOrThrow())&&r.getParentOrThrow().getNextSibling()===null?(e.preventDefault(),!0):RS(Od,e))},1),e.registerCommand(Ed,e=>zS(Ed,e),1),e.registerCommand(wd,e=>zS(wd,e),1))}var zpe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function BS(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!zpe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function VS(e,t,n,r,i){let a=BS(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Bpe(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}var Vpe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__rel;o!=null&&(a.rel=o);let s=e.__target;s!=null&&(a.target=s);let c=e.__title;c!=null&&(a.title=c);let l=e.__url;l!==void 0&&l!==``&&(a.url=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=VS(t.indent,0,0,1/0),e.__textFormat=BS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;return e.__url=typeof u==`string`?u:``,e},afterCloneFrom:Bpe}};function Hpe(e,t){e.__isUnlinked=t.__isUnlinked}var Upe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__isUnlinked;o!==void 0&&!1!==o&&(a.isUnlinked=o);let s=e.__rel;s!=null&&(a.rel=s);let c=e.__target;c!=null&&(a.target=c);let l=e.__title;l!=null&&(a.title=l);let u=e.__url;u!==void 0&&u!==``&&(a.url=u);let d=e.__dir;d!=null&&(a.direction=d);let f=t[e.__format];f!==void 0&&f!==``&&(a.format=f);let p=e.__indent;return p!==void 0&&p!==0&&(a.indent=p),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=VS(t.indent,0,0,1/0),e.__textFormat=BS(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;e.__url=typeof u==`string`?u:``;let d=t.isUnlinked;return e.__isUnlinked=typeof d==`boolean`&&d,e},afterCloneFrom:Hpe}},HS=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),Wpe=Uf()({rel:Gf(Vf(Lf(),{defaultAsNull:!0}),{field:`__rel`}),target:Gf(Vf(Lf(),{defaultAsNull:!0}),{field:`__target`}),title:Gf(Vf(Lf(),{defaultAsNull:!0}),{field:`__title`}),url:Gf(Lf(),{field:`__url`,getter:`getURL`,setter:`setURL`})}),US=class extends bm{__url;__target;__rel;__title;$config(){return this.config(`link`,{children:`inline`,extends:bm,generated:Vpe,importDOM:{a:()=>({conversion:Gpe,priority:1})},inline:!0,json:Wpe,mergeAdjacent:{by:[`url`,`target`,`rel`,`title`]}})}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=Cg().createElement(`a`);return this.updateLinkDOM(null,t,e),Mb(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Ag(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}sanitizeUrl(e){let t=e;e=YS(e);try{let t=new URL(YS(e));if(!HS.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!HS.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=fg(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Q(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith(`mailto:`)}isWebSiteURI(){let e=this.getURL();return e.startsWith(`https://`)||e.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.getURL()===e.getURL()&&this.getTarget()===e.getTarget()&&this.getRel()===e.getRel()&&this.getTitle()===e.getTitle()}};function Gpe(e){let t=null;if(Ag(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=WS(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function WS(e=``,t){return pg(new US(e,t))}function GS(e){return e instanceof US}var Kpe=Uf()({isUnlinked:Gf(zf(),{field:`__isUnlinked`})}),qpe=class extends US{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}$config(){return this.config(`autolink`,{extends:US,generated:Upe,json:Kpe,mergeAdjacent:!1})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?Cg().createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}};function KS(e){return e instanceof qpe}var qS=rd(`TOGGLE_LINK_COMMAND`);function JS(e,t){if(e.type===`element`){let n=e.getNode();return Z(n)||function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(252),n.getChildren()[e.offset+t]||null}return null}function Jpe(e,t={}){let n;if(e&&typeof e==`object`){let{url:r,...i}=e;n=r,t={...i,...t}}else n=e;let{target:r,title:i}=t,a=t.rel===void 0?`noreferrer`:t.rel,o=$();if(o===null||!Q(o)&&!ty(o))return;if(ty(o)){let e=o.getNodes();if(e.length===0)return;e.forEach(e=>{if(n===null){let t=g_(e,e=>!KS(e)&&GS(e));t&&(t.insertBefore(e),t.getChildren().length===0&&t.remove())}else{let t=g_(e,e=>!KS(e)&&GS(e));if(t)t.setURL(n),r!==void 0&&t.setTarget(r),a!==void 0&&t.setRel(a),i!==void 0&&t.setTitle(i);else{let t=WS(n,{rel:a,target:r,title:i});e.insertBefore(t),t.append(e)}}});return}if(o.isCollapsed()&&n===null)for(let e of o.getNodes()){let t=g_(e,e=>!KS(e)&&GS(e));t!==null&&(t.getParentOrThrow().splice(t.getIndexWithinParent(),0,t.getChildren()),t.remove());return}let s=o.extract();if(n===null){let e=new Set;s.forEach(t=>{let n=g_(t,e=>!KS(e)&&GS(e));if(n!==null){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||Z(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),a=r.filter(i);if(a.length===0&&r.length>0)return;if(a.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let o=r.findIndex(i),s=r.findLastIndex(i),c=o===0,l=s===r.length-1;if(c)a.forEach(t=>e.insertBefore(t));else if(l)for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);else{for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);let t=r.slice(s+1);if(t.length>0){let n=fg(e);a[a.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,s),e.add(t)}});return}let c=new Set,l=e=>{c.has(e.getKey())||(c.add(e.getKey()),e.setURL(n),r!==void 0&&e.setTarget(r),a!==void 0&&e.setRel(a),i!==void 0&&e.setTitle(i))};if(s.length===1){let e=s[0],t=g_(e,GS);if(t!==null)return l(t)}(function(e){let t=$();if(!Q(t))return e();let n=fm(t),r=n.isBackward(),i=JS(n.anchor,r?-1:0),a=JS(n.focus,r?0:-1);if(e(),i||a){let e=$();if(Q(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}Nh(fm(t))}}})(()=>{let e=null;for(let t of s){if(!t.isAttached())continue;let o=g_(t,GS);if(o){l(o);continue}if(Z(t)){if(!t.isInline())continue;if(GS(t)){if(!(KS(t)||e!==null&&e.getParentOrThrow().isParentOf(t))){l(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let s=t.getPreviousSibling();GS(s)&&s.is(e)?s.append(t):(e=WS(n,{rel:a,target:r,title:i}),t.insertAfter(e),e.append(t))}})}var Ype=/^\+?[0-9\s()-]{5,}$/;function YS(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:Ype.test(e)?`tel:${e}`:`https://${e}`}function XS(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Xpe(e){let t=1,n=e.getParent();for(;n!=null;){if(_C(n)){let e=n.getParent();if(fC(e)){t++,n=e.getParent();continue}XS(40)}return t}return t}function Zpe(e){let t=e.getParent();fC(t)||XS(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),fC(r)&&(n=r);return n}function ZS(e){return _C(e)&&fC(e.getFirstChild())}function QS(e,t){return t.getValue()}function Qpe(e,t){return _C(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function $S(e,t){return fC(e)?fg(e).setListType(t):dC(t)}function $pe(e){let t=$();if(t!==null){let n=t.getNodes();if(Q(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(dg(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=Qm();i.append(e),n=e.select().getNodes()}}else if(Qpe(i,n)){if(dg(a)){let t=dC(e);i.replace(t);let n=gC();Z(i)&&(n.setFormat(i.getFormatType()),n.setIndent(i.getIndent())),t.append(n)}else if(_C(i)){let t=i.getParentOrThrow();if(eb(t)===null){let n=$S(t,e);eC(n,t.getChildren()),t.replace(n)}}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(Z(i)&&i.isEmpty()&&!_C(i)&&eb(i)===null&&!r.has(i.getKey())){tC(i,e);continue}let a=Fle(i)?i.getParent():_C(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(fC(a)){if(!r.has(t)&&eb(a)===null){let n=$S(a,e);eC(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(dg(n)&&!r.has(t)){r.add(t),tC(a,e);break}a=n}}}}}function eC(e,t){e.splice(e.getChildrenSize(),0,t)}function tC(e,t){if(fC(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=gC(),a;if(eC(i,e.getChildren()),fC(n)&&t===n.getListType())n.append(i),fC(r)&&t===r.getListType()&&(eC(n,r.getChildren()),r.remove()),a=n;else if(fC(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=dC(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=$();return Q(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function nC(e,t){rC(e,t,!1)}function rC(e,t,n){iC(e.getLastChild(),t.getFirstChild(),n);let r=t.getChildren();r.length>0&&e.append(...r),t.remove()}function iC(e,t,n=!1){if(e&&t&&ZS(e)&&ZS(t)&&(!n||e.getChildrenSize()===1&&t.getChildrenSize()===1)&&e.getFirstChild().getListType()===t.getFirstChild().getListType()){if(rC(e.getFirstChild(),t.getFirstChild(),n),!n)return void t.remove();bm.prototype.remove.call(t)}}function eme(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())_C(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),fC(r.getFirstChild())||n++)}function tme(e){let t=new Set;if(ZS(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(ZS(r)&&ZS(i)){let n=i.getFirstChild();if(fC(n)){n.append(e);let i=r.getFirstChild();fC(i)&&n.getListType()===i.getListType()&&(eC(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(ZS(r)){let t=r.getFirstChild();if(fC(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(ZS(i)){let t=i.getFirstChild();fC(t)&&t.append(e)}else if(fC(n)){let t=fg(e),a=fg(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function aC(e){if(ZS(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(fC(n?n.getParent():void 0)&&_C(n)&&fC(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=fg(e),i=fg(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=fg(e),o=fg(t);a.append(o),eC(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function nme(e=!1){let t=$();if(!Q(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(_C(n)&&n.getChildrenSize()===0)r=n;else if(Fm(n)){let e=n.getParent();_C(e)&&e.getChildren().every(e=>Fm(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=Zpe(r),a=r.getParent();fC(a)||XS(40);let o=a.getParent(),s;if(dg(o))s=Qm(),i.insertAfter(s);else{if(!_C(o))return!1;s=fg(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?QS(0,r):1,n=fg(a).setStart(t);if(_C(s)){let e=fg(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!_C(e)&&!fC(e))break;t=e}t.remove()}(r),!0}var rme=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function oC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!rme.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function ime(e,t){e.__listType=t.__listType,e.__start=t.__start,e.__tag=t.__tag}var ame=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`),i=Ef(e,`listType`,0);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],listType:e.__listType,start:e.__start,tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__listType;o!==void 0&&o!==`number`&&(a.listType=o);let s=e.__start;s!==void 0&&s!==1&&(a.start=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let a=t.direction;e.__dir=a===null||a===`ltr`||a===`rtl`?a:null;let o=t.format;e.__format=typeof o==`string`&&o in n?n[o]:r,e.__indent=function(e){let t=oC(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=oC(t.textFormat,0);let s=t.textStyle;e.__textStyle=typeof s==`string`?s:``;let c=t.listType;return e.setListType(typeof c==`string`&&c in i?i[c]:c===`number`||c===`bullet`||c===`check`?c:`number`),e.__start=oC(t.start,1),e},afterCloneFrom:ime}};function ome(e,t){e.__checked=t.__checked,e.__value=t.__value}var sme=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],checked:e.getChecked(),indent:e.getIndent(),value:e.__value,direction:e.__dir,format:t[e.__format],textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.getChecked();o!==void 0&&(a.checked=o);let s=e.getIndent();s!==void 0&&s!==0&&(a.indent=s);let c=e.__value;c!==void 0&&c!==1&&(a.value=c);let l=e.__dir;l!=null&&(a.direction=l);let u=t[e.__format];return u!==void 0&&u!==``&&(a.format=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.setIndent(function(e){let t=oC(e,NaN);return Number.isFinite(t)&&Number.isInteger(t)?t<0?0:t>128?128:t:0}(t.indent)),e.__textFormat=oC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.checked;return e.__checked=s===void 0?void 0:typeof s==`boolean`&&s,e.__value=oC(t.value,1),e},afterCloneFrom:ome}},sC={ol:`number`,ul:`bullet`},cme=Uf()({listType:Kf(Wf(Bf([`number`,`bullet`,`check`]),sC),{getter:{field:`__listType`}}),start:Gf(Rf(1),{field:`__start`}),tag:Kf(Bf([`ul`,`ol`]),{getter:{field:`__tag`},setter:null})}),cC=class extends bm{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.constructor,n=e.getNextSibling();return n!==null&&n.constructor===t&&ym(Lg())&&tle(t).declaredBy.mergeAdjacent===t})(e)||function(e){let t=e.getNextSibling();fC(t)&&e.getListType()===t.getListType()&&nC(e,t)}(e),eme(e)},children:[pC],extends:bm,generated:ame,importDOM:rm({ol:()=>({conversion:uC,priority:0}),ul:()=>({conversion:uC,priority:0})}),json:cme,mergeAdjacent:{by:[`listType`]}})}constructor(e=`number`,t=1,n){super(n);let r=sC[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=Cg().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,lC(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(lC(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}exportDOM(e){let t=this.createDOM(e._config,e);if(jg(t)){this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`);let e=this.getDirection();e&&(t.dir=e)}return{element:t}}canBeEmpty(){return!1}INTERNAL_$afterStructureMerge(e,t){iC(e,t,!0)}INTERNAL_$afterStructureSplit(e,t){if(this.getListType()===`number`){let n=e.getStart();for(let e of t)_C(e)&&!fC(e.getFirstChild())&&n++;this.setStart(n)}}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];if(!_C(t)){r===n&&(r=[...n]);let i=this.createListItemNode();!Z(t)||fC(t)||t.isInline()?i.append(t):i.append(...t.getChildren()),r[e]=i}}return super.splice(e,t,r)}extractWithChild(e){return _C(e)}createListItemNode(){return gC()}};function lC(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=Xpe(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...jb(s));for(let t=0;t<e.length;t++)t!==o&&i.push(...jb(e[t]))}if(l!==void 0){let e=jb(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&Nb(e,...i),r.length>0&&Mb(e,...r)}function uC(e){let t;if(function(e){return jg(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=dC(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(jg(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?dC(`check`):dC(`bullet`);return Gg(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];if(_C(i)){r.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{fC(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}function dC(e=`number`,t=1){return pg(new cC(e,t))}function fC(e){return e instanceof cC}var lme=Uf()({checked:Kf(Hf(zf()),{setter:{field:`__checked`}}),indent:Kf(Rf(0,{clamp:!0,integer:!0,max:128,min:0}),{derived:!0}),value:Gf(Rf(1),{derived:!0,field:`__value`})}),pC=class extends bm{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(fC(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();fC(n)||XS(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of _b(e,t)){if(!_C(n))break;r.push(n)}}let i=ym(Lg()),a=i?function(e,t){let n=$();if(!Q(n))return null;let r=e.getKey(),i=t[0].getIndexWithinParent(),a=[n.anchor,n.focus].filter(e=>e.type===`element`&&e.key===r).map(e=>({offset:e.offset,point:e}));return a.length===0?null:e=>{for(let{point:e,offset:n}of a)if(n<=i)e.set(r,n,`element`);else if(n<i+t.length){let r=t[n-i-1];e.set(r.getKey(),r.getChildrenSize(),`element`)}else e.set(r,n-t.length+1,`element`)}}(t,r):null;if(e.insertBefore(n),n.splice(0,0,r),a!==null&&a(n),i)for(let e=t;e!==null&&!dg(e);e=e.getParent())e.markDirty();dg(t)||i||(Xm(n,Hm(_b(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},children:[`inline`,cC],extends:bm,generated:sme,importDOM:rm({li:()=>({conversion:ume,priority:0})}),json:lme})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){let t=Cg().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!fC(n)||n.getListType()!==`check`||fC(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=fC(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>fC(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...jb(a)),u.length>0&&Nb(e,...u);let d=[];if(i!==void 0&&d.push(...jb(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...jb(a)),d.length>0&&Mb(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&Dm(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=Em(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in Em(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),ZS(this)?{after(e){if(jg(e)){let t=e.previousElementSibling;if(jg(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(Z(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(_C(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!fC(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=fg(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}let r=this.__key,i=0;if(t&&(Z(e)||XS(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&Z(e)){let t=$();if(Q(t))for(let n of t.getStartEndPoints())n.key===r&&n.type===`element`&&n.set(e.getKey(),i+n.offset,`element`)}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(fC(n)||XS(39),_C(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=fg(n),a=r[0];i.getListType()===`number`&&_C(a)&&i.setStart(QS(0,a)),r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&ZS(t)&&ZS(n)&&t.getFirstChild().getListType()===n.getFirstChild().getListType()&&(nC(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=fg(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(ZS(this))return!1;let t=this.getParentOrThrow();if(_C(t.getParentOrThrow()))return aC(this),!0;let n=Qm().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=fg(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return fC(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;_C(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&XS(117),(e=Math.floor(e))>=0||XS(199);let t=e,n=this.getIndent();for(;n!==t;)n<t?(tme(this),n++):(aC(this),n--);return this}canInsertAfter(e){return _C(e)}canReplaceWith(e){return _C(e)}canMergeWith(e){return _C(e)||$m(e)}extractWithChild(e,t){if(!Q(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return dC(`bullet`)}canMergeWhenEmpty(){return!0}};function ume(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return mC(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return mC(t.children[0])}let t=e.getAttribute(`aria-checked`),n=gC(t===`true`||t!==`false`&&void 0);return Kg(n,e),{after:hC.bind(null,n),node:Gg(n,e)}}function mC(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=gC(e.hasAttribute(`checked`));return{after:hC.bind(null,t),node:t}}function hC(e,t){let n=t[0];return t.length===1&&$m(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function gC(e){return pg(new pC(void 0,e))}function _C(e){return e instanceof pC}var vC=rd(`INSERT_UNORDERED_LIST_COMMAND`),yC=rd(`INSERT_ORDERED_LIST_COMMAND`);function bC(e,t,n=null){let r=Sg(n),i=n?bg(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=$h(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(yg(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function xC(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var SC={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function dme(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}var CC=(e,t)=>{if(!Q(t))return t.insertRawText(e),!0;t!==$()&&Nh(t);let n=e=>{let t=$();Q(t)&&e(t)};return Fy(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([th()])),text:e=>n(t=>t.insertText(e))}),!0},wC={"application/x-lexical-editor":[(e,t,n)=>{try{let n=Lg(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return jC(n,yme(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=Lg();return jC(n,mpe(n,new DOMParser().parseFromString(dme(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[CC],"text/uri-list":[CC]};function fme(e,t,n,r){if(!e)return!1;let i=(t,n,a)=>!!e[t]&&e[t](n,a,(e=n,r=a)=>i(t-1,e,r),r);return i(e.length-1,t,n)}function TC(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?t<n?-1:+(t>n):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&fme(e.$importMimeType[i],a,n,t))return!0}return!1}var pme={$importMimeType:wC,$insertDataTransfer:(e,t)=>TC({$importMimeType:wC,priority:SC},e,t),priority:SC},mme={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>TC(t,e,n),priority:t.priority}),config:{$importMimeType:wC,priority:SC},mergeConfig(e,t){let n=Ab(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`};function EC(e,t=$()){return t??xC(166),Q(t)&&t.isCollapsed()||t.getNodes().length===0?``:gpe(e,t)}function DC(e,t=$()){return t??xC(166),Q(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(vme(e,t))}function OC(e,t,n){(function(){let e=wfe(mme.name);return e?e.output:pme})().$insertDataTransfer(e,t)}var kC=`application/x-lexical-drag`;function hme(e,t){let n={editorKey:t.getKey()};e.setData(kC,JSON.stringify(n))}function AC(e){let t=e;if(mb(t)){if(t.offset===0)t=Hm(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(gb(t))t=Hm(_b(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=_b(e,`next`)}}}function gme(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(kC);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=bC(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=Oh(n.node);if(r===null)return null;if(Fm(r))return vb(r,`next`,n.offset);let i=r.getParent();if(Z(r)){let e=t.getElementByKey(r.getKey());if(e===null)return null;let a=zg(r,e,t);return n.node===a.element||i?qm(...a.resolveChildIndex(r,e,n.node,n.offset),`next`):null}return i&&qm(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=$();if(o){if(!Q(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=Km(Vm(t),`next`),i=AC(e);return Db(AC(n),i)<=0&&Db(i,AC(r))<=0}(a,s))return e.preventDefault(),!0}let c=Wm(a),l=mb(c)?Dle(c):c;if(l===null)return!1;let u=l.getFlipped();o&&Q(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||xC(438),n(r,zm(wb(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of xg(t)){let t=fh(n);if(uh(t)&&t.getKey()===e&&jg(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function _me(e,t){return gme(e,t,OC)}function jC(e,t,n){e.dispatchCommand(ad,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Q(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=Lm(t,`previous`);if(r){if(mb(r))n=r.origin;else{let e=Tb(r,bb(jh(),`next`).getFlipped());for(let t of e){if(Fm(t.origin)){n=t.origin;break}if(Z(t.origin)&&!t.origin.isInline())break}}}if(n&&Fm(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function MC(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=Z(n)&&n.excludeFromCopy(`clone`),o=n;t!==null&&Fm(o)&&(o=bde(t,o,`clone`));let s=of(o),c=Z(o)?o.getChildren():[],l=s.children||[];Fm(o)&&o.getTextContentSize()===0&&(i=!1);let u=i&&ty(t)&&Z(n)?null:t;for(let r=0;r<c.length;r++){let a=c[r],o=MC(e,u,a,l);!i&&Z(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a){let t=ib(o);if(t.length>0){let n={};for(let r of t){let t=ab(o,r);t===null&&xC(366,o.constructor.name,r);let i=[];MC(e,null,t,i),(i.length!==1||Z(t)&&t.excludeFromCopy(`clone`))&&xC(435,r,o.constructor.name,String(i.length)),n[r]=i[0]}s.$slots=n}}if(i&&!a)r.push(s);else for(let e=0;e<l.length;e++)r.push(l[e]);return i}function vme(e,t){let n=[],r=jh(),i=nb(t),a=(Z(i)?i:r).getChildren();for(let r=0;r<a.length;r++)MC(e,t,a[r],n);return{namespace:e._config.namespace,nodes:n}}function yme(e){let t=[];for(let n of e)t.push(gue(n));return t}var NC=null;async function PC(e,t,n){if(NC!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(FC(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=vg(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(Hd,r=>(Rb(r,ClipboardEvent)&&(o(),NC!==null&&(i.clearTimeout(NC),NC=null),t(FC(e,r,n))),!0),4);NC=i.setTimeout(()=>{o(),NC=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function FC(e,t,n){if(n===void 0){let t=vg(e._window),r=$();if(!r||r.isCollapsed()||!t)return!1;let i=Eg(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!lh(e,a,o))return!1;n=IC(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(LC(r,n),!0)}var bme=[[`text/html`,EC],[`application/x-lexical-editor`,DC]];function IC(e=$()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=Cme(i,t);e!==null&&(n[r]=e)}return n}(xme(),e)}function LC(e,t){for(let[n]of bme)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function xme(e=Lg()){let t=Gb(e,wme.name);return t?t.output:Sme}var Sme={"application/x-lexical-editor":[(e,t)=>e?DC(Lg(),e):t()],"text/html":[(e,t)=>e?EC(Lg(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function Cme(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var wme={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:Sme},mergeConfig(e,t){let n=Ab(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`},Tme={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},RC=Symbol.for(`@lexical/dragon/WindowState`);function Eme(e,t,n){let r=function(e){let t=e[RC];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[RC]=t),t}(e);if(r.installs.size===0){let t=Ame.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return Dme.bind(null,e,r,t,n)}function Dme(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[RC])}function Ome(e){return e&&e.ownerDocument.defaultView}function kme(e){let t=cx(()=>Ome(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=Ome(e)}));return sx(()=>{let n=t.value;if(n)return Eme(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function Ame(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[RC];if(t===void 0)return null;let n=fh(Og(e.document));return uh(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=$();if(Q(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(Fm(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),Fm(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=Tme[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}var jme=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function zC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!jme.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Mme(e,t,n,r,i){let a=zC(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Nme(e,t){e.__tag=t.__tag}var Pme=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__tag;o!==void 0&&o!==`h1`&&(a.tag=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Mme(t.indent,0,0,1/0),e.__textFormat=zC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.tag;return e.__tag=s===`h1`||s===`h2`||s===`h3`||s===`h4`||s===`h5`||s===`h6`?s:`h1`,e},afterCloneFrom:Nme}},Fme=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Mme(t.indent,0,0,1/0),e.__textFormat=zC(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Ime=rd(`DRAG_DROP_PASTE_FILE`),BC=Yf(`shadowRoot`,{parse:zf()}),VC=class extends bm{$config(){return this.config(`quote`,{children:`inline`,extends:bm,generated:Fme,importDOM:{blockquote:()=>({conversion:zme,priority:0})},stateConfigs:[{flat:!0,stateConfig:BC}]})}isShadowRoot(){return Xf(this,BC)}setIsShadowRoot(e){return Zf(this,BC,e)}createDOM(e){let t=Cg().createElement(`blockquote`);return Mb(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(jg(t)){this.isEmpty()&&t.append(Cg().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return HC().updateFromJSON(e)}insertNewAfter(e,t){let n=Qm();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=Qm();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function HC(e){let t=pg(new VC);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function UC(e){return e instanceof VC}var Lme=Uf()({tag:Gf(Bf([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),{field:`__tag`})}),WC=class extends bm{__tag;$config(){return this.config(`heading`,{children:`inline`,extends:bm,generated:Pme,importDOM:{h1:()=>({conversion:GC,priority:0}),h2:()=>({conversion:GC,priority:0}),h3:()=>({conversion:GC,priority:0}),h4:()=>({conversion:GC,priority:0}),h5:()=>({conversion:GC,priority:0}),h6:()=>({conversion:GC,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&Rme(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Rme(e)?{conversion:()=>({node:KC(`h1`)}),priority:3}:null},json:Lme})}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=Cg().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];Mb(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(jg(t)){this.isEmpty()&&t.append(Cg().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}insertNewAfter(e,t=!0){let n=!this.getLastDescendant()||e&&Kde(e.anchor,this),r=e&&Gde(e.anchor,this),i=n||!e?Qm():KC(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),r&&!this.isEmpty()){let e=Qm();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=Qm();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function Rme(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function GC(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=KC(t),Wg(e,n),Kg(n,e),Gg(n,e)),{node:n}}function zme(e){let t=HC();return Kg(t,e),Wg(e,t),Gg(t,e),{node:t}}function KC(e=`h1`){return pg(new WC(e))}function qC(e){return e instanceof WC}function Bme(e){return Sm(Oh(e))&&!(jg(e)&&e.hasAttribute(`data-lexical-slot`))}function Vme(e){let t=e.focus;return t.key===`root`&&t.offset===jh().getChildrenSize()}function Hme(e){let t=e.focus;return t.key===`root`&&t.offset===0}function Ume(e,t){if(!e.isCollapsed())return!1;let n=t===`next`;if(!(n?Vme(e):Hme(e)))return!1;let r=e.focus.offset;return gg(jh().getChildAtIndex(n?r-1:r))}function JC(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(Fm(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&Fm(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var Wme={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function YC(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=Lm(e.focus,t),r=g_(n.origin,ug);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!ag(i,r))return!1;let a=Tb(n,_b(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=Tb(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!hb(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of Cb(_b(r,t))){if(!e.origin.is(c.getParent())){if(gg(e.origin)){let e=_b(c,t);return zm(Tb(e,e)),!0}break}if(!ug(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=Lm(e.anchor,t).getNodeAtCaret();return!(!ug(n)||n.isInline()||(zm(wb(Wm(bb(n,t)))),0))}(e,t)}function Gme(e){return Sm(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function XC(e){let t=Cy();t.add(e),Nh(t)}function Kme(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=Lm(n,i);if(n.type===`element`&&Z(r)&&dg(r)){let e=a.getNodeAtCaret();return!(e===null||!Gme(e)||(XC(e.__key),0))}let o=g_(Z(r)?r:r.getParentOrThrow(),e=>Z(e)&&!e.isInline()&&dg(e.getParent()));if(o===null)return!1;let s=_b(o,i).getNodeAtCaret();if(s===null||!Gme(s))return!1;if(o.getTextContentSize()===0)return XC(s.__key),!0;let c=Lg().getRootElement();if(c===null)return!1;let l=vg(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return qme(l,u,d,f,p),!1;let g=Oh(m);return qme(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!ag(g,o))&&(XC(s.__key),!0)}function qme(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function Jme(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=g_(Z(n)?n:n.getParentOrThrow(),e=>Z(e)&&!e.isInline());if(r===null)return!1;let i=Lg(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if(Z(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=_b(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!Z(c)){if(t){let e=r.getFirstDescendant();Fm(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(Fm(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=vg(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=bC(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(Fm(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function ZC(e,t){let n=_b(e,t),r=n.getAdjacentCaret();r!==null&&Z(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?zm(wb(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function QC(e,t){let n=e.getNodes().map(e=>_b(e,`next`)).sort(Db),r=n[0],i=n[n.length-1];if(!r||!i)return!1;for(let e=0;e<n.length-1;e++)if(!n[e+1].origin.is(n[e].getNodeAtCaret()))return!1;return zm(Km(Tb(Hm(r),i),t)),_ue(),!0}function $C(e,t,n){n.preventDefault(),n.stopPropagation();let r=e.getNodes();if(r.length===0)return!0;let i=r.map(e=>_b(e,`next`)).sort(Db),a=(t?i[0]:i[i.length-1]).origin,o=g_(a,e=>e!==a&&Z(e)&&!e.isInline())??jh(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function Yme(e,t){return e.length>0&&!t}function Xme(e,t=rx(Wme),n=rx(Yme)){return pv(e.registerCommand(od,n=>{let r=$();if(ty(r)){let t=n.target;if(jg(t))for(let n of r.getNodes()){let r=e.getElementByKey(n.getKey());if(r!==null&&r.contains(t))return!1}return r.clear(),!0}return Q(r)&&JC(r,`click`,`both`,t.peek()),!1},0),e.registerCommand(dd,e=>{let t=$();return Q(t)?(t.deleteCharacter(e),!0):!!ty(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(_d,e=>{let t=$();return!!Q(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(vd,e=>{let t=$();return!!Q(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(md,t=>{let n=$();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)OC(r,n,e);else if(Q(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(gd,()=>{let e=$();return!!Q(e)&&(e.removeText(),!0)},0),e.registerCommand(yd,e=>{let t=$();return!(!Q(t)&&!ty(t)||(iy(t,e),0))},0),e.registerCommand(yce,e=>{let t=$();return!(!Q(t)&&!ty(t)||(Rue(t,e),0))},0),e.registerCommand(zd,e=>{let t=$();if(!Q(t)&&!ty(t))return!1;let n=t.getNodes();for(let t of n){let n=g_(t,e=>Z(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(fd,e=>{let t=$();return!!Q(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(pd,()=>{let e=$();return!!Q(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(Fd,()=>{let e=th(),t=$();return Q(t)&&(e.setFormat(t.format),e.setStyle(t.style)),Py([e]),!0},0),e.registerCommand(Id,()=>Ide(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Ld,()=>Ide(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(Dd,e=>{let t=$();if(ty(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!QC(t,`previous`))return e.preventDefault(),ZC(n[0],`previous`),!0;t=$()}}return Q(t)&&(Hme(t)||!e.shiftKey&&YC(t,`previous`)||!e.shiftKey&&Kme(t,!0)||!e.shiftKey&&Jme(t,!0))?(e.preventDefault(),!0):!1},0),e.registerCommand(Od,e=>{let t=$();if(ty(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!QC(t,`next`))return e.preventDefault(),ZC(n[0],`next`),!0;t=$()}}return Q(t)&&(Vme(t)||!e.shiftKey&&YC(t,`next`)||!e.shiftKey&&Kme(t,!1)||!e.shiftKey&&Jme(t,!1))?(e.preventDefault(),!0):!1},0),e.registerCommand(Td,e=>{let n=$();if(ty(n)){let t=n.getNodes();if(t.length>0){let r=Pb(t[0])?`next`:`previous`;if(!e.shiftKey||!QC(n,r))return e.preventDefault(),ZC(t[0],r),!0;n=$()}}if(!Q(n))return!1;let r=Pb(n.anchor.getNode())?`next`:`previous`;if(Ume(n,r)||!e.shiftKey&&YC(n,r))return e.preventDefault(),!0;if(e.shiftKey||JC(n,`arrow`,`start`,t.peek()),Tde(n,!0)){let t=e.shiftKey;return e.preventDefault(),Ode(n,t,!0),!0}return!1},0),e.registerCommand(Cd,e=>{let n=$();if(ty(n)){let t=n.getNodes();if(t.length>0){let r=Pb(t[0])?`previous`:`next`;if(!e.shiftKey||!QC(n,r))return e.preventDefault(),ZC(t[0],r),!0;n=$()}}if(!Q(n))return!1;let r=Pb(n.anchor.getNode())?`previous`:`next`;if(Ume(n,r)||!e.shiftKey&&YC(n,r))return e.preventDefault(),!0;if(e.shiftKey||JC(n,`arrow`,`end`,t.peek()),Tde(n,!1)){let t=e.shiftKey;return e.preventDefault(),Ode(n,t,!1),!0}return!1},0),e.registerCommand(jd,t=>{let n=$();if(!ty(n)&&Bme(t.target))return!1;if(Q(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(Tm(n))return!1;let r=Fde(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Ld);if(Wu&&Uu)return!1}else if(!ty(n))return!1;return t.preventDefault(),e.dispatchCommand(dd,!0)},0),e.registerCommand(Nd,t=>{let n=$();return!(!ty(n)&&Bme(t.target))&&!(!Q(n)&&!ty(n))&&(t.preventDefault(),e.dispatchCommand(dd,!1))},0),e.registerCommand(kd,n=>{let r=$();if(ty(r)){let e=r.getNodes();e.length===1&&Sm(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Q(r))return!1;if(JC(r,`enter`,`both`,t.peek()),n!==null){if((Wu||Ku||Yu)&&Uu)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(fd,!1)}return e.dispatchCommand(pd)},0),e.registerCommand(Md,()=>!!Q($())&&(e.blur(),!0),0),e.registerCommand(Rd,t=>{let[,n]=zb(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=bC(r,i,e.getRootElement());if(a!==null){let{offset:e,node:t}=a,n=Oh(t);if(n!==null){let t=Sy();if(Fm(n))t.anchor.set(n.getKey(),e,`text`),t.focus.set(n.getKey(),e,`text`);else{let e=n.getParentOrThrow().getKey(),r=n.getIndexWithinParent()+1;t.anchor.set(e,r,`element`),t.focus.set(e,r,`element`)}Nh(fm(t))}}return!(!e.dispatchCommand(Ime,n)&&Wu&&n.every(e=>e.type===`text/plain`)||(t.preventDefault(),0))}return _me(t,e)},0),e.registerCommand(Bd,t=>{let[n]=zb(t),r=$();return!(n&&!Q(r)||(Q(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(LC(t.dataTransfer,IC(r)),hme(t.dataTransfer,e)),0))},0),e.registerCommand(Vd,t=>{let[n]=zb(t),r=$();if(n&&!Q(r))return!1;let i=t.clientX,a=t.clientY,o=bC(i,a,e.getRootElement());return o!==null&&Sm(Oh(o.node))&&t.preventDefault(),!0},0),e.registerCommand(Wd,()=>{let e=$();return zle(Q(e)&&tb(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(Hd,t=>!ch(t)&&(PC(e,Rb(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Ud,t=>!ch(t)&&(async function(e,t){t.update(()=>{let e=$();Q(e)&&!e.isCollapsed()&&ay(e)},{discrete:!0,tag:`cut`}),await PC(t,Rb(e,ClipboardEvent)?e:null),t.update(()=>{let e=$();Q(e)?e.removeText():ty(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(hd,t=>{let[,r,i]=zb(t);return!(!n.peek()(r,i)||!e.dispatchCommand(Ime,r))||!ch(t)&&$()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=$(),r=Rb(e,InputEvent)||Rb(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&OC(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(Ad,()=>{let e=$();return Q(e)&&JC(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(Pd,()=>{let e=$();return Q(e)&&JC(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(wd,e=>{let t=$();if(ty(t))return $C(t,!1,e);if(!Q(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!Z(r))return!1;let i=r.getFirstChild();if(!Sm(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(Ed,e=>{let t=$();if(ty(t))return $C(t,!0,e);if(!Q(t))return!1;let{anchor:n,focus:r}=t,i=g_(r.getNode(),e=>Z(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!Sm(a)||!a.isInline()||g_(n.getNode(),e=>Z(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function ew(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function tw(e){let t=ew(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var nw=/[!-/:-@[-`{-~\s]/,rw=/\s/,iw=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Zme=/^\s{0,3}$/;function aw(e){if(!$m(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&Fm(t)&&Zme.test(t.getTextContent())}function ow(e){return e.replace(/\\([!-/:-@[-`{-~])|&#(?:(\d{1,7})|[xX]([\da-fA-F]{1,6}));/g,(e,t,n,r)=>t??function(e,t){let n=e===void 0?parseInt(t,16):Number(e);return n===0||n>=55296&&n<=57343||n>1114111?`�`:String.fromCodePoint(n)}(n,r))}function sw(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1}function cw(e){let t=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},n=[],r=0;for(;r<e.length;)if(e[r]==="`"){let t=1;for(;r+t<e.length&&e[r+t]==="`";)t++;n.push({index:r,length:t}),r+=t}else r++;let i=[],a=0;for(;a<n.length;){let r=n[a];if(t(r.index)){a++;continue}let o=-1;for(let e=a+1;e<n.length;e++)if(n[e].length===r.length){o=e;break}if(o===-1){a++;continue}let s=n[o],c=e.slice(r.index+r.length,s.index);c.length>=2&&c.startsWith(` `)&&c.endsWith(` `)&&/[^ ]/.test(c)&&(c=c.slice(1,-1)),i.push({content:c,endIndex:s.index+s.length,startIndex:r.index}),a=o+1}return i}function lw(e,t,n,r,i){if(!uw(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!uw(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&iw.test(e)}return!0}function uw(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!rw.test(o)&&(!iw.test(o)||s===void 0||rw.test(s)||iw.test(s))}var dw=/^(\s*)(\d{1,})\.\s/,fw=/^(\s*)[-*+]\s/,Qme=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,pw=/^(#{1,6})\s/,mw=/^>\s/,hw=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,gw=/^[ \t]*`{3,}$/,$me=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,ehe=/^(?:\|)(.+)(?:\|)\s?$/;function the(e){if(e[0]!==`|`)return!1;let{length:t}=e,n=1,r=0;for(;n<t;){let t=n;for(e[t]===` `&&t++,e[t]===`:`&&t++;e[t]===`-`;)t++;if(e[t]===`:`&&t++,e[t]===` `&&t++,e[t]!==`|`)break;r++,n=t+1}return r>0&&(n===t||n===t-1&&/\s/.test(e[n]))}var _w=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,vw=/^<\/[a-z_][\w-]*\s*>/i,yw=e=>RegExp(`(?:${e.source})$`,e.flags),bw=Yf(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),xw=Yf(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),Sw=Yf(`mdCodeMeta`,{parse:e=>typeof e==`string`?e:``,resetOnCopyNode:!0}),Cw=Yf(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function ww(e){if(e.endsWith(`\\`)){let t=0;for(let n=e.length-1;n>=0&&e[n]===`\\`;n--)t++;return t%2==1?[e.slice(0,-1),`\\`]:null}let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function Tw(e){let t=T_(),n=function(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!Fm(r))return null;let i=r.getTextContent(),a=ww(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(E_(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}(e);return n!==null&&Zf(t,Cw,n),t}function Ew(e){return UC(e)}function Dw(e,t){let n=0;for(;n<t&&(e[n]===` `||e[n]===` `);)n++;return e.slice(n)}function nhe(e,t){let n=e.getLastChild();t&&_S(n)&&Zf(n,Sw,t)}var Ow=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)};function kw(e){let t=0;for(let n of e)t+=n===` `?4-t%4:1;return t}var Aw=null,jw=!1,Mw=e=>(t,n,r,i)=>{if(qC(t)||!i&&Ew(t))return!1;let a=t.getPreviousSibling(),o=t.getNextSibling(),s=gC(e===`check`?/^x$/i.test(r[3]||``):void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==bw.parse(c)?void 0:c,u=Aw,d=a;if(u!==null){if(jw)for(;d!==null&&aw(d);)d=d.getPreviousSibling();fC(d)||(u.length=0)}let f=u===null||u.length===0?function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]):function(e,t){let n=kw(t);for(let t=e.length-1;t>=0;t--)if(n>=e[t])return t+1;return 0}(u,r[1]);if(fC(o)&&o.getListType()===e){let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&f===0&&o.setStart(Number(r[2])),t.remove()}else if(fC(d)&&(d.getListType()===e||f>0))d.append(s),t.remove();else{let n=dC(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0),f&&(s.setIndent(f),function(e,t,n){let r=e.getParent();if(!fC(r)||r.getListType()===t)return;let i=r.getParent();if(!_C(i))return;let a=dC(t,t===`number`?Number(n[2]):void 0),o=e.getPreviousSibling()===null;a.append(e);let s=gC();s.append(a),o?i.insertBefore(s):i.insertAfter(s),r.getChildrenSize()===0&&i.remove()}(s,e,r));let p=s.getParent();l&&fC(p)&&Zf(p,bw,l),u!==null&&function(e,t,n,r){for(let n=e.length;n<t;n++)e[n]=4*(n+1);e.length=t,e[t]=function(e,t){let n=e[0];if(t===`check`){let t=n.slice(e[1].length).match(/^[-*+]\s/);t&&(n=e[1]+t[0])}return Math.min(kw(n),kw(e[1])+4)}(n,r)}(u,f,r,e)},Nw=(e,t,n,r)=>{let i=[],a=e.getChildren(),o=0;for(let s of a)if(_C(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(fC(e)){let a=Nw(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=Xf(e,bw),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(`
|
||
`)},rhe=Ow(e=>KC(`h`+e[1].length)),Pw={dependencies:[WC],export:(e,t)=>{if(!qC(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:pw,replace:(e,t,n,r)=>!(!r&&Ew(e))&&rhe(e,t,n,r),triggerOnEnter:!0,type:`element`},Fw={dependencies:[VC],export:(e,t)=>{if(!UC(e))return null;let n=t(e).split(`
|
||
`),r=[];for(let e of n)r.push(`> `+e);return r.join(`
|
||
`)},regExp:mw,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(UC(n))return n.splice(n.getChildrenSize(),0,[Tw(n),...t]),void e.remove()}let i=HC();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},Iw={dependencies:[hS],export:e=>{if(!_S(e))return null;let t=e.getTextContent(),n=Xf(e,xw);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}let r=e.getLanguage()||``,i=r?Xf(e,Sw):``;return n+r+(i?` `+i:``)+(t?`
|
||
`+t:``)+`
|
||
`+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,Iw.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i<e.length;i++){let a=e[i];if(u.test(a)){let s=a.match(u),c=e.slice(n+1,i),l=r[2]?o.slice(r[0].length).trim():``;return c.unshift(l?``:o.slice(r[0].length)),Iw.replace(t,null,r,s,c,!0),nhe(t,l),[!0,i]}}let d=e.slice(n+1);return d.unshift(o.slice(r[0].length)),Iw.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:gw},regExpStart:hw,replace:(e,t,n,r,i,a)=>{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0,u=n[1]?n[1].length-n[1].trimStart().length:0;if(!t&&i){if(i.length===1)r?(o=gS(l),s=Dw(i[0],u)):(o=gS(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=gS(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.map(e=>Dw(e,u)).join(`
|
||
`)}Zf(o,xw,c);let t=Pm(s);o.append(t),e.append(o)}else if(t){if(!a&&Ew(e))return!1;Ow(e=>gS(e?e[2]:void 0))(e,t,n,a)}},type:`multiline-element`},Lw={dependencies:[cC,pC],export:(e,t,n)=>fC(e)?Nw(e,t,0,n):null,regExp:fw,replace:Mw(`bullet`),triggerOnEnter:!0,type:`element`},Rw={dependencies:[cC,pC],export:(e,t,n)=>fC(e)?Nw(e,t,0,n):null,regExp:dw,replace:Mw(`number`),triggerOnEnter:!0,type:`element`},zw={format:[`code`],tag:"`",type:`text-format`},ihe={format:[`highlight`],tag:`==`,type:`text-format`},Bw={format:[`bold`,`italic`],tag:`***`,type:`text-format`},Vw={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},Hw={format:[`bold`],tag:`**`,type:`text-format`},Uw={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},Ww={format:[`strikethrough`],tag:`~~`,type:`text-format`},Gw={format:[`italic`],tag:`*`,type:`text-format`},Kw={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`};function qw(e){return e.replace(/&(?=#\d+;|#[Xx][\dA-Fa-f]+;|[A-Za-z][\dA-Za-z]*;)/g,`&`)}var Jw={dependencies:[US],export:(e,t,n)=>{if(!GS(e)||KS(e))return null;let r=t(e),i=e.getTitle();i!=null&&(i=qw(i).replace(/([\\"])/g,`\\$1`));let a=e.getURL(),o=qw(a),s=a===``||/\s/.test(a)?`<${o.replace(/([\\<>])/g,`\\$1`).replace(/\r/g,` `).replace(/\n/g,` `)}>`:o.replace(/([\\()])/g,`\\$1`).replace(/^</,`\\<`);return i?`[${r}](${s} "${i}")`:`[${r}](${s})`},importRegExp:/(?:\[(.+?)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))$/,replace:(e,t)=>{let n=t.input||``,r=t.index||0;if(g_(e,GS)||sw(n,r)||sw(n,r+t[1].length+1))return;let[,i,a,o,s,c,l]=t,u=ow(a??o??``),d=s??c??l,f=WS(u,{title:d==null?void 0:ow(d)}),p=function(e){let t=cw(e),n=0,r=e.replace(/\\.|[[\]]/g,(e,r)=>{for(;n<t.length&&r>=t[n].endIndex;)n++;return n<t.length&&r>=t[n].startIndex||e[0]===`\\`?` `.repeat(e.length):e}),i=[],a=!1;for(let e=0;e<r.length;e++){let t=r[e];t===`[`?i.push(e):t===`]`&&i.pop()===void 0&&(a=!0)}return i.pop()??(a?null:-1)}(i);if(p===null)return;let m=i,h=``;p!==-1&&(h=`[`+function(e){let t=``,n=0;for(let{startIndex:r,endIndex:i}of cw(e))t+=ow(e.slice(n,r))+e.slice(r,i),n=i;return t+ow(e.slice(n))}(i.slice(0,p)),m=i.slice(p+1));let g=e.getFormat(),_=Pm(m);return _.setFormat(g),f.append(_),e.replace(f),h&&f.insertBefore(Pm(h).setFormat(g)),_},trigger:`)`,type:`text-match`},ahe=[Pw,Fw,Lw,Rw],ohe=[Iw],she=[zw,Bw,Vw,Hw,Uw,ihe,Gw,Kw,Ww],che=[Jw];function lhe(...e){return e.flat()}var Yw=lhe(ahe,ohe,she,che);function Xw(e,t=!1){let n=e.split(`
|
||
`),r=0,i=[];for(let e=0;e<n.length;e++){let a=n[e],o=a.trimEnd(),s=i[i.length-1],c=e<n.length-1?ww(a):null,l=s!==void 0&&ww(s)!==null;if($me.test(o))i.push(o);else if(r===0){{let e=o.match(hw);if(e){r=e[1].trim().length,i.push(o);continue}}o===``||s===``||!s||pw.test(s)||pw.test(o)||mw.test(o)||dw.test(o)||fw.test(o)||Qme.test(o)||ehe.test(o)||the(o)||l||!t||_w.test(o)||vw.test(o)||yw(vw).test(s)||yw(_w).test(s)||gw.test(s)?i.push(!t&&o!==``||c!==null?a:o):i[i.length-1]=s+` `+(c===null?o:a).trimStart()}else{if(gw.test(o)&&o.trim().length>=r){r=0,i.push(o);continue}i.push(a)}}return i.join(`
|
||
`)}function uhe(e,t,n,r,i){for(let a of t){if(!a.export)continue;let t=a.export(e,e=>Zw(e,n,r,void 0,void 0,i));if(t!=null)return t}return Z(e)?Zw(e,n,r,void 0,void 0,i):Sm(e)?e.getTextContent():null}function Zw(e,t,n,r,i,a=!1){let o=[],s=e.getChildren();r||=[],i||=[];t:for(let e of s){for(let s of n){if(!s.export)continue;let c=s.export(e,e=>Zw(e,t,n,r,[...i,...r],a),(e,n)=>Qw(e,n,t,r,i,a));if(c!=null){o.push(c);continue t}}E_(e)?o.push(dhe(e)):Fm(e)?o.push(Qw(e,e.getTextContent(),t,r,i,a)):Z(e)?o.push(Zw(e,t,n,r,i,a)):Sm(e)&&o.push(e.getTextContent())}return o.join(``)}function dhe(e){return Xf(e,Cw)+`
|
||
`}function Qw(e,t,n,r,i,a=!1){let o=e.hasFormat(`code`),s,c,l,u,d=t;if(o||(d=a?d.replace(/([*_`~])/g,`\\$1`):d.replace(/([[\]*_`~\\]|<(?=\S|$)|&(?=#|$))/g,e=>/[*_`~\\]/.test(e)?`\\${e}`:`&#${e.charCodeAt(0)};`)),o){let{fence:e,padded:n}=function(e){let t=e.match(/`+/g),n=t?Math.max(...t.map(e=>e.length)):0;return{fence:"`".repeat(n+1),padded:e.length===0||e.includes("`")||/^\s/.test(e)&&/\s$/.test(e)?` ${e} `:e}}(t);s=``,l=``,c=e+n+e,u=!1}else{let e=d.match(/^(\s*)(.*?)(\s*)$/s)||[``,``,d,``];s=e[1],c=e[2],l=e[3],u=c===``}let f=``,p=``,m=``,h=$w(e,!0),g=$w(e,!1),_=new Set;for(let t of n){let n=t.format[0],i=t.tag;n!==`code`&&(u||!tT(e,n)||_.has(n)||(_.add(n),tT(h,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),f+=i)))}for(let t=0;t<r.length;t++){let n=eT(e,r[t].format),a=eT(g,r[t].format);if(n&&a)continue;let o=[...r];for(;o.length>t;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&typeof e.tag==`string`&&(n?a||(m+=e.tag):p+=e.tag),r.pop())}break}return u&&!e.hasFormat(`code`)?p+d:p+s+f+c+m+l}function $w(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return Fm(n)?n:null}function eT(e,t){return Fm(e)&&e.hasFormat(t)}function tT(e,t){return!(!eT(e,t)||t!==`code`&&e&&/^\s*$/.test(e.getTextContent()))}function fhe(e,t){let n=new RegExp(t.source,t.flags.replace(/[gy]/g,``)+`g`),r;for(;(r=n.exec(e))!==null;){if(!sw(e,r.index))return r;n.lastIndex=r.index+1}return null}function nT(e){return Fm(e)&&!e.hasFormat(`code`)}function rT(e,t,n){let r=function(e,t){let n=e.getTextContent(),r=t.transformersByTag["`"],i=[],a=null;if(r){let e=cw(n);for(let t of e)a||={content:t.content,endIndex:t.endIndex,startIndex:t.startIndex,tag:"`"},i.push({end:t.endIndex,start:t.startIndex})}let o=function(e,t,n=[]){let r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>e[0]!=="`").map(e=>e[0])),a=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},o=e=>n.some(t=>e>=t.start&&e<t.end),s=0;for(;s<e.length;){let t=e[s];if(!i.has(t)||a(s)||o(s)){s++;continue}let n=1;for(;s+n<e.length&&e[s+n]===t;)n++;let c=lw(t,e,s,n,!0),l=lw(t,e,s,n,!1);(c||l)&&r.push({active:!0,canClose:l,canOpen:c,char:t,index:s,length:n}),s+=n}return r}(n,t,i),s=o.length>0?function(e,t,n){let r={},i=0,a=null;for(;i<t.length;){let o=t[i];if(!o.active||!o.canClose||o.length===0){i++;continue}let s=`${o.char}${o.canOpen}${o.length%3}`,c=r[s]??-1,l=!1;for(let r=i-1;r>c;r--){let s=t[r];if(!s.active||!s.canOpen||s.length===0||s.char!==o.char||(s.canClose||o.canOpen)&&(s.length+o.length)%3==0&&s.length%3!=0&&o.length%3!=0)continue;let c=Math.min(s.length,o.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===s.char&&e.length<=c).sort((e,t)=>t.length-e.length)[0];if(!u)continue;l=!0;let d=u.length,f={content:e.slice(s.index+s.length,o.index),endIndex:o.index+d,startIndex:s.index+(s.length-d),tag:u};(!a||f.startIndex<a.startIndex||f.startIndex===a.startIndex&&f.endIndex>a.endIndex)&&(a=f);for(let e=r+1;e<i;e++)t[e].active=!1;s.length-=d,o.length-=d,s.active=s.length>0,o.length>0?o.index+=d:(o.active=!1,i++);break}l||(r[s]=i-1,o.canOpen||(o.active=!1),i++)}return a}(n,o,t):null,c=null,l=null;if(a&&s?s.startIndex<=a.startIndex&&s.endIndex>=a.endIndex?(c=s,l=t.transformersByTag[s.tag]):(c=a,l=r):a?(c=a,l=r):s&&(c=s,l=t.transformersByTag[s.tag]),!c||!l)return null;let u=[n.slice(c.startIndex,c.endIndex),c.tag,c.content];return u.index=c.startIndex,u.input=n,{endIndex:c.endIndex,isCodeSpan:l===r,match:u,startIndex:c.startIndex,transformer:l}}(e,t),i=function(e,t){let n=e,r,i,a,o;for(let e of t){if(!e.replace||!e.importRegExp)continue;let t=n.getTextContent(),s=Jw.importRegExp!==void 0&&e.importRegExp.source===Jw.importRegExp.source?fhe(t,e.importRegExp):t.match(e.importRegExp);if(!s)continue;let c=s.index||0,l=e.getEndIndex?e.getEndIndex(n,s):c+s[0].length;!1!==l&&(r===void 0||i===void 0||c<r&&(l>i||l<=r))&&(r=c,i=l,a=e,o=s)}return r===void 0||i===void 0||a===void 0||o===void 0?null:{endIndex:i,match:o,startIndex:r,transformer:a}}(e,n);if(r&&i&&(r.isCodeSpan?i.startIndex<=r.startIndex&&i.endIndex>=r.endIndex?r=null:i=null:r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){let i=function(e,t,n,r,i){let a=e.getTextContent(),o,s,c;if(i[0]===a?o=e:t===0?[o,s]=e.splitText(n):[c,o,s]=e.splitText(t,n),o.setTextContent(i[2]),r)for(let e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:s,nodeBefore:c,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);nT(i.nodeAfter)&&rT(i.nodeAfter,t,n),nT(i.nodeBefore)&&rT(i.nodeBefore,t,n),nT(i.transformedNode)&&rT(i.transformedNode,t,n)}else if(i){let r=function(e,t,n,r,i){let a,o,s;return t===0?[a,o]=e.splitText(n):[s,a,o]=e.splitText(t,n),r.replace?{matchedNode:a,nodeAfter:o,nodeBefore:s,transformedNode:r.replace(a,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;nT(r.nodeAfter)&&rT(r.nodeAfter,t,n),nT(r.nodeBefore)&&rT(r.nodeBefore,t,n),nT(r.transformedNode)?rT(r.transformedNode,t,n):r.transformedNode===void 0&&nT(r.matchedNode)&&r.matchedNode.getParent()!==null&&r.matchedNode.setTextContent(ow(r.matchedNode.getTextContent()))}if(!r&&!i){let t=ow(e.getTextContent());e.setTextContent(t)}}function iT(e,t,n,r=!1){let i=tw(n),a=function(e){let t={},n={},r=[];for(let i of e){let{tag:e}=i;t[e]=i;let a=e.replace(/(\*|\^|\+)/g,`\\$1`);r.push(a),n[e]=e.length===1?RegExp(e==="`"?"(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)":`(^|[^\\\\${a}])(${a})((\\\\${a})?.*?[^${a}\\s](\\\\${a})?)(${a})(?![\\\\${a}])`):RegExp(`(^|[^\\\\])(${a})((\\\\${a})?.*?[^\\s](\\\\${a})?)(${a})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(${r.join(`|`)})`,`g`),transformersByTag:t}}(i.textFormat),o=e.split(`
|
||
`),s=o.length;(function(e){let n=Aw,c=jw;Aw=[],jw=e;try{return(()=>{for(let e=0;e<s;e++){let n=o[e],[s,c]=phe(o,e,i.multilineElement,t);s?e=c:mhe(n,t,i.element,a,i.textMatch,r)}})()}finally{Aw=n,jw=c}})(!r);let c=t.getChildren();for(let e of c)if(!r&&aw(e)&&t.getChildrenSize()>1)e.remove();else if(Z(e))for(let t of e.getAllTextNodes())hhe(t)}function phe(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d<f;){let n=l?e[d].match(l):null;if(!n&&(!u||u&&d<f-1)||n&&t===d&&n.index===c.index){d++;continue}let i=[];if(n&&t===d)i.push(e[t].slice(c[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){let t=e[r].slice(c[0].length);i.push(t)}else if(r===d&&n){let t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==s(r,null,c,n,i,!0))return[!0,d];break}}return[!1,t]}function mhe(e,t,n,r,i,a){let o=Pm(e),s=Qm();s.append(o),t.append(s);for(let{regExp:t,replace:r}of n){let n=e.match(t);if(n&&(o.setTextContent(e.slice(n[0].length)),!1!==r(s,[o],n,!0)))break}if(rT(o,r,i),s.getParent()!==null&&e.length>0){let e=s.getPreviousSibling();if(!a&&($m(e)||UC(e)||fC(e))){let t=e;if(fC(e)){let n=e.getLastDescendant();t=n==null?null:g_(n,_C)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[Tw(t),...s.getChildren()]),s.remove())}}}function hhe(e){if(nh(e))return;let t=e.getTextContent();if(!t.includes(` `))return;let n=e.getFormat(),r=e.getStyle(),i=[],a=0;for(let e=t.indexOf(` `);e!==-1;e=t.indexOf(` `,e+1))e>a&&i.push(Pm(t.slice(a,e)).setFormat(n).setStyle(r)),i.push(th()),a=e+1;a<t.length&&i.push(Pm(t.slice(a)).setFormat(n).setStyle(r)),e.getParentOrThrow().splice(e.getIndexWithinParent(),1,i)}function ghe(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function aT(e,t,n,r,i){if(!dg(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExp:o,replace:s}of r){let r=a.match(o),c=i||r&&r[0].endsWith(` `)?n:n-1;if(r&&r[0].length===c){let i=t.getNextSiblings(),[a,o]=t.splitText(n);if(!1!==s(e,o?[o,...i]:i,r,!1))return a.remove(),!0}}return!1}function oT(e,t,n,r,i){if(!dg(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExpStart:o,replace:s,regExpEnd:c}of r){if(c&&!(`optional`in c)||c&&`optional`in c&&!c.optional)continue;let r=a.match(o);if(r){let a=i||r[0].endsWith(` `)?n:n-1;if(r[0].length!==a)continue;let o=t.getNextSiblings(),[c,l]=t.splitText(n);if(!1!==s(e,l?[l,...o]:o,r,null,null,!1))return c.remove(),!0}}return!1}function _he(e,t){let n=0,r=e.getTextContent();for(let e=0;e<t;e++)r[e]==="`"&&n++;return n%2!=0}function sT(e,t,n){let r=n.length;for(let i=t;i>=r;i--){let t=i-r;if(lT(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function cT(e){let t=e.getNode(),n=0;if(Fm(t))n=e.offset;else if(Z(t))for(let r of t.getChildren().slice(0,e.offset))n+=r.getTextContentSize();for(let e=t.getPreviousSibling();e!==null;e=e.getPreviousSibling())n+=e.getTextContentSize();return n}function lT(e,t,n,r,i){for(let a=0;a<i;a++)if(e[t+a]!==n[r+a])return!1;return!0}function vhe(e,t=Yw){let n=tw(t),r=n.element.filter(e=>e.triggerOnEnter),i=ew(n.textFormat,({tag:e})=>e[e.length-1]),a=ew(n.textMatch,({trigger:e})=>e),o=new Set([` `]);for(let e of n.textFormat)o.add(e.tag.slice(-1));for(let e of n.textMatch)e.trigger!==void 0&&o.add(e.trigger);for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||ghe(173,n.getType())}}return pv(e.registerUpdateListener(({tags:t,dirtyLeaves:r,editorState:s,prevEditorState:c})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let l=t.has(`composition-end`),u=s.read($),d=c.read($);if(!Q(d)||!Q(u)||!u.isCollapsed()||u.is(d)&&!l)return;let f=u.anchor.key,p=u.anchor.offset,m=s._nodeMap.get(f);if(Fm(m)&&r.has(f)&&(l||p===1||!(s.read(()=>cT(u.anchor))>c.read(()=>cT(d.anchor))+1))){if(l){let e=s.read(()=>m.getTextContent())[p-1];if(!o.has(e))return}e.update(()=>{if(!nT(m))return;let e=m.getParent();e===null||_S(e)||((e,t,r)=>!!(aT(e,t,r,n.element)||oT(e,t,r,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t<r.length&&(r=r.slice(0,t));for(let t of i){if(!t.replace||!t.regExp)continue;let n=r.match(t.regExp);if(n===null)continue;let i=n.index||0,a=i+n[0].length,o;return i===0?[o]=e.splitText(a):[,o]=e.splitText(i,a),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,r,a)||function(e,t,n){let r=e.getTextContent(),i=t-1,a=r[i],o=n[a];if(!o)return!1;for(let t of o){let{tag:n}=t,o=n.length,s=i-o+1;if(o>1&&!lT(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!nw.test(c))continue;let l=e,u=l,d=sT(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!E_(f);)if(Fm(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=sT(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!nw.test(m)||!t.format.includes(`code`)&&_he(u,d))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=$(),y=Sy();Nh(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.formatText(e,$u[e]);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return Q(v)&&(y.format=v.format),!0}return!1}(t,r,i)))(e,m,u.anchor.offset)&&rg(`history-push`)})}}),e.registerCommand(kd,e=>{if(e!==null&&e.shiftKey)return!1;let t=$();if(!Q(t)||!t.isCollapsed())return!1;let i=t.anchor.offset,a=t.anchor.getNode();if(!Fm(a)||!nT(a))return!1;let o=a.getParent();return o!==null&&!_S(o)&&!(i!==a.getTextContent().length||!oT(o,a,i,n.multilineElement,!0)&&!aT(o,a,i,r,!0)||(e!==null&&e.preventDefault(),0))},1))}function uT(e,t=Yw,n,r=!1,i=!1){let a=r?e:Xw(e,i),o=n||jh();o.clear(),iT(a,o,t,r),$()!==null&&o.selectStart()}function yhe(e,t=Yw,n=!1,r=!1){let i=n?e:Xw(e,r),a=new C_;return iT(i,a,t,n),a.getChildren()}function dT(e=Yw,t,n=!1){return function(e,t=!1){let n=tw(e),r=[...n.multilineElement,...n.element],i=!t,a=n.textFormat.filter(e=>e.format.length===1).sort((e,t)=>Number(e.format.includes(`code`))-Number(t.format.includes(`code`)));return e=>{let o=[],s=(e||jh()).getChildren();for(let e=0;e<s.length;e++){let c=s[e],l=uhe(c,r,a,n.textMatch,t);l!=null&&o.push(i&&e>0&&!aw(c)&&!aw(s[e-1])?`
|
||
${l}`:l)}return o.join(`
|
||
`)}}(e,n)(t)}var bhe=/^([ \t]*`{3,})[ \t]*([\w-]+)?[ \t]*/,fT={...Iw,export:(e,t)=>{let n=Iw.export?.(e,t)??null,[r]=n?.split(`
|
||
`,1)??[];if(!n||!r.includes(``))return n;let i=n.slice(r.length,n.lastIndexOf(`
|
||
`)),a=Math.max(2,...(i.match(/^[ \t]*~+/gm)??[]).map(e=>e.trim().length)),o=`~`.repeat(a+1);return`${r.replace(/^`+/,o).replaceAll(``,"`")}${i}\n${o}`},handleImportAfterStartMatch:({lines:e,startLineIndex:t,...n})=>{let r=e[t].match(bhe),i=r[1].trim(),a=RegExp(`^[ \\t]*\`{${i.length},}$`),o=e.slice(t+1).some(e=>a.test(e)),s=Iw.handleImportAfterStartMatch?.({...n,lines:o?e:[...e,i],startLineIndex:t,startMatch:r});return s&&[s[0],Math.min(s[1],e.length-1)]},regExpStart:RegExp(`${Iw.regExpStart.source}(?=[^\`]*$)`)},pT=e=>Fm(e)&&e.hasFormat(`code`)&&/^\s+$/.test(e.getTextContent()),mT=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(![e,t,n].some(pT))return e;let r=e=>pT(e)?Object.create(e,{getTextContent:{value:()=>``}}):e;return Object.create(r(e),{getPreviousSibling:{value:()=>r(t)},getNextSibling:{value:()=>r(n)}})},hT=e=>{if(!$m(e))return!1;let t=e.getFirstChild();return!t||e.getChildrenSize()===1&&Fm(t)&&/^\s{0,3}$/.test(t.getTextContent())},xhe=e=>{let t=e.getParent();if(!hT(t)||!Tm(t?.getParent()))return[``,``];let n=t?.getPreviousSibling()??null,r=t?.getNextSibling()??null;return[n&&!hT(n)?`
|
||
`:``,r&&!(e=>{let t=e?.getFirstChild();return hT(e)&&!(Fm(t)&&t.hasFormat(`code`))})(r)?`
|
||
`:``]},gT={dependencies:[],export:(e,t,n)=>{if(!Fm(e)||!e.hasFormat(`code`))return null;let r=e.getTextContent(),i=mT(e),[a,o]=pT(e)?xhe(e):[``,``],s=!r.includes("`")&&/^\s/.test(r)&&/\s$/.test(r)&&!(r.startsWith(` `)&&r.endsWith(` `)&&/[^ ]/.test(r));if(!s&&i===e&&!a&&!o)return null;let c=n(i,r);return`${a}${s?c.replace(`\` ${r} \``,()=>`\`${r}\``):c}${o}`},importRegExp:/^(`+)(?!`)([^]*?[^`])\1(?!`)/,regExp:/(?!)/,replace:(e,[,,t])=>{let n=Pm(/^ .*[^ ].* $/s.test(t)?t.slice(1,-1):t).setFormat(e.getFormat()).setStyle(e.getStyle()).toggleFormat(`code`);return e.replace(n),n},type:`text-match`},_T={bold:[`**`,`__`],italic:[`_`,`*`],strikethrough:[`~~`]},She=/^(?:\*\*|__|~~|\*|_)/,vT=e=>Fm(e)&&e.hasFormat(`code`)?"`":e?.getTextContent()??``,Che=e=>{let t=e.getChildren();if(!t.length||!t.every(e=>Fm(e)&&/\S/.test(vT(e)))||/^\s/.test(vT(t[0]))||/\s$/.test(vT(t.at(-1))))return[];let n=Object.keys(_T).filter(e=>t.every(t=>t.hasFormat(e))),r=(e,t)=>{if(!e||E_(e))return!0;if(!Fm(e))return!1;let r=t(vT(e))??``;return n.some(t=>e.hasFormat(t))?/\s/.test(r):/[\s\p{P}\p{S}]/u.test(r)};return n.length&&r(e.getPreviousSibling(),e=>e.at(-1))&&r(e.getNextSibling(),e=>e[0])?n:[]},whe=(e,t)=>{let n=[...t],r=``;for(;n.length;){let[t]=e.slice(r.length).match(She)??[],i=n.findIndex(e=>_T[e]?.includes(t??``));if(!t||i===-1)return;n.splice(i,1),r+=t}let i=[...r].reverse().join(``);if(!(e.length<r.length*2||!e.endsWith(i)))return{text:e.slice(r.length,-i.length),delimiters:r}},yT={...Jw,export:(e,t,n)=>{let r=GS(e)?Che(e):[],i,a=Jw.export?.(e,e=>{let n=t(e),a=r.length?whe(n,r):void 0;return i=a?.delimiters,a?.text??n},n);return a&&i?`${i}${a}${[...i].reverse().join(``)}`:a??null}},The={text:{italic:`italic`,strikethrough:`strikethrough`},list:{nested:{listitem:`nested`}},code:`code-block`,tableScrollableWrapper:`table-wrapper`,tableCellSelected:`selected`,tableSelection:`table-selection`},bT={bold:{labelKey:`bold`,icon:`format_bold`,inline:!0},italic:{labelKey:`italic`,icon:`format_italic`,inline:!0},strikethrough:{labelKey:`strikethrough`,icon:`strikethrough_s`,inline:!0},code:{labelKey:`code`,icon:`code`,inline:!0},link:{labelKey:`link`,icon:`link`,inline:!0},paragraph:{labelKey:`paragraph`,icon:`format_paragraph`,inline:!1},"heading-1":{labelKey:`heading_1`,icon:`format_h1`,inline:!1},"heading-2":{labelKey:`heading_2`,icon:`format_h2`,inline:!1},"heading-3":{labelKey:`heading_3`,icon:`format_h3`,inline:!1},"heading-4":{labelKey:`heading_4`,icon:`format_h4`,inline:!1},"heading-5":{labelKey:`heading_5`,icon:`format_h5`,inline:!1},"heading-6":{labelKey:`heading_6`,icon:`format_h6`,inline:!1},"bulleted-list":{labelKey:`bulleted_list`,icon:`format_list_bulleted`,inline:!1},"numbered-list":{labelKey:`numbered_list`,icon:`format_list_numbered`,inline:!1},blockquote:{labelKey:`blockquote`,icon:`format_quote`,inline:!1},"code-block":{labelKey:`code_block`,icon:`code_blocks`,inline:!1},table:{labelKey:`insert_table`,icon:`table`,inline:!1},"horizontal-rule":{labelKey:`insert_horizontal_rule`,icon:`horizontal_rule`,inline:!1}},xT=[`bold`,`italic`,`strikethrough`,`code`],ST=[...xT,`link`],CT=[`paragraph`,`heading-1`,`heading-2`,`heading-3`,`heading-4`,`heading-5`,`heading-6`,`bulleted-list`,`numbered-list`,`blockquote`,`code-block`],Ehe={"heading-1":[WC],"heading-2":[WC],"heading-3":[WC],"heading-4":[WC],"heading-5":[WC],"heading-6":[WC],"bulleted-list":[cC,pC],"numbered-list":[cC,pC],blockquote:[VC],"code-block":[hS,CS],link:[US]},Dhe={"heading-1":[Pw],"heading-2":[Pw],"heading-3":[Pw],"heading-4":[Pw],"heading-5":[Pw],"heading-6":[Pw],"bulleted-list":[Lw],"numbered-list":[Rw],blockquote:[Fw],"code-block":[fT],code:[zw,gT],bold:[Hw,Uw,Bw,Vw],italic:[Kw,Gw,Bw,Vw],strikethrough:[Ww],link:[yT]},Ohe=[`*`,`__`,`***`,`___`],wT=rd(`OPEN_LINK_EDITOR_COMMAND`),TT=[{type:`left`,labelKey:`align_left`,icon:`format_align_left`},{type:`center`,labelKey:`align_center`,icon:`format_align_center`},{type:`right`,labelKey:`align_right`,icon:`format_align_right`},{type:`justify`,labelKey:`align_justify`,icon:`format_align_justify`}];function ET(e){return JSON.stringify([e.exportJSON(),Z(e)?e.getChildrenKeys():null])}function khe(e,t,n){let r=n(),i=0,a=r,o=0,s=null,c=new Set;return(l,u,d,f,p,m)=>{let h=n();if(m.has(`composition-start`)&&(a=r,o=i,s=l,c.clear()),s!==null){for(let e of f)c.add(e);for(let e of p.keys())c.add(e)}if(m.has(`historic`))return i=0,r=h,s=null,c.clear(),2;let g=m.has(`composition-end`);g&&s&&(r=a,i=o,l=s);let _=m.has(`paste`)||m.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(Q(a)&&Q(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||Tm(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Fm(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!Fm(l)||!Fm(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(l,u,f,p,e.isComposing()),v=!1,y=(()=>{let n=d===null||d.editor===e,a=m.has(`history-push`),o=!a&&n&&m.has(`history-merge`);if(g&&s!==null&&n&&!a&&function(e,t,n){for(let r of e){let e=t._nodeMap.get(r),i=n._nodeMap.get(r);if(!(e===i||e&&i&&t.read(()=>ET(e))===n.read(()=>ET(i))))return!1}return!0}(c,s,u))return v=!0,0;if(o)return 0;if(_===1)return 2;if(l===null)return 1;let y=u._selection;if(!(f.size>0||p.size>0))return y===null?2:0;let b=typeof t==`number`?t:t.peek();return!1===a&&_!==0&&_===i&&h<r+b&&n||!a&&f.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(Q(a)&&Q(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!Fm(r)||!Fm(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],l,u)?0:1})();return g&&(s=null,c.clear()),v||(r=h,i=_),y}}function DT(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function OT(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function Ahe(e,t,n,r=Date.now,i,a=null){let o=khe(e,n,r),s=()=>{i&&i(t)};return s(),pv(e.registerCommand(bd,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=DT(o,a);t!==null&&(r.push(t),e.dispatchCommand(Gd,!0))}i.length===0&&e.dispatchCommand(Kd,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(xd,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=DT(o,a);t!==null&&(i.push(t),e.dispatchCommand(Kd,!0))}r.length===0&&e.dispatchCommand(Gd,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(xce,()=>(OT(t,i),!1),0),e.registerCommand(Sce,()=>(OT(t,i),e.dispatchCommand(Gd,!1),e.dispatchCommand(Kd,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(Gd,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(Kd,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function jhe(){return{current:null,redoStack:[],undoStack:[]}}var kT=/^(\d+(?:\.\d+)?)px$/,Mhe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function AT(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Mhe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function jT(e,t,n,r,i){let a=AT(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Nhe(e,t){e.__colWidths=t.__colWidths,e.__frozenColumnCount=t.__frozenColumnCount,e.__frozenRowCount=t.__frozenRowCount,e.__rowStriping=t.__rowStriping}var Phe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],colWidths:e.__colWidths,frozenColumnCount:e.getSerializedFrozenColumnCount(),frozenRowCount:e.getSerializedFrozenRowCount(),rowStriping:e.getSerializedRowStriping(),direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__colWidths;o!==void 0&&(a.colWidths=o);let s=e.getSerializedFrozenColumnCount();s!==void 0&&s!==0&&(a.frozenColumnCount=s);let c=e.getSerializedFrozenRowCount();c!==void 0&&c!==0&&(a.frozenRowCount=c);let l=e.getSerializedRowStriping();l!==void 0&&!1!==l&&(a.rowStriping=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jT(t.indent,0,0,1/0),e.__textFormat=AT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.colWidths;e.setColWidths(s===void 0?void 0:Array.isArray(s)?Array.from(s,e=>AT(e,0)):[]),e.__frozenColumnCount=AT(t.frozenColumnCount,0),e.__frozenRowCount=AT(t.frozenRowCount,0);let c=t.rowStriping;return e.__rowStriping=typeof c==`boolean`&&c,e},afterCloneFrom:Nhe}};function Fhe(e,t){e.__height=t.__height}var Ihe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],height:e.__height,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__height;o!==void 0&&(a.height=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jT(t.indent,0,0,1/0),e.__textFormat=AT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.height;return e.__height=s===void 0?void 0:AT(s,0),e},afterCloneFrom:Fhe}};function Lhe(e,t){e.__backgroundColor=t.__backgroundColor,e.__colSpan=t.__colSpan,e.__headerState=t.__headerState,e.__rowSpan=t.__rowSpan,e.__verticalAlign=t.__verticalAlign,e.__width=t.__width}var Rhe=e=>{let t=wf(e,`format`),n=Tf(e,`format`),r=Df(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],backgroundColor:e.__backgroundColor,colSpan:e.__colSpan,headerState:e.__headerState,rowSpan:e.__rowSpan,verticalAlign:e.getSerializedVerticalAlign(),width:e.__width,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__backgroundColor;o!=null&&(a.backgroundColor=o);let s=e.__colSpan;s!==void 0&&s!==1&&(a.colSpan=s);let c=e.__headerState;c!==void 0&&c!==0&&(a.headerState=c);let l=e.__rowSpan;l!==void 0&&l!==1&&(a.rowSpan=l);let u=e.getSerializedVerticalAlign();u!==void 0&&(a.verticalAlign=u);let d=e.__width;d!==void 0&&(a.width=d);let f=e.__dir;f!=null&&(a.direction=f);let p=t[e.__format];p!==void 0&&p!==``&&(a.format=p);let m=e.__indent;return m!==void 0&&m!==0&&(a.indent=m),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jT(t.indent,0,0,1/0),e.__textFormat=AT(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.backgroundColor;e.__backgroundColor=typeof s==`string`&&s!==``?s:null,e.__colSpan=jT(t.colSpan,1,1,1/0),e.setHeaderStyles(AT(t.headerState,0)),e.__rowSpan=jT(t.rowSpan,1,1,1/0);let c=t.verticalAlign;e.__verticalAlign=c===`middle`||c===`bottom`?c:void 0;let l=t.width;return e.__width=l===void 0||AT(l,0)===0?void 0:AT(l,0),e},afterCloneFrom:Lhe}},MT={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},zhe=Uf()({backgroundColor:Gf(Vf(Lf(),{defaultAsNull:!0}),{field:`__backgroundColor`}),colSpan:Gf(Rf(1,{integer:!0,min:1}),{field:`__colSpan`}),headerState:Kf(Rf(0),{getter:{field:`__headerState`,method:`getHeaderStyles`},setter:`setHeaderStyles`}),rowSpan:Gf(Rf(1,{integer:!0,min:1}),{field:`__rowSpan`}),verticalAlign:Kf(Bf([void 0,`middle`,`bottom`]),{getter:`getSerializedVerticalAlign`,setter:{field:`__verticalAlign`}}),width:Gf(Hf(Rf(),{omitDefault:!0}),{field:`__width`})}),NT=class extends bm{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config(`tablecell`,{children:`block`,extends:bm,generated:Rhe,importDOM:{td:()=>({conversion:FT,priority:0}),th:()=>({conversion:FT,priority:0})},json:zhe})}constructor(e=MT.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=Cg().createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),PT(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),Mb(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(jg(t.element)){let e=t.element;e.setAttribute(`data-temporary-table-cell-lexical-key`,this.getKey()),e.style.border=`1px solid black`,this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||`top`,e.style.textAlign=`start`,this.__backgroundColor===null&&this.hasHeader()&&(e.style.backgroundColor=`#f2f3f5`)}return t}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?`th`:`td`}setHeaderStyles(e,t=MT.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getSerializedVerticalAlign(){let e=this.getLatest().__verticalAlign;return PT(e)?e:void 0}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState&=~e:t.__headerState|=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==MT.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function PT(e){return e===`middle`||e===`bottom`}function FT(e){let t=e,n=e.nodeName.toLowerCase(),r;kT.test(t.style.width)&&(r=parseFloat(t.style.width));let i=MT.NO_STATUS;if(n===`th`){let e=t.getAttribute(`scope`);if(e===`col`)i=MT.COLUMN;else if(e===`row`)i=MT.ROW;else{let e=t.parentElement,n=jg(e)&&e.nodeName.toLowerCase()===`tr`&&jg(e.parentElement)&&(e.parentElement.nodeName.toLowerCase()===`thead`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=MT.ROW),r&&(i|=MT.COLUMN),i===MT.NO_STATUS&&(i=MT.ROW)}}let a=IT(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;PT(s)&&(a.__verticalAlign=s),Gg(a,t);let c=t.style,l=(c&&c.textDecoration||``).split(` `),u=c.fontWeight===`700`||c.fontWeight===`bold`,d=l.includes(`line-through`),f=c.fontStyle===`italic`,p=l.includes(`underline`),m=c.color;return{after:e=>{let t=[],n=null,r=()=>{if(n){let e=n.getFirstChild();E_(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)if(cg(i)||Fm(i)||E_(i)){if(Fm(i)&&(u&&i.toggleFormat(`bold`),d&&i.toggleFormat(`strikethrough`),f&&i.toggleFormat(`italic`),p&&i.toggleFormat(`underline`),m)){let e=i.getStyle();e.includes(`color:`)||i.setStyle(e+`color: ${m};`)}n?n.append(i):(n=Qm().append(i),t.push(n))}else t.push(i),r(),n=null;return r(),t.length===0&&t.push(Qm()),t},node:a}}function IT(e=MT.NO_STATUS,t=1,n){return pg(new NT(e,t,n))}function LT(e){return e instanceof NT}var Bhe=rd(`INSERT_TABLE_COMMAND`);function RT(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Vhe=Uf()({height:Gf(Hf(Rf()),{field:`__height`})}),zT=class extends bm{__height;$config(){return this.config(`tablerow`,{extends:bm,generated:Ihe,importDOM:{tr:()=>({conversion:Hhe,priority:0})},json:Vhe})}constructor(e=void 0,t){super(t),this.__height=e}createDOM(e){let t=Cg().createElement(`tr`);return this.__height&&(t.style.height=`${this.__height}px`),Mb(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n===`html`}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function Hhe(e){let t=e,n;return kT.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:e=>Bb(e,LT),node:Gg(BT(n),t)}}function BT(e){return pg(new zT(e))}function VT(e){return e instanceof zT}function HT(e,t,n=!0){let r=KE();for(let i=0;i<e;i++){let e=BT();for(let r=0;r<t;r++){let t=MT.NO_STATUS;typeof n==`object`?(i===0&&n.rows&&(t|=MT.ROW),r===0&&n.columns&&(t|=MT.COLUMN)):n&&(i===0&&(t|=MT.ROW),r===0&&(t|=MT.COLUMN));let a=IT(t),o=Qm();o.append(Pm()),a.append(o),e.append(a)}r.append(e)}return r}function Uhe(e){let t=g_(e,e=>qE(e));if(qE(t))return t;throw Error(`Expected table cell to be inside of table.`)}var UT=(e,t)=>e===MT.BOTH||e===t?t:MT.NO_STATUS;function Whe(e=!0){let t=$();Q(t)||iE(t)||RT(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=QT(n),[a,,o]=QT(r),[,s,c]=YT(o,a,i),{startRow:l}=c,{startRow:u}=s;return e?WT(l+i.__rowSpan>u+a.__rowSpan?i:a,!0):WT(u<l?a:i,!1)}function WT(e,t=!0){let[,,n]=QT(e);ZT(n);let[r,i]=YT(n,e,e),a=r[0].length,{startRow:o}=i,s=null;if(t){let t=o+e.__rowSpan-1,i=r[t],c=BT();for(let e=0;e<a;e++){let{cell:n,startRow:r}=i[e];if(r+n.__rowSpan-1<=t){let t=i[e].cell.__headerState,n=UT(t,MT.COLUMN);c.append(IT(n).append(Qm()))}else n.setRowSpan(n.__rowSpan+1)}let l=n.getChildAtIndex(t);VT(l)||RT(256),l.insertAfter(c),s=c}else{let e=o,t=r[e],i=BT();for(let n=0;n<a;n++){let{cell:r,startRow:a}=t[n];if(a===e){let e=t[n].cell.__headerState,r=UT(e,MT.COLUMN);i.append(IT(r).append(Qm()))}else r.setRowSpan(r.__rowSpan+1)}let c=n.getChildAtIndex(e);VT(c)||RT(257),c.insertBefore(i),s=i}return s}function Ghe(e=!0){let t=$();Q(t)||iE(t)||RT(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=QT(n),[a,,o]=QT(r),[,s,c]=YT(o,a,i),{startColumn:l}=c,{startColumn:u}=s;return e?GT(l+i.__colSpan>u+a.__colSpan?i:a,!0):GT(u<l?a:i,!1)}function GT(e,t=!0,n=!0){let[,,r]=QT(e);ZT(r);let[i,a]=YT(r,e,e),o=i.length,{startColumn:s}=a,c=t?s+e.__colSpan-1:s-1,l=r.getFirstChild();VT(l)||RT(120);let u=null;function d(e=MT.NO_STATUS){let t=IT(e).append(Qm());return u===null&&(u=t),t}let f=l;for(let e=0;e<o;e++){if(e!==0){let e=f.getNextSibling();VT(e)||RT(121),f=e}let t=i[e],n=t[c<0?0:c].cell.__headerState,r=UT(n,MT.ROW);if(c<0){qT(f,d(r));continue}let{cell:a,startColumn:o}=t[c];if(o+a.__colSpan-1<=c){let n=null;for(let r=0;r<=c;r++){let i=t[r];i.startRow===e&&(n=i.cell),i.cell.__colSpan>1&&(r+=i.cell.__colSpan-1)}n===null?qT(f,d(r)):n.insertAfter(d(r))}else a.setColSpan(a.__colSpan+1)}u!==null&&n&&KT(u);let p=r.getColWidths();if(p){let e=[...p],t=c<0?0:c,n=e[t];e.splice(t,0,n),r.setColWidths(e)}return u}function Khe(){let e=$();Q(e)||iE(e)||RT(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[r,,i]=QT(t),[a]=QT(n);ZT(i);let[o,s,c]=YT(i,r,a),{startRow:l}=s,{startRow:u}=c,d=u+a.__rowSpan-1;if(o.length===d-l+1)return i.selectPrevious(),void i.remove();let f=o[0].length,p=o[d+1],m=i.getChildAtIndex(d+1);for(let e=d;e>=l;e--){for(let t=f-1;t>=0;t--){let{cell:n,startRow:r,startColumn:i}=o[e][t];if(i===t){if(r<l||r+n.__rowSpan-1>d){let e=Math.max(r,l),t=Math.min(n.__rowSpan+r-1,d),i=e<=t?t-e+1:0;n.setRowSpan(n.__rowSpan-i)}if(r>=l&&r+n.__rowSpan-1>d&&e===d){VT(m)||RT(387);let r=null;for(let n=0;n<t;n++){let t=p[n],i=t.cell;t.startRow===e+1&&(r=i),i.__colSpan>1&&(n+=i.__colSpan-1)}r===null?qT(m,n):r.insertAfter(n)}}}let t=i.getChildAtIndex(e);VT(t)||RT(206,String(e)),t.remove()}if(p!==void 0){let{cell:e}=p[0];KT(e)}else{let{cell:e}=o[l-1][0];KT(e)}}function qhe(){let e=$();Q(e)||iE(e)||RT(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[r,,i]=QT(t),[a]=QT(n);ZT(i);let[o,s,c]=YT(i,r,a),{startColumn:l}=s,{startRow:u,startColumn:d}=c,f=Math.min(l,d),p=Math.max(l+r.__colSpan-1,d+a.__colSpan-1),m=p-f+1;if(o[0].length===p-f+1)return i.selectPrevious(),void i.remove();let h=o.length;for(let e=0;e<h;e++)for(let t=f;t<=p;t++){let{cell:n,startColumn:r}=o[e][t];if(r<f){if(t===f){let e=f-r;n.setColSpan(n.__colSpan-Math.min(m,n.__colSpan-e))}}else if(r+n.__colSpan-1>p){if(t===p){let e=p-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}let g=o[u],_=l>d?g[l+r.__colSpan]:g[d+a.__colSpan];if(_!==void 0){let{cell:e}=_;KT(e)}else{let{cell:e}=d<l?g[d-1]:g[l-1];KT(e)}let v=i.getColWidths();if(v){let e=[...v];e.splice(f,m),i.setColWidths(e)}}function KT(e){let t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function qT(e,t){let n=e.getFirstChild();n===null?e.append(t):n.insertBefore(t)}function Jhe(e){if(e.length===0)return null;let t=Uhe(e[0]);ZT(t);let[n]=XT(t,null,null),r=1/0,i=-1/0,a=1/0,o=-1/0,s=new Set;for(let t of n)for(let n of t){if(!n||!n.cell)continue;let t=n.cell.getKey();if(!s.has(t)&&e.some(e=>e.is(n.cell))){s.add(t);let e=n.startRow,c=n.startColumn,l=n.cell.__rowSpan||1,u=n.cell.__colSpan||1;r=Math.min(r,e),i=Math.max(i,e+l-1),a=Math.min(a,c),o=Math.max(o,c+u-1)}}if(r===1/0||a===1/0)return null;let c=i-r+1,l=o-a+1,u=n[r][a];if(!u.cell)return null;let d=u.cell;d.setColSpan(l),d.setRowSpan(c);let f=new Set([d.getKey()]);for(let e=r;e<=i;e++)for(let t=a;t<=o;t++){let r=n[e][t];if(!r.cell)continue;let i=r.cell,a=i.getKey();f.has(a)||(f.add(a),JT(i)||(JT(d)&&d.clear(),d.append(...i.getChildren())),i.remove())}return d.getChildrenSize()===0&&d.append(Qm()),d}function JT(e){if(e.getChildrenSize()!==1)return!1;let t=e.getFirstChildOrThrow();return!(!$m(t)||!t.isEmpty())}function Yhe(e){let[t,n,r]=QT(e),i=t.__colSpan,a=t.__rowSpan;if(i===1&&a===1)return;ZT(r);let[o,s]=YT(r,t,t),{startColumn:c,startRow:l}=s,u=t.__headerState&MT.COLUMN,d=Array.from({length:i},(e,t)=>{let n=u;for(let e=0;n!==0&&e<o.length;e++)n&=o[e][t+c].cell.__headerState;return n}),f=t.__headerState&MT.ROW,p=Array.from({length:a},(e,t)=>{let n=f;for(let e=0;n!==0&&e<o[0].length;e++)n&=o[t+l][e].cell.__headerState;return n}),m=e=>fg(t).setColSpan(1).setRowSpan(1).setHeaderStyles(e).setWidth(void 0).append(Qm());if(i>1){for(let e=1;e<i;e++)t.insertAfter(m(d[e]|p[0]));t.setColSpan(1)}if(a>1){let e;for(let t=1;t<a;t++){let r=l+t,a=o[r];e=(e||n).getNextSibling(),VT(e)||RT(125);let s=null;for(let e=0;e<c;e++){let t=a[e],n=t.cell;t.startRow===r&&(s=n),n.__colSpan>1&&(e+=n.__colSpan-1)}if(s===null)for(let n=i-1;n>=0;n--)qT(e,m(d[n]|p[t]));else for(let e=i-1;e>=0;e--)s.insertAfter(m(d[e]|p[t]))}t.setRowSpan(1)}}function YT(e,t,n){let[r,i,a]=XT(e,t,n);return i===null&&RT(207),a===null&&RT(208),[r,i,a]}function XT(e,t,n){let r=[],i=null,a=null;function o(e){let t=r[e];return t===void 0&&(r[e]=t=[]),t}let s=e.getChildren();for(let e=0;e<s.length;e++){let r=s[e];VT(r)||RT(209);let c=o(e);for(let l=r.getFirstChild(),u=0;l!=null;l=l.getNextSibling()){for(LT(l)||RT(147);c[u]!==void 0;)u++;let r={cell:l,startColumn:u,startRow:e},{__rowSpan:d,__colSpan:f}=l;for(let t=0;t<d&&!(e+t>=s.length);t++){let n=o(e+t);for(let e=0;e<f;e++)n[u+e]=r}t!==null&&i===null&&t.is(l)&&(i=r),n!==null&&a===null&&n.is(l)&&(a=r)}}return[r,i,a]}function ZT(e){let[t]=XT(e,null,null),n=t.reduce((e,t)=>Math.max(e,t.length),0),r=e.getChildren(),i=!1;for(let e=0;e<t.length;++e){let a=r[e];if(!VT(a))continue;let o=t[e].reduce((e,t)=>t?1+e:e,0);if(o>=n)continue;let s=a.getLastChild(),c=LT(s)?s.getHeaderStyles()&MT.ROW:MT.NO_STATUS;for(let e=o;e<n;++e)a.append(IT(c).append(Qm()));i=!0}return i}function QT(e){let t;if(e instanceof NT)t=e;else if(`__type`in e){let n=g_(e,LT);LT(n)||RT(148),t=n}else{let n=g_(e.getNode(),LT);LT(n)||RT(148),t=n}let n=t.getParent();VT(n)||RT(149);let r=n.getParent();return qE(r)||RT(210),[t,n,r]}function $T(e,t,n){let r,i=Math.min(t.startColumn,n.startColumn),a=Math.min(t.startRow,n.startRow),o=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),s=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let t=0;t<e.length;t++)for(let n=0;n<e[0].length;n++){let c=e[t][n];if(!c)continue;let l=c.startColumn+c.cell.__colSpan-1,u=c.startRow+c.cell.__rowSpan-1,d=c.startColumn<=o&&l>=i,f=c.startRow<=s&&u>=a;if(d&&f){let e=Math.min(i,c.startColumn),t=Math.max(o,l),n=Math.min(a,c.startRow),d=Math.max(s,u);e===i&&t===o&&n===a&&d===s||(i=e,o=t,a=n,s=d,r=!0)}}}while(r);return{maxColumn:o,maxRow:s,minColumn:i,minRow:a}}function eE(e){let[t,,n]=QT(e),r=n.getChildren().filter(VT),i=r.length,a=r[0].getChildren().length,o=Array(i);for(let e=0;e<i;e++)o[e]=Array(a);for(let e=0;e<i;e++){let n=r[e].getChildren().filter(LT),i=0;for(let r=0;r<n.length;r++){for(;o[e][i];)i++;let a=n[r],s=a.__rowSpan||1,c=a.__colSpan||1;for(let t=0;t<s;t++)for(let n=0;n<c;n++)o[e+t][i+n]=a;if(t===a)return{colSpan:c,columnIndex:i,rowIndex:e,rowSpan:s};i+=c}}return null}function tE(e,t){let n=t.getStartEndPoints(),r=iE(t);if(n===null)return!1;let[i,a]=n,[o,s,c]=QT(i),l=g_(a.getNode(),e=>LT(e));if(!(LT(o)&<(l)&&VT(s)&&qE(c)))return!1;ZT(c);let[u,d,f]=YT(c,o,l),[p]=XT(e,null,null),m=u.length,h=m>0?u[0].length:0,g=d.startRow,_=d.startColumn,v=p.length,y=v>0?p[0].length:0;if(r){let e=$T(u,d,f),t=e.maxRow-e.minRow+1,n=e.maxColumn-e.minColumn+1;g=e.minRow,_=e.minColumn,v=Math.min(v,t),y=Math.min(y,n)}let b=!1,x=Math.min(m,g+v)-1,S=Math.min(h,_+y)-1,C=new Set;for(let e=g;e<=x;e++)for(let t=_;t<=S;t++){let n=u[e][t];C.has(n.cell.getKey())||n.cell.__rowSpan===1&&n.cell.__colSpan===1||(Yhe(n.cell),C.add(n.cell.getKey()),b=!0)}let[w]=XT(c.getWritable(),null,null),T=v-m+g;for(let e=0;e<T;e++)WT(w[m-1][0].cell);let ee=y-h+_;for(let e=0;e<ee;e++)GT(w[0][h-1].cell,!0,!1);[w]=XT(c.getWritable(),null,null);for(let e=g;e<g+v;e++)for(let t=_;t<_+y;t++){let n=e-g,r=t-_,i=p[n][r];if(i.startRow!==n||i.startColumn!==r)continue;let a=i.cell;if(a.__rowSpan!==1||a.__colSpan!==1){let n=[],r=Math.min(e+a.__rowSpan,g+v)-1,i=Math.min(t+a.__colSpan,_+y)-1;for(let a=e;a<=r;a++)for(let e=t;e<=i;e++){let t=w[a][e];n.push(t.cell)}Jhe(n),b=!0}let{cell:o}=w[e][t],s=a.getBackgroundColor();s!=null&&o.setBackgroundColor(s);let c=a.getVerticalAlign();c!==void 0&&o.setVerticalAlign(c);let l=o.getChildren();a.getChildren().forEach(e=>{Fm(e)&&Qm().append(e),o.append(e)}),l.forEach(e=>e.remove())}if(r&&b){let[e]=XT(c.getWritable(),null,null);e[d.startRow][d.startColumn].cell.selectEnd()}return!0}function nE(e){let[[t,n,r,i],[a,o,s,c]]=[`anchor`,`focus`].map(t=>{let n=e[t].getNode(),r=g_(n,LT);LT(r)||RT(238,t,n.getKey(),n.getType());let i=r.getParent();VT(i)||RT(239,t);let a=i.getParent();return qE(a)||RT(240,t),[n,r,i,a]});return i.is(c)||RT(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:i,focusCell:o,focusNode:a,focusRow:s,focusTable:c}}var rE=class e{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey===`root`||this.anchor.key===`root`||this.anchor.type!==`element`||this.focus.key===`root`||this.focus.type!==`element`)return!1;let e=wh(this.tableKey),t=wh(this.anchor.key),n=wh(this.focus.key);return e!==null&&t!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return iE(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new e(this.tableKey,qv(this.anchor.key,this.anchor.offset,this.anchor.type),qv(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e===``)return;let t=(e.endsWith(`
|
||
`)?e.slice(0,-1):e).split(`
|
||
`).map(e=>e.split(` `)),n=KE();for(let e of t){let t=BT();for(let n of e){let e=IT(MT.NO_STATUS),r=Qm();n&&r.append(Pm(n)),e.append(r),t.append(e)}n.append(t)}let{anchorCell:r}=nE(this);tE(n,r.select(0,r.getChildrenSize()))}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(LT).forEach(e=>{let n=e.getFirstChild();$m(n)&&(t|=n.getTextFormat())});let n=$u[e];return(t&n)!==0}insertNodes(e){let t=this.focus.getNode();Z(t)||RT(151),fm(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=nE(this),n=eE(e);n===null&&RT(153);let r=eE(t);r===null&&RT(155);let i=Math.min(n.columnIndex,r.columnIndex),a=Math.max(n.columnIndex+n.colSpan-1,r.columnIndex+r.colSpan-1),o=Math.min(n.rowIndex,r.rowIndex),s=Math.max(n.rowIndex+n.rowSpan-1,r.rowIndex+r.rowSpan-1);return{fromX:Math.min(i,a),fromY:Math.min(o,s),toX:Math.max(i,a),toY:Math.max(o,s)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:t,anchorCell:n,focusCell:r}=nE(this),i=r.getParents()[1];if(i!==t){if(t.isParentOf(r)){let e=i.getParent();e??RT(159),this.set(this.tableKey,r.getKey(),e.getKey())}else{let e=t.getParent();e??RT(158),this.set(this.tableKey,e.getKey(),r.getKey())}return this.getNodes()}let[a,o,s]=YT(t,n,r),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=$T(a,o,s),f=new Map([[t.getKey(),t]]),p=null;for(let e=u;e<=d;e++)for(let t=c;t<=l;t++){let{cell:n}=a[e][t],r=n.getParent();VT(r)||RT(160),r!==p&&(f.set(r.getKey(),r),p=r),f.has(n.getKey())||Xhe(n,e=>{f.set(e.getKey(),e)})}let m=Array.from(f.values());return K_()||(this._cachedNodes=m),m}getTextContent(){let e=this.getNodes().filter(e=>LT(e)),t=``;for(let n=0;n<e.length;n++){let r=e[n],i=r.__parent,a=(e[n+1]||{}).__parent;t+=r.getTextContent()+(a===i?` `:`
|
||
`)}return t}};function iE(e){return e instanceof rE}function aE(e,t,n){e.getKey(),t.getKey(),n.getKey();let r=$(),i=iE(r)?r.clone():new rE(`root`,qv(`root`,0,`element`),qv(`root`,0,`element`));return i.set(e.getKey(),t.getKey(),n.getKey()),i}function Xhe(e,t){let n=[[e]];for(let e=n.at(-1);e!==void 0&&n.length>0;e=n.at(-1)){let r=e.pop();r===void 0?n.pop():!1!==t(r)&&Z(r)&&n.push(r.getChildren())}}function oE(e,t=Lg()){let n=wh(e);qE(n)||RT(231,e);let r=fE(n,t.getElementByKey(e));return r===null&&RT(232,e),{tableElement:r,tableNode:n}}var Zhe=class{observers;nextFocus;shouldCheckSelectionForTable;touchTapCellKey;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null,this.touchTapCellKey=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let t=this.observers.get(e);return t!==void 0&&(t[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[t,[n]]of Array.from(this.observers.entries())){let r=wh(t);qE(r)?e.push([r,n]):this.removeObserver(t)}return e}},Qhe=class{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;isPointerDrag;pointerStartCell;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.isPointerDrag=!1,this.pointerStartCell=null,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort(`removeListeners`),Array.from(this.listenersToRemove).forEach(e=>e()),this.listenersToRemove.clear()}$lookup(){return oE(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(e=>{this.editor.read(`latest`,()=>{let t=!1;for(let n=0;n<e.length;n++){let r=e[n].target.nodeName;if(r===`TABLE`||r===`TBODY`||r===`THEAD`||r===`TR`){t=!0;break}}if(!t)return;let{tableNode:n,tableElement:r}=this.$lookup();this.table=vE(n,r)})});this.listenersToRemove.add(()=>e.disconnect()),this.editor.read(`latest`,()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=vE(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:r}=this.$lookup();yE(t,vE(n,r),null),e&&$()!==null&&(Nh(null),t.dispatchCommand(id))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();Nb(t,e._config.theme.tableSelection),t.classList.remove(`disable-selection`),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();Mb(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&RT(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),yE(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=vg(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:r}=this.$lookup(),i=e.x,a=e.y;if(this.focusCell=e,this.isHighlightingCells||(t||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle()),this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let o=IE(r,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let e=o;if(e===null&&t&&(e=r.getCellNodeFromCords(i,a,this.table)),e!==null){let t=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=e.getKey(),this.tableSelection=aE(r,t,e),Nh(this.tableSelection),n.dispatchCommand(id),yE(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?wh(this.anchorCellNodeKey):null;return LT(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&RT(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?wh(this.focusCellNodeKey):null;return LT(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&RT(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),n=IE(t,e.elem);if(n!==null){let e=n.getKey();this.tableSelection==null?this.tableSelection=aE(t,n,n):(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),e,e)),this.anchorCellNodeKey=e}}$formatCells(e){let t=$();iE(t)||RT(236);let n=Sy(),r=n.anchor,i=n.focus,a=t.getNodes().filter(LT);a.length>0||RT(237);let o=a[0].getFirstChild(),s=$m(o)?o.getFormatFlags(e,null):null;a.forEach(t=>{r.set(t.getKey(),0,`element`),i.set(t.getKey(),t.getChildrenSize(),`element`),n.formatText(e,s)}),Nh(t),this.editor.dispatchCommand(id)}$clearText(){let{editor:e}=this,t=wh(this.tableNodeKey);if(!qE(t))throw Error(`Expected TableNode.`);let n=$();iE(n)||RT(253);let r=n.getNodes().filter(LT),i=t.getFirstChild(),a=t.getLastChild();if(r.length>0&&i!==null&&a!==null&&VT(i)&&VT(a)&&r[0]===i.getFirstChild()&&r[r.length-1]===a.getLastChild()){t.selectPrevious();let n=t.getParent();t.remove(),Tm(n)&&n.isEmpty()&&e.dispatchCommand(pd)}else r.forEach(e=>{if(Z(e)){let t=e.getFirstChild(),n=$m(t)?fg(t):Qm(),r=Pm();n.append(r),e.append(n),e.getChildren().forEach(e=>{e!==n&&e.remove()})}}),yE(e,this.table,null),Nh(null),e.dispatchCommand(id)}},sE=`__lexicalTableSelection`;function cE(e){let t=hg(e);return qE(t)||RT(386,e),t}var lE=40;function uE(e,t,n,r=1e3/60){let i=e=>Math.max(1,Math.round(Math.max(1,Math.ceil(Math.min(lE,e)/lE*18))*r*60/1e3));return e<=t+lE?-i(t+lE-e):e>=n-lE?i(e-(n-lE)):0}function dE(e){return jg(e)&&e.nodeName===`TABLE`}function fE(e,t){if(!t)return t;let n=dE(t)?t:t.querySelector(`table`);return dE(n)||RT(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function pE(e){return e._window}function mE(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;LT(n)&&(r=n)}return null}var $he=[[Od,`down`],[Dd,`up`],[Td,`backward`],[Cd,`forward`]],ege=[_d,vd,dd],tge=[jd,Nd];function nge(e,t){return e.registerRootListener(n=>{if(n===null)return;let r=e._window;if(r===null)return;let i=()=>{t.touchTapCellKey=null};return pv(mv(r,`pointerdown`,r=>{t.touchTapCellKey=null;let i=kg(r);if(r.button!==0||!Mg(i)||!n.contains(i))return;let a=function(e){let t=gE(e);if(t===null)return null;let n=t.elem;for(;n!=null;){if(n.nodeName===`TABLE`&&sE in n&&n[sE])return{cellElement:t,tableElement:n,tableObserver:n[sE]};n=n.parentNode}return null}(i),o=a!==null&&a.tableObserver.editor===e?a:null;e.update(()=>{if(iE($())){for(let[e]of t.observers.values())e.$clearHighlight(!1);Nh(null),e.dispatchCommand(id)}if(!o)return;let{tableObserver:n,tableElement:i,cellElement:a}=o;(function(e,t,n,r,i,a){let o=e._window;if(!o)return;if(i.pointerType=t.pointerType,t.pointerType===`touch`&&!t.shiftKey&&!i.isSelecting){let e=Oh(n.elem);a.touchTapCellKey=e?e.getKey():null}let s=cE(i.tableNodeKey),c=Dy(),l=Q(c)||iE(c)?kE(c.anchor.getNode()):null,u=l!==null&&l.isParentOf(s);if(Hu&&t.shiftKey&&(Q(c)||iE(c))&&(TE(c,s)||u)){let e=c.anchor.getNode(),r=mE(s,c.anchor.getNode());if(r){let e=FE(i,r);e.elem===n.elem?t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n):(i.$setAnchorCellForSelection(e),i.$setFocusCellForSelection(n),ME(t))}else(s.isBefore(e)?s.selectStart():s.selectEnd()).anchor.set(c.anchor.key,c.anchor.offset,c.anchor.type),ME(t)}else t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n);(n=>{if(i.isSelecting)return;i.isSelecting=!0,i.isPointerDrag=!1,i.pointerStartCell=n;let s=t.pointerType===`touch`,c=t.pointerId,l=t.clientX,u=t.clientY,d=!s;s||i.anchorCell!==null||e.update(()=>{i.$setAnchorCellForSelection(n)});let f,p=t.clientX,m=t.clientY,h=null,g=null,_=e=>e.pointerId===c,v=(e,t)=>!(Math.abs(e-l)<=10&&Math.abs(t-u)<=10),y=()=>{i.isSelecting=!1,i.isPointerDrag=!1,i.pointerStartCell=null,h!==null&&(o.cancelAnimationFrame(h),h=null),g!==null&&(g(),g=null)},b=(e,t)=>{let n=r.getRootNode();if(!gh(n)&&!yg(n))return null;for(let i of n.elementsFromPoint(e,t)){let e=_E(r,i);if(e)return e}return null},x=(t,r)=>{if(d||i.isPointerDrag&&t.elem!==n.elem){if(i.anchorCell===null||!d){let r=d?t:n;e.update(()=>{i.$setAnchorCellForSelection(r)})}d=!0,i.focusCell!==null&&t.elem===i.focusCell.elem||(a.setNextFocus({focusCell:t,override:r,tableKey:i.tableNodeKey}),e.dispatchCommand(id))}},S=e=>{for(let t=r.parentElement;t;t=t.parentElement)if(e===`x`?t.scrollWidth>t.clientWidth:t.scrollHeight>t.clientHeight){let n=o.getComputedStyle(t),r=e===`x`?n.overflowX:n.overflowY;if(r===`auto`||r===`scroll`)return t}return null},C=(e,t,n,r)=>{let i,a;if(e===null)i=0,a=n===`x`?o.innerWidth:o.innerHeight;else{let t=e.getBoundingClientRect();i=n===`x`?t.left:t.top,a=n===`x`?t.right:t.bottom}let s=uE(t,i,a,r);if(s===0)return!1;if(e===null){let e=n===`x`?o.scrollX:o.scrollY;return o.scrollBy(n===`x`?s:0,n===`x`?0:s),(n===`x`?o.scrollX:o.scrollY)!==e}if(n===`x`){let t=e.scrollLeft;return e.scrollLeft+=s,e.scrollLeft!==t}let c=e.scrollTop;return e.scrollTop+=s,e.scrollTop!==c},w=e=>{if(h=null,!i.isSelecting)return;let t=e>f?Math.min(e-f,100):1e3/60;f=e;let n=S(`x`),r=S(`y`),a=n!==null&&C(n,p,`x`,t),s=C(r,m,`y`,t);if(a||s){let[e,t]=((e,t)=>{let n=p,r=m;if(e===null)n=Math.min(Math.max(n,1),o.innerWidth-1);else{let t=e.getBoundingClientRect();n=Math.min(Math.max(n,t.left+1),t.right-1)}if(t===null)r=Math.min(Math.max(r,1),o.innerHeight-1);else{let e=t.getBoundingClientRect();r=Math.min(Math.max(r,e.top+1),e.bottom-1)}return[n,r]})(n,r),i=b(e,t);i&&x(i,!1),h=o.requestAnimationFrame(w)}},T=()=>{h!==null||s&&!i.isPointerDrag||!(()=>{let e=S(`x`);if(e!==null){let t=e.getBoundingClientRect();if(uE(p,t.left,t.right)!==0)return!0}let t=S(`y`),n=t===null?0:t.getBoundingClientRect().top,r=t===null?o.innerHeight:t.getBoundingClientRect().bottom;return uE(m,n,r)!==0})()||(f=1/0,h=o.requestAnimationFrame(w))},ee=e=>{_(e)&&(a.touchTapCellKey=null,y())};g=hv(o,{lostpointercapture:ee,pointercancel:ee,pointermove:e=>{if(!_(e))return;if(!(e=>!(1&~e.buttons))(e)&&i.isSelecting)return a.touchTapCellKey=null,void y();let t=kg(e);if(!Mg(t))return;p=e.clientX,m=e.clientY,!i.isPointerDrag&&v(p,m)&&(i.isPointerDrag=!0,a.touchTapCellKey=null);let n=null,o=!(Hu||r.contains(t));n=o?_E(r,t):b(e.clientX,e.clientY),n&&x(n,o),T()},pointerup:e=>{_(e)&&(v(e.clientX,e.clientY)&&(a.touchTapCellKey=null),y())}},i.listenerOptions)})(n)})(e,r,a,i,n,t)})}),hv(r,{blur:i,keydown:i},{capture:!0}),i)})}function rge(e,t,n,r,i){let a=n.getRootElement(),o=pE(n);a!==null&&o!==null||RT(246);let s=new Qhe(n,e.getKey()),c=fE(e,t);(function(e,t){hE(e)!==null&&RT(205),e[sE]=t})(c,s),s.listenersToRemove.add(()=>function(e,t){hE(e)===t&&delete e[sE]}(c,s)),s.listenersToRemove.add(mv(c,`mousedown`,e=>{let t=kg(e);e.detail>=3&&Mg(t)&&gE(t)!==null&&e.preventDefault()},s.listenerOptions));for(let[t,r]of $he)s.listenersToRemove.add(n.registerCommand(t,t=>jE(n,t,r,e,s,i),3));s.listenersToRemove.add(n.registerCommand(Md,t=>{let n=$();if(iE(n)){let r=mE(e,n.focus.getNode());if(r!==null)return ME(t),r.selectEnd(),!0}return!1},3));let l=()=>{let t=$();return!!TE(t,e)&&!!iE(t)&&(s.$clearText(),!0)};for(let e of ege)s.listenersToRemove.add(n.registerCommand(e,l,3));let u=t=>{let n=$();if(!iE(n)&&!Q(n))return!1;let r=e.isParentOf(n.anchor.getNode());if(r!==e.isParentOf(n.focus.getNode())){let t=r?`anchor`:`focus`,i=r?`focus`:`anchor`,{key:a,offset:o,type:s}=n[i];return e[n[t].isBefore(n[i])?`selectPrevious`:`selectNext`]()[i].set(a,o,s),!1}return!!TE(n,e)&&!!iE(n)&&(t&&(t.preventDefault(),t.stopPropagation()),s.$clearText(),!0)};for(let e of tge)s.listenersToRemove.add(n.registerCommand(e,u,3));s.listenersToRemove.add(n.registerCommand(Ud,e=>{let t=$();if(t){if(!iE(t)&&!Q(t))return!1;PC(n,Rb(e,ClipboardEvent)?e:null,IC(t));let r=u(e);return Q(t)?(t.removeText(),!0):r}return!1},3));let d=a.ownerDocument;return s.listenersToRemove.add(mv(d,`paste`,t=>{t.defaultPrevented||n.read(`latest`,()=>{let t=$();return a.contains(d.activeElement)&&iE(t)&&TE(t,e)})&&(t.preventDefault(),n.dispatchCommand(hd,t))})),s.listenersToRemove.add(mv(d,`copy`,t=>{if(t.defaultPrevented)return;let r=kg(t);r===a||Mg(r)&&a.contains(r)||n.read(`latest`,()=>{let t=$();return a.contains(Dg(a))&&iE(t)&&TE(t,e)})&&(t.preventDefault(),n.dispatchCommand(Hd,t))})),s.listenersToRemove.add(n.registerCommand(yd,t=>{let n=$();return!!TE(n,e)&&!!iE(n)&&(s.$formatCells(t),!0)},3)),s.listenersToRemove.add(n.registerCommand(zd,t=>{let n=$();if(!iE(n)||!TE(n,e))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();if(!LT(r)||!LT(i))return!1;let[a,o,s]=YT(e,r,i),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=$T(a,o,s);if(u===0&&c===0&&d===a.length-1&&l===a[0].length-1)return e.setFormat(t),!0;let f=new Set;for(let e=u;e<=d;e++)for(let n=c;n<=l;n++){let r=a[e][n].cell;if(f.has(r))continue;f.add(r),r.setFormat(t);let i=r.getChildren();for(let e=0;e<i.length;e++){let n=i[e];Z(n)&&!n.isInline()&&n.setFormat(t)}}return!0},3)),s.listenersToRemove.add(n.registerCommand(md,t=>{let r=$();if(!TE(r,e))return!1;if(iE(r))return s.$clearHighlight(),!1;if(Q(r)){if(!LT(g_(r.anchor.getNode(),e=>LT(e))))return!1;if(typeof t==`string`){let i=PE(n,r,e);if(i)return NE(i,e,[Pm(t)]),!0}}return!1},3)),r&&s.listenersToRemove.add(n.registerCommand(Pd,t=>{let n=$();if(!Q(n)||!n.isCollapsed()||!TE(n,e))return!1;let r=kE(n.anchor.getNode());return!(r===null||!e.is(AE(r))||(ME(t),function(e,t){let n=t===`next`?`getNextSibling`:`getPreviousSibling`,r=t===`next`?`getFirstChild`:`getLastChild`,i=e[n]();if(Z(i))return i.selectEnd();let a=g_(e,VT);a===null&&RT(247);for(let e=a[n]();VT(e);e=e[n]()){let t=e[r]();if(Z(t))return t.selectEnd()}let o=g_(a,qE);o===null&&RT(248),t===`next`?o.selectNext():o.selectPrevious()}(r,t.shiftKey?`previous`:`next`),0))},3)),s.listenersToRemove.add(n.registerCommand(qd,t=>e.isSelected(),3)),s.listenersToRemove.add(n.registerCommand(pd,()=>{let t=$();if(!Q(t)||!t.isCollapsed()||!TE(t,e))return!1;let r=PE(n,t,e);return!!r&&(NE(r,e),!0)},3)),s}function ige(e,t,n){let r=$(),i=t.isSelected();if(!(iE(r)&&r.tableKey===t.getKey()||n.isHighlightingCells||n.hasHijackedSelectionStyles||i))return;let{tableElement:a}=n.$lookup();if(n.table=vE(t,a),iE(r)&&r.tableKey===t.getKey()){let e=wh(r.anchor.key),t=wh(r.focus.key);if(LT(e)&<(t)){let r=FE(n,e),i=FE(n,t);n.anchorCell=r,n.anchorCellNodeKey=e.getKey(),n.anchorX=r.x,n.anchorY=r.y,n.focusCell=i,n.focusCellNodeKey=t.getKey(),n.focusX=i.x,n.focusY=i.y}n.$updateTableTableSelection(r)}else n.isHighlightingCells&&n.$clearHighlight(!1);n.hasHijackedSelectionStyles&&!i?function(e,t){t.$enableHighlightStyle(),bE(t.table,t=>{let n=t.elem;t.highlighted=!1,OE(e,t),n.getAttribute(`style`)||n.removeAttribute(`style`)})}(e,n):!n.hasHijackedSelectionStyles&&i&&function(e,t){t.$disableHighlightStyle(),bE(t.table,t=>{t.highlighted=!0,DE(e,t)})}(e,n)}function hE(e){return e[sE]||null}function gE(e){let t=e;for(;t!=null;){let e=t.nodeName;if(e===`TD`||e===`TH`){let e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function _E(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;let t=r.nodeName;t!==`TD`&&t!==`TH`||(n=r._cell||null)}return null}function vE(e,t){let n=[],r={columns:0,domRows:n,rows:0},i=fE(e,t).querySelector(`tr`),a=0,o=0;for(n.length=0;i!=null;){let e=i.nodeName;if(e===`TD`||e===`TH`){let e={elem:i,hasBackgroundColor:i.style.backgroundColor!==``,highlighted:!1,x:a,y:o};i._cell=e;let t=n[o];t===void 0&&(t=n[o]=[]),t[a]=e}else{let e=i.firstChild;if(e!=null){i=e;continue}}let t=i.nextSibling;if(t!=null){a++,i=t;continue}let r=i.parentNode;if(r!=null){let e=r.nextSibling;if(e==null)break;o++,a=0,i=e}}return r.columns=a+1,r.rows=o+1,r}function yE(e,t,n){let r=new Set(n?n.getNodes():[]);bE(t,(t,n)=>{let i=t.elem;r.has(n)?(t.highlighted=!0,DE(e,t)):(t.highlighted=!1,OE(e,t),i.getAttribute(`style`)||i.removeAttribute(`style`))})}function bE(e,t){let{domRows:n}=e;for(let e=0;e<n.length;e++){let r=n[e];if(r)for(let n=0;n<r.length;n++){let i=r[n];if(!i)continue;let a=Oh(i.elem);a!==null&&t(i,a,{x:n,y:e})}}}var age=(e,t,n,r,i)=>{let a=i===`forward`;switch(i){case`backward`:case`forward`:return n===(a?e.table.columns-1:0)?r===(a?e.table.rows-1:0)?a?t.selectNext():t.selectPrevious():EE(t.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,r+(a?1:-1),e.table),a):EE(t.getCellNodeFromCordsOrThrow(n+(a?1:-1),r,e.table),a),!0;case`up`:return r===0?t.selectPrevious():EE(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1),!0;case`down`:return r===e.table.rows-1?t.selectNext():EE(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0),!0;default:return!1}};function xE(e,t){let n,r;if(t.startColumn===e.minColumn)n=`minColumn`;else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n=`maxColumn`}if(t.startRow===e.minRow)r=`minRow`;else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r=`maxRow`}return[n,r]}function SE(e,t,n){let r=xE(e,t);if(r)return r;let i=xE(e,n);return i?CE(i):[`minColumn`,`minRow`]}function CE([e,t]){return[e===`minColumn`?`maxColumn`:`minColumn`,t===`minRow`?`maxRow`:`minRow`]}function wE(e,t,[n,r]){let i=t[r],a=e[i];a===void 0&&RT(250,r,String(i));let o=t[n],s=a[o];return s===void 0&&RT(250,n,String(o)),s}function TE(e,t){if(Q(e)||iE(e)){let n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function EE(e,t){t?e.selectStart():e.selectEnd()}function DE(e,t){let n=t.elem,r=e._config.theme;LT(Oh(n))||RT(131),Mb(n,r.tableCellSelected)}function OE(e,t){let n=t.elem;LT(Oh(n))||RT(131);let r=e._config.theme;Nb(n,r.tableCellSelected)}function kE(e){let t=g_(e,LT);return LT(t)?t:null}function AE(e){let t=g_(e,qE);return qE(t)?t:null}function jE(e,t,n,r,i,a){if((n===`up`||n===`down`)&&function(e){let t=e.getRootElement();return!!t&&t.hasAttribute(`aria-controls`)&&t.getAttribute(`aria-controls`)===`typeahead-menu`}(e))return!1;let o=$();if(!TE(o,r)){if(Q(o)){if(n===`backward`){if(o.focus.offset>0)return!1;let e=function(e){for(let t=e,n=e;n!==null;t=n,n=n.getParent())if(Z(n)){if(n!==t&&n.getFirstChild()!==t)return null;if(!n.isInline())return n}return null}(o.focus.getNode());if(!e)return!1;let n=e.getPreviousSibling();return!!qE(n)&&(ME(t),t.shiftKey?o.focus.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent(),`element`):n.selectEnd(),!0)}if(t.shiftKey&&(n===`up`||n===`down`)){let e=o.focus.getNode();if(!o.isCollapsed()&&(n===`up`&&!o.isBackward()||n===`down`&&o.isBackward())){let i=g_(e,e=>qE(e));if(LT(i)&&(i=g_(i,qE)),i!==r||!i)return!1;let a=n===`down`?i.getNextSibling():i.getPreviousSibling();if(!a)return!1;let s=0;n===`up`&&Z(a)&&(s=a.getChildrenSize());let c=a;n===`up`&&Z(a)&&(c=a.getLastChild()||a,s=Fm(c)?c.getTextContentSize():0);let l=o.clone();return l.focus.set(c.getKey(),s,Fm(c)?`text`:`element`),Nh(l),ME(t),!0}if(dg(e)){let e=n===`up`?o.getNodes()[o.getNodes().length-1]:o.getNodes()[0];if(e&&mE(r,e)!==null){let e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;let[n]=QT(e),[a]=QT(t),o=r.getCordsFromCellNode(n,i.table),s=r.getCordsFromCellNode(a,i.table),c=r.getDOMCellFromCordsOrThrow(o.x,o.y,i.table),l=r.getDOMCellFromCordsOrThrow(s.x,s.y,i.table);return i.$setAnchorCellForSelection(c),i.$setFocusCellForSelection(l,!0),!0}return!1}{let r=g_(e,e=>Z(e)&&!e.isInline());if(LT(r)&&(r=g_(r,qE)),!r)return!1;let a=n===`down`?r.getNextSibling():r.getPreviousSibling();if(qE(a)&&i.tableNodeKey===a.getKey()){let e=a.getFirstDescendant(),r=a.getLastDescendant();if(!e||!r)return!1;let[i]=QT(e),[s]=QT(r),c=o.clone();return c.focus.set((n===`up`?i:s).getKey(),n===`up`?0:s.getChildrenSize(),`element`),ME(t),Nh(c),!0}}}}return n===`down`&&UE(e)&&function(e,t){if(!Q(e))return!1;let n=Lm(e.focus,`next`),r=bb(t,`next`);return kb(n.origin,r.origin)!==null&&Db(n,r)<0}(o,r)&&a.setShouldCheckSelectionForTable(r.getKey()),!1}if(Q(o)){if(n===`backward`||n===`forward`)return function(e,t,n,r,i,a,o){let s=Lm(n.focus,i?`previous`:`next`);if(Gm(s))return!1;let c=s;for(let e of Cb(s).iterNodeCarets(`shadowRoot`)){if(!hb(e)||!Z(e.origin))return!1;c=e}let l=c.getParentAtCaret();if(!LT(l))return!1;let u=l,d=function(e){for(let t of Cb(e).iterNodeCarets(`root`)){let{origin:n}=t;if(LT(n)){if(gb(t))return bb(n,e.direction)}else if(!VT(n))break}return null}(_b(u,c.direction)),f=g_(u,qE);if(!f||!f.is(a))return!1;let p=e.getElementByKey(u.getKey()),m=gE(p);if(!p||!m)return!1;if(o.table=uge(e,f),d){if(r===`extend`){let t=gE(e.getElementByKey(d.origin.getKey()));if(!t)return!1;o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(t,!0)}else{let e=Wm(d);Rm(n.anchor,e),Rm(n.focus,e)}}else if(r===`extend`)o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(m,!0);else{let e=function(e){let t=xb(e);return gb(t)?Wm(t):e}(_b(f,s.direction));Rm(n.anchor,e),Rm(n.focus,e)}return ME(t),!0}(e,t,o,t.shiftKey?`extend`:`move`,n===`backward`,r,i);if(o.isCollapsed()){let{anchor:s,focus:c}=o,l=g_(s.getNode(),LT),u=g_(c.getNode(),LT);if(!LT(l)||!l.is(u))return!1;let d=AE(l);if(d!==r&&d!=null){let r=fE(d,e.getElementByKey(d.getKey()));if(r!=null)return i.table=vE(d,r),jE(e,t,n,d,i,a)}let f=e.getElementByKey(l.__key),p=e.getElementByKey(s.key);if(p==null||f==null)return!1;let m;if(s.type===`element`)m=p.getBoundingClientRect();else{let t=vg(pE(e));if(t===null||t.rangeCount===0)return!1;let n=Tg(t,e.getRootElement());if(n===null)return!1;m=n.getBoundingClientRect()}let h=n===`up`?l.getFirstChild():l.getLastChild();if(h==null)return!1;let g=e.getElementByKey(h.__key);if(g==null)return!1;let _=g.getBoundingClientRect();if(n===`up`?_.top>m.top-m.height:m.bottom+m.height>_.bottom){ME(t);let e=r.getCordsFromCellNode(l,i.table);if(!t.shiftKey)return age(i,r,e.x,e.y,n);{let t=r.getDOMCellFromCordsOrThrow(e.x,e.y,i.table);i.$setAnchorCellForSelection(t),i.$setFocusCellForSelection(t,!0)}return!0}}}else if(iE(o)){let{anchor:a,focus:s,tableKey:c}=o;if(c!==r.getKey())return!1;let l=g_(a.getNode(),LT),u=g_(s.getNode(),LT),[d]=o.getNodes();qE(d)||RT(251);let f=fE(d,e.getElementByKey(d.getKey()));if(!LT(l)||!LT(u)||!qE(d)||f==null)return!1;i.$updateTableTableSelection(o);let p=vE(d,f),m=r.getCordsFromCellNode(l,p),h=r.getDOMCellFromCordsOrThrow(m.x,m.y,p);if(i.$setAnchorCellForSelection(h),ME(t),t.shiftKey){let[e,t,a]=YT(r,l,u);return function(e,t,n,r,i){let a=$T(t,n,r),{topSpan:o,leftSpan:s,bottomSpan:c,rightSpan:l}=function(e,t){let{minColumn:n,maxColumn:r,minRow:i,maxRow:a}=t,o=1,s=1,c=1,l=1,u=e[i],d=e[a];for(let e=n;e<=r;e++)o=Math.max(o,u[e].cell.__rowSpan),l=Math.max(l,d[e].cell.__rowSpan);for(let t=i;t<=a;t++)s=Math.max(s,e[t][n].cell.__colSpan),c=Math.max(c,e[t][r].cell.__colSpan);return{bottomSpan:l,leftSpan:s,rightSpan:c,topSpan:o}}(t,a),[u,d]=CE(SE(a,n,r)),f=a[u],p=a[d];i===`forward`?f+=u===`maxColumn`?1:s:i===`backward`?f-=u===`minColumn`?1:l:i===`down`?p+=d===`maxRow`?1:o:i===`up`&&(p-=d===`minRow`?1:c);let m=t[p];if(m===void 0)return!1;let h=m[f];if(h===void 0)return!1;let[g,_]=function(e,t,n){let r=$T(e,t,n),i=SE(r,t,n);return[wE(e,r,i),wE(e,r,CE(i))]}(t,n,h),v=FE(e,g.cell),y=FE(e,_.cell);return e.$setAnchorCellForSelection(v),e.$setFocusCellForSelection(y,!0),!0}(i,e,t,a,n)}return u.selectEnd(),!0}return!1}function ME(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function NE(e,t,n){let r=Qm();e===`first`?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function PE(e,t,n){let r=n.getParent();if(!r)return;let i=vg(pE(e));if(!i)return;let a=Eg(i,e.getRootElement()).anchorNode,o=e.getElementByKey(r.getKey()),s=fE(n,e.getElementByKey(n.getKey()));if(!a||!o||!s||!o.contains(a)||s.contains(a))return;let c=g_(t.anchor.getNode(),e=>LT(e));if(!c)return;let l=g_(c,e=>qE(e));if(!qE(l)||!l.is(n))return;let[u,d]=YT(n,c,c),f=u[0][0],p=u[u.length-1][u[0].length-1],{startRow:m,startColumn:h}=d,g=m===f.startRow&&h===f.startColumn,_=m===p.startRow&&h===p.startColumn;return g?`first`:_?`last`:void 0}function FE(e,t){let{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function IE(e,t,n){return mE(e,Oh(t,n))}function LE(e){return jg(e)&&e.nodeName===`DIV`}var oge=Uf()({colWidths:Kf(Hf(zce(Rf())),{getter:{field:`__colWidths`}}),frozenColumnCount:Kf(Rf(),{getter:`getSerializedFrozenColumnCount`,setter:{field:`__frozenColumnCount`,method:`setFrozenColumns`}}),frozenRowCount:Kf(Rf(),{getter:`getSerializedFrozenRowCount`,setter:{field:`__frozenRowCount`,method:`setFrozenRows`}}),rowStriping:Kf(zf(),{getter:`getSerializedRowStriping`,setter:{field:`__rowStriping`}})});function RE(e,t,n){let r=e.querySelector(`:scope > colgroup`);if(!n)return void(r&&r.remove());r||(r=Cg().createElement(`colgroup`),qg(r),e.insertBefore(r,e.firstChild));let i=[];for(let e=0;e<t;e++){let t=Cg().createElement(`col`),r=n[e];r&&(t.style.width=`${r}px`),i.push(t)}r.replaceChildren(...i)}function zE(e,t,n){if(!t.theme.tableAlignment)return;let r=[],i=[];for(let e of[`center`,`right`]){let a=t.theme.tableAlignment[e];a&&(e===n?i:r).push(a)}Nb(e,...r),Mb(e,...i)}var BE=new WeakSet;function sge(e){let{scrollable:t,scrollbar:n,tableElement:r}=e;if(n.classList.length===0&&function(e){let t=e.style.display;e.style.display=``;let n=e.offsetHeight-e.clientHeight;return e.style.display=t,n}(n)===0)return BE.add(n),n.style.display=`none`,t.style.scrollbarWidth=`auto`,()=>{};let i=t.scrollLeft,a=n.scrollLeft,o=()=>{t.scrollLeft!==i&&(n.scrollLeft=i=t.scrollLeft,a=n.scrollLeft)},s=()=>{n.scrollLeft!==a&&(t.scrollLeft=a=n.scrollLeft,i=t.scrollLeft)};t.addEventListener(`scroll`,o,{passive:!0}),n.addEventListener(`scroll`,s,{passive:!0});let c=null;return typeof ResizeObserver<`u`&&(c=new ResizeObserver(()=>{VE(t,n)}),c.observe(t),c.observe(r)),VE(t,n),()=>{t.removeEventListener(`scroll`,o),n.removeEventListener(`scroll`,s),c&&c.disconnect()}}function VE(e,t){if(BE.has(t))return;let n=t.firstElementChild;if(!n||!jg(n)||!e.isConnected)return;let r=e.ownerDocument.defaultView;if(!r)return void(t.style.display=`none`);let i=r.getComputedStyle(e).overflowX,a=i===`auto`||i===`scroll`,o=e.scrollWidth,s=e.clientWidth,c=o+`px`;n.style.width!==c&&(n.style.width=c);let l=a&&o>s;t.style.display=l?``:`none`}function cge(e){if(!e.hasAttribute(`data-lexical-sticky-scrollbar`))return null;let t=e.firstElementChild;if(!LE(t))return null;let n=t.querySelector(`:scope > table`);if(!dE(n))return null;let r=t.nextElementSibling;return LE(r)?{scrollable:t,scrollbar:r,tableElement:n}:null}var HE=new WeakSet;function UE(e=Lg()){return HE.has(e)}function WE(e=Lg()){let t=Gb(e,`@lexical/table/Table`);return!!t&&t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek()}function lge(e,t){t?HE.add(e):HE.delete(e)}var GE=class extends bm{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config(`table`,{extends:bm,generated:Phe,importDOM:{table:()=>({conversion:dge,priority:1})},json:oge})}getSerializedFrozenColumnCount(){return this.getLatest().__frozenColumnCount||void 0}getSerializedFrozenRowCount(){return this.getLatest().__frozenRowCount||void 0}getSerializedRowStriping(){return this.getLatest().__rowStriping||void 0}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}extractWithChild(e,t,n){return n===`html`}getDOMSlot(e){let t=dE(e)?e:e.querySelector(`table`);return dE(t)||RT(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(`:scope > colgroup`))}createDOM(e,t){let n=Cg().createElement(`table`);if(this.__style&&Dm(n.style,this.__style),this.getColWidths()){let e=Cg().createElement(`colgroup`);n.appendChild(e),qg(e)}if(Mb(n,e.theme.table),this.updateTableElement(null,n,e),UE(t)){let r=WE(t),i=function(e,t,n){let r=Cg().createElement(`div`),i=t.theme.tableScrollableWrapper;return i?Mb(r,i):r.style.overflowX=`auto`,n&&(r.style.scrollbarWidth=`none`),r.appendChild(e),r}(n,e,r);if(this.updateTableWrapper(null,i,n,e),r){let t=function(e){let t=Cg(),n=t.createElement(`div`),r=e.theme.tableStickyScrollbar;r?Mb(n,r):(n.style.position=`sticky`,n.style.bottom=`0`,n.style.overflowX=`scroll`,n.style.overflowY=`hidden`),n.style.display=`none`,n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1;let i=t.createElement(`div`);return i.style.height=`1px`,i.style.width=`0px`,n.appendChild(i),n}(e),n=Cg().createElement(`div`);return n.setAttribute(`data-lexical-sticky-scrollbar`,`true`),n.appendChild(i),n.appendChild(t),qg(t),n}return i}return n}updateTableWrapper(e,t,n,r){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(e,t,n,r){r>0?(Mb(e,n.theme.tableFrozenColumn),t.setAttribute(`data-lexical-frozen-column`,`true`)):(Nb(e,n.theme.tableFrozenColumn),t.removeAttribute(`data-lexical-frozen-column`))}(t,n,r,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(e,t,n,r){r>0?(Mb(e,n.theme.tableFrozenRow),t.setAttribute(`data-lexical-frozen-row`,`true`)):(Nb(e,n.theme.tableFrozenRow),t.removeAttribute(`data-lexical-frozen-row`))}(t,n,r,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:``)&&Dm(t.style,this.__style,e?e.__style:``),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(e,t,n){n?(Mb(e,t.theme.tableRowStriping),e.setAttribute(`data-lexical-row-striping`,`true`)):(Nb(e,t.theme.tableRowStriping),e.removeAttribute(`data-lexical-row-striping`))}(t,n,this.__rowStriping);let r=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===r&&this.getColWidths()===i||RE(t,this.getColumnCount(),this.getColWidths()),zE(t,n,this.getFormatType())}updateDOM(e,t,n){let r=fE(this,t);if(t===r===UE())return!0;if(LE(t)){if(t.hasAttribute(`data-lexical-sticky-scrollbar`)!==WE())return!0;let i=r.parentElement;LE(i)&&this.updateTableWrapper(e,i,r,n)}return this.updateTableElement(e,r,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();n&&RE(fE(this,e),this.getColumnCount(),n.map(e=>e*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t,r=!dE(n)&&jg(n)?n.querySelector(`table`):n;if(jg(n)&&dE(r)&&r!==n){n.dir&&(r.dir=n.dir);let{paddingInlineStart:e}=n.style;e&&(r.style.paddingInlineStart=e);let t=n.getAttribute(`data-lexical-indent`);t!==null&&r.setAttribute(`data-lexical-indent`,t)}return{after:n=>{if(t.after&&(n=t.after(n)),!dE(n)&&jg(n)&&(n=n.querySelector(`table`)),!dE(n))return null;zE(n,e._config,this.getFormatType());let[r]=XT(this,null,null),i=new Map;for(let e of r)for(let t of e){let e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let a=new Set;for(let e of n.querySelectorAll(`:scope > tr > [data-temporary-table-cell-lexical-key]`)){let t=e.getAttribute(`data-temporary-table-cell-lexical-key`);if(t){let n=i.get(t);if(e.removeAttribute(`data-temporary-table-cell-lexical-key`),n){i.delete(t);for(let e=0;e<n.colSpan;e++)a.add(e+n.startColumn)}}}let o=n.querySelector(`:scope > colgroup`);if(o){let e=Array.from(n.querySelectorAll(`:scope > colgroup > col`)).filter((e,t)=>a.has(t));o.replaceChildren(...e)}let s=n.querySelectorAll(`:scope > tr`);if(s.length>0){let e=Cg().createElement(`tbody`);for(let t of s)e.appendChild(t);n.append(e)}return n},element:r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:r}=t;for(let t=0;t<n;t++){let n=r[t];if(n!=null)for(let r=0;r<n.length;r++){let i=n[r];if(i==null)continue;let{elem:a}=i,o=IE(this,a);if(o!==null&&e.is(o))return{x:r,y:t}}}throw Error(`Cell not found in table.`)}getDOMCellFromCords(e,t,n){let{domRows:r}=n,i=r[t];return i==null?null:i[e<i.length?e:i.length-1]??null}getDOMCellFromCordsOrThrow(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(!r)throw Error(`Cell not found at cords.`);return r}getCellNodeFromCords(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(r==null)return null;let i=Oh(r.elem);return LT(i)?i:null}getCellNodeFromCordsOrThrow(e,t,n){let r=this.getCellNodeFromCords(e,t,n);if(!r)throw Error(`Node at cords not TableCellNode.`);return r}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!VT(e))return 0;let t=0;return e.getChildren().forEach(e=>{LT(e)&&(t+=e.getColSpan())}),t}};function uge(e,t){let n=e.getElementByKey(t.getKey());return n===null&&RT(230),vE(t,n)}function dge(e){let t=KE();e.hasAttribute(`data-lexical-row-striping`)&&t.setRowStriping(!0),e.hasAttribute(`data-lexical-frozen-column`)&&t.setFrozenColumns(1),e.hasAttribute(`data-lexical-frozen-row`)&&t.setFrozenRows(1);let n=e.querySelector(`:scope > colgroup`);if(n){let e=[];for(let t of n.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!kT.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return Gg(t,e),{after:e=>Bb(e,VT),node:t}}function KE(){return pg(new GE)}function qE(e){return e instanceof GE}function fge(e){VT(e.getParent())?e.isEmpty()&&e.append(Qm()):e.remove()}function pge(e){qE(e.getParent())?Rde(e,LT):e.remove()}function mge(e){Rde(e,VT),ZT(e);let t=e.getColWidths(),n=e.getColumnCount();if(t&&t.length!==n){let r;if(n<t.length)r=t.slice(0,n);else if(t.length>0){let e=t[t.length-1];r=[...t,...Array(n-t.length).fill(e)]}e.setColWidths(r)}}function hge(e){if(e.detail<3||!Mg(e.target))return!1;let t=Oh(e.target);if(t===null)return!1;let n=g_(t,e=>Z(e)&&!e.isInline());return n!==null&&!!LT(n.getParent())&&(fm(n.select(0)),!0)}function gge(){let e=$();if(!Q(e))return!1;let t=AE(e.anchor.getNode());if(t===null)return!1;let n=jh();if(!n.is(t.getParent())||n.getChildrenSize()!==1)return!1;let[r]=XT(t,null,null);if(r.length===0||r[0].length===0)return!1;let i=r[0][0];if(!i||!i.cell)return!1;let a=r[r.length-1],o=a[a.length-1];return!o||!o.cell?!1:(Nh(aE(t,i.cell,o.cell)),!0)}function _ge(e){return e.registerNodeTransform(NT,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=QT(e),[n]=YT(t,e,e),r=n.length,i=n[0].length,a=t.getFirstChild();VT(a)||RT(175);let o=[];for(let e=0;e<r;e++){e!==0&&(a=a.getNextSibling(),VT(a)||RT(175));let t=null;for(let r=0;r<i;r++){let i=n[e][r],s=i.cell;if(i.startRow===e&&i.startColumn===r)t=s,o.push(s);else if(s.getColSpan()>1||s.getRowSpan()>1){LT(s)||RT(176);let e=IT(s.__headerState);t===null?Lde(a,e):t.insertAfter(e)}}}for(let e of o)e.setColSpan(1),e.setRowSpan(1)}})}function vge(e,t=!0){let n=new Zhe,r=!1,i=(r,i,a)=>{let o=fE(r,a),s=rge(r,o,e,t,n);n.observers.set(i,[s,o])};return pv(nge(e,n),e.registerCommand(id,()=>e.getRootElement()!==null&&(r=!0,function(e,t){let n=$(),r=Dy(),i=e.getAndClearNextFocus();if(i!==null&&qE(wh(i.tableKey))){let{tableKey:t,focusCell:r}=i,a=e.observers.get(t);a||RT(335,t);let[o]=a;if(iE(n)&&n.tableKey===o.tableNodeKey)return(r.x!==o.focusX||r.y!==o.focusY)&&(o.$setFocusCellForSelection(r),!0);if(o.anchorCell!==null&&o.anchorCellNodeKey!==null&&r.elem!==o.anchorCell.elem&&o.tableSelection!==null)return o.$setFocusCellForSelection(r,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&Q(r)&&Q(n)&&n.isCollapsed()){let e=wh(a);if(qE(e)){let t=n.anchor.getNode(),r=e.getFirstChild(),i=kE(t);if(i!==null&&VT(r)){let t=r.getFirstChild();if(LT(t)&&e.is(g_(i,n=>n.is(e)||n.is(t))))return t.selectStart(),!0}}}return iE(n)&&function(e,t){let n=pE(e),r=Dy();if(!t.is(r))return;let i=cE(t.tableKey),a=vg(n),o=a&&Eg(a,e.getRootElement());if(a&&o&&o.anchorNode&&o.focusNode){let n=Oh(o.focusNode),r=n&&!i.isParentOf(n),s=Oh(o.anchorNode),c=s&&i.isParentOf(s);if(r&&c&&a.rangeCount>0){let n=wy(a,e);n&&(n.anchor.set(i.getKey(),t.isBackward()?i.getChildrenSize():0,`element`),a.removeAllRanges(),Nh(n))}}}(t,n),Q(n)&&function(e,t){let n=Dy(),{anchor:r,focus:i}=e,a=r.getNode(),o=i.getNode(),s=kE(a),c=kE(o),l=s?AE(s):null,u=c?AE(c):null;if(t.touchTapCellKey!==null&&!e.dirty&&!e.isCollapsed()&&Q(n)&&n.isCollapsed()&&(!s||!s.is(c))){let e=wh(n.anchor.key),a=e&&e.getParent();if(Z(e)&&e.isEmpty()&<(a)&&a.getKey()===t.touchTapCellKey&&a.getChildren().every(e=>Z(e)&&e.isEmpty())&&(r.is(n.anchor)||i.is(n.anchor)))return void Nh(n.clone())}let d=e.isBackward(),f=s&&c&&l&&u&&l.is(u),p=u&&(!l||l.isParentOf(u)),m=l&&(!u||u.isParentOf(l));if(p){let t=e.clone(),[n]=YT(u,c,c),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.focus.set(d?r.getKey():i.getKey(),d?0:i.getChildrenSize(),`element`),Nh(t)}else if(m){let t=e.clone(),[n]=YT(l,s,s),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.anchor.set(d?i.getKey():r.getKey(),d?i.getChildrenSize():0,`element`),Nh(t)}else if(f){if(!s.is(c))return void Nh(aE(l,s,c));let r=t.observers.get(l.getKey());if(r===void 0)return;let[i]=r;if(i.pointerType===`touch`&&i.isSelecting&&i.isPointerDrag&&e.isCollapsed()&&Q(n)&&n.isCollapsed()){let e=wh(n.anchor.key),t=e&&kE(e),{pointerStartCell:r}=i,a=r&&Oh(r.elem);a!==null&&!a.is(c)&&t&&l.is(AE(t))&&!t.is(c)&&(Nh(aE(l,t,c)),i.pointerType=null)}}}(n,e),!1}(n,e)),3),e.registerUpdateListener(({dirtyElements:t})=>{if(!r){for(let e of t.keys())if(n.observers.has(e)){r=!0;break}}r&&(r=!1,e.getRootElement()!==null&&e.read(`latest`,()=>{(function(e,t){for(let[n,r]of e.$getTableNodesAndObservers())ige(t,n,r)})(n,e)}))}),e.registerMutationListener(GE,t=>{r=!0,e.read(`latest`,()=>{for(let[e,r]of t){let t=n.observers.get(e);if(r===`created`||r===`updated`){let{tableNode:r,tableElement:a}=oE(e);t===void 0?i(r,e,a):a!==t[1]&&(n.removeObserver(e),i(r,e,a))}else r===`destroyed`&&n.removeObserver(e)}})},{skipInitialization:!1}),()=>{n.removeAllObservers()})}function yge(e,t){e.hasNodes([GE])||RT(255);let{hasNestedTables:n=rx(!1)}=t??{};return pv(e.registerCommand(Bhe,e=>function({rows:e,columns:t,includeHeaders:n},r){let i=$()||Dy();if(!i||!Q(i)||!r&&AE(i.anchor.getNode()))return!1;let a=HT(Number(e),Number(t),n);Lb(a);let o=a.getFirstDescendant();return Fm(o)&&o.select(),!0}(e,n.peek()),0),e.registerCommand(ad,(t,r)=>e===r&&function(e,t){let{nodes:n,selection:r}=e;if(!n.some(e=>qE(e)||Ade(e).some(e=>qE(e.node)))){if(iE(r)){let e=``,t=!1;for(let r of n){let n=Z(r)&&!r.isInline();e.length>0&&(n||t)&&(e+=`
|
||
`),e+=r.getTextContent(),t=n}return r.insertRawText(e),!0}return!1}let i=iE(r),a=Q(r);return!!(a&&g_(r.anchor.getNode(),e=>LT(e))!==null&&g_(r.focus.getNode(),e=>LT(e))!==null||i)&&(n.length===1&&qE(n[0])?tE(n[0],r):!(a&&t.peek()&&!function(e){return!(!iE(e)||e.focus.getNode().is(e.anchor.getNode()))||!(!Q(e)||!LT(e.anchor.getNode())||e.anchor.getNode().is(e.focus.getNode()))}(r)))}(t,n),0),e.registerCommand(Wd,gge,1),e.registerCommand(od,hge,0),e.registerNodeTransform(GE,mge),e.registerNodeTransform(zT,pge),e.registerNodeTransform(NT,fge))}var bge={build:(e,t,n)=>vpe(t),config:{hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0},dependencies:[fpe,[tS,{rules:[{$import:(e,t)=>{let n=KE();t.hasAttribute(`data-lexical-row-striping`)&&n.setRowStriping(!0),t.hasAttribute(`data-lexical-frozen-column`)&&n.setFrozenColumns(1),t.hasAttribute(`data-lexical-frozen-row`)&&n.setFrozenRows(1);let r=t.querySelector(`:scope > colgroup`);if(r){let e=[];for(let t of r.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!kT.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&n.setColWidths(e)}return[n.splice(0,0,Bb(e.$importChildren(t),VT))]},match:nS.tag(`table`),name:`@lexical/table/table`},{$import:(e,t)=>[BT(kT.test(t.style.height)?parseFloat(t.style.height):void 0).splice(0,0,Bb(e.$importChildren(t),LT))],match:nS.tag(`tr`),name:`@lexical/table/tr`},{$import:(e,t)=>{let n=t.nodeName===`TH`,r=kT.test(t.style.width)?parseFloat(t.style.width):void 0,i=MT.NO_STATUS;if(n){let e=t.getAttribute(`scope`);if(e===`col`)i=MT.COLUMN;else if(e===`row`)i=MT.ROW;else{let e=t.parentElement,n=Kle(e)&&(e.parentElement&&e.parentElement.nodeName===`THEAD`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=MT.ROW),r&&(i|=MT.COLUMN),i===MT.NO_STATUS&&(i=MT.ROW)}}let a=IT(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;(function(e){return e===`middle`||e===`bottom`})(s)&&(a.__verticalAlign=s);let c=e.get(Rx),l=c|function(e){let t=0,n=e.fontWeight;n!==`700`&&n!==`bold`||(t|=1),e.fontStyle===`italic`&&(t|=2);let r=(e.textDecoration||``).split(` `);return r.includes(`underline`)&&(t|=8),r.includes(`line-through`)&&(t|=4),t}(t.style),u=e.get(zx),d=t.style.color,f=d?{...u,color:d}:u,p=[];l!==c&&p.push(bx(Rx,l)),f!==u&&p.push(bx(zx,f));let m=function(e){let t=[],n=null,r=()=>{if(n!==null){let e=n.getFirstChild();E_(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)cg(i)||Fm(i)||E_(i)?n===null?(n=Qm().append(i),t.push(n)):n.append(i):(r(),n=null,t.push(i));return r(),t.length===0&&t.push(Qm()),t}(e.$importChildren(t,{context:p})),h=n?m:Wx(m,t);return[a.splice(0,0,h)]},match:nS.tag(`td`,`th`),name:`@lexical/table/cell`}]}]],name:`@lexical/table/Table`,nodes:()=>[GE,zT,NT],register(e,t,n){let r=n.getOutput(),i=!1;return pv(sx(()=>{let t=r.hasHorizontalScroll.value,n=r.hasStickyScrollbar.value&&t,a=UE(e);a!==t&&lge(e,t),a===t&&i===n||e.update(Z_),i=n}),yge(e,r),sx(()=>vge(e,r.hasTabHandler.value)),sx(()=>{if(r.hasStickyScrollbar.value&&r.hasHorizontalScroll.value)return e.registerRootListener(t=>{if(t)return function(e){let t=new Map;return pv(()=>{for(let{cleanup:e}of t.values())e();t.clear()},e.registerMutationListener(GE,n=>{for(let[r,i]of n){let n=t.get(r);if(i===`destroyed`){n&&(n.cleanup(),t.delete(r));continue}let a=e.getElementByKey(r),o=a&&jg(a)?cge(a):null;n&&o&&n.parts.scrollable===o.scrollable&&n.parts.scrollbar===o.scrollbar&&n.parts.tableElement===o.tableElement?VE(o.scrollable,o.scrollbar):(n&&(n.cleanup(),t.delete(r)),o&&t.set(r,{cleanup:sge(o),parts:o}))}},{skipInitialization:!1}))}(e)})}),sx(()=>r.hasCellMerge.value?void 0:_ge(e)),sx(()=>r.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(NT,e=>{e.getBackgroundColor()!==null&&e.setBackgroundColor(null)})))}},JE=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),YE=(e,t,{ellipsis:n=`…`}={})=>{let r=e.trim();if(r.length<=t)return r;let i=[...r.slice(0,t*2)];return`${i.slice(0,t).join(``).trim()}${i.length>t||r.length>t*2?n:``}`},XE=e=>e.replace(/^\/+|\/+$/g,``),ZE,xge=e=>(ZE??=new DOMParser,ZE.parseFromString(e,`text/html`).body.textContent),QE=e=>!/\s/.test(e)&&URL.canParse(e),$E=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare,eD=(e,t=[])=>e.getRootElement()?.contains(document.activeElement)?t:[...t,`skip-dom-selection`],tD=class e{#e;#t;#n=``;#r=``;#i={};#a=[];constructor(e,t,{keyPath:n,autoIncrement:r,indexes:i=[]}={}){this.#e=void 0,this.#n=e,this.#r=t,this.#i={keyPath:n,autoIncrement:r},this.#a=i}async#o(e){return new Promise((t,n)=>{let r=globalThis.indexedDB.open(this.#n,e);r.onupgradeneeded=()=>{let e=r.result,t=this.#r,n=e.objectStoreNames.contains(t)?r.transaction.objectStore(t):e.createObjectStore(t,this.#i);this.#a.forEach(({name:e,keyPath:t,options:r})=>{n.indexNames.contains(e)||n.createIndex(e,t,r)})},r.onsuccess=()=>{t(r.result)},r.onerror=()=>{n(r.error)}})}#s(e){let t=this.#r;if(!e.objectStoreNames.contains(t))return!0;let n=e.transaction(t).objectStore(t);return this.#a.some(({name:e})=>!n.indexNames.contains(e))}async#c(){let e=await this.#o();for(;this.#s(e);){let{version:t}=e;e.close();try{e=await this.#o(t+1)}catch(t){if(t?.name!==`VersionError`)throw t;e=await this.#o()}}return e.onversionchange=()=>{e.close(),this.#e=void 0},e.onclose=()=>{this.#e=void 0},e}async#l(e,{mode:t=`readonly`}={}){if(!this.#e){this.#t??=this.#c();try{this.#e=await this.#t}finally{this.#t=void 0}}let n=this.#e,r=this.#r,i=n.transaction(r,t),a=e(i.objectStore(r));return new Promise((e,n)=>{if(i.onerror=()=>{n(i.error)},i.onabort=()=>{n(i.error)},t===`readwrite`){let t;a&&(a.onsuccess=()=>{t=a.result}),i.oncomplete=()=>{e(t)}}else a?a.onsuccess=()=>{e(a.result)}:i.oncomplete=()=>{e(void 0)}})}async set(e,t){return this.#l(n=>n.put(t,e),{mode:`readwrite`})}async put(e){return this.#l(t=>t.put(e),{mode:`readwrite`})}async saveEntries(e){return this.#l(t=>{e.forEach(([e,n])=>{t.put(n,e)})},{mode:`readwrite`})}async get(e){return this.#l(t=>t.get(e))}async keys(){return this.#l(e=>e.getAllKeys())}async values(){return this.#l(e=>e.getAll())}async entries(){let e=[],t=await this.#l(t=>{let n=t.getAllKeys();return n.onsuccess=()=>{e=n.result},t.getAll()});return e.map((e,n)=>[e,t[n]])}static#u(e,t){return t?e.index(t):e}async#d({callback:t=void 0,index:n=void 0,query:r=void 0,direction:i=`next`}){return new Promise((a,o)=>{this.#l(o=>{let s=e.#u(o,n).openCursor(r,i);s.onsuccess=()=>{let e=s.result;if(e){let{value:n}=e;typeof t!=`function`||t(n)?a(n):e.continue()}else a(void 0)}}).catch(o)})}async find(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n})}async findLast(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n,direction:`prev`})}async filter(t,{index:n,query:r}={}){let i=await this.#l(t=>e.#u(t,n).getAll(r));return typeof t==`function`?i.filter(e=>t(e)):i}async delete(e){await this.#l(t=>t.delete(e),{mode:`readwrite`})}async deleteEntries(e){await this.#l(t=>{e.forEach(e=>{t.delete(e)})},{mode:`readwrite`})}async clear(){await this.#l(e=>e.clear(),{mode:`readwrite`})}},nD=e=>{try{return JSON.parse(e)}catch{return null}},rD=class{static async set(e,t){t===void 0?globalThis.localStorage.removeItem(e):globalThis.localStorage.setItem(e,JSON.stringify(t))}static async get(e){let t=globalThis.localStorage.getItem(e);return t?nD(t):null}static async delete(e){globalThis.localStorage.removeItem(e)}static async clear(){globalThis.localStorage.clear()}static async keys(){return Object.keys(globalThis.localStorage)}static async values(){return Object.values(globalThis.localStorage).map(nD)}static async entries(){return Object.entries(globalThis.localStorage).map(([e,t])=>[e,nD(t)])}},iD=[{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`]},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`]},{id:`abap`,name:`ABAP`},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`]},{id:`ada`,name:`Ada`},{id:`angular-html`,name:`Angular HTML`},{id:`angular-ts`,name:`Angular TypeScript`},{id:`apache`,name:`Apache Conf`},{id:`apex`,name:`Apex`},{id:`apl`,name:`APL`},{id:`applescript`,name:`AppleScript`},{id:`ara`,name:`Ara`},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`]},{id:`razor`,name:`ASP.NET Razor`},{id:`asm`,name:`Assembly`},{id:`astro`,name:`Astro`},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`]},{id:`ahk2`,name:`AutoHotkey2`},{id:`awk`,name:`AWK`},{id:`ballerina`,name:`Ballerina`},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`]},{id:`beancount`,name:`Beancount`},{id:`berry`,name:`Berry`,aliases:[`be`]},{id:`bibtex`,name:`BibTeX`},{id:`bicep`,name:`Bicep`},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`]},{id:`blade`,name:`Blade`},{id:`c`,name:`C`},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`]},{id:`cpp`,name:`C++`,aliases:[`c++`]},{id:`c3`,name:`C3`},{id:`cadence`,name:`Cadence`,aliases:[`cdc`]},{id:`cairo`,name:`Cairo`},{id:`chapel`,name:`Chapel`,aliases:[`chpl`]},{id:`clarity`,name:`Clarity`},{id:`clojure`,name:`Clojure`,aliases:[`clj`]},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`]},{id:`cmake`,name:`CMake`},{id:`cobol`,name:`COBOL`},{id:`codeowners`,name:`CODEOWNERS`},{id:`codeql`,name:`CodeQL`,aliases:[`ql`]},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`]},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`]},{id:`crystal`,name:`Crystal`},{id:`css`,name:`CSS`},{id:`csv`,name:`CSV`},{id:`cue`,name:`CUE`},{id:`cypher`,name:`Cypher`,aliases:[`cql`]},{id:`d`,name:`D`},{id:`dart`,name:`Dart`},{id:`dax`,name:`DAX`},{id:`desktop`,name:`Desktop`},{id:`diff`,name:`Diff`},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`]},{id:`dotenv`,name:`dotEnv`},{id:`dream-maker`,name:`Dream Maker`},{id:`edge`,name:`Edge`},{id:`elixir`,name:`Elixir`},{id:`elm`,name:`Elm`},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`]},{id:`erb`,name:`ERB`},{id:`erlang`,name:`Erlang`,aliases:[`erl`]},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`]},{id:`fennel`,name:`Fennel`},{id:`fish`,name:`Fish`},{id:`fluent`,name:`Fluent`,aliases:[`ftl`]},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`]},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`]},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`]},{id:`gdscript`,name:`GDScript`,aliases:[`gd`]},{id:`gdshader`,name:`GDShader`},{id:`genie`,name:`Genie`},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`]},{id:`gherkin`,name:`Gherkin`},{id:`git-commit`,name:`Git Commit Message`},{id:`git-rebase`,name:`Git Rebase Message`},{id:`gleam`,name:`Gleam`},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`]},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`]},{id:`glsl`,name:`GLSL`},{id:`gn`,name:`GN`},{id:`smalltalk`,name:`GNU Smalltalk`},{id:`gnuplot`,name:`Gnuplot`},{id:`go`,name:`Go`},{id:`graphql`,name:`GraphQL`,aliases:[`gql`]},{id:`groovy`,name:`Groovy`},{id:`hack`,name:`Hack`},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`]},{id:`hcl`,name:`HashiCorp HCL`},{id:`haskell`,name:`Haskell`,aliases:[`hs`]},{id:`haxe`,name:`Haxe`},{id:`hjson`,name:`Hjson`},{id:`hlsl`,name:`HLSL`},{id:`html`,name:`HTML`},{id:`html-derivative`,name:`HTML (Derivative)`},{id:`http`,name:`HTTP`},{id:`hurl`,name:`Hurl`},{id:`hxml`,name:`HXML`},{id:`hy`,name:`Hy`},{id:`imba`,name:`Imba`},{id:`ini`,name:`INI`,aliases:[`properties`]},{id:`java`,name:`Java`},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`]},{id:`jinja`,name:`Jinja`},{id:`jison`,name:`Jison`},{id:`json`,name:`JSON`},{id:`jsonl`,name:`JSON Lines`},{id:`jsonc`,name:`JSON with Comments`},{id:`json5`,name:`JSON5`},{id:`jsonnet`,name:`Jsonnet`},{id:`jssm`,name:`JSSM`,aliases:[`fsl`]},{id:`jsx`,name:`JSX`},{id:`julia`,name:`Julia`,aliases:[`jl`]},{id:`just`,name:`Just`,aliases:[`justfile`]},{id:`kdl`,name:`KDL`},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`]},{id:`kusto`,name:`Kusto`,aliases:[`kql`]},{id:`latex`,name:`LaTeX`},{id:`lean`,name:`Lean 4`,aliases:[`lean4`]},{id:`less`,name:`Less`},{id:`liquid`,name:`Liquid`},{id:`llvm`,name:`LLVM IR`},{id:`log`,name:`Log file`},{id:`logo`,name:`Logo`},{id:`lua`,name:`Lua`},{id:`luau`,name:`Luau`},{id:`make`,name:`Makefile`,aliases:[`makefile`]},{id:`markdown`,name:`Markdown`,aliases:[`md`]},{id:`marko`,name:`Marko`},{id:`matlab`,name:`MATLAB`},{id:`mdc`,name:`MDC`},{id:`mdx`,name:`MDX`},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`]},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`]},{id:`mojo`,name:`Mojo`},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`]},{id:`move`,name:`Move`},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`]},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`]},{id:`nextflow-groovy`,name:`Nextflow Groovy`},{id:`nginx`,name:`Nginx`},{id:`nim`,name:`Nim`},{id:`nix`,name:`Nix`},{id:`nsis`,name:`NSIS`},{id:`nushell`,name:`nushell`,aliases:[`nu`]},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`]},{id:`objective-cpp`,name:`Objective-C++`},{id:`ocaml`,name:`OCaml`},{id:`odin`,name:`Odin`},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`]},{id:`org`,name:`Org Markup`},{id:`pascal`,name:`Pascal`},{id:`perl`,name:`Perl`},{id:`php`,name:`PHP`},{id:`pkl`,name:`Pkl`},{id:`plsql`,name:`PL/SQL`},{id:`polar`,name:`Polar`},{id:`postcss`,name:`PostCSS`},{id:`powerquery`,name:`PowerQuery`},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`]},{id:`prisma`,name:`Prisma`},{id:`prolog`,name:`Prolog`},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`]},{id:`pug`,name:`Pug`,aliases:[`jade`]},{id:`puppet`,name:`Puppet`},{id:`purescript`,name:`PureScript`},{id:`python`,name:`Python`,aliases:[`py`]},{id:`qml`,name:`QML`},{id:`qmldir`,name:`QML Directory`},{id:`qss`,name:`Qt Style Sheets`},{id:`r`,name:`R`},{id:`racket`,name:`Racket`},{id:`raku`,name:`Raku`,aliases:[`perl6`]},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`]},{id:`regexp`,name:`RegExp`,aliases:[`regex`]},{id:`rel`,name:`Rel`},{id:`rst`,name:`reStructuredText`},{id:`riscv`,name:`RISC-V`},{id:`coq`,name:`Rocq`},{id:`ron`,name:`RON`},{id:`rosmsg`,name:`ROS Interface`},{id:`ruby`,name:`Ruby`,aliases:[`rb`]},{id:`haml`,name:`Ruby Haml`},{id:`rust`,name:`Rust`,aliases:[`rs`]},{id:`sas`,name:`SAS`},{id:`sass`,name:`Sass`},{id:`scala`,name:`Scala`},{id:`scheme`,name:`Scheme`},{id:`scss`,name:`SCSS`},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`]},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`]},{id:`shellsession`,name:`Shell Session`,aliases:[`console`]},{id:`smithy`,name:`Smithy`},{id:`solidity`,name:`Solidity`},{id:`sparql`,name:`SPARQL`},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`]},{id:`sql`,name:`SQL`},{id:`ssh-config`,name:`SSH Config`},{id:`stata`,name:`Stata`},{id:`stylus`,name:`Stylus`,aliases:[`styl`]},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`]},{id:`svelte`,name:`Svelte`},{id:`swift`,name:`Swift`},{id:`systemd`,name:`Systemd Units`},{id:`system-verilog`,name:`SystemVerilog`},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`]},{id:`tasl`,name:`Tasl`},{id:`tcl`,name:`Tcl`},{id:`templ`,name:`Templ`},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`]},{id:`tex`,name:`TeX`},{id:`toml`,name:`TOML`},{id:`tsv`,name:`TSV`},{id:`tsx`,name:`TSX`},{id:`turtle`,name:`Turtle`},{id:`twig`,name:`Twig`},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`]},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`]},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`]},{id:`typst`,name:`Typst`,aliases:[`typ`]},{id:`v`,name:`V`},{id:`vala`,name:`Vala`},{id:`verilog`,name:`Verilog`},{id:`vhdl`,name:`VHDL`},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`]},{id:`vb`,name:`Visual Basic`},{id:`vue`,name:`Vue`},{id:`vue-html`,name:`Vue HTML`},{id:`vue-vine`,name:`Vue Vine`},{id:`vyper`,name:`Vyper`,aliases:[`vy`]},{id:`wasm`,name:`WebAssembly`},{id:`wit`,name:`WebAssembly Interface Types`},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`]},{id:`wgsl`,name:`WGSL`},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`]},{id:`reg`,name:`Windows Registry Script`},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`]},{id:`xml`,name:`XML`},{id:`xsl`,name:`XSL`},{id:`yaml`,name:`YAML`,aliases:[`yml`]},{id:`zenscript`,name:`ZenScript`},{id:`zig`,name:`Zig`}],Sge=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`},{id:`github-light`,displayName:`GitHub Light`,type:`light`},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`},{id:`horizon`,displayName:`Horizon`,type:`dark`},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`},{id:`houston`,displayName:`Houston`,type:`dark`},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`},{id:`laserwave`,displayName:`LaserWave`,type:`dark`},{id:`light-plus`,displayName:`Light Plus`,type:`light`},{id:`material-theme`,displayName:`Material Theme`,type:`dark`},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`},{id:`min-dark`,displayName:`Min Dark`,type:`dark`},{id:`min-light`,displayName:`Min Light`,type:`light`},{id:`monokai`,displayName:`Monokai`,type:`dark`},{id:`night-owl`,displayName:`Night Owl`,type:`dark`},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`},{id:`nord`,displayName:`Nord`,type:`dark`},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`},{id:`one-light`,displayName:`One Light`,type:`light`},{id:`plastic`,displayName:`Plastic`,type:`dark`},{id:`poimandres`,displayName:`Poimandres`,type:`dark`},{id:`red`,displayName:`Red`,type:`dark`},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`},{id:`vesper`,displayName:`Vesper`,type:`dark`},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`}],Cge=`sveltia-ui`,wge=`shiki`,aD,oD,sD=!0,cD=(e,t)=>`4.6.0/${e}/${t}`,lD=()=>(aD===void 0&&(aD=typeof indexedDB>`u`?null:new tD(Cge,wge)),aD),Tge=async e=>(oD??=(async()=>{let t=(await e.keys()).filter(e=>typeof e==`string`&&!e.startsWith(`4.6.0/`));t.length&&await e.deleteEntries(t)})(),oD),Ege=async(e,t)=>{let n=sD?lD():null;if(n)try{return await Tge(n),await n.get(cD(e,t))}catch{return}},Dge=async(e,t,n)=>{let r=sD?lD():null;if(r)try{await r.set(cD(e,t),n)}catch{}},uD=`https://unpkg.com/@shikijs`,Oge=`https://unpkg.com/@sveltia/ui`,kge=()=>`${Oge}@0.89.0/dist/shiki-engine.js`,Age=e=>`${uD}/langs@4.6.0/dist/${e}.mjs`,jge=e=>`${uD}/themes@4.6.0/dist/${e}.mjs`,Mge={loadEngine:async()=>import(kge()),loadLanguage:async e=>import(Age(e)),loadTheme:async e=>import(jge(e))},dD=()=>Mge,fD=()=>{if(typeof document>`u`)return`github-light`;let{theme:e}=document.documentElement.dataset;return e?e===`dark`?`github-dark`:`github-light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`github-dark`:`github-light`},pD=e=>{if(typeof document>`u`)return()=>void 0;let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]});let n=window.matchMedia(`(prefers-color-scheme: dark)`);return n.addEventListener(`change`,e),()=>{t.disconnect(),n.removeEventListener(`change`,e)}},Nge=e=>pD(()=>{let t=fD();e.update(()=>{jh().getChildren().forEach(e=>{_S(e)&&e.getTheme()!==t&&(e.setTheme(t),e.markDirty())})},{tag:eD(e,[`history-merge`])})}),Pge=[``,`plain`,`plaintext`,`text`,`txt`],Fge=/^diff-([\w-]+)/i,mD=null,hD=null,gD=!1,_D=e=>Fge.exec(e)?.[1]??null,vD=e=>Pge.includes(e??``),yD=()=>!!hD,Ige=()=>gD,bD=e=>{if(!hD)return!1;let t=_D(e)??e;return mD.isSpecialLang(t)?!0:hD.getLoadedLanguages().includes(t)},Lge=(e,t)=>{e.update(()=>{let e=wh(t);if(!_S(e))return;let n=e.getLanguage();n&&bD(n)&&!e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!0),e.markDirty()},{tag:eD(e,[`history-merge`])})},xD=new Map,SD=(e,t,n,r)=>{let i=xD.get(e);if(!i){let n=new Map;i={promise:(async()=>{try{await t()}catch{}xD.delete(e),n.forEach((e,t)=>Lge(e,t))})(),targets:n},xD.set(e,i)}return n&&r&&i.targets.set(r,n),i.promise},CD=(e,t)=>{if(!(hD||gD))return SD(`engine`,async()=>{try{mD=await dD().loadEngine(),hD=mD.createHighlighterCoreSync({engine:mD.createJavaScriptRegexEngine(),langs:[],themes:[]})}catch{gD=!0}},e,t)},Rge=async(e,t,n)=>{let r=await Ege(e,t);if(r)return r;let i=await n();if(!i)return;let a=i.default??i;return await Dge(e,t,a),a},wD=(e,t,n,r)=>{let i=e===`lang`?`loadLanguage`:`loadTheme`;return SD(`${e}/${t}`,async()=>{let n=await Rge(e,t,()=>dD()[i](t));n&&await hD[i](n)},n,r)},TD=e=>iD.find(({id:t,aliases:n})=>t===e||n?.includes(e)),ED=e=>TD(e)?.id??e,DD=(e,t,n)=>{let r=_D(e)??e;if(!hD||bD(r))return;let i=TD(r);if(i)return wD(`lang`,i.id,t,n)},OD=e=>hD?mD.isSpecialTheme(e)||hD.getLoadedThemes().includes(e):!1,kD=(e,t,n)=>{if(hD&&!OD(e)&&Sge.some(({id:t})=>t===e))return wD(`theme`,e,t,n)},zge=(e,t)=>{let n=[];return e.forEach((e,r)=>{r&&n.push(T_()),e.forEach((e,r)=>{let{content:i}=e;if(t&&r===0&&i.length>0){let e=[`+`,`-`,`>`,`<`,` `],t=[`inserted`,`deleted`,`inserted`,`deleted`,`unchanged`],r=e.indexOf(i[0]);r!==-1&&(n.push(TS(e[r],t[r])),i=i.slice(1))}let a=mD.stringifyTokenStyle(e.htmlStyle||mD.getTokenStyleObject(e));Fy(i,{linebreak:()=>n.push(T_()),tab:()=>n.push(th()),text:e=>{let t=TS(e);t.setStyle(a),n.push(t)}})})}),n},Bge=(e,t)=>{let n=_D(t),{tokens:r}=hD.codeToTokens(e.getTextContent(),{lang:n??t,theme:e.getTheme()});return zge(r,!!n)},AD=(e,t)=>{if(!hD||vD(e)||!bD(e))return;let n=t??fD();return OD(n)?n:void 0},Vge=(e,t,{theme:n}={})=>{let r=ED(_D(t)??t),i=AD(r,n);if(i!==void 0)return hD.codeToHtml(e,{lang:r,theme:i})},Hge=(e,t,{theme:n}={})=>{let r=ED(t),i=AD(r,n);if(i===void 0)return;let{tokens:a,fg:o=``}=hD.codeToTokens(e,{lang:r,theme:i});return a.map(e=>e.map(({content:e,color:t,fontStyle:n=0})=>{let r={content:e};return t&&t.toLowerCase()!==o.toLowerCase()&&(r.color=t),n&2&&(r.bold=!0),n&4&&(r.underline=!0),n&8&&(r.strikethrough=!0),r}))},Uge={a:[`href`,`rel`,`target`,`title`],ol:[`start`],td:[`colspan`,`rowspan`],th:[`colspan`,`rowspan`]},Wge=[[`code`,`code`],[`subscript`,`sub`],[`superscript`,`sup`],[`highlight`,`mark`],[`underline`,`u`],[`strikethrough`,`s`],[`italic`,`em`],[`bold`,`strong`]],Gge=[`tbody`,`thead`,`tfoot`,`colgroup`,`col`],Kge=[`html`,`head`,`body`],jD=e=>e.className.match(/(?:^|\s)(?:lang|language)-(\S+)/)?.[1],qge=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`blockquote`,`li`],MD=e=>{let t=Uge[e.localName]??[],n=qge.includes(e.localName)?e.style.textAlign:``;[...e.attributes].forEach(({name:n})=>{t.includes(n)||e.removeAttribute(n)}),n&&(e.style.textAlign=n)},ND=(e,t)=>{let{after:n,...r}=t.exportDOM(e);return jg(r.element)&&MD(r.element),{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return jg(i)&&(MD(i),i.querySelectorAll(`:scope > br`).forEach(MD)),r===e?void 0:r}}},Jge=(e,t)=>{let n=t.getParent();return n instanceof NT&&n.getChildrenSize()===1&&!t.getFormatType()?{element:document.createDocumentFragment()}:t.isEmpty()&&t.getNextSiblings().every(e=>$m(e)&&e.isEmpty())?{element:null}:ND(e,t)},PD=(e,t)=>{let n=document.createTextNode(t.getTextContent());return Wge.forEach(([e,r])=>{if(t.hasFormat(e)){let e=document.createElement(r);e.append(n),n=e}}),{element:n}},Yge=(e,t)=>({element:document.createElement(`pre`),after:e=>{if(!jg(e))return;let n=document.createElement(`code`),r=t.getLanguage();r&&!vD(r)&&(n.className=`language-${r}`),n.textContent=[...e.childNodes].map(e=>e.nodeName===`BR`?jg(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)?``:`
|
||
`:e.textContent).join(``),e.replaceChildren(n)}}),Xge=`:scope > :is(thead, tbody, tfoot), :scope > :is(thead, tbody, tfoot) > tr, :scope > :is(thead, tbody, tfoot) > tr > :is(th, td), :scope > tr, :scope > tr > :is(th, td)`,Zge=new Map([[Mm,PD],[eh,PD],[CS,PD],[Zm,Jge],[WC,ND],[VC,ND],[cC,ND],[pC,ND],[US,ND],[ux,ND],[hS,Yge],[GE,(e,t)=>{let{after:n,...r}=t.exportDOM(e);return{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return jg(i)&&(i.querySelectorAll(`:scope > colgroup`).forEach(e=>e.remove()),[i,...i.querySelectorAll(Xge)].forEach(MD)),r===e?void 0:r}}}]]),Qge=e=>{let t=document.createTreeWalker(e,NodeFilter.SHOW_ALL),n=``;for(let e=t.nextNode();e;e=t.nextNode())e.nodeType===Node.TEXT_NODE?n+=e.data:e.nodeName===`BR`&&(n+=`
|
||
`);return n},$ge=e=>{let t=e.querySelector(`:scope > code`),n=gS((t?jD(t):void 0)??e.getAttribute(`data-language`)),r=Qge(e).replace(/\n$/,``);return r&&n.append(Pm(r)),{node:n,after:()=>[]}},FD=new WeakMap,ID=new WeakMap,LD=e=>{let t=ID.get(e);return t||(t=e.importDOM?.()??{},ID.set(e,t)),t},RD=new WeakMap,zD=(e,t)=>{let n=RD.get(t);return n===void 0&&(n=FD.get(e)?.find(({node:e})=>!!LD(e)[t.localName]?.(t))??null,RD.set(t,n)),n??void 0},BD=e=>{let t=zD(Lg(),e);return!!t&&!!t.node.prototype.isInline?.()},VD=(e,t)=>{let n=e;for(;;){let e=t?n.nextSibling:n.previousSibling;for(;!e;){let{parentElement:r}=n;if(!r)return null;n=r,e=t?n.nextSibling:n.previousSibling}if(n=e,jg(n)){if(BD(n))return n;let{display:e}=n.style;if(e?!e.startsWith(`inline`):!Pg(n))return null}let r=t?n.firstChild:n.lastChild;for(;r;){if(n=r,jg(n)&&BD(n))return n;r=t?n.firstChild:n.lastChild}if(hh(n))return n;if(n.nodeName===`BR`)return null}},e_e=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.localName===`pre`||t.style.whiteSpace.startsWith(`pre`))return!0;return!1},t_e=e=>{let t=e.data.replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(t.startsWith(` `)){let n=VD(e,!1),r=!0;for(;n;n=VD(n,!1)){if(!hh(n)){r=!1;break}let e=n.data;if(e){r=/[ \t\n]$/.test(e);break}}r&&(t=t.slice(1))}if(t.endsWith(` `)){let n=VD(e,!0),r=!0;for(;n;n=VD(n,!0))if(!hh(n)||n.data.replace(/^[ \t\n]+/,``)){r=!1;break}r&&(t=t.slice(0,-1))}return{node:t?Pm(t):null}},n_e={"#text":e=>e_e(e)?null:{conversion:e=>t_e(e),priority:1}},r_e={pre:()=>({conversion:$ge,priority:2})},i_e=e=>{let t=FD.get(e)??[],n=new Set(t.map(({node:e})=>e)),r=new Set([...e._nodes.values()].filter(({klass:e})=>!n.has(e)).flatMap(({klass:e})=>Object.keys(e.importDOM?.()??{})));return new Set(t.flatMap(({node:e})=>Object.keys(LD(e))).filter(e=>!r.has(e)))},a_e=(e,t)=>{let n=i_e(e),r=i=>{let a;return[...i.childNodes].some(i=>{if(i.nodeType===Node.COMMENT_NODE)return a=i,!0;if(i.nodeType!==Node.ELEMENT_NODE)return!1;let o=i,s=o.localName;return zD(e,o)?!1:!Kge.includes(s)&&!Gge.includes(s)&&(!e._htmlConversions.has(s)||n.has(s))?(a=o,!0):(a=s===`pre`?t.createTreeWalker(o,NodeFilter.SHOW_COMMENT).nextNode()??void 0:r(o),!!a)}),a};return r(t)},HD=e=>gpe(e),UD=`[ \\t\\uE005]`;`${UD}${UD}${UD}${UD}${UD}`;var o_e=String.raw`(?=<)(?<!(?:^|[^\\])(?:\\\\)*\\)`,s_e=new RegExp([o_e,`(?:`,[`<[A-Za-z][A-Za-z0-9-]*(?:[ \\t\\uE005]+[A-Za-z_:][\\w.:-]*(?:[ \\t\\uE005]*=[ \\t\\uE005]*(?:[^\\s"'=<>\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|</[A-Za-z][A-Za-z0-9-]*[ \\t\\uE005]*>`,String.raw`<!-->|<!--->|<!--.*?-->`,String.raw`<\?.*?\?>`,String.raw`<![A-Za-z][^>]*>`,String.raw`<!\[CDATA\[.*?\]\]>`].join(`|`),`)`].join(``)),c_e=`(?:${[`javascript`,`vbscript`,`data`].map(e=>e.replace(/[a-z]/g,e=>`[${e}${e.toUpperCase()}]`)).join(`|`)})`,l_e=new RegExp([o_e,`(?:`,[String.raw`<(?!${c_e}:)[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\s<>]*>`,String.raw`<[\w.!#$%&'*+/=?^\x60{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?`+String.raw`(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>`].join(`|`),`)`].join(``)),u_e=/(?<!(?:^|[^\\])(?:\\\\)*\\)\[\^[^\s[\]]+\]/,d_e=[/([-*_])(?:[ \t]*\1){2,}[ \t]*$/,/(?:=+|-{2,})[ \t]*$/,/(?:#{1,6}|[-+*]|\d{1,9}[.)])(?=[ \t]|$)/,/>|`{3,}|~{3,}/].map(({source:e})=>e).join(`|`),f_e=String.raw`\[(?:[^\\[\]]|\\.)+\]:`,p_e=RegExp(`^ {0,3}(?:${d_e}|${f_e})`),WD=Yf(`suiRawSyntax`,{parse:e=>typeof e==`string`?e:``}),m_e=e=>Xf(e,WD)||void 0,h_e=e=>{if(Xf(e,WD))return e.getTextContent()},GD={dependencies:[],export:()=>null,importRegExp:p_e,regExp:/(?!)/,replace:e=>{Zf(e,WD,e.getTextContent())},type:`text-match`},g_e={dependencies:[],export:()=>null,importRegExp:new RegExp([`^(?=[*_~=]).+`,`(?<=^).+`,s_e.source,l_e.source,u_e.source].join(`|`)),regExp:/(?!)/,replace:GD.replace,type:`text-match`},KD=e=>{let t=[],n;return e.forEach((e,r)=>{let i=e.match(/^[ \t]*(`{3,}(?=[^`]*$)|~{3,})/)?.[1];n?i?.[0]===n.fence[0]&&i.length>=n.fence.length&&!e.trim().slice(i.length)&&(t.push({...n,end:r,closed:!0}),n=void 0):i&&(n={start:r,fence:i})}),n&&t.push({...n,end:e.length-1,closed:!1}),t},qD=(e,t)=>{let n=e.split(`
|
||
`),r=[],i=0,a=e=>{if(e>i){let a=i>0?`
|
||
`:``,o=e<n.length?`
|
||
`:``,s=t(`${a}${n.slice(i,e).join(`
|
||
`)}${o}`);r.push(s.slice(a.length,s.length-o.length))}};return KD(n).forEach(({start:e,end:t})=>{a(e),r.push(n.slice(e,t+1).join(`
|
||
`)),i=t+1}),a(n.length),r.join(`
|
||
`)},JD=(e,t)=>{let n=e.split(`
|
||
`),r=new Set(KD(n).flatMap(({start:e,end:t})=>Array.from({length:t-e+1},(t,n)=>e+n)));return n.map((e,n)=>r.has(n)?e:t(e)).join(`
|
||
`)},YD=/^ {0,3}(=+|-+)[ \t]*$/,XD=/^ {0,3}#{1,6}(?:[ \t]|$)/,__e=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,v_e=[[`(?:script|pre|style|textarea)(?:[ \\t>]|$)`,/<\/(?:pre|script|style|textarea)>/i],[`!--`,/-->/],[`\\?`,/\?>/],[`![A-Za-z]`,/>/],[`!\\[CDATA\\[`,/\]\]>/],[`/?(?:${`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h[1-6].head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`).join(`|`)})(?:[ \\t>]|/>|$)`,null]],y_e=RegExp(`<(?:${v_e.map(([e])=>e).join(`|`)})`,`i`),b_e=v_e.map(([e,t])=>[RegExp(`^ {0,3}<(?:${e})`,`i`),t]),x_e=new RegExp(s_e,`g`),S_e=RegExp(`^ {0,3}(?!</?(?:pre|script|style|textarea)\\b)(?:<[A-Za-z][A-Za-z0-9-]*(?:[ \\t\\uE005]+[A-Za-z_:][\\w.:-]*(?:[ \\t\\uE005]*=[ \\t\\uE005]*(?:[^\\s"'=<>\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|</[A-Za-z][A-Za-z0-9-]*[ \\t\\uE005]*>)[ \\t]*$`,`i`),C_e=new RegExp([XD.source,"^ {0,3}(?:>|[-+*](?:[ \\t]|$)|\\d{1,9}[.)](?:[ \\t]|$)|`{3,}|~{3,}|\\|)",`^ {0,3}${y_e.source}`,`^(?: {4}|\\t)`,__e.source,YD.source].join(`|`),`i`),w_e=new RegExp([XD.source,__e.source].join(`|`)),T_e=new RegExp(C_e.source.replace(`|^(?: {4}|\\t)`,``),`i`),ZD=(e,t)=>{let n=`[${e}]`.repeat(t),r=String.raw`(?:\\[^\s]|[^${e}\\\n])`,i=String.raw`(?:\\[^\s]|[^${e}\s\\])`,a=`${i}(?:${r}*?${i})?`,o=String.raw`[\s\p{P}\p{S}]`,s=e===`*`,c=s?`(?:(?<=^|${o})${n}|${n}(?!${o}))`:`(?<=^|${o})${n}`,l=s?`(?:(?<!${o})${n}|${n}(?=${o}|$))`:`${n}(?=${o}|$)`,u=String.raw`(?:\\|[ \t]*)\n[ \t]*`;return new RegExp(String.raw`(?<![${e}\\])${c}(${a}(?:${u}${a})+)${l}(?![${e}])`,`gu`)},E_e=[[`***`,ZD(`*`,3)],[`___`,ZD(`_`,3)],[`**`,ZD(`*`,2)],[`__`,ZD(`_`,2)],[`~~`,ZD(`~`,2)],[`*`,ZD(`*`,1)],[`_`,ZD(`_`,1)]],D_e=e=>e.split(`
|
||
`).map(e=>{let t=e.length-e.trimStart().length,n=e.length,r=0;for(;n>t&&/[ \t]/.test(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r%2&&--n,{indent:e.slice(0,t),text:e.slice(t,n),lineEnd:e.slice(n)}}),O_e=e=>E_e.some(([,t])=>e.search(t)!==-1),QD=e=>{let t=[...e.matchAll(/`+/g)].map(({0:{length:t},index:n})=>{let r=0;for(;e[n-r-1]===`\\`;)r+=1;return{index:n,length:t,escaped:r%2==1}}),n=[];for(let e=0;e<t.length;e+=1){let r=e+1;for(;r<t.length&&t[r].length!==t[e].length;)r+=1;if(!t[e].escaped&&r<t.length){let{index:i,length:a}=t[r];n.push({start:t[e].index,end:i+a,fenceLength:a}),e=r}}return n},k_e=new RegExp(String.raw`(?<!(?:^|[^\\])(?:\\\\)*[\\!])\[([^[\]\n]*[^[\]\s\\])([ \t]*\n[ \t]*)([^[\]\n]+)\]`+String.raw`\(([^()\s]*(?:[ \t]+"[^"\n]*")?)\)`,`g`),A_e=e=>e.replace(/(?<=^|[\s\p{P}\p{S}])(?<![`\\])`([^`\n]+?)\n([^`\n]+?)`(?=[\s\p{P}\p{S}]|$)(?!`)/gu,"`$1`\n`$2`"),j_e=e=>{if(!e.includes(`[`))return e;let t=QD(e);return e.replace(k_e,(e,n,r,i,a,o)=>t.some(({start:e,end:t})=>o>=e&&o<t)?e:`[${n}](${a})${r}[${i}](${a})`)},M_e=e=>QD(e).some(({start:t,end:n})=>e.slice(t,n).includes(`
|
||
`))||/(?<!(?:^|[^\\])(?:\\\\)*\\)\[[^[\]\n]*\n[^[\]]*\](?=[([])/.test(e),N_e=e=>qD(e,e=>{let t=A_e(e),n;for(;t!==n;)n=t,t=E_e.reduce((e,[t,n])=>e.replace(n,(e,n)=>{if(O_e(n))return e;let r=j_e(n);if(M_e(r))return e;let i=D_e(r);return i.some(({text:e})=>/^[*_~]+$/.test(e))||i.slice(1).some(({indent:e,text:t})=>T_e.test(`${e}${t}`))?e:i.map(({indent:e,text:n,lineEnd:r})=>`${e}${t}${n}${t}${r}`).join(`
|
||
`)}),t);return t}),$D=``,eO=``,tO=``,P_e=``,F_e=e=>{if(!/[\\`][*_~]*$/.test(e))return e;let t=QD(e).findLast(({end:t})=>/^[*_~]*$/.test(e.slice(t)));if(t){let n=t.end-t.fenceLength;return e[n-1]===`\\`?`${e.slice(0,n)}${$D}${e.slice(n)}`:e}let n=[!0,!1].map(t=>{let n=e.length-(t&&e.endsWith(`\\`)?1:0),r=0;for(;n>0&&`*_~`.includes(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r&&r%2==0?n:-1}).find(e=>e!==-1);return n===void 0?e:`${e.slice(0,n)}${$D}${e.slice(n)}`},I_e=/(?=\\)(?<=(?:^|[^\\])(?:\\\\)*[*_~])|(?=[*_~])(?<=(?:^|[^\\])(?:\\\\)+)/g,L_e=e=>/[*_~]\\|\\[*_~]/.test(e)?e.replace(I_e,(t,n)=>`*_~`.includes(e[n])?`${eO}.`:`.${eO}`):e,R_e=/(?<=[*_~])(?=(?![\0-\x7F])[\p{P}\p{S}])|(?<=(?![\0-\x7F])[\p{P}\p{S}])(?=[*_~])/gu,z_e=e=>/[^\0-\x7F]/.test(e)?e.replace(R_e,(t,n)=>`*_~`.includes(e[n-1])?`.${eO}`:`${eO}.`):e,B_e=e=>{if(!/`[ \t]|\t/.test(e))return e;let t=``,n=0;return QD(e).forEach(({start:r,end:i,fenceLength:a})=>{let o=e.slice(r+a,i-a);t+=`${e.slice(n,r+a)}${/^ +$/.test(o)?P_e.repeat(o.length):o.replaceAll(` `,tO)}`,n=i-a}),t+e.slice(n)},V_e=e=>{let t,n=!1;return e.split(`
|
||
`).map(e=>{let r=!e.trim();if(t===null&&r&&(t=void 0),t===void 0){let i=b_e.find(([t])=>t.test(e));if(i)[,t]=i;else if(!n&&S_e.test(e))t=null;else return n=!r&&!w_e.test(e)&&!(n&&YD.test(e)),e.includes(` `)?e.replace(x_e,e=>e.replaceAll(` `,tO)):e}return t?.test(e)&&(t=void 0),n=!1,`${e.replaceAll(` `,tO)}`}).join(`
|
||
`)},H_e=e=>JD(e.includes(`<`)?qD(e,V_e):e,e=>B_e(z_e(L_e(F_e(e))))),nO=e=>e.replace(RegExp(`\\.${eO}|${eO}\\.`,`g`),``).replaceAll($D,``).replaceAll(``,``).replaceAll(tO,` `).replaceAll(P_e,` `),U_e=e=>{if(!/^[ \t]*~{3,}/m.test(e))return e;let t=e.split(`
|
||
`);return KD(t).filter(({fence:e})=>e.startsWith(`~`)).forEach(({start:e,end:n,closed:r})=>{let i=t.slice(e+1,r?n:n+1),a=Math.max(2,...i.map(e=>e.match(/^[ \t]*(`*)/)[1].length)),o="`".repeat(a+1);t[e]=t[e].replace(/^([ \t]*)~+([ \t]*[\w-]+)?(.*)$/,(e,t,n,r)=>`${t}${o}${n??``}${r.replaceAll("`",n?``:``)}`),r&&(t[n]=t[n].replace(/^([ \t]*)~+[ \t]*$/,`$1${o}`))}),t.join(`
|
||
`)},W_e=e=>!!e.trim()&&!C_e.test(e),G_e=e=>/^ {0,3}(?:=+|-+)[ \t]*$/m.test(e)?qD(e,e=>{let t=[];return e.split(`
|
||
`).forEach(e=>{let[,n]=e.match(YD)??[],r=t.length;for(;r>0&&W_e(t[r-1]);)--r;let i=t[r-1];if(!n||r===t.length||i!==void 0&&i.trim()&&!XD.test(i)){t.push(e);return}let a=t.splice(r).map(e=>e.trim()).join(` `);t.push(`${n.startsWith(`=`)?`#`:`##`} ${a}`)}),t.join(`
|
||
`)}):e,K_e=e=>/^>$/m.test(e)?JD(e,e=>e===`>`?`> `:e):e,q_e=e=>/^> $/m.test(e)?JD(e,e=>e===`> `?`>`:e):e,J_e={defaultLanguage:`javascript`,defaultTheme:`github-light`,tokenize(e,t){let n=t||this.defaultLanguage;return n===null||vD(n)||!yD()?cS(e.getTextContent()):Bge(e,n)}},Y_e=(e,t)=>{let n=t.getElementByKey(e.getKey());if(n===null)return;let r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let a=`1`,o=1;for(let e=0;e<i;e+=1)E_(r[e])&&(o+=1,a+=`\n${o}`);n.setAttribute(`data-gutter`,a)},X_e=(e,t)=>ES(e)&&ES(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType&&e.__style===t.__style||nh(e)&&nh(t)||E_(e)&&E_(t),Z_e=(e,t)=>{let n=0;for(;n<e.length&&X_e(e[n],t[n]);)n+=1;let r=e.length,i=t.length,a=Math.min(r,i)-n,o=0;for(;o<a;)if(o+=1,!X_e(e[r-o],t[i-o])){--o;break}return{from:n,to:r-o,nodesForReplacement:t.slice(n,i-o)}},Q_e=(e,t)=>{let n=wh(e);if(!_S(n)||!n.isAttached())return;let r=$();if(!Q(r)){t();return}let{anchor:i}=r,a=i.getNode();if(a!==n&&!n.isParentOf(a)){t();return}let o=i.offset,s=i.type===`element`&&E_(n.getChildAtIndex(i.offset-1)),c=0;if(s||(c=o+a.getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),!t())return;if(s){i.getNode().select(o,o);return}let l=n.getChildren();for(let e=0;e<l.length;e+=1){let t=l[e];if(Fm(t)){let e=t.getTextContentSize();if(e>=c){t.select(c,c);return}c-=e}else if(E_(t)){if(c===0){n.select(e,e);return}--c}}n.select(l.length,l.length)},$_e=(e,t,n,r)=>{let i=r.getKey(),{nodesCurrentlyHighlighting:a}=n,o=r.getLanguage();!o&&t.defaultLanguage!==null&&(o=t.defaultLanguage,r.setLanguage(o));let s=r.getTheme();s||(s=t.defaultTheme,r.setTheme(s));let c=!o||vD(o),l=!1;c||!o||Ige()?r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1):yD()?(OD(s)||(kD(s,e,i),l=!0),bD(o)?r.getIsSyntaxHighlightSupported()||r.setIsSyntaxHighlightSupported(!0):(!DD(o,e,i)&&r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1),l=!0)):(CD(e,i),l=!0),l||(a.has(i)?n.pendingRefresh.has(i)||(n.pendingRefresh.add(i),ig(()=>{n.pendingRefresh.delete(i),e.update(()=>{let e=wh(i);_S(e)&&e.markDirty()},{tag:eD(e,[`history-merge`])})})):(a.add(i),n.didTransform||(n.didTransform=!0,ig(()=>{n.didTransform=!1,a.clear()})),Q_e(i,()=>{let e=wh(i);if(!_S(e)||!e.isAttached())return!1;let n=e.getLanguage()||t.defaultLanguage,a=t.tokenize(e,n??void 0),{from:o,to:s,nodesForReplacement:c}=Z_e(e.getChildren(),a);return o!==s||c.length?(r.splice(o,s-o,c),!0):!1})))},eve=(e,t,n,r)=>{let i=r.getParent();_S(i)?$_e(e,t,n,i):ES(r)&&r.replace(Pm(r.__text))},tve=(e,t=J_e)=>{if(!e.hasNodes([hS,CS]))throw Error(`CodeNode or CodeHighlightNode not registered on editor`);let n=[];e._headless!==!0&&n.push(e.registerMutationListener(hS,t=>{e.read(`latest`,()=>{t.forEach((t,n)=>{if(t!==`destroyed`){let t=wh(n);t!==null&&Y_e(t,e)}})})},{skipInitialization:!1}));let r={didTransform:!1,nodesCurrentlyHighlighting:new Set,pendingRefresh:new Set};return n.push(e.registerNodeTransform(hS,$_e.bind(null,e,t,r)),e.registerNodeTransform(Mm,eve.bind(null,e,t,r)),e.registerNodeTransform(CS,eve.bind(null,e,t,r)),Rpe(e)),pv(...n)},nve=e=>e.replace(/^( {0,3})(#{1,6}(?=[ \t]|$)|[-+](?=[ \t]|$)|>|=+[ \t]*$|-{2,}[ \t]*$)/,`$1\\$2`).replace(/^( {0,3}\d{1,9})([.)])(?=[ \t]|$)/,`$1\\$2`),rO=e=>!!e&&/[^\s\p{P}\p{S}]/u.test(e),rve=e=>e.replace(/((?:\\_)+)|\\(.)/gs,(e,t,n,r,i)=>{if(t)return rO(i[r-1])&&rO(i[r+e.length])?t.replaceAll(`\\`,``):e;if(n===`\\`){let t=i[r+2];return t&&!/[\n\r!-/:-@[-`{-~]/.test(t)?n:e}return e}),ive={38:`&`,60:`<`,91:`[`,93:`]`},ave=/^[\w.!#$%&'*+/=?^`{|}~-]{1,64}@[A-Za-z\d]/,ove=(e,{isInLink:t,isAtLineEnd:n})=>e.replace(/&#(38|60|91|93);/g,(e,r,i,a)=>{let o=ive[r],s=a.slice(i+e.length,i+e.length+70);return!s&&!n||o===`<`&&(/^[A-Za-z/!?]/.test(s)||ave.test(s))||o===`&`&&/^#(?:\d{1,7}|[xX][\dA-Fa-f]{1,6});/.test(s)||o===`[`&&(t||s.startsWith(`^`))||o===`]`&&(t||/^[(:[]/.test(s))?`\\${o}`:o}),sve=e=>{if(!e.hasFormat(`italic`))return!1;let t=e=>Fm(e)&&e.hasFormat(`italic`),n=e,r=e;for(;t(n.getPreviousSibling());)n=n.getPreviousSibling();for(;t(r.getNextSibling());)r=r.getNextSibling();let i=n.getTextContent(),a=r.getTextContent(),o=/^\s/.test(i)?` `:n.getPreviousSibling()?.getTextContent().at(-1),s=/\s$/.test(a)?` `:r.getNextSibling()?.getTextContent()[0];return rO(o)||rO(s)},iO=``,cve={dependencies:[],export:(e,t,n)=>{if(!Fm(e)||e.hasFormat(`code`))return null;let r=e.getTextContent();if(e.getFormat()&&/^\s+$/.test(r))return`${n(mT(e),iO).replace(iO,``)}${r}`;let i=h_e(e),a=n(mT(e),i===void 0?r:iO);if(sve(e)&&(a=a.replace(/\\.|_/gs,e=>e===`_`?`*`:e)),i!==void 0)return a.replace(iO,()=>i);let o=e.getParent(),s=e.getPreviousSibling(),c=e.getNextSibling();return a=ove(rve(a),{isInLink:!!o?.isInline(),isAtLineEnd:!c||E_(c)}),!o||o.isInline()||[`code`,`heading`].includes(o.getType())||s&&!E_(s)?a:nve(a)},regExp:/(?!)/,type:`text-match`},lve=/\s/,aO=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,uve=(e,t)=>{let n=0;for(;e[t-n-1]===`\\`;)n+=1;return n%2==1},dve=(e,t,n,r)=>{let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o===void 0||lve.test(o)?!1:!aO.test(o)||s===void 0||lve.test(s)||aO.test(s)},fve=(e,t,n,r)=>{if(!dve(e,t,n,r))return!1;if(e[t]!==`_`||!dve(e,t,n,!r))return!0;let i=r?e[t-1]:e[t+n];return i!==void 0&&aO.test(i)},pve=(e,t,n)=>{let r=[],i=0,a=0;for(;a<e.length;){for(;i<n.length&&n[i].end<=a;)i+=1;let o=e[a],s=n[i];if(s&&s.start<=a)a=s.end;else if(!t.has(o)||uve(e,a))a+=1;else{let t=1;for(;e[a+t]===o;)t+=1;let n=fve(e,a,t,!0),i=fve(e,a,t,!1);(n||i)&&r.push({char:o,index:a,length:t,canOpen:n,canClose:i,active:!0}),a+=t}}return r},mve=(e,t)=>{let n={},r=[],i=0;for(;i<e.length;){let a=e[i];if(!a.active||!a.canClose||!a.length)i+=1;else{let o=`${a.char}${a.canOpen}${a.length%3}`,s=n[o]??-1,c=!1;for(let n=i-1;n>s&&!c;--n){let o=e[n],s=o.active&&o.canOpen&&o.length>0&&o.char===a.char&&(!o.canClose&&!a.canOpen||(o.length+a.length)%3!=0||o.length%3==0||a.length%3==0),l=Math.min(o.length,a.length),u=s?t.filter(e=>e[0]===o.char&&e.length<=l).sort((e,t)=>t.length-e.length)[0]:void 0;if(u){c=!0,r.push({start:o.index+o.length-u.length,end:a.index+u.length});for(let t=n+1;t<i;t+=1)e[t].active=!1;o.length-=u.length,a.length-=u.length,o.active=o.length>0,a.length>0?a.index+=u.length:(a.active=!1,i+=1)}}c||(n[o]=i-1,a.active=a.canOpen,i+=1)}}return r},hve=(e,t)=>{let n=new Set(e.map(e=>e[0])),r=t.flatMap(({importRegExp:e})=>e?[new RegExp(e.source,`${e.flags.replace(`g`,``)}g`)]:[]),i,a=t=>{let i=QD(t),[a]=i;if(!a)return;let o=mve(pve(t,n,i),e),s=({start:e,end:t})=>e<=a.start&&t>=a.end,[c]=[...o].sort((e,t)=>e.start-t.start||t.end-e.end);if(!c||s(c))return;let[l]=o.filter(s).sort((e,t)=>e.start-t.start);if(l&&!r.some(e=>[...t.matchAll(e)].some(({0:{length:e},index:t})=>t<l.start&&t+e>l.start)))return l.start};return e=>(i?.text!==e&&(i={text:e,index:a(e)}),i.index)},gve=e=>{let t=e.filter(e=>e.type===`text-format`).map(e=>e.tag);if(!t.includes("`"))return e;let n=hve(t.filter(e=>e!=="`"),e.filter(e=>e.type===`text-match`));return[{dependencies:[],export:()=>null,importRegExp:Object.assign(/(?!)/,{[Symbol.match]:e=>{let t=n(e);return t===void 0?null:Object.assign([e.slice(t)],{index:t,input:e})}}),regExp:/(?!)/,replace:e=>e,type:`text-match`},...e.map(e=>{if(e.type!==`text-match`)return e;let{getEndIndex:t}=e;return{...e,getEndIndex:(e,r)=>{let i=t?t(e,r):(r.index??0)+r[0].length,a=n(e.getTextContent());return i!==!1&&a!==void 0&&i<=a?!1:i}}})]},_ve={dependencies:[ux],export:e=>fx(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=dx();r||e.getNextSibling()!==null?e.replace(i):e.insertBefore(i),i.isAttached()&&i.selectNext()},type:`element`},vve=()=>{let e=$();return Q(e)?g_(e.anchor.getNode(),e=>Z(e)&&!e.isInline())?.getFormatType()??``:``},yve=e=>{let t=$()??Dy();t&&!$()&&Nh(t.clone());let n=Q(t)?t.anchor.getNode():null;return $m(n)&&n.isEmpty()&&Tm(n.getParent())?n.replace(e):Lb(e)},bve=()=>{let e=yve(dx()),t=e.getNextSibling();return Z(t)?t.selectStart():e.insertAfter(Qm()).selectStart(),e},xve=e=>{let t=Number(e);return Number.isInteger(t)&&t>=1&&t<=50?t:void 0},Sve=(e,t)=>{let n=`| ${Array(t).fill(``).join(` | `)} |`;return[n,`| ${Array(t).fill(`---`).join(` | `)} |`,...Array(e-1).fill(n)].join(`
|
||
`)},Cve=e=>{let t=e.closest(`table`);return!!t&&getComputedStyle(t).direction===`rtl`},wve=e=>e?g_(e,LT):null,oO=()=>{let e=$();return!Q(e)&&!iE(e)?null:wve(e.focus.getNode())?.getKey()??null},Tve=(e,t)=>{let n=$()??Dy();return(Q(n)||iE(n))&&AE(n.anchor.getNode())?!1:(yve(HT(e,t,{rows:!0,columns:!1})).getFirstChildOrThrow().getFirstChildOrThrow().selectStart(),!0)},Eve=e=>{!e.getNextSibling()&&Tm(e.getParent())&&e.insertAfter(Qm())},Dve=e=>{e.getChildren().forEach((e,t)=>{if(!VT(e))return;let n=t===0?MT.ROW:MT.NO_STATUS;e.getChildren().forEach(e=>{LT(e)&&e.getHeaderStyles()!==n&&e.setHeaderStyles(n)})})},Ove=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();Z(t)?t.selectEnd():Z(n)?n.selectStart():e.insertAfter(Qm()).selectStart()},kve=e=>e===`delete-row`||e===`delete-column`,Ave=(e,t)=>{let n=$(),[r,i]=[n.anchor,n.focus].map(e=>wve(e.getNode())).map(e=>t===`delete-row`?e.getParentOrThrow().getIndexWithinParent():e.getIndexWithinParent()).sort((e,t)=>e-t);return i-r+1===(t===`delete-row`?e.getChildrenSize():e.getColumnCount())},jve=(e,t,{rtl:n=!1}={})=>{let r=wh(t);if(!LT(r))return!1;let i=AE(r),a=$()??Dy();return(Q(a)||iE(a))&&AE(a.anchor.getNode())?.is(i)&&AE(a.focus.getNode())?.is(i)?$()||Nh(a.clone()):r.selectStart(),e===`delete-table`||kve(e)&&Ave(i,e)?(Ove(i),i.remove()):e===`delete-row`?Khe():e===`delete-column`?qhe():e===`insert-row-above`||e===`insert-row-below`?Whe(e===`insert-row-below`):Ghe(e===`insert-column-right`!==n),!0},Mve=/^(?:\|)(.+)(?:\|)\s?$/,Nve=/^(?:\|[ \t]*:?-+:?[ \t]*)+\|\s?$/,Pve={left:`:---`,center:`:---:`,right:`---:`},Fve=e=>{let t=e.trim(),n=t.startsWith(`:`),r=t.endsWith(`:`);return n&&r?`center`:n?`left`:r?`right`:``},Ive=e=>{let t=e.getFirstChild();return VT(t)?t.getChildrenSize():0},Lve=(e,t)=>{e=e.trim().replace(/\\n/g,`
|
||
`).replace(/\\\|/g,`|`);let n=IT(MT.NO_STATUS);return uT(e,t,n),n},Rve=(e,t)=>{let[,n]=e.match(Mve)??[];return n?n.split(/(?<=(?<!\\)(?:\\\\)*)\|/).map(e=>Lve(e,t)):null},zve=(e=[])=>{let t=[...e,...Yw.map(e=>e===Jw?yT:e),gT,g_e,GD],n=[...t,cve];return{dependencies:[GE,zT,NT],export:e=>{if(!qE(e))return null;let t=[];return e.getChildren().forEach(e=>{let r=[],i=[];if(!VT(e))return;let a=!1;e.getChildren().forEach(e=>{LT(e)&&(r.push(dT(n,e).replace(/\|/g,`\\|`).replace(/\n/g,`\\n`).trim()),i.push(e),e.__headerState===MT.ROW&&(a=!0))}),t.push(`| ${r.join(` | `)} |`),a&&t.push(`| ${i.map(e=>Pve[e.getFormatType()]??`---`).join(` | `)} |`)}),t.join(`
|
||
`)},regExp:Mve,replace:(e,n,[r])=>{if(Nve.test(r)){let t=e.getPreviousSibling();if(!t||!qE(t))return;let n=t.getChildren(),i=n[n.length-1];if(!i||!VT(i))return;let a=r.trim().slice(1,-1).split(`|`).map(Fve);i.getChildren().forEach((e,t)=>{LT(e)&&(e.setHeaderStyles(MT.ROW,MT.ROW),e.setFormat(a[t]??``))}),e.remove();return}let i=Rve(r,t);if(!i)return;let a=[i],o=e.getPreviousSibling(),s=i.length;for(;o&&$m(o)&&o.getChildrenSize()===1;){let e=o.getFirstChild();if(!Fm(e))break;let n=Rve(e.getTextContent(),t);if(!n)break;s=Math.max(s,n.length),a.unshift(n);let r=o.getPreviousSibling();o.remove(),o=r}let c=KE();a.forEach(e=>{let n=BT();c.append(n);for(let r=0;r<s;r+=1)n.append(r<e.length?e[r]:Lve(``,t))});let l=e.getPreviousSibling();if(qE(l)&&Ive(l)===s){let t=l.getFirstChild().getChildren();c.getChildren().forEach(e=>{e.getChildren().forEach((e,n)=>{e.setFormat(t[n].getFormatType())})}),l.append(...c.getChildren()),e.remove()}else e.replace(c);c.selectEnd()},type:`element`}},Bve=200,Vve=`input, textarea, select, button, a[href], label, summary, video[controls], audio[controls], [tabindex], [draggable="true"], [contenteditable]:not([contenteditable="false"])`,Hve=e=>{if(!(e instanceof Element))return!1;let t=e.closest(`[data-lexical-decorator]`);if(!t)return!1;let n=e.closest(Vve);return!n||!t.contains(n)},Uve=()=>{let e=$();if(!Q(e)||!e.isCollapsed()||e.anchor.type!==`element`)return!1;let t=jh();if(!e.anchor.getNode().is(t))return!1;let{offset:n}=e.anchor,r=t.getChildAtIndex(n-1),i=t.getChildAtIndex(n);if(Z(i))i.selectStart();else if(Z(r))r.selectEnd();else{let e=Qm();r?r.insertAfter(e):i?i.insertBefore(e):t.append(e),e.select()}return!0},Wve=(e,t,n)=>{e.getRootElement()?.focus({preventScroll:!0}),e.update(()=>{n(Oh(t))})},Gve=(e,t)=>{Wve(e,t,e=>{Sm(e)&&(e.selectNext(),Uve())})},Kve=(e,t)=>{Wve(e,t,e=>{Z(e)&&e.selectEnd()})},qve=(e,t)=>{let{target:n,button:r,shiftKey:i,clientY:a}=t,o=e.getRootElement();if(!o||!e.isEditable()||t.defaultPrevented||r!==0||i||!(n instanceof Element))return!1;if(Hve(n)){let r=n.closest(`[data-lexical-decorator]`);return r.parentElement?.closest(`[data-lexical-editor]`)===o&&(t.preventDefault(),Gve(e,r),!0)}if(n!==o)return!1;let s=[...o.children].filter(e=>!e.hasAttribute(`data-lexical-decorator-boundary`)).findLast(e=>e.getBoundingClientRect().top<=a);return s?s.hasAttribute(`data-lexical-decorator`)?(t.preventDefault(),Gve(e,s),!0):a<=s.getBoundingClientRect().bottom?!1:(t.preventDefault(),Kve(e,s),!0):!1},Jve=[`http`,`https`,`mailto`,`sms`,`tel`],sO=e=>{let t=e.replace(/[\u0000-\u0020]/g,``);if(/^[^/?#]*[&\\]/.test(t))return!1;let n=/^([a-z][a-z\d+.-]*):/i.exec(t)?.[1];return!n||Jve.includes(n.toLowerCase())},Yve=e=>e instanceof bm?e:Ib(e,bm),Xve=()=>{let e=$();if(!Q(e))return{blockNodeKey:null,blockType:`paragraph`,inlineTypes:[],tableCellKey:oO(),alignment:``};let t=e.anchor.getNode(),n=null,r=xT.filter(t=>e.hasFormat(t));t.getType()!==`root`&&(n=Yve(t),GS(n)&&(r.push(`link`),n=n.getParent()),_C(n)&&(n=Ib(n,cC)));let i=(()=>{if(!n)return`paragraph`;if(qC(n))return`heading-${n.getTag().match(/\d/)?.[0]}`;if(fC(n))return n.getListType()===`bullet`?`bulleted-list`:`numbered-list`;if(UC(n))return`blockquote`;if(_S(n)||ES(n))return`code-block`;let e=n.getType();return CT.includes(e)?e:`paragraph`})();return{blockNodeKey:n?.getKey()??null,blockType:i,inlineTypes:r,tableCellKey:oO(),alignment:vve()}},Zve=e=>q_e(dT([...e.filter(({tag:e})=>!Ohe.includes(e)),cve]).replace(/\n+$/,``)),Qve=(e,t,n,r=`markdown`)=>{let i=n??(r===`html`?HD(e):Zve(t));return e.getRootElement()?.dispatchEvent(new CustomEvent(`Update`,{detail:{value:i,selection:Xve()}})),i},$ve=({node:e,createNode:t,transformer:n,createMarkdown:r})=>{if(r)return r().trim();let i=M_({namespace:`component`,nodes:e?[e]:[],onError:e=>{throw e}}),a=``;try{i.update(()=>{let e=t();jh().append(e.isInline()?Qm().append(e):e),a=Qve(i,[n])},{discrete:!0})}catch{}return a.trim()},cO=(...e)=>{let t=e.filter(e=>typeof e==`function`);return()=>{t.forEach(e=>e())}},eye=(e,t)=>cO(e.registerCommand(dd,e=>{let t=$();if(!e||!Q(t)||!t.isCollapsed())return!1;let{offset:n}=t.anchor,r=t.anchor.getNode(),i=_S(r)?r:Ib(r,hS);return!!i&&n===0&&(r.is(i)||!!i.getFirstDescendant()?.is(r))},1),e.registerCommand(kd,t=>Q($())?(t?.preventDefault(),e.dispatchCommand(pd,void 0)):!1,2),e.registerNodeTransform(wm,e=>{let n=e.getChildren();if(n.length===1&&_S(n[0]))return;let[r]=n;if(n.length===1&&Z(r)){let e=gS(t);r.replace(e,!0)}else if(n.length===0){let n=gS(t);e.append(n),n.selectStart()}})),tye=({transformer:e})=>e.type===`text-match`,nye=e=>e.multiline!==!1||e.isCodeEditor?e:{...e,modes:e.format===`html`?[`rich-text`]:e.modes,enabledButtons:(e.enabledButtons??[]).filter(e=>ST.includes(e)),components:(e.components??[]).filter(tye)},rye=e=>Z(e)&&!e.isInline()?e.getChildren().flatMap(rye):e.isInline()?[e]:[],iye=e=>{let t=e.getChildren(),[n]=t;if(!n||t.length===1&&$m(n))return;let r=$m(n)?n:Qm();r!==n&&n.insertBefore(r);let i=r.getTextContent().at(-1)??``;t.filter(e=>e!==r).forEach(e=>{let t=rye(e),n=t.map(e=>e.getTextContent()).join(``);t.length&&r.getChildrenSize()&&!/\s/.test(i+n.charAt(0))&&r.append(Pm(` `)),r.append(...t),i=n.at(-1)??i,e.remove()})},aye=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(!t||!n||/\s$/.test(t.getTextContent())||/^\s/.test(n.getTextContent())){e.remove();return}let r=Pm(` `),i=GS(t)&&GS(n)&&t.getURL()===n.getURL()&&t.getTitle()===n.getTitle()&&t.getTarget()===n.getTarget()&&t.getRel()===n.getRel(),a=Z(t)?t.getLastDescendant():t,o=Z(n)?n.getFirstDescendant():n;Fm(a)&&Fm(o)&&(xT.forEach(e=>{a.hasFormat(e)&&o.hasFormat(e)&&r.toggleFormat(e)}),a.getStyle()===o.getStyle()&&r.setStyle(a.getStyle())),i?(t.append(r,...n.getChildren()),n.remove(),e.remove()):e.replace(r)},oye=e=>cO(e.registerCommand(kd,e=>(e?.preventDefault(),!0),3),e.registerCommand(pd,()=>!0,3),e.registerCommand(fd,()=>!0,3),e.registerNodeTransform(w_,aye),e.registerNodeTransform(wm,iye)),sye=e=>cO(e.registerNodeTransform(US,e=>{sO(e.getURL())||Hde(e)}),e.registerCommand(qS,e=>{let t=typeof e==`string`?e:e?.url??null;return t!==null&&!sO(t)||Jpe(t===null?null:e),!0},2),e.registerCommand(hd,t=>{let n=$();if(!Q(n)||!Rb(t,ClipboardEvent)||!t.clipboardData||t.target.matches(`input, textarea`))return!1;let r=t.clipboardData.getData(`text`).trim();return!QE(r)||!sO(r)?!1:(n.isCollapsed()&&Py([Pm(r)]),!n.getNodes().some(e=>Z(e)||Fm(e)&&!e.isSimpleText())&&(e.dispatchCommand(qS,r),t.preventDefault(),!0))},1)),cye=[[`bulleted-list`,vC,`bullet`],[`numbered-list`,yC,`number`]],lye=(e,t=[])=>{let n=cye.filter(([e])=>t.includes(e));return cO(...n.map(([,t,n])=>e.registerCommand(t,()=>($pe(n),!0),2)),n.length?e.registerCommand(pd,()=>nme(),2):void 0)},uye=(e,t,n)=>{let r=0,i=!0,a,o=!1;return cO(()=>{o=!0},e.registerUpdateListener(({dirtyElements:s,dirtyLeaves:c}={})=>{if(i||=!s||s.size>0||c.size>0,e?.isComposing())return;r+=1;let l=r;(async()=>{await Zc(100),l!==r||o||e.update(()=>{a=Qve(e,t,i?void 0:a,n),i=!1})})()}))},dye=e=>e.registerRootListener(t=>{if(!t)return;let n=t=>{e.update(()=>{if(t.key===`Tab`){let n=$();if(!Q(n))return;let r=Yve(n.anchor.getNode());_C(r)&&r.canIndent()&&(t.shiftKey?r.getIndent()>0&&(t.preventDefault(),e.dispatchCommand(Ld,void 0)):(t.preventDefault(),e.dispatchCommand(Id,void 0)))}})};return t.addEventListener(`keydown`,n),()=>{t.removeEventListener(`keydown`,n)}}),fye=e=>{let t=e=>e===void 0?e:nO(e);return Object.assign(e.map(t),{index:e.index,input:e.input,groups:e.groups?Object.fromEntries(Object.entries(e.groups).map(([e,n])=>[e,t(n)])):void 0})},lO=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>{let r=+!!n.startsWith(``),i=n.slice(r).match(e);return!i||!r||(i.input=n,t&&i.index===0?i[0]=`${i[0]}`:i.index+=r),i}}),pye=e=>Array.isArray(e)?`index`in e?fye(e):e.every(e=>typeof e==`string`)?e.map(e=>nO(e)):e:e,mye=e=>{let{type:t,handleImportAfterStartMatch:n,importRegExp:r,regExp:i,regExpStart:a,regExpEnd:o,replace:s}=e,c={};return n&&(c.handleImportAfterStartMatch=e=>n({...e,lines:e.lines.map(e=>nO(e))})),r&&(c.importRegExp=lO(r,!1)),t===`element`&&i&&(c.regExp=lO(i,!0)),a&&(c.regExpStart=lO(a,!0)),o instanceof RegExp?c.regExpEnd=lO(o,!0):o?.regExp&&(c.regExpEnd={...o,regExp:lO(o.regExp,!0)}),s&&(c.replace=(...e)=>s(...e.map(pye))),{...e,...c}},uO=async e=>{vD(e)||(await CD(),await Promise.all([DD(ED(e)),kD(fD())]))},hye=e=>{e.flatMap(e=>Z(e)?e.getAllTextNodes():e).filter(e=>Fm(e)).forEach(e=>{let t=e.getTextContent(),n=nO(m_e(e)??t),r=e.getParent();if(n!==t&&e.setTextContent(n),GS(r)){let e=r.getURL(),t=r.getTitle();nO(e)!==e&&r.setURL(nO(e)),t&&nO(t)!==t&&r.setTitle(nO(t))}})},gye=(e,t)=>{let n=t.some(e=>`regExpStart`in e&&e.regExpStart===fT.regExpStart),r=t.some(e=>`regExp`in e&&e.regExp===Pw.regExp),i=n?U_e(e):e,a=r?G_e(i):i;return{markdown:a,languages:[...a.matchAll(/^`{3,}[ \t]*(?<lang>[\w-]+)/gm)].map(({groups:{lang:e=`plain`}={}})=>e)}},_ye=(e,t,{toRoot:n=!1}={})=>{let r=N_e(e),i=H_e(r),a=K_e(i),o=gve(t),s;return n?(uT(a,o),s=jh().getChildren()):s=yhe(a,o),(i!==r||/[\\&]/.test(i))&&hye(s),s},vye=async(e,t,n)=>{let{markdown:r,languages:i}=gye(t,n);await Promise.allSettled(i.map(e=>uO(e))),e.isEditable()&&e.update(()=>{let e=$()?.clone();if(!e)return;let i;try{i=_ye(r,n)}catch(e){console.error(e)}Nh(e),i?e.insertNodes(i):e.insertRawText(t)},{tag:`paste`})},yye=1e3,bye=()=>Uc()?`Meta+Shift+V Meta+Alt+Shift+V`:`Ctrl+Shift+V`,xye=(e,t)=>{let n=bye(),r=!1,i=0;return cO(()=>{clearTimeout(i)},e.registerCommand(Sd,e=>(r=qc(e,n),clearTimeout(i),r&&(i=window.setTimeout(()=>{r=!1},yye)),!1),2),e.registerCommand(hd,n=>{if(!r)return!1;r=!1;let i=Rb(n,ClipboardEvent),a=(i?n.clipboardData:Rb(n,InputEvent)?n.dataTransfer:null)?.getData(`text/plain`);return!a||i&&QE(a.trim())?!1:(n.preventDefault(),vye(e,a,t),!0)},2))},Sye=e=>{let{enabledButtons:t=[],components:n=[],useMarkdownShortcuts:r,isCodeEditor:i=!1,defaultLanguage:a=`plain`,format:o=`markdown`,multiline:s=!0}=nye(e),c=t.includes(`code-block`)||i,l=t.includes(`table`)&&!i,u=t.includes(`horizontal-rule`)&&!i,d=!i&&s,f=mde({name:`@sveltia/ui/editor`,namespace:`editor`,dependencies:[...c?[Lpe]:[],...l?[hde(bge,{hasCellMerge:!1,hasCellBackgroundColor:!1,hasHorizontalScroll:!0,hasTabHandler:!0})]:[],...u?[Cfe]:[]],$initialEditorState:null,nodes:[...n.map(({node:e})=>e),...new Set(Object.entries(Ehe).filter(([e])=>t.includes(e)).flatMap(([,e])=>e)),...i?[hS,CS]:[],...d?[ux,GE,NT,zT]:[]],theme:The,html:o===`html`?{export:Zge,import:{...n_e,...c?r_e:{}}}:void 0,onError:e=>{console.error(e)}}),p=n.map(({transformer:e})=>mye(e)),m=[...p,...i?[]:[g_e],...new Set(Object.entries(Dhe).filter(([e])=>t.includes(e)).flatMap(([,e])=>e)),...i?[fT]:[],...d?[_ve,zve(p.filter(({type:e})=>e===`text-match`))]:[],...i?[]:[GD]],h=afe(f);FD.set(h,n);let g=cO(Xme(h),kme(h),Ahe(h,jhe(),1e3,void 0,void 0,Bve),i?eye(h,a):void 0,s||i?void 0:oye(h),r?vhe(h,m):void 0,c?tve(h,{...J_e,defaultLanguage:a,defaultTheme:fD()}):void 0,c?Nge(h):void 0,t.includes(`link`)?sye(h):void 0,l?h.registerNodeTransform(GE,e=>{Eve(e),o===`markdown`&&Dve(e)}):void 0,lye(h,t),uye(h,m,o),dye(h),i?void 0:xye(h,m));return{editor:h,enabledTransformers:m,dispose:()=>{g(),h.dispose()}}},dO=new WeakMap,Cye=async(e,{languages:t,$import:n,$export:r,formatName:i})=>{let a=(dO.get(e)??0)+1;dO.set(e,a);let o=()=>dO.get(e)!==a;try{await Promise.all(t.map(async e=>uO(e)))}catch(e){if(o())return;throw e}if(o())return;let s=e.getEditorState().isEmpty(),c;if(e.update(()=>{try{n()}catch(e){c=e}},{tag:s?[`sui-import`,`history-merge`]:`sui-import`,discrete:!0}),c)throw Error(`Failed to convert ${i}`,{cause:c});return e.read(r)},wye=async(e,t,n)=>{let{markdown:r,languages:i}=gye(t,n);return Cye(e,{languages:i,$import:()=>{_ye(r,n,{toRoot:!0})},$export:()=>Zve(n),formatName:`Markdown`})},Tye=async(e,t)=>{let n=new DOMParser().parseFromString(t,`text/html`);return Cye(e,{languages:[...n.querySelectorAll(`pre > code`)].map(jD).filter(e=>e!==void 0),$import:()=>{let t=a_e(e,n);if(t)throw Error(t.nodeType===Node.COMMENT_NODE?`Unsupported comment`:`Unsupported element: <${t.localName}>`);let r=jh(),i=null;r.clear(),mpe(e,n).forEach(e=>{(Z(e)||Sm(e))&&!e.isInline()?(i=null,r.append(e)):(i||(i=Qm(),r.append(i)),i.append(e))}),r.isEmpty()&&r.append(Qm()),$()!==null&&r.selectStart()},$export:()=>HD(e),formatName:`HTML`})},fO=async e=>new Promise(t=>{e.focus(()=>{t(void 0)})}),Eye=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`dir`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),Dye=V(`<div></div>`),Oye={hash:`svelte-amjery`,code:`.lexical-root.svelte-amjery {overflow:clip;border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius) !important;padding:var(--sui-textbox-multiline-padding);min-height:120px;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);transition-duration:200ms;transition-property:outline-color, border-color, color, background-color;outline-offset:calc(var(--sui-focus-ring-width) * -1);}.lexical-root.svelte-amjery:not(:first-child) {border-start-start-radius:0 !important;border-start-end-radius:0 !important;}.lexical-root.code.svelte-amjery {padding:0;}.lexical-root.code.svelte-amjery .code-block {border-radius:0 !important;min-height:120px;}.lexical-root.svelte-amjery:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.lexical-root[aria-invalid=true].svelte-amjery {border-color:var(--sui-error-border-color);}.lexical-root.svelte-amjery :not(.sui):first-child {margin-top:0;}.lexical-root.svelte-amjery :not(.sui):last-child {margin-bottom:0;}.lexical-root.svelte-amjery strong.italic {font-style:italic;}.lexical-root.svelte-amjery .strikethrough {text-decoration:line-through;}.lexical-root.svelte-amjery li.nested {list-style-type:none;}.lexical-root.svelte-amjery .code-block {position:relative;display:block;padding-block:8px;padding-inline-start:56px;padding-inline-end:8px;background-color:var(--sui-code-background-color);overflow-x:auto;white-space:pre;}.lexical-root.svelte-amjery .code-block:not(:first-child) {margin-top:1em;}.lexical-root.svelte-amjery .code-block:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-amjery .code-block::before {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;content:attr(data-gutter);padding:8px;min-width:40px;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);text-align:end;}.lexical-root.svelte-amjery [data-lexical-text=true] {cursor:text;}.lexical-root.svelte-amjery :is(th, td) > p {margin:0;white-space:normal;word-break:normal;}.lexical-root.svelte-amjery .table-wrapper {overflow-x:auto;}.lexical-root.svelte-amjery .table-wrapper:not(:first-child) {margin-top:1em;}.lexical-root.svelte-amjery .table-wrapper:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-amjery :is(th, td) {min-width:80px;vertical-align:top;text-align:start;}.lexical-root.svelte-amjery th {background-color:var(--sui-secondary-background-color);}.lexical-root.svelte-amjery :is(th, td).selected {background-color:var(--sui-selected-background-color);}.lexical-root.svelte-amjery .table-selection ::selection {background-color:transparent;}.lexical-root.svelte-amjery hr {margin:var(--sui-paragraph-margin) 0;border:none;padding:0;}.lexical-root.svelte-amjery hr.selected {outline:2px solid var(--sui-primary-accent-color);outline-offset:4px;}.lexical-root.svelte-amjery hr::after {display:block;height:2px;background-color:var(--sui-control-border-color);line-height:2px;content:"";}`};function kye(e,t){k(t,!0),q(e,Oye);let n=Y(t,`dir`,3,void 0),r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`readonly`,3,!1),o=Y(t,`required`,3,!1),s=Y(t,`invalid`,3,!1),c=gs(t,Eye),l=ui(`editorStore`),u=M(void 0),d=j(()=>!(i()||a()));R(()=>{l.editor?.setEditable(B(d))}),R(()=>{let{editor:e}=l,t=n()===`ltr`||n()===`rtl`?n():null;e&&e.getEditorState().read(()=>jh().getDirection())!==t&&e.update(()=>{jh().setDirection(t)},{tag:`history-merge`})});let f=e=>{let{hasConverterError:t,useRichText:n,inputValue:r}=l;if(l.pending=!1,t||!n||l.importing)return;let{value:i,selection:a}=e.detail,o=l.getImportedValue(i)??i;r!==o&&(l.useRichText=!1,l.inputValue=o,l.useRichText=!0),l.selection=a},p=e=>{e.target?.closest(`a`)&&e.preventDefault()},m=e=>{l.editor&&qve(l.editor,e)},h=e=>!!e&&!e.contains(B(u)??null),g=({target:e})=>{let t=e;B(u)?.contains(t)?co(()=>{l.componentHasFocus=t!==B(u)}):t instanceof Element&&h(t.closest(`dialog`))||co(()=>{l.componentHasFocus=!1})},_=({relatedTarget:e})=>{e||queueMicrotask(()=>{document.activeElement===document.body&&![...document.querySelectorAll(`:modal`)].some(h)&&(l.componentHasFocus=!1)})};vs(()=>{let{editor:e,enabledTransformers:t,dispose:n}=Sye(l.config);l.editor=e,l.enabledTransformers=t,B(u)?.addEventListener(`Update`,f),B(u)?.addEventListener(`click`,p),B(u)?.addEventListener(`mousedown`,m),document.addEventListener(`focusin`,g),document.addEventListener(`focusout`,_);let r=e.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{(e.size||t.size)&&!n.has(`sui-import`)&&!n.has(`history-merge`)&&(l.pending=!0)});return()=>{r(),B(u)?.removeEventListener(`Update`,f),B(u)?.removeEventListener(`click`,p),B(u)?.removeEventListener(`mousedown`,m),document.removeEventListener(`focusin`,g),document.removeEventListener(`focusout`,_),n(),e.setRootElement(null),l.initialized=!1,l.editor=void 0}}),R(()=>{l.editor&&B(u)&&(l.editor.setRootElement(B(u)),l.initialized=!0)});var v=Dye();us(v,()=>({...c,role:`textbox`,"aria-multiline":l.config.multiline!==!1,"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),class:`lexical-root`,id:`${l.editorId}-lexical-root`,contenteditable:B(d),hidden:r(),[cs]:{code:l.config.isCodeEditor}}),void 0,void 0,void 0,`svelte-amjery`),ms(v,e=>N(u,e),()=>B(u)),W(e,v),A()}var Aye=()=>{let e=rl(`editor`),t=M(!1),n=M(void 0),r=M(na([])),i=M(na({modes:[],enabledButtons:[],components:[],useMarkdownShortcuts:!0,isCodeEditor:!1,useEmojiAutocomplete:!1})),a=M(``),o=M(na({blockNodeKey:null,blockType:`paragraph`,inlineTypes:[]})),s=M(!0),c=M(void 0),l=M(0),u=M(!1),d=M(!1),f=M(!1),p=M(!1),m=M(0),h,g=0,_=!1,v=e=>{N(d,e,!0),e&&(N(s,!1),N(f,!0))},y=async()=>{if(!B(n)||!B(t))return;let e=B(a);g+=1;let o=g;_=!0;try{let t=B(i).format===`html`?await Tye(B(n),B(a)||``):await wye(B(n),B(a)||``,B(r));t!==void 0&&(h={source:e,exported:t})}catch(t){v(!0),N(a,e,!0),console.error(t)}finally{o===g&&(_=!1)}};return{get editor(){return B(n)},set editor(e){N(n,e,!0)},set enabledTransformers(e){N(r,e,!0)},get enabledTransformers(){return B(r)},get initialized(){return B(t)},set initialized(e){N(t,e,!0)},get config(){return B(i)},set config(e){N(i,nye(e),!0),N(s,B(i).modes[0]===`rich-text`||B(i).isCodeEditor,!0)},get inputValue(){return B(a)},set inputValue(e){let t=B(a)!==e;t&&N(a,e,!0),B(s)&&(t||B(n)?.getEditorState().isEmpty())&&y()},get selection(){return B(o)},set selection(e){N(o,e,!0)},get controlId(){return B(s)?`${e}-lexical-root`:`${e}-plain-text`},get textArea(){return B(c)},set textArea(e){N(c,e,!0)},get toolbarHeight(){return B(l)},set toolbarHeight(e){N(l,e,!0)},get componentHasFocus(){return B(u)},set componentHasFocus(e){N(u,e,!0)},get useRichText(){return B(s)},set useRichText(e){N(s,e,!0)},get hasConverterError(){return B(d)},set hasConverterError(e){v(e)},get showConverterError(){return B(f)},set showConverterError(e){N(f,e,!0)},get pending(){return B(p)||B(m)>0},set pending(e){N(p,e,!0)},get importing(){return _},editorId:e,convertToLexical:y,startOperation:()=>{N(m,B(m)+1);let e=!1;return()=>{e||(e=!0,N(m,B(m)-1))}},getImportedValue:e=>h?.exported===e?h.source:void 0}},jye=V(`<!> <!>`,1);function Mye(e,t){k(t,!0);let n=Y(t,`disabled`,3,!1),r=iD.map(({id:e,name:t,aliases:n=[]})=>({key:e,label:t,aliases:n})),i=ui(`editorStore`),a=M(`plain`),o=j(()=>r.find(({key:e,aliases:t})=>e===B(a)||t.includes(B(a)))?.key??`plain`),s=()=>{let{blockNodeKey:e}=i.selection,t=i.config.isCodeEditor?jh().getChildren()[0]:e?wh(e):null;return _S(t)?t:null},c=async e=>{let{editor:t}=i;if(!t||B(o)===e)return;let n=i.startOperation();try{await fO(t),await uO(e),t.update(()=>{let t=s();t&&(t.setLanguage(e),N(a,e,!0))},{tag:eD(t)})}finally{n()}};R(()=>{i.selection.blockNodeKey,i.editor?.read(()=>{let e=s();e&&N(a,e.getLanguage()??i.config.defaultLanguage??`plain`,!0)})});{let t=j(()=>X(`_sui.text_editor.language`));yu(e,{get disabled(){return n()},get ariaLabel(){return B(t)},get value(){return B(o)},onChange:({detail:{value:e}})=>{c(e)},children:(e,t)=>{var n=jye(),i=F(n);{let e=j(()=>X(`_sui.text_editor.plain_text`));nu(i,{get label(){return B(e)},value:`plain`,dir:`ltr`})}Ro(L(i,2),17,()=>r,({key:e,label:t})=>e,(e,t)=>{let n=()=>B(t).key,r=()=>B(t).label;{let t=j(()=>n()===B(o));nu(e,{get label(){return r()},get value(){return n()},get selected(){return B(t)},dir:`ltr`})}}),W(e,n)},$$slots:{default:!0}})}A()}var Nye=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`variant`,`ariaLabel`,`children`]),Pye=V(`<div><div role="none" class="inner svelte-1yg30ts"><!></div></div>`),Fye={hash:`svelte-1yg30ts`,code:`[role=toolbar].svelte-1yg30ts {--toolbar-size: var(--sui-secondary-toolbar-size);flex:none !important;display:flex;align-items:center;padding-inline:8px;background-color:var(--toolbar-background-color, transparent);}[role=toolbar].primary.svelte-1yg30ts {--toolbar-size: var(--sui-primary-toolbar-size);}
|
||
@media (width < 768px) {[role=toolbar].secondary.svelte-1yg30ts {padding-inline:0;}
|
||
}[role=toolbar][aria-orientation=horizontal].svelte-1yg30ts {height:var(--toolbar-size);}[role=toolbar][aria-orientation=vertical].svelte-1yg30ts {flex-direction:column;width:var(--toolbar-size);}[role=toolbar].svelte-1yg30ts button[role=button]:is([aria-pressed=true], [aria-checked=true]) {background-color:var(--sui-selected-background-color);}[role=toolbar].svelte-1yg30ts h2 {flex:auto;display:flex;align-items:center;gap:8px;margin:0;padding-inline-end:12px;min-width:0;font-size:var(--sui-font-size-x-large);}[role=toolbar].svelte-1yg30ts h2:first-child {padding-inline-start:12px;}[role=toolbar].svelte-1yg30ts h2 span:not(.sui.truncated-text) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal, normal);opacity:0.8;}[role=toolbar].svelte-1yg30ts .divider[aria-orientation=horizontal] {margin:0 4px;width:calc(100% - 8px);}[role=toolbar].svelte-1yg30ts .divider[aria-orientation=vertical] {margin:4px 0;height:calc(100% - 8px);}.inner.svelte-1yg30ts {display:contents;}`};function pO(e,t){q(e,Fye);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`orientation`,3,`horizontal`),a=Y(t,`variant`,3,void 0),o=Y(t,`ariaLabel`,3,void 0),s=gs(t,Nye);var c=Pye();us(c,()=>({...s,role:`toolbar`,class:[`sui`,`toolbar`,i(),a(),t.class],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o()}),void 0,void 0,void 0,`svelte-1yg30ts`);var l=P(c);Uo(P(l),()=>t.children??jr),O(l),O(c),z(()=>l.inert=r()),W(e,c)}var Iye=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`]),Lye=V(`<div role="none" class="wrapper svelte-9hp1oe"><!></div>`),Rye={hash:`svelte-9hp1oe`,code:`.wrapper.svelte-9hp1oe {display:contents;}.wrapper.svelte-9hp1oe [role=toolbar] {position:sticky;top:var(--sui-text-editor-toolbar-top, 0px);z-index:var(--sui-text-editor-toolbar-z-index, 100);display:flex;flex-wrap:wrap;gap:4px;border-width:1px 1px 0;border-style:solid;border-color:var(--sui-textbox-border-color);border-start-start-radius:var(--sui-textbox-border-radius);border-start-end-radius:var(--sui-textbox-border-radius);border-end-start-radius:0;border-end-end-radius:0;padding:0 4px;height:auto;min-height:40px;background-color:var(--sui-tertiary-background-color);}.wrapper.svelte-9hp1oe [role=toolbar][aria-disabled=true] {filter:none;}.wrapper.svelte-9hp1oe .sui.menu-button {padding:0 4px;}.wrapper.svelte-9hp1oe .sui.button {flex:none;margin:0 !important;}.wrapper.svelte-9hp1oe .sui.button-group {gap:4px;}`};function zye(e,t){k(t,!0),q(e,Rye);let n=Y(t,`disabled`,3,!1),r=gs(t,Iye),i=ui(`editorStore`),a=e=>{let t=new ResizeObserver(([e])=>{i.toolbarHeight=e.borderBoxSize[0].blockSize});return t.observe(e),()=>{t.disconnect(),i.toolbarHeight=0}};var o=Lye();pO(P(o),_s(()=>r,{get disabled(){return n()},[lo()]:a,children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{default:!0}})),O(o),W(e,o),A()}function Bye(e,t){k(t,!0);let n=Y(t,`disabled`,3,!1),r=Y(t,`readonly`,3,!1);{let t=j(()=>n()||r()),i=j(()=>X(`_sui.text_editor.code_editor`));zye(e,{get disabled(){return B(t)},get ariaLabel(){return B(i)},children:(e,t)=>{{let t=j(()=>n()||r());Mye(e,{get disabled(){return B(t)}})}},$$slots:{default:!0}})}A()}var Vye=new Set([`$$slots`,`$$events`,`$$legacy`,`code`,`lang`,`pending`,`showLanguageSwitcher`,`flex`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`ariaLabelledby`,`ariaDescribedby`,`aria-label`,`aria-labelledby`,`aria-describedby`,`children`]),Hye=V(`<div><!> <!></div> <!>`,1),Uye={hash:`svelte-1eh5cd2`,code:`.code-editor.svelte-1eh5cd2 {margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.code-editor.flex.svelte-1eh5cd2:not([hidden]) {display:block;}.code-editor.svelte-1eh5cd2 {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.code-editor.svelte-1eh5cd2 > * {--sui-text-editor-inner-toolbar-top: calc(
|
||
var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height)
|
||
);--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function Wye(e,t){k(t,!0),q(e,Uye);let n=Y(t,`code`,15,``),r=Y(t,`lang`,15,`plain`),i=Y(t,`pending`,15,!1),a=Y(t,`showLanguageSwitcher`,3,!1),o=Y(t,`flex`,3,!1),s=Y(t,`hidden`,3,!1),c=Y(t,`disabled`,3,!1),l=Y(t,`readonly`,3,!1),u=Y(t,`required`,3,!1),d=Y(t,`invalid`,3,!1),f=Y(t,`ariaLabel`,3,void 0),p=Y(t,`ariaLabelledby`,3,void 0),m=Y(t,`ariaDescribedby`,3,void 0),h=Y(t,`aria-label`,3,void 0),g=Y(t,`aria-labelledby`,3,void 0),_=Y(t,`aria-describedby`,3,void 0),v=gs(t,Vye),y=j(()=>({"aria-label":f()??h(),"aria-labelledby":p()??g(),"aria-describedby":m()??_()})),b=Aye();b.config={...b.config,useMarkdownShortcuts:!1,isCodeEditor:!0,defaultLanguage:r()},di(`editorStore`,b),R(()=>{i(b.pending)}),R(()=>()=>{i(!1)}),R(()=>{b.initialized&&(n(),r(),co(()=>{b.inputValue=Qse(r(),n())}))}),R(()=>{b.initialized&&(b.inputValue,co(()=>{let{lang:e,code:t}=$se(b.inputValue);r()!==e&&r(e),n()!==t&&n(t)}))});var x=Hye(),S=F(x);us(S,()=>({...v,role:`none`,class:`sui code-editor`,hidden:s(),[cs]:{flex:o()},[ls]:{"--sui-text-editor-toolbar-height":`${b.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-1eh5cd2`);var C=P(S),w=e=>{Bye(e,{get disabled(){return c()},get readonly(){return l()}})};K(C,e=>{a()&&e(w)}),kye(L(C,2),_s(()=>B(y),{get hidden(){return s()},get disabled(){return c()},get readonly(){return l()},get required(){return u()},get invalid(){return d()}})),O(S);var T=L(S,2),ee=e=>{Pu(e,{get show(){return b.showConverterError},set show(e){b.showConverterError=e},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`_sui.text_editor.converter_error`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(T,e=>{b.showConverterError&&e(ee)}),W(e,x),A()}var Gye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`flex`,`dir`,`name`,`autoResize`,`useEmojiAutocomplete`,`highlight`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),Kye=V(`<span> </span>`),qye=V(`<div aria-hidden="true"></div>`),Jye=V(`<div class="clone auto-resize svelte-4njyy1" aria-hidden="true"> </div>`),Yye=V(`<div role="none"><textarea></textarea> <!> <!></div>`),Xye={hash:`svelte-4njyy1`,code:`.text-area.svelte-4njyy1 {position:relative;display:inline-grid;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-multiline-min-width);}.text-area[hidden].svelte-4njyy1 {display:none;}.text-area.flex.svelte-4njyy1:not([hidden]) {display:inline-grid;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}:is(textarea.svelte-4njyy1, .clone.svelte-4njyy1) {grid-area:1/1/2/2;display:block;margin:0;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-multiline-padding);width:100%;min-height:8em;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);letter-spacing:var(--sui-textbox-letter-spacing, normal);word-spacing:var(--sui-word-spacing-normal, normal);transition:all 200ms;}:is(textarea:where(.svelte-4njyy1), .clone:where(.svelte-4njyy1)).resizing.svelte-4njyy1 {transition-duration:0ms;}.svelte-4njyy1:is(textarea:where(.svelte-4njyy1), .clone:where(.svelte-4njyy1)):focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.svelte-4njyy1:is(textarea:where(.svelte-4njyy1), .clone:where(.svelte-4njyy1)):is(:where(.svelte-4njyy1):disabled, :where(.svelte-4njyy1):read-only):not(.clone) {background-color:var(--sui-disabled-background-color);}textarea.svelte-4njyy1 {resize:vertical;}textarea.auto-resize.svelte-4njyy1 {overflow:hidden;resize:none;}textarea[aria-invalid=true].svelte-4njyy1 {border-color:var(--sui-error-border-color);}.clone.svelte-4njyy1 {overflow:hidden;visibility:hidden;scroll-behavior:auto;}.clone.svelte-4njyy1:not(.auto-resize) {position:absolute;inset:0;min-height:0;}.highlighted.svelte-4njyy1 textarea:where(.svelte-4njyy1) {z-index:1;caret-color:var(--sui-textbox-foreground-color);color:transparent !important;background-color:transparent !important;}.highlighted.svelte-4njyy1 textarea:where(.svelte-4njyy1):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-4njyy1 textarea:where(.svelte-4njyy1)::placeholder {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 1);}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) {visibility:visible;pointer-events:none;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) .bold:where(.svelte-4njyy1) {-webkit-text-stroke:0.03em currentColor;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) .underline:where(.svelte-4njyy1) {text-decoration-line:underline;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) .strikethrough:where(.svelte-4njyy1) {text-decoration-line:line-through;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1) .underline.strikethrough:where(.svelte-4njyy1) {text-decoration-line:underline line-through;}.highlighted.svelte-4njyy1 .clone:where(.svelte-4njyy1):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-4njyy1:focus-within .clone:where(.svelte-4njyy1) {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.highlighted.svelte-4njyy1:is(.disabled:where(.svelte-4njyy1), .readonly:where(.svelte-4njyy1)) .clone:where(.svelte-4njyy1) {background-color:var(--sui-disabled-background-color);}textarea.svelte-4njyy1,
|
||
.clone.svelte-4njyy1 {white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;}`};function mO(e,t){k(t,!0),q(e,Xye);let n=Y(t,`value`,15,``),r=Y(t,`element`,15),i=Y(t,`flex`,3,!1),a=Y(t,`dir`,3,void 0),o=Y(t,`name`,3,void 0),s=Y(t,`autoResize`,3,!1),c=Y(t,`useEmojiAutocomplete`,3,!1),l=Y(t,`highlight`,3,void 0),u=Y(t,`hidden`,3,!1),d=Y(t,`disabled`,3,!1),f=Y(t,`readonly`,3,!1),p=Y(t,`required`,3,!1),m=Y(t,`invalid`,3,!1),h=gs(t,Gye),g=j(()=>`${n()}\n`),_=j(()=>{let e=l()?.(n()??``);if(!e)return;let t=e.flatMap(e=>[...e,{content:`
|
||
`}]);return t.map(({content:e})=>e).join(``)===B(g)?t:void 0}),v=M(void 0);R(()=>{if(!r()||!B(v))return;let e=r(),t=B(v),n=()=>{t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft};return n(),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`scroll`,n)}});var y=Yye();let b;var x=P(y);Bee(x),us(x,()=>({...h,dir:a(),name:o(),disabled:d()||void 0,readonly:f()||void 0,"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f(),"aria-required":p(),"aria-invalid":m(),[cs]:{"auto-resize":s()}}),void 0,void 0,void 0,`svelte-4njyy1`),ms(x,e=>r(e),()=>r());var S=L(x,2),C=e=>{var t=qye();let n;Ro(t,21,()=>B(_),Fo,(e,t)=>{var n=Kye();let r,i;var a=I(n,!0);z(()=>{r=rs(n,1,`svelte-4njyy1`,null,r,{bold:B(t).bold,underline:B(t).underline,strikethrough:B(t).strikethrough}),i=as(n,``,i,{color:B(t).color}),G(a,B(t).content)}),W(e,n)}),O(t),ms(t,e=>N(v,e),()=>B(v)),z(()=>{n=rs(t,1,`clone svelte-4njyy1`,null,n,{"auto-resize":s()}),J(t,`dir`,a()),t.dir=t.dir}),W(e,t)},w=e=>{var t=Jye(),n=I(t,!0);z(()=>{J(t,`dir`,a()),G(n,B(g)),t.dir=t.dir}),W(e,t)};K(S,e=>{B(_)?e(C):s()&&e(w,1)});var T=L(S,2),ee=e=>{Wl(e,{get element(){return r()}})};K(T,e=>{c()&&!d()&&!f()&&e(ee)}),O(y),z(()=>{b=rs(y,1,`sui text-area ${t.class??``}`,`svelte-4njyy1`,b,{flex:i(),disabled:d(),readonly:f(),highlighted:!!B(_)}),J(y,`hidden`,u()),x.dir=x.dir}),sne(x,n),W(e,y),A()}function Zye(e,t){k(t,!0);let n=ui(`editorStore`),r=M(void 0),i=()=>{let e=$();if(!Q(e)||!e.isCollapsed()||e.hasFormat(`code`))return;let t=e.anchor.getNode();if(!Fm(t)||!t.isSimpleText()||_S(t.getParent()))return;let{offset:n}=e.anchor,r=Vl(t.getTextContent().slice(0,n));if(r===void 0)return;let i=t.getKey();return{id:`${i}:${n-r.length-1}`,query:r,nodeKey:i,offset:n}},a=({query:e})=>{let t=window.getSelection();if(!t?.rangeCount)return;let n=t.getRangeAt(0).cloneRange();try{n.setStart(n.startContainer,Math.max(0,n.startOffset-e.length-1))}catch{}let{top:r,bottom:i,left:a,right:o,width:s,height:c}=n.getBoundingClientRect();return r||i||a||s||c?{top:r,bottom:i,left:a,right:o}:void 0},o=(e,t)=>{let{editor:r}=n,{query:i,nodeKey:a,offset:o}=t,s=o-i.length-1;r?.update(()=>{let t=wh(a);if(!Fm(t)||t.getTextContent().slice(s,o)!==`:${i}`)return;let n=Bl(e.emoji,t.getTextContent().slice(o));t.spliceText(s,i.length+1,n,!0)})},s=()=>{let{editor:e}=n;if(!e)return[];let t=e=>t=>B(r)?.isOpen()?(t?.preventDefault(),e(),!0):!1;return[e.registerCommand(Od,t(()=>B(r)?.moveSelection(1)),4),e.registerCommand(Dd,t(()=>B(r)?.moveSelection(-1)),4),e.registerCommand(kd,t(()=>B(r)?.selectHighlighted()),4),e.registerCommand(Pd,t(()=>B(r)?.selectHighlighted()),4),e.registerCommand(Md,t(()=>B(r)?.close(!0)),4),e.registerUpdateListener(({editorState:e})=>{let t;e.read(()=>{t=i()}),B(r)?.update(t)})]};R(()=>{if(!n.editor||!B(r))return;let e=s();return()=>{e.forEach(e=>e()),B(r)?.close()}}),R(()=>{n.useRichText||B(r)?.close()});{let t=j(()=>n.editor?.getRootElement()??void 0);ms(Ul(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return B(t)}}),e=>N(r,e,!0),()=>B(r))}A()}var Qye=V(`<!> <!> <!> <!>`,1),$ye=V(`<a class="url svelte-118qqx8" target="_blank" rel="external noopener noreferrer" dir="ltr"> </a> <!> <!>`,1),ebe=V(`<div role="group" class="sui floating-link-editor svelte-118qqx8" popover="manual"><!></div>`),tbe={hash:`svelte-118qqx8`,code:`.floating-link-editor.svelte-118qqx8 {position:fixed;inset:auto;z-index:1000;display:flex;align-items:center;gap:4px;margin:0;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:4px;width:min(400px, 100vw - 16px);color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.floating-link-editor.svelte-118qqx8 .sui.text-input {flex:auto;margin:0 !important;min-width:0;}.floating-link-editor.svelte-118qqx8 .sui.button {flex:none;margin:0 !important;}.url.svelte-118qqx8 {flex:auto;overflow:hidden;padding:0 8px;min-width:0;white-space:nowrap;text-overflow:ellipsis;}`};function nbe(e,t){let n=Co();k(t,!0),q(e,tbe);let r=ui(`editorStore`),i=M(void 0),a=M(!1),o=M(void 0),s=M(void 0),c=M(``),l=M(!1),u=!1,d=j(()=>r.config.format===`html`),f=M(void 0),p=M(0),m=M(void 0),h=M(void 0),g=j(()=>!!B(s)),_=j(()=>!!B(c).trim()&&sO(B(c))),v=j(()=>B(g)||!!B(i)&&B(a)&&B(o)!==B(i).key),y=j(()=>B(f)?Hl({anchorRect:B(f),listMaxHeight:B(p)||48,viewport:{width:window.innerWidth,height:window.innerHeight},rtl:Pc(),listWidth:Math.min(400,window.innerWidth-16)}):void 0),b=()=>{let e=$();if(!Q(e))return null;let t=g_(e.anchor.getNode(),GS);return t&&g_(e.focus.getNode(),GS)===t?t:null},x=e=>{let t;if(B(s)&&`selection`in B(s)){let{selection:n}=B(s);e.getEditorState().read(()=>{let[r,i]=n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];r.getNode().isAttached()&&i.getNode().isAttached()&&(t=_de(e,r.getNode(),r.offset,i.getNode(),i.offset)?.getBoundingClientRect())})}else{let n=B(s)&&`linkKey`in B(s)?B(s).linkKey:B(i)?.key;t=n?e.getElementByKey(n)?.getBoundingClientRect():void 0}if(!t||!(t.top||t.bottom||t.left||t.width||t.height))return;let{top:n,bottom:r,left:a,right:o}=t;return{top:n,bottom:r,left:a,right:o}},S=()=>{let{editor:e}=r;N(f,e&&B(v)?x(e):void 0)},C=async(e,t,n=!1)=>{N(s,e),N(c,t,!0),N(l,n,!0),u=n,N(o,void 0),await ao(),S(),await ao(),B(h)?.focus(),B(h)?.select()},w=()=>{N(s,void 0),N(c,``),N(l,!1)},T=async()=>{r.editor&&await fO(r.editor)},ee=()=>{let e,t=``,n=!1;return r.editor?.getEditorState().read(()=>{let r=b();if(r){e={linkKey:r.getKey()},t=r.getURL(),n=r.getTarget()===`_blank`;return}let i=$()??Dy();if(Q(i)&&!i.isCollapsed()){let n=i.getTextContent().trim();n&&(e={selection:i.clone()},t=QE(n)&&sO(n)?n:``)}}),e?(C(e,t,n),!0):!1},E=async()=>{let{editor:e}=r,t=B(s),n=B(c).trim(),i=B(d)&&B(l)!==u?B(l)?`_blank`:null:void 0;e&&t&&B(_)&&(w(),`linkKey`in t?e.update(()=>{let e=wh(t.linkKey);GS(e)&&(e.setURL(n),i!==void 0&&e.setTarget(i))}):(e.update(()=>{Nh(t.selection.clone())}),e.dispatchCommand(qS,i?{url:n,target:i}:n)),await T())},te=async()=>{w(),await T()},ne=async()=>{let e=B(i)?.key;e&&(r.editor?.update(()=>{let t=wh(e);GS(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())}),await T())},re=e=>{e.isComposing||(qc(e,`Enter`)?(e.preventDefault(),B(_)&&E()):qc(e,`Escape`)&&(e.preventDefault(),e.stopPropagation(),te()))};R(()=>{let{editor:e}=r;if(!e)return;let t=e.registerCommand(wT,ee,2),n=e.registerCommand(Md,e=>!B(v)||B(g)||!B(i)?!1:(e?.preventDefault(),N(o,B(i).key,!0),!0),3),a=e.registerUpdateListener(({editorState:e})=>{e.read(()=>{let e=b();N(i,e?{key:e.getKey(),url:e.getURL(),target:e.getTarget()}:void 0,!0),B(s)&&(`linkKey`in B(s)?!GS(wh(B(s).linkKey)):[B(s).selection.anchor,B(s).selection.focus].some(({key:e})=>!wh(e)?.isAttached()))&&w()}),B(o)&&B(i)?.key!==B(o)&&N(o,void 0),S()}),c=e.registerEditableListener(e=>{e||w()});return()=>{t(),n(),a(),c()}}),R(()=>{r.useRichText||(w(),N(i,void 0))}),R(()=>{B(v),S()}),R(()=>{B(g),B(m)&&(B(m).matches(`:popover-open`)||B(m).showPopover?.(),N(p,B(m).getBoundingClientRect().height,!0))}),vs(()=>{let e=e=>{let t=e,n=r.editor?.getRootElement();return!!t&&(!!n?.contains(t)||!!B(m)?.contains(t))},t=({target:t})=>{co(()=>{N(a,e(t),!0),B(g)&&!B(m)?.contains(t)&&w()})},n=({relatedTarget:e})=>{e||co(()=>{N(a,!1)})};return window.addEventListener(`scroll`,S,{capture:!0,passive:!0}),window.addEventListener(`resize`,S,{passive:!0}),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,n),()=>{window.removeEventListener(`scroll`,S,{capture:!0}),window.removeEventListener(`resize`,S),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,n)}});var ie=U(),ae=F(ie),oe=e=>{var t=ebe();let r;var a=P(t),o=e=>{var t=Qye(),r=F(t);{let e=j(()=>!!B(c).trim()&&!sO(B(c))),t=j(()=>X(`_sui.text_editor.url`));Gl(r,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return B(e)},get"aria-label"(){return B(t)},onkeydown:e=>{re(e)},get element(){return B(h)},set element(e){N(h,e,!0)},get value(){return B(c)},set value(e){N(c,e,!0)}})}var i=L(r,2),a=e=>{{let t=e=>{Lc(e,{name:`open_in_new`})},n=j(()=>X(`_sui.text_editor.open_in_new_tab`));ll(e,{iconic:!0,variant:`ghost`,get pressed(){return B(l)},get"aria-label"(){return B(n)},onclick:()=>{N(l,!B(l))},startIcon:t,$$slots:{startIcon:!0}})}};K(i,e=>{B(d)&&e(a)});var o=L(i,2);{let e=e=>{Lc(e,{name:`check`})},t=j(()=>!B(_)),n=j(()=>B(s)&&`linkKey`in B(s)?X(`_sui.update`):X(`_sui.insert`));ll(o,{iconic:!0,variant:`ghost`,get disabled(){return B(t)},get"aria-label"(){return B(n)},onclick:()=>{E()},startIcon:e,$$slots:{startIcon:!0}})}var u=L(o,2);{let e=e=>{Lc(e,{name:`close`})},t=j(()=>X(`_sui.cancel`));ll(u,{iconic:!0,variant:`ghost`,get"aria-label"(){return B(t)},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}W(e,t)},u=e=>{var t=$ye(),n=F(t),r=I(n,!0),a=L(n,2);{let e=e=>{Lc(e,{name:`edit`})},t=j(()=>X(`_sui.text_editor.edit_link`));ll(a,{iconic:!0,variant:`ghost`,get"aria-label"(){return B(t)},onclick:()=>{B(i)&&C({linkKey:B(i).key},B(i).url,B(i).target===`_blank`)},startIcon:e,$$slots:{startIcon:!0}})}var o=L(a,2);{let e=e=>{Lc(e,{name:`link_off`})},t=j(()=>X(`_sui.text_editor.remove_link`));ll(o,{iconic:!0,variant:`ghost`,get"aria-label"(){return B(t)},onclick:()=>{ne()},startIcon:e,$$slots:{startIcon:!0}})}z(e=>{J(n,`href`,e),G(r,B(i).url),n.dir=n.dir},[()=>sO(B(i).url)?B(i).url:void 0]),W(e,t)};K(a,e=>{B(g)?e(o):B(i)&&e(u,1)}),O(t),ms(t,e=>N(m,e),()=>B(m)),z(e=>{J(t,`aria-label`,e),r=as(t,``,r,{top:B(y).top,bottom:B(y).bottom,left:B(y).left})},[()=>X(`_sui.text_editor.link`)]),_o(`mousedown`,t,e=>{e.target===e.currentTarget&&e.preventDefault()}),W(e,t)};K(ae,e=>{B(v)&&B(y)&&e(oe)}),W(e,ie),A()}vo([`mousedown`]);var rbe=60,hO=async(e,t=0)=>e.closest(`dialog`)?.open&&t<rbe?(await new Promise(e=>{window.requestAnimationFrame(e)}),hO(e,t+1)):new Promise(e=>{window.setTimeout(e)}),ibe=V(`<!> <!>`,1);function abe(e,t){k(t,!0);let n=ui(`editorStore`),r=[[[`insert-row-above`,`insert_row_above`],[`insert-row-below`,`insert_row_below`]],[[`insert-column-left`,`insert_column_left`],[`insert-column-right`,`insert_column_right`]],[[`delete-row`,`delete_row`],[`delete-column`,`delete_column`],[`delete-table`,`delete_table`]]],i=async(e,r)=>{let{editor:i}=n;if(!i)return;let a=i.getElementByKey(t.cellKey),o=!!a&&Cve(a);i.update(()=>{jve(e,t.cellKey,{rtl:o})}),await hO(r),await fO(i)};{let t=j(()=>X(`_sui.text_editor.table_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>r,Fo,(e,t,n)=>{var r=ibe(),a=F(r),o=e=>{ql(e,{})};K(a,e=>{n>0&&e(o)}),Ro(L(a,2),17,()=>B(t),([e,t])=>e,(e,t)=>{var n=j(()=>Pr(B(t),2));let r=()=>B(n)[0],a=()=>B(n)[1];{let t=j(()=>X(`_sui.text_editor.${a()}`));iu(e,{get label(){return B(t)},onclick:e=>{i(r(),e.currentTarget)}})}}),W(e,r)}),W(e,n)},$$slots:{default:!0}})}A()}var obe=V(`<div role="none"><!></div>`),sbe={hash:`svelte-11ok6r3`,code:`.table-cell-menu-button.svelte-11ok6r3 {position:absolute;z-index:1;translate:-100% 0;}.table-cell-menu-button.rtl.svelte-11ok6r3 {translate:0 0;}.table-cell-menu-button[hidden].svelte-11ok6r3 {display:none;}.table-cell-menu-button.svelte-11ok6r3 .sui.button {margin:0;border-radius:50%;background-color:var(--sui-secondary-background-color);}`};function cbe(e,t){k(t,!0),q(e,sbe);let n=ui(`editorStore`),r=M(null),i=M(!1),a=M(void 0),o=M(void 0),s=j(()=>!!B(r)&&B(i)&&!!B(a)&&n.useRichText),c=j(()=>B(a)?`top: ${B(a).top}px; left: ${B(a).left}px`:void 0),l=()=>B(o)?.parentElement,u=()=>{let e=l(),t=B(r)?n.editor?.getElementByKey(B(r)):void 0;if(!B(i)||!e||!t){N(a,void 0);return}let o=t.getBoundingClientRect(),s=t.closest(`.table-wrapper`).getBoundingClientRect(),c=t.closest(`.lexical-root`).getBoundingClientRect(),u=e.getBoundingClientRect(),d=Cve(t),f=Math.max(o.left,s.left),p=Math.min(o.right,s.right),m=Math.max(o.top,c.top),h=Math.min(o.bottom,c.bottom);p<=f||h<=m?N(a,void 0):N(a,{top:m-u.top+4,left:(d?f+4:p-4)-u.left,rtl:d,popupPosition:d?`bottom-right`:`bottom-left`})},d,f=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{let e=l();N(i,!!e?.contains(document.activeElement)||!!B(o)?.querySelector(`[aria-expanded="true"]`),!0),u()})};R(()=>{let{editor:e}=n;if(!e)return;let t=e.registerUpdateListener(({editorState:e})=>{N(r,e.read(oO),!0),u()}),i=e.registerRootListener(e=>{if(!e)return;let t=new ResizeObserver(u);return e.addEventListener(`scroll`,u,{capture:!0}),t.observe(e),()=>{e.removeEventListener(`scroll`,u,{capture:!0}),t.disconnect()}});return()=>{t(),i()}}),vs(()=>(window.addEventListener(`resize`,u),document.addEventListener(`focusin`,f),document.addEventListener(`focusout`,f),()=>{window.clearTimeout(d),window.removeEventListener(`resize`,u),document.removeEventListener(`focusin`,f),document.removeEventListener(`focusout`,f)}));var p=obe();let m;var h=P(p),g=e=>{let t=j(()=>B(r));{let r=e=>{Lc(e,{name:`expand_more`})},i=e=>{abe(e,{get cellKey(){return B(t)}})},o=j(()=>B(a)?.popupPosition),s=j(()=>X(`_sui.text_editor.show_table_options`));kl(e,{iconic:!0,size:`small`,variant:`tertiary`,get popupPosition(){return B(o)},get"aria-label"(){return B(s)},get"aria-controls"(){return n.controlId},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}};K(h,e=>{B(s)&&B(r)&&e(g)}),O(p),ms(p,e=>N(o,e),()=>B(o)),z(()=>{m=rs(p,1,`table-cell-menu-button svelte-11ok6r3`,null,m,{rtl:B(a)?.rtl}),J(p,`hidden`,!B(s)),as(p,B(c))}),W(e,p),A()}var lbe={bold:`**`,italic:`_`,strikethrough:`~~`,code:"`"},ube=/^(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d+[.)][ \t]+)/,dbe=/^[ \t]*(?:```|~~~)/,fbe=({value:e,start:t,end:n})=>{let r=e.lastIndexOf(`
|
||
`,t-1)+1,i=n>t&&e[n-1]===`
|
||
`?n-1:n,a=e.indexOf(`
|
||
`,i);return{lineStart:r,lineEnd:a===-1?e.length:a}},pbe=({value:e,start:t})=>e.slice(0,t).split(`
|
||
`).length-1,mbe=(e,t)=>{let n;for(let r=0;r<e.length;r+=1){if(dbe.test(e[r])){if(n===void 0)n=r;else{if(t>=n&&t<=r)return{open:n,close:r};n=void 0}}if(n===void 0&&r>=t)return}return n!==void 0&&t>=n?{open:n,close:e.length}:void 0},hbe=e=>{let t=e.value.split(`
|
||
`),n=pbe(e),r=t[n];if(mbe(t,n))return`code-block`;let[,i]=r.match(/^(#{1,6})[ \t]/)??[];return i?`heading-${i.length}`:/^[-*+][ \t]/.test(r)?`bulleted-list`:/^\d+[.)][ \t]/.test(r)?`numbered-list`:r.startsWith(`>`)?`blockquote`:`paragraph`},gbe=({value:e,start:t,end:n},r)=>{let i=lbe[r],{length:a}=i,o=e.slice(t,n);if(o.length>=a*2&&o.startsWith(i)&&o.endsWith(i)){let e=o.slice(a,-a);return{start:t,end:n,text:e,selectionStart:t,selectionEnd:t+e.length}}if(e.slice(t-a,t)===i&&e.slice(n,n+a)===i)return{start:t-a,end:n+a,text:o,selectionStart:t-a,selectionEnd:n-a};let[,s,c,l]=o.match(/^(\s*)([\s\S]*?)(\s*)$/),u=`${s}${c.split(`
|
||
`).map(e=>e.trim()?`${i}${e}${i}`:e).join(`
|
||
`)}${l}`;if(!c){let e=t+s.length+a;return{start:t,end:n,text:`${s}${i}${i}${l}`,selectionStart:e,selectionEnd:e}}return{start:t,end:n,text:u,selectionStart:t+s.length+a,selectionEnd:t+u.length-l.length-a}},_be=(e,t)=>{let{value:n,start:r,end:i}=e,a=n.split(`
|
||
`),o=mbe(a,pbe(e));if(o){let{open:e,close:n}=o,s=a.slice(0,e).join(`
|
||
`).length+ +!!e,c=s+a.slice(e,n+1).join(`
|
||
`).length,l=a.slice(e+1,n).join(`
|
||
`),u=s+a[e].length+1,d=e=>Math.min(Math.max(e-u,0),l.length),f=_be({value:l,start:d(r),end:d(i)},t);return{start:s,end:c,text:`${l.slice(0,f.start)}${f.text}${l.slice(f.end)}`,selectionStart:s+f.selectionStart,selectionEnd:s+f.selectionEnd}}let{lineStart:s,lineEnd:c}=fbe(e),l=n.slice(s,c).split(`
|
||
`);if(t===`code-block`)return{start:s,end:c,text:`\`\`\`\n${l.join(`
|
||
`)}\n\`\`\``,selectionStart:r+4,selectionEnd:i+4};let[,u]=t.match(/^heading-(\d)$/)??[],d=0,f=e=>u?e.trim()?`${`#`.repeat(Number(u))} `:``:t===`bulleted-list`?e.trim()?`- `:``:t===`numbered-list`?e.trim()?(d+=1,`${d}. `):``:t===`blockquote`?e.trim()?`> `:`>`:``,p=0,m=r,h=i,g=l.map((e,t)=>{let[n=``]=e.match(ube)??[],a=e.slice(n.length),o=f(a),c=s+l.slice(0,t).join(`
|
||
`).length+ +!!t,u=c+n.length,d=c+e.length,g=u+p+o.length-n.length,_=e=>g+Math.max(e-u,0);return r>=c&&r<=d&&(m=_(r)),i>=c&&i<=d&&(h=_(i)),p+=o.length-n.length,`${o}${a}`});return i>c&&(h=i+p),{start:s,end:c,text:g.join(`
|
||
`),selectionStart:m,selectionEnd:Math.max(m,h)}},vbe=({value:e,start:t,end:n},{url:r,text:i})=>{let[,a,o,s]=e.slice(t,n).match(/^(\s*)([\s\S]*?)(\s*)$/),c=`[${((i??o).trim()||r).replace(/([[\]\\])/g,`\\$1`)}](${/[\s()<>]/.test(r)?`<${r.replace(/[<>]/g,encodeURIComponent)}>`:r})`,l=t+a.length+c.length;return{start:t,end:n,text:`${a}${c}${s}`,selectionStart:l,selectionEnd:l}},gO=({value:e,start:t,end:n},r,{block:i=!1}={})=>{if(!i){let e=t+r.length;return{start:t,end:n,text:r,selectionStart:e,selectionEnd:e}}let a=e.slice(0,t).replace(/[ \t]*$/,``),o=e.slice(n).replace(/^[ \t]*/,``),s=a.length,c=e.length-o.length,l=`${a?a.endsWith(`
|
||
|
||
`)?``:a.endsWith(`
|
||
`)?`
|
||
`:`
|
||
|
||
`:``}${r}${o.startsWith(`
|
||
|
||
`)?``:o.startsWith(`
|
||
`)?`
|
||
`:`
|
||
|
||
`}`,u=s+l.length;return{start:s,end:c,text:l,selectionStart:u,selectionEnd:u}},_O=({value:e,selectionStart:t,selectionEnd:n})=>({value:e,start:t,end:n}),ybe=async e=>{let t=Date.now()+1e3;for(;;){if(e.focus(),document.activeElement===e||Date.now()>t)return document.activeElement===e;await new Promise(e=>{window.setTimeout(e,20)})}},bbe=({readOnly:e,disabled:t})=>!e&&!t,xbe=async(e,{start:t,end:n,text:r,selectionStart:i,selectionEnd:a})=>{if(!bbe(e))return;let o=await ybe(e);e.value.slice(t,n)!==r&&(e.setSelectionRange(t,n),o&&typeof document.execCommand==`function`&&(r?document.execCommand(`insertText`,!1,r):document.execCommand(`delete`,!1))&&e.value.slice(t,t+r.length)===r||(e.setRangeText(r,t,n),e.dispatchEvent(new Event(`input`,{bubbles:!0})))),e.setSelectionRange(i,a)},vO=async(e,t)=>{e&&await xbe(e,t(_O(e)))},Sbe=(e,t,n)=>{let r=r=>{bbe(e)&&qc(r,Uc()?`Meta+${t}`:`Ctrl+${t}`)&&(r.preventDefault(),n())};return e.addEventListener(`keydown`,r),()=>{e.removeEventListener(`keydown`,r)}},Cbe=async(e,t)=>{let n=$ve(t);if(!n){e.focus();return}let r=t.transformer?.type!==`text-match`;await xbe(e,gO(_O(e),n,{block:r}))},yO=/[ \t]*(?:\r?\n[ \t]*)+/g,wbe=({value:e,caret:t})=>{let n=e.slice(0,t).replace(yO,` `);return{value:n+e.slice(t).replace(yO,` `),caret:n.length}},Tbe=e=>{let t=e=>{let{inputType:t}=e;if(t===`insertLineBreak`||t===`insertParagraph`){e.preventDefault();return}let n=e.data||e.dataTransfer?.getData(`text/plain`)||``;(t===`insertFromPaste`||t===`insertReplacementText`)&&n.includes(`
|
||
`)&&typeof document.execCommand==`function`&&(e.preventDefault(),document.execCommand(`insertText`,!1,n.replace(yO,` `)))},n=()=>{let{value:t,selectionStart:n}=e;if(!t.includes(`
|
||
`))return;let r=wbe({value:t,caret:n});e.value=r.value,e.setSelectionRange(r.caret,r.caret)};return e.addEventListener(`beforeinput`,t),e.addEventListener(`input`,n,{capture:!0}),()=>{e.removeEventListener(`beforeinput`,t),e.removeEventListener(`input`,n,{capture:!0})}},Ebe=e=>Array.isArray(e)&&e.every(D),bO=e=>[...new Set(e)],Dbe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),Obe=V(`<div><!></div>`),kbe={hash:`svelte-dhf2js`,code:`.button-group.svelte-dhf2js {flex:none;display:inline-flex;align-items:center;}`};function Abe(e,t){q(e,kbe);let n=Y(t,`ariaLabel`,3,void 0),r=gs(t,Dbe);var i=Obe();us(i,()=>({...r,role:`group`,class:`sui button-group ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-dhf2js`),Uo(P(i),()=>t.children??jr),O(i),W(e,i)}function jbe(e,t){k(t,!0);let n=ui(`editorStore`),r=j(()=>n.selection.alignment??``),i=j(()=>TT.find(({type:e})=>e===B(r))?.icon??`format_align_left`),a=async(e,t)=>{let{editor:r}=n;r&&(r.dispatchCommand(zd,e),await hO(t),await fO(r))};{let t=e=>{Lc(e,{get name(){return B(i)}})},o=e=>{{let t=j(()=>X(`_sui.text_editor.alignment_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var i=U();No(F(i),()=>n.selection,e=>{var t=U();Ro(F(t),17,()=>TT,e=>e.type,(e,t)=>{{let n=e=>{Lc(e,{get name(){return B(t).icon}})},i=j(()=>X(`_sui.text_editor.${B(t).labelKey}`)),o=j(()=>B(r)===B(t).type);su(e,{get label(){return B(i)},get checked(){return B(o)},onclick:e=>{a(B(t).type,e.currentTarget)},startIcon:n,$$slots:{startIcon:!0}})}}),W(e,t)}),W(e,i)},$$slots:{default:!0}})}},s=j(()=>X(`_sui.text_editor.show_alignment_options`));kl(e,{get"aria-label"(){return B(s)},get"aria-controls"(){return n.controlId},startIcon:t,popup:o,$$slots:{startIcon:!0,popup:!0}})}A()}function Mbe(e,t){k(t,!0);let n=ui(`editorStore`),r=j(()=>n.selection.inlineTypes.includes(t.type)),i={bold:`B`,italic:`I`},a=async()=>{let{editor:e,textArea:r,useRichText:i}=n;i?e&&(await fO(e),e.dispatchCommand(yd,t.type)):vO(r,e=>gbe(e,t.type))};R(()=>{let{textArea:e}=n,r=i[t.type];if(e&&r)return Sbe(e,r,()=>{a()})});{let i=e=>{Lc(e,{get name(){return bT[t.type].icon}})},o=j(()=>X(`_sui.text_editor.${bT[t.type].labelKey}`));ll(e,{iconic:!0,get"aria-label"(){return B(o)},get"aria-controls"(){return n.controlId},get pressed(){return B(r)},onclick:()=>{a()},startIcon:i,$$slots:{startIcon:!0}})}A()}function Nbe(e,t){k(t,!0);let n=ui(`editorStore`),{labelKey:r,icon:i}=bT[`horizontal-rule`],a=async()=>{let{editor:e,textArea:t,useRichText:r}=n;r?e&&(e.update(()=>{bve()}),await fO(e)):await vO(t,e=>gO(e,`***`,{block:!0}))};{let t=e=>{Lc(e,{get name(){return i}})},o=j(()=>X(`_sui.text_editor.${r}`));ll(e,{iconic:!0,get"aria-label"(){return B(o)},get"aria-controls"(){return n.controlId},onclick:()=>{a()},startIcon:t,$$slots:{startIcon:!0}})}A()}var Pbe=(e,t)=>{let{textArea:n,useRichText:r}=e;if(!r){n&&Cbe(n,t);return}let{createNode:i}=t;e.editor?.update(()=>{let e=i();Py(e.isInline()?[e]:[e,Qm()])})};function Fbe(e,t){k(t,!0);let n=ui(`editorStore`),r=j(()=>t.component.label),i=j(()=>t.component.icon);{let a=e=>{var t=U(),n=F(t),r=e=>{Lc(e,{get name(){return B(i)}})};K(n,e=>{B(i)&&e(r)}),W(e,t)},o=j(()=>!!B(i)),s=j(()=>B(i)?void 0:B(r));ll(e,{get iconic(){return B(o)},get label(){return B(s)},get title(){return B(r)},get"aria-label"(){return B(r)},get"aria-controls"(){return n.controlId},onclick:()=>{Pbe(n,t.component)},startIcon:a,$$slots:{startIcon:!0}})}A()}var Ibe=V(`<div role="none"><label> </label> <!></div>`),Lbe=V(`<div role="none"><!></div>`),Rbe=V(`<div role="none"><label> </label> <!></div> <!> <!>`,1),zbe=V(`<!> <!>`,1);function Bbe(e,t){let n=Co();k(t,!0);let r=`link`,i=ui(`editorStore`),a=j(()=>i.selection.inlineTypes.includes(r)),o=M(!1),s=M(!1),c=M(``),l=M(``),u=M(!1),d=j(()=>i.config.format===`html`&&i.useRichText),f=j(()=>!!B(c).trim()&&sO(B(c))),p=e=>{N(c,QE(e)&&sO(e)?e:``,!0),N(s,!!e),N(o,!0)},m=()=>{let{textArea:e,useRichText:t}=i;if(t)i.editor?.getEditorState().read(()=>{p(Uue().trim())});else if(e){let{value:t,start:n,end:r}=_O(e);p(t.slice(n,r).trim())}},h=()=>{i.useRichText&&i.editor?.dispatchCommand(wT,void 0)||m()},g=e=>{qc(e,`Enter`)&&B(f)&&N(o,!1)},_=async e=>{let{textArea:t,useRichText:n}=i;if(!n)t&&(e.detail.returnValue===`cancel`?t.focus():vO(t,e=>vbe(e,{url:B(c).trim(),text:B(s)?void 0:B(l)}))),N(c,``),N(l,``);else{if(e.detail.returnValue!==`cancel`){if(!i.editor)return;await new Promise(e=>{i.editor?.update(async()=>{let t=$()??Dy()?.clone();Q(t)||(t=Sy()),B(s)||(N(l,B(l).trim(),!0),N(l,B(l)||B(c),!0),Py([Pm(B(l))])),Nh(t),e(void 0)})}),await fO(i.editor),i.editor.dispatchCommand(qS,B(d)&&B(u)?{url:B(c),target:`_blank`}:B(c))}else i.editor&&await fO(i.editor);N(c,``),N(l,``),N(u,!1)}},v=()=>i.editor?.registerCommand(Sd,e=>(qc(e,Uc()?`Meta+K`:`Ctrl+K`)&&(e.preventDefault(),h()),!1),2);R(()=>{let{textArea:e}=i;if(e)return Sbe(e,`K`,()=>{h()})}),R(()=>{if(i.editor)return v()});var y=zbe(),b=F(y);{let e=e=>{Lc(e,{get name(){return bT[r].icon}})},t=j(()=>X(`_sui.text_editor.${bT[r].labelKey}`)),n=j(()=>B(a)&&i.useRichText);ll(b,{iconic:!0,get"aria-label"(){return B(t)},get"aria-controls"(){return i.controlId},get pressed(){return B(n)},onclick:()=>{h()},startIcon:e,$$slots:{startIcon:!0}})}var x=L(b,2);{let e=j(()=>X(`_sui.text_editor.insert_link`)),t=j(()=>!B(f)),r=j(()=>X(`_sui.insert`));Pl(x,{get title(){return B(e)},get okDisabled(){return B(t)},get okLabel(){return B(r)},restoreFocus:!1,onClose:e=>{_(e)},get open(){return B(o)},set open(e){N(o,e,!0)},children:(e,t)=>{var r=Rbe(),i=F(r),a=P(i),o=I(a,!0),f=L(a,2);{let e=j(()=>!!B(c).trim()&&!sO(B(c))),t=j(()=>X(`_sui.text_editor.url`));Gl(f,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return B(e)},get"aria-label"(){return B(t)},onkeydown:e=>{g(e)},get value(){return B(c)},set value(e){N(c,e,!0)}})}O(i);var p=L(i,2),m=e=>{var t=Ibe(),r=P(t),i=I(r,!0),a=L(r,2);{let e=j(()=>X(`_sui.text_editor.text`));Gl(a,{dir:`auto`,get id(){return`${n}-text`},flex:!0,get"aria-label"(){return B(e)},onkeydown:e=>{g(e)},get value(){return B(l)},set value(e){N(l,e,!0)}})}O(t),z(e=>{J(r,`for`,`${n}-text`),G(i,e)},[()=>X(`_sui.text_editor.text`)]),W(e,t)};K(p,e=>{B(s)||e(m)});var h=L(p,2),_=e=>{var t=Lbe(),n=P(t);{let e=j(()=>X(`_sui.text_editor.open_in_new_tab`));jl(n,{get label(){return B(e)},get checked(){return B(u)},set checked(e){N(u,e,!0)}})}O(t),W(e,t)};K(h,e=>{B(d)&&e(_)}),z(e=>{J(a,`for`,`${n}-url`),G(o,e)},[()=>X(`_sui.text_editor.url`)]),W(e,r)},$$slots:{default:!0}})}W(e,y),A()}function Vbe(e,t){k(t,!0);let n=ui(`editorStore`);{let r=e=>{Lc(e,{name:`arrow_drop_down`,class:`small-arrow`})},i=e=>{ru(e,{children:(e,r)=>{var i=U();Ro(F(i),17,()=>t.components,e=>e.id,(e,t)=>{let r=j(()=>B(t));iu(e,{get label(){return B(r).label},onclick:()=>{Pbe(n,B(t))},startIcon:e=>{var t=U(),n=F(t),i=e=>{Lc(e,{get name(){return B(r).icon}})};K(n,e=>{B(r).icon&&e(i)}),W(e,t)},$$slots:{startIcon:!0}})}),W(e,i)},$$slots:{default:!0}})},a=j(()=>X(`_sui.insert`));kl(e,{get label(){return B(a)},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}A()}var Hbe=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:1,Ube=e=>{let[t,n=`0`]=String(e).toLowerCase().split(`e`),r=(t.split(`.`)[1]?.length??0)-Number(n);return Math.max(r,0)},Wbe=({fractional:e,min:t})=>typeof t==`number`&&t>=0?e?`decimal`:`numeric`:`text`,Gbe=new Map,Kbe=e=>{let t=e||``,n=Gbe.get(t);if(n===void 0){try{n=new Intl.NumberFormat(e||void 0).formatToParts(1.5).find(({type:e})=>e===`decimal`).value}catch{n=`.`}Gbe.set(t,n)}return n},qbe=(e,t)=>{let n=Kbe(t);if(!e||n===`.`||e.includes(`.`))return e;let r=e.split(n);return r.length===2?r.join(`.`):e},xO=e=>{let t=e.trim()?Number(e):NaN;return Number.isNaN(t)?void 0:t},SO=e=>Number(e||0),Jbe=(e,t)=>typeof t==`number`&&SO(e)<=t,Ybe=(e,t)=>typeof t==`number`&&SO(e)>=t,Xbe=(e,{step:t,direction:n,min:r,max:i})=>{if(Number.isNaN(Number(e))||(n>0?Ybe(e,i):Jbe(e,r)))return;let a=Ube(t),o=Number((SO(e)+t*n).toFixed(a));return typeof i==`number`&&o>i?String(i):typeof r==`number`&&o<r?String(r):o.toFixed(a)},Zbe=(e,{required:t=!1,min:n,max:r}={})=>{if(t&&(xO(e)===void 0||e===``))return!0;if(e===void 0||e===``)return!1;let i=Number(e);return Number.isNaN(i)||typeof n==`number`&&SO(e)<n||typeof r==`number`&&SO(e)>r},Qbe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`invalid`,`flex`,`min`,`max`,`step`,`fractional`,`inputmode`,`class`,`hidden`,`disabled`,`readonly`,`required`,`children`,`increaseIcon`,`decreaseIcon`,`onChange`,`onkeydown`,`oninput`]),$be=V(`<div role="none" class="buttons svelte-9rabgg"><!> <!></div>`),exe=V(`<span hidden=""> </span>`),txe=V(`<div role="none"><!> <!></div>`),nxe={hash:`svelte-9rabgg`,code:`.number-input.svelte-9rabgg {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.number-input.stepper.svelte-9rabgg {--sui-number-input-end-padding: 24px;}.number-input.flex.svelte-9rabgg:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.number-input.svelte-9rabgg:not(.disabled) button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.number-input.svelte-9rabgg:not(.disabled) button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.number-input.svelte-9rabgg input {padding-right:var(--sui-number-input-end-padding, 8px);}.number-input.svelte-9rabgg .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.buttons.svelte-9rabgg {display:flex;flex-direction:column;position:absolute;inset-block:2px;right:2px;z-index:3;width:18px;}.buttons.svelte-9rabgg button {flex:none;margin:0 !important;border-width:0;border-radius:3px;padding:0;width:100%;height:50%;min-height:0;}.buttons.svelte-9rabgg button .icon {font-size:16px;}.number-input.svelte-9rabgg:dir(rtl) {--sui-textbox-text-align: right;}.number-input.svelte-9rabgg:dir(rtl) .buttons:where(.svelte-9rabgg) {right:auto;left:2px;}.number-input.svelte-9rabgg:dir(rtl) input {padding-right:8px;padding-left:var(--sui-number-input-end-padding, 8px);}`};function CO(e,t){let n=Co();k(t,!0),q(e,nxe);let r=Y(t,`value`,15),i=Y(t,`invalid`,15,!1),a=Y(t,`flex`,3,!1),o=Y(t,`min`,3,void 0),s=Y(t,`max`,3,void 0),c=Y(t,`step`,3,1),l=Y(t,`fractional`,3,void 0),u=Y(t,`inputmode`,3,void 0),d=Y(t,`hidden`,3,!1),f=Y(t,`disabled`,3,!1),p=Y(t,`readonly`,3,!1),m=Y(t,`required`,3,!1),h=gs(t,Qbe),g=M(!1),_=M(``),v=j(()=>c()!==-1),y=j(()=>Hbe(c())),b=j(()=>l()??(!B(v)||Ube(B(y))>0)),x=j(()=>{let e=typeof o()==`number`,t=typeof s()==`number`;if(!(B(v)||!e&&!t))return e&&t?X(`_sui.number_input.range`,{values:{min:o(),max:s()}}):e?X(`_sui.number_input.min`,{values:{min:o()}}):X(`_sui.number_input.max`,{values:{max:s()}})}),S=j(()=>[h[`aria-describedby`],B(x)?`${n}-range`:void 0].filter(Boolean).join(` `)||void 0),C=j(()=>qbe(B(_),t.lang??Fc.current)),w=j(()=>Jbe(B(C),o())),T=j(()=>Ybe(B(C),s()));R(()=>{let e=r();co(()=>{xO(B(C))!==e&&N(_,String(e??``),!0)})}),R(()=>{r(xO(B(C)))}),R(()=>{B(g)&&i(Zbe(B(C),{required:m(),min:o(),max:s()}))});let ee=e=>{let t=Xbe(B(C),{step:B(y),direction:e,min:o(),max:s()});t!==void 0&&N(_,t,!0)},E=()=>{ee(-1)},te=()=>{ee(1)};var ne=txe();let re;var ie=P(ne),ae=e=>{var r=$be(),i=P(r);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.increaseIcon),W(e,n)},a=e=>{Lc(e,{name:`expand_less`})};K(r,e=>{t.increaseIcon?e(i):e(a,-1)}),W(e,n)},r=j(()=>f()||p()||Number.isNaN(Number(B(C)))||B(T)),a=j(()=>X(`_sui.number_input.increase`));ll(i,{iconic:!0,get disabled(){return B(r)},get"aria-label"(){return B(a)},get"aria-controls"(){return n},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}var a=L(i,2);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.decreaseIcon),W(e,n)},a=e=>{Lc(e,{name:`expand_more`})};K(r,e=>{t.decreaseIcon?e(i):e(a,-1)}),W(e,n)},r=j(()=>f()||p()||Number.isNaN(Number(B(C)))||B(w)),i=j(()=>X(`_sui.number_input.decrease`));ll(a,{iconic:!0,get disabled(){return B(r)},get"aria-label"(){return B(i)},get"aria-controls"(){return n},onclick:()=>{E()},startIcon:e,$$slots:{startIcon:!0}})}O(r),W(e,r)},oe=e=>{var t=exe(),r=I(t,!0);z(()=>{J(t,`id`,`${n}-range`),G(r,B(x))}),W(e,t)};K(ie,e=>{B(v)?e(ae):B(x)&&e(oe,1)});var se=L(ie,2);{let e=j(()=>B(v)?`spinbutton`:`textbox`),c=j(()=>B(v)&&Number.isFinite(r())?r():void 0),l=j(()=>B(v)?o():void 0),y=j(()=>B(v)?s():void 0),x=j(()=>u()??Wbe({fractional:B(b),min:o()}));Gl(se,_s({dir:`ltr`},()=>h,{get role(){return B(e)},get id(){return n},spellcheck:`false`,get flex(){return a()},get hidden(){return d()},get disabled(){return f()},get readonly(){return p()},get required(){return m()},get invalid(){return i()},get"aria-valuenow"(){return B(c)},get"aria-valuemin"(){return B(l)},get"aria-valuemax"(){return B(y)},get inputmode(){return B(x)},get"aria-describedby"(){return B(S)},onkeydown:e=>{let{key:n,ctrlKey:r,metaKey:i,altKey:a,shiftKey:o}=e,s=o||a||r||i,c=B(v)&&!f()&&!p()&&!s;n===`ArrowDown`&&c&&(e.preventDefault(),E()),n===`ArrowUp`&&c&&(e.preventDefault(),te()),B(g)||N(g,!0),t.onkeydown?.(e)},oninput:e=>{B(g)||N(g,!0),t.oninput?.(e)},get onChange(){return t.onChange},get value(){return B(_)},set value(e){N(_,e,!0)}}))}O(ne),z(()=>{re=rs(ne,1,`sui number-input ${t.class??``}`,`svelte-9rabgg`,re,{flex:a(),disabled:f(),readonly:p(),stepper:B(v)}),J(ne,`hidden`,d())}),W(e,ne),A()}var rxe=V(`<div role="none" class="table-size svelte-17ruwh8"><label> </label> <!> <label> </label> <!></div>`),ixe=V(`<!> <!>`,1),axe={hash:`svelte-17ruwh8`,code:`.table-size.svelte-17ruwh8 {display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px 16px;}`};function oxe(e,t){let n=Co();k(t,!0),q(e,axe);let r=Y(t,`disabled`,3,!1),i=ui(`editorStore`),a=M(!1),o=M(na(3)),s=M(na(3)),c=j(()=>xve(B(o))),l=j(()=>xve(B(s))),u=j(()=>!!B(c)&&!!B(l)),d=()=>{B(c)||N(o,3,!0),B(l)||N(s,3,!0),N(a,!0)},f=e=>{qc(e,`Enter`)&&B(u)&&N(a,!1)},p=async({rows:e,columns:t})=>{let{editor:n}=i;n&&(n.update(()=>{Tve(e,t)}),await fO(n))},m=async({rows:e,columns:t})=>{let n=Sve(e,t);await vO(i.textArea,e=>{let t=gO(e,n,{block:!0}),r=t.start+t.text.indexOf(n)+2;return{...t,selectionStart:r,selectionEnd:r}})},h=async e=>{if(e.detail.returnValue!==`cancel`&&B(c)&&B(l)){let e={rows:B(c),columns:B(l)};i.useRichText?await p(e):await m(e)}else i.useRichText?i.editor&&await fO(i.editor):i.textArea?.focus()};var g=ixe(),_=F(g);{let e=e=>{Lc(e,{get name(){return bT.table.icon}})},t=j(()=>X(`_sui.text_editor.${bT.table.labelKey}`));ll(_,{iconic:!0,get disabled(){return r()},get"aria-label"(){return B(t)},get"aria-controls"(){return i.controlId},onclick:()=>{d()},startIcon:e,$$slots:{startIcon:!0}})}var v=L(_,2);{let e=j(()=>X(`_sui.text_editor.insert_table`)),t=j(()=>!B(u)),r=j(()=>X(`_sui.insert`));Pl(v,{size:`x-small`,get title(){return B(e)},get okDisabled(){return B(t)},get okLabel(){return B(r)},restoreFocus:!1,onClose:e=>{h(e)},get open(){return B(a)},set open(e){N(a,e,!0)},children:(e,t)=>{var r=rxe(),i=P(r),a=I(i,!0),u=L(i,2);{let e=j(()=>!B(c)),t=j(()=>X(`_sui.text_editor.rows`));CO(u,{get id(){return`${n}-rows`},min:1,get max(){return 50},get invalid(){return B(e)},get"aria-label"(){return B(t)},onkeydown:e=>{f(e)},get value(){return B(o)},set value(e){N(o,e,!0)}})}var d=L(u,2),p=I(d,!0),m=L(d,2);{let e=j(()=>!B(l)),t=j(()=>X(`_sui.text_editor.columns`));CO(m,{get id(){return`${n}-columns`},min:1,get max(){return 50},get invalid(){return B(e)},get"aria-label"(){return B(t)},onkeydown:e=>{f(e)},get value(){return B(s)},set value(e){N(s,e,!0)}})}O(r),z((e,t)=>{J(i,`for`,`${n}-rows`),G(a,e),J(d,`for`,`${n}-columns`),G(p,t)},[()=>X(`_sui.text_editor.rows`),()=>X(`_sui.text_editor.columns`)]),W(e,r)},$$slots:{default:!0}})}W(e,g),A()}function sxe(e,t){k(t,!0);let n={paragraph:Qm,blockquote:HC,"code-block":gS},r={"bulleted-list":vC,"numbered-list":yC},i=ui(`editorStore`),a=j(()=>i.selection.blockType===t.type),o=async()=>{if(!i.useRichText){vO(i.textArea,e=>_be(e,t.type));return}if(!i.editor)return;await fO(i.editor);let[,e]=t.type.match(/^heading-(\d)$/)??[],a=e?()=>KC(`h${e}`):n[t.type];a&&i.editor.update(()=>{Sde($(),a)}),t.type in r&&i.editor.dispatchCommand(r[t.type],void 0)};var s=U();No(F(s),()=>B(a),e=>{{let n=e=>{Lc(e,{get name(){return bT[t.type].icon}})},r=j(()=>X(`_sui.text_editor.${bT[t.type].labelKey}`));ou(e,{get label(){return B(r)},get checked(){return B(a)},onclick:()=>{B(a)||o()},startIcon:n,$$slots:{startIcon:!0}})}}),W(e,s),A()}var wO=V(`<!> <!>`,1),cxe=V(`<!> <!> <!> <!> <!>`,1),lxe=V(`<!> <!> <!> <!>`,1);function uxe(e,t){k(t,!0);let n=Y(t,`disabled`,3,!1),r=Y(t,`readonly`,3,!1),i=ui(`editorStore`),a=j(()=>bO([`paragraph`,...i.config.enabledButtons.filter(e=>CT.includes(e))])),o=j(()=>i.config.format===`html`),s=j(()=>i.useRichText||!B(o)),c=j(()=>i.config.enabledButtons.includes(`table`)),l=j(()=>B(o)&&i.useRichText&&i.config.enabledButtons.includes(`align`)),u=j(()=>i.config.enabledButtons.includes(`horizontal-rule`)),d=j(()=>i.useRichText?i.selection.tableCellKey??null:null),f=j(()=>!!B(d)&&!B(o)),p=j(()=>B(f)?i.config.components.filter(tye):i.config.components),m=j(()=>B(p).filter(({trigger:e=`menuitem`})=>e===`button`)),h=j(()=>B(p).filter(({trigger:e=`menuitem`})=>e===`menuitem`)),g=j(()=>B(c)||!B(f)&&B(u)||B(p).length>0),_=j(()=>B(s)&&!B(f)),v=j(()=>bO(i.config.enabledButtons.filter(e=>ST.includes(e))));{let t=j(()=>n()||r()||i.componentHasFocus),p=j(()=>X(`_sui.text_editor.text_editor`));zye(e,{get disabled(){return B(t)},get ariaLabel(){return B(p)},children:(e,t)=>{var n=lxe(),r=F(n),p=e=>{{let t=e=>{{let t=j(()=>bT[i.selection.blockType]?.icon??`format_paragraph`);Lc(e,{get name(){return B(t)}})}},n=e=>{{let t=j(()=>X(`_sui.text_editor.text_style_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),16,()=>B(a),e=>e,(e,t)=>{sxe(e,{get type(){return t}})}),W(e,n)},$$slots:{default:!0}})}},r=j(()=>X(`_sui.text_editor.show_text_style_options`));kl(e,{get"aria-label"(){return B(r)},get"aria-controls"(){return i.controlId},startIcon:t,popup:n,$$slots:{startIcon:!0,popup:!0}})}};K(r,e=>{B(_)&&B(a).length>1&&e(p)});var y=L(r,2),b=e=>{var t=wO(),n=F(t);ql(n,{orientation:`vertical`}),Mye(L(n,2),{}),W(e,t)},x=e=>{var t=lxe(),n=F(t),r=e=>{var t=wO(),n=F(t),r=e=>{ql(e,{orientation:`vertical`})};K(n,e=>{B(_)&&B(a).length>1&&e(r)});var o=L(n,2);{let e=e=>{Lc(e,{name:`table_edit`})},t=e=>{abe(e,{get cellKey(){return B(d)}})},n=j(()=>X(`_sui.text_editor.show_table_options`));kl(o,{get"aria-label"(){return B(n)},get"aria-controls"(){return i.controlId},startIcon:e,popup:t,$$slots:{startIcon:!0,popup:!0}})}W(e,t)};K(n,e=>{B(c)&&B(d)&&e(r)});var o=L(n,2),s=e=>{var t=wO(),n=F(t);ql(n,{orientation:`vertical`}),Abe(L(n,2),{children:(e,t)=>{var n=U();Ro(F(n),16,()=>B(v),e=>e,(e,t)=>{var n=U(),r=F(n),i=e=>{Bbe(e,{})},a=e=>{Mbe(e,{get type(){return t}})};K(r,e=>{t===`link`?e(i):e(a,-1)}),W(e,n)}),W(e,n)},$$slots:{default:!0}}),W(e,t)};K(o,e=>{B(v).length&&e(s)});var p=L(o,2),y=e=>{var t=wO(),n=F(t);ql(n,{orientation:`vertical`}),jbe(L(n,2),{}),W(e,t)};K(p,e=>{B(l)&&e(y)});var b=L(p,2),x=e=>{var t=cxe(),n=F(t);ql(n,{orientation:`vertical`});var r=L(n,2),i=e=>{{let t=j(()=>!!B(d));oxe(e,{get disabled(){return B(t)}})}};K(r,e=>{B(c)&&e(i)});var a=L(r,2),o=e=>{Nbe(e,{})};K(a,e=>{B(u)&&!B(f)&&e(o)});var s=L(a,2);Ro(s,17,()=>B(m),e=>e.id,(e,t)=>{Fbe(e,{get component(){return B(t)}})});var l=L(s,2),p=e=>{Vbe(e,{get components(){return B(h)}})};K(l,e=>{B(h).length&&e(p)}),W(e,t)};K(b,e=>{B(g)&&e(x)}),W(e,t)};K(y,e=>{i.useRichText&&i.selection.blockType===`code-block`?e(b):B(s)&&e(x,1)});var S=L(y,2);Ml(S,{flex:!0});var C=L(S,2),w=e=>{{let t=e=>{{let t=j(()=>B(o)?`html`:`markdown`);Lc(e,{get name(){return B(t)}})}},n=j(()=>!i.useRichText),r=j(()=>X(`_sui.text_editor.${B(o)?`edit_in_html`:`edit_in_markdown`}`));ll(e,{iconic:!0,get disabled(){return i.hasConverterError},get pressed(){return B(n)},get"aria-label"(){return B(r)},onclick:()=>{i.useRichText=!i.useRichText,i.useRichText&&i.convertToLexical()},startIcon:t,$$slots:{startIcon:!0}})}};K(C,e=>{i.config.modes.length>1&&e(w)}),W(e,n)},$$slots:{default:!0}})}A()}var dxe=new Set(`$$slots.$$events.$$legacy.value.pending.format.flex.dir.modes.buttons.components.multiline.minimal.useMarkdownShortcuts.useEmojiAutocomplete.hidden.disabled.readonly.required.invalid.ariaLabel.ariaLabelledby.ariaDescribedby.aria-label.aria-labelledby.aria-describedby.children`.split(`.`)),fxe=V(`<div><!> <!> <!> <!> <!> <!></div> <!>`,1),pxe={hash:`svelte-lbovw0`,code:`.text-editor.svelte-lbovw0 {position:relative;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.text-editor.flex.svelte-lbovw0:not([hidden]) {display:block;}.text-editor.svelte-lbovw0:is(.single-line:where(.svelte-lbovw0), .minimal:where(.svelte-lbovw0)) > .lexical-root, .text-editor.svelte-lbovw0:is(.single-line:where(.svelte-lbovw0), .minimal:where(.svelte-lbovw0)) > .text-area > :is(textarea, .clone) {min-height:0;}.text-editor.minimal.svelte-lbovw0 > .lexical-root,
|
||
.text-editor.minimal.svelte-lbovw0 > .text-area > :is(textarea, .clone) {max-height:240px;}.text-editor.minimal.svelte-lbovw0 > .lexical-root,
|
||
.text-editor.minimal.svelte-lbovw0 > .text-area > textarea {overflow:auto;}.text-editor.minimal.svelte-lbovw0 > .lexical-root {--sui-text-editor-inner-toolbar-top: 0px;}.text-editor.minimal.svelte-lbovw0 > .text-area > :is(textarea, .clone) {scrollbar-gutter:stable;}.text-editor.svelte-lbovw0 .sui.text-area {margin:0 !important;width:100% !important;min-width:auto;}.text-editor.svelte-lbovw0 .sui.text-area textarea {border-start-start-radius:0 !important;border-start-end-radius:0 !important;border-end-start-radius:var(--sui-textbox-border-radius) !important;border-end-end-radius:var(--sui-textbox-border-radius) !important;outline-offset:calc(var(--sui-focus-ring-width) * -1);}.text-editor.svelte-lbovw0 {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.text-editor.svelte-lbovw0 > * {--sui-text-editor-inner-toolbar-top: calc(
|
||
var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height)
|
||
);--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function mxe(e,t){k(t,!0),q(e,pxe);let n=Y(t,`value`,15,``),r=Y(t,`pending`,15,!1),i=Y(t,`format`,3,`markdown`),a=Y(t,`flex`,3,!1),o=Y(t,`dir`,3,void 0),s=Y(t,`modes`,19,()=>[`rich-text`,`plain-text`]),c=Y(t,`buttons`,19,()=>[...ST,...CT]),l=Y(t,`components`,19,()=>[]),u=Y(t,`multiline`,3,!0),d=Y(t,`minimal`,3,!1),f=Y(t,`useMarkdownShortcuts`,3,!0),p=Y(t,`useEmojiAutocomplete`,3,!0),m=Y(t,`hidden`,3,!1),h=Y(t,`disabled`,3,!1),g=Y(t,`readonly`,3,!1),_=Y(t,`required`,3,!1),v=Y(t,`invalid`,3,!1),y=Y(t,`ariaLabel`,3,void 0),b=Y(t,`ariaLabelledby`,3,void 0),x=Y(t,`ariaDescribedby`,3,void 0),S=Y(t,`aria-label`,3,void 0),C=Y(t,`aria-labelledby`,3,void 0),w=Y(t,`aria-describedby`,3,void 0),T=gs(t,dxe),ee=j(()=>({"aria-label":y()??S(),"aria-labelledby":b()??C(),"aria-describedby":x()??w()})),E=Aye();E.config={...E.config,modes:s(),enabledButtons:c(),components:l(),multiline:u(),useMarkdownShortcuts:f(),useEmojiAutocomplete:p(),format:i()},di(`editorStore`,E);let te=i()===`html`?`html`:`markdown`,ne=2e4,re=M(na(fD())),ie=M(0),ae=j(()=>!E.useRichText&&!m()),oe=j(()=>o()===`auto`&&E.useRichText?void 0:o()),se=j(()=>!B(ae)||te!==`markdown`||E.inputValue.length>ne?``:[...new Set([...E.inputValue.matchAll(/^[ \t]*(?:```|~~~)[ \t]*(?<lang>[\w+#-]+)/gm)].map(({groups:e})=>e?.lang))].join(`,`)),ce=e=>{if(B(ie),!(!B(ae)||e.length>ne))return Hge(e,te,{theme:B(re)})};R(()=>pD(async()=>{let e=fD();B(ae)&&await uO(te),e===fD()&&N(re,e,!0)})),R(()=>{if(!B(ae))return;let e=B(se)?B(se).split(`,`):[];B(re),co(()=>{uO(te).then(async()=>{N(ie,B(ie)+1),await Promise.all(e.map(e=>uO(e))),N(ie,B(ie)+1)})})}),R(()=>{let{textArea:e,useRichText:t}=E;if(!e||t)return;let n=()=>{E.selection={blockNodeKey:null,blockType:document.activeElement===e?hbe(_O(e)):`paragraph`,inlineTypes:[]}},r=[`selectionchange`,`select`,`input`,`keyup`,`mouseup`,`focus`];return co(n),r.forEach(t=>e.addEventListener(t,n)),()=>{r.forEach(t=>e.removeEventListener(t,n))}}),R(()=>{let{textArea:e}=E;if(e&&!u())return Tbe(e)}),R(()=>{r(E.pending)}),R(()=>()=>{r(!1)}),R(()=>{if(!E.initialized)return;let e=n();co(()=>{E.inputValue=e})}),R(()=>{if(!E.initialized)return;let e=E.inputValue;co(()=>{n()!==e&&n(e)})});var le=fxe(),ue=F(le);us(ue,()=>({...T,role:`none`,class:`sui text-editor`,hidden:m(),[cs]:{flex:a(),"single-line":!u(),minimal:d()},[ls]:{"--sui-text-editor-toolbar-height":`${E.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-lbovw0`);var de=P(ue);uxe(de,{get disabled(){return h()},get readonly(){return g()}});var fe=L(de,2);{let e=j(()=>!E.useRichText||m());kye(fe,_s(()=>B(ee),{get dir(){return o()},get hidden(){return B(e)},get disabled(){return h()},get readonly(){return g()},get required(){return _()},get invalid(){return v()}}))}var pe=L(fe,2);{let e=j(()=>u()?void 0:1),t=j(()=>u()?void 0:!1),n=j(()=>E.useRichText||m());mO(pe,_s(()=>B(ee),{get id(){return`${E.editorId??``}-plain-text`},autoResize:!0,get rows(){return B(e)},get"aria-multiline"(){return B(t)},get useEmojiAutocomplete(){return p()},highlight:ce,get flex(){return a()},get dir(){return B(oe)},get hidden(){return B(n)},get disabled(){return h()},get readonly(){return g()},get required(){return _()},get invalid(){return v()},get element(){return E.textArea},set element(e){E.textArea=e},get value(){return E.inputValue},set value(e){E.inputValue=e}}))}var me=L(pe,2),he=e=>{Zye(e,{})};K(me,e=>{E.config.useEmojiAutocomplete&&!h()&&!g()&&e(he)});var ge=L(me,2),_e=e=>{nbe(e,{})},ve=j(()=>E.config.enabledButtons.includes(`link`)&&!h()&&!g());K(ge,e=>{B(ve)&&e(_e)});var ye=L(ge,2),be=e=>{cbe(e,{})},xe=j(()=>E.config.enabledButtons.includes(`table`)&&!h()&&!g());K(ye,e=>{B(xe)&&e(be)}),O(ue);var Se=L(ue,2),Ce=e=>{Pu(e,{get show(){return E.showConverterError},set show(e){E.showConverterError=e},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`_sui.text_editor.converter_error`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(Se,e=>{E.showConverterError&&e(Ce)}),W(e,le),A()}var hxe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`onclick`,`oninput`]),gxe=V(`<input/>`),_xe={hash:`svelte-1ck6cim`,code:`.color-input.svelte-1ck6cim {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-color-input-border-width, 1px);border-color:var(--sui-color-input-border-color, var(--sui-control-border-color));border-radius:var(--sui-color-input-border-radius, var(--sui-button-medium-border-radius));padding:var(--sui-color-input-padding, 3px);width:var(--sui-color-input-width, calc(var(--sui-button-medium-height) * 1.5));height:var(--sui-color-input-height, var(--sui-button-medium-height));color:inherit;background-color:var(--sui-color-input-background-color, var(--sui-textbox-background-color));font-family:var(--sui-textbox-font-family);cursor:pointer;transition:all 200ms;}.color-input.svelte-1ck6cim:is(:where(.svelte-1ck6cim):hover, :where(.svelte-1ck6cim):focus-visible) {background-color:var(--sui-color-input-background-color-focus, var(--sui-hover-background-color));}.color-input.svelte-1ck6cim:active {background-color:var(--sui-color-input-background-color-active, var(--sui-active-background-color));}.color-input[aria-readonly=true].svelte-1ck6cim {cursor:default;background-color:var(--sui-disabled-background-color);}.color-input[aria-invalid=true].svelte-1ck6cim {border-color:var(--sui-error-border-color);}.color-input.svelte-1ck6cim::-webkit-color-swatch-wrapper {padding:0;}.color-input.svelte-1ck6cim::-webkit-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}.color-input.svelte-1ck6cim::-moz-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}`};function vxe(e,t){k(t,!0),q(e,_xe);let n=Y(t,`value`,15),r=Y(t,`element`,15),i=Y(t,`disabled`,3,!1),a=Y(t,`readonly`,3,!1),o=Y(t,`required`,3,!1),s=Y(t,`invalid`,3,!1),c=Y(t,`ariaLabel`,3,void 0),l=gs(t,hxe),u=e=>{a()&&e.preventDefault(),t.onclick?.(e)},d=e=>{n(e.currentTarget.value),t.oninput?.(e)};var f=gxe();us(f,()=>({...l,value:n()??``,type:`color`,class:`sui color-input ${t.class??``}`,disabled:i()||void 0,"aria-label":c()??l[`aria-label`],"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),onclick:u,oninput:d}),void 0,void 0,void 0,`svelte-1ck6cim`,!0),ms(f,e=>r(e),()=>r()),W(e,f),A()}var yxe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`type`,`min`,`max`,`step`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`oninput`]),bxe=V(`<input/>`),xxe={hash:`svelte-cdw0d9`,code:`.date-time-input.svelte-cdw0d9 {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);width:auto;min-width:0;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-transform:var(--sui-date-time-input-text-transform, uppercase);letter-spacing:var(--sui-textbox-letter-spacing, normal);font-variant-numeric:tabular-nums;transition:all 200ms;}.date-time-input.svelte-cdw0d9:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.date-time-input.svelte-cdw0d9:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}.date-time-input.svelte-cdw0d9:is(:where(.svelte-cdw0d9):disabled, :where(.svelte-cdw0d9):read-only) {background-color:var(--sui-disabled-background-color);}.date-time-input[aria-invalid=true].svelte-cdw0d9 {border-color:var(--sui-error-border-color);}.date-time-input.svelte-cdw0d9::-webkit-calendar-picker-indicator {cursor:pointer;}.date-time-input.svelte-cdw0d9:is(:where(.svelte-cdw0d9):disabled, :where(.svelte-cdw0d9):read-only)::-webkit-calendar-picker-indicator {cursor:default;}`};function Sxe(e,t){k(t,!0),q(e,xxe);let n=Y(t,`value`,15),r=Y(t,`element`,15),i=Y(t,`type`,3,`date`),a=Y(t,`min`,3,void 0),o=Y(t,`max`,3,void 0),s=Y(t,`step`,3,void 0),c=Y(t,`disabled`,3,!1),l=Y(t,`readonly`,3,!1),u=Y(t,`required`,3,!1),d=Y(t,`invalid`,3,!1),f=Y(t,`ariaLabel`,3,void 0),p=gs(t,yxe),m=e=>{n(e.currentTarget.value),t.oninput?.(e)};var h=bxe();us(h,()=>({...p,value:n()??``,type:i(),min:a(),max:o(),step:s(),class:`sui date-time-input ${t.class??``}`,disabled:c()||void 0,readonly:l()||void 0,"aria-label":f()??p[`aria-label`],"aria-disabled":c(),"aria-readonly":l(),"aria-required":u(),"aria-invalid":d(),oninput:m}),void 0,void 0,void 0,`svelte-cdw0d9`,!0),ms(h,e=>r(e),()=>r()),W(e,h),A()}var Cxe=new Set([`$$slots`,`$$events`,`$$legacy`,`mask`,`value`,`flex`,`monospace`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`visibilityIcon`]),wxe=V(`<div role="none"><!> <!></div>`),Txe={hash:`svelte-1cqpw8k`,code:`.password-input.svelte-1cqpw8k,
|
||
.secret-input.svelte-1cqpw8k {display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.password-input.flex.svelte-1cqpw8k:not([hidden]),
|
||
.secret-input.flex.svelte-1cqpw8k:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.password-input.svelte-1cqpw8k .text-input,
|
||
.secret-input.svelte-1cqpw8k .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.password-input.svelte-1cqpw8k input,
|
||
.secret-input.svelte-1cqpw8k input {border-start-end-radius:0;border-end-end-radius:0;}.password-input.svelte-1cqpw8k button,
|
||
.secret-input.svelte-1cqpw8k button {margin-block:0;margin-inline-end:0;flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);width:var(--sui-textbox-height);aspect-ratio:1/1;}.password-input.svelte-1cqpw8k button:last-child,
|
||
.secret-input.svelte-1cqpw8k button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}.password-input.svelte-1cqpw8k button .icon,
|
||
.secret-input.svelte-1cqpw8k button .icon {font-size:var(--sui-font-size-xx-large);}.secret-input.show.svelte-1cqpw8k input {-webkit-text-security:none;}.secret-input.svelte-1cqpw8k input {-webkit-text-security:disc;}.password-input.svelte-1cqpw8k:dir(rtl),
|
||
.secret-input.svelte-1cqpw8k:dir(rtl) {--sui-textbox-text-align: right;}`};function Exe(e,t){let n=Co();k(t,!0),q(e,Txe);let r=Y(t,`value`,15),i=Y(t,`flex`,3,!1),a=Y(t,`monospace`,3,!0),o=Y(t,`hidden`,3,!1),s=Y(t,`disabled`,3,!1),c=Y(t,`readonly`,3,!1),l=Y(t,`required`,3,!1),u=Y(t,`invalid`,3,!1),d=gs(t,Cxe),f=M(!1),p=j(()=>t.mask===`type`?{show:`_sui.password_input.show_password`,hide:`_sui.password_input.hide_password`}:{show:`_sui.secret_input.show_secret`,hide:`_sui.secret_input.hide_secret`});var m=wxe();let h;var g=P(m);Gl(g,_s({dir:`ltr`},()=>t.mask===`css`?{autocomplete:`off`,autocapitalize:`off`,autocorrect:`off`}:{},()=>d,{get id(){return n}},()=>t.mask===`type`?{type:B(f)?`text`:`password`}:{},{spellcheck:`false`,get flex(){return i()},get monospace(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get required(){return l()},get invalid(){return u()},get value(){return r()},set value(e){r(e)}}));var _=L(g,2);{let e=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.visibilityIcon),W(e,n)},a=e=>{{let t=j(()=>B(f)?`visibility_off`:`visibility`);Lc(e,{get name(){return B(t)}})}};K(r,e=>{t.visibilityIcon?e(i):e(a,-1)}),W(e,n)},r=j(()=>s()||c()),i=j(()=>X(B(f)?B(p).hide:B(p).show));ll(_,{iconic:!0,get disabled(){return B(r)},get pressed(){return B(f)},get"aria-label"(){return B(i)},get"aria-controls"(){return n},onclick:()=>{N(f,!B(f))},startIcon:e,$$slots:{startIcon:!0}})}O(m),z(()=>{h=rs(m,1,`sui ${t.mask===`type`?`password-input`:`secret-input`} ${t.class??``}`,`svelte-1cqpw8k`,h,{flex:i(),disabled:s(),readonly:c(),show:t.mask===`css`&&B(f)}),J(m,`hidden`,o())}),W(e,m),A()}var Dxe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`]);function Oxe(e,t){k(t,!0);let n=Y(t,`value`,15),r=gs(t,Dxe);Exe(e,_s(()=>r,{mask:`css`,get value(){return n()},set value(e){n(e)}})),A()}var kxe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`expanded`,`class`,`hidden`,`disabled`,`label`,`value`,`valueType`,`children`,`items`,`startIcon`,`endIcon`,`chevronIcon`,`onChange`,`onSelect`,`onExpand`]),Axe=V(`<span role="none" class="chevron svelte-wso092" data-action="toggle"><!></span>`),jxe=V(`<span role="none" class="chevron placeholder svelte-wso092"></span>`),Mxe=V(`<div role="group" class="group svelte-wso092"><!></div>`),Nxe=V(`<div><div role="none" class="row svelte-wso092"><!> <!> <span role="none" class="label svelte-wso092"><!></span> <!></div> <!></div>`),Pxe={hash:`svelte-wso092`,code:`[role=treeitem].svelte-wso092 {display:block;}[role=treeitem][hidden].svelte-wso092 {display:none;}[role=treeitem].svelte-wso092:focus-visible {outline-color:transparent;}[role=treeitem].svelte-wso092:focus-visible > .row:where(.svelte-wso092) {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role=treeitem][aria-selected=true].svelte-wso092 > .row:where(.svelte-wso092) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem].svelte-wso092 > .row:where(.svelte-wso092):hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}[role=treeitem].svelte-wso092 > .row:where(.svelte-wso092):active {background-color:var(--sui-active-background-color);}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-wso092 > .row:where(.svelte-wso092) {cursor:default;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-wso092 > .row:where(.svelte-wso092):is(:where(.svelte-wso092):hover, :where(.svelte-wso092):active) {color:var(--sui-tree-foreground-color);background-color:transparent;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-wso092 > .row:where(.svelte-wso092) > .chevron:where(.svelte-wso092):not(.placeholder) {cursor:pointer;}[role='tree'][aria-readonly='true'] [role=treeitem][aria-selected=true].svelte-wso092 > .row:where(.svelte-wso092):is(:where(.svelte-wso092):hover, :where(.svelte-wso092):active) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem][aria-expanded=true].svelte-wso092 > .row:where(.svelte-wso092) > .chevron:where(.svelte-wso092):dir(ltr) {transform:rotate(90deg);}[role=treeitem][aria-expanded=true].svelte-wso092 > .row:where(.svelte-wso092) > .chevron:where(.svelte-wso092):dir(rtl) {transform:rotate(-90deg);}.row.svelte-wso092 {display:flex;align-items:center;gap:4px;border-radius:var(--sui-tree-item-border-radius, var(--sui-option-border-radius, 4px));padding:var(--sui-tree-item-padding, var(--sui-option-padding, 0 8px));min-height:var(--sui-tree-item-height, var(--sui-option-height));cursor:pointer;transition:background-color 200ms;}.chevron.svelte-wso092 {flex:none;display:flex;align-items:center;justify-content:center;margin-inline-start:calc((var(--sui-tree-item-level, 1) - 1) * var(--sui-tree-item-indent, 16px));width:var(--sui-tree-item-chevron-size, 24px);height:var(--sui-tree-item-chevron-size, 24px);transition:transform 200ms;}.label.svelte-wso092 {flex:auto;overflow:hidden;padding:0 4px;white-space:nowrap;text-overflow:ellipsis;}.group.svelte-wso092 {display:block;}.group[hidden].svelte-wso092 {display:none;}`};function TO(e,t){let n=Co();k(t,!0),q(e,Pxe);let r=Y(t,`selected`,15,!1),i=Y(t,`expanded`,15,!1),a=Y(t,`hidden`,3,!1),o=Y(t,`disabled`,3,!1),s=Y(t,`label`,3,``),c=Y(t,`value`,3,void 0),l=Y(t,`valueType`,3,void 0),u=gs(t,kxe),d=j(()=>c()===void 0?s():c()),f=j(()=>l()===void 0?Yc(B(d)):l()),p=(ui(`sui:tree-item-level`)??0)+1;di(`sui:tree-item-level`,p);let m=e=>{r(e.detail.selected),t.onChange?.(e)},h=e=>{i(e.detail.expanded),t.onExpand?.(e)},g=e=>{t.onSelect?.(e)},_=e=>{let t=[[`Change`,m],[`Expand`,h],[`Select`,g]];return t.forEach(([t,n])=>{e.addEventListener(t,n)}),()=>{t.forEach(([t,n])=>{e.removeEventListener(t,n)})}};var v=Nxe();us(v,()=>({...u,id:n,role:`treeitem`,class:`sui treeitem ${t.class??``}`,tabindex:`-1`,hidden:a(),"aria-hidden":a(),"aria-disabled":o(),"aria-selected":r(),"aria-expanded":t.items?i():void 0,"aria-level":p,"aria-labelledby":`${n}-label`,"data-label":s(),"data-value":B(d),"data-type":B(f)}),void 0,void 0,void 0,`svelte-wso092`);var y=P(v);let b;var x=P(y),S=e=>{var n=Axe(),r=P(n),i=e=>{var n=U();Uo(F(n),()=>t.chevronIcon),W(e,n)},a=e=>{{let t=j(()=>Pc()?`chevron_left`:`chevron_right`);Lc(e,{get name(){return B(t)}})}};K(r,e=>{t.chevronIcon?e(i):e(a,-1)}),O(n),W(e,n)},C=e=>{W(e,jxe())};K(x,e=>{t.items?e(S):e(C,-1)});var w=L(x,2);Uo(w,()=>t.startIcon??jr);var T=L(w,2),ee=P(T),E=e=>{var t=H();z(()=>G(t,s())),W(e,t)},te=e=>{var n=U();Uo(F(n),()=>t.children??jr),W(e,n)};K(ee,e=>{s()?e(E):e(te,-1)}),O(T),Uo(L(T,2),()=>t.endIcon??jr),O(y);var ne=L(y,2),re=e=>{var n=Mxe();Uo(P(n),()=>t.items),O(n),z(()=>J(n,`hidden`,!i())),W(e,n)};K(ne,e=>{t.items&&e(re)}),O(v),$o(v,()=>_),z(()=>{b=as(y,``,b,{"--sui-tree-item-level":p}),J(T,`id`,`${n}-label`)}),W(e,v),A()}var EO=`[role="treeitem"]`,Fxe=class{#e=new vl;constructor(e,{clickToSelect:t=!0,selectionFollowsFocus:n,expandOnSelect:r=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.id=rl(`tree`),this.clickToSelect=t,this.expandOnSelect=r,this.selectionFollowsFocusOption=n,this.anchor=void 0,this.activated=!1,this.destroyed=!1,this._onClick=bl(this,e=>this.onClick(e)),this._onKeyDown=bl(this,e=>this.onKeyDown(e)),this._onFocusIn=bl(this,e=>this.onFocusIn(e)),this.observer=new globalThis.MutationObserver(()=>{this.update()}),this.parent.tabIndex=-1,e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`focusin`,this._onFocusIn),xl(this,()=>this.destroyed)}activate(){if(this.activated)return;let{parent:e}=this;this.activated=!0,this.update(),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`aria-hidden`,`aria-disabled`,`aria-expanded`]}),e.dispatchEvent(new CustomEvent(`Initialized`))}get multi(){return this.parent.getAttribute(`aria-multiselectable`)===`true`}get selectionFollowsFocus(){return this.selectionFollowsFocusOption??!this.multi}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get allItems(){return[...this.parent.querySelectorAll(EO)]}get visibleItems(){let e=[],t=n=>{[...n.children].forEach(n=>{if(n.getAttribute(`role`)!==`treeitem`){t(n);return}let r=n;if(r.matches(`[hidden], [aria-hidden="true"]`)||(e.push(r),this.isParent(r)&&!this.isExpanded(r)))return;let i=this.getGroup(r);i&&t(i)})};return t(this.parent),e}get activeItems(){return this.visibleItems.filter(e=>!e.matches(`[aria-disabled="true"]`))}get selectedItems(){return[...this.parent.querySelectorAll(`${EO}[aria-selected="true"]`)]}get currentItem(){return this.allItems.find(e=>e.tabIndex===0)}getGroup(e){return[...e.children].find(e=>e.getAttribute(`role`)===`group`)}getChildItems(e){let t=this.getGroup(e);return t?this.getItemsInGroup(t):[]}getItemsInGroup(e){let t=[],n=e=>{[...e.children].forEach(e=>{let r=e.getAttribute(`role`);r===`treeitem`?t.push(e):r!==`group`&&r!==`tree`&&n(e)})};return n(e),t}getParentItem(e){return e.parentElement?.closest(EO)??void 0}isParent(e){return e.hasAttribute(`aria-expanded`)}isExpanded(e){return e.getAttribute(`aria-expanded`)===`true`}getLabel(e){return e.dataset.label??e.querySelector(`.label`)?.textContent??``}update(){let{allItems:e,activeItems:t}=this;e.forEach((e,t)=>{e.id||=`${this.id}-item-${t+1}`,e.hasAttribute(`aria-selected`)||e.setAttribute(`aria-selected`,`false`)}),[this.parent,...this.parent.querySelectorAll(`[role="group"]`)].forEach(e=>{let t=this.getItemsInGroup(e);t.forEach((e,n)=>{e.setAttribute(`aria-posinset`,String(n+1)),e.setAttribute(`aria-setsize`,String(t.length))})});let n=t.find(e=>e===document.activeElement)??t.find(e=>e.tabIndex===0)??t.find(e=>e.getAttribute(`aria-selected`)===`true`)??t[0];this.setTabStop(n)}scrollIntoView(e){fl(e)}setTabStop(e){this.parent.querySelectorAll(`${EO}[tabindex]:not([tabindex="-1"])`).forEach(t=>{t!==e&&(t.tabIndex=-1)}),e&&(e.tabIndex=0)}focusItem(e,{select:t=this.selectionFollowsFocus}={}){this.setTabStop(e),e.focus(),e.dispatchEvent(new CustomEvent(`Focus`)),this.scrollIntoView(e),t&&this.selectItem(e)}setSelected(e,t){e.getAttribute(`aria-selected`)===`true`!==t&&(e.setAttribute(`aria-selected`,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{selected:t}})),t&&e.dispatchEvent(new CustomEvent(`Select`)))}selectItem(e,{additive:t=!1,range:n=!1}={}){if(this.isDisabled||this.isReadOnly)return;let{multi:r,anchor:i}=this,a=r&&n&&i&&i!==e?this.visibleItems:[],o=a.indexOf(i);if(o!==-1){let t=[o,a.indexOf(e)].sort((e,t)=>e-t);a.forEach((e,n)=>{this.setSelected(e,n>=t[0]&&n<=t[1]&&!e.matches(`[aria-disabled="true"]`))})}else r&&t?(this.setSelected(e,e.getAttribute(`aria-selected`)!==`true`),this.anchor=e):(this.selectedItems.forEach(t=>{t!==e&&this.setSelected(t,!1)}),this.setSelected(e,!0),this.anchor=e);this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:ml(e)}))}selectAll(e){this.isDisabled||this.isReadOnly||!this.multi||(this.activeItems.forEach(e=>{this.setSelected(e,!0)}),this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:ml(e)})))}expandItem(e,t){if(this.isDisabled||!this.isParent(e)||this.isExpanded(e)===t)return;let n=this.getGroup(e);e.setAttribute(`aria-expanded`,String(t)),n&&(n.hidden=!t),e.dispatchEvent(new CustomEvent(`Expand`,{detail:{expanded:t}})),this.update()}expandSiblings(e){let t=this.getParentItem(e),n=t?this.getGroup(t):this.parent;n&&this.getItemsInGroup(n).forEach(e=>{this.expandItem(e,!0)})}typeAhead(e,t){let n=this.activeItems,r=yl(n.map(e=>gl(this.getLabel(e))),this.#e.push(e),n.indexOf(t));r!==-1&&n[r]!==t&&this.focusItem(n[r])}onFocusIn(e){let t=e.target.closest(EO);t&&!t.matches(`[aria-disabled="true"]`)&&this.setTabStop(t)}onClick(e){let t=e.target,n=t.closest(EO);if(!n||e.button!==0||this.isDisabled)return;if(n.matches(`[aria-disabled="true"]`)){e.preventDefault();return}let{ctrlKey:r,metaKey:i,shiftKey:a}=e;t.closest(`[data-action="toggle"]`)?(e.preventDefault(),this.focusItem(n,{select:!1}),this.expandItem(n,!this.isExpanded(n))):(this.focusItem(n,{select:!1}),this.clickToSelect&&this.selectItem(n,{additive:r||i,range:a}),this.expandOnSelect&&!r&&!i&&!a&&this.expandItem(n,!this.isExpanded(n)))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,{activeItems:o,multi:s}=this;if(this.isDisabled||a||!o.length)return;let c=e.target.closest(EO),l=(c&&o.includes(c)?c:void 0)??this.currentItem??o[0],u=o.indexOf(l),{prevKey:d,nextKey:f}=_l(`horizontal`,Pc());if(t===`a`&&(n||r))s&&(e.preventDefault(),this.selectAll(l));else if(!(n||r)){if(t===`Enter`)e.preventDefault(),l.click();else if(t===` `)e.preventDefault(),s?this.selectItem(l,{additive:!i,range:i}):this.selectItem(l);else if(t===`ArrowDown`||t===`ArrowUp`){e.preventDefault();let n=o[t===`ArrowDown`?u+1:u-1];if(!n)return;s&&i?(this.focusItem(n,{select:!1}),this.selectItem(n,{additive:!0})):this.focusItem(n)}else if(t===f){if(e.preventDefault(),!this.isParent(l))return;if(!this.isExpanded(l)){this.expandItem(l,!0);return}let t=this.getChildItems(l).find(e=>o.includes(e));t&&this.focusItem(t)}else if(t===d){if(e.preventDefault(),this.isParent(l)&&this.isExpanded(l)){this.expandItem(l,!1);return}let t=this.getParentItem(l);t&&o.includes(t)&&this.focusItem(t)}else t===`Home`||t===`End`?(e.preventDefault(),this.focusItem(t===`Home`?o[0]:o[o.length-1])):t===`*`?(e.preventDefault(),this.expandSiblings(l)):t.length===1&&t.trim()&&this.typeAhead(t,l)}}destroy(){this.destroyed=!0,this.#e.reset(),this.observer.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown),this.parent.removeEventListener(`focusin`,this._onFocusIn)}},Ixe=e=>t=>{let n=new Fxe(t,e);return()=>{n.destroy()}},Lxe=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`hidden`,`disabled`,`readonly`,`multiple`,`clickToSelect`,`selectionFollowsFocus`,`expandOnSelect`,`ariaLabel`,`children`,`onChange`]),Rxe=V(`<div><div role="none" class="inner svelte-1jxckbi"><!></div></div>`),zxe={hash:`svelte-1jxckbi`,code:`[role=tree].svelte-1jxckbi {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);min-width:var(--sui-tree-min-width, calc(var(--sui-option-height) * 5));overflow:auto;color:var(--sui-tree-foreground-color, var(--sui-control-foreground-color));background-color:var(--sui-tree-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.inner.svelte-1jxckbi {display:contents;}`};function Bxe(e,t){k(t,!0),q(e,zxe);let n=Y(t,`element`,15),r=Y(t,`hidden`,3,!1),i=Y(t,`disabled`,3,!1),a=Y(t,`readonly`,3,!1),o=Y(t,`multiple`,3,!1),s=Y(t,`clickToSelect`,3,!0),c=Y(t,`selectionFollowsFocus`,3,void 0),l=Y(t,`expandOnSelect`,3,!0),u=Y(t,`ariaLabel`,3,void 0),d=gs(t,Lxe);var f=Rxe(),p=e=>{t.onChange?.(e)};us(f,()=>({...d,role:`tree`,class:`sui tree ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a()||void 0,"aria-multiselectable":o(),"aria-label":u(),onChange:p}),void 0,void 0,void 0,`svelte-1jxckbi`);var m=P(f);Uo(P(m),()=>t.children??jr),O(m),O(f),ms(f,e=>n(e),()=>n()),$o(f,()=>Ixe({clickToSelect:s(),selectionFollowsFocus:c(),expandOnSelect:l()})),z(()=>m.inert=i()),W(e,f),A()}var Vxe=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`],Hxe=e=>document.documentElement.matches(`[data-env="dev"]`)?!0:e instanceof Element?e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&Vxe.includes(e.type)||e.closest(`[role="textbox"]`)?.contentEditable===`true`:!1,Uxe={hash:`svelte-u1y14z`,code:`
|
||
/* https://fontsource.org/fonts/source-sans-3/cdn */
|
||
@font-face {font-family:'Source Sans 3';font-style:normal;font-display:swap;font-weight:200 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/source-sans-3:vf@5.3.1/latin-wght-normal.woff2)
|
||
format('woff2-variations');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
||
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;size-adjust:110%;
|
||
}
|
||
|
||
/* https://fontsource.org/fonts/noto-mono/cdn */
|
||
@font-face {font-family:'Noto Mono';font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/noto-mono@5.3.0/latin-400-normal.woff2)
|
||
format('woff2');
|
||
}
|
||
|
||
/* https://fontsource.org/fonts/material-symbols-outlined/cdn */
|
||
@font-face {font-family:'Material Symbols Outlined';font-style:normal;font-display:block;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/material-symbols-outlined:vf@5.3.9/latin-wght-normal.woff2)
|
||
format('woff2-variations');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
||
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||
}.material-symbols-outlined {
|
||
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */font-family:'Material Symbols Outlined';font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;overflow-wrap:normal;direction:ltr;-moz-font-feature-settings:'liga';font-feature-settings:'liga';}`};function Wxe(e){q(e,Uxe)}var Gxe=new Set([`$$slots`,`$$events`,`$$legacy`,`orientation`,`children`]),Kxe=V(`<meta name="viewport"/> <meta name="google" content="notranslate"/> <!>`,1),qxe=V(`<div class="font-loader svelte-ajli7a" aria-hidden="true">Loading <strong>Sveltia</strong> <em>UI</em> <span role="none" class="material-symbols-outlined">favorite</span></div>`),Jxe=V(`<!> <div><!></div>`,1),Yxe={hash:`svelte-ajli7a`,code:`:root,
|
||
:host {--sui-base-hue: 210;--sui-highlight-foreground-color: hsl(var(--sui-foreground-color-1-hsl));--sui-primary-foreground-color: hsl(var(--sui-foreground-color-2-hsl));--sui-secondary-foreground-color: hsl(var(--sui-foreground-color-3-hsl));--sui-tertiary-foreground-color: hsl(var(--sui-foreground-color-4-hsl));--sui-disabled-foreground-color: hsl(var(--sui-foreground-color-5-hsl));--sui-error-foreground-color: hsl(
|
||
var(--sui-error-color-hue) var(--sui-alert-foreground-color-saturation)
|
||
var(--sui-alert-foreground-color-lightness)
|
||
);--sui-warning-foreground-color: hsl(
|
||
var(--sui-warning-color-hue) var(--sui-alert-foreground-color-saturation)
|
||
var(--sui-alert-foreground-color-lightness)
|
||
);--sui-info-foreground-color: hsl(
|
||
var(--sui-info-color-hue) var(--sui-alert-foreground-color-saturation)
|
||
var(--sui-alert-foreground-color-lightness)
|
||
);--sui-success-foreground-color: hsl(
|
||
var(--sui-success-color-hue) var(--sui-alert-foreground-color-saturation)
|
||
var(--sui-alert-foreground-color-lightness)
|
||
);--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 35%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl) / 75%);--sui-active-background-color: hsl(var(--sui-background-color-5-hsl) / 100%);--sui-content-background-color: hsl(var(--sui-background-color-1-hsl));--sui-code-background-color: hsl(var(--sui-background-color-3-hsl));--sui-primary-background-color: hsl(var(--sui-background-color-2-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl) / 80%);--sui-secondary-background-color: hsl(var(--sui-background-color-3-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl) / 80%);--sui-tertiary-background-color: hsl(var(--sui-background-color-4-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl) / 80%);--sui-disabled-background-color: hsl(var(--sui-background-color-4-hsl));--sui-error-background-color: hsl(
|
||
var(--sui-error-color-hue) var(--sui-alert-background-color-saturation)
|
||
var(--sui-alert-background-color-lightness)
|
||
);--sui-warning-background-color: hsl(
|
||
var(--sui-warning-color-hue) var(--sui-alert-background-color-saturation)
|
||
var(--sui-alert-background-color-lightness)
|
||
);--sui-info-background-color: hsl(
|
||
var(--sui-info-color-hue) var(--sui-alert-background-color-saturation)
|
||
var(--sui-alert-background-color-lightness)
|
||
);--sui-success-background-color: hsl(
|
||
var(--sui-success-color-hue) var(--sui-alert-background-color-saturation)
|
||
var(--sui-alert-background-color-lightness)
|
||
);--sui-disabled-opacity: 0.35;--sui-modal-border-width: 0;--sui-focus-ring-width: 2px;--sui-focus-ring-color: var(--sui-primary-accent-color);--sui-focus-ring-offset: 1px;--sui-primary-border-color: hsl(var(--sui-border-color-2-hsl));--sui-secondary-border-color: hsl(var(--sui-border-color-3-hsl));--sui-error-border-color: hsl(
|
||
var(--sui-error-color-hue) var(--sui-alert-border-color-saturation)
|
||
var(--sui-error-border-color-lightness, var(--sui-alert-border-color-lightness))
|
||
);--sui-warning-border-color: hsl(
|
||
var(--sui-warning-color-hue) var(--sui-alert-border-color-saturation)
|
||
var(--sui-alert-border-color-lightness)
|
||
);--sui-info-border-color: hsl(
|
||
var(--sui-info-color-hue) var(--sui-alert-border-color-saturation)
|
||
var(--sui-alert-border-color-lightness)
|
||
);--sui-success-border-color: hsl(
|
||
var(--sui-success-color-hue) var(--sui-alert-border-color-saturation)
|
||
var(--sui-alert-border-color-lightness)
|
||
);--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 40%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 40%);--sui-font-family-default: "Source Sans 3", system-ui, sans-serif;--sui-font-size-xxx-large: 25px;--sui-font-size-xx-large: 21px;--sui-font-size-x-large: 19px;--sui-font-size-large: 17px;--sui-font-size-default: 15px;--sui-font-size-small: 13px;--sui-font-size-x-small: 11px;--sui-font-weight-normal: 400;--sui-font-weight-bold: 700;--sui-font-family-monospace: "Noto Sans Mono", ui-monospace, monospace;--sui-font-size-monospace: 0.9em;--sui-line-height-default: 1.2;--sui-line-height-compact: 1.4;--sui-line-height-comfortable: 1.6;--sui-word-spacing-normal: 1px;--sui-heading-margin: 0;--sui-heading-font-family: var(--sui-font-family-default);--sui-heading-font-weight: var(--sui-font-weight-bold);--sui-heading-line-height: var(--sui-line-height-default);--sui-paragraph-margin: 1.75em;--sui-menuitem-font-size: 14px;--sui-control-small-border-width: 1px;--sui-control-small-border-radius: calc(var(--sui-control-small-height) / 8);--sui-control-small-padding: 0 calc((var(--sui-control-small-height) / 5));--sui-control-small-height: 24px;--sui-control-medium-border-width: 1px;--sui-control-medium-border-radius: calc(var(--sui-control-medium-height) / 8);--sui-control-medium-padding: 0 calc((var(--sui-control-medium-height) / 4));--sui-control-medium-height: 32px;--sui-control-large-border-width: 1px;--sui-control-large-border-radius: calc(var(--sui-control-large-height) / 8);--sui-control-large-padding: 0 calc((var(--sui-control-large-height) / 3));--sui-control-large-height: 40px;--sui-control-border-color: hsl(var(--sui-border-color-2-hsl));--sui-control-foreground-color: var(--sui-primary-foreground-color);--sui-control-background-color: hsl(var(--sui-background-color-4-hsl));--sui-control-font-family: var(--sui-font-family-default);--sui-control-font-size: var(--sui-font-size-default);--sui-control-line-height: var(--sui-line-height-compact);--sui-button-small-border-radius: var(--sui-control-small-border-radius);--sui-button-small-padding: var(--sui-control-small-padding);--sui-button-small-height: var(--sui-control-small-height);--sui-button-medium-border-radius: var(--sui-control-medium-border-radius);--sui-button-medium-padding: var(--sui-control-medium-padding);--sui-button-medium-height: var(--sui-control-medium-height);--sui-button-large-border-radius: var(--sui-control-large-border-radius);--sui-button-large-padding: var(--sui-control-large-padding);--sui-button-large-height: var(--sui-control-large-height);--sui-button-border-color: var(--sui-control-border-color);--sui-button-background-color: var(--sui-control-background-color);--sui-checkbox-border-radius: var(--sui-control-medium-border-radius);--sui-checkbox-height: 20px;--sui-checkbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-checkbox-background-color: var(--sui-control-background-color);--sui-readonly-accent-color: var(--sui-tertiary-foreground-color);--sui-readonly-accent-color-inverted: var(--sui-primary-background-color);--sui-option-border-radius: var(--sui-control-medium-border-radius);--sui-option-padding: calc((var(--sui-control-medium-height) / 6))
|
||
calc((var(--sui-control-medium-height) / 5));--sui-option-height: var(--sui-control-medium-height);--sui-listbox-border-radius: var(--sui-control-medium-border-radius);--sui-listbox-border-color: var(--sui-control-border-color);--sui-listbox-foreground-color: var(--sui-control-foreground-color);--sui-listbox-background-color: hsl(var(--sui-background-color-1-hsl));--sui-tree-border-radius: var(--sui-control-medium-border-radius);--sui-tree-border-color: var(--sui-control-border-color);--sui-tree-foreground-color: var(--sui-control-foreground-color);--sui-tree-background-color: hsl(var(--sui-background-color-1-hsl));--sui-tree-item-border-radius: var(--sui-control-medium-border-radius);--sui-tree-item-padding: var(--sui-option-padding);--sui-tree-item-height: var(--sui-control-medium-height);--sui-tree-item-indent: 16px;--sui-textbox-border-radius: var(--sui-control-medium-border-radius);--sui-textbox-height: var(--sui-control-medium-height);--sui-textbox-border-color: var(--sui-control-border-color);--sui-textbox-foreground-color: var(--sui-control-foreground-color);--sui-textbox-background-color: hsl(var(--sui-background-color-1-hsl));--sui-textbox-font-family: var(--sui-font-family-default);--sui-textbox-font-size: var(--sui-font-size-default);--sui-textbox-singleline-padding: 0 8px;--sui-textbox-singleline-min-width: 240px;--sui-textbox-singleline-line-height: var(--sui-line-height-compact);--sui-textbox-multiline-padding: 16px;--sui-textbox-multiline-min-width: 480px;--sui-textbox-multiline-line-height: var(--sui-line-height-comfortable);--sui-tab-height: var(--sui-control-medium-height);--sui-tab-small-height: var(--sui-control-small-height);--sui-tab-medium-height: var(--sui-control-medium-height);--sui-tab-large-height: var(--sui-control-large-height);--sui-primary-toolbar-size: 56px;--sui-secondary-toolbar-size: 48px;--sui-bottom-navigation-height: var(--sui-primary-toolbar-size);--sui-primary-row-height: 56px;--sui-secondary-row-height: 40px;}
|
||
@media (pointer: coarse) {:root,
|
||
:host {--sui-menuitem-height: 40px;--sui-control-small-height: 32px;--sui-control-medium-height: 40px;--sui-control-large-height: 48px;--sui-checkbox-height: 24px;--sui-secondary-row-height: 48px;}
|
||
}
|
||
@media (prefers-reduced-transparency) {:root,
|
||
:host {--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));}
|
||
}:root[data-theme=light],
|
||
:host[data-theme=light] {color-scheme:light;--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 95%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 92%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 72%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 80%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 25%;--sui-alert-background-color-saturation: 65%;--sui-alert-background-color-lightness: 90%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 68%;--sui-error-border-color-lightness: 60%;}:root[data-theme=dark],
|
||
:host[data-theme=dark] {color-scheme:dark;--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 8%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 10%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 13%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 24%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 20%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 75%;--sui-alert-background-color-saturation: 40%;--sui-alert-background-color-lightness: 10%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 38%;}
|
||
@media (prefers-color-scheme: light) {:root:not([data-theme]),
|
||
:host:not([data-theme]) {color-scheme:light;--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 95%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 92%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 72%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 80%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 25%;--sui-alert-background-color-saturation: 65%;--sui-alert-background-color-lightness: 90%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 68%;--sui-error-border-color-lightness: 60%;}
|
||
}
|
||
@media (prefers-color-scheme: dark) {:root:not([data-theme]),
|
||
:host:not([data-theme]) {color-scheme:dark;--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 8%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 10%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 13%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 24%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 20%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 75%;--sui-alert-background-color-saturation: 40%;--sui-alert-background-color-lightness: 10%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 38%;}
|
||
}:root[data-contrast=more][data-theme=light],
|
||
:host[data-contrast=more][data-theme=light] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}:root[data-contrast=more][data-theme=dark],
|
||
:host[data-contrast=more][data-theme=dark] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
|
||
@media (prefers-color-scheme: light) {:root[data-contrast=more]:not([data-theme]),
|
||
:host[data-contrast=more]:not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
|
||
}
|
||
@media (prefers-color-scheme: dark) {:root[data-contrast=more]:not([data-theme]),
|
||
:host[data-contrast=more]:not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
|
||
}
|
||
@media (prefers-contrast: more) {:root:not([data-contrast])[data-theme=light],
|
||
:host:not([data-contrast])[data-theme=light] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}:root:not([data-contrast])[data-theme=dark],
|
||
:host:not([data-contrast])[data-theme=dark] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
|
||
}
|
||
@media (prefers-contrast: more) and (prefers-color-scheme: light) {:root:not([data-contrast]):not([data-theme]),
|
||
:host:not([data-contrast]):not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
|
||
}
|
||
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {:root:not([data-contrast]):not([data-theme]),
|
||
:host:not([data-contrast]):not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
|
||
}.material-symbols-outlined {font-variation-settings:"FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;}*,
|
||
::before,
|
||
::after {overflow-anchor:none;scroll-behavior:smooth;box-sizing:border-box;outline-offset:0px;outline-width:var(--sui-focus-ring-width) !important;outline-style:solid;outline-color:transparent;border-width:0;border-style:solid;vertical-align:top;font-size-adjust:inherit;}
|
||
@media (prefers-reduced-motion) {*,
|
||
::before,
|
||
::after {scroll-behavior:auto;transition-duration:1ms !important;}
|
||
}::selection {background-color:var(--sui-primary-accent-color-translucent-light);}* {-webkit-tap-highlight-color:transparent;}:focus {z-index:1;outline-width:0;}:focus-visible {outline-color:var(--sui-focus-ring-color);outline-offset:var(--sui-focus-ring-offset, 0);z-index:2;}h1 {margin:var(--sui-h1-margin, var(--sui-heading-margin));font-size:var(--sui-h1-font-size, 34px);font-family:var(--sui-h1-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h1-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h1-line-height, var(--sui-heading-line-height));}h2 {margin:var(--sui-h2-margin, var(--sui-heading-margin));font-size:var(--sui-h2-font-size, 30px);font-family:var(--sui-h2-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h2-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h2-line-height, var(--sui-heading-line-height));}h3 {margin:var(--sui-h3-margin, var(--sui-heading-margin));font-size:var(--sui-h3-font-size, 26px);font-family:var(--sui-h3-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h3-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h3-line-height, var(--sui-heading-line-height));}h4 {margin:var(--sui-h4-margin, var(--sui-heading-margin));font-size:var(--sui-h4-font-size, 22px);font-family:var(--sui-h4-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h4-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h4-line-height, var(--sui-heading-line-height));}h5 {margin:var(--sui-h5-margin, var(--sui-heading-margin));font-size:var(--sui-h5-font-size, 18px);font-family:var(--sui-h5-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h5-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h5-line-height, var(--sui-heading-line-height));}h6 {margin:var(--sui-h6-margin, var(--sui-heading-margin));font-size:var(--sui-h6-font-size, 14px);font-family:var(--sui-h6-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h6-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h6-line-height, var(--sui-heading-line-height));}strong {font-weight:var(--sui-font-weight-bold, bold);}a {color:var(--sui-primary-accent-color-text);text-decoration:none;text-underline-offset:2px;}a:is(:hover, :focus, :active) {text-decoration:underline;}:is(:root, :host)[data-underline-links="true"] a {text-decoration:underline;}:is(p, ul, ol, dl) {margin:var(--sui-paragraph-margin) 0;line-height:var(--sui-line-height-comfortable);}:is(ul, ol) {padding-inline:2em;}:is(code, pre) {border-radius:4px;background-color:var(--sui-code-background-color);font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);vertical-align:-0.05em;}pre {padding:8px;line-height:var(--sui-line-height-compact);-webkit-user-select:text;user-select:text;}code {padding:2px 4px;}table {border-collapse:collapse;}:is(th, td) {border:1px solid var(--sui-textbox-border-color);padding:8px;}blockquote {margin-inline:16px 0;border-inline-start:4px solid var(--sui-textbox-border-color);padding-inline-start:12px;}:is(.disabled, [aria-disabled=true], [inert]):not(body) {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}:is(.disabled, [aria-disabled=true], [inert]):not(body) * {filter:grayscale(0) opacity(1);}:is(.disabled, [aria-disabled=true], [inert]) * {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;}:is(.readonly, [aria-readonly=true]):not(body) {cursor:default;}:is(.readonly, [aria-readonly=true]):not(body) * {cursor:default;}.font-loader.svelte-ajli7a {position:absolute;inset-inline-start:-99999px;font-family:var(--sui-font-family-default);}.app-shell.svelte-ajli7a {position:fixed;inset:0;overflow:hidden;width:100%;height:100%;color:var(--sui-primary-foreground-color);background-color:var(--sui-primary-background-color);font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);word-spacing:var(--sui-word-spacing-normal);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;touch-action:none;cursor:default;}.app-shell.horizontal.svelte-ajli7a {display:flex;flex-direction:row;overflow:hidden;}.app-shell.vertical.svelte-ajli7a {display:flex;flex-direction:column;overflow:hidden;}`};function Xxe(e,t){k(t,!0),q(e,Yxe);let n=Y(t,`orientation`,3,`horizontal`),r=gs(t,Gxe),i=M(!1);vs(()=>{let e=globalThis.matchMedia(`(prefers-color-scheme: dark)`),{dataset:t}=document.documentElement,n=()=>{t.autoTheming!==`false`&&(t.theme=e.matches?`dark`:`light`)};n(),e.addEventListener(`change`,n);let r=globalThis.setTimeout(()=>{N(i,!0)},1e3);return()=>{e.removeEventListener(`change`,n),globalThis.clearTimeout(r)}});var a=Jxe();Qo(`ajli7a`,e=>{var t=Kxe(),n=F(t);Wxe(L(n,4),{}),z(e=>J(n,`content`,e),[()=>`width=device-width, initial-scale=1, maximum-scale=1, interactive-widget=resizes-content`]),W(e,t)});var o=F(a),s=e=>{var t=qxe();as(t,``,{},{opacity:`0`}),W(e,t)};K(o,e=>{B(i)||e(s)});var c=L(o,2),l=e=>e.preventDefault(),u=e=>e.preventDefault(),d=e=>{Hxe(e.target)||e.preventDefault()};us(c,()=>({...r,role:`none`,class:[`sui`,`app-shell`,n()],ondragover:l,ondrop:u,oncontextmenu:d}),void 0,void 0,void 0,`svelte-ajli7a`),Uo(P(c),()=>t.children??jr),O(c),W(e,a),A()}var Zxe=V(`<div role="none" class="sui empty-state svelte-j9b5tx"><!></div>`),Qxe={hash:`svelte-j9b5tx`,code:`.empty-state.svelte-j9b5tx {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:16px;width:100%;height:100%;text-align:center;}`};function DO(e,t){q(e,Qxe);let n=Y(t,`children`,3,void 0);var r=Zxe();Uo(P(r),()=>n()??jr),O(r),W(e,r)}var $xe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`]),eSe=V(`<div><div role="none" class="inner svelte-1xj2823"><!></div></div>`),tSe={hash:`svelte-1xj2823`,code:`.inner.svelte-1xj2823 {display:contents;}`};function OO(e,t){q(e,tSe);let n=Y(t,`hidden`,3,!1),r=Y(t,`disabled`,3,!1),i=Y(t,`ariaLabel`,3,void 0),a=gs(t,$xe);var o=eSe();us(o,()=>({...a,role:`group`,class:`sui group ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-1xj2823`);var s=P(o);Uo(P(s),()=>t.children??jr),O(s),O(o),z(()=>s.inert=r()),W(e,o)}var nSe=V(`<div class="placeholder svelte-1swh89p"></div>`),rSe={hash:`svelte-1swh89p`,code:`.placeholder.svelte-1swh89p {height:64px;}`};function kO(e,t){k(t,!0),q(e,rSe);let n=Y(t,`eager`,3,!1),r=M(null),i=M(na(n()));R(()=>(B(r)&&(async()=>{await al(B(r)),N(i,!0)})(),()=>{B(r)&&il(B(r))}));var a=U(),o=F(a),s=e=>{var n=U();Uo(F(n),()=>t.children),W(e,n)},c=e=>{var t=nSe();ms(t,e=>N(r,e),()=>B(r)),W(e,t)};K(o,e=>{B(i)?e(s):e(c,-1)}),W(e,a),A()}var iSe={ok:`OK`,cancel:`Cancel`,close:`Close`,clear:`Clear`,insert:`Insert`,update:`Update`,remove:`Remove`,collapse:`Collapse`,expand:`Expand`,dismiss:`Dismiss`,alert:{error:`Error`,warning:`Warning`,info:`Information`,success:`Success`},role_descriptions:{disclosure:`disclosure`,option_group:`option group`,menu_item_group:`menu item group`,checkbox_group:`checkbox group`,table_head:`table head`,table_body:`table body`,table_foot:`table foot`,grid_head:`grid head`,grid_body:`grid body`,grid_foot:`grid foot`},emoji_suggestions:`Emoji Suggestions`,calendar:{year:`Year`,previous_decade:`Previous Decade`,next_decade:`Next Decade`,month:`Month`,previous_month:`Previous Month`,next_month:`Next Month`,today:`Today`},split_button:{x_options:`{$name} Options`,more_options:`More Options`},combobox:{select_an_option:`Select an option…`,filter_options:`Filter Options`,no_matching_options:`No matching options found`},number_input:{increase:`Increase`,decrease:`Decrease`,range:`From {$min} to {$max}`,min:`Minimum {$min}`,max:`Maximum {$max}`},password_input:{show_password:`Show Password`,hide_password:`Hide Password`},secret_input:{show_secret:`Show Secret`,hide_secret:`Hide Secret`},select_tags:{selected_options:`Selected Options`,remove_x:`Remove {$name}`},text_editor:{text_editor:`Text Editor`,code_editor:`Code Editor`,text_style_options:`Text Style Options`,show_text_style_options:`Show Text Style Options`,paragraph:`Paragraph`,heading_1:`Heading 1`,heading_2:`Heading 2`,heading_3:`Heading 3`,heading_4:`Heading 4`,heading_5:`Heading 5`,heading_6:`Heading 6`,bulleted_list:`Bulleted List`,numbered_list:`Numbered List`,blockquote:`Block Quote`,code_block:`Code Block`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,code:`Code`,link:`Link`,insert_link:`Insert Link`,edit_link:`Edit Link`,remove_link:`Remove Link`,text:`Text`,url:`URL`,open_in_new_tab:`Open in New Tab`,insert_table:`Insert Table`,rows:`Rows`,columns:`Columns`,table_options:`Table Options`,show_table_options:`Show Table Options`,insert_row_above:`Insert Row Above`,insert_row_below:`Insert Row Below`,insert_column_left:`Insert Column Left`,insert_column_right:`Insert Column Right`,delete_row:`Delete Row`,delete_column:`Delete Column`,delete_table:`Delete Table`,insert_horizontal_rule:`Insert Horizontal Rule`,alignment_options:`Alignment Options`,show_alignment_options:`Show Alignment Options`,align_left:`Left Align`,align_center:`Center Align`,align_right:`Right Align`,align_justify:`Justify Align`,edit_in_markdown:`Edit in Markdown`,edit_in_html:`Edit in HTML`,converter_error:`Unable to enable rich text mode. Please use the plain text editor instead.`,language:`Language`,plain_text:`Plain Text`}};function aSe(e,t){k(t,!0);let n=Y(t,`currentValue`,15),r=Y(t,`required`,3,!0),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1);var o=()=>n()??!1,s=e=>{n(e)};Tu(e,{get checked(){return o()},set checked(e){s(e)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}}),A()}var oSe=V(`<p> </p>`);function sSe(e,t){k(t,!0);let n=Y(t,`currentValue`,3,!1);var r=U(),i=F(r),a=e=>{var t=oSe(),r=I(t,!0);z(e=>G(r,e),[()=>X(`boolean.${n()}`)]),W(e,t)};K(i,e=>{typeof n()==`boolean`&&e(a)}),W(e,r),A()}var cSe=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],lSe=[`difference`,`intersection`,`symmetricDifference`,`union`],AO=!1,jO=class e extends Set{#e=new Map;#t=M(0);#n=M(0);#r=Xa||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}AO||this.#a()}#i(e){return Xa===this.#r?M(e):Xi(e)}#a(){AO=!0;var t=e.prototype,n=Set.prototype;for(let e of cSe)t[e]=function(...t){return B(this.#t),n[e].apply(this,t)};for(let r of lSe)t[r]=function(...t){B(this.#t);var i=n[r].apply(this,t);return new e(i)}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return B(this.#t),!1;r=this.#i(!0),n.set(e,r)}return B(r),t}add(e){return super.has(e)||(super.add(e),N(this.#n,super.size),ta(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),N(r,!1)),t&&(N(this.#n,super.size),ta(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())N(t,!1);e.clear(),N(this.#n,0),ta(this.#t)}}keys(){return this.values()}values(){return B(this.#t),super.values()}entries(){return B(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return B(this.#n)}},MO=class extends Map{#e=new Map;#t=M(0);#n=M(0);#r=Xa||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return Xa===this.#r?M(e):Xi(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return B(this.#t),!1}return B(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{B(this.#t);return}}return B(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),N(this.#n,super.size),ta(o);else if(i!==t){ta(r);var s=o.reactions===null?null:new Set(o.reactions);s!==null&&r.reactions?.every(e=>s.has(e))||ta(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),N(n,-1)),r&&(N(this.#n,super.size),ta(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;N(this.#n,0);for(var t of e.values())N(t,-1);ta(this.#t),e.clear()}}#a(){B(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)B(n)}keys(){return B(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return B(this.#n),super.size}},NO=new Map,PO=new MO,FO=new Map,IO=new Map,LO=new Set,RO=new Map,zO=new Map,BO=new Set,{DEV:uSe,VITE_SITE_URL:dSe}={DEV:!1},VO=uSe?dSe||`http://localhost:5174`:void 0,fSe=[`text/yaml`,`application/x-yaml`,`application/yaml`,`application/toml`,`application/json`],HO=(e,t=[])=>(t.forEach(t=>{Object.hasOwn(e,t)&&Object.defineProperty(e,t,{value:e[t],writable:!1,enumerable:!0,configurable:!0})}),na(e)),UO=e=>ai(e),WO=e=>{let t=M(e);return{get current(){return B(t)},set current(e){N(t,e)}}},GO=e=>na({current:e}),KO=e=>{let t=j(e);return{get current(){return B(t)}}},qO=e=>{let t;return KO(()=>{let n=e();return(0,Cr.default)(n,t)||(t=n),t})},JO=e=>xa(()=>{R(e)}),YO=(e,t)=>{R(()=>(e(),co(t)))},XO=(e,t,n)=>{R(()=>{let r=e();if(!r)return;let i=!1;return r.then(e=>{i||t(e)},n&&(e=>{i||n(e)})),()=>{i=!0}})},ZO=(e,t,n,r,i=e=>e,a=e=>e)=>{let o,s=()=>{let t=i(e());n()!==t&&r(t),o=t},c=()=>{let r=a(n());e()!==r&&t(r)};return YO(e,s),YO(n,()=>{n()!==o&&c()}),{updateInput:s,updateValue:c}},QO=WO(),$O=QO,ek={},tk=WO(),nk=WO([]),rk=KO(()=>!!$O.current||!!nk.current.length),ik={errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set},ak=e=>Array.isArray(e.fields)&&!Array.isArray(e.files),ok=e=>Array.isArray(e.files),sk=e=>ok(e)&&e.name===`_singletons`,ck=e=>e?._type===`entry`&&!!e._file.arrayFile,pSe=(e,{visible:t=void 0,type:n=void 0}={})=>`divider`in e||t&&e.hide?!1:n===`entry`?ak(e):n===`file`?ok(e):n===`singleton`?sk(e):ak(e)||ok(e),lk=e=>!(`divider`in e)&&typeof e.file==`string`&&Array.isArray(e.fields),uk=e=>e.filter(e=>lk(e)),dk=[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`],fk=[`boolean`,`color`,`compute`,`datetime`,`map`,`markdown`,`number`,`richtext`,`string`,`text`,`uuid`],pk=fk.filter(e=>![`boolean`,`number`].includes(e)),mk=[`file`,`image`],hk=[`richtext`,`markdown`],gk=[`text`,`string`,...hk],_k=[...mk,`relation`,`select`],mSe=[..._k,`datetime`,`keyvalue`,`list`,`number`],vk=(e=``)=>RegExp(`\\bblob:${JE(globalThis.location.origin)}\\/${kre.source}\\b`,e),hSe=/(?:(.+?)\/)?(([^/]+?)(?:\.((?:[Tt][Aa][Rr]\.)?[a-zA-Z0-9]+))?)$/,gSe=[`application/atom+xml`,`application/javascript`,`application/json`,`application/ld+json`,`application/rss+xml`,`application/xhtml+xml`,`application/xml`,`application/yaml`,`image/svg+xml`],yk=e=>e.startsWith(`text/`)||gSe.includes(e),bk=e=>{let t=e.length;for(;e[t-1]===`/`;)--t;let[,n,r=``,i=``,a]=e.slice(0,t).match(hSe)??[];return{dirname:n,basename:r,filename:i,extension:a}},xk=(e,t)=>{if(!t.length)return!0;let n=e.name.toLowerCase();return t.some(t=>{let r=t.toLowerCase();if(r.startsWith(`.`))return n.endsWith(r);let[i,a]=r.split(`/`);return a===`*`?e.type.split(`/`)[0]===i:e.type===r})},_Se=async({items:e},{accept:t}={})=>{let n=t?t.split(`,`).map(e=>e.trim()).filter(Boolean):[],r=e=>new Promise(t=>{e.file(t,()=>t(null))}),i=e=>new Promise(t=>{e.readEntries(t,()=>t([]))}),a=async e=>{if(e.name.startsWith(`.`))return[];if(e.isFile){let t=await r(e);return t&&xk(t,n)?[t]:[]}let t=e.createReader(),o=[];for(;;){let e=await i(t);if(!e.length)break;o.push(...e)}return(await Promise.all(o.map(a))).flat()},o=[...e].map(e=>e.webkitGetAsEntry()).filter(e=>e!==null);return(await Promise.all(o.map(a))).flat().sort((e,t)=>e.name.localeCompare(t.name))},vSe=async e=>(await e.text()).replace(/\r\n?/g,`
|
||
`),ySe=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,Sk=async e=>{let t=ySe(e);return new Uint8Array(await t.arrayBuffer()).toBase64()},bSe=async e=>{let t=Uint8Array.fromBase64(e);return new TextDecoder().decode(t)},xSe=new Map([[`application/gzip`,`gz`],[`application/javascript`,`js`],[`application/ld+json`,`jsonld`],[`audio/mpeg`,`mp3`],[`text/javascript`,`js`],[`text/markdown`,`md`],[`text/plain`,`txt`],[`video/quicktime`,`mov`]]),SSe=e=>{let t=e.toLowerCase().split(`;`)[0].trim(),n=xSe.get(t);if(n)return n;let r=t.split(`/`)[1]?.split(`+`)[0];if(r&&!/[.-]/.test(r))return r},CSe=(e,t)=>{let n=document.createElement(`a`),r=URL.createObjectURL(e),i=SSe(e.type);n.download=t||e.name||[Date.now(),i].filter(Boolean).join(`.`),n.href=r,n.click(),globalThis.setTimeout(()=>{URL.revokeObjectURL(r)},0)},Ck=/(?<!\\){{(.+?)}}/,wk=new RegExp(Ck.source,`g`),wSe=/\\\{\\\{.+?\\\}\\\}/g,Tk=[`year`,`month`,`day`,`hour`,`minute`,`second`],Ek=/{{(?:year|month|day|hour|minute|second)}}/,Dk=/^fields\./,TSe=/\|\s*default\s*\(/,Ok={uuid:{length:void 0,pattern:`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`},uuid_short:{length:`short`,pattern:`[0-9a-f]{12}`},uuid_shorter:{length:`shorter`,pattern:`[0-9a-f]{8}`}},kk=e=>e.replace(Dk,``),Ak=(e,t=[])=>{let n=e.split(`/`).pop(),r=n.lastIndexOf(`.`),i=r===-1?``:n.slice(r+1),a=r===-1?n:n.slice(0,r),o=t.find(e=>a.endsWith(`.${e}`));return o&&(a=a.slice(0,-(o.length+1))),{filename:a,extension:i}},jk=({_i18n:e})=>e?.structureMap?.i18nMultiFile?e.allLocales:[],Mk=(e,t)=>JE(e).replace(wSe,t),Nk={slug_length:!1,slug_editor_tag:!1,yaml_quote:!1,save_all_locales:!1,automatic_deployments:!1,multiple_folders_i18n_root:!1,omit_default_locale_from_filename:!1,logo_url:!1},ESe={slug_length:"The `slug_length` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `slug.maxlength` option instead. ",slug_editor_tag:"The `{{fields._slug}}` and `{{fields._slug | localize}}` slug template tags are deprecated and will be removed in Sveltia CMS 1.0. Use the `slug` collection option’s object form instead: `{{fields._slug}}` is equivalent to `slug: { editable: true }`, and `{{fields._slug | localize}}` is equivalent to `slug: { editable: true, i18n: true }`. https://sveltiacms.app/en/docs/collections/entries/slugs#making-slugs-editable",yaml_quote:"The `yaml_quote` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `output.yaml.quote` option instead. `yaml_quote: true` is equivalent to `quote: double`. https://sveltiacms.app/en/docs/data-output#controlling-data-output",save_all_locales:"The `save_all_locales` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `initial_locales` option instead. `save_all_locales: false` is equivalent to `initial_locales: all`. https://sveltiacms.app/en/docs/i18n/options#disabling-non-default-locale-content",automatic_deployments:"The `automatic_deployments` backend option is deprecated and will be removed in Sveltia CMS 1.0. Use the `skip_ci` option instead. `automatic_deployments: false` is equivalent to `skip_ci: true`, and `automatic_deployments: true` is equivalent to `skip_ci: false`. https://sveltiacms.app/en/docs/deployments#disabling-automatic-deployments",multiple_folders_i18n_root:"The `multiple_folders_i18n_root` i18n structure is deprecated and will be removed in Sveltia CMS 1.0. Use the `multiple_root_folders` structure instead. https://sveltiacms.app/en/docs/i18n/structures#multiple-root-folders",omit_default_locale_from_filename:"The `omit_default_locale_from_filename` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `omit_default_locale_from_file_path` option instead. https://sveltiacms.app/en/docs/i18n/structures",logo_url:"The `logo_url` option is deprecated and will be removed in a future version of Sveltia CMS. Use the `logo.src` option instead. https://sveltiacms.app/en/docs/customization#custom-logo"},Pk=(e,t)=>{Nk[e]||(console.warn(t??ESe[e]),Nk[e]=!0)},DSe=`_index`,Fk=new WeakMap,Ik=e=>{if(!ak(e))return;let{index_file:t}=e;if(t)return(t===!0?void 0:t.name)??DSe},Lk=e=>{let t=Fk.get(e);if(t&&t.locale===Fc.current)return t.indexFile;let n=Ik(e),r;if(n!==void 0){let{index_file:t}=e,i=t===!0?{}:t;r={...i,name:n,label:i.label||X(`index_file`),icon:i.icon??`home`}}return Fk.set(e,{locale:Fc.current,indexFile:r}),r},Rk=(e,t)=>{let n=Ik(e);if(n===void 0)return!1;let r=e._file?.fullPathRegEx;return!!r&&t.match(r)?.groups?.subPath===n},zk=(e,t)=>{let n=Ik(e);if(n===void 0)return!1;let r=Object.values(t.locales??{})[0]?.path;return r===void 0?t.slug===n:Rk(e,r)},Bk=[`markdown`,`md`,`mdown`,`mdwn`,`mdx`,`mkd`,`mkdn`,`html.md`],OSe={raw:`txt`,yaml:`yml`,yml:`yml`,toml:`toml`,json:`json`},Vk={yaml:`yaml`,yml:`yaml`,toml:`toml`,json:`json`,astro:`raw`},Hk={"json-frontmatter":[`{`,`}`],"toml-frontmatter":[`+++`,`+++`],"yaml-frontmatter":[`---`,`---`]},Uk=[`yaml-frontmatter`,`toml-frontmatter`,`json-frontmatter`],Wk=[`yml`,`yaml`,`toml`,`json`,`frontmatter`,...Uk,`raw`],Gk=[`toml`,`toml-frontmatter`],Kk={yml:`yaml`,yaml:`yaml`,toml:`toml`,json:`json`,frontmatter:`yaml`,"yaml-frontmatter":`yaml`,"toml-frontmatter":`toml`,"json-frontmatter":`json`},qk=e=>Object.hasOwn(Kk,e)?Kk[e]:void 0,Jk=e=>typeof e==`string`&&!!e.trim(),Yk=e=>typeof e==`string`&&/^https?:\/\//i.test(e.trim())&&QE(e.trim()),Xk=e=>e.replace(/&(?![a-zA-Z0-9#]+;)/g,`&`).replaceAll(`"`,`"`),kSe={"&":`&`,"<":`<`,">":`>`},Zk=e=>e.replace(/[&<>]/g,e=>kSe[e]),Qk={ALLOWED_TAGS:[`a`],ALLOWED_ATTR:[`href`,`target`,`rel`]},$k=(e,t)=>_t(e.replace(`<a>`,`<a href="${Xk(t)}" target="_blank" rel="noopener noreferrer">`),Qk),eA=(e,{allowedTags:t=[`strong`,`em`,`del`,`code`,`a`],allowedAttr:n=[`href`]}={})=>_t(vr(e),{ALLOWED_TAGS:t,ALLOWED_ATTR:n}),tA=e=>eA(e.replaceAll(`\\n`,`<br>`),{allowedTags:[`strong`,`em`,`del`,`code`,`a`,`br`]}),nA=[`index`,`_index`],ASe=[...Bk,...Object.keys(Vk)],jSe=e=>{if(typeof e!=`string`||!e.trim())return;let t=XE(e.trim()),{filename:n,extension:r}=bk(t);return r!==void 0&&ASe.includes(r)?n:t},rA=WO(``),iA=e=>{let t=e;if(!ak(t))return;let{nested:n}=t;if(!n||typeof n!=`object`)return;let{depth:r,summary:i,subfolders:a}=n;return{depth:typeof r==`number`&&r>=1?Math.floor(r):1/0,summary:Jk(i)?i:void 0,subfolders:a!==!1}},aA=e=>!!iA(e),oA=e=>{if(!aA(e))return;let t=e.meta?.path;if(t&&typeof t==`object`)return{indexFileName:jSe(t.index_file)}},sA=e=>aA(e)?oA(e)?.indexFileName:void 0,cA=e=>iA(e)?.subfolders===!1?void 0:oA(e)?.indexFileName,lA=(e,t)=>{let n=cA(e);return n&&t.endsWith(`/${n}`)?t.slice(0,-n.length-1):t},uA=({collection:e,isNew:t,originalPath:n,currentPath:r})=>r===void 0?!1:t&&cA(e)?!0:!!XE(r)||!!XE(n??``),dA=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)},fA=(e,t)=>!e||t.startsWith(`${e}/`),MSe=({collection:e,entries:t,dirPath:n})=>{if(!aA(e))return!1;let r=XE(n);return!r||t.some(({subPath:e})=>fA(r,e))},pA=({collection:e,entries:t,dirPath:n})=>{let r=iA(e);if(!r)return t;let{subfolders:i}=r,a=XE(n);return t.filter(({subPath:e})=>{if(!fA(a,e))return!1;let t=(a?e.slice(a.length+1):e).split(`/`).length;return i?a?t===2:t<=2:t===1})},mA=(e,t,n)=>{let r=e;return r.has(t)||r.set(t,n()),r.get(t)},hA=(e,t)=>{let n=e.get(t);return e.delete(t),e.set(t,n),n},gA=(e,t,n,r)=>{e.delete(t),e.set(t,n),e.size>r&&e.delete(e.keys().next().value)},_A=e=>{let t=new Map;return{has:e=>t.has(e),get:e=>t.has(e)?hA(t,e):void 0,set:(n,r)=>{gA(t,n,r,e)},clear:()=>{t.clear()}}},vA=(e,t,n,r)=>{if(e.has(t))return hA(e,t);let i=n();return gA(e,t,i,r),i},yA=(e,t,n)=>mA(e,t,()=>n().finally(()=>{e.delete(t)})),bA=(e,t,n)=>mA(e,t,()=>n().catch(n=>{throw e.delete(t),n})),xA=(e,t)=>{let n;return()=>{let r=e();return n&&n.source===r||(n={source:r,value:t(r)}),n.value}},NSe=/(?:^|\/){{locale}}(?:\/|$)/,SA=e=>e.includes(`{{locale}}`),PSe=e=>e.split(`{{locale}}`).length===2&&NSe.test(e),CA=e=>{let t=e.indexOf(`{{locale}}`);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+10);if(n===``||n.endsWith(`/`))return r.startsWith(`/`)?`${n}${r.slice(1)}`:r===``?n.endsWith(`//`)?void 0:n.length>1?n.slice(0,-1):n:/^\.(?:[^./][^/]*\.|{{)/.test(r)?`${n}${r.slice(1)}`:void 0;if(/[^/]\.$/.test(n)&&/^(?:[./]|$)/.test(r))return`${n.slice(0,-1)}${r}`},wA=e=>CA(e)!==void 0,TA=({path:e,locale:t,omitLocale:n=!1})=>(n&&(e=CA(e)??e),e.replaceAll(`{{locale}}`,t)),EA=(e,t)=>`${e}/`.split(`{{locale}}/`).map(JE).join(t),FSe=new Map,ISe=(e,t)=>e.replace(mA(FSe,t,()=>RegExp(`^${EA(t,`(?:[^/]+\\/)?`)}`)),``),LSe={type:`language`,languageDisplay:`standard`,style:`short`,fallback:`none`},DA=e=>{let t;if(e!==`_default`)try{[t]=Intl.getCanonicalLocales(e)}catch{}return t},OA=e=>e===`_default`?`auto`:Pc(e)?`rtl`:`ltr`,RSe=new Map,kA=(e,{displayLocale:t=DA(Fc.current??`en`),formatterOptions:n=LSe}={})=>{let r=DA(e);if(!r)return;let i=t?mA(RSe,t,()=>new Intl.DisplayNames(t,n)):new Intl.DisplayNames(void 0,n);try{let e=i.of(r);if(!e)return;let[n,...a]=e;return[n.toLocaleUpperCase(t),...a].join(``)}catch(e){console.error(e);return}},zSe=new Map,AA=(e,t={})=>{let n={style:`narrow`,type:`conjunction`,...t};return mA(zSe,`${e}|${n.style}|${n.type}`,()=>{let t=new Intl.ListFormat(DA(e),n);return{format:e=>t.format([...e].filter(e=>e!=null).map(e=>`${e}`))}})},jA=({_i18n:e,locale:t,path:n})=>{let{defaultLocale:r,omitDefaultLocaleFromFilePath:i}=e;return TA({path:n,locale:t,omitLocale:i&&t===r})},MA=({extension:e,format:t})=>(t?IO.get(t)?.extension:void 0)||e||(t?OSe[t]??`md`:`md`),NA=({extension:e,format:t})=>t||(Bk.includes(e)?`frontmatter`:Vk[e]??`yaml-frontmatter`),BSe=({subPath:e,indexFileName:t,nestedDepth:n,entrySuffix:r=``,indexSuffix:i=``})=>{let a=t?JE(t):``,o=!!a&&!!i,s=a&&!o?`|${a}`:``,c;if(!e)c=n===void 0?`[^/]+?`:`[^/]+?(?:\\/[^/]+?)${Number.isFinite(n)?`{0,${Math.max(0,n-1)}}`:`*`}`;else{let t=`${Mk(e,`[^/]+?`)}${s}`;if(n===void 0)c=t;else{let r=Number.isFinite(n)?Math.max(0,n-e.split(`/`).length):void 0;c=`${r===void 0?`(?:[^/]+\\/)*`:`(?:[^/]+\\/){0,${r}}`}(?:${t})`}}return o?`(?<subPath>${`(?!${a}${r})`}(?:${c})${r}|${a}${i})`:`(?<subPath>${c})`},VSe=({extension:e,format:t,basePath:n,subPath:r,indexFileName:i,indexFileExtension:a,nestedDepth:o,_i18n:s})=>{let{allLocales:c,defaultLocale:l,omitDefaultLocaleFromFilePath:u,structureMap:{i18nMultiFile:d,i18nMultiFolder:f,i18nMultiRootFolder:p}}=s,m=c.map(JE).join(`|`),h=c.filter(e=>e!==l).map(JE).join(`|`),g=`(?<locale>${m})`,_=u?`(?:(?<locale>${h})\\/)?`:`${g}\\/`,v=u?`(?:\\.(?<locale>${h}))?`:`\\.${g}`,y=!!n&&SA(n),b=y?EA(n,_):n?`${JE(n)}\\/`:``,x=MA({format:t,extension:e}),S=i&&a!==void 0&&a!==x?a:void 0,C=e=>{let t=u?`(?:\\.(?:${h}))?`:`\\.(?:${m})`;return`(?=${d?t:``}\\.${JE(e)}$)`},w=[`^`,p&&!y?_:``,b,f&&!y?_:``,BSe({subPath:r,indexFileName:i,nestedDepth:o,entrySuffix:S?C(x):``,indexSuffix:S?C(S):``}),d?v:``,`\\.`,S?`(?:${JE(x)}|${JE(S)})`:JE(x),`$`].join(``);return new RegExp(w)},PA=({format:e,delimiter:t})=>Jk(t)?[t,t]:Array.isArray(t)&&t.length===2?t:Hk[e]??void 0,HSe=({indexFile:e,extension:t,format:n})=>{if(!e)return;let{extension:r,format:i}=e;if(r===void 0&&i===void 0)return;let a=MA({extension:r,format:i}),o=NA({extension:a,format:i}),s=MA({extension:t,format:n}),c=NA({extension:s,format:n});if(a!==s||o!==c)return{extension:a,format:o}},FA=({rawCollection:e,file:t,_i18n:n})=>{let{folder:r,file:i,path:a,extension:o,format:s,frontmatter_delimiter:c,body_field:l,yaml_quote:u}=e,d=ak(e),f=d&&typeof i==`string`,p=t?.file?XE(t.file):f?XE(i):void 0,m=p?bk(p).extension:o,h=t?.format??s,g=MA({format:h,extension:m}),_=NA({format:h,extension:g}),v=t?.frontmatter_delimiter??c,y=d&&!f,b=y?XE(r):void 0,x=y?Lk(e):void 0,S=x?.name,C=y?iA(e)?.depth:void 0,w=HSe({indexFile:x,extension:o,format:s});u!==void 0&&Pk(`yaml_quote`);let T={extension:g,format:_,basePath:b,subPath:y?a:void 0,fullPathRegEx:b===void 0?void 0:VSe({extension:g,format:_,basePath:b,subPath:a,indexFileName:S,indexFileExtension:w?.extension,nestedDepth:C,_i18n:n}),fullPath:p?jA({_i18n:n,locale:n.defaultLocale,path:p}):void 0,fmDelimiters:PA({format:_,delimiter:v}),bodyField:t?.body_field??l,yamlQuote:!!u};return f&&(T.arrayFile=!0),w&&(T.indexFile={...T,...w,fmDelimiters:PA({format:w.format,delimiter:v})}),T},IA=({collection:e,collectionFile:t,isIndexFile:n=!1})=>{let{_file:r}=t??e;return(n?r.indexFile:void 0)??r},LA={SINGLE_FILE:`single_file`,SINGLE_FILE_DEFAULT_ROOT:`single_file_default_root`,MULTIPLE_FILES:`multiple_files`,MULTIPLE_FOLDERS:`multiple_folders`,MULTIPLE_FOLDERS_I18N_ROOT:`multiple_folders_i18n_root`,MULTIPLE_ROOT_FOLDERS:`multiple_root_folders`},USe=[LA.MULTIPLE_FOLDERS_I18N_ROOT,LA.MULTIPLE_ROOT_FOLDERS],RA={key:`translationKey`,value:`{{slug}}`},zA=({cmsConfig:e,collection:t,file:n})=>{let r=e?.i18n;if(!D(r))return;let i=structuredClone(r),{name:a,i18n:o}=t;if(o||a===`_singletons`){if(D(o)&&Object.assign(i,o),n){if(!n.i18n)return;D(n.i18n)&&Object.assign(i,n.i18n)}return i}},WSe=e=>e?.omit_default_locale_from_file_path??e?.omit_default_locale_from_filename??!1,GSe={i18nEnabled:!1,saveAllLocales:!0,allLocales:[`_default`],initialLocales:[`_default`],defaultLocale:`_default`,structure:LA.SINGLE_FILE,structureMap:{i18nSingleFile:!1,i18nSingleFileDefaultRoot:!1,i18nMultiFile:!1,i18nMultiFolder:!1,i18nMultiRootFolder:!1},canonicalSlug:{...RA},omitDefaultLocaleFromFilePath:!1,omitDefaultLocaleFromPreviewPath:!1},BA=e=>(e?.collectionFile??e?.collection)?._i18n??GSe,KSe=(e,t,n,r)=>!t&&typeof r!=`string`?typeof n==`string`&&SA(n)?LA.MULTIPLE_FOLDERS:e:t?.file.includes(`{{locale}}`)?LA.MULTIPLE_FILES:e===LA.SINGLE_FILE_DEFAULT_ROOT?LA.SINGLE_FILE_DEFAULT_ROOT:LA.SINGLE_FILE,qSe=(e,t)=>({i18nSingleFile:e&&t===LA.SINGLE_FILE,i18nSingleFileDefaultRoot:e&&t===LA.SINGLE_FILE_DEFAULT_ROOT,i18nMultiFile:e&&t===LA.MULTIPLE_FILES,i18nMultiFolder:e&&t===LA.MULTIPLE_FOLDERS,i18nMultiRootFolder:e&&(t===LA.MULTIPLE_FOLDERS_I18N_ROOT||t===LA.MULTIPLE_ROOT_FOLDERS)}),VA=({i18nSingleFile:e,i18nSingleFileDefaultRoot:t})=>!!e||!!t,HA=({i18nMultiFile:e,i18nMultiFolder:t,i18nMultiRootFolder:n})=>!!e||!!t||!!n,JSe=(e,t,n)=>e?n&&t.includes(n)?n:t[0]:`_default`,YSe=(e,t,n)=>e===`all`?t:e==="default"?[n]:t.filter(t=>t===n||!Array.isArray(e)||e.includes(t)),XSe=(e,t,n)=>e?n?wA(n.file):HA(t):!1,UA=(e,t)=>{let n=zA({cmsConfig:$O.current,collection:e,file:t}),{structure:r=LA.SINGLE_FILE,locales:i=[],default_locale:a,initial_locales:o,save_all_locales:s=!0,canonical_slug:c={key:void 0,value:void 0},omit_default_locale_from_filename:l,omit_default_locale_from_file_path:u=l??!1,omit_default_locale_from_preview_path:d=!1}=n??{};n?.save_all_locales!==void 0&&Pk(`save_all_locales`),l!==void 0&&Pk(`omit_default_locale_from_filename`);let{key:f=RA.key,value:p=RA.value}=c,m=i.length>0,h=m?i:[`_default`],g=JSe(m,h,a),{folder:_,file:v}=e,y=KSe(r,t,_,v),b=qSe(m,y),x=!m||s===!0&&o===void 0,S=YSe(o,h,g),C=XSe(u,b,t);return y===`multiple_folders_i18n_root`&&Pk(`multiple_folders_i18n_root`),{i18nEnabled:m,saveAllLocales:x,allLocales:h,defaultLocale:g,initialLocales:S,structure:y,structureMap:b,canonicalSlug:{key:f,value:p},omitDefaultLocaleFromFilePath:C,omitDefaultLocaleFromPreviewPath:d}},WA=WO(),GA=new Map,KA=({collections:e=$O.current?.collections??[],visible:t,type:n}={})=>e.filter(e=>pSe(e,{visible:t,type:n})),ZSe=()=>KA({visible:!0})[0],QSe=e=>{if(!ak(e))return[];let{fields:t,thumbnail:n=!0}=e;return n===!1?[]:typeof n==`string`?[n]:Array.isArray(n)?n:t?.length?t.filter(({widget:e=`string`})=>mk.includes(e)).map(({multiple:e,name:t})=>e?`${t}.*`:t):[]},$Se=(e,t)=>({...e,_i18n:t,_type:`entry`,_file:FA({rawCollection:e,_i18n:t}),_thumbnailFieldNames:QSe(e)}),qA=(e,t,n)=>({...e,_i18n:t,_type:sk(e)?`singleton`:`file`,_fileMap:Object.fromEntries(n.filter(lk).map(t=>{let n=UA(e,t),r=FA({rawCollection:e,file:t,_i18n:n});return[t.name,{...t,_file:r,_i18n:n}]}))}),JA=()=>{let e=$O.current?.singletons;if(!Array.isArray(e))return;let t=uk(e).map(e=>({...e,file:XE(e.file)}));if(!t.length)return;let n={name:`_singletons`,files:t};return qA(n,UA(n),t)},YA=e=>{let t=GA.get(e);if(t)return t;if(e===`_singletons`){let t=JA();return GA.set(e,t),t}let n=KA().find(t=>t.name===e);if(!n){GA.set(e,void 0);return}let r=ak(n)?n:void 0,i=ok(n)?n:void 0;if(!r&&!i){GA.set(e,void 0);return}r?(typeof r.folder==`string`&&(r.folder=XE(r.folder)),typeof r.file==`string`&&(r.file=XE(r.file))):i?.files.forEach(e=>{e.file&&=XE(e.file)});let a=UA(n),o=r?$Se(r,a):qA(i,a,i.files);return GA.set(e,o),o},XA=(e,{useSingular:t=!1}={})=>{let{_type:n,name:r,label:i,label_singular:a}=e;return n===`singleton`?X(`files`):t&&a?a:i||r},ZA=e=>e?e===`_singletons`?9999999:$O.current?.collections?.findIndex(({name:t})=>t===e)??-1:-1,QA=WO(!1),$A=WO(),ej=WO([]),tj=WO([]),eCe=xA(()=>tj.current,e=>{let t=new Map;return e.forEach((e,n)=>{Object.values(e.locales).forEach(({path:r})=>{t.has(r)||t.set(r,{entry:e,index:n})})}),t}),nj=e=>{let t=eCe(),n;return[...e].forEach(e=>{let r=t.get(e);r&&(!n||r.index<n.index)&&(n=r)}),n?.entry},rj=WO([]),ij=(e,t)=>{let n=typeof e==`string`?YA(e):e;if(n&&`_fileMap`in n&&Object.hasOwn(n._fileMap,t))return n._fileMap[t]},aj=(e,t)=>{let n=YA(e);if(!n)return;let r=t?ij(n,t):void 0;if(!t||r)return{collection:n,collectionFile:r}},oj=e=>e.label||e.name,sj=(e,t)=>`_fileMap`in e?Object.values(e._fileMap).filter(({file:e,_file:n,_i18n:r})=>Object.entries(t.locales).some(([t,{path:i}])=>i===(t===r.defaultLocale?n.fullPath:jA({_i18n:r,locale:t,path:XE(e)})))):[],cj=(e,t)=>{let n=ej.current.find(({collectionName:n,fileName:r})=>n===e&&r===t);if(n?.filePathMap)return nj(Object.values(n.filePathMap))},lj=(e,t)=>{if(e&&t){let{collections:n,singletons:r}=$O.current;if(e===`_singletons`)return Array.isArray(r)?uk(r).findIndex(e=>e.name===t):-1;let i=KA({collections:n}).find(({name:t})=>t===e);if(i&&`files`in i)return i.files.findIndex(({name:e})=>e===t)}return-1},uj=e=>JE(e).replaceAll(`\\*`,`\\d+`),dj=(e,t)=>e===t||e.startsWith(`${t}.`),fj=new WeakMap,tCe=e=>{let t=fj.get(e);return t||(t=Object.keys(e).map((e,t)=>[e,t]).sort(([e],[t])=>e<t?-1:1),fj.set(e,t)),t},pj=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.startsWith(t));let r=tCe(e),i=0,a=r.length;for(;i<a;){let e=Math.floor((i+a)/2);r[e][0]<t?i=e+1:a=e}let o=[];for(let e=i;e<r.length&&r[e][0].startsWith(t);e+=1)o.push(r[e]);return o.sort(([,e],[,t])=>e-t).map(([e])=>e)},mj=/\.\d+$/,hj=/^(?<parent>.+)\.\d+$/,gj=new WeakMap,_j=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.match(hj)?.groups?.parent===t);let r=gj.get(e);return r||(r=new Map,Object.keys(e).forEach(e=>{let{parent:t}=e.match(hj)?.groups??{};if(t===void 0)return;let n=r.get(t);n?n.push(e):r.set(t,[e])}),gj.set(e,r)),r.get(t)??[]};function vj(e){return e&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function yj(e){return e}function nCe(e,t){t||={};let n=t.delimiter||`.`,r=t.maxDepth,i=t.transformKey||yj,a={};function o(e,s,c){c||=1,Object.keys(e).forEach(function(l){let u=e[l],d=t.safe&&Array.isArray(u),f=Object.prototype.toString.call(u),p=vj(u),m=f===`[object Object]`||f===`[object Array]`,h=s?s+n+i(l):i(l);if(!d&&!p&&m&&Object.keys(u).length&&(!t.maxDepth||c<r))return o(u,h,c+1);a[h]=u})}return o(e),a}function bj(e,t){t||={};let n=t.delimiter||`.`,r=t.overwrite||!1,i=t.transformKey||yj,a={};if(vj(e)||Object.prototype.toString.call(e)!==`[object Object]`)return e;function o(e){let n=Number(e);return isNaN(n)||e.indexOf(`.`)!==-1||t.object?e:n}function s(e,t,r){return Object.keys(r).reduce(function(t,i){return t[e+n+i]=r[i],t},t)}function c(e){let t=Object.prototype.toString.call(e),n=t===`[object Array]`,r=t===`[object Object]`;if(!e)return!0;if(n)return!e.length;if(r)return!Object.keys(e).length}return e=Object.keys(e).reduce(function(n,r){let i=Object.prototype.toString.call(e[r]);return i!==`[object Object]`&&i!==`[object Array]`||c(e[r])?(n[r]=e[r],n):s(r,n,nCe(e[r],t))},{}),Object.keys(e).forEach(function(s){let c=s.split(n).map(i),l=o(c.shift()),u=o(c[0]),d=a;for(;u!==void 0;){if(l===`__proto__`)return;let e=Object.prototype.toString.call(d[l]),n=e===`[object Object]`||e===`[object Array]`;if(!r&&!n&&d[l]!==void 0)return;(r&&!n||!r&&d[l]==null)&&(d[l]=typeof u==`number`&&!t.object?[]:{}),d=d[l],c.length>0&&(l=o(c.shift()),u=o(c[0]))}d[l]=bj(e[s],t)}),a}var rCe=``,iCe=``,aCe=/[.\uE000\uE001]/g,oCe=/\uE001([\uE000\uE001])|\uE000/g,xj=/[\uE000\uE001]/,Sj=`\0`,Cj=/^(?:0|[1-9]\d*)$/,wj=e=>!Number.isNaN(Number(e))&&!Cj.test(e),sCe=e=>wj(e)?`${Sj}${e}`:e,Tj=e=>D(e)&&[Object.prototype,null].includes(Object.getPrototypeOf(e)),Ej=e=>Array.isArray(e)?(e.forEach((t,n)=>{e[n]=Ej(t)}),e):Tj(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e.startsWith(Sj)?e.slice(1):e,Ej(t)])):e,Dj=e=>e.includes(`.`)||xj.test(e)?e.replace(aCe,e=>e===`.`?rCe:`${iCe}${e}`):e,Oj=e=>xj.test(e)?e.replace(oCe,(e,t)=>t??`.`):e,kj=e=>[`[object Object]`,`[object Array]`].includes(Object.prototype.toString.call(e))&&!!Object.keys(e).length,cCe=e=>Object.prototype.toString.call(e)===`[object Object]`&&Object.keys(e).some(e=>Cj.test(e)),lCe=(e,t)=>{let n=`${t}.`;return Object.keys(e).some(e=>e.startsWith(n)&&Cj.test(e.slice(n.length).split(`.`)[0]))},Aj=(e,t)=>{let n={},r=(e,t)=>{t!==void 0&&cCe(e)&&(n[t]={}),Object.entries(e).forEach(([e,i])=>{let a=Dj(e),o=t===void 0?a:`${t}.${a}`;kj(i)?r(i,o):n[o]=i})};return kj(e)?r(e,t):t!==void 0&&(n[t]=e),n},uCe=e=>sCe(Oj(e)),jj=e=>{let t=Object.entries(e);return t.some(([,e])=>kj(e))?jj(Object.fromEntries(t.flatMap(([e,t])=>kj(t)?Object.entries(Aj(t,e)):[[e,t]]))):t.some(([e])=>xj.test(e)||e.split(`.`).some(wj))?Ej(bj(e,{transformKey:uCe})):bj(e)},Mj=e=>e?jj(Object.fromEntries(Object.entries(e).sort(([e],[t])=>$E(e,t)))):bj(e),Nj=e=>e==null||e===``||Array.isArray(e)&&!e.length||Tj(e)&&!Object.keys(e).length,Pj=e=>Array.isArray(e)&&!e.length||D(e)&&!Object.keys(e).length,Fj=(e,t)=>({[e]:Array.isArray(t)?[]:{},...Aj(t,e)}),Ij=(e,t,{live:n=!1}={})=>{let r=pj(e,`${t}.`,{live:n});if(!r.length)return;let i=r.map(n=>[`_${n.slice(t.length)}`,e[n]]),a=e[t];return Pj(a)&&i.push([`_`,a]),Mj(Object.fromEntries(i))._},dCe=e=>typeof e==`object`&&e?Array.isArray(e)?`\0[]`:`\0{}`:e,Lj=(e,t,n)=>{let r=pj(t,`${n}.`),i=[...r,n].map(e=>dCe(t[e])),a=e.keys,o=e.values;return e.keyPath===n&&a.length===r.length&&r.every((e,t)=>e===a[t])&&i.every((e,t)=>e===o[t])||Object.assign(e,{keyPath:n,keys:r,values:i,subtree:Ij(t,n)}),e.subtree},Rj=(e,t)=>{Object.keys(e).forEach(n=>{dj(n,t)&&delete e[n]})},fCe=(e,t,n)=>{Rj(e,t),Object.assign(e,Fj(t,n))},zj=e=>!!e&&`type`in e&&e.type===`inline`,pCe=({source:e,flags:t})=>new RegExp(e.startsWith(`^`)?e.slice(1):e,t.replace(/[gy]/g,``)),mCe=e=>{let{id:t,label:n,icon:r,pattern:i,trigger:a,toPreview:o,onInsert:s,onEdit:c}=e,{fromBlock:l,toBlock:u}=e,d=e.fromInline??l,f=e.toInline??u;return{id:t,label:n,icon:r,fields:[],pattern:pCe(i),fromBlock:d,toBlock:f,toPreview:o,inlinePattern:{trigger:a||void 0,onInsert:s,onEdit:c}}},hCe=new WeakMap,gCe=(e,t)=>{let n=t?`sticky`:`global`,r=mA(hCe,e,()=>({}));return r[n]??=new RegExp(e.source,`${e.flags}${t?`y`:`g`}`),r[n]},Bj=(e,t,{trigger:n}={},r=1/0)=>{let i=gCe(t,!!n),a=[],o=n?e.indexOf(n):0;for(;o!==-1&&a.length<r;){i.lastIndex=o;let t=i.exec(e);if(!t&&!n)break;let r;t?.[0]?(a.push(t),r=t.index+t[0].length):r=(t?.index??o)+1,o=n?e.indexOf(n,r):r<=e.length?r:-1}return a},_Ce=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>Bj(n,e,t,1)[0]??null}),Vj=e=>e.startsWith(`__sc_`),Hj=({multiline:e,dotAll:t,source:n})=>e||t||n.includes(`[\\s\\S]`)||n.includes(`[\\S\\s]`),Uj=({pattern:e,inlinePattern:t})=>!!t||!Hj(e),vCe=e=>{let t=[],n=0,r=``,i=0,a=!1;return[...e,`,`].forEach((o,s)=>{r?o===r&&(r=``):n===0&&o===`,`?(t.push(e.slice(i,s).trim()),i=s+1,a=!1):n===0&&/[\s>+~]/.test(o)?a=!0:(a&&=(i=s,!1),o===`"`||o===`'`?r=o:o===`(`||o===`[`?n+=1:(o===`)`||o===`]`)&&--n)}),t},Wj=e=>{let t=vCe(e).map(e=>/^[a-z][a-z\d-]*(?![\w-])/i.exec(e)?.[0].toLowerCase()??``);return t.every(Boolean)?[...new Set(t)]:void 0},yCe=e=>{try{return document.createDocumentFragment().querySelector(e),!0}catch{return!1}},Gj=({htmlSelector:e,fromBlockHTML:t,toBlockHTML:n})=>typeof e==`string`&&typeof t==`function`&&typeof n==`function`,Kj=e=>jj(Object.fromEntries(Object.entries(Aj(e)).filter(([e])=>!Vj(e.split(`.`).pop())))),bCe=e=>{let t=e?.parentElement?.closest(`[data-component-path]`);return t?JSON.parse(t.dataset.componentPath):[]},xCe=(e,t)=>{let n=e?.closest(`[role="textbox"]`);if(!n)return;let r=()=>{t(n.getAttribute(`aria-readonly`)===`true`)},i=new MutationObserver(r);return r(),i.observe(n,{attributes:!0,attributeFilter:[`aria-readonly`]}),i},qj=(e,t)=>{let n,r=window.requestAnimationFrame(()=>{n=xCe(e,t)});return()=>{window.cancelAnimationFrame(r),n?.disconnect()}},Jj=e=>e.replace(/\\([!-/:-@[-`{-~])/g,`$1`),Yj=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/"/g,`\\"`),SCe=[String.raw`(?:[^\][\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\[(?:[^\][\\!]|\\(?!!\[).|!(?!\[))*\])*`].join(``),CCe=[String.raw`(?:[^"()\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\((?:[^)!]|!(?!\[))*\)|"(?:[^"!]|!(?!\[))*")*?`].join(``),Xj=e=>String.raw`(?:[^${e}\\!]|\\(?!!\[).|!(?!\[))*`,Zj=(e=``)=>[String.raw`!\[(?<alt${e}>${SCe})\]\((?<src${e}>${CCe})`,String.raw`(?:(?<![^\\]\s)\s+(?:"(?<title${e}>${Xj(`"`)})"`,String.raw`|'(?<singleQuotedTitle${e}>${Xj(`'`)})'))?\)`].join(``),Qj=new RegExp(Zj()),wCe=new RegExp(String.raw`\[${Zj(`2`)}\](?:\((?<link>[^()]*(?:\([^)]*\)[^)]*|\([^)]*)?)\))`),$j=RegExp(`${Qj.source}|${wCe.source}`),eM=e=>({src:e.getAttribute(`src`)??``,alt:e.getAttribute(`alt`)??``,title:e.getAttribute(`title`)??``}),tM=({src:e=``,alt:t=``,title:n=``})=>{if(!e)return``;let r=document.createElement(`img`);return r.setAttribute(`src`,e),r.setAttribute(`alt`,t),n&&r.setAttribute(`title`,n),r},nM={id:`image`,label:`Image`,fields:[{name:`src`,label:`Source`,widget:`image`},{name:`alt`,label:`Alt Text`,required:!1},{name:`title`,label:`Title`,required:!1}],pattern:Qj,fromBlock:e=>{let{src:t,alt:n,title:r=e.groups?.singleQuotedTitle}=e.groups??{};return{src:t,alt:n,title:r&&Jj(r)}},toBlock:e=>{let{src:t=``,alt:n=``,title:r=``}=e;return t?`}"`:``})`:``},toPreview:e=>{let{src:t=``,alt:n=``,title:r=``}=e;return`<img src="${Xk(t)}" alt="${Xk(n)}" title="${Xk(r)}">`},htmlSelector:`img`,fromBlockHTML:eM,toBlockHTML:tM},TCe={id:`linked-image`,label:`Image`,fields:[...nM.fields,{name:`link`,label:`Link`,required:!1}],pattern:$j,fromBlock:e=>{let{src:t,alt:n,title:r,singleQuotedTitle:i,src2:a,alt2:o,title2:s,singleQuotedTitle2:c,link:l}=e.groups??{};return{src:(t||a||``).trim(),alt:(n||o||``).trim(),title:Jj(r||i||s||c||``).trim(),link:(l||``).trim()}},toBlock:e=>{let{src:t=``,alt:n=``,title:r=``,link:i=``}=e,a=t?`}"`:``})`:``;return a&&i?`[${a}](${i})`:a},toPreview:e=>{let{src:t=``,alt:n=``,title:r=``,link:i=``}=e,a=`<img src="${Xk(t)}" alt="${Xk(n)}" title="${Xk(r)}">`;return i?`<a href="${Xk(i)}">${a}</a>`:a},htmlSelector:`a:has(> img:only-child), img`,fromBlockHTML:e=>{if(e.localName===`img`)return{...eM(e),link:``};if(!e.textContent?.trim())return{...eM(e.querySelector(`img`)),link:e.getAttribute(`href`)??``}},toBlockHTML:e=>{let{link:t=``}=e,n=tM(e);if(!n||!t)return n;let r=document.createElement(`a`);return r.setAttribute(`href`,t),r.append(n),r}},ECe=()=>{let e={icon:`image`,label:X(`editor_components.image`),fields:[{name:`src`,label:X(`editor_components.src`),widget:`image`},{name:`alt`,label:X(`editor_components.alt`),required:!1},{name:`title`,label:X(`editor_components.title`),required:!1}],trigger:`button`,createMarkdown:()=>`![]()`};return[{...nM,...e},{...TCe,...e,fields:[...e.fields,{name:`link`,label:X(`editor_components.link`),required:!1}]}]},rM=e=>{if(!e)return;if(NO.has(e))return e;let t=e.replace(/^x-/,``);return t!==e&&NO.has(t)?t:void 0},iM=e=>{let t=rM(e);if(t){let e=NO.get(t),n=zj(e)?mCe(e):e;return{...n,id:`x-${t}`,label:n.label??t}}return ECe().find(({id:t})=>t===e)},aM=e=>{if(!e)return;let t=Object.values(e);if(t.some(e=>e.config?.multiple===!0))return!0;if(t.some(e=>e.config?.multiple===!1))return!1},oM=e=>{if(!e?.config)return;let{multiple:t}=e.config;if(typeof t==`boolean`)return t},sM=e=>{let t=$O.current;return e.multiple??aM(e.media_libraries)??oM(e.media_library)??aM(t?.media_libraries)??oM(t?.media_library)??!1},DCe=/^\d+$/,cM=e=>DCe.test(e),lM=e=>Number.isInteger(e)?e:Number(e.toPrecision(15)),uM=(e,t)=>{let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)},dM=(e,t)=>{if(typeof e!=`number`)return NaN;if(!Number.isFinite(e))return e;let n=Math.abs(lM(e)),r=uM(Math.round(uM(n,t)),-t);return Math.sign(e)*r+0},OCe=/^(.*?)<([^>]+)>(.*)$/,fM=new Map,pM=(e,t)=>{if(e.length!==1)return!1;let[n]=e;return n.widget===t&&`root`in n&&n.root===!0},mM=e=>{let t=e.widget??`string`;return mk.includes(t)?sM(e):_k.includes(t)?!!e.multiple:!1},hM=e=>{let t=e.match(OCe);if(!t)return{cleanKey:e};let[,n,r,i]=t;return i?{cleanKey:e}:{cleanKey:n||``,typeName:r}},kCe=({field:e,key:t,keyPathArray:n,segmentIndex:r,pendingExplicitType:i,valueMap:a})=>{let{cleanKey:o,typeName:s}=hM(t),{widget:c=`text`}=e,l=s??i,u=cM(o),d=o===`*`;if((u||d)&&_k.includes(c))return{field:mM(e)?e:void 0,explicitType:l};let{field:f}=e,{fields:p}=e,{types:m,typeKey:h=`type`}=e;if(f){let e=u||d?n[r+1]:void 0;return{field:!e||f.name===e||f.widget===`object`&&`fields`in f&&f.fields?.some(t=>t.name===e)?f:void 0,explicitType:l}}if(p&&(u||d))return{field:e,explicitType:l};if(p&&!u&&o!==``)return{field:p.find(({name:e})=>e===o),explicitType:l};if(m&&(u||d)){let e=l??a[[n.slice(0,r).join(`.`),o,h].join(`.`)];return{field:m.find(({name:t})=>t===e),explicitType:d?void 0:l}}if(m&&t!==h&&o!==h&&o!==``){let e=l??a[[n.slice(0,r).join(`.`),h].join(`.`)];return{field:m.find(({name:t})=>t===e)?.fields?.find(({name:e})=>e===o),explicitType:void 0}}return{field:void 0,explicitType:l}},gM=({collectionName:e,fileName:t,isIndexFile:n},r={})=>({collectionName:e,fileName:t,isIndexFile:n,...r}),_M=e=>{let{collectionName:t,fileName:n=void 0,componentName:r=void 0,valueMap:i={},keyPath:a,isIndexFile:o=!1}=e,s=[t,n??``,r??``,a,o?`1`:`0`].join(`|`);if(fM.has(s))return fM.get(s);let c=YA(t),l=c&&n?ij(c,n):void 0;if(!c||n&&c?._type!==`entry`&&!l){fM.set(s,void 0);return}let{fields:u=[]}=l??c,d=o?Lk(c):void 0,f=r?iM(r)?.fields??[]:d?.fields??u,p=a.split(`.`),m,h,g=!1;if(p.forEach((e,t)=>{if(t===0){let{cleanKey:t,typeName:n}=hM(e);m=f.find(({name:e})=>e===t),!m&&d?.fields&&(m=u.find(({name:e})=>e===t)),n&&(h=n)}else if(m){let n=kCe({field:m,key:e,keyPathArray:p,segmentIndex:t,pendingExplicitType:h,valueMap:i});m=n.field,h=n.explicitType}m&&`types`in m&&(g=!0)}),h&&m&&`types`in m){let{types:e}=m;m=e.find(({name:e})=>e===h)}return g||fM.set(s,m),m},vM=({keyPath:e,valueMap:t={},...n})=>{let r=e.split(`.`);return r.map((e,i)=>{let a=r.slice(0,i).join(`.`),o=i?`${a}.${e}`:e;if(cM(e)){let e=_M({...n,valueMap:t,keyPath:a}),{widget:r=`text`}=e??{};if(_k.includes(r))return;let{field:i}=e??{},{types:s,typeKey:c=`type`}=e??{};if(i)return`*.${i.name}`;let l=s?t[`${o}.${c}`]:void 0;return l?`*<${l}>`:`*`}let s=_M({...n,valueMap:t,keyPath:o}),{types:c,typeKey:l=`type`}=s??{},u=s?.widget===`object`&&c?t[`${o}.${l}`]:void 0;return u?`${e}<${u}>`:e}).filter(e=>e!==void 0).join(`.`)},yM=e=>{let t=e.widget??`string`;return dk.includes(t)?`builtin`:FO.has(t)?`custom`:`unknown`},bM=({fieldConfig:{required:e=!0},locale:t})=>Array.isArray(e)?e.includes(t):!!e,xM=({valueMap:e,keyPath:t,isList:n,isCustomFieldType:r=!1})=>{let i=e[t];if(!n&&!r)return D(i)?Ij(e,t)??i:i;let a=_j(e,t);return a.length?a.map(t=>e[t]).filter(e=>e!==void 0):r?i===void 0||D(i)?Ij(e,t)??i:i:[]},SM=(e,t)=>e?.widget===`relation`&&e.collection===t,CM=(e,t)=>e.pendingEntries.filter(e=>e.collectionName===t),wM=(e,t)=>CM(e,t).filter(({baseEntry:e})=>!e),ACe=({collectionName:e,fileName:t,isIndexFile:n,currentValues:r,extraValues:i})=>[...Object.values(r).map(r=>({valueMap:r,fieldArgs:{collectionName:e,fileName:t,isIndexFile:n}})),...Object.values(i).map(e=>({valueMap:e}))],jCe=({collectionName:e,entry:t})=>Object.values(t.locales).flatMap(({content:t})=>t?[{valueMap:t,fieldArgs:{collectionName:e}}]:[]),MCe=(e,{collectionName:t,values:n})=>e.some(({valueMap:e,fieldArgs:r})=>Object.entries(e).some(([i,a])=>{if(!n.includes(a))return!1;if(!r)return!0;let o=_M({...r,valueMap:e,keyPath:i});return!o||SM(o,t)})),TM=e=>{let t=ACe(e),n=new Set,r=()=>{let r=e.pendingEntries.filter(e=>!n.has(e)&&MCe(t,e));return r.forEach(e=>{n.add(e),t.push(...jCe(e))}),r.length>0};for(;r(););return n},EM=e=>e.pendingEntries?.some(({baseEntry:e})=>!!e)?[...TM(e)].filter(({baseEntry:e})=>!!e):[],NCe=e=>{let t=TM(e);return e.pendingEntries.filter(e=>t.has(e)).map(e=>UO(e))},DM=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=e;return r??i?.find(({name:e})=>e===t[`${n}.${a}`])?.fields},OM=(e,t)=>{let n=e.find(({name:e})=>e===t);return n?n.fields??[]:void 0},kM=({value:e,fields:t,types:n,typeKey:r=`type`})=>t??(n?OM(n,e?.[r]):void 0)??[],AM=e=>{let{field:t,fields:n=[],types:r=[]}=e;return[...t?[t]:[],...n,...r.flatMap(e=>e.fields??[])]},jM=(e,t,n)=>{let r=n?.get(e);if(r!==void 0)return r;let i=t(e)||AM(e).some(e=>jM(e,t,n));return n?.set(e,i),i},MM=(e,t,n)=>{let r=t+n;for(;/\s/.test(e[r]??``);)r+=n;return e[r]??``},NM=(e,t,{unescape:n=!0}={})=>{let r=``,i=0;for(;i<e.length;){let a=e.indexOf(`{{`,i);if(a===-1){r+=e.slice(i);break}r+=e.slice(i,a);let o=a+2,s=!1;for(;o<e.length;){let c=e[o],l=e[o+1];if(c===`'`&&(!s&&[`(`,`,`].includes(MM(e,o,-1))?s=!0:s&&[`,`,`)`].includes(MM(e,o,1))&&(s=!1)),!s&&c===`}`&&l===`}`){let s=o,c=e.slice(a+2,s);if(e[a-1]===`\\`){r=n?r.slice(0,-1):r,r+=e.slice(a,s+2),i=s+2;break}r+=c?t(e.slice(a,s+2),c):e.slice(a,s+2),i=s+2;break}o+=1}if(o>=e.length){r+=e.slice(a);break}}return r},PM=e=>{let t=[];return{tags:t,literals:NM(e,(e,n)=>(t.push(n),`\0`)).split(`\0`)}},FM=e=>{let t=[];return NM(e,(e,n)=>(t.push({tag:e,content:n,name:n.split(`|`)[0].trim()}),e)),t},IM=e=>Ck.test(e),LM=(e,t)=>NM(e,(e,n)=>String(t(n)??``)),RM=(e,t)=>e.map(e=>{let{defaultValue:n,truthyValue:r,falsyValue:i}=e.args,a={...e.args},o=!1;if(n!==void 0){let e=LM(n,t);e!==n&&(a.defaultValue=e,o=!0)}if(r!==void 0){let e=LM(r,t);e!==r&&(a.truthyValue=e,o=!0)}if(i!==void 0){let e=LM(i,t);e!==i&&(a.falsyValue=e,o=!0)}let{customArgs:s}=e,c;return s?.some(e=>typeof e==`string`&&e.includes(`{{`))&&(c=s.map(e=>typeof e==`string`?LM(e,t):e)),!o&&!c?e:{...e,args:a,...c?{customArgs:c}:{}}}),PCe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof ee||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),E=ee.prototype;return w.prototype=E,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,ee,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),FCe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(n,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),ICe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(n,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};return function(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),LCe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(n,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),zM=u(PCe(),1),BM=u(FCe(),1),VM=u(ICe(),1),HM=u(LCe(),1),UM=(e,t)=>Array.from({length:t-e+1},(t,n)=>String.fromCodePoint(e+n)),RCe=Array.from({length:94},(e,t)=>{let n=65281+t;return[String.fromCodePoint(n),String.fromCodePoint(n-65248)]}),zCe=[`I`,`II`,`III`,`IV`,`V`,`VI`,`VII`,`VIII`,`IX`,`X`,`XI`,`XII`,`L`,`C`,`D`,`M`].flatMap((e,t)=>[[String.fromCodePoint(8544+t),e],[String.fromCodePoint(8560+t),e.toLowerCase()]]),BCe=`a.b.g.d.e.v.z.t.i.k.l.m.n.o.p.zh.r.s.t.u.ph.k.gh.q.sh.ch.ts.dz.ts.tch.kh.j.h`.split(`.`).flatMap((e,t)=>{let n=e[0].toUpperCase()+e.slice(1);return[[String.fromCodePoint(4304+t),e],[String.fromCodePoint(11520+t),e],[String.fromCodePoint(7312+t),n],[String.fromCodePoint(4256+t),n]]}),VCe=[[688,696],[737,739],[7468,7530],[7579,7615],[8305,8305],[8319,8319],[8336,8351],[43868,43871],[43881,43881],[67456,67514]],HCe=new Map([[`ʱ`,`h`],[`ʴ`,`r`],[`ʵ`,`r`],[`ʶ`,`r`],[`ᴭ`,`AE`],[`ᴯ`,`B`],[`ᴲ`,`E`],[`ᴻ`,`N`],[`ᴽ`,`Ou`],[`ᵄ`,`a`],[`ᵅ`,`a`],[`ᵆ`,`ae`],[`ᵊ`,`a`],[`ᵋ`,`e`],[`ᵌ`,`e`],[`ᵎ`,`i`],[`ᵑ`,`n`],[`ᵓ`,`o`],[`ᵔ`,`o`],[`ᵕ`,`o`],[`ᵙ`,`u`],[`ᵚ`,`u`],[`ᵜ`,`e`],[`ᵝ`,`v`],[`ᵞ`,`g`],[`ᵟ`,`d`],[`ᵠ`,`f`],[`ᵡ`,`x`],[`ᵦ`,`v`],[`ᵧ`,`g`],[`ᵨ`,`r`],[`ᵩ`,`f`],[`ᵪ`,`x`],[`ₔ`,`a`],[``,`w`],[``,`y`],[``,`z`],[`ᶞ`,`d`],[`ᶴ`,`sh`],[`ᶾ`,`zh`],[`ᶵ`,`t`],[`ᶹ`,`v`],[`ᶿ`,`th`]]),UCe=VCe.flatMap(([e,t])=>UM(e,t)).map(e=>[e,HCe.get(e)??e.normalize(`NFKC`)]).filter(([,e])=>RegExp(`^\\p{ASCII}*$`,`v`).test(e)),WCe=[...UM(8448,8527).map(e=>[e,e.normalize(`NFKC`)]).filter(([e,t])=>e.normalize()===e&&RegExp(`^[0-9A-Za-z]$`,`v`).test(t)),[`ⱼ`,`j`],[`ⱽ`,`V`],[`℀`,`a/c`],[`℁`,`a/s`],[`℅`,`c/o`],[`℆`,`c/u`],[`℠`,`(sm)`],[`℡`,`TEL`],[`℻`,`FAX`]],WM=UM(65,90),GCe=[...[10102,10112,10122].flatMap(e=>UM(e,e+9).map((e,t)=>[e,String(t+1)])),...UM(12881,12895).map((e,t)=>[e,String(t+21)]),...UM(12977,12991).map((e,t)=>[e,String(t+36)]),...WM.map((e,t)=>[String.fromCodePoint(127248+t),`(${e})`]),...WM.map((e,t)=>[String.fromCodePoint(127280+t),e]),...WM.map((e,t)=>[String.fromCodePoint(127312+t),e]),[String.fromCodePoint(127232),`0.`],...UM(127233,127242).map((e,t)=>[e,`${t},`]),[String.fromCodePoint(127243),`0`],[String.fromCodePoint(127244),`0`],[`🄫`,`C`],[`🄬`,`R`],[`🄭`,`CD`],[`🄮`,`WZ`],[`🅊`,`HV`],[`🅋`,`MV`],[`🅌`,`SD`],[`🅍`,`SS`],[`🅎`,`PPV`],[`🅏`,`WC`],[`🅪`,`MC`],[`🅫`,`MD`],[`🅬`,`MR`],[`🆐`,`DJ`],[`㉐`,`PTE`],[`﬩`,`+`]],KCe=[...[[13004,13007],[13056,13311],[65040,65055],[65072,65128],[65130,65135],[130032,130041]].flatMap(([e,t])=>UM(e,t)).map(e=>[e,e.normalize(`NFKC`)]).filter(([,e])=>RegExp(`^\\p{ASCII}+$`,`v`).test(e)),...[...WM,...UM(48,57)].map((e,t)=>[String.fromCodePoint(117974+t),e])],qCe=[[`ß`,`ss`],[`ẞ`,`Ss`],[`ä`,`ae`],[`Ä`,`Ae`],[`ö`,`oe`],[`Ö`,`Oe`],[`ü`,`ue`],[`Ü`,`Ue`],[`À`,`A`],[`Á`,`A`],[`Â`,`A`],[`Ã`,`A`],[`Å`,`A`],[`Æ`,`AE`],[`Ç`,`C`],[`È`,`E`],[`É`,`E`],[`Ê`,`E`],[`Ë`,`E`],[`Ə`,`A`],[`Ì`,`I`],[`Í`,`I`],[`Î`,`I`],[`Ï`,`I`],[`Ð`,`D`],[`Ñ`,`N`],[`Ò`,`O`],[`Ó`,`O`],[`Ô`,`O`],[`Õ`,`O`],[`Ō`,`O`],[`Ő`,`O`],[`Ø`,`O`],[`Œ`,`OE`],[`Ù`,`U`],[`Ú`,`U`],[`Û`,`U`],[`Ű`,`U`],[`Ý`,`Y`],[`Þ`,`TH`],[`à`,`a`],[`á`,`a`],[`â`,`a`],[`ã`,`a`],[`å`,`a`],[`æ`,`ae`],[`ç`,`c`],[`è`,`e`],[`é`,`e`],[`ê`,`e`],[`ë`,`e`],[`ə`,`a`],[`ì`,`i`],[`í`,`i`],[`î`,`i`],[`ï`,`i`],[`ð`,`d`],[`ñ`,`n`],[`ò`,`o`],[`ó`,`o`],[`ô`,`o`],[`õ`,`o`],[`ō`,`o`],[`ő`,`o`],[`ø`,`o`],[`œ`,`oe`],[`ù`,`u`],[`ú`,`u`],[`û`,`u`],[`ű`,`u`],[`ý`,`y`],[`þ`,`th`],[`ÿ`,`y`],[`ª`,`a`],[`º`,`o`],[`µ`,`u`],[`ĸ`,`k`],[`Ŀ`,`L`],[`ŀ`,`l`],[`ʼn`,`'n`],[`Ŋ`,`N`],[`ŋ`,`n`],[`Ŧ`,`T`],[`ŧ`,`t`],[`Ɓ`,`B`],[`ɓ`,`b`],[`Ɗ`,`D`],[`ɗ`,`d`],[`Ɖ`,`D`],[`ɖ`,`d`],[`Ƙ`,`K`],[`ƙ`,`k`],[`Ƴ`,`Y`],[`ƴ`,`y`],[`Ɣ`,`Gh`],[`ɣ`,`gh`],[`Ʋ`,`V`],[`ʋ`,`v`],[`Ʃ`,`Sh`],[`ʃ`,`sh`],[`Ʒ`,`Zh`],[`ʒ`,`zh`],[`Ɛ`,`E`],[`ɛ`,`e`],[`Ɔ`,`O`],[`ɔ`,`o`],[`ǝ`,`e`],[`Ǥ`,`G`],[`ǥ`,`g`],[`Ǝ`,`E`],[`Ƕ`,`Hv`],[`ƕ`,`hv`],[`Ƿ`,`W`],[`ƿ`,`w`],[`Ȝ`,`Y`],[`ȝ`,`y`],[`ƀ`,`b`],[`Ƃ`,`B`],[`ƃ`,`b`],[`Ƈ`,`C`],[`ƈ`,`c`],[`Ƌ`,`D`],[`ƌ`,`d`],[`Ƒ`,`F`],[`ƒ`,`f`],[`Ɠ`,`G`],[`Ɩ`,`I`],[`Ɨ`,`I`],[`ƚ`,`l`],[`Ɲ`,`N`],[`ƞ`,`n`],[`Ɵ`,`O`],[`Ƣ`,`Gh`],[`ƣ`,`gh`],[`Ƥ`,`P`],[`ƥ`,`p`],[`ƫ`,`t`],[`Ƭ`,`T`],[`ƭ`,`t`],[`Ʈ`,`T`],[`Ʊ`,`U`],[`Ƶ`,`Z`],[`ƶ`,`z`],[`Ǿ`,`O`],[`ǿ`,`o`],[`Ƞ`,`N`],[`ȡ`,`d`],[`Ȣ`,`Ou`],[`ȣ`,`ou`],[`Ȥ`,`Z`],[`ȥ`,`z`],[`ȴ`,`l`],[`ȵ`,`n`],[`ȶ`,`t`],[`ȷ`,`j`],[`Ⱥ`,`A`],[`Ȼ`,`C`],[`ȼ`,`c`],[`Ƚ`,`L`],[`Ⱦ`,`T`],[`ȿ`,`s`],[`ɀ`,`z`],[`Ɂ`,`'`],[`ɂ`,`'`],[`Ƀ`,`B`],[`Ʉ`,`U`],[`Ɇ`,`E`],[`ɇ`,`e`],[`Ɉ`,`J`],[`ɉ`,`j`],[`ɋ`,`q`],[`Ɍ`,`R`],[`ɍ`,`r`],[`Ɏ`,`Y`],[`ɏ`,`y`],[`Ⱡ`,`L`],[`ⱡ`,`l`],[`Ɫ`,`L`],[`Ᵽ`,`P`],[`Ɽ`,`R`],[`ⱥ`,`a`],[`ⱦ`,`t`],[`Ⱨ`,`H`],[`ⱨ`,`h`],[`Ⱪ`,`K`],[`ⱪ`,`k`],[`Ⱬ`,`Z`],[`ⱬ`,`z`],[`Ɑ`,`A`],[`Ɱ`,`M`],[`Ɐ`,`A`],[`Ɒ`,`A`],[`ⱱ`,`v`],[`Ⱳ`,`W`],[`ⱳ`,`w`],[`ⱴ`,`v`],[`Ⱶ`,`H`],[`ⱶ`,`h`],[`ⱸ`,`e`],[`ⱺ`,`o`],[`Ȿ`,`S`],[`Ɀ`,`Z`],[`Ꜧ`,`H`],[`ꜧ`,`h`],[`Ꜳ`,`Aa`],[`ꜳ`,`aa`],[`Ꜵ`,`Ao`],[`ꜵ`,`ao`],[`Ꜷ`,`Au`],[`ꜷ`,`au`],[`Ꜹ`,`Av`],[`ꜹ`,`av`],[`Ꜻ`,`Av`],[`ꜻ`,`av`],[`Ꜽ`,`Ay`],[`ꜽ`,`ay`],[`Ꝁ`,`K`],[`ꝁ`,`k`],[`Ꝃ`,`K`],[`ꝃ`,`k`],[`Ꝅ`,`K`],[`ꝅ`,`k`],[`Ꝉ`,`L`],[`ꝉ`,`l`],[`Ꝋ`,`O`],[`ꝋ`,`o`],[`Ꝏ`,`Oo`],[`ꝏ`,`oo`],[`Ꝑ`,`P`],[`ꝑ`,`p`],[`Ꝓ`,`P`],[`ꝓ`,`p`],[`Ꝕ`,`P`],[`ꝕ`,`p`],[`Ꝗ`,`Q`],[`ꝗ`,`q`],[`Ꝙ`,`Q`],[`ꝙ`,`q`],[`Ꝟ`,`V`],[`ꝟ`,`v`],[`Ꝡ`,`Vy`],[`ꝡ`,`vy`],[`Ꝩ`,`V`],[`ꝩ`,`v`],[`Ꝫ`,`Et`],[`ꝫ`,`et`],[`Ꝭ`,`Is`],[`ꝭ`,`is`],[`Ꝯ`,`Con`],[`ꝯ`,`con`],[`ꞎ`,`l`],[`Ꞑ`,`N`],[`ꞑ`,`n`],[`Ꞓ`,`C`],[`ꞓ`,`c`],[`ꞔ`,`c`],[`ꞕ`,`h`],[`Ꞗ`,`B`],[`ꞗ`,`b`],[`Ꞙ`,`F`],[`ꞙ`,`f`],[`Ꞡ`,`G`],[`ꞡ`,`g`],[`Ꞣ`,`K`],[`ꞣ`,`k`],[`Ꞥ`,`N`],[`ꞥ`,`n`],[`Ꞧ`,`R`],[`ꞧ`,`r`],[`Ꞩ`,`S`],[`ꞩ`,`s`],[`Ɦ`,`H`],[`Ɬ`,`L`],[`Ʝ`,`J`],[`Ꞹ`,`U`],[`ꞹ`,`u`],[`Ꞔ`,`C`],[`Ʂ`,`S`],[`Ᶎ`,`Z`],[`Ꟈ`,`D`],[`ꟈ`,`d`],[`Ꟊ`,`S`],[`ꟊ`,`s`],[``,`S`],[``,`s`],[``,`S`],[`ꟲ`,`C`],[`ꟳ`,`F`],[`ꟴ`,`Q`],[`Ꟶ`,`H`],[`ꟶ`,`h`],[`ꟷ`,`I`],[`ꟸ`,`H`],[`ꟹ`,`oe`],[`ꟺ`,`m`],[`ſ`,`s`],[`ff`,`ff`],[`fi`,`fi`],[`fl`,`fl`],[`ffi`,`ffi`],[`ffl`,`ffl`],[`ſt`,`st`],[`st`,`st`],[`DŽ`,`DZ`],[`Dž`,`Dz`],[`dž`,`dz`],[`LJ`,`LJ`],[`Lj`,`Lj`],[`lj`,`lj`],[`NJ`,`NJ`],[`Nj`,`Nj`],[`nj`,`nj`],[`DZ`,`DZ`],[`Dz`,`Dz`],[`dz`,`dz`],[`ă`,`a`],[`Ă`,`A`],[`Đ`,`D`],[`đ`,`d`],[`ĩ`,`i`],[`Ĩ`,`I`],[`ũ`,`u`],[`Ũ`,`U`],[`ơ`,`o`],[`Ơ`,`O`],[`ư`,`u`],[`Ư`,`U`],[`ạ`,`a`],[`Ạ`,`A`],[`ả`,`a`],[`Ả`,`A`],[`ấ`,`a`],[`Ấ`,`A`],[`ầ`,`a`],[`Ầ`,`A`],[`ẩ`,`a`],[`Ẩ`,`A`],[`ẫ`,`a`],[`Ẫ`,`A`],[`ậ`,`a`],[`Ậ`,`A`],[`ắ`,`a`],[`Ắ`,`A`],[`ằ`,`a`],[`Ằ`,`A`],[`ẳ`,`a`],[`Ẳ`,`A`],[`ẵ`,`a`],[`Ẵ`,`A`],[`ặ`,`a`],[`Ặ`,`A`],[`ẹ`,`e`],[`Ẹ`,`E`],[`ẻ`,`e`],[`Ẻ`,`E`],[`ẽ`,`e`],[`Ẽ`,`E`],[`ế`,`e`],[`Ế`,`E`],[`ề`,`e`],[`Ề`,`E`],[`ể`,`e`],[`Ể`,`E`],[`ễ`,`e`],[`Ễ`,`E`],[`ệ`,`e`],[`Ệ`,`E`],[`ỉ`,`i`],[`Ỉ`,`I`],[`ị`,`i`],[`Ị`,`I`],[`ọ`,`o`],[`Ọ`,`O`],[`ỏ`,`o`],[`Ỏ`,`O`],[`ố`,`o`],[`Ố`,`O`],[`ồ`,`o`],[`Ồ`,`O`],[`ổ`,`o`],[`Ổ`,`O`],[`ỗ`,`o`],[`Ỗ`,`O`],[`ộ`,`o`],[`Ộ`,`O`],[`ớ`,`o`],[`Ớ`,`O`],[`ờ`,`o`],[`Ờ`,`O`],[`ở`,`o`],[`Ở`,`O`],[`ỡ`,`o`],[`Ỡ`,`O`],[`ợ`,`o`],[`Ợ`,`O`],[`ụ`,`u`],[`Ụ`,`U`],[`ủ`,`u`],[`Ủ`,`U`],[`ứ`,`u`],[`Ứ`,`U`],[`ừ`,`u`],[`Ừ`,`U`],[`ử`,`u`],[`Ử`,`U`],[`ữ`,`u`],[`Ữ`,`U`],[`ự`,`u`],[`Ự`,`U`],[`ỳ`,`y`],[`Ỳ`,`Y`],[`ỵ`,`y`],[`Ỵ`,`Y`],[`ỷ`,`y`],[`Ỷ`,`Y`],[`ỹ`,`y`],[`Ỹ`,`Y`],[`ء`,`e`],[`آ`,`a`],[`أ`,`a`],[`ؤ`,`w`],[`إ`,`a`],[`ئ`,`y`],[`ا`,`a`],[`ب`,`b`],[`ة`,`t`],[`ت`,`t`],[`ث`,`th`],[`ج`,`j`],[`ح`,`h`],[`خ`,`kh`],[`د`,`d`],[`ذ`,`dh`],[`ر`,`r`],[`ز`,`z`],[`س`,`s`],[`ش`,`sh`],[`ص`,`s`],[`ض`,`d`],[`ط`,`t`],[`ظ`,`z`],[`ع`,`e`],[`غ`,`gh`],[`ـ`,`_`],[`ف`,`f`],[`ق`,`q`],[`ك`,`k`],[`ل`,`l`],[`م`,`m`],[`ن`,`n`],[`ه`,`h`],[`و`,`w`],[`ى`,`a`],[`ي`,`y`],[`َ`,`a`],[`ُ`,`u`],[`ِ`,`i`],[`ًا`,`an`],[`اً`,`an`],[`ً`,`an`],[`ٌ`,`un`],[`ٍ`,`in`],[`ٰ`,`a`],[`َٰ`,`a`],[`ؐ`,``],[`ؑ`,``],[`ؒ`,``],[`ؓ`,``],[`ؔ`,``],[`ؕ`,``],[`ؖ`,``],[`ؗ`,``],[`ؘ`,`a`],[`ؙ`,`u`],[`ؚ`,`i`],[`ٓ`,``],[`ٔ`,``],[`ٕ`,``],[`ٖ`,``],[`ٙ`,``],[`ٚ`,``],[`ٛ`,``],[`ٜ`,``],[`ٝ`,`u`],[`ٞ`,`a`],[`ٟ`,``],[`ۖ`,``],[`ۗ`,``],[`ۘ`,``],[`ۙ`,``],[`ۚ`,``],[`ۛ`,``],[`ۜ`,``],[`ۡ`,``],[`ۢ`,``],[`ۣ`,``],[`ۤ`,``],[`ۧ`,``],[`ۨ`,``],[`ۭ`,``],[``,`e`],[`࣓`,``],[`ࣔ`,``],[`ࣕ`,``],[`ࣖ`,``],[`ࣗ`,``],[`ࣘ`,``],[`ࣙ`,``],[`ࣚ`,``],[`ࣛ`,``],[`ࣜ`,``],[`ࣝ`,``],[`ࣞ`,``],[`ࣟ`,``],[`࣠`,``],[`࣡`,``],[`ࣿ`,``],[`٠`,`0`],[`١`,`1`],[`٢`,`2`],[`٣`,`3`],[`٤`,`4`],[`٥`,`5`],[`٦`,`6`],[`٧`,`7`],[`٨`,`8`],[`٩`,`9`],[`،`,`,`],[`؛`,`;`],[`؟`,`?`],[`٪`,`%`],[`٫`,`.`],[`٬`,`,`],[`٭`,`*`],[`۔`,`.`],[`؍`,`/`],[`؞`,`.`],[`﴾`,`(`],[`﴿`,`)`],[`ٱ`,`a`],[`ۂ`,`h`],[`ۃ`,`t`],[`ۓ`,`y`],[`ۇ`,`u`],[`ۈ`,`u`],[`ۊ`,`u`],[`ۆ`,`o`],[`ۅ`,`o`],[`ۋ`,`v`],[`ۏ`,`v`],[`ە`,`e`],[`ڭ`,`ng`],[`ڴ`,`ng`],[`ڻ`,`n`],[`چ`,`ch`],[`ک`,`k`],[`گ`,`g`],[`پ`,`p`],[`ژ`,`zh`],[`ی`,`y`],[`۰`,`0`],[`۱`,`1`],[`۲`,`2`],[`۳`,`3`],[`۴`,`4`],[`۵`,`5`],[`۶`,`6`],[`۷`,`7`],[`۸`,`8`],[`۹`,`9`],[`ټ`,`t`],[`ځ`,`z`],[`څ`,`c`],[`ډ`,`d`],[`ړ`,`r`],[`ږ`,`g`],[`ښ`,`x`],[`ګ`,`g`],[`ڼ`,`n`],[`ۀ`,`e`],[`ې`,`e`],[`ۍ`,`ai`],[`ٹ`,`t`],[`ڈ`,`d`],[`ڑ`,`r`],[`ں`,`n`],[`ہ`,`h`],[`ھ`,`h`],[`ے`,`e`],[`ڤ`,`v`],[`ڕ`,`r`],[`ڵ`,`l`],[`ێ`,`e`],[`ٺ`,`th`],[`ٻ`,`b`],[`ٽ`,`t`],[`ٿ`,`th`],[`ڀ`,`bh`],[`ڃ`,`n`],[`ڄ`,`j`],[`ڇ`,`ch`],[`ڊ`,`d`],[`ڋ`,`d`],[`ڌ`,`dh`],[`ڍ`,`dh`],[`ڎ`,`d`],[`ڏ`,`d`],[`ڐ`,`d`],[`ڙ`,`r`],[`ڳ`,`g`],[`ڱ`,`ng`],[`ڪ`,`k`],[`ڦ`,`ph`],[`ٮ`,`b`],[`ٯ`,`q`],[`ٲ`,`a`],[`ٳ`,`a`],[`ٴ`,`'`],[`ٵ`,`a`],[`ٶ`,`w`],[`ٷ`,`u`],[`ٸ`,`y`],[`𞸀`,`a`],[`𞸁`,`b`],[`𞸂`,`j`],[`𞸃`,`d`],[`𞸅`,`w`],[`𞸆`,`z`],[`𞸇`,`h`],[`𞸈`,`t`],[`𞸉`,`y`],[`𞸊`,`k`],[`𞸋`,`l`],[`𞸌`,`m`],[`𞸍`,`n`],[`𞸎`,`s`],[`𞸏`,`e`],[`𞸐`,`f`],[`𞸑`,`s`],[`𞸒`,`q`],[`𞸓`,`r`],[`𞸔`,`sh`],[`𞸕`,`t`],[`𞸖`,`th`],[`𞸗`,`kh`],[`𞸘`,`dh`],[`𞸙`,`d`],[`𞸚`,`z`],[`𞸛`,`gh`],[`𞸜`,`b`],[`𞸝`,`n`],[`𞸞`,`f`],[`𞸟`,`q`],[`𞸡`,`b`],[`𞸢`,`j`],[`𞸤`,`h`],[`𞸧`,`h`],[`𞸩`,`y`],[`𞸪`,`k`],[`𞸫`,`l`],[`𞸬`,`m`],[`𞸭`,`n`],[`𞸮`,`s`],[`𞸯`,`e`],[`𞸰`,`f`],[`𞸱`,`s`],[`𞸲`,`q`],[`𞸴`,`sh`],[`𞸵`,`t`],[`𞸶`,`th`],[`𞸷`,`kh`],[`𞸹`,`d`],[`𞸻`,`gh`],[`𞹂`,`j`],[`𞹇`,`h`],[`𞹉`,`y`],[`𞹋`,`l`],[`𞹍`,`n`],[`𞹎`,`s`],[`𞹏`,`e`],[`𞹑`,`s`],[`𞹒`,`q`],[`𞹔`,`sh`],[`𞹗`,`kh`],[`𞹙`,`d`],[`𞹛`,`gh`],[`𞹝`,`n`],[`𞹟`,`q`],[`𞹡`,`b`],[`𞹢`,`j`],[`𞹤`,`h`],[`𞹧`,`h`],[`𞹨`,`t`],[`𞹩`,`y`],[`𞹪`,`k`],[`𞹬`,`m`],[`𞹭`,`n`],[`𞹮`,`s`],[`𞹯`,`e`],[`𞹰`,`f`],[`𞹱`,`s`],[`𞹲`,`q`],[`𞹴`,`sh`],[`𞹵`,`t`],[`𞹶`,`th`],[`𞹷`,`kh`],[`𞹹`,`d`],[`𞹺`,`z`],[`𞹻`,`gh`],[`𞹼`,`b`],[`𞹾`,`f`],[`𞺀`,`a`],[`𞺁`,`b`],[`𞺂`,`j`],[`𞺃`,`d`],[`𞺄`,`h`],[`𞺅`,`w`],[`𞺆`,`z`],[`𞺇`,`h`],[`𞺈`,`t`],[`𞺉`,`y`],[`𞺋`,`l`],[`𞺌`,`m`],[`𞺍`,`n`],[`𞺎`,`s`],[`𞺏`,`e`],[`𞺐`,`f`],[`𞺑`,`s`],[`𞺒`,`q`],[`𞺓`,`r`],[`𞺔`,`sh`],[`𞺕`,`t`],[`𞺖`,`th`],[`𞺗`,`kh`],[`𞺘`,`dh`],[`𞺙`,`d`],[`𞺚`,`z`],[`𞺛`,`gh`],[`𞺡`,`b`],[`𞺢`,`j`],[`𞺣`,`d`],[`𞺥`,`w`],[`𞺦`,`z`],[`𞺧`,`h`],[`𞺨`,`t`],[`𞺩`,`y`],[`𞺫`,`l`],[`𞺬`,`m`],[`𞺭`,`n`],[`𞺮`,`s`],[`𞺯`,`e`],[`𞺰`,`f`],[`𞺱`,`s`],[`𞺲`,`q`],[`𞺳`,`r`],[`𞺴`,`sh`],[`𞺵`,`t`],[`𞺶`,`th`],[`𞺷`,`kh`],[`𞺸`,`dh`],[`𞺹`,`d`],[`𞺺`,`z`],[`𞺻`,`gh`],[`А`,`A`],[`а`,`a`],[`Б`,`B`],[`б`,`b`],[`В`,`V`],[`в`,`v`],[`Г`,`G`],[`г`,`g`],[`Д`,`D`],[`д`,`d`],[`ъе`,`ye`],[`Ъе`,`Ye`],[`ъЕ`,`yE`],[`ЪЕ`,`YE`],[`Е`,`E`],[`е`,`e`],[`Ё`,`Yo`],[`ё`,`yo`],[`Ж`,`Zh`],[`ж`,`zh`],[`З`,`Z`],[`з`,`z`],[`И`,`I`],[`и`,`i`],[`ый`,`iy`],[`Ый`,`Iy`],[`ЫЙ`,`IY`],[`ыЙ`,`iY`],[`Й`,`Y`],[`й`,`y`],[`К`,`K`],[`к`,`k`],[`Л`,`L`],[`л`,`l`],[`М`,`M`],[`м`,`m`],[`Н`,`N`],[`н`,`n`],[`О`,`O`],[`о`,`o`],[`П`,`P`],[`п`,`p`],[`Р`,`R`],[`р`,`r`],[`С`,`S`],[`с`,`s`],[`Т`,`T`],[`т`,`t`],[`У`,`U`],[`у`,`u`],[`Ф`,`F`],[`ф`,`f`],[`Х`,`Kh`],[`х`,`kh`],[`Ц`,`Ts`],[`ц`,`ts`],[`Ч`,`Ch`],[`ч`,`ch`],[`Ш`,`Sh`],[`ш`,`sh`],[`Щ`,`Sch`],[`щ`,`sch`],[`Ъ`,``],[`ъ`,``],[`Ы`,`Y`],[`ы`,`y`],[`Ь`,``],[`ь`,``],[`Э`,`E`],[`э`,`e`],[`Ю`,`Yu`],[`ю`,`yu`],[`Я`,`Ya`],[`я`,`ya`],[`Ѣ`,`E`],[`ѣ`,`e`],[`Ѳ`,`F`],[`ѳ`,`f`],[`Ѵ`,`I`],[`ѵ`,`i`],[`Ѡ`,`O`],[`ѡ`,`o`],[`Ѻ`,`O`],[`ѻ`,`o`],[`Ѯ`,`Ks`],[`ѯ`,`ks`],[`Ѱ`,`Ps`],[`ѱ`,`ps`],[`Ѹ`,`U`],[`ѹ`,`u`],[`Ѥ`,`Ye`],[`ѥ`,`ye`],[`Ҁ`,`Q`],[`ҁ`,`q`],[`Ѿ`,`Ot`],[`ѿ`,`ot`],[`Ѧ`,`E`],[`ѧ`,`e`],[`Ѩ`,`Ye`],[`ѩ`,`ye`],[`Ѫ`,`U`],[`ѫ`,`u`],[`Ѭ`,`Yu`],[`ѭ`,`yu`],[`Ѽ`,`O`],[`ѽ`,`o`],[`Ә`,`A`],[`ә`,`a`],[`Ғ`,`Gh`],[`ғ`,`gh`],[`Җ`,`J`],[`җ`,`j`],[`Қ`,`Q`],[`қ`,`q`],[`Ң`,`Ng`],[`ң`,`ng`],[`Һ`,`H`],[`һ`,`h`],[`Ө`,`O`],[`ө`,`o`],[`Ұ`,`U`],[`ұ`,`u`],[`Ү`,`U`],[`ү`,`u`],[`Ҳ`,`H`],[`ҳ`,`h`],[`Ҷ`,`J`],[`ҷ`,`j`],[`Ӯ`,`U`],[`ӯ`,`u`],[`Ӣ`,`I`],[`ӣ`,`i`],[`Ҝ`,`G`],[`ҝ`,`g`],[`Ҹ`,`J`],[`ҹ`,`j`],[`Ҡ`,`Q`],[`ҡ`,`q`],[`Ҫ`,`Th`],[`ҫ`,`th`],[`Ӑ`,`A`],[`ӑ`,`a`],[`Ӗ`,`E`],[`ӗ`,`e`],[`Ӂ`,`J`],[`ӂ`,`j`],[`Ӕ`,`Ae`],[`ӕ`,`ae`],[`Ӈ`,`Ng`],[`ӈ`,`ng`],[`Ӱ`,`U`],[`ӱ`,`u`],[`Ӳ`,`U`],[`ӳ`,`u`],[`Ӧ`,`O`],[`ӧ`,`o`],[`Ӵ`,`Ch`],[`ӵ`,`ch`],[`Ӹ`,`Y`],[`ӹ`,`y`],[`Ӄ`,`Q`],[`ӄ`,`q`],[`Ҋ`,`J`],[`ҋ`,`j`],[`Ҍ`,``],[`ҍ`,``],[`Ҏ`,`R`],[`ҏ`,`r`],[`Ҕ`,`Gh`],[`ҕ`,`gh`],[`Ҙ`,`Dh`],[`ҙ`,`dh`],[`Ҟ`,`K`],[`ҟ`,`k`],[`Ҥ`,`Ng`],[`ҥ`,`ng`],[`Ҧ`,`P`],[`ҧ`,`p`],[`Ҩ`,`H`],[`ҩ`,`h`],[`Ҭ`,`T`],[`ҭ`,`t`],[`Ҵ`,`Ts`],[`ҵ`,`ts`],[`Ҽ`,`Ch`],[`ҽ`,`ch`],[`Ҿ`,`Ch`],[`ҿ`,`ch`],[`Ӏ`,`'`],[`ӏ`,`'`],[`Ӆ`,`L`],[`ӆ`,`l`],[`Ӊ`,`N`],[`ӊ`,`n`],[`Ӌ`,`J`],[`ӌ`,`j`],[`Ӎ`,`M`],[`ӎ`,`m`],[`Ӡ`,`Dz`],[`ӡ`,`dz`],[`Ӷ`,`G`],[`ӷ`,`g`],[`Ӻ`,`Gh`],[`ӻ`,`gh`],[`Ӽ`,`Kh`],[`ӽ`,`kh`],[`Ӿ`,`H`],[`ӿ`,`h`],[`Ԁ`,`D`],[`ԁ`,`d`],[`Ԃ`,`Dj`],[`ԃ`,`dj`],[`Ԅ`,`Zj`],[`ԅ`,`zj`],[`Ԇ`,`Dz`],[`ԇ`,`dz`],[`Ԉ`,`Lj`],[`ԉ`,`lj`],[`Ԋ`,`Nj`],[`ԋ`,`nj`],[`Ԍ`,`Sj`],[`ԍ`,`sj`],[`Ԏ`,`Tj`],[`ԏ`,`tj`],[`Ԑ`,`E`],[`ԑ`,`e`],[`Ԓ`,`L`],[`ԓ`,`l`],[`Ԕ`,`Lh`],[`ԕ`,`lh`],[`Ԗ`,`Rh`],[`ԗ`,`rh`],[`Ԙ`,`Yae`],[`ԙ`,`yae`],[`Ԛ`,`Q`],[`ԛ`,`q`],[`Ԝ`,`W`],[`ԝ`,`w`],[`Ԟ`,`Q`],[`ԟ`,`q`],[`Ԡ`,`L`],[`ԡ`,`l`],[`Ԣ`,`Ng`],[`ԣ`,`ng`],[`Ԥ`,`P`],[`ԥ`,`p`],[`Ԧ`,`Sh`],[`ԧ`,`sh`],[`Ԩ`,`Ng`],[`ԩ`,`ng`],[`Ԫ`,`Dzh`],[`ԫ`,`dzh`],[`Ԭ`,`Tch`],[`ԭ`,`tch`],[`Ԯ`,`L`],[`ԯ`,`l`],[`ᲀ`,`v`],[`ᲁ`,`d`],[`ᲂ`,`o`],[`ᲃ`,`s`],[`ᲄ`,`t`],[`ᲅ`,`t`],[`ᲆ`,``],[`ᲇ`,`e`],[`ᲈ`,`u`],[``,`C`],[``,`c`],[`҈`,``],[`҉`,``],[`ⷠ`,``],[`ⷡ`,``],[`ⷢ`,``],[`ⷣ`,``],[`ⷤ`,``],[`ⷥ`,``],[`ⷦ`,``],[`ⷧ`,``],[`ⷨ`,``],[`ⷩ`,``],[`ⷪ`,``],[`ⷫ`,``],[`ⷬ`,``],[`ⷭ`,``],[`ⷮ`,``],[`ⷯ`,``],[`ⷰ`,``],[`ⷱ`,``],[`ⷲ`,``],[`ⷳ`,``],[`ⷴ`,``],[`ⷵ`,``],[`ⷶ`,``],[`ⷷ`,``],[`ⷸ`,``],[`ⷹ`,``],[`ⷺ`,``],[`ⷻ`,``],[`ⷼ`,``],[`ⷽ`,``],[`ⷾ`,``],[`ⷿ`,``],[`꙰`,``],[`꙱`,``],[`꙲`,``],[`ꙴ`,``],[`ꙵ`,``],[`ꙶ`,``],[`ꙷ`,``],[`ꙸ`,``],[`ꙹ`,``],[`ꙺ`,``],[`ꙻ`,``],[`𝉂`,``],[`𝉃`,``],[`𝉄`,``],[`ꙮ`,`o`],[`꙳`,`*`],[`꙾`,`'`],[`Ꙁ`,`Z`],[`ꙁ`,`z`],[`Ꙃ`,`Dz`],[`ꙃ`,`dz`],[`Ꙅ`,`Dz`],[`ꙅ`,`dz`],[`Ꙇ`,`I`],[`ꙇ`,`i`],[`Ꙉ`,`Dj`],[`ꙉ`,`dj`],[`Ꙋ`,`U`],[`ꙋ`,`u`],[`Ꙍ`,`O`],[`ꙍ`,`o`],[`Ꙏ`,``],[`ꙏ`,``],[`Ꙑ`,`Y`],[`ꙑ`,`y`],[`Ꙓ`,`Ye`],[`ꙓ`,`ye`],[`Ꙕ`,`Yu`],[`ꙕ`,`yu`],[`Ꙗ`,`Ya`],[`ꙗ`,`ya`],[`Ꙙ`,`E`],[`ꙙ`,`e`],[`Ꙛ`,`E`],[`ꙛ`,`e`],[`Ꙝ`,`Ye`],[`ꙝ`,`ye`],[`Ꙟ`,`Y`],[`ꙟ`,`y`],[`Ꙡ`,`Ts`],[`ꙡ`,`ts`],[`Ꙣ`,`D`],[`ꙣ`,`d`],[`Ꙥ`,`L`],[`ꙥ`,`l`],[`Ꙧ`,`M`],[`ꙧ`,`m`],[`Ꙩ`,`O`],[`ꙩ`,`o`],[`Ꙫ`,`O`],[`ꙫ`,`o`],[`Ꙭ`,`O`],[`ꙭ`,`o`],[`Ꚁ`,`D`],[`ꚁ`,`d`],[`Ꚃ`,`Dz`],[`ꚃ`,`dz`],[`Ꚅ`,`Zh`],[`ꚅ`,`zh`],[`Ꚇ`,`Ch`],[`ꚇ`,`ch`],[`Ꚉ`,`Dzh`],[`ꚉ`,`dzh`],[`Ꚋ`,`T`],[`ꚋ`,`t`],[`Ꚍ`,`T`],[`ꚍ`,`t`],[`Ꚏ`,`Ts`],[`ꚏ`,`ts`],[`Ꚑ`,`Ts`],[`ꚑ`,`ts`],[`Ꚓ`,`Ch`],[`ꚓ`,`ch`],[`Ꚕ`,`H`],[`ꚕ`,`h`],[`Ꚗ`,`Sh`],[`ꚗ`,`sh`],[`Ꚙ`,`Oo`],[`ꚙ`,`oo`],[`Ꚛ`,`O`],[`ꚛ`,`o`],[`ș`,`s`],[`Ș`,`S`],[`ț`,`t`],[`Ț`,`T`],[`ţ`,`t`],[`Ţ`,`T`],[`ş`,`s`],[`Ş`,`S`],[`ğ`,`g`],[`Ğ`,`G`],[`ı`,`i`],[`İ`,`I`],[`ա`,`a`],[`Ա`,`A`],[`բ`,`b`],[`Բ`,`B`],[`գ`,`g`],[`Գ`,`G`],[`դ`,`d`],[`Դ`,`D`],[`ե`,`ye`],[`Ե`,`Ye`],[`զ`,`z`],[`Զ`,`Z`],[`է`,`e`],[`Է`,`E`],[`ը`,`y`],[`Ը`,`Y`],[`թ`,`t`],[`Թ`,`T`],[`ժ`,`zh`],[`Ժ`,`Zh`],[`ի`,`i`],[`Ի`,`I`],[`լ`,`l`],[`Լ`,`L`],[`խ`,`kh`],[`Խ`,`Kh`],[`ծ`,`ts`],[`Ծ`,`Ts`],[`կ`,`k`],[`Կ`,`K`],[`հ`,`h`],[`Հ`,`H`],[`ձ`,`dz`],[`Ձ`,`Dz`],[`ղ`,`gh`],[`Ղ`,`Gh`],[`ճ`,`tch`],[`Ճ`,`Tch`],[`մ`,`m`],[`Մ`,`M`],[`յ`,`y`],[`Յ`,`Y`],[`ն`,`n`],[`Ն`,`N`],[`շ`,`sh`],[`Շ`,`Sh`],[`ու`,`u`],[`ՈՒ`,`U`],[`Ու`,`U`],[`ո`,`vo`],[`Ո`,`Vo`],[`չ`,`ch`],[`Չ`,`Ch`],[`պ`,`p`],[`Պ`,`P`],[`ջ`,`j`],[`Ջ`,`J`],[`ռ`,`r`],[`Ռ`,`R`],[`ս`,`s`],[`Ս`,`S`],[`վ`,`v`],[`Վ`,`V`],[`տ`,`t`],[`Տ`,`T`],[`ր`,`r`],[`Ր`,`R`],[`ց`,`c`],[`Ց`,`C`],[`փ`,`p`],[`Փ`,`P`],[`ք`,`q`],[`Ք`,`Q`],[`օ`,`o`],[`Օ`,`O`],[`ֆ`,`f`],[`Ֆ`,`F`],[`ւ`,`v`],[`Ւ`,`V`],[`և`,`yev`],[`ﬓ`,`mn`],[`ﬔ`,`mye`],[`ﬕ`,`mi`],[`ﬖ`,`vn`],[`ﬗ`,`mkh`],[`։`,`.`],[`՝`,`,`],[`՞`,`?`],[`՛`,`!`],[`՜`,`!`],[`՚`,`'`],[`՟`,`.`],[`ՠ`,`a`],[`ֈ`,`y`],...BCe,[`ჱ`,`e`],[`ჲ`,`y`],[`ჳ`,`w`],[`ჴ`,`q`],[`ჵ`,`o`],[`ჶ`,`f`],[`ႁ`,`E`],[`ႂ`,`Y`],[`ႃ`,`W`],[`ႄ`,`Q`],[`ႅ`,`O`],[`ⴡ`,`e`],[`ⴢ`,`y`],[`ⴣ`,`w`],[`ⴤ`,`q`],[`ⴥ`,`o`],[`Ჱ`,`E`],[`Ჲ`,`Y`],[`Ჳ`,`W`],[`Ჴ`,`Q`],[`Ჵ`,`O`],[`Ჶ`,`F`],[`č`,`c`],[`ď`,`d`],[`ě`,`e`],[`ň`,`n`],[`ř`,`r`],[`š`,`s`],[`ť`,`t`],[`ů`,`u`],[`ž`,`z`],[`Č`,`C`],[`Ď`,`D`],[`Ě`,`E`],[`Ň`,`N`],[`Ř`,`R`],[`Š`,`S`],[`Ť`,`T`],[`Ů`,`U`],[`Ž`,`Z`],[`ހ`,`h`],[`ށ`,`sh`],[`ނ`,`n`],[`ރ`,`r`],[`ބ`,`b`],[`ޅ`,`lh`],[`ކ`,`k`],[`އ`,`a`],[`ވ`,`v`],[`މ`,`m`],[`ފ`,`f`],[`ދ`,`dh`],[`ތ`,`th`],[`ލ`,`l`],[`ގ`,`g`],[`ޏ`,`gn`],[`ސ`,`s`],[`ޑ`,`d`],[`ޒ`,`z`],[`ޓ`,`t`],[`ޔ`,`y`],[`ޕ`,`p`],[`ޖ`,`j`],[`ޗ`,`ch`],[`ޘ`,`tt`],[`ޙ`,`hh`],[`ޚ`,`kh`],[`ޛ`,`th`],[`ޜ`,`z`],[`ޝ`,`sh`],[`ޞ`,`s`],[`ޟ`,`d`],[`ޠ`,`t`],[`ޡ`,`z`],[`ޢ`,`a`],[`ޣ`,`gh`],[`ޤ`,`q`],[`ޥ`,`w`],[`ޱ`,`n`],[`ަ`,`a`],[`ާ`,`aa`],[`ި`,`i`],[`ީ`,`ee`],[`ު`,`u`],[`ޫ`,`oo`],[`ެ`,`e`],[`ޭ`,`ey`],[`ޮ`,`o`],[`ޯ`,`oa`],[`ް`,``],[`α`,`a`],[`β`,`v`],[`γ`,`g`],[`δ`,`d`],[`ε`,`e`],[`ζ`,`z`],[`η`,`i`],[`θ`,`th`],[`ι`,`i`],[`κ`,`k`],[`λ`,`l`],[`μ`,`m`],[`ν`,`n`],[`ξ`,`ks`],[`ο`,`o`],[`π`,`p`],[`ρ`,`r`],[`σ`,`s`],[`τ`,`t`],[`υ`,`y`],[`φ`,`f`],[`χ`,`x`],[`ψ`,`ps`],[`ω`,`o`],[`ά`,`a`],[`έ`,`e`],[`ί`,`i`],[`ό`,`o`],[`ύ`,`y`],[`ή`,`i`],[`ώ`,`o`],[`ς`,`s`],[`ϊ`,`i`],[`ΰ`,`y`],[`ϋ`,`y`],[`ΐ`,`i`],[`Α`,`A`],[`Β`,`V`],[`Γ`,`G`],[`Δ`,`D`],[`Ε`,`E`],[`Ζ`,`Z`],[`Η`,`I`],[`Θ`,`TH`],[`Ι`,`I`],[`Κ`,`K`],[`Λ`,`L`],[`Μ`,`M`],[`Ν`,`N`],[`Ξ`,`KS`],[`Ο`,`O`],[`Π`,`P`],[`Ρ`,`R`],[`Σ`,`S`],[`Τ`,`T`],[`Υ`,`Y`],[`Φ`,`F`],[`Χ`,`X`],[`Ψ`,`PS`],[`Ω`,`O`],[`Ά`,`A`],[`Έ`,`E`],[`Ί`,`I`],[`Ό`,`O`],[`Ύ`,`Y`],[`Ή`,`I`],[`Ώ`,`O`],[`Ϊ`,`I`],[`Ϋ`,`Y`],[`ϐ`,`v`],[`ϑ`,`th`],[`ϕ`,`f`],[`ϖ`,`p`],[`ϰ`,`k`],[`ϱ`,`r`],[`ϲ`,`s`],[`ϳ`,`j`],[`ϵ`,`e`],[`ϒ`,`Y`],[`ϓ`,`Y`],[`ϔ`,`Y`],[`ϴ`,`TH`],[`ϗ`,`k`],[`Ϗ`,`K`],[`϶`,`e`],[`ᴦ`,`g`],[`ᴧ`,`l`],[`ᴨ`,`p`],[`ᴩ`,`r`],[`ᴪ`,`ps`],[`Ͱ`,`H`],[`ͱ`,`h`],[`Ͳ`,`SS`],[`ͳ`,`ss`],[`Ͷ`,`W`],[`ͷ`,`w`],[`Ϳ`,`J`],[`Ϸ`,`SH`],[`ϸ`,`sh`],[`Ϙ`,`Q`],[`ϙ`,`q`],[`Ϛ`,`ST`],[`ϛ`,`st`],[`Ϝ`,`W`],[`ϝ`,`w`],[`Ϟ`,`Q`],[`ϟ`,`q`],[`Ϡ`,`SS`],[`ϡ`,`ss`],[`Ϻ`,`S`],[`ϻ`,`s`],[`ϼ`,`r`],[`Ϲ`,`S`],[`Ͻ`,`S`],[`Ͼ`,`S`],[`Ͽ`,`S`],[`ͻ`,`s`],[`ͼ`,`s`],[`ͽ`,`s`],[`ā`,`a`],[`ē`,`e`],[`ģ`,`g`],[`ī`,`i`],[`ķ`,`k`],[`ļ`,`l`],[`ņ`,`n`],[`ū`,`u`],[`Ā`,`A`],[`Ē`,`E`],[`Ģ`,`G`],[`Ī`,`I`],[`Ķ`,`K`],[`Ļ`,`L`],[`Ņ`,`N`],[`Ū`,`U`],[`ą`,`a`],[`ę`,`e`],[`ė`,`e`],[`į`,`i`],[`ų`,`u`],[`Ą`,`A`],[`Ę`,`E`],[`Ė`,`E`],[`Į`,`I`],[`Ų`,`U`],[`Ѓ`,`Gj`],[`ѓ`,`gj`],[`Ѕ`,`Dz`],[`ѕ`,`dz`],[`Ј`,`J`],[`ј`,`j`],[`Ќ`,`Kj`],[`ќ`,`kj`],[`Љ`,`Lj`],[`љ`,`lj`],[`Њ`,`Nj`],[`њ`,`nj`],[`Џ`,`Dz`],[`џ`,`dz`],[`Тс`,`Ts`],[`тс`,`ts`],[`Ђ`,`Dj`],[`ђ`,`dj`],[`Ћ`,`C`],[`ћ`,`c`],[`ć`,`c`],[`ł`,`l`],[`ń`,`n`],[`ś`,`s`],[`ź`,`z`],[`ż`,`z`],[`Ć`,`C`],[`Ł`,`L`],[`Ń`,`N`],[`Ś`,`S`],[`Ź`,`Z`],[`Ż`,`Z`],[`Є`,`Ye`],[`І`,`I`],[`Ї`,`Yi`],[`Ґ`,`G`],[`є`,`ye`],[`і`,`i`],[`ї`,`yi`],[`ґ`,`g`],[`IJ`,`IJ`],[`ij`,`ij`],[`¢`,`c`],[`£`,`L`],[`¥`,`Y`],[`߿`,`b`],[`৳`,`t`],[`૱`,`Bo`],[`฿`,`B`],[`₠`,`CE`],[`₡`,`C`],[`₢`,`Cr`],[`₣`,`F`],[`₤`,`L`],[`₥`,`m`],[`₦`,`N`],[`₧`,`Pt`],[`₨`,`Rs`],[`₩`,`W`],[`₫`,`d`],[`€`,`E`],[`₭`,`K`],[`₮`,`T`],[`₯`,`Dp`],[`₰`,`S`],[`₱`,`P`],[`₲`,`G`],[`₳`,`A`],[`₴`,`S`],[`₵`,`C`],[`₶`,`tt`],[`₷`,`S`],[`₸`,`T`],[`₹`,`R`],[`₺`,`L`],[`₽`,`P`],[`₿`,`B`],[`﹩`,`$`],[`¢`,`c`],[`£`,`L`],[`¥`,`Y`],[`₩`,`W`],...WCe,[`𝐀`,`A`],[`𝐁`,`B`],[`𝐂`,`C`],[`𝐃`,`D`],[`𝐄`,`E`],[`𝐅`,`F`],[`𝐆`,`G`],[`𝐇`,`H`],[`𝐈`,`I`],[`𝐉`,`J`],[`𝐊`,`K`],[`𝐋`,`L`],[`𝐌`,`M`],[`𝐍`,`N`],[`𝐎`,`O`],[`𝐏`,`P`],[`𝐐`,`Q`],[`𝐑`,`R`],[`𝐒`,`S`],[`𝐓`,`T`],[`𝐔`,`U`],[`𝐕`,`V`],[`𝐖`,`W`],[`𝐗`,`X`],[`𝐘`,`Y`],[`𝐙`,`Z`],[`𝐚`,`a`],[`𝐛`,`b`],[`𝐜`,`c`],[`𝐝`,`d`],[`𝐞`,`e`],[`𝐟`,`f`],[`𝐠`,`g`],[`𝐡`,`h`],[`𝐢`,`i`],[`𝐣`,`j`],[`𝐤`,`k`],[`𝐥`,`l`],[`𝐦`,`m`],[`𝐧`,`n`],[`𝐨`,`o`],[`𝐩`,`p`],[`𝐪`,`q`],[`𝐫`,`r`],[`𝐬`,`s`],[`𝐭`,`t`],[`𝐮`,`u`],[`𝐯`,`v`],[`𝐰`,`w`],[`𝐱`,`x`],[`𝐲`,`y`],[`𝐳`,`z`],[`𝐴`,`A`],[`𝐵`,`B`],[`𝐶`,`C`],[`𝐷`,`D`],[`𝐸`,`E`],[`𝐹`,`F`],[`𝐺`,`G`],[`𝐻`,`H`],[`𝐼`,`I`],[`𝐽`,`J`],[`𝐾`,`K`],[`𝐿`,`L`],[`𝑀`,`M`],[`𝑁`,`N`],[`𝑂`,`O`],[`𝑃`,`P`],[`𝑄`,`Q`],[`𝑅`,`R`],[`𝑆`,`S`],[`𝑇`,`T`],[`𝑈`,`U`],[`𝑉`,`V`],[`𝑊`,`W`],[`𝑋`,`X`],[`𝑌`,`Y`],[`𝑍`,`Z`],[`𝑎`,`a`],[`𝑏`,`b`],[`𝑐`,`c`],[`𝑑`,`d`],[`𝑒`,`e`],[`𝑓`,`f`],[`𝑔`,`g`],[`𝑖`,`i`],[`𝑗`,`j`],[`𝑘`,`k`],[`𝑙`,`l`],[`𝑚`,`m`],[`𝑛`,`n`],[`𝑜`,`o`],[`𝑝`,`p`],[`𝑞`,`q`],[`𝑟`,`r`],[`𝑠`,`s`],[`𝑡`,`t`],[`𝑢`,`u`],[`𝑣`,`v`],[`𝑤`,`w`],[`𝑥`,`x`],[`𝑦`,`y`],[`𝑧`,`z`],[`𝑨`,`A`],[`𝑩`,`B`],[`𝑪`,`C`],[`𝑫`,`D`],[`𝑬`,`E`],[`𝑭`,`F`],[`𝑮`,`G`],[`𝑯`,`H`],[`𝑰`,`I`],[`𝑱`,`J`],[`𝑲`,`K`],[`𝑳`,`L`],[`𝑴`,`M`],[`𝑵`,`N`],[`𝑶`,`O`],[`𝑷`,`P`],[`𝑸`,`Q`],[`𝑹`,`R`],[`𝑺`,`S`],[`𝑻`,`T`],[`𝑼`,`U`],[`𝑽`,`V`],[`𝑾`,`W`],[`𝑿`,`X`],[`𝒀`,`Y`],[`𝒁`,`Z`],[`𝒂`,`a`],[`𝒃`,`b`],[`𝒄`,`c`],[`𝒅`,`d`],[`𝒆`,`e`],[`𝒇`,`f`],[`𝒈`,`g`],[`𝒉`,`h`],[`𝒊`,`i`],[`𝒋`,`j`],[`𝒌`,`k`],[`𝒍`,`l`],[`𝒎`,`m`],[`𝒏`,`n`],[`𝒐`,`o`],[`𝒑`,`p`],[`𝒒`,`q`],[`𝒓`,`r`],[`𝒔`,`s`],[`𝒕`,`t`],[`𝒖`,`u`],[`𝒗`,`v`],[`𝒘`,`w`],[`𝒙`,`x`],[`𝒚`,`y`],[`𝒛`,`z`],[`𝒜`,`A`],[`𝒞`,`C`],[`𝒟`,`D`],[`𝒢`,`G`],[`𝒥`,`J`],[`𝒦`,`K`],[`𝒩`,`N`],[`𝒪`,`O`],[`𝒫`,`P`],[`𝒬`,`Q`],[`𝒮`,`S`],[`𝒯`,`T`],[`𝒰`,`U`],[`𝒱`,`V`],[`𝒲`,`W`],[`𝒳`,`X`],[`𝒴`,`Y`],[`𝒵`,`Z`],[`𝒶`,`a`],[`𝒷`,`b`],[`𝒸`,`c`],[`𝒹`,`d`],[`𝒻`,`f`],[`𝒽`,`h`],[`𝒾`,`i`],[`𝒿`,`j`],[`𝓀`,`k`],[`𝓁`,`l`],[`𝓂`,`m`],[`𝓃`,`n`],[`𝓅`,`p`],[`𝓆`,`q`],[`𝓇`,`r`],[`𝓈`,`s`],[`𝓉`,`t`],[`𝓊`,`u`],[`𝓋`,`v`],[`𝓌`,`w`],[`𝓍`,`x`],[`𝓎`,`y`],[`𝓏`,`z`],[`𝓐`,`A`],[`𝓑`,`B`],[`𝓒`,`C`],[`𝓓`,`D`],[`𝓔`,`E`],[`𝓕`,`F`],[`𝓖`,`G`],[`𝓗`,`H`],[`𝓘`,`I`],[`𝓙`,`J`],[`𝓚`,`K`],[`𝓛`,`L`],[`𝓜`,`M`],[`𝓝`,`N`],[`𝓞`,`O`],[`𝓟`,`P`],[`𝓠`,`Q`],[`𝓡`,`R`],[`𝓢`,`S`],[`𝓣`,`T`],[`𝓤`,`U`],[`𝓥`,`V`],[`𝓦`,`W`],[`𝓧`,`X`],[`𝓨`,`Y`],[`𝓩`,`Z`],[`𝓪`,`a`],[`𝓫`,`b`],[`𝓬`,`c`],[`𝓭`,`d`],[`𝓮`,`e`],[`𝓯`,`f`],[`𝓰`,`g`],[`𝓱`,`h`],[`𝓲`,`i`],[`𝓳`,`j`],[`𝓴`,`k`],[`𝓵`,`l`],[`𝓶`,`m`],[`𝓷`,`n`],[`𝓸`,`o`],[`𝓹`,`p`],[`𝓺`,`q`],[`𝓻`,`r`],[`𝓼`,`s`],[`𝓽`,`t`],[`𝓾`,`u`],[`𝓿`,`v`],[`𝔀`,`w`],[`𝔁`,`x`],[`𝔂`,`y`],[`𝔃`,`z`],[`𝔄`,`A`],[`𝔅`,`B`],[`𝔇`,`D`],[`𝔈`,`E`],[`𝔉`,`F`],[`𝔊`,`G`],[`𝔍`,`J`],[`𝔎`,`K`],[`𝔏`,`L`],[`𝔐`,`M`],[`𝔑`,`N`],[`𝔒`,`O`],[`𝔓`,`P`],[`𝔔`,`Q`],[`𝔖`,`S`],[`𝔗`,`T`],[`𝔘`,`U`],[`𝔙`,`V`],[`𝔚`,`W`],[`𝔛`,`X`],[`𝔜`,`Y`],[`𝔞`,`a`],[`𝔟`,`b`],[`𝔠`,`c`],[`𝔡`,`d`],[`𝔢`,`e`],[`𝔣`,`f`],[`𝔤`,`g`],[`𝔥`,`h`],[`𝔦`,`i`],[`𝔧`,`j`],[`𝔨`,`k`],[`𝔩`,`l`],[`𝔪`,`m`],[`𝔫`,`n`],[`𝔬`,`o`],[`𝔭`,`p`],[`𝔮`,`q`],[`𝔯`,`r`],[`𝔰`,`s`],[`𝔱`,`t`],[`𝔲`,`u`],[`𝔳`,`v`],[`𝔴`,`w`],[`𝔵`,`x`],[`𝔶`,`y`],[`𝔷`,`z`],[`𝔸`,`A`],[`𝔹`,`B`],[`𝔻`,`D`],[`𝔼`,`E`],[`𝔽`,`F`],[`𝔾`,`G`],[`𝕀`,`I`],[`𝕁`,`J`],[`𝕂`,`K`],[`𝕃`,`L`],[`𝕄`,`M`],[`𝕆`,`O`],[`𝕊`,`S`],[`𝕋`,`T`],[`𝕌`,`U`],[`𝕍`,`V`],[`𝕎`,`W`],[`𝕏`,`X`],[`𝕐`,`Y`],[`𝕒`,`a`],[`𝕓`,`b`],[`𝕔`,`c`],[`𝕕`,`d`],[`𝕖`,`e`],[`𝕗`,`f`],[`𝕘`,`g`],[`𝕙`,`h`],[`𝕚`,`i`],[`𝕛`,`j`],[`𝕜`,`k`],[`𝕝`,`l`],[`𝕞`,`m`],[`𝕟`,`n`],[`𝕠`,`o`],[`𝕡`,`p`],[`𝕢`,`q`],[`𝕣`,`r`],[`𝕤`,`s`],[`𝕥`,`t`],[`𝕦`,`u`],[`𝕧`,`v`],[`𝕨`,`w`],[`𝕩`,`x`],[`𝕪`,`y`],[`𝕫`,`z`],[`𝕬`,`A`],[`𝕭`,`B`],[`𝕮`,`C`],[`𝕯`,`D`],[`𝕰`,`E`],[`𝕱`,`F`],[`𝕲`,`G`],[`𝕳`,`H`],[`𝕴`,`I`],[`𝕵`,`J`],[`𝕶`,`K`],[`𝕷`,`L`],[`𝕸`,`M`],[`𝕹`,`N`],[`𝕺`,`O`],[`𝕻`,`P`],[`𝕼`,`Q`],[`𝕽`,`R`],[`𝕾`,`S`],[`𝕿`,`T`],[`𝖀`,`U`],[`𝖁`,`V`],[`𝖂`,`W`],[`𝖃`,`X`],[`𝖄`,`Y`],[`𝖅`,`Z`],[`𝖆`,`a`],[`𝖇`,`b`],[`𝖈`,`c`],[`𝖉`,`d`],[`𝖊`,`e`],[`𝖋`,`f`],[`𝖌`,`g`],[`𝖍`,`h`],[`𝖎`,`i`],[`𝖏`,`j`],[`𝖐`,`k`],[`𝖑`,`l`],[`𝖒`,`m`],[`𝖓`,`n`],[`𝖔`,`o`],[`𝖕`,`p`],[`𝖖`,`q`],[`𝖗`,`r`],[`𝖘`,`s`],[`𝖙`,`t`],[`𝖚`,`u`],[`𝖛`,`v`],[`𝖜`,`w`],[`𝖝`,`x`],[`𝖞`,`y`],[`𝖟`,`z`],[`𝖠`,`A`],[`𝖡`,`B`],[`𝖢`,`C`],[`𝖣`,`D`],[`𝖤`,`E`],[`𝖥`,`F`],[`𝖦`,`G`],[`𝖧`,`H`],[`𝖨`,`I`],[`𝖩`,`J`],[`𝖪`,`K`],[`𝖫`,`L`],[`𝖬`,`M`],[`𝖭`,`N`],[`𝖮`,`O`],[`𝖯`,`P`],[`𝖰`,`Q`],[`𝖱`,`R`],[`𝖲`,`S`],[`𝖳`,`T`],[`𝖴`,`U`],[`𝖵`,`V`],[`𝖶`,`W`],[`𝖷`,`X`],[`𝖸`,`Y`],[`𝖹`,`Z`],[`𝖺`,`a`],[`𝖻`,`b`],[`𝖼`,`c`],[`𝖽`,`d`],[`𝖾`,`e`],[`𝖿`,`f`],[`𝗀`,`g`],[`𝗁`,`h`],[`𝗂`,`i`],[`𝗃`,`j`],[`𝗄`,`k`],[`𝗅`,`l`],[`𝗆`,`m`],[`𝗇`,`n`],[`𝗈`,`o`],[`𝗉`,`p`],[`𝗊`,`q`],[`𝗋`,`r`],[`𝗌`,`s`],[`𝗍`,`t`],[`𝗎`,`u`],[`𝗏`,`v`],[`𝗐`,`w`],[`𝗑`,`x`],[`𝗒`,`y`],[`𝗓`,`z`],[`𝗔`,`A`],[`𝗕`,`B`],[`𝗖`,`C`],[`𝗗`,`D`],[`𝗘`,`E`],[`𝗙`,`F`],[`𝗚`,`G`],[`𝗛`,`H`],[`𝗜`,`I`],[`𝗝`,`J`],[`𝗞`,`K`],[`𝗟`,`L`],[`𝗠`,`M`],[`𝗡`,`N`],[`𝗢`,`O`],[`𝗣`,`P`],[`𝗤`,`Q`],[`𝗥`,`R`],[`𝗦`,`S`],[`𝗧`,`T`],[`𝗨`,`U`],[`𝗩`,`V`],[`𝗪`,`W`],[`𝗫`,`X`],[`𝗬`,`Y`],[`𝗭`,`Z`],[`𝗮`,`a`],[`𝗯`,`b`],[`𝗰`,`c`],[`𝗱`,`d`],[`𝗲`,`e`],[`𝗳`,`f`],[`𝗴`,`g`],[`𝗵`,`h`],[`𝗶`,`i`],[`𝗷`,`j`],[`𝗸`,`k`],[`𝗹`,`l`],[`𝗺`,`m`],[`𝗻`,`n`],[`𝗼`,`o`],[`𝗽`,`p`],[`𝗾`,`q`],[`𝗿`,`r`],[`𝘀`,`s`],[`𝘁`,`t`],[`𝘂`,`u`],[`𝘃`,`v`],[`𝘄`,`w`],[`𝘅`,`x`],[`𝘆`,`y`],[`𝘇`,`z`],[`𝘈`,`A`],[`𝘉`,`B`],[`𝘊`,`C`],[`𝘋`,`D`],[`𝘌`,`E`],[`𝘍`,`F`],[`𝘎`,`G`],[`𝘏`,`H`],[`𝘐`,`I`],[`𝘑`,`J`],[`𝘒`,`K`],[`𝘓`,`L`],[`𝘔`,`M`],[`𝘕`,`N`],[`𝘖`,`O`],[`𝘗`,`P`],[`𝘘`,`Q`],[`𝘙`,`R`],[`𝘚`,`S`],[`𝘛`,`T`],[`𝘜`,`U`],[`𝘝`,`V`],[`𝘞`,`W`],[`𝘟`,`X`],[`𝘠`,`Y`],[`𝘡`,`Z`],[`𝘢`,`a`],[`𝘣`,`b`],[`𝘤`,`c`],[`𝘥`,`d`],[`𝘦`,`e`],[`𝘧`,`f`],[`𝘨`,`g`],[`𝘩`,`h`],[`𝘪`,`i`],[`𝘫`,`j`],[`𝘬`,`k`],[`𝘭`,`l`],[`𝘮`,`m`],[`𝘯`,`n`],[`𝘰`,`o`],[`𝘱`,`p`],[`𝘲`,`q`],[`𝘳`,`r`],[`𝘴`,`s`],[`𝘵`,`t`],[`𝘶`,`u`],[`𝘷`,`v`],[`𝘸`,`w`],[`𝘹`,`x`],[`𝘺`,`y`],[`𝘻`,`z`],[`𝘼`,`A`],[`𝘽`,`B`],[`𝘾`,`C`],[`𝘿`,`D`],[`𝙀`,`E`],[`𝙁`,`F`],[`𝙂`,`G`],[`𝙃`,`H`],[`𝙄`,`I`],[`𝙅`,`J`],[`𝙆`,`K`],[`𝙇`,`L`],[`𝙈`,`M`],[`𝙉`,`N`],[`𝙊`,`O`],[`𝙋`,`P`],[`𝙌`,`Q`],[`𝙍`,`R`],[`𝙎`,`S`],[`𝙏`,`T`],[`𝙐`,`U`],[`𝙑`,`V`],[`𝙒`,`W`],[`𝙓`,`X`],[`𝙔`,`Y`],[`𝙕`,`Z`],[`𝙖`,`a`],[`𝙗`,`b`],[`𝙘`,`c`],[`𝙙`,`d`],[`𝙚`,`e`],[`𝙛`,`f`],[`𝙜`,`g`],[`𝙝`,`h`],[`𝙞`,`i`],[`𝙟`,`j`],[`𝙠`,`k`],[`𝙡`,`l`],[`𝙢`,`m`],[`𝙣`,`n`],[`𝙤`,`o`],[`𝙥`,`p`],[`𝙦`,`q`],[`𝙧`,`r`],[`𝙨`,`s`],[`𝙩`,`t`],[`𝙪`,`u`],[`𝙫`,`v`],[`𝙬`,`w`],[`𝙭`,`x`],[`𝙮`,`y`],[`𝙯`,`z`],[`𝙰`,`A`],[`𝙱`,`B`],[`𝙲`,`C`],[`𝙳`,`D`],[`𝙴`,`E`],[`𝙵`,`F`],[`𝙶`,`G`],[`𝙷`,`H`],[`𝙸`,`I`],[`𝙹`,`J`],[`𝙺`,`K`],[`𝙻`,`L`],[`𝙼`,`M`],[`𝙽`,`N`],[`𝙾`,`O`],[`𝙿`,`P`],[`𝚀`,`Q`],[`𝚁`,`R`],[`𝚂`,`S`],[`𝚃`,`T`],[`𝚄`,`U`],[`𝚅`,`V`],[`𝚆`,`W`],[`𝚇`,`X`],[`𝚈`,`Y`],[`𝚉`,`Z`],[`𝚊`,`a`],[`𝚋`,`b`],[`𝚌`,`c`],[`𝚍`,`d`],[`𝚎`,`e`],[`𝚏`,`f`],[`𝚐`,`g`],[`𝚑`,`h`],[`𝚒`,`i`],[`𝚓`,`j`],[`𝚔`,`k`],[`𝚕`,`l`],[`𝚖`,`m`],[`𝚗`,`n`],[`𝚘`,`o`],[`𝚙`,`p`],[`𝚚`,`q`],[`𝚛`,`r`],[`𝚜`,`s`],[`𝚝`,`t`],[`𝚞`,`u`],[`𝚟`,`v`],[`𝚠`,`w`],[`𝚡`,`x`],[`𝚢`,`y`],[`𝚣`,`z`],[`𝚤`,`i`],[`𝚥`,`j`],[`𝚨`,`A`],[`𝚩`,`V`],[`𝚪`,`G`],[`𝚫`,`D`],[`𝚬`,`E`],[`𝚭`,`Z`],[`𝚮`,`I`],[`𝚯`,`TH`],[`𝚰`,`I`],[`𝚱`,`K`],[`𝚲`,`L`],[`𝚳`,`M`],[`𝚴`,`N`],[`𝚵`,`KS`],[`𝚶`,`O`],[`𝚷`,`P`],[`𝚸`,`R`],[`𝚹`,`TH`],[`𝚺`,`S`],[`𝚻`,`T`],[`𝚼`,`Y`],[`𝚽`,`F`],[`𝚾`,`X`],[`𝚿`,`PS`],[`𝛀`,`O`],[`𝛁`,`D`],[`𝛂`,`a`],[`𝛃`,`v`],[`𝛄`,`g`],[`𝛅`,`d`],[`𝛆`,`e`],[`𝛇`,`z`],[`𝛈`,`i`],[`𝛉`,`th`],[`𝛊`,`i`],[`𝛋`,`k`],[`𝛌`,`l`],[`𝛍`,`m`],[`𝛎`,`n`],[`𝛏`,`ks`],[`𝛐`,`o`],[`𝛑`,`p`],[`𝛒`,`r`],[`𝛓`,`s`],[`𝛔`,`s`],[`𝛕`,`t`],[`𝛖`,`y`],[`𝛗`,`f`],[`𝛘`,`x`],[`𝛙`,`ps`],[`𝛚`,`o`],[`𝛛`,`d`],[`𝛜`,`e`],[`𝛝`,`th`],[`𝛞`,`k`],[`𝛟`,`f`],[`𝛠`,`r`],[`𝛡`,`p`],[`𝛢`,`A`],[`𝛣`,`V`],[`𝛤`,`G`],[`𝛥`,`D`],[`𝛦`,`E`],[`𝛧`,`Z`],[`𝛨`,`I`],[`𝛩`,`TH`],[`𝛪`,`I`],[`𝛫`,`K`],[`𝛬`,`L`],[`𝛭`,`M`],[`𝛮`,`N`],[`𝛯`,`KS`],[`𝛰`,`O`],[`𝛱`,`P`],[`𝛲`,`R`],[`𝛳`,`TH`],[`𝛴`,`S`],[`𝛵`,`T`],[`𝛶`,`Y`],[`𝛷`,`F`],[`𝛸`,`X`],[`𝛹`,`PS`],[`𝛺`,`O`],[`𝛻`,`D`],[`𝛼`,`a`],[`𝛽`,`v`],[`𝛾`,`g`],[`𝛿`,`d`],[`𝜀`,`e`],[`𝜁`,`z`],[`𝜂`,`i`],[`𝜃`,`th`],[`𝜄`,`i`],[`𝜅`,`k`],[`𝜆`,`l`],[`𝜇`,`m`],[`𝜈`,`n`],[`𝜉`,`ks`],[`𝜊`,`o`],[`𝜋`,`p`],[`𝜌`,`r`],[`𝜍`,`s`],[`𝜎`,`s`],[`𝜏`,`t`],[`𝜐`,`y`],[`𝜑`,`f`],[`𝜒`,`x`],[`𝜓`,`ps`],[`𝜔`,`o`],[`𝜕`,`d`],[`𝜖`,`e`],[`𝜗`,`th`],[`𝜘`,`k`],[`𝜙`,`f`],[`𝜚`,`r`],[`𝜛`,`p`],[`𝜜`,`A`],[`𝜝`,`V`],[`𝜞`,`G`],[`𝜟`,`D`],[`𝜠`,`E`],[`𝜡`,`Z`],[`𝜢`,`I`],[`𝜣`,`TH`],[`𝜤`,`I`],[`𝜥`,`K`],[`𝜦`,`L`],[`𝜧`,`M`],[`𝜨`,`N`],[`𝜩`,`KS`],[`𝜪`,`O`],[`𝜫`,`P`],[`𝜬`,`R`],[`𝜭`,`TH`],[`𝜮`,`S`],[`𝜯`,`T`],[`𝜰`,`Y`],[`𝜱`,`F`],[`𝜲`,`X`],[`𝜳`,`PS`],[`𝜴`,`O`],[`𝜵`,`D`],[`𝜶`,`a`],[`𝜷`,`v`],[`𝜸`,`g`],[`𝜹`,`d`],[`𝜺`,`e`],[`𝜻`,`z`],[`𝜼`,`i`],[`𝜽`,`th`],[`𝜾`,`i`],[`𝜿`,`k`],[`𝝀`,`l`],[`𝝁`,`m`],[`𝝂`,`n`],[`𝝃`,`ks`],[`𝝄`,`o`],[`𝝅`,`p`],[`𝝆`,`r`],[`𝝇`,`s`],[`𝝈`,`s`],[`𝝉`,`t`],[`𝝊`,`y`],[`𝝋`,`f`],[`𝝌`,`x`],[`𝝍`,`ps`],[`𝝎`,`o`],[`𝝏`,`d`],[`𝝐`,`e`],[`𝝑`,`th`],[`𝝒`,`k`],[`𝝓`,`f`],[`𝝔`,`r`],[`𝝕`,`p`],[`𝝖`,`A`],[`𝝗`,`V`],[`𝝘`,`G`],[`𝝙`,`D`],[`𝝚`,`E`],[`𝝛`,`Z`],[`𝝜`,`I`],[`𝝝`,`TH`],[`𝝞`,`I`],[`𝝟`,`K`],[`𝝠`,`L`],[`𝝡`,`M`],[`𝝢`,`N`],[`𝝣`,`KS`],[`𝝤`,`O`],[`𝝥`,`P`],[`𝝦`,`R`],[`𝝧`,`TH`],[`𝝨`,`S`],[`𝝩`,`T`],[`𝝪`,`Y`],[`𝝫`,`F`],[`𝝬`,`X`],[`𝝭`,`PS`],[`𝝮`,`O`],[`𝝯`,`D`],[`𝝰`,`a`],[`𝝱`,`v`],[`𝝲`,`g`],[`𝝳`,`d`],[`𝝴`,`e`],[`𝝵`,`z`],[`𝝶`,`i`],[`𝝷`,`th`],[`𝝸`,`i`],[`𝝹`,`k`],[`𝝺`,`l`],[`𝝻`,`m`],[`𝝼`,`n`],[`𝝽`,`ks`],[`𝝾`,`o`],[`𝝿`,`p`],[`𝞀`,`r`],[`𝞁`,`s`],[`𝞂`,`s`],[`𝞃`,`t`],[`𝞄`,`y`],[`𝞅`,`f`],[`𝞆`,`x`],[`𝞇`,`ps`],[`𝞈`,`o`],[`𝞉`,`d`],[`𝞊`,`e`],[`𝞋`,`th`],[`𝞌`,`k`],[`𝞍`,`f`],[`𝞎`,`r`],[`𝞏`,`p`],[`𝞐`,`A`],[`𝞑`,`V`],[`𝞒`,`G`],[`𝞓`,`D`],[`𝞔`,`E`],[`𝞕`,`Z`],[`𝞖`,`I`],[`𝞗`,`TH`],[`𝞘`,`I`],[`𝞙`,`K`],[`𝞚`,`L`],[`𝞛`,`M`],[`𝞜`,`N`],[`𝞝`,`KS`],[`𝞞`,`O`],[`𝞟`,`P`],[`𝞠`,`R`],[`𝞡`,`TH`],[`𝞢`,`S`],[`𝞣`,`T`],[`𝞤`,`Y`],[`𝞥`,`F`],[`𝞦`,`X`],[`𝞧`,`PS`],[`𝞨`,`O`],[`𝞩`,`D`],[`𝞪`,`a`],[`𝞫`,`v`],[`𝞬`,`g`],[`𝞭`,`d`],[`𝞮`,`e`],[`𝞯`,`z`],[`𝞰`,`i`],[`𝞱`,`th`],[`𝞲`,`i`],[`𝞳`,`k`],[`𝞴`,`l`],[`𝞵`,`m`],[`𝞶`,`n`],[`𝞷`,`ks`],[`𝞸`,`o`],[`𝞹`,`p`],[`𝞺`,`r`],[`𝞻`,`s`],[`𝞼`,`s`],[`𝞽`,`t`],[`𝞾`,`y`],[`𝞿`,`f`],[`𝟀`,`x`],[`𝟁`,`ps`],[`𝟂`,`o`],[`𝟃`,`d`],[`𝟄`,`e`],[`𝟅`,`th`],[`𝟆`,`k`],[`𝟇`,`f`],[`𝟈`,`r`],[`𝟉`,`p`],[`𝟊`,`W`],[`𝟋`,`w`],[`⒜`,`(a)`],[`⒝`,`(b)`],[`⒞`,`(c)`],[`⒟`,`(d)`],[`⒠`,`(e)`],[`⒡`,`(f)`],[`⒢`,`(g)`],[`⒣`,`(h)`],[`⒤`,`(i)`],[`⒥`,`(j)`],[`⒦`,`(k)`],[`⒧`,`(l)`],[`⒨`,`(m)`],[`⒩`,`(n)`],[`⒪`,`(o)`],[`⒫`,`(p)`],[`⒬`,`(q)`],[`⒭`,`(r)`],[`⒮`,`(s)`],[`⒯`,`(t)`],[`⒰`,`(u)`],[`⒱`,`(v)`],[`⒲`,`(w)`],[`⒳`,`(x)`],[`⒴`,`(y)`],[`⒵`,`(z)`],[`Ⓐ`,`(A)`],[`Ⓑ`,`(B)`],[`Ⓒ`,`(C)`],[`Ⓓ`,`(D)`],[`Ⓔ`,`(E)`],[`Ⓕ`,`(F)`],[`Ⓖ`,`(G)`],[`Ⓗ`,`(H)`],[`Ⓘ`,`(I)`],[`Ⓙ`,`(J)`],[`Ⓚ`,`(K)`],[`Ⓛ`,`(L)`],[`Ⓜ`,`(M)`],[`Ⓝ`,`(N)`],[`Ⓞ`,`(O)`],[`Ⓟ`,`(P)`],[`Ⓠ`,`(Q)`],[`Ⓡ`,`(R)`],[`Ⓢ`,`(S)`],[`Ⓣ`,`(T)`],[`Ⓤ`,`(U)`],[`Ⓥ`,`(V)`],[`Ⓦ`,`(W)`],[`Ⓧ`,`(X)`],[`Ⓨ`,`(Y)`],[`Ⓩ`,`(Z)`],[`ⓐ`,`(a)`],[`ⓑ`,`(b)`],[`ⓒ`,`(c)`],[`ⓓ`,`(d)`],[`ⓔ`,`(e)`],[`ⓕ`,`(f)`],[`ⓖ`,`(g)`],[`ⓗ`,`(h)`],[`ⓘ`,`(i)`],[`ⓙ`,`(j)`],[`ⓚ`,`(k)`],[`ⓛ`,`(l)`],[`ⓜ`,`(m)`],[`ⓝ`,`(n)`],[`ⓞ`,`(o)`],[`ⓟ`,`(p)`],[`ⓠ`,`(q)`],[`ⓡ`,`(r)`],[`ⓢ`,`(s)`],[`ⓣ`,`(t)`],[`ⓤ`,`(u)`],[`ⓥ`,`(v)`],[`ⓦ`,`(w)`],[`ⓧ`,`(x)`],[`ⓨ`,`(y)`],[`ⓩ`,`(z)`],[`Ċ`,`C`],[`ċ`,`c`],[`Ġ`,`G`],[`ġ`,`g`],[`Ħ`,`H`],[`ħ`,`h`],[`½`,`1/2`],[`⅓`,`1/3`],[`⅔`,`2/3`],[`¼`,`1/4`],[`¾`,`3/4`],[`⅕`,`1/5`],[`⅖`,`2/5`],[`⅗`,`3/5`],[`⅘`,`4/5`],[`⅙`,`1/6`],[`⅚`,`5/6`],[`⅐`,`1/7`],[`⅛`,`1/8`],[`⅜`,`3/8`],[`⅝`,`5/8`],[`⅞`,`7/8`],[`⅑`,`1/9`],[`⅒`,`1/10`],[`⅟`,`1/`],[`↉`,`0/3`],[`ↄ`,`c`],[`¹`,`1`],[`²`,`2`],[`³`,`3`],[`⁰`,`0`],[`⁴`,`4`],[`⁵`,`5`],[`⁶`,`6`],[`⁷`,`7`],[`⁸`,`8`],[`⁹`,`9`],[`⁺`,`+`],[`⁻`,`-`],[`⁼`,`=`],[`⁽`,`(`],[`⁾`,`)`],[`₀`,`0`],[`₁`,`1`],[`₂`,`2`],[`₃`,`3`],[`₄`,`4`],[`₅`,`5`],[`₆`,`6`],[`₇`,`7`],[`₈`,`8`],[`₉`,`9`],[`₊`,`+`],[`₋`,`-`],[`₌`,`=`],[`₍`,`(`],[`₎`,`)`],...UCe,[`𞀰`,`a`],[`𞀱`,`b`],[`𞀲`,`v`],[`𞀳`,`g`],[`𞀴`,`d`],[`𞀵`,`e`],[`𞀶`,`zh`],[`𞀷`,`z`],[`𞀸`,`i`],[`𞀹`,`k`],[`𞀺`,`l`],[`𞀻`,`m`],[`𞀼`,`o`],[`𞀽`,`p`],[`𞀾`,`r`],[`𞀿`,`s`],[`𞁀`,`t`],[`𞁁`,`u`],[`𞁂`,`f`],[`𞁃`,`kh`],[`𞁄`,`ts`],[`𞁅`,`ch`],[`𞁆`,`sh`],[`𞁇`,`y`],[`𞁈`,`e`],[`𞁉`,`yu`],[`𞁊`,`dzh`],[`𞁋`,`a`],[`𞁌`,`i`],[`𞁍`,`j`],[`𞁎`,`o`],[`𞁏`,`u`],[`𞁐`,`'`],[`𞁫`,`th`],[`𞁬`,`y`],[`𞁭`,`u`],[`𝟎`,`0`],[`𝟏`,`1`],[`𝟐`,`2`],[`𝟑`,`3`],[`𝟒`,`4`],[`𝟓`,`5`],[`𝟔`,`6`],[`𝟕`,`7`],[`𝟖`,`8`],[`𝟗`,`9`],[`𝟘`,`0`],[`𝟙`,`1`],[`𝟚`,`2`],[`𝟛`,`3`],[`𝟜`,`4`],[`𝟝`,`5`],[`𝟞`,`6`],[`𝟟`,`7`],[`𝟠`,`8`],[`𝟡`,`9`],[`𝟢`,`0`],[`𝟣`,`1`],[`𝟤`,`2`],[`𝟥`,`3`],[`𝟦`,`4`],[`𝟧`,`5`],[`𝟨`,`6`],[`𝟩`,`7`],[`𝟪`,`8`],[`𝟫`,`9`],[`𝟬`,`0`],[`𝟭`,`1`],[`𝟮`,`2`],[`𝟯`,`3`],[`𝟰`,`4`],[`𝟱`,`5`],[`𝟲`,`6`],[`𝟳`,`7`],[`𝟴`,`8`],[`𝟵`,`9`],[`𝟶`,`0`],[`𝟷`,`1`],[`𝟸`,`2`],[`𝟹`,`3`],[`𝟺`,`4`],[`𝟻`,`5`],[`𝟼`,`6`],[`𝟽`,`7`],[`𝟾`,`8`],[`𝟿`,`9`],[`①`,`1`],[`②`,`2`],[`③`,`3`],[`④`,`4`],[`⑤`,`5`],[`⑥`,`6`],[`⑦`,`7`],[`⑧`,`8`],[`⑨`,`9`],[`⑩`,`10`],[`⑪`,`11`],[`⑫`,`12`],[`⑬`,`13`],[`⑭`,`14`],[`⑮`,`15`],[`⑯`,`16`],[`⑰`,`17`],[`⑱`,`18`],[`⑲`,`19`],[`⑳`,`20`],[`⑴`,`1`],[`⑵`,`2`],[`⑶`,`3`],[`⑷`,`4`],[`⑸`,`5`],[`⑹`,`6`],[`⑺`,`7`],[`⑻`,`8`],[`⑼`,`9`],[`⑽`,`10`],[`⑾`,`11`],[`⑿`,`12`],[`⒀`,`13`],[`⒁`,`14`],[`⒂`,`15`],[`⒃`,`16`],[`⒄`,`17`],[`⒅`,`18`],[`⒆`,`19`],[`⒇`,`20`],[`⒈`,`1.`],[`⒉`,`2.`],[`⒊`,`3.`],[`⒋`,`4.`],[`⒌`,`5.`],[`⒍`,`6.`],[`⒎`,`7.`],[`⒏`,`8.`],[`⒐`,`9.`],[`⒑`,`10.`],[`⒒`,`11.`],[`⒓`,`12.`],[`⒔`,`13.`],[`⒕`,`14.`],[`⒖`,`15.`],[`⒗`,`16.`],[`⒘`,`17.`],[`⒙`,`18.`],[`⒚`,`19.`],[`⒛`,`20.`],...GCe,...KCe,[`⓪`,`0`],[`⓫`,`11`],[`⓬`,`12`],[`⓭`,`13`],[`⓮`,`14`],[`⓯`,`15`],[`⓰`,`16`],[`⓱`,`17`],[`⓲`,`18`],[`⓳`,`19`],[`⓴`,`20`],[`⓵`,`1`],[`⓶`,`2`],[`⓷`,`3`],[`⓸`,`4`],[`⓹`,`5`],[`⓺`,`6`],[`⓻`,`7`],[`⓼`,`8`],[`⓽`,`9`],[`⓾`,`10`],[`⓿`,`0`],...zCe,...RCe,[`‘`,`'`],[`’`,`'`],[`‚`,`'`],[`‛`,`'`],[`‹`,`'`],[`›`,`'`],[`′`,`'`],[`‵`,`'`],[`“`,`"`],[`”`,`"`],[`„`,`"`],[`‟`,`"`],[`«`,`"`],[`»`,`"`],[`″`,`"`],[`‶`,`"`],[`‴`,`'''`],[`‷`,`'''`],[`🙰`,`&`],[`🙱`,`&`],[`🙲`,`&`],[`🙳`,`&`],[`🙴`,`&`],[`🙵`,`&`],[`🙶`,`"`],[`🙷`,`"`],[`🙸`,`"`],[`…`,`...`],[`⋯`,`...`],[`‥`,`..`],[`․`,`.`],[`‼`,`!!`],[`⁇`,`??`],[`⁈`,`?!`],[`⁉`,`!?`],[`⩴`,`::=`],[`⩵`,`==`],[`⩶`,`===`],[`⁄`,`/`],[`№`,`No`],[`™`,`(tm)`],[`©`,`(c)`],[`®`,`(r)`],[`¿`,`?`],[`¡`,`!`],[`‽`,`?!`],[`⸘`,`?!`],[`⸜`,`(`],[`⸝`,`)`],[`⸢`,`[`],[`⸣`,`]`],[`⸤`,`[`],[`⸥`,`]`],[`⸦`,`(`],[`⸧`,`)`],[`⸨`,`((`],[`⸩`,`))`],[`⸪`,`:`],[`⸫`,`:`],[`⸮`,`?`],[`⸱`,`.`],[`⸲`,`,`],[`⸴`,`,`],[`⸵`,`;`],[`⸼`,`.`],[`⹁`,`,`],[`⹂`,`"`],[`⹕`,`[`],[`⹖`,`]`],[`⹗`,`[`],[`⹘`,`]`],[`⹙`,`(`],[`⹚`,`)`],[`⹛`,`(`],[`⹜`,`)`],[``,`!`],[``,`!`],[``,`(`],[``,`)`],[`🙹`,`?!`],[`🙺`,`?!`],[`🙻`,`?!`],[`🙼`,`/`],[`🙽`,`\\`],[`🜇`,`AR`],[`🜈`,`V`],[`🜉`,`V`],[`🜆`,`VR`],[`🜅`,`VF`],[`🜩`,`2`],[`🜪`,`5`],[`🝡`,`f`],[`🝢`,`W`],[`🝣`,`U`],[`🝧`,`V`],[`🝨`,`T`],[`🝪`,`V`],[`🝫`,`MB`],[`🝬`,`VB`],[`🝲`,`3B`],[`🝳`,`3B`],[`💯`,`100`],[`🔙`,`BACK`],[`🔚`,`END`],[`🔛`,`ON!`],[`🔜`,`SOON`],[`🔝`,`TOP`],[`🔞`,`18`],[`🔤`,`abc`],[`🔠`,`ABCD`],[`🔡`,`abcd`],[`🔢`,`1234`],[`🔣`,`T&@%`],...[`#`,`*`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`].flatMap(e=>[[`${e}\u{FE0F}\u{20E3}`,e],[`${e}\u{20E3}`,e]]),...[[`🅰`,`A`],[`🅱`,`B`],[`🅾`,`O`]].flatMap(([e,t])=>[[`${e}\u{FE0F}`,t],[e,t]]),[`🔟`,`10`],[`🆎`,`AB`],[`🆑`,`CL`],[`🅿`,`P`],[`🆘`,`SOS`],[`🅲`,`C`],[`🅳`,`D`],[`🅴`,`E`],[`🅵`,`F`],[`🅶`,`G`],[`🅷`,`H`],[`🅸`,`I`],[`🅹`,`J`],[`🅺`,`K`],[`🅻`,`L`],[`🅼`,`M`],[`🅽`,`N`],[`🆀`,`Q`],[`🆁`,`R`],[`🆂`,`S`],[`🆃`,`T`],[`🆄`,`U`],[`🆅`,`V`],[`🆆`,`W`],[`🆇`,`X`],[`🆈`,`Y`],[`🆉`,`Z`],[`−`,`-`],[`⁓`,`-`],[`⁃`,`-`]],GM=new Map(qCe),KM=[[`æ`,`ae`],[`Æ`,`Ae`],[`ø`,`oe`],[`Ø`,`Oe`],[`å`,`aa`],[`Å`,`Aa`]],qM={sv:[[`ä`,`a`],[`Ä`,`A`],[`ö`,`o`],[`Ö`,`O`],[`å`,`a`],[`Å`,`A`]],da:KM,nb:KM,de:[[`ä`,`ae`],[`Ä`,`Ae`],[`ö`,`oe`],[`Ö`,`Oe`],[`ü`,`ue`],[`Ü`,`Ue`],[`ß`,`ss`],[`ẞ`,`Ss`]],tr:[[`â`,`a`],[`Â`,`A`],[`ö`,`o`],[`Ö`,`O`],[`ü`,`u`],[`Ü`,`U`]],hu:[[`ű`,`u`],[`Ű`,`U`],[`ö`,`o`],[`Ö`,`O`],[`ü`,`u`],[`Ü`,`U`],[`á`,`a`],[`Á`,`A`],[`é`,`e`],[`É`,`E`],[`í`,`i`],[`Í`,`I`],[`ó`,`o`],[`Ó`,`O`],[`ú`,`u`],[`Ú`,`U`]],bg:[[`х`,`h`],[`Х`,`H`],[`щ`,`sht`],[`Щ`,`Sht`],[`ъ`,`a`],[`Ъ`,`A`],[`ь`,`y`],[`Ь`,`Y`],[`ъе`,`ae`],[`Ъе`,`Ae`],[`ъЕ`,`aE`],[`ЪЕ`,`AE`]],sr:[[`х`,`h`],[`Х`,`H`],[`ђ`,`dj`],[`Ђ`,`Dj`],[`đ`,`dj`],[`Đ`,`Dj`],[`џ`,`dz`],[`Џ`,`Dz`],[`љ`,`lj`],[`Љ`,`Lj`],[`њ`,`nj`],[`Њ`,`Nj`],[`ћ`,`c`],[`Ћ`,`C`],[`ч`,`ch`],[`Ч`,`Ch`],[`ш`,`sh`],[`Ш`,`Sh`],[`ж`,`zh`],[`Ж`,`Zh`]]};for(let e of Object.keys(qM))qM[e]=new Map(qM[e]);var JM=e=>new RegExp(String.raw`(?<![\p{Letter}\p{Mark}])${e}(?!\p{Mark}*\p{Letter})`,`gv`),YM=e=>new RegExp(String.raw`${e}(?!\p{Mark}*\p{Letter})`,`gv`),JCe={bg:[[JM(`България`),`Bulgaria`],[JM(`БЪЛГАРИЯ`),`BULGARIA`],[JM(`българия`),`bulgaria`],[YM(`ия`),`ia`],[YM(`Ия`),`Ia`],[YM(`ИЯ`),`IA`]]},YCe=e=>e.replaceAll(RegExp(`[$\\(\\)*+.?\\[\\\\\\]^\\{\\|\\}]`,`gv`),String.raw`\$&`),XCe=(e=>{let t=e.keys().toArray().toSorted((e,t)=>t.length-e.length);return new RegExp(t.map(e=>YCe(e)).join(`|`),`gv`)})(GM),ZCe={replacements:GM,contextReplacements:[]},XM=new Map,QCe=e=>{if(e===void 0)return ZCe;let t=XM.get(e);return t===void 0&&(t={replacements:new Map([...GM,...qM[e]]),contextReplacements:JCe[e]??[]},XM.set(e,t)),t},$Ce=e=>{if(!e)return;let t=e.toLowerCase().replace(RegExp(`^(?:no|nn)(?<suffix>-|$)`,`v`),`nb$<suffix>`);if(Object.hasOwn(qM,t))return t;let n=t.split(`-`,1)[0];if(Object.hasOwn(qM,n))return n},ZM=(e,t)=>{if(RegExp(`\\p{Mark}{101}`,`v`).test(e))throw RangeError(`Cannot normalize more than 100 consecutive combining marks`);return e.normalize(t)};function ewe(e,t){if(typeof e!=`string`)throw TypeError(`Expected a string, got \`${typeof e}\``);let{replacements:n,contextReplacements:r}=QCe($Ce(t?.locale)),i=e=>e.replace(XCe,e=>n.get(e)),a=Array.from(t?.customReplacements??[],([e,t])=>[ZM(e),t]);if(a.length===0&&!RegExp(`\\P{ASCII}`,`v`).test(e))return e;if(e=ZM(e),a.length>0){a.sort((e,t)=>t[0].length-e[0].length);for(let[t,n]of a)e=e.replaceAll(t,n);e=ZM(e)}for(let[t,n]of r)e=e.replaceAll(t,()=>n);if(e=e.replaceAll(RegExp(`[\\u{FB50}-\\u{FDFF}\\u{FE70}-\\u{FEFF}]`,`gv`),e=>e.normalize(`NFKC`)),e=i(e),!RegExp(`\\P{ASCII}`,`v`).test(e))return e;let o=ZM(ZM(e,`NFD`).replaceAll(RegExp(`[[\\p{Diacritic}--\\p{ASCII}]--\\u{338}]`,`gv`),``));return o!==e&&(e=i(o)),e=e.replaceAll(RegExp(`[\\p{Dash_Punctuation}--\\-]`,`gv`),`-`),e}var QM=RegExp(`[\\p{Z}[\\p{C}--[\\u200C\\u200D]]!"#$%\\x26'\\(\\)*+,\\/:;<=>?@\\[\\\\\\]^\`\\{\\|\\}]`,`v`),$M=/[^\w-~]/,twe=/^\.+/,nwe=/\.+$/,rwe={unicode:new RegExp(QM,`gv`),ascii:new RegExp($M,`g`)},iwe=new Map,eN=e=>{let t=JE(e);return mA(iwe,t,()=>({consecutivePattern:RegExp(`(?:${t})+`,`g`),trimPattern:RegExp(`^(?:${t})+|(?:${t})+$`,`g`),leadingDotsPattern:RegExp(`^(?:\\.|${t})+`),trailingDotsPattern:RegExp(`(?:\\.|${t})+$`)}))},tN=({sanitize_replacement:e=`-`,trim:t=!0}={})=>e&&t?eN(e).trailingDotsPattern:nwe,nN=e=>e.replace(tN($O.current?.slug),``),rN=()=>$O.current?.slug?.timezone===`local`?void 0:`UTC`,iN=(e,{fallback:t=!0,locale:n=void 0,maxLength:r=void 0}={})=>{let{slug:{encoding:i=`unicode`,clean_accents:a=!1,sanitize_replacement:o=`-`,maxlength:s=void 0,trim:c=!0,lowercase:l=!0}={}}=$O.current??{},u=r??s,d=e;a&&(d=ewe(d.normalize(`NFD`),{locale:n?.replaceAll(`_`,`-`)})),d=d.replaceAll(rwe[i===`ascii`?`ascii`:`unicode`],` `),d=d.trim().replaceAll(/\s+/g,o);let f=twe;if(o){let e=eN(o);d=d.replace(e.consecutivePattern,o),c&&(d=d.replace(e.trimPattern,``),{leadingDotsPattern:f}=e)}let p=tN({sanitize_replacement:o,trim:c});return d=d.replace(f,``),d=d.replace(p,``),!d&&t&&(d=Qc(`short`)),typeof u==`number`&&d.length>u&&(d=YE(d,u,{ellipsis:``}),d=d.replace(p,``)),l&&(d=d.toLowerCase()),d},aN=e=>iN(e.trim(),{fallback:!1}),oN=({takenNames:e,name:t})=>{let n=t.trim();if(!n)return`empty`;let r=aN(n);return!r||n.includes(`/`)||n.startsWith(`.`)?`invalid`:e.includes(r)?`duplicate`:void 0},awe=new Set([`local`,`utc`]),sN=new WeakMap,cN=e=>typeof e==`string`&&!awe.has(e),lN=e=>{let t=sN.get(e);if(t)return t;let{type:n=`datetime-local`,min:r=void 0,max:i=void 0,step:a=void 0,format:o,date_format:s=void 0,time_format:c=void 0,picker_utc:l=!1,input_timezone:u=`local`,output_utc:d=!1}=e,f=typeof u==`string`&&u!==`any`?u:`local`,p=typeof s==`string`?s:``,m=typeof c==`string`?c:``,h=n===`date`||c===!1,g=n===`time`||s===!1,_=h?`9999-12-31`:g?void 0:`9999-12-31T23:59`,v=e.input_timezone===void 0?l?`utc`:`local`:f,y={type:h?`date`:g?`time`:`datetime-local`,min:typeof r==`string`&&r?r:void 0,max:typeof i==`string`&&i?i:_,step:typeof a==`number`&&Number.isInteger(a)&&a>0||a===`any`?a:void 0,format:o||[p,m].join(` `).trim()||void 0,dateOnly:h,timeOnly:g,inputTimeZone:v,outputUTC:e.output_utc===void 0?l:d,utc:v===`utc`,singleCustomTimeZone:cN(v)?v:void 0};return sN.set(e,y),y},owe=[{key:`af`,name:`Afrikaans`},{key:`am`,name:`Amharic`},{key:`ar-iq`,name:` Arabic (Iraq)`},{key:`ar-dz`,name:`Arabic (Algeria)`},{key:`ar-kw`,name:`Arabic (Kuwait)`},{key:`ar-ly`,name:`Arabic (Lybia)`},{key:`ar-ma`,name:`Arabic (Morocco)`},{key:`ar-sa`,name:`Arabic (Saudi Arabia)`},{key:`ar-tn`,name:` Arabic (Tunisia)`},{key:`ar`,name:`Arabic`},{key:`az`,name:`Azerbaijani`},{key:`be`,name:`Belarusian`},{key:`bg`,name:`Bulgarian`},{key:`bi`,name:`Bislama`},{key:`bm`,name:`Bambara`},{key:`bn-bd`,name:`Bengali (Bangladesh)`},{key:`bn`,name:`Bengali`},{key:`bo`,name:`Tibetan`},{key:`br`,name:`Breton`},{key:`bs`,name:`Bosnian`},{key:`ca`,name:`Catalan`},{key:`cs`,name:`Czech`},{key:`cv`,name:`Chuvash`},{key:`cy`,name:`Welsh`},{key:`da`,name:`Danish`},{key:`de-at`,name:`German (Austria)`},{key:`de-ch`,name:`German (Switzerland)`},{key:`de`,name:`German`},{key:`dv`,name:`Maldivian`},{key:`en-au`,name:`English (Australia)`},{key:`el`,name:`Greek`},{key:`en-gb`,name:`English (United Kingdom)`},{key:`en-ie`,name:`English (Ireland)`},{key:`en-il`,name:`English (Israel)`},{key:`en-in`,name:`English (India)`},{key:`en-nz`,name:`English (New Zealand)`},{key:`en-sg`,name:`English (Singapore)`},{key:`en-tt`,name:`English (Trinidad & Tobago)`},{key:`en-ca`,name:`English (Canada)`},{key:`en`,name:`English`},{key:`eo`,name:`Esperanto`},{key:`es-mx`,name:`Spanish (Mexico)`},{key:`es-pr`,name:`Spanish (Puerto Rico)`},{key:`es-us`,name:`Spanish (United States)`},{key:`es-do`,name:`Spanish (Dominican Republic)`},{key:`et`,name:`Estonian`},{key:`eu`,name:`Basque`},{key:`fa`,name:`Persian`},{key:`fi`,name:`Finnish`},{key:`fr-ca`,name:`French (Canada)`},{key:`fr-ch`,name:`French (Switzerland)`},{key:`fr`,name:`French`},{key:`fo`,name:`Faroese`},{key:`fy`,name:`Frisian`},{key:`ga`,name:`Irish or Irish Gaelic`},{key:`gd`,name:`Scottish Gaelic`},{key:`gl`,name:`Galician`},{key:`gom-latn`,name:`Konkani Latin script`},{key:`gu`,name:`Gujarati`},{key:`he`,name:`Hebrew`},{key:`hi`,name:`Hindi`},{key:`hr`,name:`Croatian`},{key:`ht`,name:`Haitian Creole (Haiti)`},{key:`hu`,name:`Hungarian`},{key:`hy-am`,name:`Armenian`},{key:`id`,name:`Indonesian`},{key:`is`,name:`Icelandic`},{key:`it-ch`,name:`Italian (Switzerland)`},{key:`it`,name:`Italian`},{key:`jv`,name:`Javanese`},{key:`ka`,name:`Georgian`},{key:`kk`,name:`Kazakh`},{key:`km`,name:`Cambodian`},{key:`ko`,name:`Korean`},{key:`ku`,name:`Kurdish`},{key:`ky`,name:`Kyrgyz`},{key:`kn`,name:`Kannada`},{key:`lb`,name:`Luxembourgish`},{key:`ja`,name:`Japanese`},{key:`lt`,name:`Lithuanian`},{key:`lv`,name:`Latvian`},{key:`me`,name:`Montenegrin`},{key:`mi`,name:`Maori`},{key:`mk`,name:`Macedonian`},{key:`ml`,name:`Malayalam`},{key:`mn`,name:`Mongolian`},{key:`mr`,name:`Marathi`},{key:`ms-my`,name:`Malay`},{key:`ms`,name:`Malay`},{key:`mt`,name:`Maltese (Malta)`},{key:`lo`,name:`Lao`},{key:`my`,name:`Burmese`},{key:`nb`,name:`Norwegian Bokmål`},{key:`ne`,name:`Nepalese`},{key:`nl`,name:`Dutch`},{key:`nl-be`,name:`Dutch (Belgium)`},{key:`nn`,name:`Nynorsk`},{key:`pa-in`,name:`Punjabi (India)`},{key:`pl`,name:`Polish`},{key:`pt-br`,name:`Portuguese (Brazil)`},{key:`pt`,name:`Portuguese`},{key:`rn`,name:`Kirundi`},{key:`ro`,name:`Romanian`},{key:`es`,name:`Spanish`},{key:`ru`,name:`Russian`},{key:`rw`,name:`Kinyarwanda (Rwanda)`},{key:`sd`,name:`Sindhi`},{key:`se`,name:`Northern Sami`},{key:`si`,name:`Sinhalese`},{key:`sk`,name:`Slovak`},{key:`sl`,name:`Slovenian`},{key:`oc-lnc`,name:`Occitan, lengadocian dialecte`},{key:`sq`,name:`Albanian`},{key:`sr-cyrl`,name:`Serbian Cyrillic`},{key:`sr`,name:`Serbian`},{key:`ss`,name:`siSwati`},{key:`sv-fi`,name:`Finland Swedish`},{key:`sv`,name:`Swedish`},{key:`sw`,name:`Swahili`},{key:`ta`,name:`Tamil`},{key:`te`,name:`Telugu`},{key:`tet`,name:`Tetun Dili (East Timor)`},{key:`tg`,name:`Tajik`},{key:`th`,name:`Thai`},{key:`tl-ph`,name:`Tagalog (Philippines)`},{key:`tlh`,name:`Klingon`},{key:`tr`,name:`Turkish`},{key:`tzl`,name:`Talossan`},{key:`tzm`,name:`Central Atlas Tamazight`},{key:`ug-cn`,name:`Uyghur (China)`},{key:`uk`,name:`Ukrainian`},{key:`tk`,name:`Turkmen`},{key:`ur`,name:`Urdu`},{key:`uz-latn`,name:`Uzbek Latin`},{key:`uz`,name:`Uzbek`},{key:`vi`,name:`Vietnamese`},{key:`x-pseudo`,name:`Pseudo`},{key:`tzm-latn`,name:`Central Atlas Tamazight Latin`},{key:`yo`,name:`Yoruba Nigeria`},{key:`zh-cn`,name:`Chinese (China)`},{key:`zh-hk`,name:`Chinese (Hong Kong)`},{key:`zh-tw`,name:`Chinese (Taiwan)`},{key:`zh`,name:`Chinese`}],swe=function(e,t,n){let r=Promise.resolve();function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},cwe=(typeof document>`u`?void 0:document.currentScript?.src)||{}.url,uN=e=>{let t=`https://unpkg.com/${e}`,n=cee[e]?.replace(/^\D/,``);return n?`${t}@${n}`:t},dN=async(e,t)=>swe(()=>import(`${uN(e)}/${t}`),void 0),lwe=async()=>`${uN(`leaflet`)}/dist/images/marker-icon-2x.png`,uwe=[`unpkg.com`,`cdn.jsdelivr.net`],dwe=e=>{let t=new URL(e),n=t.pathname.match(/^(.*\/@sveltia\/cms)(?:@([^/]*))?(\/.*)$/);if(!n)return e;let[,r,i,a]=n;return i===xr||i===void 0&&!uwe.includes(t.host)?e:(t.pathname=`${r}@${xr}${a}`,t.href)},fwe=(e,t=cwe)=>{let n=`chunks/${e}.js`,r=`https://unpkg.com/@sveltia/cms@${xr}/dist/${n}`;if(!t)return[r];let i=new URL(n,dwe(t)).href;return i===r?[r]:[i,r]},fN={},pN=async e=>{if(e in fN)return fN[e]();let t;for(let n of fwe(e))try{return await import(n)}catch(e){t=e}throw Error(`Failed to load the ${e} chunk.`,{cause:t})},pwe=async e=>(await dN(`dayjs`,`esm/locale/${e}.js`)).default,mwe=new Set(owe.map(({key:e})=>e)),mN=new Set([`en`]),hN=new Map,hwe=new Map,gwe=e=>{let t;try{t=new Intl.Locale(e)}catch{return}let{language:n,script:r,region:i}=t,a=[e.toLowerCase()];return r&&i&&a.push(`${n}-${r}-${i}`),r&&a.push(`${n}-${r}`),i&&a.push(`${n}-${i}`),r&&!i&&a.push(`${n}-${t.maximize().region}`),a.push(n),a.map(e=>e.toLowerCase()).find(e=>mwe.has(e))},gN=e=>mA(hwe,e,()=>gwe(e)),_we=e=>{if(mN.has(e))return Promise.resolve();let t=hN.get(e);return t||(t=(async()=>{try{zM.default.locale(await pwe(e),void 0,!0),mN.add(e)}catch(t){console.error(`Failed to load the Day.js locale “${e}”`,t)}finally{hN.delete(e)}})(),hN.set(e,t)),t},vwe=async e=>{let t=new Set([...e].map(gN).filter(e=>e!==void 0));await Promise.all([...t].map(_we))},_N=(e,t)=>{let{localize_format:n}=e,r=typeof n==`string`?n:n===!0&&t&&t!==`_default`?t:void 0;if(!r)return;let i=gN(r);return i&&i!==`en`&&mN.has(i)?i:void 0},ywe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(n,(function(){"use strict";return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`YYYY-MM-DDTHH:mm:ssZ`).replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),bwe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_timezone=r()})(n,(function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var a,o=function(e,n,r){r===void 0&&(r={});var i=new Date(e);return function(e,n){n===void 0&&(n={});var r=n.timeZoneName||`short`,i=e+`|`+r,a=t[i];return a||(a=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:r}),t[i]=a),a}(n,r).formatToParts(i)},s=function(t,n){for(var r=o(t,n),a=[],s=0;s<r.length;s+=1){var c=r[s],l=c.type,u=c.value,d=e[l];d>=0&&(a[d]=parseInt(u,10))}var f=a[3],p=f===24?0:f,m=a[0]+`-`+a[1]+`-`+a[2]+` `+p+`:`+a[4]+`:`+a[5]+`:000`,h=+t;return(i.utc(m).valueOf()-(h-=h%1e3))/6e4},c=r.prototype;c.tz=function(e,t){if(e===void 0&&(e=a),!this.isValid())return this;var n,r=this.utcOffset(),o=this.toDate(),c=o.toLocaleString(`en-US`,{timeZone:e}),l=s(+o,e);if(!Number(l))n=this.utcOffset(0,t);else if(n=i(c,{locale:this.$L}).$set(`millisecond`,this.$ms).utcOffset(l,!0),t){var u=n.utcOffset();n=n.add(r-u,`minute`)}return n.$x.$timezone=e,n},c.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return e.type.toLowerCase()===`timezonename`}));return n&&n.value};var l=c.startOf;c.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return l.call(this,e,t);var n=i(this.format(`YYYY-MM-DD HH:mm:ss:SSS`),{locale:this.$L});return l.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,c=s(+i(),o);if(typeof e!=`string`)return i(e).tz(o);var l=i.utc(e,r).valueOf();if(Number.isNaN(l)){var u=i(NaN);return u.$x.$timezone=o,u}var d=function(e,t,n){var r=e-60*t*1e3,i=s(r,n);if(t===i)return[r,t];var a=s(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(l,c,o),f=d[0],p=d[1],m=i(f).utcOffset(p);return m.$x.$timezone=o,m},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}))})),vN=u(ywe(),1),yN=u(bwe(),1);zM.default.extend(vN.default),zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default),zM.default.extend(yN.default);var bN=e=>e instanceof Date&&!Number.isNaN(e.getTime()),xN=e=>e?zM.default.utc:zM.default,SN=/\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,xwe=/[XxZ]/,Swe=/[AaHhkmSsXx]|LT|LLL|lll/,CN=e=>e.replaceAll(/\[.*?]/g,``),wN=e=>xwe.test(CN(e)),TN=(e,t)=>SN.test(e)&&Swe.test(CN(t))&&!wN(t),EN=(e,t,n,r)=>e(t,n,r,TN(t,n)),DN=({value:e,format:t,parseAsUTC:n,localeKey:r})=>{let i=xN(n),a=EN(i,e,t,r);return a.isValid()?a:i(e)},ON=(e,t,n)=>(n?e.locale(n):e).format(t),kN=(e,t)=>t===`UTC`?e.toDate():zM.default.tz(e.format(`YYYY-MM-DDTHH:mm:ss.SSS`),t).toDate(),AN=(e,t)=>{if(!t||SN.test(e))return new Date(e);let n=zM.default.utc(e);return n.isValid()?kN(n,t):void 0},jN=e=>{let{format:t,dateOnly:n,utc:r,outputUTC:i,singleCustomTimeZone:a}=lN(e);return r||t&&i?`UTC`:n?void 0:a},MN=(e,t,n)=>{let{format:r,timeOnly:i}=lN(t);if(!e)return;let a=jN(t),o;if(r){let i=_N(t,n);if(a===`UTC`||!a){let t=DN({value:e,format:r,parseAsUTC:a===`UTC`,localeKey:i});o=t.isValid()?t.toDate():void 0}else{let t=EN(xN(!0),e,r,i);o=t.isValid()?wN(r)?t.toDate():kN(t,a):AN(e,a)}}else o=AN(i?`${new Date().toJSON().split(`T`)[0]}T${e}`:e,a);if(bN(o))return o;console.error(`Invalid Date`,e)};zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default);var Cwe=/^\d{4}-[01]\d-[0-3]\d$/,wwe=/T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?Z$/,NN=Object.freeze([`date`,`default`,`localize`,`lower`,`slugify`,`ternary`,`truncate`,`upper`]),PN=/^[A-Za-z_]\w*$/,Twe=RegExp(`^(?<method>${PN.source.slice(1,-1)})(?:\\((?<args>.*)\\))?$`,`s`),Ewe=/\s*(?:'(?<string>.*?)'|(?<number>-?\d+(?:\.\d+)?))\s*(?<separator>,|$)/sy,Dwe=Object.entries({date:/^date\('(?<format>.+?)'(?:,\s*'(?<timeZone>.+?)')?\)$/,default:/^default\('(?<defaultValue>.+?)'\)$/,ternary:/^ternary\('(?<truthyValue>.*?)',\s*'(?<falsyValue>.*?)'\)$/,truncate:/^truncate\((?<max>\d+)(?:,\s*'(?<ellipsis>.+?)')?\)$/}),Owe=e=>{let t=[];if(!e.trim())return t;let n=new RegExp(Ewe),r;do{let i=n.exec(e)?.groups;if(!i)return;t.push(i.string??Number(i.number)),{separator:r}=i}while(r);return t},kwe=e=>{for(let[t,n]of Dwe){let r=Object.entries(e.match(n)?.groups??{});if(r.length)return{method:t,args:Object.fromEntries(r.filter(([,e])=>e!==void 0))}}let{method:t,args:n}=e.match(Twe)?.groups??{};if(t&&!NN.includes(t)){if(n===void 0)return{method:t,args:{}};let e=Owe(n);if(e)return{method:t,args:{},customArgs:e}}return{method:e,args:{}}},FN=e=>{let t=[],n=``,r=!1;for(let i=0;i<e.length;i+=1){let a=e[i];a===`'`&&(!r&&[`(`,`,`].includes(MM(e,i,-1))?r=!0:r&&[`,`,`)`].includes(MM(e,i,1))&&(r=!1)),a===`|`&&!r?(t.push(n.trim()),n=``):n+=a}return t.push(n.trim()),t},Awe=new Map,IN=e=>vA(Awe,e,()=>{let[t,...n]=FN(e.trim());return Object.freeze({value:t,transformations:Object.freeze(n.map(e=>{let{method:t,args:n,customArgs:r}=kwe(e);return Object.freeze({method:t,args:Object.freeze(n),...r?{customArgs:Object.freeze(r)}:{}})}))})},500),jwe=e=>String(e??``).toUpperCase(),Mwe=e=>String(e??``).toLowerCase(),Nwe=(e,{format:t,timeZone:n},r,i)=>{let a=String(e),{format:o,dateOnly:s,utc:c}=lN(r),l=o?_N(r,i):void 0,u=n===`utc`||c||s&&!!a.match(Cwe)||s&&!!a.match(wwe),d=o&&!(e instanceof Date)?DN({value:a,format:o,parseAsUTC:u,localeKey:l}):xN(u)(a);return d.isValid()?ON(d,t,l):``},Pwe=(e,{defaultValue:t})=>e?String(e):t,Fwe=(e,{truthyValue:t,falsyValue:n})=>e?t:n,Iwe=(e,{max:t,ellipsis:n=`…`})=>YE(String(e??``),Number(t),{ellipsis:n}),Lwe=new WeakMap,Rwe=({method:e,transform:t,value:n,customArgs:r,locale:i})=>{try{let e=t(n,{args:[...r??[]],locale:i===`_default`?void 0:i});if(typeof e?.then==`function`)throw e.then(void 0,()=>void 0),TypeError(`The function must return a string, not a Promise`);return String(e??``)}catch(r){let i=mA(Lwe,t,()=>new Set);return i.has(e)||(i.add(e),console.error(`The custom “${e}” string transformation failed. Further errors are not logged:`,r)),String(n??``)}},zwe=({fieldConfig:e,value:t,transformation:n,locale:r})=>{let{method:i,args:a,customArgs:o}=n;switch(i){case`upper`:return jwe(t);case`lower`:return Mwe(t);case`slugify`:return iN(String(t??``),{fallback:!1,locale:r});case`date`:return Nwe(t,a,e??{},r);case`default`:return Pwe(t,a);case`ternary`:return Fwe(t,a);case`truncate`:return Iwe(t,a);default:{let e=zO.get(i);return e?Rwe({method:i,transform:e,value:t,customArgs:o,locale:r}):String(t)}}},LN=({fieldConfig:e,value:t,transformations:n,locale:r})=>(n.forEach(n=>{t=zwe({fieldConfig:e,value:t,transformation:n,locale:r})}),t),Bwe=/^\d{4}-[01]\d-[0-3]\d$/,Vwe=/T00:00(?::00)?(?:\.000)?Z$/,RN={year:`numeric`,month:`short`,day:`numeric`},zN={hour:`numeric`,minute:`numeric`,hour12:!0},Hwe={...RN,...zN},Uwe=new Map,BN=(e,t)=>Number.isNaN(e.getTime())?`Invalid Date`:mA(Uwe,t??``,()=>new Intl.DateTimeFormat(t??void 0,Hwe)).format(e);zM.default.extend(vN.default),zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default),zM.default.extend(yN.default);var Wwe=new Map,VN=({locale:e,parts:t,timeZone:n})=>mA(Wwe,[e,t,n].join(`|`),()=>t===`time`?new Intl.DateTimeFormat(e,{...zN,timeZone:n}):t===`date`?new Intl.DateTimeFormat(e,{...RN,timeZone:n}):new Intl.DateTimeFormat(e,{...RN,...zN,timeZone:n,timeZoneName:void 0})),HN=({locale:e,fieldConfig:t,currentValue:n})=>{let{format:r,dateOnly:i,timeOnly:a,utc:o,singleCustomTimeZone:s}=lN(t),c=o?`UTC`:s;if(typeof n!=`string`||!n.trim())return``;if(r){let i=_N(t,e);if(TN(n,r)){let a=MN(n,t,e),o=jN(t);return a?ON(o?(0,zM.default)(a).tz(o):(0,zM.default)(a),r,i):``}let a=DN({value:n,format:r,parseAsUTC:o,localeKey:i});return a.isValid()?a.format(r):(console.error(`Invalid Date`,n),``)}let l=MN(n,t,e),u=DA(e);return bN(l)?a?VN({locale:u,parts:`time`,timeZone:c}).format(l):i?VN({locale:u,parts:`date`,timeZone:o||Bwe.test(n)||Vwe.test(n)?`UTC`:c}).format(l):VN({locale:u,parts:`datetime`,timeZone:c}).format(l):``},Gwe=new Map,UN=e=>mA(Gwe,e,()=>Intl.NumberFormat(e,{maximumFractionDigits:20})),WN=({widget:e,value_type:t})=>t??(e===`compute`?`string`:`int`),GN=e=>[`float`,`float/string`].includes(WN(e)),KN=e=>![`int`,`float`].includes(WN(e)),qN=e=>e.widget===`number`||e.widget===`compute`&&WN(e)!==`string`,JN=e=>(e.widget===`number`||e.widget===`compute`)&&!KN(e),YN=e=>typeof e==`number`?e:typeof e==`string`&&e.trim()?Number(e):NaN,XN=(e,t)=>{if(GN(t))return Number.isFinite(e)?e+0:NaN;let n=Math.trunc(e);return Number.isSafeInteger(n)?n+0:NaN},ZN=(e,t)=>e==null||typeof e==`string`&&!e.trim()?!1:Number.isNaN(XN(Number(e),t)),QN=({inputValue:e,fieldConfig:t})=>{if(typeof e==`string`)return e;if(e===void 0||Number.isNaN(e))return KN(t)?``:null;let n=XN(e,t);return Number.isNaN(n)?String(e):KN(t)?String(n):n},Kwe=({currentValue:e,fieldConfig:t,inputValue:n=void 0})=>{if(ZN(e,t)&&e===QN({inputValue:n,fieldConfig:t}))return n;if(typeof e==`number`)return e;if(typeof e!=`string`||!e.trim())return;let r=XN(Number(e),t);return Number.isNaN(r)?void 0:r},qwe=xA(()=>ej.current,e=>{let t=new Map,n=[];return e.forEach(e=>{e.filePathMap?[...new Set(Object.values(e.filePathMap))].forEach(n=>{mA(t,n,()=>[]).push(e)}):n.push([e,YA(e.collectionName)?._file?.fullPathRegEx])}),{fileMap:t,regexFolders:n}}),$N=e=>{let{fileMap:t,regexFolders:n}=qwe();return t.get(e)||n.filter(([,t])=>t?.test(e)).map(([e])=>e).sort((e,t)=>(t.folderPath??``).localeCompare(e.folderPath??``))},Jwe=xA(()=>ej.current,()=>new WeakMap),Ywe=e=>mA(Jwe(),e,()=>$N(Object.values(e.locales)[0].path)),eP=e=>Ywe(e).map(({collectionName:e})=>YA(e)).filter(e=>!!e),Xwe=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e,t,i){if(typeof t!=`string`)throw Error(`Input must be string`);for(var a=t.length,o=0,s,c,l=0;l<a;l+=1){if(s=t.charCodeAt(l),c=t[l],n(s)&&r(t.charCodeAt(l+1))&&(l+=1,c+=t[l]),o+=e(c),o===i)return t.slice(0,l+1);if(o>i)return t.slice(0,l-c.length+1)}return t}})),Zwe=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e){if(typeof e!=`string`)throw Error(`Input must be string`);for(var t=e.length,i=0,a=null,o=null,s=0;s<t;s++)a=e.charCodeAt(s),r(a)?o!=null&&n(o)?i+=1:i+=3:a<=127?i+=1:a>=128&&a<=2047?i+=2:a>=2048&&a<=65535&&(i+=3),o=a;return i}})),Qwe=s(((e,t)=>{var n=Xwe(),r=Zwe();t.exports=n.bind(null,r)})),$we=u(s(((e,t)=>{var n=Qwe(),r=/[\/\?<>\\:\*\|"]/g,i=/[\x00-\x1f\x80-\x9f]/g,a=/^\.+$/,o=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;function s(e,t){for(var n=e.length;n>0&&(e[n-1]===`.`||e[n-1]===` `);)n--;return n<e.length?e.slice(0,n)+t:e}function c(e,t){if(typeof e!=`string`)throw Error(`Input must be string`);var c=e.replace(r,t).replace(i,t).replace(a,t).replace(o,t);return c=s(c,t),n(c,255)}t.exports=function(e,t){var n=t&&t.replacement||``,r=c(e,n);return n===``?r:c(r,``)}}))(),1),tP=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[\da-f]{2})+/gi,e=>{try{return t(e)}catch{return e}})}},nP=e=>tP(e,decodeURI),rP=e=>tP(e,decodeURIComponent),iP=e=>{try{return new URL(e).href}catch{return encodeURI(nP(e).toWellFormed())}},aP=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),oP=(e,t=encodeURIComponent)=>e.split(`/`).map(e=>t(e)).join(`/`),sP=e=>e.replace(/\/+$/,``),cP=(e,t)=>RegExp(`^${e.split(`/`).map(t).join(`\\/`)}(?=\\/|$)`),lP=e=>{let t=e.startsWith(`@`);return t&&(e=e.slice(1)),e=oP(e,aP),t?`@${e}`:e},uP=(e,t,{hasExtension:n=!0}={})=>{let r=e.toLowerCase();if(!t.some(e=>e.toLowerCase()===r))return e;let{filename:i,extension:a}=n?bk(e):{filename:e,extension:void 0},o=a?`\\.${a}`:``,s=RegExp(`^${JE(i)}-(?<num>\\d+)${o}$`,`i`),c=0;return t.forEach(e=>{let t=e.match(s);t&&(c=Math.max(c,Number(t.groups.num)))}),`${i}-${c+1}${a?`.${a}`:``}`},dP=e=>(0,$we.default)(e.normalize().replace(/[\s\u00A0\u202F]+/g,` `)),eTe=[[`jpg`,`jpeg`,`jpe`,`jfif`],[`tif`,`tiff`],[`htm`,`html`],[`yml`,`yaml`],[`md`,`markdown`],[`mpg`,`mpeg`],[`mid`,`midi`],[`aif`,`aiff`]],fP=(e,t)=>{let n=e?.toLowerCase()??``,r=t?.toLowerCase()??``;return n===r||eTe.some(e=>e.includes(n)&&e.includes(r))},pP=e=>e.filter(Boolean).join(`/`),mP=e=>bk(e).dirname??``,hP=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,tTe=e=>e.split(`/`).filter(e=>e!==`.`&&e!==`..`).join(`/`),gP=e=>{let t=[],n=!1;return e.split(`/`).forEach(e=>{if(e){if(!n||e!==`.`&&e!==`..`)n||=e!==`.`&&e!==`..`,t.push(e);else if(e===`..`){let n=t.at(-1);n!==void 0&&n!==`.`&&n!==`..`?t.pop():t.push(e)}}}),t.join(`/`)},_P=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,vP=e=>typeof e==`string`?new TextEncoder().encode(e).length:e.size,yP=async e=>{let t=await e.arrayBuffer();return el(new Blob([`blob ${t.byteLength}\0`,t]))},nTe=new WeakMap,bP=e=>typeof e==`string`?yP(_P(e)):bA(nTe,e,()=>yP(e)),xP=(e,{locale:t,defaultLocale:n}={})=>(t?e.locales[t]:void 0)??(n?e.locales[n]:void 0)??Object.values(e.locales)[0],SP=(e,t)=>e[t]?t:Object.keys(e)[0],CP=(e,{includePrevious:t=!1}={})=>[...new Set([...Object.values(e.locales).map(({path:e})=>e),...t&&e.workflow?.previousPaths||[]])],wP=(e,t)=>mP(xP(e,{locale:t}).path),TP=(e,{basePath:t,fullPathRegEx:n}={})=>{let r=n?e.match(n)?.groups?.subPath:void 0;if(r!==void 0)return mP(r);let i=XE(t??``);return mP(SA(i)?ISe(e,i):hP(e,i))},rTe=/^(?:0|[1-9]\d*)$/,iTe=/^(.+)\.\d+\.([^.]+)$/,EP=e=>{if(e.widget!==`list`||!(`fields`in e||`types`in e))return;let{map_key_field:t}=e;return typeof t==`string`&&t?t:void 0},aTe=e=>rTe.test(e)&&Number(e)<2**32-1,oTe=(e,t)=>!D(e)||!Object.values(e).every(e=>e===null||D(e))?e:Object.entries(e).map(([e,n])=>({...n,[t]:e})),sTe=(e,t)=>Array.isArray(e)?Object.fromEntries(e.map(e=>{let{[t]:n=``,...r}=D(e)?e:{};return[String(n),r]})):e,cTe=new WeakMap,lTe=e=>jM(e,e=>!!EP(e),cTe),DP=(e,t,n)=>{let{widget:r=`string`}=t,{fields:i,types:a,typeKey:o}=t,s=e=>kM({value:e,fields:i,types:a,typeKey:o});if(!lTe(t))return e;if(r===`object`)return OP(e,s(e),n);if(r!==`list`)return e;let c=EP(t),{field:l}=t,u=c&&n?oTe(e,c):e;if(Array.isArray(u)){let e=u.map(e=>l?DP(e,l,n):OP(e,s(e),n));e.some((e,t)=>e!==u[t])&&(u=e)}return c&&!n?sTe(u,c):u},OP=(e,t,n)=>{if(!D(e))return e;let r=e;return t.forEach(t=>{let{name:i}=t;if(!Object.hasOwn(e,i))return;let a=DP(e[i],t,n);a!==e[i]&&(r===e&&(r={...e}),r[i]=a)}),r},kP=e=>{if(e.componentName)return;let[,t,n]=e.keyPath.match(iTe)??[];if(!t)return;let r=_M({...e,keyPath:t});if(r&&EP(r)===n)return{listKeyPath:t,keyField:n}},AP=({valueMap:e,listKeyPath:t,keyField:n})=>{let r=`${t}.`,i=`.${n}`;return Object.keys(e).filter(e=>e.startsWith(r)&&e.endsWith(i)&&cM(e.slice(r.length,-i.length)))},uTe=({valueMap:e,keyPath:t,listKeyPath:n,keyField:r,value:i})=>AP({valueMap:e,listKeyPath:n,keyField:r}).some(n=>n!==t&&e[n]!==void 0&&e[n]!==null&&String(e[n])===String(i)),jP=Symbol.for(`yaml.alias`),MP=Symbol.for(`yaml.document`),NP=Symbol.for(`yaml.map`),PP=Symbol.for(`yaml.pair`),FP=Symbol.for(`yaml.scalar`),IP=Symbol.for(`yaml.seq`),LP=Symbol.for(`yaml.node.type`),RP=e=>!!e&&typeof e==`object`&&e[LP]===jP,zP=e=>!!e&&typeof e==`object`&&e[LP]===MP,BP=e=>!!e&&typeof e==`object`&&e[LP]===NP,VP=e=>!!e&&typeof e==`object`&&e[LP]===PP,HP=e=>!!e&&typeof e==`object`&&e[LP]===FP,UP=e=>!!e&&typeof e==`object`&&e[LP]===IP;function WP(e){if(e&&typeof e==`object`)switch(e[LP]){case NP:case IP:return!0}return!1}function GP(e){if(e&&typeof e==`object`)switch(e[LP]){case jP:case NP:case FP:case IP:return!0}return!1}var KP=e=>(HP(e)||WP(e))&&!!e.anchor,qP=Symbol(`break visit`),dTe=Symbol(`skip children`),JP=Symbol(`remove node`);function YP(e,t){let n=fTe(t);zP(e)?XP(null,e.contents,n,Object.freeze([e]))===JP&&(e.contents=null):XP(null,e,n,Object.freeze([]))}YP.BREAK=qP,YP.SKIP=dTe,YP.REMOVE=JP;function XP(e,t,n,r){let i=pTe(e,t,n,r);if(GP(i)||VP(i))return mTe(e,r,i),XP(e,i,n,r);if(typeof i!=`symbol`){if(WP(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=XP(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===qP)return qP;else i===JP&&(t.items.splice(e,1),--e)}}else if(VP(t)){r=Object.freeze(r.concat(t));let e=XP(`key`,t.key,n,r);if(e===qP)return qP;e===JP&&(t.key=null);let i=XP(`value`,t.value,n,r);if(i===qP)return qP;i===JP&&(t.value=null)}}return i}function fTe(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function pTe(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(BP(t))return n.Map?.(e,t,r);if(UP(t))return n.Seq?.(e,t,r);if(VP(t))return n.Pair?.(e,t,r);if(HP(t))return n.Scalar?.(e,t,r);if(RP(t))return n.Alias?.(e,t,r)}function mTe(e,t,n){let r=t[t.length-1];if(WP(r))r.items[e]=n;else if(VP(r))e===`key`?r.key=n:r.value=n;else if(zP(r))r.contents=n;else{let e=RP(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var hTe={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},gTe=e=>e.replace(/[!,[\]{}]/g,e=>hTe[e]),ZP=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+gTe(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&GP(e.contents)){let t={};YP(e.contents,(e,n)=>{GP(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(`
|
||
`)}};ZP.defaultYaml={explicit:!1,version:`1.2`},ZP.defaultTags={"!!":`tag:yaml.org,2002:`};function QP(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function $P(e){let t=new Set;return YP(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function eF(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function _Te(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=$P(e);let a=eF(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(HP(t.node)||WP(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function tF(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=tF(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=tF(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=tF(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=tF(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function nF(e,t,n){if(Array.isArray(e))return e.map((e,t)=>nF(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!KP(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var rF=class{constructor(e){Object.defineProperty(this,LP,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!zP(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=nF(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?tF(i,{"":o},``,o):o}},iF=class extends rF{constructor(e){super(jP),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],YP(e,{Node:(e,t)=>{(RP(t)||KP(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(nF(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=aF(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(QP(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function aF(e,t,n){if(RP(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(WP(t)){let r=0;for(let i of t.items){let t=aF(e,i,n);t>r&&(r=t)}return r}if(VP(t)){let r=aF(e,t.key,n),i=aF(e,t.value,n);return Math.max(r,i)}return 1}var oF=e=>!e||typeof e!=`function`&&typeof e!=`object`,sF=class extends rF{constructor(e){super(FP),this.value=e}toJSON(e,t){return t?.keep?this.value:nF(this.value,e,t)}toString(){return String(this.value)}};sF.BLOCK_FOLDED=`BLOCK_FOLDED`,sF.BLOCK_LITERAL=`BLOCK_LITERAL`,sF.PLAIN=`PLAIN`,sF.QUOTE_DOUBLE=`QUOTE_DOUBLE`,sF.QUOTE_SINGLE=`QUOTE_SINGLE`;var vTe=`tag:yaml.org,2002:`;function yTe(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function cF(e,t,n){if(zP(e)&&(e=e.contents),GP(e))return e;if(VP(e)){let t=n.schema[NP].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new iF(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=vTe+t.slice(2));let l=yTe(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new sF(e);return c&&(c.node=t),t}l=e instanceof Map?o[NP]:Symbol.iterator in Object(e)?o[IP]:o[NP]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new sF(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function lF(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return cF(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var uF=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,dF=class extends rF{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>GP(t)||VP(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(uF(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(WP(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,lF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(WP(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&HP(i)?i.value:i:WP(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!VP(t))return!1;let n=t.value;return n==null||e&&HP(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return WP(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(WP(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,lF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},bTe=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function fF(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var pF=(e,t,n)=>e.endsWith(`
|
||
`)?fF(n,t):n.includes(`
|
||
`)?`
|
||
`+fF(n,t):(e.endsWith(` `)?``:` `)+n;function mF(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=hF(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
||
`)n===`block`&&(h=hF(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
||
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
||
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function hF(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
||
`);r=t,i=t+1,a=e[i]}return r}var gF=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),_F=e=>/^(%|---|\.\.\.)/m.test(e);function xTe(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
||
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function vF(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(_F(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
||
|
||
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
||
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:mF(o,a,`quoted`,gF(t,!1))}function yF(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||
`)||/[ \t]\n|\n[ \t]/.test(e))return vF(e,t);let n=t.indent||(_F(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:mF(r,n,`flow`,gF(t,!1))}function bF(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=vF;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?yF:i&&!t?vF:n?yF:vF}return r(e,t)}var xF;try{xF=RegExp(`(^|(?<!
|
||
))
|
||
+(?!
|
||
|$)`,`g`)}catch{xF=/\n+(?!\n|$)/g}function SF({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return bF(n,r);let l=r.indent||(r.forceBlockIndent||_F(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===sF.BLOCK_FOLDED?!1:t===sF.BLOCK_LITERAL||!xTe(n,c,l.length);if(!n)return u?`|
|
||
`:`>
|
||
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
||
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
||
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
||
`&&(p=p.slice(0,-1)),p.replace(xF,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
||
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
||
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=gF(r,!0);o!==`folded`&&t!==sF.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=mF(`${v}${e}${p}`,l,`block`,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function STe(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
||
`)||u&&/[[\]{},]/.test(a))return bF(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||
`)?bF(a,t):SF(e,t,n,r);if(!s&&!u&&i!==sF.PLAIN&&a.includes(`
|
||
`))return SF(e,t,n,r);if(_F(a)){if(c===``)return t.forceBlockIndent=!0,SF(e,t,n,r);if(s&&c===l)return bF(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return bF(a,t)}return s?d:mF(d,c,`flow`,gF(t,!1))}function CF(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==sF.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=sF.QUOTE_DOUBLE);let c=e=>{switch(e){case sF.BLOCK_FOLDED:case sF.BLOCK_LITERAL:return i||a?bF(o.value,t):SF(o,t,n,r);case sF.QUOTE_DOUBLE:return vF(o.value,t);case sF.QUOTE_SINGLE:return yF(o.value,t);case sF.PLAIN:return STe(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function wF(e,t){let n=Object.assign({blockQuote:!0,commentString:bTe,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function CTe(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(HP(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function wTe(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(HP(e)||WP(e))&&e.anchor;a&&QP(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function TF(e,t,n,r){if(VP(e))return e.toString(t,n,r);if(RP(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=GP(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=CTe(t.doc.schema.tags,a);let o=wTe(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):HP(a)?CF(a,t,n,r):a.toString(t,n,r);return o?HP(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function TTe({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=GP(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(WP(e)||!GP(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||WP(e)||(HP(e)?e.type===sF.BLOCK_FOLDED||e.type===sF.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=TF(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=pF(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=pF(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=pF(g,n.indent,l(f))));let _,v,y;GP(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&HP(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&UP(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=TF(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||
`:``,v){let e=l(v);S+=`\n${fF(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
||
`&&y&&(S=`
|
||
|
||
`):S+=`\n${n.indent}`}else if(!p&&WP(t)){let e=x[0],r=x.indexOf(`
|
||
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
|
||
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=pF(g,n.indent,l(y)):h&&i&&i(),g}function EF(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var DF=`<<`,OF={identify:e=>e===DF||typeof e==`symbol`&&e.description===DF,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new sF(Symbol(DF)),{addToJSMap:kF}),stringify:()=>DF},ETe=(e,t)=>(OF.identify(t)||HP(t)&&(!t.type||t.type===sF.PLAIN)&&OF.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===OF.tag&&e.default);function kF(e,t,n){let r=jF(e,n);if(UP(r))for(let n of r.items)AF(e,t,n);else if(Array.isArray(r))for(let n of r)AF(e,t,n);else AF(e,t,r)}function AF(e,t,n){let r=jF(e,n);if(!BP(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function jF(e,t){return e&&RP(t)?t.resolve(e.doc,e):t}function MF(e,t,{key:n,value:r}){if(GP(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(ETe(e,n))kF(e,t,r);else{let i=nF(n,``,e);if(t instanceof Map)t.set(i,nF(r,i,e));else if(t instanceof Set)t.add(i);else{let a=DTe(n,i,e),o=nF(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function DTe(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(GP(e)&&n?.doc){let t=wF(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),EF(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function NF(e,t,n){return new PF(cF(e,void 0,n),cF(t,void 0,n))}var PF=class e{constructor(e,t=null){Object.defineProperty(this,LP,{value:PP}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return GP(n)&&(n=n.clone(t)),GP(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return MF(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?TTe(this,e,t,n):JSON.stringify(this)}};function FF(e,t,n){return(t.inFlow??e.flow?kTe:OTe)(e,t,n)}function OTe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(GP(i))!d&&i.spaceBefore&&f.push(``),IF(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(VP(i)){let e=GP(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),IF(n,f,e.commentBefore,d))}d=!1;let s=TF(i,u,()=>o=null,()=>d=!0);o&&(s+=pF(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
||
`}}return e?(p+=`
|
||
`+fF(l(e),c),s&&s()):d&&o&&o(),p}function kTe({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(GP(i))i.spaceBefore&&d.push(``),IF(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(VP(i)){let e=GP(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),IF(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=GP(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=TF(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
||
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=pF(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
||
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function IF({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=fF(t(r),e);n.push(i.trimStart())}}function LF(e,t){let n=HP(t)?t.value:t;for(let r of e)if(VP(r)&&(r.key===t||r.key===n||HP(r.key)&&r.key.value===n))return r}var RF=class extends dF{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(NP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(NF(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=VP(e)?e:!e||typeof e!=`object`||!(`key`in e)?new PF(e,e?.value):new PF(e.key,e.value);let r=LF(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);HP(r.value)&&oF(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=LF(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=LF(this.items,e)?.value;return(!t&&HP(n)?n.value:n)??void 0}has(e){return!!LF(this.items,e)}set(e,t){this.add(new PF(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)MF(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!VP(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),FF(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},zF={collection:`map`,default:!0,nodeClass:RF,tag:`tag:yaml.org,2002:map`,resolve(e,t){return BP(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>RF.from(e,t,n)},BF=class extends dF{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(IP,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=VF(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=VF(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&HP(r)?r.value:r}has(e){let t=VF(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=VF(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];HP(r)&&oF(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(nF(e,String(r++),t));return n}toString(e,t,n){return e?FF(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(cF(a,void 0,n))}}return i}};function VF(e){let t=HP(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var HF={collection:`seq`,default:!0,nodeClass:BF,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return UP(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>BF.from(e,t,n)},UF={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),CF(e,t,n,r)}},WF={identify:e=>e==null,createNode:()=>new sF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new sF(null),stringify:({source:e},t)=>typeof e==`string`&&WF.test.test(e)?e:t.options.nullStr},GF={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new sF(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&GF.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function KF({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var qF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:KF},JF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():KF(e)}},YF={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new sF(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:KF},XF=e=>typeof e==`bigint`||Number.isInteger(e),ZF=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function QF(e,t,n){let{value:r}=e;return XF(r)&&r>=0?n+r.toString(t):KF(e)}var $F={identify:e=>XF(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>ZF(e,2,8,n),stringify:e=>QF(e,8,`0o`)},eI={identify:XF,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ZF(e,0,10,n),stringify:KF},tI={identify:e=>XF(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ZF(e,2,16,n),stringify:e=>QF(e,16,`0x`)},ATe=[zF,HF,UF,WF,GF,$F,eI,tI,qF,JF,YF];function nI(e){return typeof e==`bigint`||Number.isInteger(e)}var rI=({value:e})=>JSON.stringify(e),jTe=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:rI},{identify:e=>e==null,createNode:()=>new sF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:rI},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:rI},{identify:nI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>nI(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:rI}],MTe=[zF,HF].concat(jTe,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),iI={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=sF.BLOCK_LITERAL,t!==sF.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===sF.BLOCK_LITERAL?`
|
||
`:` `)}return CF({comment:e,type:t,value:s},r,i,a)}};function aI(e,t){if(UP(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!VP(r)){if(BP(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new PF(new sF(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=VP(r)?r:new PF(r)}}else t(`Expected a sequence for this tag`);return e}function oI(e,t,n){let{replacer:r}=n,i=new BF(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(NF(o,s,n))}return i}var sI={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:aI,createNode:oI},cI=class e extends BF{constructor(){super(),this.add=RF.prototype.add.bind(this),this.delete=RF.prototype.delete.bind(this),this.get=RF.prototype.get.bind(this),this.has=RF.prototype.has.bind(this),this.set=RF.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(VP(e)?(r=nF(e.key,``,t),i=nF(e.value,r,t)):r=nF(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=oI(e,t,n),i=new this;return i.items=r.items,i}};cI.tag=`tag:yaml.org,2002:omap`;var lI={collection:`seq`,identify:e=>e instanceof Map,nodeClass:cI,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=aI(e,t),r=[];for(let{key:e}of n.items)HP(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new cI,n)},createNode:(e,t,n)=>cI.from(e,t,n)};function uI({value:e,source:t},n){return t&&(e?dI:fI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var dI={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new sF(!0),stringify:uI},fI={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new sF(!1),stringify:uI},NTe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:KF},PTe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():KF(e)}},FTe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new sF(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:KF},pI=e=>typeof e==`bigint`||Number.isInteger(e);function mI(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function hI(e,t,n){let{value:r}=e;if(pI(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return KF(e)}var ITe={identify:pI,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>mI(e,2,2,n),stringify:e=>hI(e,2,`0b`)},LTe={identify:pI,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>mI(e,1,8,n),stringify:e=>hI(e,8,`0`)},RTe={identify:pI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>mI(e,0,10,n),stringify:KF},zTe={identify:pI,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>mI(e,2,16,n),stringify:e=>hI(e,16,`0x`)},gI=class e extends RF{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=VP(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new PF(e.key,null):new PF(e,null),LF(this.items,t.key)||this.items.push(t)}get(e,t){let n=LF(this.items,e);return!t&&VP(n)?HP(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=LF(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new PF(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(NF(e,null,n));return i}};gI.tag=`tag:yaml.org,2002:set`;var _I={collection:`map`,identify:e=>e instanceof Set,nodeClass:gI,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>gI.from(e,t,n),resolve(e,t){if(BP(e)){if(e.hasAllNullValues(!0))return Object.assign(new gI,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function vI(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function yI(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return KF(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var bI={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>vI(e,n),stringify:yI},xI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>vI(e,!1),stringify:yI},SI={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(SI.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=vI(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},CI=[zF,HF,UF,WF,dI,fI,ITe,LTe,RTe,zTe,NTe,PTe,FTe,iI,OF,lI,sI,_I,bI,xI,SI],wI=new Map([[`core`,ATe],[`failsafe`,[zF,HF,UF]],[`json`,MTe],[`yaml11`,CI],[`yaml-1.1`,CI]]),TI={binary:iI,bool:GF,float:YF,floatExp:JF,floatNaN:qF,floatTime:xI,int:eI,intHex:tI,intOct:$F,intTime:bI,map:zF,merge:OF,null:WF,omap:lI,pairs:sI,seq:HF,set:_I,timestamp:SI},BTe={"tag:yaml.org,2002:binary":iI,"tag:yaml.org,2002:merge":OF,"tag:yaml.org,2002:omap":lI,"tag:yaml.org,2002:pairs":sI,"tag:yaml.org,2002:set":_I,"tag:yaml.org,2002:timestamp":SI};function EI(e,t,n){let r=wI.get(t);if(r&&!e)return n&&!r.includes(OF)?r.concat(OF):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(wI.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(OF)),i.reduce((e,t)=>{let n=typeof t==`string`?TI[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(TI).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var VTe=(e,t)=>e.key<t.key?-1:+(e.key>t.key),HTe=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?EI(e,`compat`):e?EI(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?BTe:{},this.tags=EI(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,NP,{value:zF}),Object.defineProperty(this,FP,{value:UF}),Object.defineProperty(this,IP,{value:HF}),this.sortMapEntries=typeof a==`function`?a:a===!0?VTe:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function UTe(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=wF(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(fF(t,``))}let o=!1,s=null;if(e.contents){if(GP(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(fF(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=TF(e.contents,i,()=>s=null,t);s&&(c+=pF(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(TF(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
|
||
`)?(n.push(`...`),n.push(fF(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(fF(a(t),``)))}return n.join(`
|
||
`)+`
|
||
`}var DI=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,LP,{value:MP});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ZP({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[LP]:{value:MP}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=GP(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){OI(this.contents)&&this.contents.add(e)}addIn(e,t){OI(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=$P(this);e.anchor=!t||n.has(t)?eF(t||`a`,n):t}return new iF(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=_Te(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=cF(e,l,p);return o&&WP(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new PF(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return OI(this.contents)?this.contents.delete(e):!1}deleteIn(e){return uF(e)?this.contents!=null&&(this.contents=null,!0):OI(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return WP(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return uF(e)?!t&&HP(this.contents)?this.contents.value:this.contents:WP(this.contents)?this.contents.getIn(e,t):void 0}has(e){return WP(this.contents)?this.contents.has(e):!1}hasIn(e){return uF(e)?this.contents!==void 0:WP(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=lF(this.schema,[e],t):OI(this.contents)&&this.contents.set(e,t)}setIn(e,t){uF(e)?this.contents=t:this.contents==null?this.contents=lF(this.schema,Array.from(e),t):OI(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new ZP({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new ZP({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new HTe(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=nF(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?tF(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return UTe(this,e)}};function OI(e){if(WP(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var kI=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},AI=class extends kI{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},WTe=class extends kI{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},jI=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
||
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function MI(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function NI(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
||
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(NI(t.key)||NI(t.value))return!0}return!1;default:return!0}}function PI(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&NI(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function FI(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||HP(e)&&HP(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var II=`All mapping items must start at the same column`;function GTe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??RF)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=MI(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,II)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||NI(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,II);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&PI(r.indent,u,i),n.atKey=!1,FI(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=MI(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&PI(r.indent,f,i),s=c.range[2];let l=new PF(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
||
`+_.comment:g.comment=_.comment);let e=new PF(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function KTe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??BF)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=MI(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&PI(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function LI(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var RI=`Block collections are not allowed within flow collections`,zI=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function qTe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?RF:BF))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=MI(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
||
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&NI(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];VP(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
||
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],zI(m)&&i(r.range,`BLOCK_IN_FLOW`,RI)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);zI(f)&&i(g.range,`BLOCK_IN_FLOW`,RI),n.atKey=!1;let _=MI(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?zI(m)&&i(v.range,`BLOCK_IN_FLOW`,RI):_.comment&&(g.comment?g.comment+=`
|
||
`+_.comment:g.comment=_.comment);let y=new PF(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;FI(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new RF(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=LI(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
||
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function BI(e,t,n,r,i,a){let o=n.type===`block-map`?GTe(e,t,n,r,a):n.type===`block-seq`?KTe(e,t,n,r,a):qTe(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function JTe(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===RF.tagName&&s===`map`||o===BF.tagName&&s===`seq`)return BI(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),BI(e,t,n,i,o)}let l=BI(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=GP(u)?u:new sF(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function YTe(e,t,n){let r=t.offset,i=XTe(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?sF.BLOCK_FOLDED:sF.BLOCK_LITERAL,o=t.source?ZTe(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
||
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
||
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===sF.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
||
`):t.length>c||r[0]===` `?(f===` `?f=`
|
||
`:!p&&f===`
|
||
`&&(f=`
|
||
|
||
`),d+=f+t.slice(c)+r,f=`
|
||
`,p=!0):r===``?f===`
|
||
`?d+=`
|
||
`:f=`
|
||
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
||
`+o[e][0].slice(c);d[d.length-1]!==`
|
||
`&&(d+=`
|
||
`);break;default:d+=`
|
||
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function XTe({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function ZTe(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function QTe(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=sF.PLAIN,c=$Te(a,l);break;case`single-quoted-scalar`:s=sF.QUOTE_SINGLE,c=eEe(a,l);break;case`double-quoted-scalar`:s=sF.QUOTE_DOUBLE,c=tEe(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=LI(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function $Te(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),VI(e)}function eEe(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),VI(e.slice(1,-1)).replace(/''/g,`'`)}function VI(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
||
`?a+=o:o=`
|
||
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function tEe(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
||
`){if(i===`
|
||
`){let{fold:t,offset:i}=nEe(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=rEe[i];if(a)n+=a;else if(i===`
|
||
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
||
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=iEe(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
||
`&&(a!==`\r`||e[r+2]!==`
|
||
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function nEe(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
||
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
|
||
`);)r===`
|
||
`&&(n+=`
|
||
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var rEe={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function iEe(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function HI(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?YTe(e,t,r):QTe(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[FP]:c?aEe(e.schema,i,c,n,r):t.type===`scalar`?oEe(e,i,t,r):e.schema[FP];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=HP(a)?a:new sF(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new sF(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function aEe(e,t,n,r,i){if(n===`!`)return e[FP];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[FP])}function oEe({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[FP];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[FP];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function sEe(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var cEe={composeNode:UI,composeEmptyNode:WI};function UI(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=lEe(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=HI(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=JTe(cEe,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=WI(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!HP(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function WI(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=HI(e,{type:`scalar`,offset:sEe(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function lEe({options:e},{offset:t,source:n,end:r},i){let a=new iF(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=LI(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function uEe(e,t,{offset:n,start:r,value:i,end:a},o){let s=new DI(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=MI(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?UI(c,i,l,o):WI(c,l.end,r,null,l,o);let u=s.contents.range[2],d=LI(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function GI(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function KI(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
||
|
||
`:`
|
||
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var dEe=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=GI(e);r?this.warnings.push(new WTe(i,t,n)):this.errors.push(new AI(i,t,n))},this.directives=new ZP({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=KI(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(WP(i)&&!i.flow&&i.items.length>0){let e=i.items[0];VP(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:KI(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=GI(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=uEe(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new AI(GI(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new AI(GI(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=LI(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new AI(GI(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new DI(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},qI=Symbol(`break visit`),fEe=Symbol(`skip children`),pEe=Symbol(`remove item`);function JI(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),mEe(Object.freeze([]),e,t)}JI.BREAK=qI,JI.SKIP=fEe,JI.REMOVE=pEe,JI.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},JI.parentCollection=(e,t)=>{let n=JI.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function mEe(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=mEe(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===qI)return qI;else r===pEe&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function hEe(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
||
`:case`\r
|
||
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function YI(e){switch(e){case void 0:case` `:case`
|
||
`:case`\r`:case` `:return!0;default:return!1}}var gEe=new Set(`0123456789ABCDEFabcdef`),_Ee=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),XI=new Set(`,[]{}`),vEe=new Set(` ,[]{}
|
||
\r `),ZI=e=>!e||vEe.has(e),yEe=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
||
`||t===`\r`&&this.buffer[e+1]===`
|
||
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
|
||
`||!t&&!this.atEnd)return e+n+1}return t===`
|
||
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&YI(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
||
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&YI(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!YI(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&YI(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(ZI),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&YI(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(ZI),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||YI(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
||
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
||
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>YI(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
||
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
||
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
||
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
||
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
||
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(YI(r)||e&&XI.has(r))break;t=n}else if(YI(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
||
`?(n+=1,r=`
|
||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&XI.has(i))break;if(r===`
|
||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&XI.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(ZI),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(YI(n)||t&&XI.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!YI(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(_Ee.has(t))t=this.buffer[++e];else if(t===`%`&&gEe.has(this.buffer[e+1])&&gEe.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
||
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
||
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},bEe=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function QI(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function xEe(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function SEe(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function $I(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function eL(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function tL(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function CEe(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!QI(t.start,`explicit-key-ind`)&&!QI(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,SEe(t.value)?t.value.end?tL(t.value.end,t.sep):t.value.end=t.sep:tL(t.start,t.sep),delete t.sep)}var wEe=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new yEe,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=hEe(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&CEe(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&xEe(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:xEe(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=eL($I(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
||
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
||
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tL(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(QI(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=eL(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(QI(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(SEe(t.key)&&!QI(t.sep,`newline`)){let e=eL(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):QI(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!QI(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){tL(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||QI(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=eL($I(t));CEe(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
||
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
||
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=eL($I(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=eL($I(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function TEe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new bEe||null,prettyErrors:t}}function EEe(e,t={}){let{lineCounter:n,prettyErrors:r}=TEe(t),i=new wEe(n?.addNewLine),a=new dEe(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new AI(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(jI(e,n)),o.warnings.forEach(jI(e,n))),o}function DEe(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=EEe(e,n);if(!i)return null;if(i.warnings.forEach(e=>EF(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function OEe(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return zP(e)&&!r?e.toString(n):new DI(e,r,n).toString(n)}var nL=new Map,kEe=/(?:^|[^\d])\.0|\d\.0*(?!\d)|\d[eE][-+]?\d/,AEe=/^[-+]?(?:\d+|0o[0-7]+|0x[\da-fA-F]+)$/,jEe=/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/,MEe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/,NEe=/^-?\d+$/,rL=e=>kEe.test(e),PEe=e=>typeof e==`number`&&Number.isInteger(e),iL=e=>{let t=Object.is(e,-0)?`-0`:String(e);return/[.e]/.test(t)?t:`${t}.0`},aL=(e,t,n)=>{let r=e.get(t);e.set(t,r===void 0||r===n?n:null)},oL=(e,t)=>{let n=String(t).replace(/[\\.]/g,`\\$&`);return e?`${e}.${n}`:n},FEe=e=>{let t={},n=(e,r)=>{if(HP(e)){let{value:n,source:i,tag:a}=e;r&&PEe(n)&&(!a||a===`tag:yaml.org,2002:float`)&&typeof i==`string`&&!AEe.test(i)&&(t[r]={value:n,source:i})}else BP(e)?e.items.forEach(({key:e,value:t})=>{HP(e)&&n(t,oL(r,String(e.value)))}):UP(e)&&e.items.forEach((e,t)=>{n(e,oL(r,t))})};return n(e.contents,``),t},sL=class{constructor(e,t){this.value=e,this.source=t}toJSON(){return this.value}},IEe=(e,t,n)=>{let r=n?.source;return PEe(t)&&typeof r==`string`&&!NEe.test(r)?new sL(t,r):t},LEe=e=>{let t={},n=(e,r)=>e instanceof sL?(r&&(t[r]={value:e.value,source:e.source}),e.value):((Array.isArray(e)||D(e))&&Object.entries(e).forEach(([t,i])=>{e[t]=n(i,oL(r,t))}),e);return{value:n(e,``),sourceMap:t}},cL=(e,t)=>{Object.keys(t).length&&nL.set(e,t)},REe=(e,t,n)=>{let r=t?e.get(t):void 0;return r?e.set(n,r):e.delete(n),r},zEe=({previousPath:e,path:t})=>REe(nL,e,t),BEe=(e,t)=>{let n=new Map;return Object.entries(e).forEach(([e,t])=>{let[r,...i]=e.split(`.`);n.has(r)||n.set(r,[]),n.get(r).push([i.join(`.`),t])}),Object.fromEntries(t.flatMap((e,t)=>e===void 0?[]:(n.get(String(e))??[]).map(([e,n])=>[e?`${t}.${e}`:String(t),n])))},VEe=(e,{value:t,source:n})=>typeof e==`number`&&e===t?new sL(e,n):void 0,lL=(e,t,n=VEe,r=``)=>{let i=r&&Object.hasOwn(t,r)?t[r]:void 0,a=i?n(e,i):void 0;return a===void 0?Array.isArray(e)?e.map((e,i)=>lL(e,t,n,oL(r,i))):Tj(e)?Object.fromEntries(Object.entries(e).map(([e,i])=>[e,lL(i,t,n,oL(r,e))])):e:a},uL=(e,t,n)=>n.test(e)&&/[.eE]/.test(e)&&Number(e.replaceAll(`_`,``))===t,HEe=({value:e,source:t})=>uL(t,e,MEe)?t:void 0,UEe={identify:e=>e instanceof sL,default:!0,tag:`tag:yaml.org,2002:float`,resolve:e=>Number(e),stringify:({value:e})=>{let{value:t,source:n}=e;return uL(n,t,jEe)?n:iL(t)}},dL=new Map,WEe=({_file:e,previousPath:t,path:n})=>{if(e.format!==`frontmatter`)return e;let r=REe(dL,t,n);return r?{...e,format:r,configuredFormat:e.format,fmDelimiters:e.fmDelimiters??Hk[r]}:e},fL=new Map,GEe=/\d{16}/,pL=e=>GEe.test(e),KEe=(e,t)=>{aL(fL,e,t)},qEe=e=>{let t=Number(e);return Number.isSafeInteger(t)||KEe(t,String(e)),t},mL=e=>typeof e==`bigint`?qEe(e):Number.isInteger(e)&&!Number.isSafeInteger(e)?(KEe(e,String(BigInt(e))),e):((Array.isArray(e)||D(e))&&Object.entries(e).forEach(([t,n])=>{e[t]=mL(n)}),e),JEe=(e,t,n)=>{let r=n?.source;return typeof t==`number`&&!Number.isSafeInteger(t)&&typeof r==`string`&&NEe.test(r)?qEe(BigInt(r)):t},hL=e=>typeof e==`number`&&!Number.isSafeInteger(e)?fL.get(e)??void 0:void 0,YEe=()=>fL.size>0,gL=e=>{let t=hL(e);return t===void 0?Array.isArray(e)?e.map(gL):Tj(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,gL(t)])):e:BigInt(t)};
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
function XEe(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function ZEe(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
|
||
`,e===t&&(i+=` `.repeat(a+n+2),i+=`^
|
||
`))}return i}var _L=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=XEe(t.toml,t.ptr),i=ZEe(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}};
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
function QEe(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p<e.s.length;e.p++)if(n=e.s.charCodeAt(e.p),a&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10))c&&=3;else if(n<32&&n!==9||n===127)_L.x(`control characters are not allowed in strings`,e);else if((!c||c===3)&&n===r&&(!a||e.s.charCodeAt(e.p+1)===r&&e.s.charCodeAt(e.p+2)===r)){if(a&&(e.s.charCodeAt(e.p+3)===r&&e.p++,e.s.charCodeAt(e.p+3)===r&&e.p++),!c){let t=e.s.slice(s,e.p);o=o?o+t:t}return e.p+=a?3:1,o}else if(!c)!i&&n===92&&(o+=e.s.slice(s,s=e.p),c=1);else if(c===1){if(n===120||n===117||n===85){let t=e.p++-1,r=0,i=n===120?2:n===117?4:8;for(let t=0;t<i;t++,e.p++){let t=e.s.charCodeAt(e.p),n=t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&_L.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&_L.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=`
|
||
`:n===102?o+=`\f`:n===114?o+=`\r`:n===101?o+=`\x1B`:n===34?o+=`"`:n===92?o+=`\\`:_L.x(`unrecognised escape sequence`,e),s=e.p+1,c=0)}else n!==32&&n!==9&&(c===2&&_L.x(`invalid escape: only line-ending whitespace may be escaped`,e,s),c=+(!i&&n===92),s=e.p);_L.x(`unfinished string`,e,t)}
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
var $Ee=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,vL=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)prep:{if(t<3){if(+e.slice(11,13)>23){e=``;break prep}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match($Ee);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
function yL(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function bL(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function xL(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||_L.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?aDe(e):iDe(e);return e.d++,t}return r===34||r===39?QEe(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&_L.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&_L.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?SL(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?tDe(e,r,t):e.s.charCodeAt(e.p+2)===58?nDe(e,r,t):SL(e,e.p,r,0,t)}function SL(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&_L.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&_L.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||bL(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return CL(e,t,16,i);if(a===98)return CL(e,t,2,i);if(a===111)return CL(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:_L.x(`illegal leading zero`,e,t)}else yL(a)||_L.x(`invalid value`,e,t);for(;++e.p<e.s.length&&(a=e.s.charCodeAt(e.p),!bL(a,i));)o||=1,a===95?(o&1||_L.x(`illegal underscore`,e),o+=11,s=!0):o===1&&a===46?o=2:(o===1||o===3)&&(a===101||a===69)?o=4:o===4&&(a===43||a===45)?o=6:yL(a)?o>9?o-=11:o&1||o++:_L.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||_L.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):eDe(e,c,10,t)}function CL(e,t,n,r){let i,a=1;for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!bL(i,r));)i===95?(a&1&&_L.x(`illegal underscore`,e),a=3):yL(i,n)?a&1&&a--:_L.x(`illegal character in numeric literal`,e);a&1&&_L.x(`unfinished numeric value`,e);let o=e.s.slice(t+2,e.p);return a&&(o=o.replaceAll(`_`,``)),eDe(e,o,n,t)}function eDe(e,t,n,r){if(e.bi!==!0)int:{let i=parseInt(t,n);if(!Number.isSafeInteger(i)){if(e.bi)break int;_L.x(`integer value cannot be represented losslessly`,e,r)}return i}return BigInt(n===10?t:(n===2?`0b`:n===8?`0o`:`0x`)+t)}function tDe(e,t,n){let r=e.p++,i;if(!yL(t)||!yL(e.s.charCodeAt(e.p++))||!yL(e.s.charCodeAt(e.p++))||!yL(e.s.charCodeAt(e.p++)))return SL(e,e.p=r,t,0,n);if(e.p+=5,yL(e.s.charCodeAt(e.p++))||_L.x(`invalid date-time: date part is malformed`,e,r),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!yL(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return wL(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&_L.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;yL(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return wL(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return wL(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return wL(e,e.s.slice(r,e.p),2,i,r)}function nDe(e,t,n){let r=e.p;if(!yL(t)||!yL(e.s.charCodeAt(++e.p)))return SL(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;yL(e.s.charCodeAt(++e.p)););return wL(e,e.s.slice(r,e.p),4,!1,r)}function wL(e,t,n,r,i,a){if(e.ld){let a=new vL(t,n,r);return a.isValid()||_L.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){_L.x(t instanceof Error?t.message:``+t,e,i)}}
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
function rDe(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&_L.x(`control characters are not allowed in comments`,e)}}function TL(e,t,n){let r;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((r=e.s.charCodeAt(e.p))===32||r===9||!t&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(n||r!==35)break;rDe(e)}}
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
function EL(e,t=61){let n,r=0,i=[],a,o=e.s.charCodeAt(n=e.p);do if(o===t)return r||_L.x(`unexpected end of key`,e),r===1&&i.push(e.s.slice(a,e.p)),e.p++,i;else o===46?(r||_L.x(`illegal empty bare key`,e),r===1&&i.push(e.s.slice(a,e.p)),r=0):!r&&(o===34||o===39)?(o===e.s.charCodeAt(e.p+1)&&o===e.s.charCodeAt(e.p+2)&&_L.x(`illegal quoted key: multiline strings are not allowed`,e),i.push(QEe(e)),r=2,e.p--):o===32||o===9?r===1&&(i.push(e.s.slice(a,e.p)),r=2):r===2||o<48&&o!==45||o>57&&o<65||o>90&&o<97&&o!==95||o>122?_L.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));_L.x(`incomplete key-value: cannot find end of key`,e,n)}function iDe(e){let t=e.p++,n=Object.create(null),r=new Set,i;for(;e.p<e.s.length;){if(TL(e),(i=e.s.charCodeAt(e.p))===125)return e.p++,n;let t,a=n,o=!1,s=e.p,c=EL(e);for(let n=0;n<c.length;n++){n&&(a=o?a[t]:a[t]=Object.create(null)),t=c[n],(o=Object.hasOwn(a,t))&&(typeof a[t]!=`object`||r.has(a[t]))&&_L.x(`trying to redefine an already defined value`,e,s);let i=t===`__proto__`;if(e.uk&&(i||t===`constructor`)){a=e.uk!==1&&_L.x(`document contains an unsafe property`,e,s);break}!o&&i&&Object.defineProperty(a,t,{enumerable:!0,configurable:!0,writable:!0})}o&&_L.x(`trying to redefine an already defined value`,e,s),TL(e,!0,!0);let l=xL(e,125);if(a&&typeof(a[t]=l)==`object`&&r.add(l),TL(e),(i=e.s.charCodeAt(e.p++))===125)return n;i!==44&&_L.x(`expected comma or end of structure`,e,e.p-1)}_L.x(`unfinished table`,e,t)}function aDe(e){let t=e.p++,n=[],r;for(;e.p<e.s.length;){if(TL(e),(r=e.s.charCodeAt(e.p))===93)return e.p++,n;if(n.push(xL(e,93)),TL(e),(r=e.s.charCodeAt(e.p++))===93)return n;r!==44&&_L.x(`expected comma or end of structure`,e,e.p-1)}_L.x(`unfinished array`,e,t)}
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
function oDe(e,t,n,r,i){let a=n,o=r,s,c=!1,l;for(let n=0;n<t.length;n++){if(n){if(a=c?a[s]:a[s]=Object.create(null),o=(l=o[s]).c,i===0&&(l.t===1||l.t===2))return null;if(l.t===2){let e=a.length-1;a=a[e],o=o[e].c}}if(s=t[n],(c=Object.hasOwn(a,s))&&o[s]?.t===0&&o[s]?.d)return null;if(!c){let r=s===`__proto__`;if(e.uk&&(r||s===`constructor`))return!1;r&&(Object.defineProperty(a,s,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,s,{enumerable:!0,configurable:!0,writable:!0})),o[s]={t:n<t.length-1&&i===2?3:i,d:!1,i:0,c:Object.create(null)}}}if(l=o[s],l.t!==i&&(i!==1||l.t!==3)||(i===2&&(l.d||(l.d=!0,a[s]=[]),a[s].push(a=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,i===1)a=c?a[s]:a[s]=Object.create(null);else if(i===0&&c)return null;return[s,a,l.c]}function sDe(e,t,n){(t===null||e.uk===2)&&_L.x(t===null?`trying to redefine an already defined table or value`:`document contains an unsafe property`,e,n)}function cDe(e,t={}){let n={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour===`throw`?2:+(t.unsafeKeyBehaviour===`drop`)},r=Object.create(null),i=Object.create(null),a,o=!1,s=r,c=i;for(e.charCodeAt(0)===65279&&n.p++,TL(n);n.p<e.length;){if(e.charCodeAt(n.p)===91){let t=e.charCodeAt(++n.p)===91;a=n.p+=+t,o=!1;let l=EL(n,93);t&&(e.charCodeAt(n.p)!==93&&_L.x(`expected end of table array declaration`,n),n.p++);let u=oDe(n,l,r,i,t?2:1);u?(c=u[2],s=u[1]):(sDe(n,u,a),o=!0)}else{a=n.p;let e=oDe(n,EL(n),s,c,0);!e&&!o&&sDe(n,e,a),TL(n,!0,!0);let t=xL(n,void 0);e&&!o&&(e[1][e[0]]=t)}TL(n,!0),n.p<e.length&&(a=e.charCodeAt(n.p))!==10&&(a!==13||e.charCodeAt(n.p+1)!==10)&&_L.x(`each key-value declaration must be followed by an end-of-line`,n),TL(n)}return r}
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
var lDe=/^[a-z0-9-_]+$/i,uDe=!!``.isWellFormed;function DL(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(typeof e.getUTCDate==`function`&&e instanceof Date)return`date`;if(globalThis.Temporal){if(e.until){if(e instanceof Temporal.ZonedDateTime)return`temporal/tz+uc`;if(e instanceof Temporal.PlainDateTime||e instanceof Temporal.PlainDate)return`temporal/uc`;if(e instanceof Temporal.PlainTime||e instanceof Temporal.Instant)return`temporal`;if(e instanceof Temporal.PlainYearMonth)return`temporal/x`}else if(e.toPlainDate&&e instanceof Temporal.PlainMonthDay||e.negated&&e instanceof Temporal.Duration)return`temporal/x`}}return t}function dDe(e){for(let t=0;t<e.length;t++)if(DL(e[t])!==`object`)return!1;return e.length!=0}function fDe(e){return JSON.stringify(e).replaceAll(``,`\\u007f`)}function pDe(e){return fDe(uDe?e.toWellFormed():e)}function mDe(e){if(lDe.test(e))return e;if(uDe&&!e.isWellFormed())throw RangeError(`key contains illegal lone surrogates`);return fDe(e)}function OL(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);switch(t){case`number`:if(isNaN(e))return`nan`;if(e===1/0)return`inf`;if(e===-1/0)return`-inf`;if(Number.isInteger(e)&&(r||!Number.isSafeInteger(e)))return e.toFixed(1);case`bigint`:case`boolean`:case`temporal`:return e.toString();case`string`:return pDe(e);case`date`:if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString();case`object`:return hDe(e,n,r,i);case`array`:return gDe(e,n,r,i);case`temporal/tz+uc`:if(i){let t=e.timeZoneId,n=t.charCodeAt(0);if(n!==43&&n!==45&&(n!==85&&n!==71&&n!==90&&n!==69||t!==`UTC`&&t!==`UCT`&&t!==`Universal`&&t!==`Zulu`&&!t.startsWith(`GMT`)&&t!==`Greenwich`&&!t.startsWith(`Etc/`)))throw TypeError(`Temporal objects with an IANA timezone are not allowed in Temporal strict mode`)}case`temporal/uc`:if(i&&e.calendarId!==`iso8601`)throw TypeError(`Temporal objects with a non-default calendar are not allowed in Temporal strict mode`);return e.toString({calendarName:`never`,timeZoneName:`never`});case`temporal/x`:throw TypeError(`Unsupported `+e[Symbol.toStringTag])}}function hDe(e,t,n,r){let i=Object.keys(e);if(i.length===0)return`{}`;let a=`{ `;for(let o=0;o<i.length;o++){let s=i[o];o&&(a+=`, `),a+=mDe(s)+` = `+OL(e[s],DL(e[s]),t-1,n,r)}return a+` }`}function gDe(e,t,n,r){if(e.length===0)return`[]`;let i=`[ `;for(let a=0;a<e.length;a++){if(a&&(i+=`, `),e[a]===null||e[a]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);i+=OL(e[a],DL(e[a]),t-1,n,r)}return i+` ]`}function _De(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``;for(let o=0;o<e.length;o++)a+=`${a&&`
|
||
`}[[${t}]]\n`,a+=kL(0,e[o],t,n,r,i);return a}function kL(e,t,n,r,i,a){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let o=``,s=``,c=Object.keys(t);for(let e=0;e<c.length;e++){let l=c[e];if(t[l]!==null&&t[l]!==void 0){let e=DL(t[l]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let c=mDe(l);if(e===`array`&&dDe(t[l]))s+=(s&&`
|
||
`)+_De(t[l],n?`${n}.${c}`:c,r-1,i,a);else if(e===`object`){let e=n?`${n}.${c}`:c;s+=(s&&`
|
||
`)+kL(e,t[l],e,r-1,i,a)}else o+=c,o+=` = `,o+=OL(t[l],e,r,i,a),o+=`
|
||
`}}return e&&(o||!s)&&(o=o?`[${e}]\n${o}`:`[${e}]`),o&&s?`${o}\n${s}`:o||s}function vDe(e,{maxDepth:t=1e3,numbersAsFloat:n=!1,strictTemporal:r=!1}={}){if(DL(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let i=kL(0,e,``,t,n,r);return i[i.length-1]===`
|
||
`?i:i+`
|
||
`}
|
||
/*!
|
||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*
|
||
* Redistribution and use in source and binary forms, with or without
|
||
* modification, are permitted provided that the following conditions are met:
|
||
*
|
||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||
* list of conditions and the following disclaimer.
|
||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||
* this list of conditions and the following disclaimer in the
|
||
* documentation and/or other materials provided with the distribution.
|
||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||
* may be used to endorse or promote products derived from this software without
|
||
* specific prior written permission.
|
||
*
|
||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/
|
||
var yDe=/(?<![\w.:+-])(?:\d{4}-\d{2}-\d{2}(?:[Tt ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:[Zz]|[+-]\d{2}:\d{2})?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)(?![\w.:+-])/g,bDe=/(?<![\w.:+-])[-+]?(?:0x[\da-fA-F_]+|0o[0-7_]+|0b[01_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][-+]?\d[\d_]*)?)(?![\w.:+-])/g,xDe=/"""[\s\S]*?"""(?!")|'''[\s\S]*?'''(?!')|"(?:[^"\\\n]|\\.)*"|'[^'\n]*'|#[^\n]*/g,SDe=/^[-+]?\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][-+]?\d[\d_]*)?$/,CDe=class extends vL{#e;constructor(e,t){super(e),this.#e=t}toISOString(){return this.#e}},wDe=(e,t)=>{let n=uL(t,e,SDe)?t:iL(e);return Object.assign(new Date(0),{toISOString:()=>n})},TDe=e=>{let t=new Map,n=new Set;return e.replace(xDe,` `).match(bDe)?.forEach(e=>{let r=!/^[-+]?0[xob]/.test(e)&&/[.eE]/.test(e),i=Number(e.replaceAll(`_`,``));r?Number.isInteger(i)&&aL(t,i,e):n.add(i)}),n.forEach(e=>{t.delete(e)}),t},EDe=e=>{let t=new Map;return e.match(yDe)?.forEach(e=>{let n=new vL(e);n.isValid()&&aL(t,n.toISOString(),e)}),t},DDe=(e,t)=>{let n={},r,i,a=(t,o)=>{if(t instanceof vL){let i=t.toISOString();r??=EDe(e),n[o]={value:i,source:r.get(i)??i}}else Number.isInteger(t)?(i??=rL(e)?TDe(e):new Map,i.has(t)&&(n[o]={value:t,source:i.get(t)??iL(t)})):(Array.isArray(t)||D(t))&&Object.entries(t).forEach(([e,t])=>{a(t,oL(o,e))})};return a(t,``),n},ODe=({path:e,str:t,parsed:n})=>{cL(e,DDe(t,n))},kDe=(e,t)=>e===t||e instanceof vL&&e.toISOString()===t,ADe=(e,{value:t,source:n})=>typeof t==`number`?e===t?wDe(t,n):void 0:kDe(e,t)?new CDe(t,n):void 0,jDe=(e,t)=>lL(e,t,ADe),MDe=(e,t,n)=>IEe(e,JEe(e,t,n),n),NDe=(e,t)=>{if(t===void 0||!rL(e))return pL(e)?JSON.parse(e,JEe):JSON.parse(e);let{value:n,sourceMap:r}=LEe(JSON.parse(e,MDe));return cL(t,r),n},PDe=(e,t)=>{let n=mL(cDe(e,{integersAsBigInt:`asNeeded`}));return t!==void 0&&ODe({path:t,str:e,parsed:n}),Sr(n)},FDe=(e,t,n)=>{let r=EEe(e,t);if(r.warnings.forEach(e=>console.warn(e)),r.errors.length)throw r.errors[0];return cL(n,FEe(r)),r.toJS(t)},IDe=(e,t,n)=>{let r=pL(e),i=r?{...t,intAsBigInt:!0}:t,a=n!==void 0&&rL(e)?FDe(e,i,n):DEe(e,i);return r?mL(a):a},LDe=e=>{let t=e.split(`
|
||
`,1)[0].trim();return Uk.find(e=>t===Hk[e][0])??`yaml-frontmatter`},RDe=/^\{\n(?<head>\{[\s\S]*?\})\n\}(?:\n\n(?<body>[\s\S]*))?$/,zDe=(e,t)=>{let n=e.trim();return NDe(n.startsWith(`{`)?n:`{${n}}`,t)},BDe={yaml:(e,t)=>IDe(e,void 0,t),toml:PDe,json:NDe},VDe={...BDe,json:zDe},HDe=new Map,UDe=({collection:e,collectionFile:t,isIndexFile:n,format:r,text:i,path:a})=>{let{format:o,fmDelimiters:s,bodyField:{key:c=`body`,inline:l=!1}={}}=IA({collection:e,collectionFile:t,isIndexFile:n}),[u,d]=(o===`frontmatter`?PA({format:r,delimiter:s}):s)??Hk[`yaml-frontmatter`],f=JE(u),p=JE(d),m=mA(HDe,`${f}|${p}`,()=>RegExp(`^${f}[ \t]*\n(?:(?<head>[\\s\\S]*?)\n)?${p}[ \t]*(?:\n(?<body>[\\s\\S]*))?$`,`s`)),h=i.trimStart(),g=(r===`json-frontmatter`&&u===`{`&&d===`}`?h.match(RDe)?.groups:void 0)??h.match(m)?.groups;if(!g)return{content:{[c]:i},hasFrontMatter:!1};let{head:_=``,body:v}=g,y=Uk.includes(r)?qk(r):void 0,b=y?VDe[y](_,a):{};return(!b||typeof b!=`object`||Array.isArray(b))&&(b={}),{content:{...b,...!Object.hasOwn(b,c)&&(!l||v?.trim())?{[c]:v?.replace(/^\n/,``)}:{}},hasFrontMatter:!0}},WDe=({path:e,folder:{collectionName:t,fileName:n}})=>{let r=YA(t),i=r&&n?ij(r,n):void 0;if(!r)throw Error(`Collection not found`);if(n&&!i)throw Error(`Collection file not found`);let a=!i&&Rk(r,e),{format:o}=IA({collection:r,collectionFile:i,isIndexFile:a});return{collection:r,collectionFile:i,isIndexFile:a,format:o}},GDe=e=>{try{return!!IO.get(WDe(e).format)?.parser}catch{return!1}},KDe=async({text:e=``,path:t,folder:n})=>{let r=WDe({path:t,folder:n}),{collection:i,collectionFile:a,isIndexFile:o}=r,{format:s}=r;nL.delete(t),dL.delete(t),e=e.trimEnd().replace(/\r\n?/g,`
|
||
`);let c=e.trimStart(),l=IO.get(s)?.parser;if(l)return l(c);if(s===`raw`)return{body:e};try{let n=s===`frontmatter`;if(n&&(s=LDe(c)),Uk.includes(s)){let{content:r,hasFrontMatter:c}=UDe({collection:i,collectionFile:a,isIndexFile:o,format:s,text:e,path:t});return n&&c&&dL.set(t,s),r}let r=qk(s);if(r)return BDe[r](c,t)}catch(e){throw Error(`${t} could not be parsed due to ${e.name}: ${e.message}`)}throw IO.has(s)?Error(`${t} could not be parsed, as no \`fromFile\` method was registered for the custom “${s}” format with \`CMS.registerCustomFormat()\``):Error(`${t} could not be parsed due to an unknown format: ${s}`)},qDe=async()=>{let{scheduler:e}=globalThis;typeof e?.yield==`function`?await e.yield():await Zc()},JDe=async(e,t,{budget:n=50}={})=>{let r=performance.now();for(let i=0;i<e.length;i+=1)performance.now()-r>=n&&(await qDe(),r=performance.now()),await t(e[i])},AL=()=>{let e=0;return{next:()=>{e+=1;let t=e;return()=>t===e}}},jL=(e,{lastInFirstOut:t=!1}={})=>{let n=0,r=[];return Object.assign(async(i,{key:a=void 0}={})=>{n>=e?await new Promise(e=>{r.push({start:e,key:a})}):n+=1;try{return await i()}finally{let e=t?r.pop():r.shift();e?e.start():--n}},{prioritize:e=>{let n=e===void 0?-1:r.findIndex(t=>t.key===e);if(n>-1){let[e]=r.splice(n,1);t?r.push(e):r.unshift(e)}}})},YDe=e=>/\/_index(?:\.[\w-]+)?\.md$/.test(e),XDe=/{{([^]*?)}}/,ZDe=new Map,ML=({subPath:e,subPathTemplate:t})=>{if(t?.includes(`{{slug}}`)){let n=mA(ZDe,t,()=>{let e=t.split(XDe).map((e,t)=>t%2==0?JE(e):e===`slug`?`([^/]+)`:`[^/]+?`).join(``);return RegExp(`^${e}$`)}),[,r]=e.match(n)??[];if(r)return r}return e},QDe=(e,t=new Set)=>{if(typeof e!=`object`||!e)return!1;if(t.has(e))return!0;t.add(e);let n=Object.values(e).some(e=>QDe(e,t));return t.delete(e),n},$De=()=>`${xr}\n${tk.current}`,eOe=({parsedFileMap:e,path:t,key:n,content:r})=>{try{e.set(t,{key:n,content:structuredClone(r),format:dL.get(t),valueSources:nL.get(t)})}catch{}},tOe=async(e,t,n)=>{let{path:r,parsed:i}=e,a=$De(),o=GDe(e);if(i?.key===a&&!o)return i.format?dL.set(r,i.format):dL.delete(r),i.valueSources?nL.set(r,i.valueSources):nL.delete(r),i.content;try{if(e.text===void 0)throw Error(`${r} could not be read.`);let t=await KDe(e);if(QDe(t))throw Error(`${r} could not be parsed, as it contains a circular reference.`);return n&&!o&&!pL(e.text)&&eOe({parsedFileMap:n,path:r,key:a,content:t}),t}catch(e){console.error(e),t.push(e);return}},nOe=({rawContent:e,fields:t,i18nSingleFile:n,validate:r})=>{let i=t[0].name;if(n)return!D(e)||!Object.values(e).every(r)?void 0:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{[i]:t}]));if(r(e))return{[i]:e}},rOe=(e,t,n)=>{if(!D(e))return;let r=t.filter(e=>e!==n),i=Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e))),a={[n]:i};return r.forEach(t=>{D(e[t])&&(a[t]=e[t])}),a},iOe=(e,t,n)=>{let r={rawContent:e,fields:t,i18nSingleFile:n};return pM(t,`list`)?nOe({...r,validate:EP(t[0])?e=>D(e)||Array.isArray(e):Array.isArray}):pM(t,`keyvalue`)?nOe({...r,validate:e=>D(e)&&Object.values(e).every(e=>typeof e==`string`)}):D(e)?e:void 0},aOe=(e,t,n)=>{let r=iOe(e,t,n);if(r)return n?Object.fromEntries(Object.entries(r).map(([e,n])=>[e,OP(n,t,!0)])):OP(r,t,!0)},oOe=(e,t,n,r,i)=>r?.split(`/`).pop()===`_index`&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(e)&&i!==`md`?!0:YDe(e)?!(t||Lk(n)?.name===`_index`||r?.split(`/`).pop()===`_index`&&i===`md`||sA(n)===`_index`):!1,sOe=({file:e,fileName:t,fullPathRegEx:n,defaultLocale:r,isMultiFileStructure:i})=>{let{path:a,folder:{filePathMap:o}}=e;if(t){if(i){let[e,t]=Object.entries(o??{}).find(([,e])=>e===a)??[];return{subPath:t,locale:e}}return{subPath:a,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};let s=a.match(n);if(!s?.groups)return{subPath:void 0,locale:void 0};let{subPath:c,locale:l=r}=s.groups;return{subPath:c,locale:l}},cOe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a})=>{let o=r||ML({subPath:i,subPathTemplate:a});e.slug=o,e.locales._default={slug:o,path:n,content:Aj(t)}},lOe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,allLocales:o})=>{let s=r||ML({subPath:i,subPathTemplate:a});e.slug=s,e.locales=Object.fromEntries(o.filter(e=>D(t[e])).map(e=>[e,{slug:s,path:n,content:Aj(t[e])}]))},uOe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,locale:o,defaultLocale:s,collectionName:c,canonicalSlugKey:l,entryMap:u})=>{let d=l&&typeof t[l]==`string`?t[l]:void 0,f=r||ML({subPath:i,subPathTemplate:a}),p={slug:f,path:n,content:Aj(t)},m=`${c}/${r||(d??i)}`,h=u.get(m);return h?(h.locales[o]=p,o!==s&&h.slug||(h.slug=f,h.subPath=i),!0):(e.id=m,e.locales[o]=p,e.slug=f,u.set(m,e),!1)},NL=new Map,PL=({collection:e,item:t,index:n,path:r,meta:i={}})=>{let{fields:a,_i18n:{i18nEnabled:o,allLocales:s,defaultLocale:c,structureMap:{i18nSingleFileDefaultRoot:l}}}=e,u=l?rOe(t,s,c):t,d=u?aOe(u,a,o):void 0;if(!d)return;let f=String(n),p={id:``,slug:``,subPath:f,locales:{},arrayIndex:n,...i};return o?lOe({entry:p,rawContent:d,path:r,subPath:f,allLocales:s}):cOe({entry:p,rawContent:d,path:r,subPath:f}),Object.keys(p.locales).length?p:void 0},dOe=({collection:e,file:t,rawContent:n,entries:r,errors:i})=>{let{path:a,meta:o={}}=t;Array.isArray(n)?(NL.set(a,n),n.forEach((t,n)=>{let i=PL({collection:e,item:t,index:n,path:a,meta:o});i&&r.push(i)})):(NL.set(a,null),i.push(Error(`${a} could not be parsed, as it doesn’t contain an array.`)))},fOe=async({file:e,entries:t,entryMap:n,errors:r,parsedFileMap:i})=>{let a=await tOe(e,r,i),{path:o,meta:s={},folder:{collectionName:c,fileName:l}}=e,{collection:u,collectionFile:d}=aj(c,l)??{},f=!d&&u?._type===`entry`&&u._file.arrayFile;if(!a){f&&NL.set(o,null);return}if(!u)return;if(f){dOe({collection:u,file:e,rawContent:a,entries:t,errors:r});return}let{fields:p=[],_file:{fullPathRegEx:m,subPath:h,extension:g},_i18n:{i18nEnabled:_,allLocales:v,defaultLocale:y,structureMap:b,canonicalSlug:{key:x}}}=d??u,S=!d&&Rk(u,o)&&Lk(u)?.fields||p,C=b.i18nSingleFileDefaultRoot?rOe(a,v,y):a;if(!C)return;let w=VA(b),T=aOe(C,S,w);if(!T||oOe(o,l,u,h,g))return;let ee=HA(b),{subPath:E,locale:te}=sOe({file:e,fileName:l,fullPathRegEx:m,defaultLocale:y,isMultiFileStructure:ee});if(!E||ee&&!te)return;let ne={id:``,slug:``,subPath:E,locales:{},...s},re={entry:ne,rawContent:T,path:o,fileName:l,subPath:E,subPathTemplate:h};if(!_)cOe(re);else if(w)lOe({...re,allLocales:v});else if(uOe({...re,locale:te,defaultLocale:y,collectionName:c,canonicalSlugKey:x,entryMap:n}))return;t.push(ne)},FL=async(e,{parsedFileMap:t}={})=>{let n=[],r=new Map,i=[];return await JDe(e,async e=>{try{await fOe({file:e,entries:n,entryMap:r,errors:i,parsedFileMap:t})}catch(e){console.error(e),i.push(e)}}),{entries:n.filter(e=>(e.id=Qc(),!!e.slug&&!!Object.keys(e.locales).length)),errors:i}},pOe=/^\/(?<pattern>.+)\/(?<flags>[dgimsuvy]*)$/,mOe=/[gy]/g,hOe=e=>{try{return RegExp(``,e),!0}catch{return!1}},IL=e=>{if(e instanceof RegExp){let t=e.flags.replace(mOe,``);return t===e.flags?e:new RegExp(e.source,t)}if(typeof e==`string`&&e){let{pattern:t,flags:n}=e.match(pOe)?.groups??{};if(t!==void 0)try{return IL(new RegExp(t,n))}catch{if(hOe(n))return}try{return new RegExp(e)}catch{}}},LL=WO([]),gOe=KO(()=>new Set(LL.current.map(e=>e.id))),_Oe=new WeakMap,vOe=e=>mA(_Oe,e,()=>{let{filter:t}=e._type===`entry`?e:{},n=t?.field;if(n!==void 0)return{field:n,pattern:IL(t?.pattern),values:t?.value===void 0?[]:Array.isArray(t.value)?t.value:[t.value]}}),yOe=(e,t)=>{let n=vOe(e);if(!n||zk(e,t))return!0;let{field:r,pattern:i,values:a}=n,o=zR({entry:t,locale:e._i18n.defaultLocale,collectionName:e.name,key:r,resolveRef:!1}),s=Array.isArray(o)?o:[o??null];return i?s.some(e=>e!=null&&i.test(String(e))):s.some(e=>a.includes(e))},RL=e=>eP(e).filter(t=>!t.hide&&yOe(t,e)),zL={entrySource:void 0,folderSource:void 0,buckets:void 0,map:new Map,folderMap:new Map},bOe=()=>{if(!zL.buckets){let e=new Map;tj.current.forEach(t=>{new Set(eP(t).map(({name:e})=>e)).forEach(n=>{mA(e,n,()=>[]).push(t)})}),zL.buckets=e}return zL.buckets},xOe=e=>{let t=YA(e);return t?(bOe().get(e)??[]).filter(e=>yOe(t,e)):[]},SOe=()=>{let e=tj.current,t=ej.current;(e!==zL.entrySource||t!==zL.folderSource)&&(zL.entrySource=e,zL.folderSource=t,zL.buckets=void 0,zL.map=new Map,zL.folderMap=new Map)},BL=e=>{SOe();let t=zL.map.get(e);if(t)return t;let n=xOe(e);return zL.map.set(e,n),n},COe=(e,t)=>{let{_file:{fullPathRegEx:n=void 0,subPath:r=void 0}={}}=e._type===`entry`?e:{};if(!n)return[];let{defaultLocale:i}=e._i18n,a=new Set(t);return tj.current.flatMap(e=>{if(a.has(e))return[];let t={},o={};Object.values(e.locales).forEach(e=>{let{subPath:a,locale:s=i}=e.path.match(n)?.groups??{};a&&(t[s]={...e,slug:ML({subPath:a,subPathTemplate:r})},o[s]=a)});let s=SP(t,i);if(!s)return[];let{slug:c}=t[s],l=o[s];return[{...e,slug:c,subPath:l,locales:t}]})},VL=e=>(SOe(),mA(zL.folderMap,e,()=>{let t=YA(e),n=bOe().get(e)??[];return t?[...n,...COe(t,n)]:n})),wOe=(e,t)=>{let n=YA(e);return!n||Ik(n)===void 0?t.length:t.filter(e=>!zk(n,e)).length},TOe=e=>Lk(e)?!BL(e.name).some(t=>zk(e,t)):!1,EOe=`order`,DOe=e=>e?._type===`entry`&&(!!e.reorder||ck(e)),HL=e=>{let t=e?.reorder;if(t&&typeof e.file!=`string`)return D(t)&&typeof t.key==`string`&&t.key?t.key:EOe},OOe=e=>{let t=e?.reorder;if(D(t)&&typeof t.group==`string`&&t.group)return t.group},UL=e=>{if(ck(e))return e=>e.arrayIndex??0;let t=HL(e);if(!t)return()=>void 0;let{defaultLocale:n}=e._i18n;return e=>{let r=e.locales[n]?.content?.[t],i=typeof r==`number`||typeof r==`string`&&r.trim()?Number(r):NaN;return Number.isFinite(i)?i:void 0}},WL=(e,t)=>{let n=UL(t),r=e.map(e=>({entry:e,v:n(e)}));return r.sort((e,t)=>e.v!==void 0&&t.v!==void 0?e.v-t.v:e.v===void 0?t.v===void 0?0:1:-1),r.map(({entry:e})=>e)},GL=e=>e?.identifier_field??`title`,kOe=new WeakMap,AOe=e=>mA(kOe,e,()=>{let t=new Map;return e.forEach(({value:e,label:n})=>{t.has(e)||t.set(e,n)}),t}),jOe=new WeakMap,MOe=0,KL=e=>mA(jOe,e,()=>{let e=MOe;return MOe+=1,e}),qL=e=>IM(e)?e:e===`slug`?`{{fields.slug}}`:`{{${e}}}`,NOe=e=>{if(!e||e.widget!==`list`)return!1;let t=`fields`in e,n=`types`in e;return t||n},POe={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`longOffset`},FOe=new Map,IOe=e=>{let t=e??``,n=FOe.get(t);return n||(n=new Intl.DateTimeFormat(`en-US`,{...POe,hourCycle:`h23`,timeZone:e}),FOe.set(t,n)),n},JL=({date:e=new Date,timeZone:t=void 0}={})=>Object.fromEntries(IOe(t).formatToParts(e).filter(({type:e})=>e in POe).map(({type:e,value:t})=>[e,t])),LOe=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ROe={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function zOe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function BOe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function VOe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function HOe(e){return VOe(e)||zOe(e)}var UOe=document.createElement(`i`);function WOe(e){let t=`&`+e+`;`;UOe.innerHTML=t;let n=UOe.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var GOe=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function YL(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?HOe:u===`decimal`?zOe:BOe;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&LOe.includes(y)&&(_=y,v=WOe(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&WOe(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):HOe(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(KOe(e))h(7,S),C=`�`;else if(e in ROe)h(6,S),C=ROe[e];else{let t=``;qOe(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,GOe[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function KOe(e){return e>=55296&&e<=57343||e>1114111}function qOe(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var XL=e=>e?.name||e?.login||e?.email,JOe=/^#+[^\S\n\r\u2028\u2029]+(.*)$/gm,YOe=e=>{if(!e.endsWith(`}`))return e;for(let t=e.indexOf(`{#`,1);t>0&&!(t+2>=e.length-1);t=e.indexOf(`{#`,t+1))if(/\s/.test(e[t-1]))return e.slice(0,t).trimEnd();return e},XOe=e=>e.matchAll(JOe).map(([,e])=>YOe(e.trim())).find(e=>!!e)??``,ZOe=``,QOe=/<(?!\/?(?:strong|em|code)(?:\s[^>]*)?>)/g,$Oe=(e,{allowMarkdown:t=!1}={})=>(e=vr(e.replace(QOe,ZOe)),t&&(e=YL(e)),e=_t(e,{ALLOWED_TAGS:t?[`strong`,`em`,`code`]:[],ALLOWED_ATTR:[]}),t||(e=YL(e)),e.replaceAll(ZOe,t?`<`:`<`).trim()),ZL=(e,{identifierField:t=`title`,useBody:n=!0}={})=>{let r=[t,`title`,`name`,`label`].find(t=>typeof e[t]==`string`&&!!e[t].trim());return r?e[r].trim():n&&typeof e.body==`string`?XOe(e.body):``},eke=(e,t)=>{let{slug:n,entryPath:r,basePath:i,fullPathRegEx:a,locales:o,localeSuffixes:s,commitDate:c,commitAuthor:l}=t;if(e===`slug`)return n;if(e===`locales`)return o.sort((e,t)=>e.localeCompare(t)).join(`, `);if(e===`dirname`)return TP(r,{basePath:i,fullPathRegEx:a});if(e===`filename`||e===`extension`)return Ak(r,s)[e];if(e===`commit_date`)return c??``;if(e===`commit_author`)return XL(l)},QL=!1,tke=(e,t)=>{let{content:n,collectionName:r,fileName:i,isIndexFile:a,replaceSubContext:o,locale:s,fallbackSummary:c}=t,{value:l,transformations:u}=IN(e),d=kk(l),f={collectionName:r,fileName:i,valueMap:n,keyPath:d,isIndexFile:a},p=eke(l,o),m=RM(u,e=>tke(e,t));if(p===void 0&&(m.some(({method:e})=>e===`date`||e===`ternary`)?p=Object.hasOwn(n,d)?n[d]:void 0:(_M(f)?.widget===`relation`&&(QL=!0),p=RR({...f,locale:s})),d===`title`&&!p&&(p=c)),p===void 0)return``;if(p instanceof Date&&!m.length){let{year:e,month:t,day:n}=JL({date:p});return`${e}-${t}-${n}`}return m.length&&(p=LN({fieldConfig:_M({...f}),value:p,transformations:m,locale:s})),String(p)},nke=new WeakMap,rke,ike=0,ake=()=>{let e=tj.current;return e!==rke&&(rke=e,ike+=1),ike},oke=(e,t,n)=>{let r=n?ij(e,n):void 0;if(r)return{collectionFile:r,isIndexFile:!1,label:oj(r),template:r.summary};let i=zk(e,t),{label:a,summary:o}=i&&Lk(e)||{};return{isIndexFile:i,label:a,template:o}},ske=(e,t,{locale:n,useTemplate:r=!1,allowMarkdown:i=!1,template:a,useIndexFileLabel:o=!0,fileName:s}={})=>{let{_type:c,name:l}=e,{collectionFile:u,isIndexFile:d,label:f,template:p}=oke(e,t,s);if((u||d&&o)&&!(r&&a===void 0&&p))return f;let{defaultLocale:m}=(u??e)._i18n,{_file:{basePath:h,fullPathRegEx:g}={},summary:_}=c===`entry`?e:{},v=GL(c===`entry`?e:void 0),y=a??p??_,{locales:b,slug:x,commitDate:S,commitAuthor:C}=t,w=n??m,T=Object.hasOwn(b,w)?w:Object.keys(b)[0]??w,{content:ee={},path:E=``}=b[T]??{},te=ZL(ee,{identifierField:v})||f||x.replaceAll(`-`,` `);if(!r||!y)return $Oe(te,{allowMarkdown:i});let ne={content:ee,collectionName:l,fileName:u?.name,isIndexFile:d,replaceSubContext:{slug:x,entryPath:E,basePath:h,fullPathRegEx:g,locales:Object.keys(b),localeSuffixes:jk(u??e),commitDate:S,commitAuthor:C},locale:T,fallbackSummary:te};return $Oe(NM(y,(e,t)=>tke(t,ne)),{allowMarkdown:i})},$L=(e,t,n={})=>{let{locale:r,useTemplate:i=!1,allowMarkdown:a=!1,template:o,useIndexFileLabel:s=!0,fileName:c}=n,l=mA(mA(nke,t,()=>new WeakMap),e,()=>new Map),u=[r??``,i?`1`:`0`,a?`1`:`0`,o??``,s?`1`:`0`,c??``,Fc.current].join(`
|
||
`),d=ake(),f=l.get(u);if(f&&(f.generation===void 0||f.generation===d))return f.summary;let p=QL;QL=!1;let m=ske(e,t,n),h=QL;return QL=p||h,l.set(u,{summary:m,generation:h?d:void 0}),m},cke=(e,t)=>{if(!ij(e,t)?.summary)return;let n=cj(e.name,t);return n?$L(e,n,{fileName:t,useTemplate:!0,allowMarkdown:!0}):void 0},lke=(e,t)=>{let n=e?.[t];return n==null?``:String(n)},uke=(e,t,n,{stored:r=!1}={})=>{let{slug:i,locale:a,getDisplayValue:o}=t,{content:s,locales:c,defaultLocale:l}=n;if(e===`slug`)return i;if(e===`locale`)return a;let u=kk(e);return r?lke(s,u)||lke(c[l]?.content,u):o(u)||o(u,l)||``},dke=(e,t)=>{let{content:n,locales:r,defaultLocale:i,identifierField:a}=t;return ZL(n,{identifierField:a})||ZL(r[i]?.content||{},{identifierField:a})||e.slug},eR=(e,t,n,r)=>{let{label:i,value:a,searchValue:o}=e,s=!1;return t.forEach(e=>{let t=`{{${e}}}`,c=uke(e,n,r);if(a.includes(t)){let i=uke(e,n,r,{stored:!0});i||(s=!0),a=a.replaceAll(t,()=>i)}i=i.replaceAll(t,()=>c),o=o?.replaceAll(t,()=>c)??``}),{label:i.trim()||dke(n,r),value:s?``:a,searchValue:o.trim()}},tR=e=>{let t=[];return NM(e,(e,n)=>(t.push(n),``)),t},fke=(e,t)=>{let n=e.value_field,r=e.display_fields??[n??`{{${t}}}`],i=e.search_fields??r,a=qL(n??`{{slug}}`),o=r.map(qL).join(` `),s=i.map(qL).join(` `),c=bO([...tR(o),...tR(a),...tR(s)]);return{_valueField:a,_displayField:o,_searchField:s,allFieldNames:c,hasListFields:c.some(e=>e.includes(`*`))}},pke=/\.(\d+)$/,mke=(e,t)=>{let n=new Map;return e.filter(e=>e.includes(`*`)).forEach(e=>{let r=e.replace(/\.\*.*$/,``),i=_M({...t,keyPath:r});n.set(e,{baseFieldName:r,fieldConfig:i,isComplexListField:NOe(i)})}),Map.groupBy(n.entries(),([,{baseFieldName:e}])=>e)},hke=({templates:e,replacements:t,staticFieldNames:n,context:r,fallbackContext:i})=>{let{_displayField:a,_valueField:o,_searchField:s}=e,c=e=>t.reduce((e,[t,n])=>e.replaceAll(`{{${t}}}`,()=>n),e),{label:l,value:u,searchValue:d}=eR({label:c(a),value:c(o),searchValue:c(s)},n,r,i);return{label:l,value:t.some(([e,t])=>o.includes(`{{${e}}}`)&&String(t??``)===``)?``:u,searchValue:d||l}},gke=new Map,_ke=(e,t,n=t)=>Object.entries(e).filter(([e])=>t.test(e)).map(([e,t])=>{let r=e.match(n);return{index:parseInt(r[1],10),value:t}}).sort((e,t)=>e.index-t.index),vke=({baseFieldName:e,groupEntries:t,content:n,templates:r,allFieldNames:i,context:a,fallbackContext:o})=>{let s=_ke(n,mA(gke,e,()=>RegExp(`^${JE(e)}\\.\\d+$`)),pke),c=i.filter(e=>!e.includes(`*`));return s.map(({value:e})=>hke({templates:r,replacements:t.map(([t])=>[t,e]),staticFieldNames:c,context:a,fallbackContext:o}))},yke=/^(.+)\.\*\.(.+)$/,bke=new Map,xke=e=>{let t=null;return e.some(([e])=>(t=e.match(yke),!!t)),t},Ske=({groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let[,o,s]=xke(e)??[];if(!o)return[];let c=_ke(t,mA(bke,`${o}:${s}`,()=>{let e=JE(o),t=JE(s);return RegExp(`^${e}\\.([0-9]+)\\.${t}$`)})),l=r.filter(e=>!e.includes(`*`));return c.map(({index:r})=>hke({templates:n,replacements:e.flatMap(([e])=>{let[,n,i]=e.match(yke)??[];return n?[[e,t[`${n}.${r}.${i}`]??``]]:[]}),staticFieldNames:l,context:i,fallbackContext:a}))},Cke=({baseFieldGroups:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let o=[],s=!1;return e.forEach((e,c)=>{if(e.length===0)return;let[,l]=e[0],u={groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a},d=l.isComplexListField?Ske({...u}):vke({...u,baseFieldName:c});o.push(...d),s=!0}),{results:o,hasProcessedListFields:s}},wke=({templates:e,allFieldNames:t,context:n,fallbackContext:r})=>{let{_displayField:i,_valueField:a,_searchField:o}=e,{label:s,value:c,searchValue:l}=eR({label:i,value:a,searchValue:o},t,n,r);return{label:s,value:c,searchValue:l||s}},nR=e=>e.filter(({value:e})=>!!e),Tke=({refEntry:e,content:t,collection:n,templates:r,fileName:i,locale:a,identifierField:o,pendingEntries:s=void 0})=>{let{locales:c}=e,{name:l,_i18n:{defaultLocale:u}}=n,{allFieldNames:d,hasListFields:f}=r,p=lA(n,e.slug),m={collectionName:l,fileName:i,isIndexFile:zk(n,e),keyPath:``},h={slug:p,locale:a,getDisplayValue:(e,n)=>RR({...m,keyPath:e,valueMap:n?c[n]?.content??{}:t,locale:n??a,pendingEntries:s})},g={content:t,locales:c,defaultLocale:u,identifierField:o};if(!f)return nR([wke({templates:r,allFieldNames:d,context:h,fallbackContext:g})]);let{results:_,hasProcessedListFields:v}=Cke({baseFieldGroups:mke(d,m),content:t,templates:r,allFieldNames:d,context:h,fallbackContext:g});if(v)return nR(_);let{_displayField:y,_valueField:b,_searchField:x}=r,{label:S,value:C,searchValue:w}=eR({label:y,value:b,searchValue:x},d.filter(e=>!e.includes(`*`)),h,g);return nR([{label:S,value:C,searchValue:w||S}])},rR=e=>e===!0||e===`translate`||e===`duplicate_if_empty`,iR=e=>e===`duplicate`||e===`sync`,aR=e=>rR(e)||iR(e),oR=e=>e===void 0||e===!1||e===`none`,sR=({fieldConfig:e,getFieldArgs:t})=>{if(e.i18n!==void 0)return e.i18n;let n=t.keyPath.split(`.`);for(let e=n.length-2;e>=0;--e)if(!cM(n[e])){let{i18n:r}=_M({...t,keyPath:n.slice(0,e+1).join(`.`)})??{};if(r!==void 0)return r}},cR=e=>iR(sR(e)),lR=e=>sR(e)===`sync`,uR=({getFieldArgs:e,locale:t,defaultLocale:n,keyPath:r})=>{if(t===n)return!0;let i=r.split(`.`),a=!1,o;return i.every((t,n)=>{if(n<i.length-1&&cM(t))return!0;let r=_M({...e,keyPath:i.slice(0,n+1).join(`.`)});return r?(a=!0,o=r.i18n===void 0?o:r.i18n,aR(o)):a})},Eke=new WeakMap,Dke=({getFieldArgs:e,locale:t,defaultLocale:n,content:r,defaultContent:i})=>{if(t===n||!i)return r;let{collectionName:a,fileName:o,isIndexFile:s}=e,c=JSON.stringify([a,o,s,t,n]);return{...mA(mA(Eke,i,()=>new Map),c,()=>{let r={...e,valueMap:i};return Object.fromEntries(Object.entries(i).filter(([e])=>!uR({getFieldArgs:r,locale:t,defaultLocale:n,keyPath:e})))}),...r}},Oke=(e,t)=>{let{defaultLocale:n}=BA(e),r=e?.currentValues[n];if(!e||!r||t===n)return;let i=gM(e,{valueMap:r});return{values:r,isShared:e=>!uR({getFieldArgs:i,locale:t,defaultLocale:n,keyPath:e})}},kke=/^{{fields\.(.+?)}}$/,Ake=new Map,dR=(e,t)=>{let n=e[t];if(n!==void 0&&!Array.isArray(n))return n;let r=mA(Ake,t,()=>RegExp(`^${JE(t)}\\.\\d+$`)),i=Object.keys(e).filter(e=>r.test(e)).map(t=>e[t]);return i.length?i:n},jke=(e,t,n=void 0,r=void 0)=>e.map(({field:e,values:i,exclude:a})=>({field:e,exclude:a,values:i.flatMap(e=>{if(typeof e!=`string`)return[e];if(e===`{{slug}}`)return n?[n]:[];let i=e.match(kke);if(!i)return[e];let a=t?dR(t,i[1]):void 0;return a===void 0&&r?.isShared(i[1])&&(a=dR(r.values,i[1])),Array.isArray(a)?a:a===void 0?[]:[a]})})),Mke=({refEntries:e,collection:t,locale:n,fileName:r=void 0,entryFilters:i=[],defaultLocale:a=void 0})=>{let o=new Map,s=(e,i,s)=>{let c=dR(i,s),l=a?e.locales[a]?.content:void 0;return c!==void 0||!l||l===i||mA(o,s,()=>uR({getFieldArgs:{collectionName:t.name,fileName:r,valueMap:l},locale:n,defaultLocale:a,keyPath:s}))?c:dR(l,s)};return e.filter(e=>!r||r===e.slug).map(e=>{let{content:t}=e.locales[n]??(a?e.locales[a]:void 0)??e.locales._default??{};return{refEntry:e,hasContent:!!t&&Object.keys(t).length>0,content:t??{}}}).filter(({hasContent:e,content:n,refEntry:r})=>e&&i.every(({field:e,values:i,exclude:a=!1})=>{if(i.length===0)return!0;let o=e===`slug`,c=kk(e),l=o?lA(t,r.slug):s(r,n,c),u=Array.isArray(l)?l.some(e=>i.includes(e)):i.includes(l);return a?!u:u}))},fR=(e,t)=>{let{databaseName:n}=e??{};return n?new tD(n,t):void 0},pR=[`eq`,`ne`,`lt`,`lte`,`gt`,`gte`,`in`,`not_in`,`empty`],mR=e=>{let{field:t,pattern:n}=e,r={field:t};return n!==void 0&&(r.pattern=n),pR.forEach(t=>{e[t]!==void 0&&(r[t]=e[t])}),r},Nke=e=>!!e&&pR.some(t=>e[t]!==void 0),hR=e=>{let{field:t,pattern:n}=e,r=[t],i=Object.fromEntries(pR.filter(t=>e[t]!==void 0).map(t=>[t,e[t]]));return n===void 0?Object.keys(i).length&&r.push(null):r.push(String(n)),Object.keys(i).length&&r.push(i),JSON.stringify(r)},gR=e=>e===`*other`?X(`other`):e,Pke=(e,t,n)=>{let r=IL(t);return[...Map.groupBy(e,e=>{let t=n(e);return t==null?`*other`:r?String(t).match(r)?.[0]??`*other`:String(t)})].sort(([e],[t])=>$E(gR(e),gR(t)))},Fke=(e,t,n)=>{let{field:r,pattern:i}=t??{};return r?Object.fromEntries(Pke(e,i,e=>n(e,r))):e.length?{"*":e}:{}},Ike=(e,t,n)=>n?n.test(String(e??``)):e===t,Lke=(e,t,n)=>n?$E(e,t):e-t,_R=(e,t,n,r)=>{let i=e.map(e=>({item:e,key:t(e)})),a=i.filter(({key:e})=>e!==void 0),o=i.filter(({key:e})=>e===void 0);return a.sort(({key:e},{key:t})=>Lke(e,t,n)),r===`descending`&&a.reverse(),[...a,...o].forEach(({item:t},n)=>{e[n]=t}),e},Rke=e=>e.filter(e=>e!==`*`),vR=e=>e?hR(e):void 0,yR=(e,t)=>{let n=vR(e.group);return n!==void 0&&!!e.collapsedGroups?.[n]?.includes(t)},zke=(e,t)=>{let n=vR(e.group);if(n===void 0)return e;let{[n]:r,...i}=e.collapsedGroups??{},a=t.length?{...i,[n]:t}:i,{collapsedGroups:o,...s}=e;return Object.keys(a).length?{...s,collapsedGroups:a}:s},Bke=(e,t,n)=>{let r=vR(e.group),i=(r===void 0?[]:e.collapsedGroups?.[r]??[]).filter(e=>e!==t);return n&&i.push(t),zke(e,i)},Vke=(e,t,n)=>zke(e,n?[...t]:[]),bR=async(e,t,n,{defaults:r={}}={})=>{let i=fR(e,`ui-settings`),a;try{a=await i?.get(t)}catch{}let o={...r,...D(a)?a:{}};n.current=o;let s=o;return JO(()=>{let{current:e}=n;(0,Cr.default)(e,s)||(s=e,(async()=>{try{await i?.set(t,e)}catch{}})())})},xR=(e,t)=>{if(Array.isArray(e))return{options:e};if(D(e)){let n=e[t],r=e.default;if(Array.isArray(n)){let e=r?n.find(({name:e})=>e===r):void 0;return{options:n,default:e?mR(e):void 0}}}return{options:[]}},Hke=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),Uke=e=>{let t=D(e)?e.default_sort:void 0;return t===!0||t===`asc`||t===`desc`},Wke=e=>{let t=[],n={},r;return e.forEach(e=>{if(typeof e==`string`){t.push(e);return}if(!D(e)||typeof e.field!=`string`)return;let{field:i,label:a}=e;t.push(i),typeof a==`string`&&a.trim()&&(n[i]=a),!r&&Uke(e)&&(r=e)}),{keys:t,...Object.keys(n).length?{labels:n}:{},...r?{defaultKey:r.field,defaultOrder:r.default_sort===`desc`?`descending`:`ascending`}:{}}},Gke=e=>{if(Array.isArray(e))return Wke(e);if(D(e)){let{fields:t,default:n}=e;return Hke(t)?D(n)?{keys:t,defaultKey:n.field,defaultOrder:[`descending`,`Descending`].includes(n.direction??``)?`descending`:`ascending`}:{keys:t}:{keys:[]}}return{keys:[]}},SR=[`slug`,`commit_author`,`commit_date`],Kke=[`dirname`,`filename`,`extension`,`locales`],qke=/^\{\{\s*(?:fields\.)?([^\s|{}]+)\s*\}\}$/,CR=e=>IM(e),wR=e=>{let{table_columns:t,summary_fields:n}=e;if(Array.isArray(t))return t.map(e=>D(e)?{key:e.field,label:e.label}:{key:e});if(Array.isArray(n))return n.map(e=>({key:e===`summary`?`_summary`:e}))},Jke=new Map,Yke=e=>mA(Jke,e,()=>{try{let{language:t,script:n}=new Intl.Locale(e).maximize();return`${t}-${n}`}catch{return e.toLowerCase()}}),Xke=(e,t)=>{if(Object.hasOwn(e,t))return t;let n=Yke(t),r=Object.keys(e).filter(e=>Yke(e)===n);return r.find(e=>!e.includes(`-`))??r[0]},Zke=(e,t)=>{let n=e[`${t}_localized`];return D(n)?n:void 0},TR=({config:e,option:t,locale:n})=>{if(!e)return;let r=Zke(e,t);if(r){if(n&&n!==`_default`&&Object.hasOwn(r,n))return r[n];let e=Fc.current?Xke(r,Fc.current):void 0;if(e!==void 0)return r[e]}return e[t]},ER=({config:e,locale:t})=>TR({config:e,option:`label`,locale:t})||e.name||``,Qke=({fieldConfig:e,locale:t,defaultLocale:n})=>{let r=Zke(e,`default`);if(!r)return e;let{default_localized:i,...a}=e,o=iR(e.i18n)?n:t;return Object.hasOwn(r,o)?{...a,default:r[o]}:a},$ke=[`title`,`name`,`date`,`author`,`description`],eAe=[`ascending`,`descending`],tAe=[`date`,`commit_date`],DR={slug:String,commit_author:String,commit_date:Date,_summary:String,_manual:String},OR=Object.keys(DR),nAe=e=>e?{keys:[e,...$ke.filter(t=>t!==e)],defaultKey:e}:{keys:[...$ke]},kR=({collection:e,isCommitAuthorAvailable:t,isCommitDateAvailable:n})=>{let{name:r,identifier_field:i,sortable_fields:a,summary:o,_i18n:{i18nEnabled:s,canonicalSlug:c}}=e,l=a?Gke(a):nAe(i),u=[...l.keys],{defaultKey:d,defaultOrder:f}=l,{labels:p}=l;o&&u.unshift(`_summary`);let m=s?[...OR,c.key]:OR;u=bO(u).filter(e=>!!e&&(m.includes(e)||!!_M({collectionName:r,keyPath:e})));let h=u.includes(`commit_author`),g=u.includes(`commit_date`),_=ck(e);t&&!_?!u.includes(`author`)&&!h&&u.push(`commit_author`):h&&(u=u.filter(e=>e!==`commit_author`)),n&&!_?!u.includes(`date`)&&!g&&u.push(`commit_date`):g&&(u=u.filter(e=>e!==`commit_date`));let v=HL(e);return(v||ck(e))&&(u=u.filter(e=>e!==v),u.includes(`_manual`)||u.unshift(`_manual`),d=`_manual`,f=`ascending`),d=d&&u.includes(d)?d:u[0],f??=d?`ascending`:void 0,{keys:u,labels:p,default:{key:d,order:f}}},rAe=({key:e,fieldConfig:t})=>Object.hasOwn(DR,e)?DR[e]:t?.widget===`boolean`?Boolean:t&&JN(t)?Number:String,AR=({collection:e,key:t})=>{if([...OR,`name`].includes(t))return X(`sort_keys.${t}`);if(t.includes(`.`))return t.split(`.`).map((t,n,r)=>{if(cM(t))return;let i=r.slice(0,n+1).join(`.`);return TR({config:_M({collectionName:e.name,keyPath:i}),option:`label`})||t}).filter(Boolean).join(` – `);let n=e.fields?.find(({name:e})=>e===t);return TR({config:n,option:`label`})||t},jR=KO(()=>{let e=WA.current;if(e?._type!==`entry`)return[];let{current:t}=tj,{keys:n,labels:r}=kR({collection:e,isCommitAuthorAvailable:t.some(e=>!!e.commitAuthor),isCommitDateAvailable:t.some(e=>!!e.commitDate)});return n.map(t=>{let n=_M({collectionName:e.name,keyPath:t}),i={key:t,label:r?.[t]??AR({collection:e,key:t})};return rAe({key:t,fieldConfig:n})===Number&&(i.type=`number`),i})}),iAe=e=>{let t=e,n=!0;for(;n;){let e=t;t=t.replaceAll(/([_*`~])([^_*`~]+)\1/g,`$2`),t=t.replaceAll(/([_*`~]{2,3})(.+?)\1/g,`$2`),n=t!==e}return t},aAe=new mr,oAe=RegExp(`<(?:br|hr)\\b[^>]*>|</(?:address|article|aside|blockquote|caption|dd|details|div|dl|dt|figcaption|figure|footer|h[1-6]|header|li|main|nav|ol|p|pre|section|summary|table|tbody|td|tfoot|th|thead|tr|ul)\\s*>`,`gi`),sAe=e=>YL(_t(aAe.parse(e).replaceAll(oAe,`$& `),{ALLOWED_TAGS:[]})).replaceAll(/\s+/g,` `).trim(),cAe=1e3,lAe=[`title`,`summary`,`description`],uAe=e=>e==null||e===``,dAe=({key:e,type:t,collection:n,locale:r,collectionName:i,dateFieldConfig:a,isMarkdownField:o})=>e===`_summary`?e=>$L(n,e,{locale:r,useTemplate:!0}):a?t=>{let n=MN(zR({entry:t,locale:r,collectionName:i,key:e}),a,r)?.getTime()??NaN;return Number.isNaN(n)?void 0:n}:t===String?t=>{let n=zR({entry:t,locale:r,collectionName:i,key:e});if(uAe(n))return;let a=String(n);return o?iAe(a.slice(0,cAe)):a}:t===Boolean?t=>+(zR({entry:t,locale:r,collectionName:i,key:e})===!0):t=>{let n=zR({entry:t,locale:r,collectionName:i,key:e}),a=uAe(n)?NaN:Number(n);return Number.isNaN(a)?void 0:a},MR=({collection:e,key:t,locale:n})=>{let{name:r}=e,i=_M({collectionName:r,keyPath:t}),a=rAe({key:t,fieldConfig:i}),o=i?.widget===`datetime`?i:void 0;return{getSortKey:dAe({key:t,type:a,collection:e,locale:n,collectionName:r,dateFieldConfig:o,isMarkdownField:hk.includes(i?.widget??``)||lAe.includes(t)}),isStringType:!o&&a===String}},fAe=(e,t)=>{let n=e.findIndex(e=>zk(t,e));return n>-1&&e.unshift(e.splice(n,1)[0]),e},pAe=(e,t,{key:n,order:r}={})=>{let i=[...e];if(n===void 0)return i;let{_i18n:{defaultLocale:a}}=t,{getSortKey:o,isStringType:s}=n===`_manual`||n===HL(t)?{getSortKey:UL(t),isStringType:!1}:MR({collection:t,key:n,locale:a});return _R(i,o,s,r),fAe(i,t)},mAe=({collection:e,key:t,locale:n})=>{if(t===`_manual`||t===HL(e))return{getSortKey:UL(e),isStringType:!1};let{defaultLocale:r}=e._i18n,i=MR({collection:e,key:t,locale:n}),a=n===r?i:MR({collection:e,key:t,locale:r}),o=n!==r&&!OR.includes(t)&&!uR({getFieldArgs:{collectionName:e.name,valueMap:{}},locale:n,defaultLocale:r,keyPath:t});return{getSortKey:e=>e.locales[n]&&!o?i.getSortKey(e):a.getSortKey(e),isStringType:i.isStringType}},hAe=({groups:e,collection:t,sortBy:n,locale:r})=>{let{field:i,direction:a}=n,{getSortKey:o,isStringType:s}=mAe({collection:t,key:i,locale:r}),c=a===`descending`?-1:1,l=e.flatMap(({refEntry:e,options:t})=>{let n=o(e);return t.map(e=>({option:e,sortKey:n}))});return l.sort((e,t)=>{if(e.sortKey!==t.sortKey){if(e.sortKey===void 0)return 1;if(t.sortKey===void 0)return-1;let n=Lke(e.sortKey,t.sortKey,s);if(n)return n*c}return $E(e.option.label,t.option.label)}),l.map(({option:e})=>e)},gAe=new Map,_Ae=100,NR=new Set,vAe=10,yAe=new WeakMap,bAe=(e=[])=>e.map(e=>KL(e)).join(`,`),xAe=(e,t,n)=>{let r=n.filter(e=>e.collectionName===t).map(({entry:e})=>e),i=new Map(r.map(e=>[e.id,e]));return r.length?[...e.map(e=>{let t=i.get(e.id);return i.delete(e.id),t??e}),...i.values()]:e},SAe=(e,t,n=[])=>{if(!n.length)return e;let r=yAe.get(e);return r||(r=new Map,yAe.set(e,r)),vA(r,bAe(n),()=>xAe(e,t,n),vAe)},CAe=({locale:e,fieldConfig:t,refEntries:n,entryFilters:r=[],pendingEntries:i=void 0})=>{let{collection:a,file:o}=t,s=YA(a);if(!s)return[];let{_type:c,_i18n:{defaultLocale:l}}=s,u=GL(c===`entry`?s:void 0),d=fke(t,u);return Mke({refEntries:n,collection:s,locale:e,fileName:o,entryFilters:r,defaultLocale:l}).map(({refEntry:t,content:n})=>({refEntry:t,options:Tke({refEntry:t,content:n,collection:s,templates:d,fileName:o,locale:e,identifierField:u,pendingEntries:i})}))},wAe=e=>CAe(e).flatMap(({options:e})=>e),TAe=({collection:e,file:t})=>{if(t){let n=cj(e,t);return n?[n]:[]}return BL(e)},PR=({locale:e,fieldConfig:t,refEntries:n,currentLocaleValues:r=void 0,currentSlug:i=void 0,pendingEntries:a=void 0,sharedValues:o=void 0})=>{let{collection:s,file:c,filters:l,sort_by:u}=t,d=jke(l??[],r,i,o),f=JSON.stringify(d.map(({values:e})=>e)),p=`${e}|${`${KL(t)}|${KL(n)}`}|${bAe(a)}|${f}`;return NR.has(p)?[]:vA(gAe,p,()=>{NR.add(p);try{let r=YA(s);if(r&&!c&&u?.field)return hAe({groups:CAe({locale:e,fieldConfig:t,refEntries:n,entryFilters:d,pendingEntries:a}),collection:r,sortBy:u,locale:e});let i=!c&&DOe(r),o=wAe({locale:e,fieldConfig:t,refEntries:i?WL(n,r):n,entryFilters:d,pendingEntries:a});return c||i?o:o.sort((e,t)=>$E(e.label,t.label))}finally{NR.delete(p)}},_Ae)},FR=({locale:e,fieldConfig:t,refEntry:n,pendingEntries:r=void 0})=>wAe({locale:e,fieldConfig:t,refEntries:[n],pendingEntries:r}),EAe=({fieldConfig:e,valueMap:t,keyPath:n,locale:r,pendingEntries:i=void 0})=>{let{multiple:a,collection:o}=e,s=AOe(PR({locale:r,fieldConfig:e,refEntries:SAe(BL(o),o,i),pendingEntries:i})),c=e=>s.get(e)||e;return a?_j(t,n).map(e=>c(t[e])):c(t[n])},DAe=new Map,OAe=1e3,kAe=new WeakMap,AAe=e=>mA(kAe,e,()=>JSON.stringify(e)),jAe=({fieldConfig:e,valueMap:t,keyPath:n})=>{let{multiple:r,options:i}=e,a=Ebe(i),o;r&&(o=_j(t,n).map(e=>t[e]));let s=`${n}|${AAe(i)}|${JSON.stringify(r?o:t[n])}`,c=e=>i.find(t=>t.value===e)?.label||e;return vA(DAe,s,()=>{if(r)return a?o.map(c):o;let e=t[n];return a?c(e):e},OAe)},IR=e=>D(e)?e.value:e,MAe=({fieldConfig:e,value:t})=>e.options.some(e=>IR(e)===t),NAe=({fieldConfig:e,currentValue:t})=>{let{options:n,multiple:r=!1}=e,i=Ebe(n),a=e=>i&&n.find(t=>t.value===e)?.label||String(e);return r?Array.isArray(t)?t.map(a).sort():[]:t===void 0||t===null&&!MAe({fieldConfig:e,value:null})?[]:[a(t)]},PAe=e=>e===null?`number`:typeof e,LR=e=>e===void 0||typeof e==`string`?``:null,FAe=e=>hk.includes(e?.widget),RR=({collectionName:e,fileName:t,componentName:n=void 0,valueMap:r={},keyPath:i,locale:a,transformations:o,isIndexFile:s=!1,pendingEntries:c=void 0,plainText:l=!1})=>{let u=_M({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,isIndexFile:s}),d=Object.hasOwn(r,i)?r[i]:void 0;if(d===void 0&&o?.length)return String(LN({fieldConfig:u,value:``,transformations:o,locale:a}));if(u?.widget===`datetime`&&(o?.some(({method:e})=>e===`date`)||(d=HN({locale:a,fieldConfig:u,currentValue:d}))),u?.widget===`relation`&&(d=EAe({fieldConfig:u,valueMap:r,keyPath:i,locale:a,pendingEntries:c})),u?.widget===`select`&&(d=jAe({fieldConfig:u,valueMap:r,keyPath:i})),u?.widget===`list`){let{field:o}=u,{fields:f}=u,{types:p}=u;if(!(f||p)){let u=_j(r,i);d=AA(a).format((o?u.map(i=>RR({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,locale:a,isIndexFile:s,pendingEntries:c,plainText:l})):u.map(e=>r[e]).filter(e=>typeof e==`string`)).filter(e=>!!e))}}if(u&&JN(u)&&d!=null&&d!==``){let e=Number(d);Number.isNaN(e)||(d=UN(DA(a)).format(e))}return l&&FAe(u)&&typeof d==`string`&&(d=sAe(d)),Array.isArray(d)&&(d=AA(a).format(d)),o?.length&&(d=LN({fieldConfig:u,value:d,transformations:o,locale:a})),String(d??``)},IAe=({valueMap:e,locale:t,keyPath:n,keyPathPrefix:r,getFieldArgs:i,plainText:a=!1})=>{let o=[`${n}.title`,`${n}.name`,...pj(e,r)].find(t=>{let n=e[t];if(!t.startsWith(r)||!(Jk(n)||typeof n==`number`&&!Number.isNaN(n)))return!1;let a=_M({...i,keyPath:t});return!!a&&a.widget!==`hidden`});return o?RR({...i,keyPath:o,locale:t,plainText:a}):``},zR=({entry:e,locale:t,collectionName:n,key:r,resolveRef:i=!0})=>{let{slug:a,locales:o,commitAuthor:s,commitDate:c}=e;if(r===`slug`)return a;if(r===`commit_author`)return XL(s);if(r===`commit_date`)return c;let{content:l}=o[t]??{};if(l===void 0)return;let u=YA(n);if(!u)return;let d=_M({collectionName:n,keyPath:r,isIndexFile:zk(u,e)});if(i&&d?.widget===`relation`)return EAe({fieldConfig:d,valueMap:l,keyPath:r,locale:t});if(d&&(d.widget===`list`||mM(d))){let e=_j(l,r);if(e.length)return e.map(e=>l[e])}let f=Object.hasOwn(l,r)?l[r]:void 0;if(f===void 0&&(d?.widget===`object`||d?.widget===`list`)){let e=pj(l,`${r}.`);if(e.length)return e.map(e=>l[e])}return f},LAe=({collectionName:e,fileName:t,keyPath:n,itemKeyPath:r=n,valueMap:i,isIndexFile:a=!1,locale:o,summaryTemplate:s,hasSingleSubField:c=!1})=>{let l={collectionName:e,fileName:t,keyPath:``,valueMap:i,isIndexFile:a};if(!s)return c?RR({...l,keyPath:r,locale:o,plainText:!0}):IAe({valueMap:i,locale:o,keyPath:r,keyPathPrefix:`${r}.`,getFieldArgs:l,plainText:!0});let u=(e,t)=>{let i=kk(e);if(c){let e=_M({...l,keyPath:n});if(!(`field`in e)||e.field.name!==i)return``}return RR({...l,keyPath:c?r:`${r}.${i}`,locale:o,plainText:!0,transformations:t?RM(t,e=>u(IN(e).value)):void 0})};return NM(s,(e,t)=>{let{value:n,transformations:r}=IN(t);return u(n,r)})},RAe=({fieldType:e,type:t,typeKey:n,types:r})=>t?`The “${t}” type is not defined for the ${e} field.`:`The type key is not found in the ${e===`list`?`list item`:`object`}. The item must include the “${n}” property with one of the defined types: ${r.map(e=>e.name).join(`, `)}`,zAe=({fieldType:e,keyPath:t,...n})=>{console.warn(`${e===`list`?`List item`:`Object field`} ${t}: ${RAe({fieldType:e,...n})}`)},BR=({types:e,fields:t,summary:n,type:r})=>{if(!e)return{typeConfig:void 0,unknownType:!1,subFields:t??[],summaryTemplate:n};let i=r?e.find(({name:e})=>e===r):void 0;return{typeConfig:i,unknownType:!i,subFields:i?.fields??[],summaryTemplate:i?.summary||n}},VR=(e,t)=>t?`${e}<${t}>`:e,HR=({typedKeyPath:e,type:t,subFieldName:n})=>`${VR(e,t)}.${n}`,BAe=/(?<hours>[+-]\d{2})(?::?(?<minutes>\d{2}))?(?::?(?<seconds>\d{2}))?(?:\.\d+)?$|Z$/,VAe=e=>String(Math.abs(Number(e))).padStart(2,`0`),HAe=new Map,UAe=(e,t)=>{if(typeof e!=`string`||!e.trim())return;let{inputTimeZone:n}=lN(t);if(n===`local`||n===`utc`)return;let r=new Date(e);if(Number.isNaN(r.getTime()))return;let i=e.match(BAe);if(!i?.groups)return;let{hours:a,minutes:o=`0`}=i.groups,s=i[0]===`Z`?`+00:00`:`${a.startsWith(`-`)?`-`:`+`}${VAe(a)}:${VAe(o)}`;return(mA(HAe,n,()=>new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`longOffset`})).formatToParts(r).find(e=>e.type===`timeZoneName`)?.value??``).replace(`GMT`,``)===s?n:void 0},WAe=(e,t)=>{let n=UAe(e,t);if(n)return n;let{inputTimeZone:r,singleCustomTimeZone:i}=lN(t);if(i)return i;try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(r===`local`)return e}catch{return r===`local`?``:void 0}},GAe=(e,t=new Date)=>{try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value??``,r=e.split(`/`).pop()?.replaceAll(`_`,` `)??e;return`(${n.replace(`GMT`,``)}) ${r}`}catch{return e}};zM.default.extend(vN.default),zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default),zM.default.extend(yN.default);var KAe=/^(?<date>\d{4}-[01]\d-[0-3]\d)(?:T00:00(?::00)?(?:\.000)?Z)?$/,qAe=/(?:^|T)(?<time>[0-2]\d:[0-5]\d)(?!\d)/,JAe=/(?:^|T)[0-2]\d:[0-5]\d:[0-5]\d/,YAe=({date:e,timeZone:t,inputTimeZone:n,dateOnly:r,timeOnly:i,includeUTCSeconds:a=!1,includeSeconds:o=!1})=>{let s=t||(n===`utc`?`UTC`:void 0),{year:c,month:l,day:u,hour:d,minute:f,second:p}=JL({date:e,timeZone:s}),m=`${c}-${l}-${u}`,h=`${d}:${f}${o?`:${p}`:``}`;return r?m:i?h:a&&s===`UTC`?`${m}T${h}${o?``:`:00`}.000Z`:`${m}T${h}`},XAe=({newValue:e,currentValue:t,fieldConfig:n,locale:r})=>{if(e===void 0||e===t)return!1;let i=MN(e,n,r),a=MN(t,n,r);return i!==void 0&&a!==void 0?i.getTime()!==a.getTime():i!==void 0||a!==void 0||e===``},ZAe=(e,t,{date:n=void 0,includeSeconds:r=!1}={})=>{let{dateOnly:i,timeOnly:a,inputTimeZone:o}=lN(e);return YAe({date:n,timeZone:t,inputTimeZone:o,dateOnly:i,timeOnly:a,includeUTCSeconds:!0,includeSeconds:r})},QAe=(e,t,n)=>{let r=e.valueOf(),i=e.utcOffset(),a=zM.default.utc(r+i*6e4),o=t.replaceAll(/\[[^\]]+]|X|x/g,e=>e===`X`?`[${Math.floor(r/1e3)}]`:e===`x`?`[${r}]`:e);return(n?a.locale(n):a).utcOffset(i,!0).format(o)},$Ae=({inputValue:e,currentValue:t,fieldConfig:n,timeZone:r,outputUTC:i,locale:a})=>{let{format:o,dateOnly:s,timeOnly:c,inputTimeZone:l,outputUTC:u}=lN(n),d=i??u,f=!!e&&JAe.test(e),p=f?`HH:mm:ss`:`HH:mm`,m=s?`YYYY-MM-DD`:c?p:`YYYY-MM-DDT${p}`,h=l===`utc`?`UTC`:l===`local`?d?r:void 0:r||l;if(e===``)return``;if(!e)return;if(o){let t=_N(n,a),r=xN(!!h),i=r(e,m);if(i.isValid()||(i=r(e)),!i.isValid())return``;if(s)return ON(i,o,t);if(!h)return ON(d?i.utc():i,o,t);let c=zM.default.tz(i.format(`YYYY-MM-DDTHH:mm:ss`),h);return d?ON(c.utc(),o,t):QAe(c,o,t)}if(s)return e;let g=t?`:00${t.endsWith(`.000`)?`.000`:``}`:`:00`;if(c){let t=f?e:`${e}${g}`;return l===`utc`?`${t}Z`:t}return l===`utc`?zM.default.utc(e).format():d?(r?zM.default.tz(e,r):(0,zM.default)(e)).utc().format():r&&l!==`local`?QAe(zM.default.tz(e,r),`YYYY-MM-DDTHH:mm:ssZ`):f?e:`${e}${g}`},eje=(e,{date:t=void 0,includeSeconds:n=!1,locale:r=void 0}={})=>{let{singleCustomTimeZone:i,outputUTC:a}=lN(e);return $Ae({inputValue:ZAe(e,i,{date:t,includeSeconds:n}),currentValue:``,fieldConfig:e,timeZone:i,outputUTC:a,locale:r})},tje=({currentValue:e,fieldConfig:t,timeZone:n,locale:r})=>{let{dateOnly:i,timeOnly:a,inputTimeZone:o,format:s}=lN(t),c=UAe(e,t)??n,l=s?_N(t,r):void 0;if(!e)return``;let u=s&&(0,zM.default)(e,s,l,!0).isValid()?void 0:i?e.match(KAe)?.groups?.date:a?e.match(qAe)?.groups?.time:void 0;if(u)return u;if(i&&s){let t=DN({value:e,format:s,parseAsUTC:!1,localeKey:l});return t.isValid()?t.format(`YYYY-MM-DD`):``}let d=MN(e,t,r);return d?YAe({date:d,timeZone:c,inputTimeZone:o,dateOnly:i,timeOnly:a}):``},nje=({fieldConfig:e,value:t,sourceLocale:n,targetLocale:r})=>{if(e.widget!==`datetime`||e.localize_format!==!0||typeof t!=`string`||!t)return t;let i=e,{format:a}=lN(i),o=_N(i,n),s=_N(i,r);if(!a||o===s)return t;let c=DN({value:t,format:a,parseAsUTC:!0,localeKey:o});return c.isValid()?ON(c,a,s??`en`):t},rje=({fieldConfig:e,value:t,sourceLocale:n,targetLocale:r})=>{let{value_field:i}=e;return typeof t!=`string`||typeof i!=`string`||!i.startsWith(`{{locale}}/`)||!t.startsWith(`${n}/`)?t:`${r}/${t.slice(n.length+1)}`},UR=e=>nje({...e,value:rje(e)}),ije=[`code`,`datetime`,`file`,`image`,`markdown`,`number`,`relation`,`richtext`,`select`,`string`,`text`],WR=e=>e.i18n===`duplicate_if_empty`&&ije.includes(e.widget??`string`)&&!mM(e),GR=(e,t)=>{if(e.widget!==`code`)return t;let{output_code_only:n=!1,keys:r={code:`code`}}=e;return n?t:`${t}.${r.code}`},aje=({content:e,fieldConfig:t,keyPath:n})=>Nj(e[GR(t,n)]),oje=(e,t)=>{let n=t(e);if(n)return WR(n)?{fieldConfig:n,fieldKeyPath:e}:void 0;let r=e.lastIndexOf(`.`);if(r<0)return;let i=e.slice(0,r),a=t(i);return a?.widget===`code`&&WR(a)&&GR(a,i)!==i?{fieldConfig:a,fieldKeyPath:i}:void 0},sje=({fieldConfig:e,targetValue:t,previousValue:n,sourceLocale:r,targetLocale:i})=>Nj(t)||t===UR({fieldConfig:e,value:n,sourceLocale:r,targetLocale:i}),KR=e=>{let t=`field`in e,n=`fields`in e,r=`types`in e;return{hasSingleSubField:t,hasMultiSubFields:n,hasVariableTypes:r,hasSubFields:t||n||r}},cje=e=>AM(e).some(e=>jM(e,e=>iR(e.i18n)||WR(e))),qR=e=>e.widget===`list`&&rR(e.i18n)&&cje(e),JR=(e,t=``)=>e.flatMap(e=>{let n=t?`${t}.${e.name}`:e.name;if(qR(e))return[n];let{fields:r}=e;return e.widget===`object`&&r?JR(r,n):[]}),lje=({fieldConfig:e,itemCount:t})=>e.max===1&&t<=1,uje=({index:e,...t})=>LAe({...t,itemKeyPath:`${t.keyPath}.${e}`}),YR=(e,t)=>{let n=e[t];return D(n)?n.__sc_item_id??t:t},XR=(e,t,{assignIds:n=!1}={})=>{e.forEach((e,r)=>{D(e)&&(n&&(e.__sc_item_id??=crypto.randomUUID()),e.__sc_item_original_key_path??=`${t}.${r}`)})},ZR=e=>{let{keyPath:t}=e,n=t.lastIndexOf(`.`);if(n<0)return;let r=t.slice(0,n),i=_M({...e,keyPath:r});if(!i)return;let{widget:a}=i;return a===`keyvalue`||a===`list`&&!KR(i).hasSubFields&&cM(t.slice(n+1))||a===`code`&&!(i.output_code_only??!1)?{keyPath:r,fieldConfig:i}:void 0},QR=/\.[^.]*$/,$R=e=>{let t=ZR(e)?.fieldConfig;return t?.widget===`keyvalue`?t:void 0},ez=(e,t,{live:n=!0}={})=>{let r=`${t}.`;return pj(e,r,{live:n}).map(t=>[Oj(t.slice(r.length)),e[t]])},tz=(e,t,n)=>{pj(e,`${t}.`,{live:!0}).forEach(t=>{delete e[t]}),n.length&&e[t]===null&&delete e[t],n.forEach(([n,r])=>{e[`${t}.${Dj(n)}`]=r})},dje=({content:e,referenceContent:t,keyPath:n})=>{let r=ez(e,n),i=r.map(([e])=>e),a=ez(t,n).map(([e])=>e).filter(e=>i.includes(e)),o=[...a,...i.filter(e=>!a.includes(e))];o.some((e,t)=>e!==i[t])&&tz(e,n,o.map(e=>r[i.indexOf(e)]))},fje=(e,t)=>{let n=new Map;return Object.keys(e).forEach(r=>{if(!r.includes(`.`)||!t(e,r))return;let i=r.replace(QR,``),a=n.get(i);a?a.push(r):n.set(i,[r])}),n},pje=({draft:e,isRealKey:t,locales:n})=>{let{collectionName:r,fileName:i,isIndexFile:a,originalValues:o,currentValues:s}=e;return(n??Object.keys(s)).some(e=>{let n=s[e],c=fje(o[e],t);return[...fje(n,t)].some(([e,t])=>{let o=c.get(e);return t.some((e,t)=>e!==o[t])&&!!$R({collectionName:r,fileName:i,isIndexFile:a,keyPath:t[0],valueMap:n})})})},nz=RegExp(`\\.__sc_\\w+$`),mje=[`collection`,`collectionFile`,`fields`,`originalEntry`],rz=0,hje=()=>!rz,iz=e=>{rz+=1;let t=()=>{--rz},n;try{n=e()}catch(e){throw t(),e}return n instanceof Promise?n.finally(t):(t(),n)},az=e=>{Object.keys(e?.files??{}).forEach(e=>{URL.revokeObjectURL(e)})},oz=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!nz.test(e))),sz=(e,t)=>!nz.test(t)&&e[t]!==void 0,cz=(e,t,{relative:n=!1,dropEmptyPlaceholders:r=!1}={})=>{let i=`${t}.`;return Object.fromEntries([...Object.hasOwn(e,t)?[t]:[],...pj(e,i)].filter(t=>{if(!sz(e,t))return!1;let n=e[t];return!(r&&(D(n)||Array.isArray(n))&&!Object.keys(n).length)}).map(t=>[n?t.slice(i.length):t,e[t]]))},lz=(e,t)=>{let n=0;return Object.keys(t).some(r=>sz(t,r)?(n+=1,!Object.hasOwn(e,r)||!(0,Cr.default)(e[r],t[r])):!1)||Object.keys(e).filter(t=>sz(e,t)).length!==n},uz=({originalLocales:e,currentLocales:t},n)=>Object.keys(n).filter(n=>e[n]!==!1||t[n]!==!1),gje=(e,t)=>{let{originalValues:n,currentValues:r}=e;return t.length!==uz(e,n).length||t.some(e=>{let t=n[e];return!t||lz(t,r[e])})},dz=e=>{if(!e)return!1;let{originalLocales:t,currentLocales:n,originalSlugs:r,currentSlugs:i,originalPath:a,currentPath:o}=e,s=uz(e,e.currentValues);return!(0,Cr.default)(t,n)||!(0,Cr.default)(r,i)||XE(a??``)!==XE(o??``)||gje(e,s)||pje({draft:e,isRealKey:sz,locales:s})||EM(e).length>0},fz=({currentLocales:e={},currentPath:t,currentSlugs:n={},currentValues:r={},files:i})=>({currentLocales:Sr(e),currentSlugs:Sr(n),...t===void 0?{}:{currentPath:t},currentValues:Sr(r),files:Object.fromEntries(Object.entries(i).map(([e,{file:t,folder:n,replace:r,subfolderPath:i,nameTemplate:a}])=>[e,{file:t,folder:n&&Sr(n),replace:r,subfolderPath:i,...a?{nameTemplate:{...a,randomValues:new Map(a.randomValues),dateTimeParts:{...a.dateTimeParts}}}:{}}]))}),pz=Symbol(`valueMapVersion`),mz=e=>e?.[pz],hz=Symbol(`subtreeVersions`),_je=class{#e=M(0);get count(){return B(this.#e)}set count(e){N(this.#e,e,!0)}},vje=(e,t)=>{let n=e?.[hz];if(!n)return;let r=n.get(t);return r?r.count:mz(e)},gz=(e={},{onSet:t,onDelete:n}={})=>{let r=na(e),i=M(0),a=new Set(Object.keys(e)),o=new Map,s=e=>{let t=e.split(`.`);return t.map((e,n)=>t.slice(0,n+1).join(`.`))},c=e=>{s(e).forEach(e=>{o.has(e)||o.set(e,new _je)})},l=e=>{N(i,B(i)+1),s(e).forEach(e=>{o.get(e).count+=1})};return a.forEach(e=>{c(e)}),new Proxy(r,{get:(e,t)=>t===pz?B(i):t===hz?o:e[t],ownKeys:e=>{let t=new Set(Reflect.ownKeys(e));return[...[...a].filter(e=>t.has(e)),...[...t].filter(e=>!a.has(e))]},set:(e,n,r)=>{let i=e[n],o=!(n in e);return i!==r&&(e[n]=r,a.add(n),c(n),l(n)),t?.(e,n,r,i,o),!0},deleteProperty:(e,t)=>{let r=e[t];return t in e&&(delete e[t],a.delete(t),l(t)),n?.(e,t,r),!0}})},_z=new WeakMap,vz=(e,t,n=`currentValues`)=>{let r=e?.[n]?.[t];if(!r)return{};let i=mz(r);if(i===void 0)return ai(r);let a=_z.get(r);if(a?.version===i)return a.snapshot;let o=co(()=>ai(r));return _z.set(r,{version:i,snapshot:o}),o},yz=e=>Object.fromEntries(Object.keys(e.currentValues??{}).map(t=>[t,vz(e,t)])),bz=(e,t,n,r=`currentValues`)=>vje(e?.[r]?.[t],n)===void 0?vz(e,t,r):co(()=>vz(e,t,r)),xz=`entry-draft`,Sz=`data-entry-draft-root`,Cz=new WeakMap,yje=new WeakMap,bje=e=>Object.fromEntries(Object.entries(e.originalValues).map(([e,t])=>[e,t&&mA(yje,t,()=>co(()=>ai(t)))])),xje=e=>e&&{...e,originalValues:bje(e),currentValues:yz(e)},wz=class{#e=M();get current(){return B(this.#e)}set current(e){N(this.#e,e)}#t=j(()=>dz(xje(this.current)));get modified(){return B(this.#t)}set modified(e){N(this.#t,e)}},Tz=e=>di(xz,e),Ez=()=>ui(xz),Dz=e=>new Map([[xz,e]]),Oz=(e,t)=>{e.setAttribute(Sz,``),Cz.set(e,t)},Sje=e=>{let t=e?.closest(`[${Sz}]`);return t?Cz.get(t):void 0},kz=e=>{queueMicrotask(e)},Az=`field-editor`,jz=e=>e===`extraValues`,Mz=()=>ui(Az)??{},Nz=e=>{di(Az,e)},Pz=new Set,Fz=WO(!1),Cje=e=>{let t=()=>{Pz.delete(e),Fz.current=!!Pz.size};Pz.add(e),Fz.current=!0,e.then(t,t)},Iz=async()=>{for(;Pz.size;)await Promise.allSettled(Pz)},Lz=async e=>{await Iz(),e()},Rz=e=>{R(()=>{if(!e())return;let{promise:t,resolve:n}=Promise.withResolvers();return Cje(t),async()=>{await ao(),n()}})};function wje(e,t){k(t,!0);let n=Ez(),{valueStoreKey:r=`currentValues`}=Mz(),i=Y(t,`currentValue`,15),a=Y(t,`required`,3,!0),o=Y(t,`readonly`,3,!1),s=Y(t,`invalid`,3,!1),c=M(``),l=M(``),u=M(!1),d=j(()=>Nr(t.fieldConfig.default_language,`plain`)),f=j(()=>Nr(t.fieldConfig.allow_language_selection,!0)),p=j(()=>Nr(t.fieldConfig.output_code_only,!1)),m=j(()=>Nr(t.fieldConfig.keys,()=>({code:`code`,lang:`lang`}),!0)),h=j(()=>bz(n.current,t.locale,t.keyPath,r)),g=j(()=>`${t.keyPath}.${B(m).code}`),_=j(()=>`${t.keyPath}.${B(m).lang}`),v={code:``,lang:``},y=()=>{if(B(p))typeof i()==`string`?B(c)!==i()&&N(c,i(),!0):N(c,``),N(l,B(d),!0);else{let e=B(h)[B(g)],t=B(h)[B(_)]||B(d);typeof e==`string`?B(c)!==e&&N(c,e,!0):N(c,``),typeof t==`string`?B(l)!==t&&N(l,t,!0):N(l,B(d),!0),v={code:B(c),lang:B(h)[B(_)]===``?``:B(l)}}},b=()=>{if(B(p)){i()!==B(c)&&i(B(c));return}if(B(c)===v.code&&B(l)===v.lang)return;let e=n.current;if(!e)return;v={code:B(c),lang:B(l)};let a={};if((!D(B(h)[t.keyPath])||Object.keys(B(h)[t.keyPath]).length)&&(a[t.keyPath]={}),B(h)[B(g)]!==B(c)&&(a[B(g)]=B(c)),B(h)[B(_)]!==B(l)&&(a[B(_)]=B(l)),!Object.keys(a).length)return;let o=e[r][t.locale];kz(()=>{Object.assign(o,a)})};YO(()=>B(h),()=>{y()}),YO(()=>[B(c),B(l)],()=>{b()}),Rz(()=>B(u));var x=U();Mo(F(x),Zc,null,e=>{var n=U();No(F(n),()=>JSON.stringify(t.fieldConfig),e=>{Wye(e,{get showLanguageSwitcher(){return B(f)},flex:!0,get readonly(){return o()},get required(){return a()},get invalid(){return s()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get code(){return B(c)},set code(e){N(c,e,!0)},get lang(){return B(l)},set lang(e){N(l,e,!0)},get pending(){return B(u)},set pending(e){N(u,e,!0)}})}),W(e,n)}),W(e,x),A()}var Tje=V(`<pre> </pre>`);function Eje(e,t){k(t,!0);let n=Ez(),r=j(()=>Nr(t.fieldConfig.default_language,``)),i=j(()=>Nr(t.fieldConfig.output_code_only,!1)),a=j(()=>Nr(t.fieldConfig.keys,()=>({code:`code`,lang:`lang`}),!0)),o=j(()=>bz(n.current,t.locale,t.keyPath)),s=j(()=>`${t.keyPath}.${B(a).code}`),c=j(()=>`${t.keyPath}.${B(a).lang}`),l=j(()=>B(i)?t.currentValue:B(o)[B(s)]),u=j(()=>B(i)?B(r):B(o)[B(c)]);var d=U(),f=F(d),p=e=>{var t=Tje(),n=I(t,!0);z(()=>{rs(t,1,ts(B(u)?`language-${B(u)}`:void 0)),G(n,B(l))}),W(e,t)};K(f,e=>{B(l)&&e(p)}),W(e,d),A()}var zz=/^#(?<r>[0-9a-f]{2})(?<g>[0-9a-f]{2})(?<b>[0-9a-f]{2})(?<a>[0-9a-f]{2})?$/i,Bz=e=>Number.parseInt(e,16),Dje=(e,{enableAlpha:t=!1}={})=>{let{r:n,g:r,b:i,a}=e?.match(zz)?.groups??{};if(!n)return``;let o=t&&a?` / ${Math.round(Bz(a)/255*100)}%`:``;return`rgb(${Bz(n)} ${Bz(r)} ${Bz(i)}${o})`},Oje=/^#[0-9a-f]{6}$/i,kje=e=>{if(typeof e!=`string`)return;let{r:t,g:n,b:r,a:i=`ff`}=e.match(zz)?.groups??{};if(t)return{rgb:`#${t}${n}${r}`,alpha:Bz(i)}},Vz=({rgb:e,alpha:t,enableAlpha:n=!1})=>Oje.test(e)?n?`${e}${t.toString(16).padStart(2,`0`)}`:e:``,Aje=({currentValue:e,rgb:t,alpha:n,enableAlpha:r=!1})=>{let i=kje(e);if(i)return i;if((e==null||e===``)&&Vz({rgb:t,alpha:n,enableAlpha:r})!==``)return{rgb:``,alpha:255}},jje=V(` <!>`,1),Mje=V(`<span role="none" class="value svelte-udhsyb"><!> <!></span>`),Nje=V(`<div role="none" class="svelte-udhsyb"><!> <!> <!></div>`),Pje={hash:`svelte-udhsyb`,code:`div.svelte-udhsyb {display:flex;align-items:center;gap:8px;.value:where(.svelte-udhsyb) {display:flex;align-items:center;gap:8px;.sui.text-input {width:88px;min-width:0;}.sui.slider {padding:8px;--sui-slider-base-width: 80px;}}}`};function Fje(e,t){let n=Co();k(t,!0),q(e,Pje);let r=Y(t,`currentValue`,15),i=Y(t,`required`,3,!0),a=Y(t,`readonly`,3,!1),o=Y(t,`invalid`,3,!1),s=M(``),c=M(255),l=j(()=>Nr(t.fieldConfig.allowInput,!1)),u=j(()=>Nr(t.fieldConfig.enableAlpha,!1)),d={rgb:``,alpha:255},f=()=>{let e=Aje({currentValue:r(),rgb:B(s),alpha:B(c),enableAlpha:B(u)});e&&(B(s)!==e.rgb&&N(s,e.rgb,!0),B(u)&&B(c)!==e.alpha&&N(c,e.alpha,!0)),d={rgb:B(s),alpha:B(c)}},p=()=>{if(B(s)===d.rgb&&B(c)===d.alpha)return;let e=Vz({rgb:B(s),alpha:B(c),enableAlpha:B(u)});r()!==e&&r(e)};YO(()=>r(),()=>{f()}),YO(()=>[B(s),B(c)],()=>{p()});var m=Nje(),h=P(m);vxe(h,{get id(){return`${n}-picker`},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return B(s)},set value(e){N(s,e,!0)}});var g=L(h,2),_=e=>{var r=Mje(),d=P(r),f=e=>{Gl(e,{dir:`ltr`,get id(){return`${n}-input`},get invalid(){return o()},get readonly(){return a()},get required(){return i()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return B(s)},set value(e){N(s,e,!0)}})};K(d,e=>{B(l)&&e(f)});var p=L(d,2),m=e=>{var t=jje(),n=F(t),r=L(n);{let e=j(()=>!B(s)),t=j(()=>X(`opacity`));Cse(r,{min:0,max:255,get disabled(){return B(e)},get readonly(){return a()},get sliderLabel(){return B(t)},get value(){return B(c)},set value(e){N(c,e,!0)}})}z(e=>G(n,`${e??``} `),[()=>X(`opacity`)]),W(e,t)};K(p,e=>{B(u)&&e(m)}),O(r),W(e,r)};K(g,e=>{(B(l)||B(u))&&e(_)});var v=L(g,2),y=e=>{{let t=j(()=>X(`clear`)),r=j(()=>!B(s)),i=j(()=>`${n}-picker ${B(l)?`${n}-input`:``}`);ll(e,{variant:`tertiary`,get label(){return B(t)},get disabled(){return B(r)},get"aria-controls"(){return B(i)},onclick:()=>{N(s,``),N(c,255)}})}};K(v,e=>{!a()&&!i()&&e(y)}),O(m),W(e,m),A()}var Ije=V(`<p><span role="none" class="preview svelte-1m6xsa0"><span role="none" class="color svelte-1m6xsa0"></span> <span role="none" class="value"> </span> <span role="none" class="value"> </span></span></p>`),Lje={hash:`svelte-1m6xsa0`,code:`.preview.svelte-1m6xsa0 {display:inline-flex;align-items:center;gap:8px;.color:where(.svelte-1m6xsa0) {display:block;width:24px;height:24px;border-radius:24px;}}`};function Rje(e,t){k(t,!0),q(e,Lje);let n=j(()=>Nr(t.fieldConfig.enableAlpha,!1)),r=j(()=>Dje(t.currentValue,{enableAlpha:B(n)}));var i=U(),a=F(i),o=e=>{var n=Ije(),i=P(n),a=P(i);let o;var s=L(a,2),c=I(s,!0),l=I(L(s,2),!0);O(i),O(n),z(()=>{o=as(a,``,o,{"background-color":t.currentValue}),G(c,t.currentValue),G(l,B(r))}),W(e,n)},s=j(()=>typeof t.currentValue==`string`&&t.currentValue.trim());K(a,e=>{B(s)&&e(o)}),W(e,i),A()}function zje(e,t){k(t,!0);let n=Y(t,`required`,3,!0),r=Y(t,`readonly`,3,!1),i=Y(t,`invalid`,3,!1);{let a=j(()=>String(t.currentValue));Gl(e,{dir:`auto`,get value(){return B(a)},flex:!0,get readonly(){return r()},get required(){return n()},get invalid(){return i()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}})}A()}var Hz=e=>{let t=new Map;return Object.keys(e).forEach(e=>{let n=e.split(`.`),r=``;n.forEach((e,n)=>{if(n>0){let n=t.get(r);n?n.add(e):t.set(r,new Set([e]))}r=n===0?e:`${r}.${e}`})}),{childSegmentMap:t}},Uz=(e,t)=>e.childSegmentMap.has(t),Wz=(e,t)=>[...e.childSegmentMap.get(t)??[]].filter(cM).map(Number).sort((e,t)=>e-t),Gz=e=>{let t=new Map;return Object.keys(e).forEach(e=>{let n=0;for(;;){let r=e.indexOf(`.`,n);if(r===-1)return;let i=e.indexOf(`.`,r+1),a=i===-1?e.length:i,o=e.slice(r+1,a);if(cM(o)){let n=e.slice(0,r),i=t.get(n);i?i.add(Number(o)):t.set(n,new Set([Number(o)]))}n=r+1}}),t},Kz=(e,t)=>[...e.get(t)??[]].sort((e,t)=>e-t),Bje=/\s*(?:(?<number>\d+(?:\.\d+)?|\.\d+)|(?<tag>\0)|(?<name>[A-Za-z_]\w*)|(?<punctuator>[-+*/%(),]))/y,Vje=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?$/i,qz=e=>e.reduce((e,t)=>e+t,0),Jz={abs:{minArgs:1,maxArgs:1,fn:Math.abs},ceil:{minArgs:1,maxArgs:1,fn:Math.ceil},floor:{minArgs:1,maxArgs:1,fn:Math.floor},round:{minArgs:1,maxArgs:2,fn:(e,t=0)=>dM(e,Math.trunc(t))},avg:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?qz(e)/e.length:void 0},count:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length,anyValue:!0},max:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?Math.max(...e):void 0},min:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?Math.min(...e):void 0},sum:{minArgs:1,maxArgs:1/0,aggregate:qz}},Hje=100,Uje=new Map,Wje=e=>{let t=[],n=new RegExp(Bje),r=0,i=e.trimEnd().length;for(;n.lastIndex<i;){let i=n.exec(e)?.groups;if(!i)return;i.number===void 0?i.tag===void 0?i.name===void 0?t.push({type:`punctuator`,value:i.punctuator}):t.push({type:`name`,name:i.name}):(t.push({type:`tag`,index:r}),r+=1):t.push({type:`number`,value:Number(i.number)})}return t},Gje=e=>{let t=0,n=new Set,r=n=>{let r=e[t];return r?.type===`punctuator`&&r.value===n&&(t+=1,!0)},i,a=(e,t)=>{let n=t();for(;n;){let i=e.find(r);if(!i)break;let a=t();n=a?{type:`binary`,operator:i,left:n,right:a}:void 0}return n},o=()=>{let e=[];if(r(`)`))return e;do{let t=i();if(!t)return;e.push(t)}while(r(`,`));return r(`)`)?e:void 0},s=()=>{let a=e[t];if(a?.type===`number`||a?.type===`tag`)return t+=1,a;if(a?.type===`name`){t+=1;let{name:e}=a,i=Object.hasOwn(Jz,e)?Jz[e]:void 0,s=i&&r(`(`)?o():void 0;return!i||!s||s.length<i.minArgs||s.length>i.maxArgs?void 0:(i.aggregate&&s.forEach(e=>{e.type===`tag`&&n.add(e.index)}),{type:`call`,name:e,args:s})}if(r(`(`)){let e=i();return e&&r(`)`)?e:void 0}},c=()=>{let e=[`-`,`+`].find(r);if(!e)return s();let t=c();return t?{type:`unary`,operator:e,operand:t}:void 0},l=()=>a([`*`,`/`,`%`],c);i=()=>a([`+`,`-`],l);let u=i();return{tree:t===e.length?u:void 0,allItemsTagIndexes:n}},Yz=e=>vA(Uje,e,()=>{let{tags:t,literals:n}=PM(e),r=Wje(n.join(`\0`)),{tree:i,allItemsTagIndexes:a}=r?Gje(r):{tree:void 0,allItemsTagIndexes:new Set};return{tree:i,tags:t.map((e,t)=>({content:e,allItems:a.has(t)}))}},Hje),Xz=e=>String(e??``).trim(),Zz=e=>{let t=Xz(e);return Vje.test(t)?Number(t):void 0},Kje=e=>!Xz(e),qje=(e,t,n,r)=>{let i=[];for(let a of t){let t=a.type===`tag`?n[a.index]:void 0;if(Array.isArray(t))for(let n of t.filter(e=>!Kje(e))){let t=e.anyValue?0:Zz(n);if(t===void 0)return;i.push(t)}else{let e=r(a);if(e===void 0)return;i.push(e)}}return e.aggregate(i)},Qz=(e,t)=>{if(e.type===`number`)return e.value;if(e.type===`tag`)return t[e.index];if(e.type===`unary`){let n=Qz(e.operand,t);return n===void 0?void 0:e.operator===`-`?-n:n}if(e.type===`call`){let n=Jz[e.name];if(n.aggregate)return qje(n,e.args,t,e=>Qz(e,t));let r=e.args.map(e=>Qz(e,t));return r.includes(void 0)?void 0:n.fn(...r)}let n=Qz(e.left,t),r=Qz(e.right,t);if(n!==void 0&&r!==void 0)switch(e.operator){case`+`:return n+r;case`-`:return n-r;case`*`:return n*r;case`/`:return n/r;default:return n%r}},Jje=(e,t)=>{let{tree:n,tags:r}=Yz(e);if(!n)return;let i=Qz(n,r.map(({content:e,allItems:n})=>n?[t(e,{allItems:n})].flat():Zz(t(e,{allItems:n}))));return i!==void 0&&Number.isFinite(i)?i:void 0},Yje=new WeakMap,$z=e=>{let t=e.split(`.`).findLast(cM);return t===void 0?void 0:Number(t)},eB=e=>Object.hasOwn(Ok,e),tB=e=>{let{tags:t,literals:n}=PM(e),r=t.map(e=>IN(e).value),i=n.map(JE),a=r.findIndex(e=>!eB(e)),o=r.findLastIndex(e=>!eB(e)),s=(e,t)=>r.slice(e,t).map((t,n)=>`${i[e+n]}(${Ok[t].pattern})`).join(``)+i[t],c=a===-1?s(0,r.length):`${s(0,a)}[\\s\\S]*${s(o+1,r.length)}`;return{uuidTags:r.map((e,t)=>({tagName:e,extractable:a===-1||t<a||t>o})).filter(({tagName:e})=>eB(e)),regex:RegExp(`^${c}$`,`i`)}},nB=(e=``)=>tB(e).uuidTags.length>0,Xje=({valueTemplate:e,keyPath:t,valueMap:n})=>{let{uuidTags:r,regex:i}=tB(e);if(!r.length)return[];let a=n[t],o=typeof a==`string`?a.match(i)?.slice(1):void 0;if(o?.length===r.length)return o;let s=mA(Yje,n,()=>new Map),c=s.get(t);if(c?.length!==r.length&&(c=r.map(({tagName:e})=>Qc(Ok[e].length)),s.set(t,c)),!o)return c;let l=0;return r.map(({extractable:e},t)=>{if(!e)return c[t];let n=o[l];return l+=1,n})},Zje=(e,t)=>{let n=KN(t),r=!GN(t),i=e===void 0?void 0:(r?Math.round(e):lM(e))+0;return i===void 0||r&&!Number.isSafeInteger(i)?n?``:null:n?String(i):i},Qje=({value:e,fieldConfig:t,canonicalLocale:n})=>{let r=String(e??``),i=Number(e);return qN(t)&&r.trim()&&Number.isFinite(i)?UN(n).format(i):r},$je=new WeakMap,eMe=({fieldKeyPath:e,ownKeyPath:t,allItems:n,valueMap:r})=>{let i=e.split(`.`),a=i.lastIndexOf(`*`);if(a===-1)return[e];let o=t.split(`.`),s=[[]];return i.forEach((e,t)=>{e===`*`?s=s.flatMap(e=>{let i=n&&t===a,s=o[t];return!i&&cM(s??``)&&e.every((e,t)=>e===o[t])?[[...e,s]]:n?Kz(mA($je,r,()=>Gz(r)),e.join(`.`)).map(t=>[...e,String(t)]):[]}):s.forEach(t=>t.push(e))}),s.map(e=>e.join(`.`))},tMe=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e.startsWith(t)).map(([e,n])=>[e.slice(t.length),n])),nMe=(e,t)=>{let{keyPath:n,valueMap:r,keyPathPrefix:i,componentName:a,collectionName:o,fileName:s,isIndexFile:c}=e;return i?a&&_M({collectionName:o,fileName:s,isIndexFile:c,keyPath:t,componentName:a})?(e.componentValues??=tMe(r,i),{valueMap:e.componentValues,componentName:a,ownKeyPath:n.slice(i.length)}):{valueMap:e.entryValueMap,ownKeyPath:i.split(`:`)[0]}:{valueMap:r,ownKeyPath:n}},rMe=(e,t)=>!!e&&(qN(e)||t&&(e.widget===`select`||e.widget===`relation`)),rB=(e,t,n,r)=>{let{locale:i,collectionName:a,fileName:o,isIndexFile:s,numeric:c,listFormatter:l}=e,{valueMap:u,componentName:d}=n,f={collectionName:a,fileName:o,componentName:d,valueMap:u,keyPath:t,isIndexFile:s},p=u[t],m=p!==void 0;if(m){let e=_M(f);if(rMe(e,c)){let t=String(p??``);return r.length?LN({fieldConfig:e,value:t,transformations:r,locale:i}):t}}let h=RR({...f,locale:i,transformations:m?r:void 0}),g=Array.isArray(h)?l.format(h):String(h);return!m&&r.length?LN({value:g,transformations:r,locale:i}):g},iMe=({fieldConfig:e,keyPath:t,locale:n,valueMap:r,collectionName:i,fileName:a,isIndexFile:o=!1,keyPathPrefix:s=``,entryValueMap:c={}})=>{let{value:l=``}=e,u=qN(e);if(!u&&l===`{{index}}`)return $z(t)??``;let d=u?[]:Xje({valueTemplate:l,keyPath:t,valueMap:r}),f=0,p={keyPath:t,locale:n,valueMap:r,collectionName:i,fileName:a,isIndexFile:o,keyPathPrefix:s,entryValueMap:c,componentName:s?r[`${s}__sc_component_name`]:void 0,numeric:u,listFormatter:AA(n)},m=(e,{allItems:r=!1}={})=>{let{value:i,transformations:a}=IN(e);if(i===`index`){let e=String($z(t)??``);return r?[e]:e}let o=RM(a,e=>eB(IN(e).value)?``:m(e));if(Dk.test(i)){let e=kk(i),t=nMe(p,e),n=eMe({fieldKeyPath:e,ownKeyPath:t.ownKeyPath,allItems:r,valueMap:t.valueMap});return r?n.map(e=>rB(p,e,t,o)):rB(p,n[0]??e,t,o)}if(!eB(i))return r?[]:``;let s=d[f];return f+=1,o.length&&(s=LN({value:s,transformations:o,locale:n})),r?[s]:s};return u?Zje(Jje(l,m),e):NM(l,(e,t)=>m(t))},aMe=V(`<p> </p>`);function oMe(e,t){k(t,!0);let n=j(()=>DA(t.locale));var r=aMe(),i=I(r,!0);z((e,t)=>{J(r,`lang`,B(n)),J(r,`dir`,e),G(i,t),r.dir=r.dir},[()=>OA(t.locale),()=>Qje({value:t.currentValue,fieldConfig:t.fieldConfig,canonicalLocale:B(n)})]),W(e,r),A()}var iB=(e,t)=>{let n=t?.media_libraries?.[e];if(n!=null)return n;let{media_library:r}=t??{},i=r?.name??QO.current?.media_library?.name;return r&&i===e?r:void 0},aB=(e,t)=>{if(t===void 0)return e;if(!t||!e)return t;let n={...e,...t};return Object.entries(t).forEach(([t,r])=>{D(r)&&D(e[t])&&(n[t]={...e[t],...r})}),n},oB=(e,t)=>aB(iB(e,QO.current),iB(e,t)),sB=WO(!1),cB=WO(!1),lB=WO(!1),uB=new URL(`https://console.cloudinary.com/console/media_library`).origin,sMe=[`cloud_name`,`api_key`,`username`,`timestamp`,`signature`,`integration`,`use_saml`,`saml_iframe_support`],cMe=[`integration`,`inline_container`,`z_index`,`multiple`,`max_files`,`default_transformations`,`insert_caption`,`remove_header`,`folder`,`search`,`collection`,`asset`,`transformation`,`sandboxNotAllowedAttributes`,`theme`],lMe=(e=QO.current)=>iB(`cloudinary`,e),dB=new Map,fB=e=>{let t=e?JSON.stringify(e):`global`,n=dB.get(t);if(n)return n;let r=oB(`cloudinary`,e)||{},i={...r,config:{...r.config}};return dB.set(t,i),i},pB=e=>{let t=oB(`cloudinary`,e),{cloud_name:n,api_key:r}=(t?t.config:void 0)??{};return{cloudName:n,apiKey:r}},uMe=e=>{let{cloudName:t,apiKey:n}=pB(e);return!!(t&&n)},dMe=e=>{let{cloudName:t}=pB();return!!t&&e.startsWith(`https://res.cloudinary.com/${t}/`)},mB=({origin:e,data:t})=>{if(e===uB){if(typeof t==`string`)try{t=JSON.parse(t)}catch{return}return D(t)?t:void 0}},fMe={serviceType:`cloud_storage`,serviceId:`cloudinary`,serviceLabel:`Cloudinary`,serviceURL:`https://cloudinary.com/`,showServiceLink:!0,hotlinking:!0,authType:`widget`,developerURL:`https://cloudinary.com/documentation/`,apiKeyURL:`https://console.cloudinary.com/settings/api-keys`,apiKeyPattern:/^[A-Za-z0-9_-]{15,}$/,isEnabled:uMe,isAssetURL:dMe},hB=(e,{noopener:t=!0}={})=>{if(!e)return null;let n=t?`noopener,noreferrer`:``;return window.open(e,`_blank`,n)},pMe=V(`<!> <div role="none"> </div>`,1);function gB(e,t){k(t,!0);let n=Y(t,`multiple`,3,!1),r=Y(t,`hidden`,3,!1),i=j(()=>fB(t.fieldConfig)),a=null,o=()=>{let{folder:e}=B(i).config,r={...Object.fromEntries(Object.entries(B(i).config).filter(([e])=>cMe.includes(e))),multiple:n(),max_files:t.fieldConfig?.max??B(i).config.max_files??20,folder:{path:e?.path??``,resource_type:e?.resource_type??t.kind}},o={type:`ML_WIDGET_SHOW`,data:{mlId:a?.dataset?.mlId,config:r}};console.debug(`Cloudinary Panel sending message:`,o),a?.contentWindow?.postMessage(JSON.stringify(o),uB)},s=({assets:e})=>{let{output_filename_only:n=!1,use_transformations:r=!0}=B(i),a=e.map(e=>{let t=e.secure_url;if(n){let{public_id:t,format:n}=e;return{url:n?`${t}.${n}`:t}}return r?{url:e.derived?.[0]?.secure_url??t}:{url:t}});t.onSelect(a)},c=e=>{let t=mB(e);t&&(console.debug(`Cloudinary Panel received message:`,t),t.type===`login`&&t.consoleDomain&&(sB.current=!0,lB.current=!0),t.type===`ML_WIDGET_INSERT_DATA`&&(lB.current=!1,s(t.data)),t.type===`ML_WIDGET_HIDE`&&(lB.current=!1))};vs(()=>(a=document.querySelector(`iframe#cloudinary-iframe`),window.addEventListener(`message`,c),()=>{window.removeEventListener(`message`,c)})),R(()=>{B(i)&&cB.current&&o()});var l=U(),u=F(l),d=e=>{DO(e,{children:(e,t)=>{var n=U(),r=F(n),i=e=>{{let t=j(()=>X(`cloud_storage.cloudinary.open_library`));ll(e,{variant:`primary`,get label(){return B(t)},onclick:()=>{lB.current=!0}})}},a=e=>{var t=pMe(),n=F(t);{let e=j(()=>X(`cloud_storage.cloudinary.activate.button_label`));ll(n,{variant:`primary`,get label(){return B(e)},onclick:()=>{hB(`https://console.cloudinary.com/console/media_library/cms_login?cms=true`,{noopener:!1})}})}var r=I(L(n,2),!0);z(e=>G(r,e),[()=>X(`cloud_storage.cloudinary.activate.description`)]),W(e,t)};K(r,e=>{sB.current?e(i):e(a,-1)}),W(e,n)},$$slots:{default:!0}})};K(u,e=>{r()||e(d)}),W(e,l),A()}var mMe=V(`<strong></strong>`),hMe=V(`<!>/`,1),gMe=V(`<span class="name svelte-1ngvthn" dir="ltr" aria-hidden="true"><!> <!></span>`),_Me={hash:`svelte-1ngvthn`,code:`.name.svelte-1ngvthn {color:var(--sui-tertiary-foreground-color);strong {color:var(--sui-primary-foreground-color);font-weight:var(--sui-font-weight-normal);}}`};function _B(e,t){k(t,!0),q(e,_Me);let n={ALLOWED_TAGS:[`wbr`],ALLOWED_ATTR:[]},r=Y(t,`children`,3,void 0),i=j(()=>t.path?XE(t.path).split(`/`):t.caption?[t.caption]:[]),a=e=>_t(e.replace(/([-_.])/g,`$1<wbr>`),n);var o=U(),s=F(o),c=e=>{var t=gMe(),n=P(t);Xc(n,{lines:2,children:(e,t)=>{var n=U();Ro(F(n),19,()=>B(i),(e,t)=>`${e}-${t}`,(e,t,n)=>{var r=U(),o=F(r),s=e=>{var n=mMe();Ho(n,()=>a(B(t)),!0),O(n),W(e,n)},c=e=>{var n=hMe();Ho(F(n),()=>a(B(t))),$r(),W(e,n)};K(o,e=>{B(n)===B(i).length-1?e(s):e(c,-1)}),W(e,r)}),W(e,n)},$$slots:{default:!0}}),Uo(L(n,2),()=>r()??jr),O(t),z(()=>t.dir=t.dir),W(e,t)};K(s,e=>{B(i).length&&e(c)}),W(e,o),A()}var vB=e=>{{let t=j(()=>Pc()?`chevron_left`:`chevron_right`);Lc(e,{get name(){return B(t)},class:`separator`})}},yB=(e,t)=>{let n=()=>(t?.()).label,r=()=>(t?.()).onClick;var i=yMe(),a=F(i);ll(a,{variant:`link`,class:`crumb`,get onclick(){return r()},children:(e,t)=>{var r=vMe(),i=I(r,!0);z(()=>G(i,n())),W(e,r)},$$slots:{default:!0}}),vB(L(a,2)),W(e,i)},vMe=V(`<bdi class="svelte-r6xh9b"> </bdi>`),yMe=V(`<!> <!>`,1),bMe=V(`<!> <!> <!>`,1),xMe=V(`<span class="crumb svelte-r6xh9b"><bdi> </bdi></span> <!>`,1),SMe=V(`<nav><!> <span class="current svelte-r6xh9b"><bdi> </bdi></span> <div class="copy svelte-r6xh9b" aria-hidden="true" inert=""><!> <span class="current svelte-r6xh9b"><bdi> </bdi></span></div></nav>`),CMe={hash:`svelte-r6xh9b`,code:`.breadcrumb.svelte-r6xh9b {position:relative;display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap;
|
||
|
||
/* A name is cut short with an ellipsis rather than wrapped, down to the least width the script
|
||
above gives it, so the trail stays one line tall */& > .crumb,
|
||
& > .current:where(.svelte-r6xh9b) {flex:0 1 auto;overflow:hidden;min-width:0;text-overflow:ellipsis;}.current:where(.svelte-r6xh9b) {display:block;}.copy:where(.svelte-r6xh9b) {position:absolute;inset-block-start:0;inset-inline-start:0;display:flex;align-items:center;gap:4px;visibility:hidden;pointer-events:none;& > :where(.svelte-r6xh9b) {flex:none;}}.sui.button.crumb {display:block;color:var(--sui-secondary-foreground-color);font-size:inherit;.label {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}&:hover .label {color:var(--sui-primary-foreground-color);}}.separator,
|
||
.more {flex:none;color:var(--sui-secondary-foreground-color);}}`};function bB(e,t){k(t,!0),q(e,CMe);let n=Y(t,`class`,3,``),r=M(void 0),i=M(void 0),a=M(!1),o=j(()=>t.items.slice(0,-1)),s=j(()=>t.items.at(-1)),c=j(()=>B(o).slice(1)),l=j(()=>B(c).length>0),u=e=>e.querySelector(`bdi`)?.textContent??``,d=()=>{if(!B(r)||!B(i))return;let e=parseFloat(getComputedStyle(B(r)).fontSize),t={},n=(B(i).children.length-1)*4;[...B(i).children].forEach(r=>{let{classList:i}=r,{width:a}=r.getBoundingClientRect();if(i.contains(`crumb`)||i.contains(`current`)){let o=Math.min(a,e*(i.contains(`current`)?6:4.5));t[u(r)]=o,n+=o}else n+=a}),[...B(r).children].forEach(e=>{let{classList:n}=e;(n.contains(`crumb`)||n.contains(`current`))&&(e.style.minWidth=`${t[u(e)]}px`)}),N(a,B(l)&&n>B(r).clientWidth+1,!0)};R(()=>{t.items;let e=B(r);if(!e)return;let n=new ResizeObserver(()=>{requestAnimationFrame(()=>{d()})});return n.observe(e),co(()=>{d()}),document.fonts.ready.then(()=>{d()}),()=>{n.disconnect()}}),R(()=>{B(a),co(()=>{d()})});var f=SMe(),p=P(f),m=e=>{var t=bMe(),n=F(t);yB(n,()=>B(o)[0]);var r=L(n,2);{let e=e=>{Lc(e,{name:`more_horiz`})},t=e=>{{let t=j(()=>X(`more_folders`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>B(c),Fo,(e,t)=>{let n=()=>B(t).label,r=()=>B(t).onClick;iu(e,{variant:`ghost`,get label(){return n()},get onclick(){return r()},startIcon:e=>{Lc(e,{name:`folder`})},$$slots:{startIcon:!0}})}),W(e,n)},$$slots:{default:!0}})}},n=j(()=>X(`more_folders`));kl(r,{variant:`ghost`,iconic:!0,size:`small`,class:`more`,get"aria-label"(){return B(n)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}})}vB(L(r,2)),W(e,t)},h=e=>{var t=U();Ro(F(t),17,()=>B(o),Fo,(e,t)=>{yB(e,()=>B(t))}),W(e,t)};K(p,e=>{B(a)?e(m):e(h,-1)});var g=L(p,2),_=I(P(g),!0);O(g);var v=L(g,2),y=P(v);Ro(y,17,()=>B(o),Fo,(e,t)=>{let n=()=>B(t).label;var r=xMe(),i=F(r),a=I(P(i),!0);O(i),vB(L(i,2)),z(()=>G(a,n())),W(e,r)});var b=L(y,2),x=I(P(b),!0);O(b),O(v),ms(v,e=>N(i,e),()=>B(i)),O(f),ms(f,e=>N(r,e),()=>B(r)),z(e=>{rs(f,1,ts([`breadcrumb`,n(),{folded:B(a)}]),`svelte-r6xh9b`),J(f,`aria-label`,e),G(_,B(s).label),G(x,B(s).label)},[()=>X(`folder`)]),W(e,f),A()}var xB=[`admin`,`cms`],SB=[``,`static`,`public`],CB=e=>XE(e).normalize().toLowerCase(),wMe=e=>xB.includes(CB(e)),TMe=(e,t)=>{if(typeof e!=`string`||typeof t!=`string`)return;let n=XE(e).replace(/^\.(?:\/|$)/,``),r=XE(t);if(!(IM(n)||IM(r)||/^[.@]/.test(r)))return!r||n===r?r?``:n:n.endsWith(`/${r}`)?n.slice(0,-r.length-1):void 0},wB=e=>{let t=e.split(`/`).filter(Boolean);t.at(-1)?.includes(`.`)&&t.pop();try{let e=t.map(decodeURIComponent);return e.map((t,n)=>e.slice(n).join(`/`))}catch{return[]}},TB,EMe=()=>{let{media_folder:e,public_folder:t}=QO.current??{},n=globalThis.location?.pathname??``,r=JSON.stringify([e,t,n]);if(TB?.key!==r){let i=TMe(e,t),a=i===void 0?SB:[...SB,i],o=[...xB,...wB(n)];TB={key:r,paths:a.flatMap(e=>o.map(t=>CB(`${e}/${t}`)))}}return TB.paths},EB=e=>{let t=CB(e);return EMe().some(e=>t===e||t.startsWith(`${e}/`))},DMe=/^(?:index\.html|config\.(?:ya?ml|toml|json))$/,OMe=(e,t)=>{if(!DMe.test(CB(t)))return!1;let n=[...xB,...wB(globalThis.location?.pathname??``).slice(-1).map(CB)];return CB(e).split(`/`).some(e=>n.includes(e))},DB=e=>{let t=e.lastIndexOf(`/`),n=e.slice(0,Math.max(t,0));return EB(n)||OMe(n,e.slice(t+1))},OB=e=>{if(e.some(DB))throw Error(`Cannot change a file in a folder the CMS is served from`)},kB=WO(),AB=WO(),jB=async(e,t)=>{let n={};if(e)try{n=await t(e)}catch{}kB.current=n.canPush===!1?e:void 0,AB.current=n.canMerge===!1?e:void 0},MB=WO(),NB=KO(()=>!!MB.current),PB=WO(!1),FB=e=>e?.message===`entry_already_published`,IB=e=>e?`${e.owner}/${e.repo}`:``,kMe=(e,t)=>{let{repoURL:n,owner:r,repo:i}=e??{};return!t||!n?``:n.slice(0,-`${r}/${i}`.length)+IB(t)},LB=WO(),AMe=async e=>(LB.current?.respond(!1),new Promise(t=>{let n={repo:e,respond:e=>{LB.current===n&&(LB.current=void 0),t(e)}};LB.current=n})),RB=WO([]),zB=KO(()=>RB.current.find(({collectionName:e,componentName:t,typedKeyPath:n,internalPath:r})=>e===void 0&&t===void 0&&n===void 0&&r!==void 0)),BB=WO(),VB=KO(()=>{let{current:e}=BB;return e?.internalPath===void 0?zB.current:e}),HB=e=>{let t=`typedKeyPath`in e?e.typedKeyPath?.match(/[^:]+$/)?.[0]:e.typedKeyPath;return RB.current.find(n=>(`typedKeyPath`in e?n.typedKeyPath===t:!n.typedKeyPath)?e.componentName?n.componentName===(rM(e.componentName)??e.componentName):n.collectionName===e.collectionName&&n.fileName===e.fileName&&!!n.isIndexFile==!!e.isIndexFile:!1)},jMe=({internalPath:e,internalSubPath:t,localeFolderNames:n})=>{let r=n?.length?`(?:(?:${n.map(JE).join(`|`)})\\/)?`:``,i=e;if(SA(i))return RegExp(`^${EA(i,r)}`);if(i)return RegExp(`^${r}${JE(i)}\\/`);let a=t,[o]=a.split(`/`);if(!o||o===`..`||IM(o))return/(?!)/;let s=Mk(a,`[^/]+`);return RegExp(`^${r}${s}\\/`)},MMe=xA(()=>RB.current,e=>{let t=[],n=[];return e.forEach(e=>{let{internalPath:r,entryRelative:i}=e;if(r!==void 0){if(i)n.push({folder:e,regex:jMe(e)});else{let n=Mk(r,`.+?`);t.push({folder:e,regexSub:RegExp(`^${n}${r?`(?=\\/|$)`:`$`}`),regexExact:RegExp(`^${n}$`)})}}}),{items:t,entryRelative:n}}),UB=(e,{matchSubFolders:t=!0}={})=>{let{filename:n,dirname:r}=bk(e);if(n.startsWith(`+`))return[];let{items:i,entryRelative:a}=MMe(),o=r??``;return[...a.filter(({regex:t})=>t.test(e)).map(({folder:e})=>e),...i.filter(({regexSub:e,regexExact:n})=>(t?e:n).test(o)).map(({folder:e})=>e)].sort((e,t)=>t.internalPath.localeCompare(e.internalPath))},NMe=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i,internalPath:a,internalSubPath:o,publicPath:s})=>JSON.stringify([e,t,n,r,i,a,o,s]),WB=e=>!!e&&!e.entryRelative&&!e.hasTemplateTags&&!e.readonly,GB=KO(()=>NB.current||!!kB.current),PMe=xA(()=>RB.current,e=>new Set(e.filter(({readonly:e,entryRelative:t})=>e&&!t).map(({internalPath:e})=>e))),KB=e=>e.some(({folder:e,path:t})=>!!e?.readonly||!e?.entryRelative&&PMe().has(e?.internalPath)||DB(t)),qB=WO([]),JB=KO(()=>qB.current.some(({workflow:e})=>e)?qB.current.filter(({workflow:e})=>!e):qB.current),YB=WO([]),FMe=KO(()=>new Set(YB.current.map(e=>e.path))),XB=WO(),IMe=KO(()=>YB.current.length?[...YB.current]:XB.current?[XB.current]:[]),ZB=WO(),QB=WO({folder:void 0,files:[]}),$B=WO(),eV=WO(),tV=/^(?:.+\/)?(\.git(?:attributes|ignore|keep))$/,nV=WO([]),rV={"application/prs.cww":[`cww`],"application/prs.xsf+xml":[`xsf`],"application/vnd.1000minds.decision-model+xml":[`1km`],"application/vnd.3gpp.pic-bw-large":[`plb`],"application/vnd.3gpp.pic-bw-small":[`psb`],"application/vnd.3gpp.pic-bw-var":[`pvb`],"application/vnd.3gpp2.tcap":[`tcap`],"application/vnd.3m.post-it-notes":[`pwn`],"application/vnd.accpac.simply.aso":[`aso`],"application/vnd.accpac.simply.imp":[`imp`],"application/vnd.acucobol":[`acu`],"application/vnd.acucorp":[`atc`,`acutc`],"application/vnd.adobe.air-application-installer-package+zip":[`air`],"application/vnd.adobe.formscentral.fcdt":[`fcdt`],"application/vnd.adobe.fxp":[`fxp`,`fxpl`],"application/vnd.adobe.xdp+xml":[`xdp`],"application/vnd.adobe.xfdf":[`*xfdf`],"application/vnd.age":[`age`],"application/vnd.ahead.space":[`ahead`],"application/vnd.airzip.filesecure.azf":[`azf`],"application/vnd.airzip.filesecure.azs":[`azs`],"application/vnd.amazon.ebook":[`azw`],"application/vnd.americandynamics.acc":[`acc`],"application/vnd.amiga.ami":[`ami`],"application/vnd.android.package-archive":[`apk`],"application/vnd.anser-web-certificate-issue-initiation":[`cii`],"application/vnd.anser-web-funds-transfer-initiation":[`fti`],"application/vnd.antix.game-component":[`atx`],"application/vnd.apple.installer+xml":[`mpkg`],"application/vnd.apple.keynote":[`key`],"application/vnd.apple.mpegurl":[`m3u8`],"application/vnd.apple.numbers":[`numbers`],"application/vnd.apple.pages":[`pages`],"application/vnd.apple.pkpass":[`pkpass`],"application/vnd.aristanetworks.swi":[`swi`],"application/vnd.astraea-software.iota":[`iota`],"application/vnd.audiograph":[`aep`],"application/vnd.autodesk.fbx":[`fbx`],"application/vnd.balsamiq.bmml+xml":[`bmml`],"application/vnd.blueice.multipass":[`mpm`],"application/vnd.bmi":[`bmi`],"application/vnd.businessobjects":[`rep`],"application/vnd.chemdraw+xml":[`cdxml`],"application/vnd.chipnuts.karaoke-mmd":[`mmd`],"application/vnd.cinderella":[`cdy`],"application/vnd.citationstyles.style+xml":[`csl`],"application/vnd.claymore":[`cla`],"application/vnd.cloanto.rp9":[`rp9`],"application/vnd.clonk.c4group":[`c4g`,`c4d`,`c4f`,`c4p`,`c4u`],"application/vnd.cluetrust.cartomobile-config":[`c11amc`],"application/vnd.cluetrust.cartomobile-config-pkg":[`c11amz`],"application/vnd.commonspace":[`csp`],"application/vnd.contact.cmsg":[`cdbcmsg`],"application/vnd.cosmocaller":[`cmc`],"application/vnd.crick.clicker":[`clkx`],"application/vnd.crick.clicker.keyboard":[`clkk`],"application/vnd.crick.clicker.palette":[`clkp`],"application/vnd.crick.clicker.template":[`clkt`],"application/vnd.crick.clicker.wordbank":[`clkw`],"application/vnd.criticaltools.wbs+xml":[`wbs`],"application/vnd.ctc-posml":[`pml`],"application/vnd.cups-ppd":[`ppd`],"application/vnd.curl.car":[`car`],"application/vnd.curl.pcurl":[`pcurl`],"application/vnd.dart":[`dart`],"application/vnd.data-vision.rdz":[`rdz`],"application/vnd.dbf":[`dbf`],"application/vnd.dcmp+xml":[`dcmp`],"application/vnd.dece.data":[`uvf`,`uvvf`,`uvd`,`uvvd`],"application/vnd.dece.ttml+xml":[`uvt`,`uvvt`],"application/vnd.dece.unspecified":[`uvx`,`uvvx`],"application/vnd.dece.zip":[`uvz`,`uvvz`],"application/vnd.denovo.fcselayout-link":[`fe_launch`],"application/vnd.dna":[`dna`],"application/vnd.dolby.mlp":[`mlp`],"application/vnd.dpgraph":[`dpg`],"application/vnd.dreamfactory":[`dfac`],"application/vnd.ds-keypoint":[`kpxx`],"application/vnd.dvb.ait":[`ait`],"application/vnd.dvb.service":[`svc`],"application/vnd.dynageo":[`geo`],"application/vnd.ecowin.chart":[`mag`],"application/vnd.enliven":[`nml`],"application/vnd.epson.esf":[`esf`],"application/vnd.epson.msf":[`msf`],"application/vnd.epson.quickanime":[`qam`],"application/vnd.epson.salt":[`slt`],"application/vnd.epson.ssf":[`ssf`],"application/vnd.eszigno3+xml":[`es3`,`et3`],"application/vnd.ezpix-album":[`ez2`],"application/vnd.ezpix-package":[`ez3`],"application/vnd.fdf":[`*fdf`],"application/vnd.fdsn.mseed":[`mseed`],"application/vnd.fdsn.seed":[`seed`,`dataless`],"application/vnd.flographit":[`gph`],"application/vnd.fluxtime.clip":[`ftc`],"application/vnd.framemaker":[`fm`,`frame`,`maker`,`book`],"application/vnd.frogans.fnc":[`fnc`],"application/vnd.frogans.ltf":[`ltf`],"application/vnd.fsc.weblaunch":[`fsc`],"application/vnd.fujitsu.oasys":[`oas`],"application/vnd.fujitsu.oasys2":[`oa2`],"application/vnd.fujitsu.oasys3":[`oa3`],"application/vnd.fujitsu.oasysgp":[`fg5`],"application/vnd.fujitsu.oasysprs":[`bh2`],"application/vnd.fujixerox.ddd":[`ddd`],"application/vnd.fujixerox.docuworks":[`xdw`],"application/vnd.fujixerox.docuworks.binder":[`xbd`],"application/vnd.fuzzysheet":[`fzs`],"application/vnd.genomatix.tuxedo":[`txd`],"application/vnd.geogebra.file":[`ggb`],"application/vnd.geogebra.slides":[`ggs`],"application/vnd.geogebra.tool":[`ggt`],"application/vnd.geometry-explorer":[`gex`,`gre`],"application/vnd.geonext":[`gxt`],"application/vnd.geoplan":[`g2w`],"application/vnd.geospace":[`g3w`],"application/vnd.gmx":[`gmx`],"application/vnd.google-apps.document":[`gdoc`],"application/vnd.google-apps.drawing":[`gdraw`],"application/vnd.google-apps.form":[`gform`],"application/vnd.google-apps.jam":[`gjam`],"application/vnd.google-apps.map":[`gmap`],"application/vnd.google-apps.presentation":[`gslides`],"application/vnd.google-apps.script":[`gscript`],"application/vnd.google-apps.site":[`gsite`],"application/vnd.google-apps.spreadsheet":[`gsheet`],"application/vnd.google-earth.kml+xml":[`kml`],"application/vnd.google-earth.kmz":[`kmz`],"application/vnd.gov.sk.xmldatacontainer+xml":[`xdcf`],"application/vnd.grafeq":[`gqf`,`gqs`],"application/vnd.groove-account":[`gac`],"application/vnd.groove-help":[`ghf`],"application/vnd.groove-identity-message":[`gim`],"application/vnd.groove-injector":[`grv`],"application/vnd.groove-tool-message":[`gtm`],"application/vnd.groove-tool-template":[`tpl`],"application/vnd.groove-vcard":[`vcg`],"application/vnd.hal+xml":[`hal`],"application/vnd.handheld-entertainment+xml":[`zmm`],"application/vnd.hbci":[`hbci`],"application/vnd.hhe.lesson-player":[`les`],"application/vnd.hp-hpgl":[`hpgl`],"application/vnd.hp-hpid":[`hpid`],"application/vnd.hp-hps":[`hps`],"application/vnd.hp-jlyt":[`jlt`],"application/vnd.hp-pcl":[`pcl`],"application/vnd.hp-pclxl":[`pclxl`],"application/vnd.hydrostatix.sof-data":[`sfd-hdstx`],"application/vnd.ibm.minipay":[`mpy`],"application/vnd.ibm.modcap":[`afp`,`listafp`,`list3820`],"application/vnd.ibm.rights-management":[`irm`],"application/vnd.ibm.secure-container":[`sc`],"application/vnd.iccprofile":[`icc`,`icm`],"application/vnd.igloader":[`igl`],"application/vnd.immervision-ivp":[`ivp`],"application/vnd.immervision-ivu":[`ivu`],"application/vnd.insors.igm":[`igm`],"application/vnd.intercon.formnet":[`xpw`,`xpx`],"application/vnd.intergeo":[`i2g`],"application/vnd.intu.qbo":[`qbo`],"application/vnd.intu.qfx":[`qfx`],"application/vnd.ipunplugged.rcprofile":[`rcprofile`],"application/vnd.irepository.package+xml":[`irp`],"application/vnd.is-xpr":[`xpr`],"application/vnd.isac.fcs":[`fcs`],"application/vnd.jam":[`jam`],"application/vnd.jcp.javame.midlet-rms":[`rms`],"application/vnd.jisp":[`jisp`],"application/vnd.joost.joda-archive":[`joda`],"application/vnd.kahootz":[`ktz`,`ktr`],"application/vnd.kde.karbon":[`karbon`],"application/vnd.kde.kchart":[`chrt`],"application/vnd.kde.kformula":[`kfo`],"application/vnd.kde.kivio":[`flw`],"application/vnd.kde.kontour":[`kon`],"application/vnd.kde.kpresenter":[`kpr`,`kpt`],"application/vnd.kde.kspread":[`ksp`],"application/vnd.kde.kword":[`kwd`,`kwt`],"application/vnd.kenameaapp":[`htke`],"application/vnd.kidspiration":[`kia`],"application/vnd.kinar":[`kne`,`knp`],"application/vnd.koan":[`skp`,`skd`,`skt`,`skm`],"application/vnd.kodak-descriptor":[`sse`],"application/vnd.las.las+xml":[`lasxml`],"application/vnd.llamagraphics.life-balance.desktop":[`lbd`],"application/vnd.llamagraphics.life-balance.exchange+xml":[`lbe`],"application/vnd.lotus-1-2-3":[`123`],"application/vnd.lotus-approach":[`apr`],"application/vnd.lotus-freelance":[`pre`],"application/vnd.lotus-notes":[`nsf`],"application/vnd.lotus-organizer":[`org`],"application/vnd.lotus-screencam":[`scm`],"application/vnd.lotus-wordpro":[`lwp`],"application/vnd.macports.portpkg":[`portpkg`],"application/vnd.mapbox-vector-tile":[`mvt`],"application/vnd.mcd":[`mcd`],"application/vnd.medcalcdata":[`mc1`],"application/vnd.mediastation.cdkey":[`cdkey`],"application/vnd.mfer":[`mwf`],"application/vnd.mfmp":[`mfm`],"application/vnd.micrografx.flo":[`flo`],"application/vnd.micrografx.igx":[`igx`],"application/vnd.mif":[`mif`],"application/vnd.mobius.daf":[`daf`],"application/vnd.mobius.dis":[`dis`],"application/vnd.mobius.mbk":[`mbk`],"application/vnd.mobius.mqy":[`mqy`],"application/vnd.mobius.msl":[`msl`],"application/vnd.mobius.plc":[`plc`],"application/vnd.mobius.txf":[`txf`],"application/vnd.mophun.application":[`mpn`],"application/vnd.mophun.certificate":[`mpc`],"application/vnd.mozilla.xul+xml":[`xul`],"application/vnd.ms-artgalry":[`cil`],"application/vnd.ms-cab-compressed":[`cab`],"application/vnd.ms-excel":[`xls`,`xlm`,`xla`,`xlc`,`xlt`,`xlw`],"application/vnd.ms-excel.addin.macroenabled.12":[`xlam`],"application/vnd.ms-excel.sheet.binary.macroenabled.12":[`xlsb`],"application/vnd.ms-excel.sheet.macroenabled.12":[`xlsm`],"application/vnd.ms-excel.template.macroenabled.12":[`xltm`],"application/vnd.ms-fontobject":[`eot`],"application/vnd.ms-htmlhelp":[`chm`],"application/vnd.ms-ims":[`ims`],"application/vnd.ms-lrm":[`lrm`],"application/vnd.ms-officetheme":[`thmx`],"application/vnd.ms-outlook":[`msg`],"application/vnd.ms-pki.seccat":[`cat`],"application/vnd.ms-pki.stl":[`*stl`],"application/vnd.ms-powerpoint":[`ppt`,`pps`,`pot`],"application/vnd.ms-powerpoint.addin.macroenabled.12":[`ppam`],"application/vnd.ms-powerpoint.presentation.macroenabled.12":[`pptm`],"application/vnd.ms-powerpoint.slide.macroenabled.12":[`sldm`],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":[`ppsm`],"application/vnd.ms-powerpoint.template.macroenabled.12":[`potm`],"application/vnd.ms-project":[`*mpp`,`mpt`],"application/vnd.ms-visio.viewer":[`vdx`],"application/vnd.ms-word.document.macroenabled.12":[`docm`],"application/vnd.ms-word.template.macroenabled.12":[`dotm`],"application/vnd.ms-works":[`wps`,`wks`,`wcm`,`wdb`],"application/vnd.ms-wpl":[`wpl`],"application/vnd.ms-xpsdocument":[`xps`],"application/vnd.mseq":[`mseq`],"application/vnd.musician":[`mus`],"application/vnd.muvee.style":[`msty`],"application/vnd.mynfc":[`taglet`],"application/vnd.nato.bindingdataobject+xml":[`bdo`],"application/vnd.neurolanguage.nlu":[`nlu`],"application/vnd.nitf":[`ntf`,`nitf`],"application/vnd.noblenet-directory":[`nnd`],"application/vnd.noblenet-sealer":[`nns`],"application/vnd.noblenet-web":[`nnw`],"application/vnd.nokia.n-gage.ac+xml":[`*ac`],"application/vnd.nokia.n-gage.data":[`ngdat`],"application/vnd.nokia.n-gage.symbian.install":[`n-gage`],"application/vnd.nokia.radio-preset":[`rpst`],"application/vnd.nokia.radio-presets":[`rpss`],"application/vnd.novadigm.edm":[`edm`],"application/vnd.novadigm.edx":[`edx`],"application/vnd.novadigm.ext":[`ext`],"application/vnd.oasis.opendocument.chart":[`odc`],"application/vnd.oasis.opendocument.chart-template":[`otc`],"application/vnd.oasis.opendocument.database":[`odb`],"application/vnd.oasis.opendocument.formula":[`odf`],"application/vnd.oasis.opendocument.formula-template":[`odft`],"application/vnd.oasis.opendocument.graphics":[`odg`],"application/vnd.oasis.opendocument.graphics-template":[`otg`],"application/vnd.oasis.opendocument.image":[`odi`],"application/vnd.oasis.opendocument.image-template":[`oti`],"application/vnd.oasis.opendocument.presentation":[`odp`],"application/vnd.oasis.opendocument.presentation-template":[`otp`],"application/vnd.oasis.opendocument.spreadsheet":[`ods`],"application/vnd.oasis.opendocument.spreadsheet-template":[`ots`],"application/vnd.oasis.opendocument.text":[`odt`],"application/vnd.oasis.opendocument.text-master":[`odm`],"application/vnd.oasis.opendocument.text-template":[`ott`],"application/vnd.oasis.opendocument.text-web":[`oth`],"application/vnd.olpc-sugar":[`xo`],"application/vnd.oma.dd2+xml":[`dd2`],"application/vnd.openblox.game+xml":[`obgx`],"application/vnd.openofficeorg.extension":[`oxt`],"application/vnd.openstreetmap.data+xml":[`osm`],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[`pptx`],"application/vnd.openxmlformats-officedocument.presentationml.slide":[`sldx`],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":[`ppsx`],"application/vnd.openxmlformats-officedocument.presentationml.template":[`potx`],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[`xlsx`],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":[`xltx`],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[`docx`],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":[`dotx`],"application/vnd.osgeo.mapguide.package":[`mgp`],"application/vnd.osgi.dp":[`dp`],"application/vnd.osgi.subsystem":[`esa`],"application/vnd.palm":[`pdb`,`pqa`,`oprc`],"application/vnd.pawaafile":[`paw`],"application/vnd.pg.format":[`str`],"application/vnd.pg.osasli":[`ei6`],"application/vnd.picsel":[`efif`],"application/vnd.pmi.widget":[`wg`],"application/vnd.pocketlearn":[`plf`],"application/vnd.powerbuilder6":[`pbd`],"application/vnd.previewsystems.box":[`box`],"application/vnd.procrate.brushset":[`brushset`],"application/vnd.procreate.brush":[`brush`],"application/vnd.procreate.dream":[`drm`],"application/vnd.proteus.magazine":[`mgz`],"application/vnd.publishare-delta-tree":[`qps`],"application/vnd.pvi.ptid1":[`ptid`],"application/vnd.pwg-xhtml-print+xml":[`xhtm`],"application/vnd.quark.quarkxpress":[`qxd`,`qxt`,`qwd`,`qwt`,`qxl`,`qxb`],"application/vnd.rar":[`rar`],"application/vnd.realvnc.bed":[`bed`],"application/vnd.recordare.musicxml":[`mxl`],"application/vnd.recordare.musicxml+xml":[`musicxml`],"application/vnd.rig.cryptonote":[`cryptonote`],"application/vnd.rim.cod":[`cod`],"application/vnd.rn-realmedia":[`rm`],"application/vnd.rn-realmedia-vbr":[`rmvb`],"application/vnd.route66.link66+xml":[`link66`],"application/vnd.sailingtracker.track":[`st`],"application/vnd.seemail":[`see`],"application/vnd.sema":[`sema`],"application/vnd.semd":[`semd`],"application/vnd.semf":[`semf`],"application/vnd.shana.informed.formdata":[`ifm`],"application/vnd.shana.informed.formtemplate":[`itp`],"application/vnd.shana.informed.interchange":[`iif`],"application/vnd.shana.informed.package":[`ipk`],"application/vnd.simtech-mindmapper":[`twd`,`twds`],"application/vnd.smaf":[`mmf`],"application/vnd.smart.teacher":[`teacher`],"application/vnd.software602.filler.form+xml":[`fo`],"application/vnd.solent.sdkm+xml":[`sdkm`,`sdkd`],"application/vnd.spotfire.dxp":[`dxp`],"application/vnd.spotfire.sfs":[`sfs`],"application/vnd.stardivision.calc":[`sdc`],"application/vnd.stardivision.draw":[`sda`],"application/vnd.stardivision.impress":[`sdd`],"application/vnd.stardivision.math":[`smf`],"application/vnd.stardivision.writer":[`sdw`,`vor`],"application/vnd.stardivision.writer-global":[`sgl`],"application/vnd.stepmania.package":[`smzip`],"application/vnd.stepmania.stepchart":[`sm`],"application/vnd.sun.wadl+xml":[`wadl`],"application/vnd.sun.xml.calc":[`sxc`],"application/vnd.sun.xml.calc.template":[`stc`],"application/vnd.sun.xml.draw":[`sxd`],"application/vnd.sun.xml.draw.template":[`std`],"application/vnd.sun.xml.impress":[`sxi`],"application/vnd.sun.xml.impress.template":[`sti`],"application/vnd.sun.xml.math":[`sxm`],"application/vnd.sun.xml.writer":[`sxw`],"application/vnd.sun.xml.writer.global":[`sxg`],"application/vnd.sun.xml.writer.template":[`stw`],"application/vnd.sus-calendar":[`sus`,`susp`],"application/vnd.svd":[`svd`],"application/vnd.symbian.install":[`sis`,`sisx`],"application/vnd.syncml+xml":[`xsm`],"application/vnd.syncml.dm+wbxml":[`bdm`],"application/vnd.syncml.dm+xml":[`xdm`],"application/vnd.syncml.dmddf+xml":[`ddf`],"application/vnd.tao.intent-module-archive":[`tao`],"application/vnd.tcpdump.pcap":[`pcap`,`cap`,`dmp`],"application/vnd.tmobile-livetv":[`tmo`],"application/vnd.trid.tpt":[`tpt`],"application/vnd.triscape.mxs":[`mxs`],"application/vnd.trueapp":[`tra`],"application/vnd.ufdl":[`ufd`,`ufdl`],"application/vnd.uiq.theme":[`utz`],"application/vnd.umajin":[`umj`],"application/vnd.unity":[`unityweb`],"application/vnd.uoml+xml":[`uoml`,`uo`],"application/vnd.vcx":[`vcx`],"application/vnd.visio":[`vsd`,`vst`,`vss`,`vsw`,`vsdx`,`vtx`],"application/vnd.visionary":[`vis`],"application/vnd.vsf":[`vsf`],"application/vnd.wap.wbxml":[`wbxml`],"application/vnd.wap.wmlc":[`wmlc`],"application/vnd.wap.wmlscriptc":[`wmlsc`],"application/vnd.webturbo":[`wtb`],"application/vnd.wolfram.player":[`nbp`],"application/vnd.wordperfect":[`wpd`],"application/vnd.wqd":[`wqd`],"application/vnd.wt.stf":[`stf`],"application/vnd.xara":[`xar`],"application/vnd.xfdl":[`xfdl`],"application/vnd.yamaha.hv-dic":[`hvd`],"application/vnd.yamaha.hv-script":[`hvs`],"application/vnd.yamaha.hv-voice":[`hvp`],"application/vnd.yamaha.openscoreformat":[`osf`],"application/vnd.yamaha.openscoreformat.osfpvg+xml":[`osfpvg`],"application/vnd.yamaha.smaf-audio":[`saf`],"application/vnd.yamaha.smaf-phrase":[`spf`],"application/vnd.yellowriver-custom-menu":[`cmp`],"application/vnd.zul":[`zir`,`zirz`],"application/vnd.zzazz.deck+xml":[`zaz`],"application/x-7z-compressed":[`7z`],"application/x-abiword":[`abw`],"application/x-ace-compressed":[`ace`],"application/x-apple-diskimage":[`*dmg`],"application/x-arj":[`arj`],"application/x-authorware-bin":[`aab`,`x32`,`u32`,`vox`],"application/x-authorware-map":[`aam`],"application/x-authorware-seg":[`aas`],"application/x-bcpio":[`bcpio`],"application/x-bdoc":[`*bdoc`],"application/x-bittorrent":[`torrent`],"application/x-blender":[`blend`],"application/x-blorb":[`blb`,`blorb`],"application/x-bzip":[`bz`],"application/x-bzip2":[`bz2`,`boz`],"application/x-cbr":[`cbr`,`cba`,`cbt`,`cbz`,`cb7`],"application/x-cdlink":[`vcd`],"application/x-cfs-compressed":[`cfs`],"application/x-chat":[`chat`],"application/x-chess-pgn":[`pgn`],"application/x-chrome-extension":[`crx`],"application/x-cocoa":[`cco`],"application/x-compressed":[`*rar`],"application/x-conference":[`nsc`],"application/x-cpio":[`cpio`],"application/x-csh":[`csh`],"application/x-debian-package":[`*deb`,`udeb`],"application/x-dgc-compressed":[`dgc`],"application/x-director":[`dir`,`dcr`,`dxr`,`cst`,`cct`,`cxt`,`w3d`,`fgd`,`swa`],"application/x-doom":[`wad`],"application/x-dtbncx+xml":[`ncx`],"application/x-dtbook+xml":[`dtb`],"application/x-dtbresource+xml":[`res`],"application/x-dvi":[`dvi`],"application/x-envoy":[`evy`],"application/x-eva":[`eva`],"application/x-font-bdf":[`bdf`],"application/x-font-ghostscript":[`gsf`],"application/x-font-linux-psf":[`psf`],"application/x-font-pcf":[`pcf`],"application/x-font-snf":[`snf`],"application/x-font-type1":[`pfa`,`pfb`,`pfm`,`afm`],"application/x-freearc":[`arc`],"application/x-futuresplash":[`spl`],"application/x-gca-compressed":[`gca`],"application/x-glulx":[`ulx`],"application/x-gnumeric":[`gnumeric`],"application/x-gramps-xml":[`gramps`],"application/x-gtar":[`gtar`],"application/x-hdf":[`hdf`],"application/x-httpd-php":[`php`],"application/x-install-instructions":[`install`],"application/x-ipynb+json":[`ipynb`],"application/x-iso9660-image":[`*iso`],"application/x-iwork-keynote-sffkey":[`*key`],"application/x-iwork-numbers-sffnumbers":[`*numbers`],"application/x-iwork-pages-sffpages":[`*pages`],"application/x-java-archive-diff":[`jardiff`],"application/x-java-jnlp-file":[`jnlp`],"application/x-keepass2":[`kdbx`],"application/x-latex":[`latex`],"application/x-lua-bytecode":[`luac`],"application/x-lzh-compressed":[`lzh`,`lha`],"application/x-makeself":[`run`],"application/x-mie":[`mie`],"application/x-mobipocket-ebook":[`*prc`,`mobi`],"application/x-ms-application":[`application`],"application/x-ms-shortcut":[`lnk`],"application/x-ms-wmd":[`wmd`],"application/x-ms-wmz":[`wmz`],"application/x-ms-xbap":[`xbap`],"application/x-msaccess":[`mdb`],"application/x-msbinder":[`obd`],"application/x-mscardfile":[`crd`],"application/x-msclip":[`clp`],"application/x-msdos-program":[`*exe`],"application/x-msdownload":[`*exe`,`*dll`,`com`,`bat`,`*msi`],"application/x-msmediaview":[`mvb`,`m13`,`m14`],"application/x-msmetafile":[`*wmf`,`*wmz`,`*emf`,`emz`],"application/x-msmoney":[`mny`],"application/x-mspublisher":[`pub`],"application/x-msschedule":[`scd`],"application/x-msterminal":[`trm`],"application/x-mswrite":[`wri`],"application/x-netcdf":[`nc`,`cdf`],"application/x-ns-proxy-autoconfig":[`pac`],"application/x-nzb":[`nzb`],"application/x-perl":[`pl`,`pm`],"application/x-pilot":[`*prc`,`*pdb`],"application/x-pkcs12":[`p12`,`pfx`],"application/x-pkcs7-certificates":[`p7b`,`spc`],"application/x-pkcs7-certreqresp":[`p7r`],"application/x-rar-compressed":[`*rar`],"application/x-redhat-package-manager":[`rpm`],"application/x-research-info-systems":[`ris`],"application/x-sea":[`sea`],"application/x-sh":[`sh`],"application/x-shar":[`shar`],"application/x-shockwave-flash":[`swf`],"application/x-silverlight-app":[`xap`],"application/x-sql":[`*sql`],"application/x-stuffit":[`sit`],"application/x-stuffitx":[`sitx`],"application/x-subrip":[`srt`],"application/x-sv4cpio":[`sv4cpio`],"application/x-sv4crc":[`sv4crc`],"application/x-t3vm-image":[`t3`],"application/x-tads":[`gam`],"application/x-tar":[`tar`],"application/x-tcl":[`tcl`,`tk`],"application/x-tex":[`tex`],"application/x-tex-tfm":[`tfm`],"application/x-texinfo":[`texinfo`,`texi`],"application/x-tgif":[`*obj`],"application/x-ustar":[`ustar`],"application/x-virtualbox-hdd":[`hdd`],"application/x-virtualbox-ova":[`ova`],"application/x-virtualbox-ovf":[`ovf`],"application/x-virtualbox-vbox":[`vbox`],"application/x-virtualbox-vbox-extpack":[`vbox-extpack`],"application/x-virtualbox-vdi":[`vdi`],"application/x-virtualbox-vhd":[`vhd`],"application/x-virtualbox-vmdk":[`vmdk`],"application/x-wais-source":[`src`],"application/x-web-app-manifest+json":[`webapp`],"application/x-x509-ca-cert":[`der`,`crt`,`pem`],"application/x-xfig":[`fig`],"application/x-xliff+xml":[`*xlf`],"application/x-xpinstall":[`xpi`],"application/x-xz":[`xz`],"application/x-zip-compressed":[`*zip`],"application/x-zmachine":[`z1`,`z2`,`z3`,`z4`,`z5`,`z6`,`z7`,`z8`],"audio/vnd.dece.audio":[`uva`,`uvva`],"audio/vnd.digital-winds":[`eol`],"audio/vnd.dra":[`dra`],"audio/vnd.dts":[`dts`],"audio/vnd.dts.hd":[`dtshd`],"audio/vnd.lucent.voice":[`lvp`],"audio/vnd.ms-playready.media.pya":[`pya`],"audio/vnd.nuera.ecelp4800":[`ecelp4800`],"audio/vnd.nuera.ecelp7470":[`ecelp7470`],"audio/vnd.nuera.ecelp9600":[`ecelp9600`],"audio/vnd.rip":[`rip`],"audio/x-aac":[`*aac`],"audio/x-aiff":[`aif`,`aiff`,`aifc`],"audio/x-caf":[`caf`],"audio/x-flac":[`flac`],"audio/x-m4a":[`*m4a`],"audio/x-matroska":[`mka`],"audio/x-mpegurl":[`m3u`],"audio/x-ms-wax":[`wax`],"audio/x-ms-wma":[`wma`],"audio/x-pn-realaudio":[`ram`,`ra`],"audio/x-pn-realaudio-plugin":[`rmp`],"audio/x-realaudio":[`*ra`],"audio/x-wav":[`*wav`],"chemical/x-cdx":[`cdx`],"chemical/x-cif":[`cif`],"chemical/x-cmdf":[`cmdf`],"chemical/x-cml":[`cml`],"chemical/x-csml":[`csml`],"chemical/x-xyz":[`xyz`],"image/prs.btif":[`btif`,`btf`],"image/prs.pti":[`pti`],"image/vnd.adobe.photoshop":[`psd`],"image/vnd.airzip.accelerator.azv":[`azv`],"image/vnd.blockfact.facti":[`facti`],"image/vnd.dece.graphic":[`uvi`,`uvvi`,`uvg`,`uvvg`],"image/vnd.djvu":[`djvu`,`djv`],"image/vnd.dvb.subtitle":[`*sub`],"image/vnd.dwg":[`dwg`],"image/vnd.dxf":[`dxf`],"image/vnd.fastbidsheet":[`fbs`],"image/vnd.fpx":[`fpx`],"image/vnd.fst":[`fst`],"image/vnd.fujixerox.edmics-mmr":[`mmr`],"image/vnd.fujixerox.edmics-rlc":[`rlc`],"image/vnd.microsoft.icon":[`ico`],"image/vnd.ms-dds":[`dds`],"image/vnd.ms-modi":[`mdi`],"image/vnd.ms-photo":[`wdp`],"image/vnd.net-fpx":[`npx`],"image/vnd.pco.b16":[`b16`],"image/vnd.tencent.tap":[`tap`],"image/vnd.valve.source.texture":[`vtf`],"image/vnd.wap.wbmp":[`wbmp`],"image/vnd.xiff":[`xif`],"image/vnd.zbrush.pcx":[`pcx`],"image/x-3ds":[`3ds`],"image/x-adobe-dng":[`dng`],"image/x-cmu-raster":[`ras`],"image/x-cmx":[`cmx`],"image/x-freehand":[`fh`,`fhc`,`fh4`,`fh5`,`fh7`],"image/x-icon":[`*ico`],"image/x-jng":[`jng`],"image/x-mrsid-image":[`sid`],"image/x-ms-bmp":[`*bmp`],"image/x-pcx":[`*pcx`],"image/x-pict":[`pic`,`pct`],"image/x-portable-anymap":[`pnm`],"image/x-portable-bitmap":[`pbm`],"image/x-portable-graymap":[`pgm`],"image/x-portable-pixmap":[`ppm`],"image/x-rgb":[`rgb`],"image/x-tga":[`tga`],"image/x-xbitmap":[`xbm`],"image/x-xpixmap":[`xpm`],"image/x-xwindowdump":[`xwd`],"message/vnd.wfa.wsc":[`wsc`],"model/vnd.bary":[`bary`],"model/vnd.cld":[`cld`],"model/vnd.collada+xml":[`dae`],"model/vnd.dwf":[`dwf`],"model/vnd.gdl":[`gdl`],"model/vnd.gtw":[`gtw`],"model/vnd.mts":[`*mts`],"model/vnd.opengex":[`ogex`],"model/vnd.parasolid.transmit.binary":[`x_b`],"model/vnd.parasolid.transmit.text":[`x_t`],"model/vnd.pytha.pyox":[`pyo`,`pyox`],"model/vnd.sap.vds":[`vds`],"model/vnd.usda":[`usda`],"model/vnd.usdz+zip":[`usdz`],"model/vnd.valve.source.compiled-map":[`bsp`],"model/vnd.vtu":[`vtu`],"text/prs.lines.tag":[`dsc`],"text/vnd.curl":[`curl`],"text/vnd.curl.dcurl":[`dcurl`],"text/vnd.curl.mcurl":[`mcurl`],"text/vnd.curl.scurl":[`scurl`],"text/vnd.dvb.subtitle":[`sub`],"text/vnd.familysearch.gedcom":[`ged`],"text/vnd.fly":[`fly`],"text/vnd.fmi.flexstor":[`flx`],"text/vnd.graphviz":[`gv`],"text/vnd.in3d.3dml":[`3dml`],"text/vnd.in3d.spot":[`spot`],"text/vnd.sun.j2me.app-descriptor":[`jad`],"text/vnd.wap.wml":[`wml`],"text/vnd.wap.wmlscript":[`wmls`],"text/x-asm":[`s`,`asm`],"text/x-c":[`c`,`cc`,`cxx`,`cpp`,`h`,`hh`,`dic`],"text/x-component":[`htc`],"text/x-fortran":[`f`,`for`,`f77`,`f90`],"text/x-handlebars-template":[`hbs`],"text/x-java-source":[`java`],"text/x-lua":[`lua`],"text/x-markdown":[`mkd`],"text/x-nfo":[`nfo`],"text/x-opml":[`opml`],"text/x-org":[`*org`],"text/x-pascal":[`p`,`pas`],"text/x-processing":[`pde`],"text/x-sass":[`sass`],"text/x-scss":[`scss`],"text/x-setext":[`etx`],"text/x-sfv":[`sfv`],"text/x-suse-ymp":[`ymp`],"text/x-uuencode":[`uu`],"text/x-vcalendar":[`vcs`],"text/x-vcard":[`vcf`],"video/vnd.dece.hd":[`uvh`,`uvvh`],"video/vnd.dece.mobile":[`uvm`,`uvvm`],"video/vnd.dece.pd":[`uvp`,`uvvp`],"video/vnd.dece.sd":[`uvs`,`uvvs`],"video/vnd.dece.video":[`uvv`,`uvvv`],"video/vnd.dvb.file":[`dvb`],"video/vnd.fvt":[`fvt`],"video/vnd.mpegurl":[`mxu`,`m4u`],"video/vnd.ms-playready.media.pyv":[`pyv`],"video/vnd.uvvu.mp4":[`uvu`,`uvvu`],"video/vnd.vivo":[`viv`],"video/x-f4v":[`f4v`],"video/x-fli":[`fli`],"video/x-flv":[`flv`],"video/x-m4v":[`m4v`],"video/x-matroska":[`mkv`,`mk3d`,`mks`],"video/x-mng":[`mng`],"video/x-ms-asf":[`asf`,`asx`],"video/x-ms-vob":[`vob`],"video/x-ms-wm":[`wm`],"video/x-ms-wmv":[`wmv`],"video/x-ms-wmx":[`wmx`],"video/x-ms-wvx":[`wvx`],"video/x-msvideo":[`avi`],"video/x-sgi-movie":[`movie`],"video/x-smv":[`smv`],"x-conference/x-cooltalk":[`ice`]};Object.freeze(rV);var iV={"application/andrew-inset":[`ez`],"application/appinstaller":[`appinstaller`],"application/applixware":[`aw`],"application/appx":[`appx`],"application/appxbundle":[`appxbundle`],"application/atom+xml":[`atom`],"application/atomcat+xml":[`atomcat`],"application/atomdeleted+xml":[`atomdeleted`],"application/atomsvc+xml":[`atomsvc`],"application/atsc-dwd+xml":[`dwd`],"application/atsc-held+xml":[`held`],"application/atsc-rsat+xml":[`rsat`],"application/automationml-aml+xml":[`aml`],"application/automationml-amlx+zip":[`amlx`],"application/bdoc":[`bdoc`],"application/calendar+xml":[`xcs`],"application/ccxml+xml":[`ccxml`],"application/cdfx+xml":[`cdfx`],"application/cdmi-capability":[`cdmia`],"application/cdmi-container":[`cdmic`],"application/cdmi-domain":[`cdmid`],"application/cdmi-object":[`cdmio`],"application/cdmi-queue":[`cdmiq`],"application/cpl+xml":[`cpl`],"application/cu-seeme":[`cu`],"application/cwl":[`cwl`],"application/dash+xml":[`mpd`],"application/dash-patch+xml":[`mpp`],"application/davmount+xml":[`davmount`],"application/dicom":[`dcm`],"application/docbook+xml":[`dbk`],"application/dssc+der":[`dssc`],"application/dssc+xml":[`xdssc`],"application/ecmascript":[`ecma`],"application/emma+xml":[`emma`],"application/emotionml+xml":[`emotionml`],"application/epub+zip":[`epub`],"application/exi":[`exi`],"application/express":[`exp`],"application/fdf":[`fdf`],"application/fdt+xml":[`fdt`],"application/font-tdpfr":[`pfr`],"application/geo+json":[`geojson`],"application/gml+xml":[`gml`],"application/gpx+xml":[`gpx`],"application/gxf":[`gxf`],"application/gzip":[`gz`],"application/hjson":[`hjson`],"application/hyperstudio":[`stk`],"application/inkml+xml":[`ink`,`inkml`],"application/ipfix":[`ipfix`],"application/its+xml":[`its`],"application/java-archive":[`jar`,`war`,`ear`],"application/java-serialized-object":[`ser`],"application/java-vm":[`class`],"application/javascript":[`*js`],"application/json":[`json`,`map`],"application/json5":[`json5`],"application/jsonml+json":[`jsonml`],"application/ld+json":[`jsonld`],"application/lgr+xml":[`lgr`],"application/lost+xml":[`lostxml`],"application/mac-binhex40":[`hqx`],"application/mac-compactpro":[`cpt`],"application/mads+xml":[`mads`],"application/manifest+json":[`webmanifest`],"application/marc":[`mrc`],"application/marcxml+xml":[`mrcx`],"application/mathematica":[`ma`,`nb`,`mb`],"application/mathml+xml":[`mathml`],"application/mbox":[`mbox`],"application/media-policy-dataset+xml":[`mpf`],"application/mediaservercontrol+xml":[`mscml`],"application/metalink+xml":[`metalink`],"application/metalink4+xml":[`meta4`],"application/mets+xml":[`mets`],"application/mmt-aei+xml":[`maei`],"application/mmt-usd+xml":[`musd`],"application/mods+xml":[`mods`],"application/mp21":[`m21`,`mp21`],"application/mp4":[`*mp4`,`*mpg4`,`mp4s`,`m4p`],"application/msix":[`msix`],"application/msixbundle":[`msixbundle`],"application/msword":[`doc`,`dot`],"application/mxf":[`mxf`],"application/n-quads":[`nq`],"application/n-triples":[`nt`],"application/node":[`cjs`],"application/octet-stream":[`bin`,`dms`,`lrf`,`mar`,`so`,`dist`,`distz`,`pkg`,`bpk`,`dump`,`elc`,`deploy`,`exe`,`dll`,`deb`,`dmg`,`iso`,`img`,`msi`,`msp`,`msm`,`buffer`],"application/oda":[`oda`],"application/oebps-package+xml":[`opf`],"application/ogg":[`ogx`],"application/omdoc+xml":[`omdoc`],"application/onenote":[`onetoc`,`onetoc2`,`onetmp`,`onepkg`,`one`,`onea`],"application/oxps":[`oxps`],"application/p2p-overlay+xml":[`relo`],"application/patch-ops-error+xml":[`xer`],"application/pdf":[`pdf`],"application/pgp-encrypted":[`pgp`],"application/pgp-keys":[`asc`],"application/pgp-signature":[`sig`,`*asc`],"application/pics-rules":[`prf`],"application/pkcs10":[`p10`],"application/pkcs7-mime":[`p7m`,`p7c`],"application/pkcs7-signature":[`p7s`],"application/pkcs8":[`p8`],"application/pkix-attr-cert":[`ac`],"application/pkix-cert":[`cer`],"application/pkix-crl":[`crl`],"application/pkix-pkipath":[`pkipath`],"application/pkixcmp":[`pki`],"application/pls+xml":[`pls`],"application/postscript":[`ai`,`eps`,`ps`],"application/provenance+xml":[`provx`],"application/pskc+xml":[`pskcxml`],"application/raml+yaml":[`raml`],"application/rdf+xml":[`rdf`,`owl`],"application/reginfo+xml":[`rif`],"application/relax-ng-compact-syntax":[`rnc`],"application/resource-lists+xml":[`rl`],"application/resource-lists-diff+xml":[`rld`],"application/rls-services+xml":[`rs`],"application/route-apd+xml":[`rapd`],"application/route-s-tsid+xml":[`sls`],"application/route-usd+xml":[`rusd`],"application/rpki-ghostbusters":[`gbr`],"application/rpki-manifest":[`mft`],"application/rpki-roa":[`roa`],"application/rsd+xml":[`rsd`],"application/rss+xml":[`rss`],"application/rtf":[`rtf`],"application/sbml+xml":[`sbml`],"application/scvp-cv-request":[`scq`],"application/scvp-cv-response":[`scs`],"application/scvp-vp-request":[`spq`],"application/scvp-vp-response":[`spp`],"application/sdp":[`sdp`],"application/senml+xml":[`senmlx`],"application/sensml+xml":[`sensmlx`],"application/set-payment-initiation":[`setpay`],"application/set-registration-initiation":[`setreg`],"application/shf+xml":[`shf`],"application/sieve":[`siv`,`sieve`],"application/smil+xml":[`smi`,`smil`],"application/sparql-query":[`rq`],"application/sparql-results+xml":[`srx`],"application/sql":[`sql`],"application/srgs":[`gram`],"application/srgs+xml":[`grxml`],"application/sru+xml":[`sru`],"application/ssdl+xml":[`ssdl`],"application/ssml+xml":[`ssml`],"application/swid+xml":[`swidtag`],"application/tei+xml":[`tei`,`teicorpus`],"application/thraud+xml":[`tfi`],"application/timestamped-data":[`tsd`],"application/toml":[`toml`],"application/trig":[`trig`],"application/ttml+xml":[`ttml`],"application/ubjson":[`ubj`],"application/urc-ressheet+xml":[`rsheet`],"application/urc-targetdesc+xml":[`td`],"application/voicexml+xml":[`vxml`],"application/wasm":[`wasm`],"application/watcherinfo+xml":[`wif`],"application/widget":[`wgt`],"application/winhlp":[`hlp`],"application/wsdl+xml":[`wsdl`],"application/wspolicy+xml":[`wspolicy`],"application/xaml+xml":[`xaml`],"application/xcap-att+xml":[`xav`],"application/xcap-caps+xml":[`xca`],"application/xcap-diff+xml":[`xdf`],"application/xcap-el+xml":[`xel`],"application/xcap-ns+xml":[`xns`],"application/xenc+xml":[`xenc`],"application/xfdf":[`xfdf`],"application/xhtml+xml":[`xhtml`,`xht`],"application/xliff+xml":[`xlf`],"application/xml":[`xml`,`xsl`,`xsd`,`rng`],"application/xml-dtd":[`dtd`],"application/xop+xml":[`xop`],"application/xproc+xml":[`xpl`],"application/xslt+xml":[`*xsl`,`xslt`],"application/xspf+xml":[`xspf`],"application/xv+xml":[`mxml`,`xhvml`,`xvml`,`xvm`],"application/yang":[`yang`],"application/yin+xml":[`yin`],"application/zip":[`zip`],"application/zip+dotlottie":[`lottie`],"audio/3gpp":[`*3gpp`],"audio/aac":[`adts`,`aac`],"audio/adpcm":[`adp`],"audio/amr":[`amr`],"audio/basic":[`au`,`snd`],"audio/midi":[`mid`,`midi`,`kar`,`rmi`],"audio/mobile-xmf":[`mxmf`],"audio/mp3":[`*mp3`],"audio/mp4":[`m4a`,`mp4a`,`m4b`],"audio/mpeg":[`mpga`,`mp2`,`mp2a`,`mp3`,`m2a`,`m3a`],"audio/ogg":[`oga`,`ogg`,`spx`,`opus`],"audio/s3m":[`s3m`],"audio/silk":[`sil`],"audio/wav":[`wav`],"audio/wave":[`*wav`],"audio/webm":[`weba`],"audio/xm":[`xm`],"font/collection":[`ttc`],"font/otf":[`otf`],"font/ttf":[`ttf`],"font/woff":[`woff`],"font/woff2":[`woff2`],"image/aces":[`exr`],"image/apng":[`apng`],"image/avci":[`avci`],"image/avcs":[`avcs`],"image/avif":[`avif`],"image/bmp":[`bmp`,`dib`],"image/cgm":[`cgm`],"image/dicom-rle":[`drle`],"image/dpx":[`dpx`],"image/emf":[`emf`],"image/fits":[`fits`],"image/g3fax":[`g3`],"image/gif":[`gif`],"image/heic":[`heic`],"image/heic-sequence":[`heics`],"image/heif":[`heif`],"image/heif-sequence":[`heifs`],"image/hej2k":[`hej2`],"image/ief":[`ief`],"image/jaii":[`jaii`],"image/jais":[`jais`],"image/jls":[`jls`],"image/jp2":[`jp2`,`jpg2`],"image/jpeg":[`jpg`,`jpeg`,`jpe`],"image/jph":[`jph`],"image/jphc":[`jhc`],"image/jpm":[`jpm`,`jpgm`],"image/jpx":[`jpx`,`jpf`],"image/jxl":[`jxl`],"image/jxr":[`jxr`],"image/jxra":[`jxra`],"image/jxrs":[`jxrs`],"image/jxs":[`jxs`],"image/jxsc":[`jxsc`],"image/jxsi":[`jxsi`],"image/jxss":[`jxss`],"image/ktx":[`ktx`],"image/ktx2":[`ktx2`],"image/pjpeg":[`jfif`],"image/png":[`png`],"image/sgi":[`sgi`],"image/svg+xml":[`svg`,`svgz`],"image/t38":[`t38`],"image/tiff":[`tif`,`tiff`],"image/tiff-fx":[`tfx`],"image/webp":[`webp`],"image/wmf":[`wmf`],"message/disposition-notification":[`disposition-notification`],"message/global":[`u8msg`],"message/global-delivery-status":[`u8dsn`],"message/global-disposition-notification":[`u8mdn`],"message/global-headers":[`u8hdr`],"message/rfc822":[`eml`,`mime`,`mht`,`mhtml`],"model/3mf":[`3mf`],"model/gltf+json":[`gltf`],"model/gltf-binary":[`glb`],"model/iges":[`igs`,`iges`],"model/jt":[`jt`],"model/mesh":[`msh`,`mesh`,`silo`],"model/mtl":[`mtl`],"model/obj":[`obj`],"model/prc":[`prc`],"model/step":[`step`,`stp`,`stpnc`,`p21`,`210`],"model/step+xml":[`stpx`],"model/step+zip":[`stpz`],"model/step-xml+zip":[`stpxz`],"model/stl":[`stl`],"model/u3d":[`u3d`],"model/vrml":[`wrl`,`vrml`],"model/x3d+binary":[`*x3db`,`x3dbz`],"model/x3d+fastinfoset":[`x3db`],"model/x3d+vrml":[`*x3dv`,`x3dvz`],"model/x3d+xml":[`x3d`,`x3dz`],"model/x3d-vrml":[`x3dv`],"text/cache-manifest":[`appcache`,`manifest`],"text/calendar":[`ics`,`ifb`],"text/coffeescript":[`coffee`,`litcoffee`],"text/css":[`css`],"text/csv":[`csv`],"text/html":[`html`,`htm`,`shtml`],"text/jade":[`jade`],"text/javascript":[`js`,`mjs`],"text/jsx":[`jsx`],"text/less":[`less`],"text/markdown":[`md`,`markdown`],"text/mathml":[`mml`],"text/mdx":[`mdx`],"text/n3":[`n3`],"text/plain":[`txt`,`text`,`conf`,`def`,`list`,`log`,`in`,`ini`],"text/richtext":[`rtx`],"text/rtf":[`*rtf`],"text/sgml":[`sgml`,`sgm`],"text/shex":[`shex`],"text/slim":[`slim`,`slm`],"text/spdx":[`spdx`],"text/stylus":[`stylus`,`styl`],"text/tab-separated-values":[`tsv`],"text/troff":[`t`,`tr`,`roff`,`man`,`me`,`ms`],"text/turtle":[`ttl`],"text/uri-list":[`uri`,`uris`,`urls`],"text/vcard":[`vcard`],"text/vtt":[`vtt`],"text/wgsl":[`wgsl`],"text/xml":[`*xml`],"text/yaml":[`yaml`,`yml`],"video/3gpp":[`3gp`,`3gpp`],"video/3gpp2":[`3g2`],"video/h261":[`h261`],"video/h263":[`h263`],"video/h264":[`h264`],"video/iso.segment":[`m4s`],"video/jpeg":[`jpgv`],"video/jpm":[`*jpm`,`*jpgm`],"video/mj2":[`mj2`,`mjp2`],"video/mp2t":[`ts`,`m2t`,`m2ts`,`mts`],"video/mp4":[`mp4`,`mp4v`,`mpg4`],"video/mpeg":[`mpeg`,`mpg`,`mpe`,`m1v`,`m2v`],"video/ogg":[`ogv`],"video/quicktime":[`qt`,`mov`],"video/webm":[`webm`]};Object.freeze(iV);var aV=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},oV,sV,cV,LMe=class{constructor(...e){oV.set(this,new Map),sV.set(this,new Map),cV.set(this,new Map);for(let t of e)this.define(t)}define(e,t=!1){for(let[n,r]of Object.entries(e)){n=n.toLowerCase(),r=r.map(e=>e.toLowerCase());let e=aV(this,cV,`f`).get(n);e||(e=new Set,aV(this,cV,`f`).set(n,e));let i=!0;for(let a of r){let r=a.startsWith(`*`);if(a=r?a.slice(1):a,e.add(a),i&&aV(this,sV,`f`).set(n,a),i=!1,r)continue;let o=aV(this,oV,`f`).get(a);if(o&&o!=n&&!t)throw Error(`"${n} -> ${a}" conflicts with "${o} -> ${a}". Pass \`force=true\` to override this definition.`);aV(this,oV,`f`).set(a,n)}}return this}getType(e){if(typeof e!=`string`)return null;let t=e.replace(/^.*[/\\]/s,``).toLowerCase(),n=t.replace(/^.*\./s,``).toLowerCase(),r=t.length<e.length;return!(n.length<t.length-1)&&r?null:aV(this,oV,`f`).get(n)??null}getExtension(e){return typeof e==`string`?(e=e?.split?.(`;`)[0],(e&&aV(this,sV,`f`).get(e.trim().toLowerCase()))??null):null}getAllExtensions(e){if(typeof e!=`string`)return null;e=e.split(`;`)[0].trim().toLowerCase();let t=aV(this,cV,`f`).get(e);return t?new Set(t):null}_freeze(){return this.define=()=>{throw Error(`define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances`)},Object.freeze(this),this}_getTestState(){return{types:aV(this,oV,`f`),extensions:aV(this,sV,`f`)}}};oV=new WeakMap,sV=new WeakMap,cV=new WeakMap;var lV=new LMe(iV,rV)._freeze(),uV=({libraryName:e=`default`,fieldConfig:t}={})=>{let n=$O.current,r=n?.media_library?.name??`default`,i=()=>{let n=t?.media_libraries?.[e];if(n!=null)return n;let i=t?.media_library;return i&&r===e&&(i.name===e||i.name===void 0)?i:void 0},a=n?.media_libraries?.[e]??(n?.media_library&&r===e?n.media_library:void 0),o=i(),s=aB(a,o);if(s===!1)return!1;if(e!=="default")return{...s};let c={...n?.media_libraries?.all,...a?a.config:void 0,...t?.media_libraries?.all,...o?o.config:void 0};return s?.config!==void 0||Object.keys(c).length>0?{...s,config:c}:{...s}},dV=[`avif`,`gif`,`heic`,`jpeg`,`png`,`webp`],RMe=[`image/heic`,`image/heif`],fV=dV.filter(e=>e!==`heic`).map(e=>`image/${e}`),pV=/\.(?:avif|gif|heic|heif|jfif|jpe?g|jpe|png|webp)$/i,mV=[`svg`],zMe=[`image/svg+xml`],BMe=/\.(?:svg)$/i,VMe=[...dV,...mV],hV=[...fV,...zMe],gV=[...hV,...RMe],HMe={avif:`AVIF`,gif:`GIF`,heic:`HEIC`,jpeg:`JPEG`,png:`PNG`,webp:`WebP`,svg:`SVG`},_V=e=>{let t=e===gV.join(`,`);if(t||e===hV.join(`,`))return VMe.filter(e=>t||e!==`heic`).map(e=>HMe[e])},UMe=[`webp`],vV=(e,t,n)=>[...n].every((n,r)=>e[t+r]===n.charCodeAt(0)),yV=e=>e&128?3*2**((e&7)+1):0,bV=(e,t)=>{let n=t;for(;n<e.length&&e[n]!==0;)n+=e[n]+1;return n+1},WMe=e=>{let t=13+yV(e[10]),n=0;for(;t<e.length;){let r=e[t];if(r===33)t=bV(e,t+2);else if(r===44){if(n+=1,n>1)return!0;t=bV(e,t+10+yV(e[t+9])+1)}else break}return!1},GMe=e=>vV(e,12,`VP8X`)&&!!(e[20]&2),KMe=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=8;for(;n+8<=e.length;){if(vV(e,n+4,`acTL`))return!0;if(vV(e,n+4,`IDAT`))return!1;n+=t.getUint32(n)+12}return!1},qMe=async(e,t)=>{if(t!==`gif`&&t!==`webp`&&t!==`png`)return!1;let n;try{n=new Uint8Array(await e.arrayBuffer())}catch{return!1}return t===`gif`?WMe(n):t===`webp`?GMe(n):KMe(n)},JMe=64,YMe=new Set([`heic`,`heix`,`heim`,`heis`,`hevc`,`hevx`,`hevm`,`hevs`,`mif1`,`msf1`]),XMe=new Set([`avif`,`avis`]),xV=(e,t,n=0)=>[...t].every((t,r)=>e[n+r]===t.charCodeAt(0)),SV=(e,t)=>String.fromCharCode(...e.subarray(t,t+4)),ZMe=e=>{if(e.length<12||SV(e,4)!==`ftyp`)return[];let t=new DataView(e.buffer,e.byteOffset).getUint32(0),n=Math.min(t,e.length),r=[SV(e,8)];for(let t=16;t+4<=n;t+=4)r.push(SV(e,t));return r},CV=async e=>{let t;try{t=new Uint8Array(await e.slice(0,JMe).arrayBuffer())}catch{return}if(t.length<12)return;if(xV(t,`ÿØÿ`))return`jpeg`;if(xV(t,`PNG`))return`png`;if(xV(t,`GIF8`))return`gif`;if(xV(t,`RIFF`)&&xV(t,`WEBP`,8))return`webp`;let n=ZMe(t);if(n.some(e=>XMe.has(e)))return`avif`;if(n.some(e=>YMe.has(e)))return`heic`},wV={},QMe=async e=>{if(e in wV)return wV[e];let t=`image/${e}`,n=new OffscreenCanvas(1,1);n.getContext(`2d`);let r=(await n.convertToBlob({type:t})).type===t;return wV[e]=r,r},$Me=e=>{let{data:t}=e.getContext(`2d`).getImageData(0,0,e.width,e.height);for(let e=3;e<t.length;e+=4)if(t[e]<255)return!0;return!1},TV=async(e,{format:t=`webp`,quality:n=85,nativeOnly:r=!1}={})=>{let i=`image/${t}`,a=await QMe(t);if(!a&&r)return e.convertToBlob({type:$Me(e)?`image/png`:`image/jpeg`,quality:n/100});if(!a&&UMe.includes(t)){let r=e.getContext(`2d`).getImageData(0,0,e.width,e.height);try{let e=(await dN(`@jsquash/${t}`,`encode.js?module`)).default,a=await e(r,{quality:n});return new Blob([a],{type:i})}catch{}}return e.convertToBlob({type:i,quality:n/100})},eNe=1e4,EV,DV=!1,OV,tNe=jL(1),nNe=()=>{let e=`${uN(`@discourse/heic`)}/index.js`;return`
|
||
import(${JSON.stringify(e)}).then(
|
||
({ decode }) => {
|
||
self.onmessage = async ({ data }) => {
|
||
try {
|
||
const { width, height, data: pixels } = await decode(data);
|
||
|
||
postMessage({ width, height, data: pixels }, [pixels.buffer]);
|
||
} catch (error) {
|
||
postMessage({ error: String(error?.message ?? error) });
|
||
}
|
||
};
|
||
|
||
postMessage({ ready: true });
|
||
},
|
||
(error) => postMessage({ error: String(error?.message ?? error) }),
|
||
);
|
||
`},kV=class extends Error{},rNe=()=>new Promise((e,t)=>{let n=new Blob([nNe()],{type:`text/javascript`}),r=URL.createObjectURL(n),i;try{i=new Worker(r,{type:`module`})}catch(e){URL.revokeObjectURL(r),t(new kV(`Failed to create a worker`,{cause:e}));return}let a=({data:n})=>{s(),n.ready?e(i):(i.terminate(),t(Error(n.error)))},o=e=>{s(),i.terminate(),t(new kV(e.message))},s=()=>{i.removeEventListener(`message`,a),i.removeEventListener(`error`,o),URL.revokeObjectURL(r)};i.addEventListener(`message`,a),i.addEventListener(`error`,o)}),iNe=()=>(clearTimeout(OV),EV??=rNe().catch(e=>{throw EV=void 0,e}),EV),aNe=async()=>{let e=await EV;EV=void 0,e?.terminate()},oNe=(e,t)=>new Promise((n,r)=>{let i=({data:e})=>{if(o(),OV=setTimeout(aNe,eNe),e.error)r(Error(e.error));else try{n(new ImageData(e.data,e.width,e.height))}catch(e){r(e)}},a=t=>{o(),EV=void 0,e.terminate(),r(Error(t.message))},o=()=>{e.removeEventListener(`message`,i),e.removeEventListener(`error`,a)};e.addEventListener(`message`,i),e.addEventListener(`error`,a),e.postMessage(t,[t])}),sNe=async e=>{let{decode:t}=await dN(`@discourse/heic`,`index.js`);return t(e)},cNe=async e=>{if(!DV){let t;try{t=await iNe()}catch(e){if(!(e instanceof kV))throw e;DV=!0}if(t)return oNe(t,e)}return sNe(e)},lNe=e=>tNe(async()=>cNe(await e.arrayBuffer())),AV=({format:e=`png`,quality:t=85,width:n=void 0,height:r=void 0,fit:i=`scale-down`,nativeOnly:a=!1}={})=>({format:e,quality:t,width:n,height:r,fit:i,nativeOnly:a}),uNe=({width:e,height:t},{width:n=e,height:r=t,fit:i=`scale-down`}={})=>{let a={scale:1,width:e,height:t};if(e===n&&t===r)return a;let o=e<=n&&t<=r,s=1,c=0,l=0;if(i===`scale-down`){if(o)return a;i=`contain`}return i===`contain`&&(s=Math.min(n/e,r/t),c=e*s,l=t*s),{scale:s,width:c,height:l}},jV=(e,t,n)=>{let{scale:r,width:i,height:a}=uNe(t,n);return e.width=i,e.height=a,{scale:r,width:i,height:a}},MV={format:`webp`,quality:85,width:512,height:512,fit:`contain`,nativeOnly:!0},dNe=async({blob:e})=>{let t=URL.createObjectURL(e),n=new Image;return new Promise((e,r)=>{n.addEventListener(`load`,()=>{e({source:n,naturalWidth:n.naturalWidth,naturalHeight:n.naturalHeight}),URL.revokeObjectURL(t)},{once:!0}),n.addEventListener(`error`,()=>{URL.revokeObjectURL(t),r(Error(`Failed to decode image`))},{once:!0}),n.src=t})},fNe=async({blob:e})=>{let t=URL.createObjectURL(e),n=document.createElement(`video`);return new Promise((e,r)=>{n.addEventListener(`canplay`,()=>{n.pause(),e({source:n,naturalWidth:n.videoWidth,naturalHeight:n.videoHeight}),URL.revokeObjectURL(t)},{once:!0}),n.addEventListener(`error`,()=>{document.body.removeChild(n),URL.revokeObjectURL(t),r(Error(`Failed to decode video`))},{once:!0}),n.muted=!0,n.autoplay=!0,n.playsInline=!0,n.style.opacity=`0`,n.style.pointerEvents=`none`,document.body.appendChild(n),n.src=t})},pNe=async e=>e.type.startsWith(`video/`)?fNe({blob:e}):dNe({blob:e}),mNe=async e=>{if(await CV(e)===`heic`)return createImageBitmap(await lNe(e))},NV=async(e,t={})=>{let{format:n,quality:r,width:i,height:a,fit:o,nativeOnly:s}=AV(t),c,l=0,u=0;try{c=await createImageBitmap(e)}catch{c=await mNe(e)}c?{width:l,height:u}=c:{source:c,naturalWidth:l,naturalHeight:u}=await pNe(e);let d=i??l,f=a??u,p=new OffscreenCanvas(512,512),m=p.getContext(`2d`);return jV(p,{width:l,height:u},{fit:o,width:d,height:f}),m.drawImage(c,0,0,p.width,p.height),c instanceof HTMLVideoElement?document.body.removeChild(c):`close`in c&&c.close(),TV(p,{format:n,quality:r,nativeOnly:s})},hNe=async e=>{let t=await e.text();try{let{optimize:n}=await dN(`svgo`,`dist/svgo.browser.js`),{data:r}=n(t);return new Blob([r],{type:e.type})}catch{}return e},PV=e=>typeof e==`string`&&e.trim()?e.trim():void 0,FV=({fieldConfig:e}={})=>{let t=uV({fieldConfig:e}),{max_file_size:n,multiple:r,slugify_filename:i,filename_template:a,transformations:o}=typeof t==`boolean`?{}:t?.config??{};return{enabled:t!==!1,config:{max_file_size:typeof n==`number`&&Number.isInteger(n)?n:1/0,multiple:typeof r==`boolean`&&r,slugify_filename:typeof i==`boolean`&&i,filename_template:PV(a),transformations:D(o)?o:void 0}}},IV=e=>e&&dV.includes(e)?e:void 0,gNe=async e=>{let[t,n]=e.type.split(`/`);if(t!==`image`&&!pV.test(e.name))return{};let r=IV(n);return{sourceFormat:IV(await CV(e))??r,declaredFormat:r}},LV=e=>!!(e?.heic??e?.raster_image),_Ne=e=>LV(e)?gV:hV,RV=({accept:e,image:t,transformations:n})=>e??(t?_Ne(n).join(`,`):void 0),zV=({name:e,type:t},n)=>xk({name:e,type:t||lV.getType(e)||``},(n??``).split(`,`).map(e=>e.trim()).filter(Boolean)),vNe=async(e,t)=>{let[n,r]=e.type.split(`/`);if(n===`image`&&r===`svg+xml`)return t.svg?.optimize?new File([await hNe(e)],e.name,{type:e.type}):e;let{sourceFormat:i,declaredFormat:a}=await gNe(e);if(!i)return e;let o=t,s=o[i]??(a?o[a]:void 0)??t.raster_image;if(!s||await qMe(e,i))return e;let{format:c=`webp`,quality:l=85,width:u,height:d}=s,f;try{f=await NV(e,{format:c,quality:l,width:u,height:d})}catch(t){if(i===`heic`)throw Error(`Failed to decode HEIC image`,{cause:t});return e}let[,p]=f.type.split(`/`),m=pV.test(e.name)?e.name.replace(pV,`.${p}`):`${e.name}.${p}`;return new File([f],m,{type:f.type})},BV=WO(``),VV=WO(),HV=WO(),UV=WO(),WV=e=>!!e&&e.internalPath!==void 0&&!e.entryRelative&&!e.hasTemplateTags,GV=(e,t)=>t===``?e:e.startsWith(`${t}/`)?e.slice(t.length+1):``,KV=(e,t)=>WV(e)?GV(t,e.internalPath):``,qV=(e,t=void 0)=>{if(t)return{folder:t,subfolderPath:KV(t,e)};let n=RB.current,r=n.find(({internalPath:t,collectionName:n})=>e===`-/all`?t===void 0&&n===void 0:t===e);if(r)return{folder:r,subfolderPath:``};let i=n.filter(t=>WV(t)&&(t.internalPath===``||e.startsWith(`${t.internalPath}/`))).sort((e,t)=>t.internalPath.length-e.internalPath.length)[0];return i?{folder:i,subfolderPath:KV(i,e)}:void 0},JV=KO(()=>{let e=BB.current;return WV(e)?pP([e.internalPath,BV.current]):void 0}),YV=KO(()=>EB(JV.current??``)),XV=({dirPath:e,paths:t})=>{let n=e?`${e}/`:``,r=new Set;return t.forEach(e=>{if(!e.startsWith(n))return;let t=e.indexOf(`/`,n.length);t>n.length&&r.add(e.slice(n.length,t))}),[...r].sort($E).map(t=>({name:t,path:pP([e,t])}))},ZV=({subfolders:e,fileNames:t,exclude:n=void 0,dirPath:r=void 0})=>[...e.map(({name:e})=>e).filter(e=>e!==n),...t,...r===void 0?[]:XV({dirPath:r,paths:RB.current.filter(({internalPath:e,hasTemplateTags:t})=>e&&!t).map(({internalPath:e})=>`${e}/`)}).map(({name:e})=>e)],QV=e=>ZV({subfolders:XV({dirPath:e,paths:[...qB.current,...nV.current].map(({path:e})=>e)}),fileNames:[],dirPath:e}),$V=e=>[...new Set([...tj.current.flatMap(({locales:e})=>Object.values(e).map(({path:e})=>e)),...nV.current.map(({path:e})=>e)].filter(t=>mP(t)===e).map(e=>e.slice(e.lastIndexOf(`/`)+1)))],eH=({rootLabel:e,subfolderNames:t,onBrowse:n})=>t.length?[...[e,...t.slice(0,-1)].map((e,r)=>({label:e,onClick:()=>{n({depth:r,path:t.slice(0,r).join(`/`)})}})),{label:t.at(-1)}]:[],tH=e=>qV(e)?.folder.internalPath,nH=({dirPath:e,assets:t})=>{let n=tH(e),r=nV.current.filter(({path:e})=>tH(mP(e))===n);return XV({dirPath:e,paths:[...t,...r].map(({path:e})=>e)})},rH=({dirPath:e,assets:t})=>t.filter(({path:t})=>mP(t)===e),iH=({folder:e,subfolderPath:t})=>e?.internalPath===void 0?void 0:pP([e.internalPath,t]),aH=e=>{let{slugify_filename:t}=FV().config,n=dP(e.trim());return t?iN(n,{fallback:!1}):n},yNe=({name:e,takenNames:t})=>{let n=e.trim();if(!n)return`empty`;let r=aH(n);if(!r||n.includes(`/`)||r.startsWith(`.`))return`invalid`;if(wMe(r))return`reserved`;let i=r.normalize().toLowerCase();return t.some(e=>e.normalize().toLowerCase()===i)?`duplicate`:void 0},bNe={hash:`svelte-mz75if`,code:`.picker-breadcrumb {flex:none;padding:0 8px 8px;.current {font-weight:var(--sui-font-weight-bold);}}`};function oH(e,t){k(t,!0),q(e,bNe);let n=Y(t,`onNavigate`,3,void 0),r=j(()=>eH({rootLabel:t.rootLabel,subfolderNames:t.path?t.path.split(`/`):[],onBrowse:({path:e})=>{n()?.(e)}}));var i=U(),a=F(i),o=e=>{bB(e,{class:`picker-breadcrumb`,get items(){return B(r)}})};K(a,e=>{B(r).length&&e(o)}),W(e,i),A()}var xNe=V(`<span role="none" class="icon check-background"><!></span>`),SNe=V(`<div role="none"><!></div>`),CNe={hash:`svelte-1fitgoo`,code:`.wrapper.svelte-1fitgoo {display:contents;[role='option'] {position:relative;& > .icon.check {display:none;}&[aria-selected='false'] {.check-background {border-color:var(--sui-checkbox-border-color);background-color:var(--sui-checkbox-background-color);.icon {display:none;}}}&[aria-selected='true'] {.check-background {border-color:var(--sui-primary-accent-color);color:var(--sui-primary-accent-color-inverted);background-color:var(--sui-primary-accent-color);}}.check-background {display:flex;justify-content:center;align-items:center;border-width:1px;border-radius:var(--sui-checkbox-border-radius);width:20px;height:20px;pointer-events:none;.icon {color:inherit !important;font-size:20px;}}}&.grid {.check-background {position:absolute;inset-block-start:8px;inset-inline-start:8px;z-index:1;}}&.list {.check-background {margin-inline-start:16px;}}}`};function sH(e,t){q(e,CNe);let n=Y(t,`viewType`,3,`grid`);var r=SNe();nu(P(r),{label:``,get"aria-label"(){return t.ariaLabel},get value(){return t.value},get selected(){return t.selected},get onChange(){return t.onChange},startIcon:e=>{var n=U(),r=F(n),i=e=>{var t=xNe();Lc(P(t),{name:`check`,class:`icon check`}),O(t),W(e,t)};K(r,e=>{t.multiple&&e(i)}),W(e,n)},children:(e,n)=>{var r=U();Uo(F(r),()=>t.children??jr),W(e,r)},$$slots:{startIcon:!0,default:!0}}),O(r),z(()=>rs(r,1,`wrapper ${n()??``}`,`svelte-1fitgoo`)),W(e,r)}var wNe=V(`<div role="none" class="wrapper svelte-umbokg"><!></div>`),TNe={hash:`svelte-umbokg`,code:`.wrapper.svelte-umbokg {display:contents;.listbox {gap:4px;border-width:0;.option {button {border-radius:var(--sui-control-medium-border-radius);padding:4px;width:100%;height:auto;transition:none;&:focus-visible {outline-color:transparent;}.preview {flex:none;border-radius:var(--sui-control-medium-border-radius);aspect-ratio:1 / 1;object-fit:contain;}}}.name {min-height:calc(var(--sui-font-size-default) * 2);white-space:normal;line-height:var(--sui-line-height-compact);}}.listbox.grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));.option {button {flex-direction:column;justify-content:flex-start;.preview {width:100%;height:auto;}.name {flex:none;margin:4px 0 12px;padding:0 8px;width:100%;min-height:calc(var(--sui-font-size-default) * 3);&:empty {display:none;}}}}button[aria-selected='true'] {outline-offset:-2px;outline-width:2px !important;outline-style:solid;outline-color:var(--sui-primary-accent-color-light);}}.listbox.list {.option {button {gap:16px;.preview {width:64px;}.name {flex:auto;padding-inline:0 8px;}}button[aria-selected='true'] {outline-offset:-2px;outline-width:2px !important;outline-style:solid;outline-color:var(--sui-primary-accent-color-light);}}}}`};function cH(e,t){k(t,!0),q(e,TNe);let n=Y(t,`viewType`,3,`grid`),r=Y(t,`gridId`,3,void 0),i=Y(t,`multiple`,3,!1),a=Y(t,`ariaLabel`,3,void 0),o=Y(t,`onChange`,3,void 0),s=Y(t,`children`,3,void 0);var c=wNe(),l=P(c);{let e=j(()=>a()??X(`assets_dialog.available_images`));eu(l,{get id(){return r()},get class(){return n()},get multiple(){return i()},get ariaLabel(){return B(e)},onChange:e=>{o()?.(e.detail)},children:(e,t)=>{var n=U();Uo(F(n),()=>s()??jr),W(e,n)},$$slots:{default:!0}})}O(c),W(e,c),A()}var ENe=()=>{let e=document.querySelector(`#page-container`);e instanceof HTMLElement&&(e.tabIndex=-1,e.focus())},lH=()=>{let e=document.activeElement;return()=>{e.isConnected&&e!==document.body&&!e.closest(`[inert]`)?e.focus():ENe()}},uH=({timeout:e=2e3}={})=>{let t=document.querySelector(`#page-container`);if(!(t instanceof HTMLElement))return;let n=performance.now(),r=()=>{let e=t.querySelector(`[role="grid"] [tabindex="0"]`);e instanceof HTMLElement?e.focus():(t.tabIndex=-1,t.focus())},i=()=>{let{activeElement:a}=document;if(a===document.body||a===t)r();else if(!t.contains(a))return;performance.now()-n<e&&window.requestAnimationFrame(i)};r(),window.requestAnimationFrame(i)},dH=async e=>{await ao();let t=e();t&&(t.tabIndex=0,t.focus())},DNe=(e,{timeout:t=2e3}={})=>{let n=performance.now(),r=()=>{let{activeElement:i}=document;if(i!==document.body&&i!==e)return;let a=e.querySelector(`[role="listbox"]`);a instanceof HTMLElement?a.focus():(i===document.body&&e.isConnected&&(e.tabIndex=-1,e.focus()),performance.now()-n<t&&window.requestAnimationFrame(r))};window.requestAnimationFrame(r)},ONe=e=>{},kNe=V(`<div role="none" class="wrapper svelte-82chpg"><!></div>`),ANe={hash:`svelte-82chpg`,code:`.wrapper.svelte-82chpg {display:contents;.listbox.subfolders {gap:4px;margin-bottom:8px;border-width:0;padding:0;min-width:0;background-color:transparent;&.grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));}.option button {border-radius:var(--sui-control-medium-border-radius);min-width:0;height:40px;.label {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}}}}`};function fH(e,t){k(t,!0),q(e,ANe);let n=Y(t,`viewType`,3,`grid`),r=Y(t,`onOpen`,3,void 0),i=Y(t,`multiple`,3,!1),a=Y(t,`selectedPaths`,19,()=>[]),o=Y(t,`onSelect`,3,void 0),s=M(void 0),c=!1,l=e=>{let t=B(s)?.closest(`[data-focus-scope]`),n=!!B(s)?.contains(document.activeElement);r()?.(e),n&&t instanceof HTMLElement&&DNe(t)},u=(e,t)=>{o()?!i()&&e.detail===1&&c&&o()(t,!1):l(t)},d=e=>{if(!o()||e.key!==`Enter`)return;let n=B(s)?.querySelector(`[role="option"].focused`)?.getAttribute(`data-value`),r=t.subfolders.find(e=>e.path===n);r&&(e.preventDefault(),e.stopPropagation(),l(r))};var f=kNe(),p=P(f);{let e=j(()=>!!o()&&i()),r=j(()=>X(`folders`));eu(p,{get class(){return`subfolders ${n()??``}`},get multiple(){return B(e)},get ariaLabel(){return B(r)},children:(e,n)=>{var r=U();Ro(F(r),17,()=>t.subfolders,e=>e.path,(e,t)=>{{let n=e=>{Lc(e,{name:`folder`})},r=j(()=>!!o()&&a().includes(B(t).path)),i=j(()=>X(`folder`)),s=j(()=>o()?void 0:ONe);nu(e,{get label(){return B(t).name},get value(){return B(t).path},get selected(){return B(r)},get"aria-description"(){return B(i)},get checkIcon(){return B(s)},onChange:e=>{o()?.(B(t),e.detail.selected)},onclickcapture:()=>{c=a().includes(B(t).path)},onclick:e=>{u(e,B(t))},ondblclick:()=>{o()&&l(B(t))},startIcon:n,$$slots:{startIcon:!0}})}}),W(e,r)},$$slots:{default:!0}})}O(f),ms(f,e=>N(s,e),()=>B(s)),go(`keydown`,f,d,!0),W(e,f),A()}var jNe=V(`<p role="alert" class="warning svelte-1py0tnw"> </p>`),MNe=V(`<p class="svelte-1py0tnw"> </p> <!> <div role="none" class="svelte-1py0tnw"><!></div> <div role="none" class="error svelte-1py0tnw"><!></div>`,1),NNe={hash:`svelte-1py0tnw`,code:`p.svelte-1py0tnw {margin:0 0 8px;}.warning.svelte-1py0tnw {color:var(--sui-warning-foreground-color);}div.svelte-1py0tnw {display:flex;align-items:center;gap:4px;}.error.svelte-1py0tnw {margin:0;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function pH(e,t){let n=Co();k(t,!0),q(e,NNe);let r=Y(t,`open`,15,!1),i=Y(t,`warning`,3,void 0),a=Y(t,`name`,3,``),o=Y(t,`onClose`,3,void 0),s=M(``),c=M(!1),l=j(()=>yNe({name:B(s),takenNames:t.takenNames})),u=j(()=>B(c)&&!!B(l)),d=j(()=>!!a()&&aH(B(s))===a());R(()=>{r()&&(N(s,a()),N(c,!1))});{let a=j(()=>!!B(l)||B(d));Pl(e,{get title(){return t.title},get okLabel(){return t.okLabel},get okDisabled(){return B(a)},onOk:()=>{t.onSubmit(aH(B(s)))},get onClose(){return o()},get open(){return r()},set open(e){r(e)},children:(e,r)=>{var a=MNe(),o=F(a),d=I(o,!0),f=L(o,2),p=e=>{var t=jNe(),n=I(t,!0);z(()=>G(n,i())),W(e,t)};K(f,e=>{i()&&e(p)});var m=L(f,2),h=P(m);{let e=j(()=>X(`new_folder_name`));Gl(h,{dir:`auto`,flex:!0,get ariaLabel(){return B(e)},get invalid(){return B(u)},get"aria-errormessage"(){return`${n}-error`},oninput:()=>{N(c,!0)},get value(){return B(s)},set value(e){N(s,e,!0)}})}O(m);var g=L(m,2),_=P(g),v=e=>{var t=H();z(e=>G(t,e),[()=>X(`new_folder_error.${B(l)}`)]),W(e,t)};K(_,e=>{B(u)&&e(v)}),O(g),z(()=>{G(d,t.description),J(g,`id`,`${n}-error`)}),W(e,a)},$$slots:{default:!0}})}A()}var PNe=(e,t)=>Tk.includes(e)?t[e]:void 0,FNe=e=>Object.hasOwn(Ok,e)?Qc(Ok[e].length):void 0,INe=(e,t)=>{if(e!==`slug`)return;let{type:n,isIndexFile:r,currentSlug:i,content:a,identifierField:o,collection:s}=t;if(n===`preview_path`&&r)return``;let c=i??ZL(a,{identifierField:o});return n===`preview_path`&&s?c===cA(s)?``:lA(s,c):c},LNe=(e,t,n,r=[],i=void 0)=>{if(!t)return``;switch(e){case`dirname`:return TP(t,{basePath:n,fullPathRegEx:i});case`filename`:case`extension`:return Ak(t,r)[e];default:return}},mH=({randomValues:e},t,n)=>e?mA(e,t,n):n(),hH=(e,t)=>{let{type:n,collection:r,content:i,entryFilePath:a,locale:o,dateTimeParts:s,basePath:c,fullPathRegEx:l,assetFileName:u}=t,d=PNe(e,s);if(d!==void 0)return d;let f=INe(e,t);if(f!==void 0)return f;if(Object.hasOwn(Ok,e))return mH(t,`${o}:${e}`,()=>FNe(e));if(u!==void 0&&(e===`filename`||e===`extension`))return bk(u)[e]??``;if(n===`preview_path`&&e===`locale`)return o;if(n===`preview_path`||n===`media_folder`){let t=LNe(e,a,c,jk(r),l);if(t!==void 0)return t;if(n===`media_folder`)return}let p=kk(e);return Object.hasOwn(i,p)?i[p]:void 0},gH=(e,t)=>{let{replaceSubContext:n,getFieldArgs:r}=t,{value:i,transformations:a}=IN(e),o=hH(i,n),s=RM(a,e=>String(hH(e,n)??``)),c=a.some(e=>e.args.defaultValue!==void 0),l=a.some(e=>zO.has(e.method)),u=o===void 0,{type:d,locale:f}=n,p=()=>{if(d===`preview_path`)throw Error(`Unresolvable template tag in preview path: ${i}`)},m=()=>(p(),mH(n,`${f}:fallback:${e}`,()=>Qc(`short`)));return u&&!c&&!l||(s.length&&(o=LN({fieldConfig:_M({...r,keyPath:kk(i)}),value:o,transformations:s,locale:f})),u&&!c&&o===``)?m():(o=tTe(String(o)),d?o:iN(o,{locale:f,maxLength:1/0,fallback:!1})||mH(n,`${f}:fallback:${e}`,()=>Qc(`short`)))},RNe=(e,{ignoreCase:t=!1}={})=>{let n=e.includes(`/`),r=e.replace(/^\//,``),i=``;for(let e=0;e<r.length;e+=1){let t=r[e];if(r.startsWith(`**/`,e))i+=`(?:.*/)?`,e+=2;else if(r.startsWith(`/**`,e)&&e+3===r.length)i+=`/.*`,e+=2;else if(t===`*`)i+=`[^/]*`;else if(t===`?`)i+=`[^/]`;else if(t===`[`&&r.indexOf(`]`,e+2)>0){let t=r.indexOf(`]`,e+2),n=r.slice(e+1,t).replace(/^!/,`^`).replaceAll(`\\`,`\\\\`);i+=`[${n}]`,e=t}else i+=t.replace(/[$()+.[\\\]^{|}]/,`\\$&`)}return RegExp(n?`^${i}$`:`(?:^|/)${i}$`,t?`i`:``)},zNe=(e,{ignoreCase:t=!1}={})=>e.split(/\r?\n/).flatMap(e=>{let[n,...r]=e.trim().split(/\s+/);if(!n||/^[#"]|^\[attr\]/.test(n)||n.endsWith(`/`))return[];let i=r.findLast(e=>/^[-!]?filter(?:=|$)/.test(e));return i?[{regex:RNe(n,{ignoreCase:t}),lfs:i===`filter=lfs`}]:[]}),BNe=async(e,t,{ignoreCase:n=!1}={})=>{let r=new Map,i=t=>{let i=r.get(t);return i||(i=e.readFile(t,{encoding:`utf8`}).then(e=>zNe(e,{ignoreCase:n}),()=>[]),r.set(t,i)),i};for(let e of t){let t=e.split(`/`),n=!1,r=[...t.map((e,n)=>{let r=t.slice(0,n).join(`/`);return{file:r?`${r}/.gitattributes`:`.gitattributes`,relativePath:t.slice(n).join(`/`)}}),{file:`.git/info/attributes`,relativePath:e}];for(let{file:e,relativePath:t}of r)for(let r of await i(e))r.regex.test(t)&&({lfs:n}=r);if(n)return e}},_H=[[`MERGE_HEAD`,`merge`],[`CHERRY_PICK_HEAD`,`cherry_pick`],[`REVERT_HEAD`,`revert`],[`rebase-merge`,`rebase`],[`rebase-apply`,`rebase`],[`sequencer`,`cherry_pick`]],VNe=`0`.repeat(40),vH=e=>typeof e==`string`?e.split(`/`).filter(e=>e&&e!==`.`).join(`/`):``,yH=()=>vH($O.current?.backend?.root_dir),bH=(e,t=yH())=>t?gP(`${t}/${e}`):e,xH=(e,t=yH())=>{if(!t)return e;if(e.startsWith(`${t}/`))return e.slice(t.length+1);let n=t.split(`/`),r=e.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)},SH=e=>!e.startsWith(`../`),CH=e=>{let t=yH();return t?e.map(({previousPath:e,...n})=>({...n,path:bH(n.path,t),...e!==void 0&&{previousPath:bH(e,t)}})):e},wH=e=>e?.name===`NotFoundError`,TH=e=>e?.name===`TypeMismatchError`,EH=e=>e.normalize(`NFC`)!==e.normalize(`NFD`),DH=(e,t)=>{if(e.includes(t))return t;let n=t.normalize();return e.find(e=>e.normalize()===n)},OH=async(e,t)=>{if(!EH(t))return t;try{return await e.getFileHandle(t),t}catch(e){if(TH(e))return t;if(!wH(e))throw e}return DH(await Array.fromAsync(e.keys()),t)??t},kH=async(e,t,n=`file`,{create:r=!0}={})=>{let i=XE(t??``),a=e;if(!i){if(n===`directory`)return a;throw Error(`Path is required for file handle retrieval`)}let o=i.split(`/`),s=o.length-1;for await(let[e,t]of o.entries()){let i=await OH(a,t);a=await(e===s&&n===`file`?a.getFileHandle(i,{create:r}):a.getDirectoryHandle(i,{create:r}))}return a},AH=(e,t)=>kH(e,t,`file`),jH=(e,t)=>kH(e,t,`directory`),MH=async(e,t)=>(await kH(e,t,`file`,{create:!1})).getFile(),NH=async(e,t)=>{try{return await MH(e,t)}catch(e){if(wH(e))return;throw e}},PH=async(e,{create:t=!1}={})=>kH(e,yH(),`directory`,{create:t}),HNe={NotFoundError:`ENOENT`,TypeMismatchError:`ENOTDIR`,InvalidModificationError:`ENOTEMPTY`},FH=(e,t)=>Object.assign(Error(`${e}: ${t}`),{code:e,path:t}),UNe=(e,t)=>{let n=HNe[e?.name];return n?FH(n,t):e},IH=e=>e.split(`/`).filter(e=>e&&e!==`.`),LH=async(e,t)=>{let n=e;for(let e of t)n=await n.getDirectoryHandle(e);return n},RH=async(e,t)=>{if(!t.length)return e;let n=await LH(e,t.slice(0,-1)),r=t.at(-1);try{return await n.getFileHandle(r)}catch(e){if(!TH(e))throw e;return n.getDirectoryHandle(r)}},WNe=async(e,t,n)=>{let r=await e.createWritable?.(n);if(!r)throw FH(`ENOTSUP`,t);return r},GNe=async e=>{let t=e.kind===`directory`,{size:n,lastModified:r}=t?{size:0,lastModified:0}:await e.getFile();return{mode:t?16384:33188,size:n,mtimeMs:r,ctimeMs:r,ino:0,uid:0,gid:0,dev:0,isFile:()=>!t,isDirectory:()=>t,isSymbolicLink:()=>!1}},KNe=(e,{Buffer:t})=>{let n=async(e,t)=>{try{return await t(IH(e))}catch(t){throw UNe(t,e)}},r=async t=>({parentHandle:await LH(e,t.slice(0,-1)),name:t.at(-1)}),i=async(e,t,n,r)=>{let i=await WNe(e,t,n);try{await r(i),await i.close()}catch(e){throw await i.abort().catch(()=>void 0),e}},a=t=>n(t,async t=>GNe(await RH(e,t)));return{readFile:(r,i)=>n(r,async n=>{let a=await RH(e,n);if(a.kind!==`file`)throw FH(`EISDIR`,r);let o=await a.getFile();return(typeof i==`string`?i:i?.encoding)===`utf8`?o.text():t.from(await o.arrayBuffer())}),writeFile:(e,t)=>n(e,async n=>{let{parentHandle:a,name:o}=await r(n),s=await a.getFileHandle(o,{create:!0});await i(s,e,void 0,async e=>{await e.write(t)})}),appendFile:(e,t)=>n(e,async n=>{let{parentHandle:a,name:o}=await r(n),s=await a.getFileHandle(o,{create:!0}),{size:c}=await s.getFile();await i(s,e,{keepExistingData:!0},async e=>{await e.write({type:`write`,position:c,data:t})})}),mkdir:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getDirectoryHandle(n,{create:!0})}),rmdir:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getDirectoryHandle(n),await t.removeEntry(n)}),unlink:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getFileHandle(n),await t.removeEntry(n)}),readdir:t=>n(t,async n=>{let r=await RH(e,n);if(r.kind!==`directory`)throw FH(`ENOTDIR`,t);let i=[];for await(let e of r.keys())i.push(e);return i}),stat:a,lstat:a,readlink:async e=>{throw FH(`ENOTSUP`,e)},symlink:async(e,t)=>{throw FH(`ENOTSUP`,t)}}},zH=e=>[`ENOENT`,`ENOTDIR`].includes(e?.code),BH=async(e,t)=>{try{return await e.stat(t),!0}catch(e){if(zH(e))return!1;throw e}},VH=new TextEncoder,HH=new TextDecoder,UH=(e,t)=>{let n=Math.min(e.length,t.length);for(let r=0;r<n;r+=1)if(e[r]!==t[r])return e[r]-t[r];return e.length-t.length},WH=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},GH=e=>Array.from(new Uint8Array(e),e=>e.toString(16).padStart(2,`0`)).join(``),KH=e=>Uint8Array.from(e.match(/../g)??[],e=>Number.parseInt(e,16)),qH=async(e,t)=>{let n=new TextEncoder,r=await crypto.subtle.importKey(`raw`,typeof e==`string`?n.encode(e):e,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),i=await crypto.subtle.sign(`HMAC`,r,n.encode(t));return new Uint8Array(i)},JH=62,qNe=e=>{let t=new Map,n=0,r=t=>{let r=e.indexOf(t,n),i=HH.decode(e.subarray(n,r));return n=r+1,i},i=a=>{let o=r(0),s=a?`${a}/${o}`:o,[c,l]=r(10).split(` `).map(Number);c>=0&&(t.set(s,GH(e.subarray(n,n+20))),n+=20);for(let e=0;e<l;e+=1)i(s)};return e.length&&i(void 0),t},JNe=e=>{let t=new DataView(e),n=new Uint8Array(e);if(HH.decode(n.subarray(0,4))!==`DIRC`)throw Error(`Invalid index file`);let r=t.getUint32(4),i=[],a=[];if(r!==2)return{version:r,entries:i,extensions:a};let o=t.getUint32(8),s=12;for(let e=0;e<o;e+=1){let e=t.getUint16(s+60),r=s+JH,a=(e&4095)<4095?e&4095:n.indexOf(0,r)-r,o=s+(JH+a+8&-8);i.push({path:HH.decode(n.subarray(r,r+a)),mode:t.getUint32(s+24),oid:GH(n.subarray(s+40,s+40+20)),stage:e>>12&3,raw:n.subarray(s,o)}),s=o}let c;for(;s<n.length-20;){let e=HH.decode(n.subarray(s,s+4)),r=t.getUint32(s+4);a.push(e),e===`TREE`&&(c=qNe(n.subarray(s+8,s+8+r))),s+=8+r}return{version:r,entries:i,extensions:a,...c?{cacheTree:c}:{}}},YNe=({extensions:e})=>e.some(e=>/^[a-z]/.test(e)),XNe=({path:e,mode:t,oid:n,size:r,mtimeMs:i})=>{let a=VH.encode(e),o=new Uint8Array(JH+a.length+8&-8),s=new DataView(o.buffer),c=Math.floor(i/1e3),l=Math.round((i-c*1e3)*1e6);return[0,8].forEach(e=>{s.setUint32(e,c%2**32),s.setUint32(e+4,l)}),s.setUint32(24,t),s.setUint32(36,r%2**32),o.set(KH(n),40),s.setUint16(60,Math.min(a.length,4095)),o.set(a,JH),{path:e,mode:t,oid:n,stage:0,raw:o}},ZNe=(e,t)=>UH(VH.encode(e),VH.encode(t)),YH=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1,a=ZNe(e[i].path,t);if(!a)return{position:i,found:!0};a<0?n=i+1:r=i}return{position:n,found:!1}},QNe=(e,{removedPaths:t,addedEntries:n})=>{let r=e.filter(({path:e})=>!t.has(e));return n.forEach(e=>{let{position:t,found:n}=YH(r,e.path);r.splice(t,+!!n,e)}),r},$Ne=e=>{let t=new Map,n=e=>{let r=e.entries.filter(({type:e})=>e!==`tree`).length;return e.subtrees.forEach(e=>{r+=n(e)}),t.set(e,r),r},r=[],i=(e,n)=>{r.push(VH.encode(`${n}\0${t.get(e)} ${e.subtrees.size}\n`),KH(e.oid)),e.subtrees.forEach((e,t)=>{i(e,t)})};return n(e),i(e,``),WH(r)},ePe=async(e,{tree:t}={})=>{let n=t?$Ne(t):void 0,r=e.reduce((e,{raw:t})=>e+t.length,12)+(n?8+n.length:0),i=new Uint8Array(r+20),a=new DataView(i.buffer),o=12;return i.set(VH.encode(`DIRC`)),a.setUint32(4,2),a.setUint32(8,e.length),e.forEach(({raw:e})=>{i.set(e,o),o+=e.length}),n&&(i.set(VH.encode(`TREE`),o),a.setUint32(o+4,n.length),i.set(n,o+8)),i.set(KH(await el(i.subarray(0,r))),r),i},XH={1:`commit`,2:`tree`,3:`blob`,4:`tag`},tPe=6,nPe=7,rPe=1e3,ZH=(e,t)=>WH([VH.encode(`${e} ${t.length}\0`),t]),iPe=(e,t)=>el(ZH(e,t)),QH=async e=>{let t=new Blob([e]).stream().pipeThrough(new DecompressionStream(`deflate`));return new Uint8Array(await new Response(t).arrayBuffer())},aPe=async e=>{let{readable:t,writable:n}=new CompressionStream(`deflate`),r=n.getWriter(),[,,i]=await Promise.all([r.write(e),r.close(),new Response(t).arrayBuffer()]);return new Uint8Array(i)},$H=async(e,t,n)=>{let r=ZH(t,n),i=await el(r),a=`.git/objects/${i.slice(0,2)}`,o=`${a}/${i.slice(2)}`,s=0;try{({size:s}=await e.stat(o))}catch(e){if(!zH(e))throw e}return s||(await e.mkdir(a),await e.writeFile(o,await aPe(r))),i},oPe=(e,t)=>{let n=0,r=()=>{let e=0,r=1,i;do i=t[n],n+=1,e+=(i&127)*r,r*=128;while(i&128);return e};if(r()!==e.length)throw Error(`Delta base size mismatch`);let i=new Uint8Array(r()),a=0;for(;n<t.length;){let r=t[n];if(n+=1,r&128){let o=0,s=0;for(let e=0;e<4;e+=1)r&1<<e&&(o+=t[n]*2**(8*e),n+=1);for(let e=0;e<3;e+=1)r&16<<e&&(s+=t[n]*2**(8*e),n+=1);s||=65536,i.set(e.subarray(o,o+s),a),a+=s}else if(r)i.set(t.subarray(n,n+r),a),n+=r,a+=r;else throw Error(`Invalid delta instruction`)}if(a!==i.length)throw Error(`Delta result size mismatch`);return i},sPe=e=>{let t=e.indexOf(0),[n,r]=HH.decode(e.subarray(0,t)).split(` `),i=e.subarray(t+1);if(!Object.values(XH).includes(n))throw Error(`Invalid object type: ${n}`);if(Number(r)!==i.length)throw Error(`Object size mismatch`);return{type:n,content:i}},cPe=e=>{let t=new DataView(e);if(t.getUint32(0)!==4285812579||t.getUint32(4)!==2)throw Error(`Unsupported pack index version`);let n=t.getUint32(1028),r=1032,i=r+n*20+n*4,a=i+n*4,o=Array.from({length:256},(e,n)=>t.getUint32(8+n*4)),s=new Float64Array(n);for(let e=0;e<n;e+=1){let n=t.getUint32(i+e*4);s[e]=n&2147483648?t.getUint32(a+(n&2147483647)*8)*2**32+t.getUint32(a+(n&2147483647)*8+4):n}return{fanout:o,oids:new Uint8Array(e,r,n*20),offsets:s}},lPe=({fanout:e,oids:t,offsets:n},r)=>{let i=r[0]?e[r[0]-1]:0,a=e[r[0]];for(;i<a;){let e=i+a>>>1,o=0;for(let n=0;n<20&&!o;n+=1)o=t[e*20+n]-r[n];if(!o)return n[e];o<0?i=e+1:a=e}},uPe=(e,t)=>{e.sortedOffsets??=Float64Array.from(e.index.offsets).sort();let{sortedOffsets:n}=e,r=0,i=n.length;for(;r<i;){let e=r+i>>>1;n[e]<=t?r=e+1:i=e}return r<n.length?n[r]:e.file.size-20},dPe=e=>{let t,n=async()=>{let t=[],n;try{n=await(await e.getDirectoryHandle(`objects`)).getDirectoryHandle(`pack`)}catch{return t}for await(let[e,r]of n.entries()){if(r.kind!==`file`||!e.endsWith(`.idx`))continue;let i=await r.getFile(),a=await n.getFileHandle(e.replace(/\.idx$/,`.pack`));t.push({index:cPe(await i.arrayBuffer()),file:await a.getFile()})}return t},r=async e=>{t??=n();let r=KH(e);for(let e of await t){let t=lPe(e.index,r);if(t!==void 0)return{pack:e,offset:t}}},i=async t=>{let n=await NH(e,`objects/${t.slice(0,2)}/${t.slice(2)}`);if(n)return sPe(await QH(new Uint8Array(await n.arrayBuffer())))},a=async(e,t,n)=>{if(n>rPe)throw Error(`Delta chain too long`);let r=uPe(e,t),i=new Uint8Array(await e.file.slice(t,r).arrayBuffer()),s=0,c=i[s],l=c>>4&7;for(;c&128;)s+=1,c=i[s];s+=1;let u;if(l===tPe){c=i[s],s+=1;let r=c&127;for(;c&128;)c=i[s],s+=1,r=(r+1)*128+(c&127);u=await a(e,t-r,n+1)}else if(l===nPe){let e=GH(i.subarray(s,s+20));if(s+=20,u=await o(e,n+1),!u)throw Error(`Delta base not found: ${e}`)}let d=await QH(i.subarray(s));if(u)return{type:u.type,content:oPe(u.content,d)};let f=XH[l];if(!f)throw Error(`Invalid packed object type: ${l}`);return{type:f,content:d}},o=async(e,t)=>{let n=await i(e);if(n)return n;let o=await r(e);return o?a(o.pack,o.offset,t):void 0};return{readObject:e=>o(e,0)}},fPe=e=>{let t=new Map(e.map(e=>[e,VH.encode(e.type===`tree`?`${e.path}/`:e.path)]));return e.toSorted((e,n)=>UH(t.get(e),t.get(n)))},eU=e=>WH(e.flatMap(({mode:e,path:t,oid:n})=>[VH.encode(`${e} ${t}\0`),KH(n)])),pPe=e=>{let t=new Map,n=0;for(;n<e.length;){let r=e.indexOf(32,n),i=e.indexOf(0,r);t.set(HH.decode(e.subarray(r+1,i)),{mode:HH.decode(e.subarray(n,r)),oid:GH(e.subarray(i+1,i+1+20))}),n=i+1+20}return t},mPe=e=>/^tree ([0-9a-f]{40})\n/.exec(HH.decode(e))?.[1],hPe=e=>{let t=e.split(`/`).slice(0,-1);return[``,...t.map((e,n)=>t.slice(0,n+1).join(`/`))]},tU=async(e,{previous:t,changedPaths:n=[],cacheTree:r}={})=>{let i=new Set(n.flatMap(hPe)),a={files:[],dirs:new Map};e.forEach(({path:e,mode:t,oid:n})=>{let r=e.split(`/`),i=r.pop(),o=a;r.forEach(e=>{let t=o.dirs.get(e);t||(t={files:[],dirs:new Map},o.dirs.set(e,t)),o=t}),o.files.push({mode:t.toString(8),path:i,oid:n,type:t===57344?`commit`:`blob`})});let o=async({files:e,dirs:t},n,a)=>{if(a&&!i.has(n))return a;let s=new Map(await Promise.all([...t].map(async([e,t])=>[e,await o(t,n?`${n}/${e}`:e,a?.subtrees.get(e))]))),c=fPe([...e,...[...s].map(([e,{oid:t}])=>({mode:`40000`,path:e,oid:t,type:`tree`}))]);return{oid:r?.get(n)??await iPe(`tree`,eU(c)),entries:c,subtrees:s}};return o(a,``,t)},nU=async(e,t,{readObject:n,writeTree:r})=>{if(e.oid===t)return;let i=t?await n(t):void 0,a=i?.type===`tree`?pPe(i.content):new Map;for(let[t,i]of e.subtrees){let e=a.get(t);await nU(i,e?.mode===`40000`?e.oid:void 0,{readObject:n,writeTree:r})}let o=await r(e.entries);if(o!==e.oid)throw Error(`Tree object ID mismatch: expected ${e.oid}, got ${o}`)},rU,iU=()=>{rU=void 0},gPe=e=>{rU=e},aU=e=>GH(e.subarray(-20)),oU=async(e,t,n)=>{try{return await e.resolveRef({fs:t,dir:`/`,ref:n})}catch(e){if(e?.code===`NotFoundError`)return;throw e}},_Pe=async(e,t)=>{if(rU?.checksum===t&&rU.tree)return rU.tree;let n=await tU(e.entries,{cacheTree:e.cacheTree});return rU={checksum:t,index:e,tree:n},n},vPe=async e=>{let t=await(await NH(e,`index`))?.arrayBuffer(),n=t?aU(new Uint8Array(t)):``;return rU?.checksum===n?{index:rU.index,buffer:t,checksum:n}:{index:t?JNe(t):{version:2,entries:[],extensions:[]},buffer:t,checksum:n}},yPe=async(e,t,n)=>t===`rebase-apply`&&await BH(e,`.git/rebase-apply/applying`)?`am`:t===`sequencer`&&await BH(e,`.git/sequencer/todo`)?(await e.readFile(`.git/sequencer/todo`,{encoding:`utf8`})).trimStart().startsWith(`revert`)?`revert`:`cherry_pick`:n,sU=e=>e===!0||/^(?:true|yes|on|[+-]?0*[1-9]\d*)$/i.test(String(e).trim()),bPe=async(e,t,n)=>{try{return sU(await e.getConfig({fs:t,dir:`/`,path:n}))}catch{return!1}},cU=async(e,{onLock:t}={})=>{let n;try{n=await e.getDirectoryHandle(`.git`)}catch(e){if(TH(e))return{ready:!1,reason:`unsupported_repository`};throw e}let r=await pN(`git`),i=KNe(e,{Buffer:r.Buffer}),[[a,o,s,c,l],u]=await Promise.all([Promise.all([`extensions.objectformat`,`extensions.refstorage`,`user.name`,`user.email`,`core.autocrlf`].map(e=>r.getConfig({fs:i,dir:`/`,path:e}))),bPe(r,i,`core.ignorecase`)]);if(a&&a!==`sha1`||o&&o!==`files`)return{ready:!1,reason:`unsupported_repository`};if(!s||!c)return{ready:!1,reason:`missing_identity`};let d={name:s,email:c};if(await BH(i,`.git/index.lock`))return{ready:!1,reason:`locked`,author:d};t&&(await i.writeFile(`.git/index.lock`,``),t(i));let f=await Promise.all(_H.map(([e])=>BH(i,`.git/${e}`))),p=_H.find((e,t)=>f[t]);if(p)return{ready:!1,reason:`operation_in_progress`,detail:await yPe(i,...p),author:d};let m=await r.currentBranch({fs:i,dir:`/`,fullname:!0});if(!m)return{ready:!1,reason:`detached_head`,author:d};let{index:h,buffer:g,checksum:_}=await vPe(n);if(h.version!==2||YNe(h))return{ready:!1,reason:`unsupported_repository`,author:d,branch:m};if(h.entries.some(({stage:e})=>e))return{ready:!1,reason:`operation_in_progress`,detail:`conflict`,author:d,branch:m};let v=dPe(n),y=await oU(r,i,m),b;if(y){let e=await v.readObject(y);if(b=e?.type===`commit`?mPe(e.content):void 0,!b)return{ready:!1,reason:`unsupported_repository`,author:d,branch:m}}let x=await _Pe(h,_);return(b?x.oid!==b:h.entries.length>0)?{ready:!1,reason:`staged_changes`,author:d,branch:m}:{ready:!0,author:d,branch:m,repository:{git:r,fs:i,gitDirHandle:n,reader:v,branch:m,author:d,headOid:y,headTreeOid:b,index:h,indexBuffer:g,indexTree:x,autocrlf:/^input$/i.test(String(l).trim())||sU(l),ignoreCase:u}}},lU=async(e,t,{concurrency:n=10}={})=>{let r=0,i=async()=>{for(;r<e.length;){let n=e[r];r+=1,await t(n)}};await Promise.all(Array(Math.min(n,e.length)).fill(void 0).map(()=>i()))},uU=async(e,t,n)=>{let r=Array(e.length);return await lU([...e.keys()],async n=>{r[n]=await t(e[n])},n),r},dU=class extends Error{},fU=(e,t,n)=>Error(e,{cause:new dU(n?X(t,{values:n}):X(t))}),pU=(e,t)=>e?.cause instanceof dU&&e.cause.message||X(t),mU=e=>fU(`Not a collaborator of the repository`,`repository_no_access`,{repo:e}),xPe=e=>fU(`Not a collaborator of the repository`,`repository_no_write_access`,{repo:e}),hU=(e,t)=>t?xPe(e):mU(e),gU=({owner:e,repo:t},n,{reportNotFound:r=!1}={})=>n===404&&r?fU(`Failed to check repository access`,`repository_not_found`,{repo:t}):n===401||n===403||n===404?mU(t):fU(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:`${e}/${t}`}),_U=[`decap-cms-user`,`netlify-cms-user`],vU=na({account:void 0});xa(()=>{R(()=>{let e=vU.account;(async()=>{try{e?await rD.set(`sveltia-cms.user`,e):e===null&&await rD.delete(`sveltia-cms.user`)}catch{}})()})});var yU={create:`Create {{collection}} “{{slug}}”`,update:`Update {{collection}} “{{slug}}”`,delete:`Delete {{collection}} “{{slug}}”`,uploadMedia:`Upload “{{path}}”`,deleteMedia:`Delete “{{path}}”`,openAuthoring:`{{message}}`},SPe=/\[(?:skip[ -](?:ci|actions)|(?:ci|actions)[ -]skip|no[ -]ci|cf-pages-skip)\]/i,CPe=e=>SPe.test(e),bU=(e,t)=>e.replace(/\{\{([\w-]+)\}\}/g,(e,n)=>Object.hasOwn(t,n)?t[n]:e),xU=()=>$O.current?.backend??{},SU=()=>{let{email:e=``,login:t=``,name:n=``}=vU.account;return{"author-email":e,"author-login":t,"author-name":n}},CU=(e,{commitType:t=`update`,collection:n},r=xU())=>{let{commit_messages:i={}}=r,[a=``]=e.map(e=>e.slug).filter(Boolean),[o,...s]=e.map(({path:e})=>e),c=n?XA(n,{useSingular:!0}):``,l=i[t]||yU[t]||``,u=SU();return[`create`,`update`,`delete`].includes(t)&&(l=bU(l,{slug:a,collection:c,path:o,...u})),[`uploadMedia`,`deleteMedia`].includes(t)&&(l=bU(l,{path:o,...u})),s.length&&(l+=` +${s.length}`),l},wPe=(e,t,n)=>{let r=t?.trim();return r?n===!0?r:n===`prefix`?`${r} ${e}`:n===`suffix`?`${e} ${r}`:e:e},wU=(e,t)=>{let{commitType:n=`update`,skipCI:r=void 0,userMessage:i}=t,a=xU(),{commit_messages:o={},skip_ci:s,automatic_deployments:c,prompt_commit_messages:l}=a,u=wPe(CU(e,t,a),i,l);return NB.current&&(u=bU(o.openAuthoring||yU.openAuthoring,{message:u,...SU()})),![`delete`,`deleteMedia`].includes(n)&&(r??(s===!0||c===!1))&&(u=`[skip ci] ${u}`),u},TPe=/^[A-Za-z0-9-]+:\s*\S/,TU=e=>(e??``).replace(/[\s<>]+/g,` `).trim(),EU=new WeakSet,DU=e=>{if(!xU().signoff_commits)return e;let{account:t}=vU,{email:n,login:r,name:i}=t,a=TU(n);if(!a)return EU.has(t)||(EU.add(t),console.warn("The `signoff_commits` option is enabled, but the Git host doesn’t share your email address, so commits are made without a `Signed-off-by` trailer.")),e;let o=TU(i)||TU(r)||a,s=e.trimEnd(),c=`<${a}>`.toLowerCase();if(s.split(/\r?\n/).some(e=>{let t=e.trim().toLowerCase();return t.startsWith(`signed-off-by:`)&&t.endsWith(c)}))return e;let l=s.split(/\r?\n\s*\r?\n/),u=l.at(-1);return`${s}${l.length>1&&u.split(/\r?\n/).every(e=>TPe.test(e))?`
|
||
`:`
|
||
|
||
`}Signed-off-by: ${o} <${a}>`},OU=e=>{let t=new Map;return e.forEach(e=>{t.has(e.sha)||t.set(e.sha,e)}),[...t.values()].sort((e,t)=>t.date.getTime()-e.date.getTime())},kU=(e,t)=>fU(`Failed to retrieve the last commit hash.`,e,t),AU=async(e,t)=>{let n=await t().catch(()=>void 0);if(n&&n.hash!==e)throw fU(`The branch has moved since the site data was loaded.`,`save_conflict.branch_moved`)},jU=async(e,t,n)=>OU((await uU(e,t)).flat().map(n)),MU=4,EPe=e=>{let t=new Map;return e.forEach(({path:e})=>{if(e===e.normalize())return;let n=e.split(`/`);n.forEach((e,r)=>{let i=n.slice(0,r+1).join(`/`);i!==i.normalize()&&t.set(i.normalize(),i)})}),e=>{let n=e.split(`/`);for(let e=n.length;e>0;--e){let r=t.get(n.slice(0,e).join(`/`));if(r)return[r,...n.slice(e)].join(`/`)}return e}},DPe=async(e,t,n)=>{if(!EH(n)||YH(t,n).found||await BH(e,n))return n;let r=[];for(let t of IH(n)){let i=DH(await e.readdir(r.join(`/`)),t);if(!i)return n;r.push(i)}return r.join(`/`)},NU=e=>e.filter(({action:e})=>[`create`,`update`,`move`].includes(e)).map(({path:e})=>e),OPe=e=>e.flatMap(({action:e,path:t,previousPath:n})=>e===`delete`?[t]:e===`move`&&n?[n]:[]),kPe=e=>{let t;try{t=new TextDecoder(`utf-8`,{fatal:!0}).decode(e)}catch{return e}return VH.encode(t.replaceAll(`\r
|
||
`,`
|
||
`))},APe=async({git:e,fs:t,index:n,autocrlf:r},i)=>(await uU(i,async i=>{let{position:a,found:o}=YH(n.entries,i);if(!o&&await e.isIgnored({fs:t,dir:`/`,filepath:i}))return;let{size:s,mtimeMs:c}=await t.stat(i),l=await t.readFile(i);return r&&(l=kPe(l)),XNe({path:i,mode:o&&n.entries[a].mode===33261?33261:33188,oid:await $H(t,`blob`,l),size:s,mtimeMs:c})},{concurrency:MU})).filter(Boolean),jPe=e=>{let t=Math.abs(e),n=String(Math.floor(t/60)).padStart(2,`0`);return`${e>0?`-`:`+`}${n}${String(t%60).padStart(2,`0`)}`},MPe=async(e,{branch:t,oldOid:n,newOid:r,signature:i,message:a})=>{let{name:o,email:s,timestamp:c,timezoneOffset:l}=i,u=n?`commit`:`commit (initial)`,d=a.split(`
|
||
`)[0],f=`${o} <${s}> ${c} ${jPe(l)}`,p=`${n??VNe} ${r} ${f}\t${u}: ${d}\n`;for(let n of[`.git/logs/HEAD`,`.git/logs/${t}`])await BH(e,n)&&await e.appendFile(n,p)},NPe=async(e,t,n)=>{let{git:r,fs:i,reader:a,branch:o,author:s,headOid:c,headTreeOid:l}=e,{index:u,indexTree:d}=e,f=EPe(u.entries),p=new Set(OPe(t).map(f)),m=await uU(NU(t),e=>DPe(i,u.entries,f(e)),{concurrency:MU}),h=await APe(e,m);if(h.length||u.entries.some(({path:e})=>p.has(e))){let e=QNe(u.entries,{removedPaths:p,addedEntries:h});d=await tU(e,{previous:d,changedPaths:[...p,...m]});let t=await ePe(e,{tree:d});await i.writeFile(`.git/index`,t),u={version:2,entries:e,extensions:[`TREE`]},gPe({checksum:aU(t),index:u,tree:d})}if(l?d.oid===l:!u.entries.length)return;if(await nU(d,l,{readObject:a.readObject,writeTree:e=>$H(i,`tree`,eU(e))}),await oU(r,i,o)!==c)throw Error(`The branch has been updated by another program.`);let g=Math.floor(Date.now()/1e3),_={...s,timestamp:g,timezoneOffset:new Date(g*1e3).getTimezoneOffset()},v=wU(t,n);return{oid:await r.commit({fs:i,dir:`/`,ref:o,message:v,tree:d.oid,author:_,committer:_}),signature:_,message:v}},PPe=async(e,t,n)=>{let{fs:r,indexBuffer:i,branch:a,headOid:o}=e,s;try{s=await NPe(e,t,n)}catch(e){throw i?await r.writeFile(`.git/index`,new Uint8Array(i)):await BH(r,`.git/index`)&&await r.unlink(`.git/index`),e}if(!s)return;let{oid:c,signature:l,message:u}=s;try{await MPe(r,{branch:a,oldOid:o,newOid:c,signature:l,message:u})}catch(e){console.error(e)}return{oid:c,date:new Date(l.timestamp*1e3)}},PU=WO(),FU=jL(1),IU=e=>{let{message:t,data:n}=Object(e);return n?.message??t??String(e)},FPe=e=>FU(async()=>{try{let{repository:t,...n}=await cU(e);return n}catch(e){return{ready:!1,reason:`error`,detail:IU(e)}}}),IPe=({repoRootDirHandle:e,changes:t,options:n,save:r})=>FU(async()=>{let i=CH(t),a;try{let t;try{if(t=await cU(e,{onLock:e=>{a=e}}),t.repository){let{fs:e,ignoreCase:n}=t.repository,r=await BNe(e,NU(i),{ignoreCase:n});r&&(t={ready:!1,reason:`lfs`,detail:r})}}catch(e){t={ready:!1,reason:`error`,detail:IU(e)}}let{repository:o,reason:s=`error`,detail:c}=t,l=await r();if(!o)return PU.current={reason:s,detail:c},l;try{let e=await PPe(o,i,n);return e?{...l,sha:e.oid,date:e.date}:l}catch(e){return console.error(e),PU.current={reason:`error`,detail:IU(e)},l}}finally{try{await a?.unlink(`.git/index.lock`)}catch{}}}),LU=[`image`,`video`,`audio`],RU=[`image`,`video`],zU=e=>/\.pdf$/i.test(e),BU=e=>RU.includes(e.kind)||zU(e.name),LPe=[...LU,`document`,`other`],RPe=/\.(?:csv|docx?|odp|ods|odt|pdf|pptx?|rtf|xlsx?)$/i,zPe=/^(?<type>image|video|audio)\//,VU=e=>LU.includes(e),HU=(e,t)=>{let n=lV.getType(t);return VU(e)||n===`application/pdf`||!!n&&yk(n)},UU=e=>HU(e.kind,e.path),WU=e=>{if(!e)return;let[t,n]=e.split(`/`);if(VU(t)&&n&&!n.startsWith(`x-`))return t},GU=e=>{if(e.startsWith(`data:`))return WU(e.slice(5).split(/[;,]/)[0]);if(QE(e)){let{hostname:t,pathname:n}=new URL(e);if(t.startsWith(`images.`))return`image`;e=n}return WU(lV.getType(e)??``)},BPe=async e=>{if(typeof e==`string`){if(!e.startsWith(`blob:`))return GU(e);try{return WU((await(await fetch(e)).blob()).type)}catch{return}}if(e instanceof Blob)return WU(e.type)},VPe=e=>{let t=lV.getType(e.path);return!!t&&yk(t)},KU=e=>lV.getType(e)?.match(zPe)?.groups?.type??(RPe.test(e)?`document`:`other`),HPe=e=>{let t=e.split(`/`),n=t.findIndex(e=>e.includes(`{{`));return(n===-1?t:t.slice(0,n)).join(`/`)},qU=(e,t)=>e===t||e.startsWith(`${t}/`),JU=()=>{let e=[],t=[];return ej.current.forEach(({filePathMap:n,folderPathMap:r})=>{n?e.push(...Object.values(n)):t.push(...Object.values(r??{}))}),RB.current.forEach(({internalPath:e})=>{e!==void 0&&t.push(e)}),{filePaths:e,folderPaths:t}},UPe=()=>{let{filePaths:e,folderPaths:t}=JU(),n=e.filter(e=>!e.includes(`{{`)),r=[...e.filter(e=>e.includes(`{{`)),...t].map(e=>HPe(XE(e)));if(r.some(e=>!e))return;let i=[...new Set(r)].filter(e=>!e.startsWith(`../`)).sort().filter((e,t,n)=>!n.slice(0,t).some(t=>qU(e,t)));return{dirs:i,files:[...new Set(n.map(e=>XE(e)))].filter(e=>!e.startsWith(`../`)&&!i.some(t=>qU(e,t)))}},WPe=6e4,GPe=jL(8),KPe=e=>e?cP(e,e=>Mk(e,`.+?`)):/^.+$/,qPe=e=>{let t=e.split(`/`).map(e=>Mk(e,`.+?`)).reduceRight((e,t,n)=>n===0?`${t}${e}`:`(?:\\/${t}${e})?`,``);return RegExp(`^${t}$`)},JPe=(e,t,n)=>t.some(t=>{let r=n.get(t);return r||(r=qPe(t),n.set(t,r)),r.test(e)}),YPe=async(e,t)=>{try{let{lastModified:n}=await t.getFile();Date.now()-n>=WPe&&await e.removeEntry(t.name)}catch{}},YU=async(e,t,n=``)=>{let{scanningPaths:r,scanningPathsRegEx:i,fileHandles:a,pathRegexCache:o}=t,s=[],c=[];await GPe(async()=>{for await(let[t,a]of e.entries()){if(t.startsWith(`.`)&&!tV.test(t)&&!(a.kind===`directory`&&r.some(e=>e.split(`/`).includes(t)))){a.kind===`file`&&t.startsWith(`.sveltia-tmp-`)&&await YPe(e,a);continue}let l=n?`${n}/${t}`:t,u=l.normalize(),d=i.some(e=>e.test(u));if(a.kind===`file`&&d&&s.push({handle:a,path:l}),a.kind===`directory`&&(d||JPe(u,r,o))){let e=[];s.push(e),c.push({handle:a,path:l,fileHandles:e})}}}),await Promise.all(c.map(({handle:e,path:n,fileHandles:r})=>YU(e,{...t,fileHandles:r},n))),s.forEach(e=>{(Array.isArray(e)?e:[e]).forEach(e=>{a.push(e)})})},XPe=()=>{let{filePaths:e,folderPaths:t}=JU();return bO([...e,...t].map(e=>XE(e).normalize()))},ZPe=async e=>{let t=[],n=XPe();return await YU(e,{rootDirHandle:e,scanningPaths:n,scanningPathsRegEx:n.map(KPe),fileHandles:t,pathRegexCache:new Map}),t.map(({handle:e,path:t})=>({handle:e,path:t.normalize(),name:e.name.normalize(),size:0,sha:``}))},XU=e=>(e.catch(()=>{}),e),ZU=e=>{let t=[],n=[],r=[],i=new Set;e.forEach(e=>{let{path:a,name:o}=e;if(o.startsWith(`.`))tV.test(o)&&r.push({...e,type:`config`});else{let[r]=$N(a);if(r){t.push({...e,type:`entry`,folder:r}),i.add(a);return}if(i.has(a)||YDe(a))return;let[o]=UB(a);o&&n.push({...e,type:`asset`,folder:o})}});let a=[...t,...n,...r];return{entryFiles:t,assetFiles:n,configFiles:r,allFiles:a,count:a.length}},QU=({entryFiles:e,assetFiles:t,configFiles:n})=>`${e.length} entry files, ${t.length} asset files, ${n.length} config files`,$U=e=>{let t=performance.now(),n=t;return(r,...i)=>{let a=performance.now(),o=Math.round(a-n),s=Math.round(a-t);n=a,console.debug(`[${e}] ${r} (+${o} ms, ${s} ms total)`,...i)}},QPe=10485760,eW=10,tW=async e=>{let{name:t,handle:n}=e;if(t===`.gitkeep`)return e;try{let r=await n.getFile();if(r.size>QPe)return console.warn(`File ${t} is too large (${r.size} bytes), skipping content read`),e;let i=await vSe(r);return{...e,text:i}}catch(t){return console.error(t),e}},$Pe=async(e,{cachedHashes:t,newHashes:n}={})=>{let{name:r,path:i,handle:a}=e,o=KU(r);try{let r=await a.getFile(),{size:s,lastModified:c}=r,l=t?.get(i),u;return l&&l.size===s&&l.lastModified===c?{sha:u}=l:(u=await bP(r),n?.set(i,{sha:u,size:s,lastModified:c})),{...e,kind:o,size:s,sha:u}}catch(t){return console.error(t),{...e,kind:o}}},eFe=async e=>{try{return new Map(await e?.entries()??[])}catch(e){return console.error(e),new Map}},tFe=async(e,{cachedHashes:t,newHashes:n,currentPaths:r})=>{if(!e)return;let i=[...t.keys()].filter(e=>!r.has(e));try{n.size&&await e.saveEntries([...n]),i.length&&await e.deleteEntries(i)}catch(e){console.error(e)}},nW=async(e,{hashCacheDB:t=null}={})=>{let n=$U(`Loading site data`);n(`Started: local repository ${e.name}`);let r=eFe(t),i=ZU(await ZPe(e)),{entryFiles:a,assetFiles:o,configFiles:s}=i;n(`Scanned the directory: ${QU(i)}`);let c=new Map,l=XU(r.then(e=>uU(o,t=>$Pe(t,{cachedHashes:e,newHashes:c}),{concurrency:eW}))),u=await uU(a,tW,{concurrency:eW});n(`Read ${u.length} entry files`);let d=await uU(s,tW,{concurrency:eW});n(`Read ${d.length} config files`);let{entries:f,errors:p}=await FL(u);n(`Parsed ${f.length} entries (${p.length} errors)`);let m=await l,h=await r;n(`Hashed ${c.size} of ${m.length} asset files (${h.size} cached)`),tj.current=f,qB.current=m,nV.current=d,rj.current=p,QA.current=!0,n(`The site data is ready`),await tFe(t,{cachedHashes:h,newHashes:c,currentPaths:new Set(o.map(({path:e})=>e))})},nFe=/^(.+\.)?localhost$/,rW=e=>[`127.0.0.1`,`[::1]`].includes(e)||nFe.test(e),iW=(e,t=globalThis.window?.location?.origin??globalThis.location?.origin??`https://localhost`)=>{try{let{hostname:n,protocol:r}=new URL(e,t);return r===`https:`||rW(n)}catch{return!1}},rFe=({method:e=`GET`,body:t})=>{if([`GET`,`HEAD`].includes(e.toUpperCase()))return!0;let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return!1}return D(n)&&typeof n.query==`string`&&!/^\s*(?:#[^\n]*\n\s*)*mutation\b/.test(n.query)},aW=async(e,t={},{responseType:n=`json`,refreshAccessToken:r=void 0,retries:i=1,retryable:a=rFe(t)}={})=>{let o,s=new Headers(t.headers);if(t.cache=`no-cache`,t.headers=s,s.has(`Authorization`)&&!iW(e))throw Error(`Refusing to send credentials over an insecure connection`);n===`json`&&s.set(`Accept`,`application/json`),D(t.body)&&(s.set(`Content-Type`,`application/json`),t.body=JSON.stringify(t.body));try{o=await fetch(e,t)}catch(e){throw Error(`Failed to send the request`,{cause:e})}let{ok:c,status:l}=o,u=async()=>{let[i]=s.get(`Authorization`)?.split(` `)??[`token`],{token:o}=await r();return s.set(`Authorization`,`${i} ${o}`),aW(e,t,{responseType:n,retryable:a})},d=async()=>(await Zc(1e3),aW(e,t,{responseType:n,refreshAccessToken:r,retries:i-1,retryable:a}));if(n===`raw`)return l===502&&i>0&&a?d():l===401&&r?u():o;let f;if(c)try{if(n===`blob`)return await o.blob();if(n===`text`)return await o.text();f=await o.json()}catch(e){throw Error(`Failed to parse the response`,{cause:e})}else try{f=await o.json()}catch{f=void 0}if(c&&!(e.endsWith(`/graphql`)&&D(f)&&f.errors))return f;if(l===502&&i>0&&a)return d();if(l===401&&r)return u();if(!D(f))throw Error(`Server responded with an error`,{cause:{status:l}});let p=``;throw typeof f.error==`string`&&(p=f.error),typeof f.message==`string`&&(p=f.message),Array.isArray(f.errors)&&(typeof f.errors[0]==`string`&&(p=f.errors.join(`, `)),D(f.errors[0])&&typeof f.errors[0].message==`string`&&(p=f.errors.map(e=>e.message).join(`, `))),Error(`Server responded with an error`,{cause:{status:l,message:p}})},oW=async(e,t,{allowNotFound:n=!1}={})=>{if(!e.ok&&!(n&&e.status===404)){let n=await e.text();throw Error(`${t}: ${n}`)}},sW=na({isLocalHost:!1,isLocalBackendSupported:!1,isTestBackendSupported:!0,isBrave:!1,isMacOS:!1,isSmallScreen:!1,isMediumScreen:!1,isLargeScreen:!1,hasMouse:!0}),iFe=()=>{let{location:{hostname:e},navigator:{userAgentData:t,platform:n},matchMedia:r}=globalThis;sW.isLocalHost=rW(e),sW.isLocalBackendSupported=`showDirectoryPicker`in globalThis,sW.isTestBackendSupported=!globalThis.FileSystemFileHandle||`createWritable`in globalThis.FileSystemFileHandle.prototype,sW.isBrave=t?.brands.some(({brand:e})=>e===`Brave`)??!1,sW.isMacOS=t?.platform===`macOS`||n.startsWith(`Mac`);let i=r(`(width < 768px)`),a=r(`(768px <= width < 1024px)`),o=r(`(1024px <= width)`),s=r(`(pointer: fine)`),c=()=>{sW.isSmallScreen=i.matches},l=()=>{sW.isMediumScreen=a.matches},u=()=>{sW.isLargeScreen=o.matches},d=()=>{sW.hasMouse=s.matches};c(),l(),u(),d(),i.addEventListener(`change`,c),a.addEventListener(`change`,l),o.addEventListener(`change`,u),s.addEventListener(`change`,d)},cW=e=>sW.isSmallScreen||sW.isMediumScreen||e.detail===0||e.pointerType===`touch`||!sW.hasMouse,aFe=3,oFe=150,lW=()=>`move`in FileSystemFileHandle.prototype&&!sW.isBrave,uW=async(e,t)=>{let n=await e.createWritable?.();try{await n?.write(t)}finally{try{await n?.close()}catch{}}},sFe=async({rootDirHandle:e,previousPath:t,path:n})=>{let{dirname:r,basename:i}=bk(n),{dirname:a}=bk(t),o=await AH(e,t);if(lW()){let t=await jH(e,r);return await o.move(t,await OH(t,i)),o}let s=await AH(e,n),c=await jH(e,a);return await uW(s,await o.getFile()),await c.removeEntry(o.name),s},cFe=async(e,t,n)=>{for(let r=1;;r+=1)try{await e.move(t,n);return}catch(e){if(r===aFe)throw e;await Zc(oFe*r)}},lFe=async({rootDirHandle:e,fileHandle:t,path:n,data:r})=>{let i;if(!t){if(lW()){let{dirname:r,basename:a}=bk(XE(n)),o=await jH(e,r);t=await o.getFileHandle(`.sveltia-tmp-${crypto.randomUUID()}`,{create:!0}),i={dirHandle:o,basename:a}}else t=await AH(e,n)}if(!i)return await uW(t,r),t.getFile();let{dirHandle:a,basename:o}=i;try{await uW(t,r),await cFe(t,a,await OH(a,o))}catch(e){try{await a.removeEntry(t.name)}catch{}throw e}return t.getFile()},uFe=async(e,t)=>{for(let n=t.length;n>0;--n){let r=t[n-1],i=t.slice(0,n-1).join(`/`);try{let t=await kH(e,i,`directory`,{create:!1}),n=await OH(t,r),a=await t.getDirectoryHandle(n);for await(let e of a.entries())return;await t.removeEntry(n)}catch(e){if(!wH(e))throw e}}},dFe=async({rootDirHandle:e,path:t})=>{let{dirname:n=``,basename:r}=bk(XE(t)),i=await jH(e,n);try{await i.removeEntry(await OH(i,r))}catch(e){if(!wH(e))throw e}},fFe=async(e,t)=>{for(let n of new Set(t))n&&await uFe(e,n.split(`/`))},pFe=async(e,{action:t,path:n,previousPath:r,data:i})=>{let a;return t===`move`&&r&&(a=await sFe({rootDirHandle:e,previousPath:r,path:n})),[`create`,`update`,`move`].includes(t)&&i!==void 0?lFe({rootDirHandle:e,fileHandle:a,path:n,data:i}):(t===`delete`&&await dFe({rootDirHandle:e,path:n}),null)},dW=({slug:e,data:t})=>e!==void 0||typeof t==`string`,fW=async(e,t)=>Promise.all(t.map(async t=>{let{path:n,data:r}=t,i=e?await pFe(e,t):null;if(!i){if(r===void 0)return null;i=_P(r)}return[n,{file:i,sha:await bP(i)}]})),pW=async(e,t)=>{let n=t.filter(e=>!dW(e)),r=t.filter(dW),i=[...await fW(e,n),...await fW(e,r)];return e&&await fFe(e,t.map(({action:e,path:t,previousPath:n})=>{if(e===`delete`)return t;if(e===`move`&&n)return n}).filter(e=>e!==void 0).map(e=>mP(XE(e)))),{sha:await bP(new Date().toJSON()),files:Object.fromEntries(i.filter(e=>!!e))}},mW={clientId:``,authScope:``,authURL:``,tokenURL:``,authScheme:`token`,restBaseURL:``,graphqlBaseURL:``,includeCredentials:!1},hW={},gW=async(e,t,{includeCredentials:n=!1}={})=>{if(iW(e))try{return await fetch(e,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(t),...n&&{credentials:`include`}})}catch{return}},_W=new Map,mFe=async({clientId:e,tokenURL:t,refreshToken:n})=>{let r=await gW(t,{grant_type:`refresh_token`,client_id:e,refresh_token:n},{includeCredentials:mW.includeCredentials});if(!r?.ok)throw Error(X(`sign_in_error.TOKEN_REFRESH_FAILED`));let i;try{i=await r.json()}catch{}if(!Jk(i?.access_token))throw Error(X(`sign_in_error.TOKEN_REFRESH_FAILED`));let a=i?.access_token;if(Jk(i?.refresh_token)&&(n=i?.refresh_token),vU.account){vU.account={...vU.account,token:a,refreshToken:n};try{await rD.set(`sveltia-cms.user`,vU.account)}catch{}}return{token:a,refreshToken:n}},hFe=({clientId:e,tokenURL:t,refreshToken:n})=>{let r=_W.get(n);return r||(r=mFe({clientId:e,tokenURL:t,refreshToken:n}).finally(()=>{_W.delete(n)}),_W.set(n,r)),r},gFe=`sveltia-cms.token-refresh`,_Fe=e=>{let t=globalThis.navigator?.locks;return t?t.request(gFe,e):e()},vW=e=>{let{account:t}=vU,n=Jk(e?.refreshToken)?e.refreshToken:void 0;if(t&&Jk(e?.token)&&e.backendName===t.backendName&&e.id===t.id&&(!t.refreshToken||n))return{token:e.token,refreshToken:n}},vFe=async()=>{try{return vW(await rD.get(`sveltia-cms.user`))}catch{return}},yW=(e,{token:t,refreshToken:n})=>!!e?.token&&e.token!==t&&e.refreshToken!==n;globalThis.addEventListener?.(`storage`,({key:e,newValue:t})=>{if(e!==`sveltia-cms.user`||!t)return;let n;try{n=JSON.parse(t)}catch{return}let r=vW(n),{account:i}=vU;r&&(r.token!==i.token||r.refreshToken!==i.refreshToken)&&(vU.account={...i,...r})});var bW=async(e,{method:t=`GET`,headers:n={},body:r=null,isGraphQL:i=!1,responseType:a=`json`,token:o=void 0,refreshToken:s=void 0,retryable:c=void 0}={})=>{let{clientId:l,tokenURL:u,restBaseURL:d,graphqlBaseURL:f,authScheme:p=`token`,includeCredentials:m}=mW,h=vU.account,g=i?f:d;o??=h?.token,s??=h?.refreshToken,n.Authorization=`${p} ${o}`;let _=!!h&&o===h.token&&s===h.refreshToken;return aW(`${g}${e}`,{method:t,headers:n,body:r,...m&&{credentials:`include`}},{responseType:a,retryable:c,refreshAccessToken:s?()=>_Fe(async()=>{if(_){let{account:e}=vU;if(e&&yW(e,{token:o,refreshToken:s}))return{token:e.token,refreshToken:e.refreshToken};let t=await vFe();if(t&&yW(t,{token:o,refreshToken:s}))return vU.account={...vU.account,...t},t}return hFe({clientId:l,tokenURL:u,refreshToken:s})}):void 0})},xW=async(e,t={},{retryable:n}={})=>{e=e.replace(/\n\s*/g,` `),Object.entries(hW).forEach(([n,r])=>{e.includes(`$${n}`)&&(t[n]??=r)});let{data:r}=await bW(``,{method:`POST`,body:{query:e,variables:t},isGraphQL:!0,retryable:n});return r},SW=na({current:void 0}),CW=na({}),wW=!1,TW=0,EW=na({current:void 0});xa(()=>{(async()=>{SW.current=void 0;try{let e=await rD.get(`sveltia-cms.prefs`),t=D(e)?e:{};t.apiKeys??={},t.useDraftBackup??=!0,t.closeOnSave??=!0,t.closeWithEscape??=!0,t.underlineLinks??=!0,t.devModeEnabled??=!1,t.localGitCommits??=!1,t.defaultTranslationService??=`google`,t.locale??=`auto`,t.locale===`en`&&(t.locale=`auto`),delete t.beta,Object.assign(CW,t)}catch{SW.current={type:`permission_denied`}}})(),R(()=>{if(!Object.keys(CW).length)return;let e=ai(CW);(async()=>{try{(0,Cr.default)(e,await rD.get(`sveltia-cms.prefs`))||await rD.set(`sveltia-cms.prefs`,e)}catch{}})();let{theme:t,underlineLinks:n=!0,devModeEnabled:r=!1}=CW,i=!t||t===`auto`,a=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;Object.assign(document.documentElement.dataset,{theme:i?a:t,autoTheming:i,underlineLinks:n,devMode:r})}),R(()=>{let{locale:e}=CW,t=e===`auto`?EW.current:e;if(!t||!pc.includes(t))return;let n=co(()=>Fc.current),r=wW&&e!==`auto`;wW=!0,TW+=1;let i=TW;Nc(t).then(()=>{i===TW&&(t in mc?Fc.set(t):r&&n&&(CW.locale=n))})})});var DW={service:``,label:``,owner:``,repo:``,branch:``,repoURL:``,treeBaseURL:``,blobBaseURL:``,isSelfHosted:!1,databaseName:``},yFe=/^(?<origin>(?:[a-z][a-z\d+.-]*:)?\/\/[^/]*)?(?<path>.*?)\/api(?:\/.*)?$/i,OW=e=>e===`https://api.github.com`?`https://github.com`:e.replace(yFe,`$<origin>$<path>`),bFe=(e,t)=>`${OW(e)}/${t}`,kW=({owner:e,repo:t})=>`/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,AW=(e,{owner:t,repo:n})=>typeof e==`string`&&e.toLowerCase()===`${t}/${n}`.toLowerCase(),jW=(e,t)=>`${kW(e)}/pulls/${t}`,MW=({tree:e,blob:t,commit:n})=>(r,i)=>({treeBaseURL:i?`${r}${e}/${oP(i)}`:r,blobBaseURL:i?`${r}${t}/${oP(i)}`:``,commitBaseURL:`${r}${n}`}),NW=(e,t,n)=>{let r=e(t,n),i=yH();return!i||!n?r:{...r,treeBaseURL:`${r.treeBaseURL}/${oP(i)}`,blobBaseURL:`${r.blobBaseURL}/${oP(i)}`}},xFe=(e,{service:t,label:n,owner:r,repo:i,branch:a,restApiRoot:o,defaultApiRoot:s,getTokenPageURL:c,getBaseURLs:l})=>{o=XE(o);let u=`${r}/${i}`,d=bFe(o,u),f=yH();return Object.assign(e,{service:t,label:n,owner:r,repo:i,branch:a,repoURL:d,tokenPageURL:c(OW(o)),databaseName:f?`${t}:${u}:${f}`:`${t}:${u}`,isSelfHosted:o!==s},NW(l,d,a)),CW.devModeEnabled&&console.info(`repositoryInfo`,e),e},PW=(e,{found:t,branch:n,getBaseURLs:r})=>{let{repo:i,repoURL:a=``}=e;if(!t)throw fU(`Failed to retrieve the default branch name.`,`repository_not_found`,{repo:i});if(!n)throw fU(`Failed to retrieve the default branch name.`,`repository_empty`,{repo:i});return Object.assign(e,{branch:n},NW(r,a,n)),n},FW={...DW},IW=new Map,LW,RW=MW({tree:`/src/branch`,blob:`/src/branch`,commit:`/commit`}),zW=()=>{let e=vU.account?.id;return IW.has(e)||IW.clear(),bA(IW,e,()=>bW(kW(FW)))},SFe=async()=>{let e=String(FW.branch),t=vU.account?.id,n=await bW(`${kW(FW)}/branches/${oP(e)}`);return LW={branch:e,userId:t,result:n},n},CFe=async()=>{let{repo:e}=FW,t;try{t=await zW()}catch(e){throw gU(FW,e?.cause?.status,{reportNotFound:!0})}if(!t.permissions?.push)throw hU(e,t.permissions?.pull)},wFe=async()=>{let{branch:e}=FW,t=LW;LW=void 0,await jB(e,async e=>{let n=t?.branch===e&&t.userId===vU.account?.id?t.result:await bW(`${kW(FW)}/branches/${oP(e)}`);return{canPush:n.user_can_push,canMerge:n.user_can_merge}})},BW=async()=>{let e=await zW().catch(()=>void 0);return PW(FW,{found:!!e,branch:e?.default_branch,getBaseURLs:RW})},VW=async({token:e,refreshToken:t},n,r)=>{let i=vU.account?.token,a=await bW(`/user`,{token:e,refreshToken:t}),o=vU.account;return o?.token&&o.token!==e&&o.token!==i&&(e=o.token,t=o.refreshToken),{backendName:n,id:a.id,name:a[r.name],login:a[r.login],email:a.email,avatarURL:a.avatar_url,profileURL:a[r.profileURL],bot:a.bot??!1,token:e,refreshToken:t}},TFe=e=>VW(e,FW.service,{name:`full_name`,login:`login`,profileURL:`html_url`}),HW=[`gitea`,`forgejo`],UW=e=>!!e&&HW.includes(e),WW=WO(!1),GW=WO(),KW=`sveltia-cms.auth`,qW=`sveltia-cms.auth-popup`,JW=e=>`sveltia-cms.auth.${e}`,YW=e=>`authorizing:${e}`,XW=(e,t,n)=>`authorization:${e}:${t}:${JSON.stringify(n)}`,EFe=(e,t)=>t.match(`^authorization:${e}:(success|error):(?<result>.+)`)?.groups?.result,DFe=()=>{try{return window.sessionStorage.getItem(qW)}catch{return null}},ZW=e=>{try{e?window.sessionStorage.setItem(qW,e):window.sessionStorage.removeItem(qW)}catch{}},QW=async()=>{ZW(),await rD.delete(KW)},$W=()=>Object.assign(Error(`Authentication aborted`),{name:`AbortError`}),eG=({authURL:e})=>{let{availHeight:t,availWidth:n}=window.screen,r=t/2-400,i=n/2-300;return window.open(e,`auth`,`width=600,height=800,top=${r},left=${i}`)},tG=async({backendName:e,authURL:t,popup:n,state:r})=>{let i=n??eG({authURL:t});if(!i)throw $W();return new Promise((n,a)=>{let o=new AbortController,s=e,c=r?new BroadcastChannel(JW(r)):void 0,l,u=()=>{o.abort(),clearInterval(l),c?.close(),GW.current=void 0},d=()=>{u(),i.close(),a($W())};(e===`github`||UW(e))&&(l=setInterval(()=>{i.closed&&d()},1e3));let f=e=>{let t=EFe(s,e),r;try{r=t?JSON.parse(t):{error:`No data`},D(r)||(r={error:`Malformed data`})}catch{r={error:`Malformed data`}}`token`in r?n(r):a(Error(`Authentication failed`,{cause:Error(r.errorCode?X(`sign_in_error.${r.errorCode}`,{default:r.error}):r.error)})),u(),i.close()};window.addEventListener(`message`,({origin:e,data:n,source:r})=>{r===i&&e===new URL(t).origin&&typeof n==`string`&&(n===YW(s)?i.postMessage(n,e):f(n))},{signal:o.signal}),c&&(c.onmessage=({data:e})=>{typeof e==`string`&&f(e)}),GW.current=d})},OFe=async({backendName:e,siteDomain:t,authURL:n,scope:r})=>{let{hostname:i}=window.location;t??=i===`localhost`?`cms.netlify.com`:i;try{new URL(n).origin===`https://api.netlify.com`&&(t=new URL(`https://${t}`).hostname)}catch{}return tG({backendName:e,authURL:`${n}?${new URLSearchParams({provider:e,site_id:t,scope:r})}`})},kFe=async()=>{let e=`${$c()}${$c()}`,t=btoa(await el(e,{algorithm:`SHA-256`,format:`binary`})).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);return{csrfToken:Qc().replaceAll(`-`,``),codeVerifier:e,codeChallenge:t}},AFe=async({backendName:e,clientId:t,authURL:n,scope:r})=>{let{origin:i,pathname:a}=window.location,o=`${i}${a}`,s=eG({authURL:o});if(!s)throw $W();let{csrfToken:c,codeVerifier:l,codeChallenge:u}=await kFe(),d=new URLSearchParams({client_id:t,redirect_uri:o,response_type:`code`,state:c,scope:r,code_challenge:u,code_challenge_method:`S256`});if(await rD.set(KW,{csrfToken:c,codeVerifier:l,realAuthURL:`${n}?${d}`}),await rD.set(`sveltia-cms.user`,{backendName:e}),s.closed)throw $W();try{return await tG({backendName:e,authURL:o,popup:s,state:c})}catch(e){throw await rD.delete(KW),e}},nG=({provider:e=`unknown`,state:t,token:n,refreshToken:r,error:i,errorCode:a})=>{let o=i?`error`:`success`,s=i?{provider:e,error:i,errorCode:a}:{provider:e,token:n,refreshToken:r};if(!window.opener){if(t){let n=new BroadcastChannel(JW(t));n.postMessage(XW(e,o,s)),n.close(),window.close()}return}let c=({data:t,origin:n,source:r})=>{r===window.opener&&n===window.location.origin&&t===YW(e)&&(window.opener?.postMessage(XW(e,o,s),n),window.removeEventListener(`message`,c))};window.addEventListener(`message`,c),window.opener?.postMessage(YW(e),window.location.origin)},jFe=async({backendName:e,apiConfig:t,code:n,state:r})=>{let{clientId:i,tokenURL:a,includeCredentials:o=!1}=t,{origin:s,pathname:c}=new URL(window.location.href),{csrfToken:l,codeVerifier:u}=await rD.get(KW)??{},d=e,f=`${s}${c}`;if(await QW(),!l||!u||r!==l)return nG({provider:d,state:r,error:X(`sign_in_error.CSRF_DETECTED`),errorCode:`CSRF_DETECTED`});let p=``,m=``,h=``,g=await gW(a,{grant_type:`authorization_code`,client_id:i,code:n,redirect_uri:f,code_verifier:u},{includeCredentials:o});if(!g)return nG({provider:d,state:r,error:X(`sign_in_error.TOKEN_REQUEST_FAILED`),errorCode:`TOKEN_REQUEST_FAILED`});try{({access_token:p,refresh_token:m,error:h}=await g.json())}catch{return nG({provider:d,state:r,error:X(`sign_in_error.MALFORMED_RESPONSE`),errorCode:`MALFORMED_RESPONSE`})}return nG({provider:d,state:r,token:p,refreshToken:m,error:h})},MFe=async({backendName:e,apiConfig:t})=>{WW.current=!0;let{search:n}=window.location,{code:r,state:i,error:a,error_description:o}=Object.fromEntries(new URLSearchParams(n));if(r&&i)await jFe({backendName:e,apiConfig:t,code:r,state:i});else if(a)await QW(),nG({provider:e,state:i,error:o||a,errorCode:`AUTH_CODE_REQUEST_FAILED`});else{let{csrfToken:e,realAuthURL:t}=await rD.get(KW)??{};t&&(ZW(e),window.location.href=t)}},NFe=()=>{try{if(window.opener)return window.opener.origin===window.location.origin&&window.name===`auth`}catch{return!1}let e=new URLSearchParams(window.location.search).get(`state`);return!!e&&e===DFe()},PFe=async({auto:e,apiConfig:t})=>{let{backend:n}=$O.current,{name:r,site_domain:i,auth_type:a}=n,{clientId:o,authScope:s,authURL:c}=t,l={backendName:r,authURL:c,scope:s};if(UW(r)||a===`pkce`){let n=NFe();return n&&await MFe({backendName:r,apiConfig:t}),n||e?void 0:AFe({...l,clientId:o})}if(!e)return OFe({...l,siteDomain:i})},FFe=async({options:{token:e,refreshToken:t,auto:n=!1},apiConfig:r})=>{if(!e){let i=await PFe({auto:n,apiConfig:r});if(!i)return;({token:e,refreshToken:t}=i)}return{token:e,refreshToken:t}},rG=async({options:e,getUserProfile:t})=>{let{token:n,refreshToken:r}=await FFe({options:e,apiConfig:mW})??{};if(n)return t({token:n,refreshToken:r})},iG=async()=>void 0,IFe=e=>`${e}/user/settings/applications`,LFe=e=>rG({options:e,getUserProfile:TFe}),aG={isForgejo:!1},RFe=28,zFe=async e=>{let{restBaseURL:t,includeCredentials:n}=mW;try{let e=new URL(`../forgejo/v1/version`,`${t}/`).href,{ok:r,status:i,redirected:a}=await aW(e,n?{credentials:`include`}:{},{responseType:`raw`});if(!a&&(r||i===404))return r}catch{}return e<RFe},oG=async()=>{let{version:e}=await bW(`/version`),t=Number.parseFloat(e),n=/\+gitea-/.test(e??``)||t>=2&&await zFe(t),r=n?`Forgejo`:`Gitea`,i=n?12:1.24;if(Object.assign(aG,{isForgejo:n}),Object.assign(FW,{label:r}),t<i)throw Error(`Unsupported ${r} version`,{cause:Error(X(`backend_unsupported_version`,{values:{name:r,version:i}}))})},sG=async(...e)=>{try{return await bW(...e)}catch(e){if(e?.cause?.status===404)return;throw e}},cG={attempts:10,interval:1e3},lG=async(e,t,{attempts:n,interval:r})=>{let i=await e();return t(i)||n<=1?i:(await Zc(r),lG(e,t,{attempts:n-1,interval:r}))},uG={interval:1e3,attempts:30},dG=e=>{let{backend:t}=$O.current??{};return!!t&&(Array.isArray(e)?e:[e]).includes(t.name)&&`open_authoring`in t&&t.open_authoring===!0},fG=({owner:e,repo:t})=>MB.current??{owner:e,repo:t},BFe=async({repoPath:e,allowForking:t})=>{if(!t)throw fU(`The repository does not allow forking`,`open_authoring.forking_disabled`,{repo:e});if(!await AMe(e))throw fU(`Permission to fork the repository was declined`,`open_authoring.fork_declined`)},pG=(e,t)=>(console.error(`Failed to fork the repository.`,t),fU(`Failed to fork the repository.`,`open_authoring.fork_failed`,{repo:e})),mG=async({repoPath:e,requestFork:t,requestRenamedFork:n,conflictStatuses:r,isNameTaken:i})=>{try{return await t()}catch(t){if(!r.includes(t.cause?.status)||!await i())throw pG(e,t)}try{return await n()}catch(t){throw pG(e,t)}},hG=async({repoPath:e,checkFork:t,attemptsLeft:n=uG.attempts})=>{let r=await lG(t,e=>e!==`pending`,{...uG,attempts:n});if(r!==`ready`)throw fU(r===`failed`?`The fork could not be created.`:`Timed out waiting for the fork to be created.`,`open_authoring.fork_failed`,{repo:e})},gG=async e=>{MB.current=void 0,PB.current=!1,await e(),PB.current=!0},_G=async e=>{let{repoPath:t,fetchAccess:n,prepare:r,fetchFork:i,prepareFork:a,fetchForkingAllowed:o}=e,s=await n();if(s.canWrite)return;await r?.();let c=await i();c?(await a?.(c),MB.current=c):(await BFe({repoPath:t,allowForking:await o(s)}),MB.current=await e.createFork())},vG=()=>{if(NB.current)throw fU(`Cannot publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},yG=({branch:e})=>{if(NB.current&&!e)throw fU(`Cannot commit directly to the configured repository`,`open_authoring.direct_commit_unsupported`)},VFe=e=>{if(e===`pending_publish`)throw fU(`Cannot mark an entry ready to publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},HFe=async({branch:e,mergedSHA:t,fetchBranchHead:n,deleteBranch:r})=>{let i=await n(e);if(!(i&&i!==t))throw i&&await r(e),fU(`entry_already_published`,`open_authoring.entry_already_published`)},bG=(e,t)=>{console.warn(`Failed to sync the ${IB(e)} fork with the upstream repository.`,t)},xG=e=>{console.warn(`The ${IB(e)} fork could not be fast-forwarded to the upstream repository.`)},SG=async(e,t,n)=>{let r=[],i=[];return e.forEach((e,n)=>{let a=t(e,n);`leftover`in a?r.push(a.leftover):i.push(a.pending)}),await lU(r,n),i},CG=async e=>{let{pullRequest:t,status:n,requestKey:r,createRequest:i,fetchRequest:a,applyStatus:o}=e,{fetchBranchHead:s,deleteBranch:c}=e;VFe(n);let{branch:l,title:u}=t;if(t[r]===void 0)return n===`draft`?{...t,status:n,updatedDate:new Date}:i({branch:l,title:u,status:n});let d=await a(t);if(d){let{merged:n,isEntryRequest:r,getMergedSHA:i}=d;if(n&&r&&await HFe({branch:l,mergedSHA:await i(),fetchBranchHead:s,deleteBranch:c}),n||!r)return CG({...e,pullRequest:{...t,number:void 0,nodeId:void 0,url:void 0}})}return await o({pullRequest:t,status:n,state:d?.state,draft:d?.draft}),{...t,status:n,updatedDate:new Date}},UFe=({commit:e,branch:t,title:n})=>({title:n,branch:t,status:`draft`,createdDate:e.date,updatedDate:e.date,files:[],canMerge:!1}),WFe=50,GFe=()=>dG(HW),wG=()=>fG(FW),TG=({full_name:e})=>{let[t,n]=e.split(`/`);return{owner:t,repo:n}},KFe=async()=>{let{owner:e,repo:t}=FW,n=`${e}/${t}`,r;try{r=await zW()}catch(e){throw[403,404].includes(e.cause?.status)?mU(n):fU(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:n})}return{canWrite:!!r.permissions?.push}},qFe=async()=>{let{repo:e}=FW,t=vU.account?.login,n=await sG(kW({owner:t,repo:e}));if(n&&n.fork&&AW(n.parent?.full_name,FW)&&n.owner?.login?.toLowerCase()===t.toLowerCase())return TG(n)},JFe=async()=>{let{id:e,login:t}=vU.account,{data:n=[]}=await bW(`/repos/search?uid=${e}&exclusive=true&mode=fork&limit=${WFe}`),r=n.find(e=>e.owner?.login===t&&AW(e.parent?.full_name,FW));return r?TG(r):void 0},YFe=async()=>await qFe()??JFe(),XFe=async()=>{if(!aG.isForgejo)return!0;try{let{forks_disabled:e}=await bW(`/settings/repository`);return!e}catch{return!0}},ZFe=async e=>{let t=vU.account?.login;return(await bW(kW({owner:t,repo:e}),{responseType:`raw`})).ok},QFe=async()=>{let{owner:e,repo:t}=FW,n=`${kW(FW)}/forks`;return TG(await mG({repoPath:`${e}/${t}`,requestFork:()=>bW(n,{method:`POST`,body:{}}),requestRenamedFork:()=>bW(n,{method:`POST`,body:{name:`${e}-${t}`}}),conflictStatuses:[409],isNameTaken:()=>ZFe(t)}))},$Fe=async({owner:e,repo:t},n)=>{let{allowed:r,fork_commit:i,base_commit:a}=await bW(`${kW({owner:e,repo:t})}/sync_fork/${oP(n)}`);return i&&i===a?`current`:r?`behind`:`diverged`},eIe=async e=>{let{branch:t}=FW,n;try{if(aG.isForgejo){let n=await $Fe(e,t);if(n===`current`)return;if(n===`diverged`){xG(e);return}}n=await bW(aG.isForgejo?`${kW(e)}/sync_fork/${oP(t)}`:`${kW(e)}/merge-upstream`,{method:`POST`,...aG.isForgejo?{}:{body:{branch:t}},responseType:`raw`})}catch(t){bG(e,t);return}n.ok||xG(e)},tIe=async({owner:e,repo:t})=>{let{branch:n}=FW;if(!(await bW(`${kW({owner:e,repo:t})}/branches/${oP(n)}`,{responseType:`raw`})).ok)throw fU(`The fork does not have the configured branch`,`open_authoring.fork_branch_missing`,{fork:`${e}/${t}`,branch:n,repo:`${FW.owner}/${FW.repo}`})},nIe=async()=>{let{owner:e,repo:t}=FW;await _G({repoPath:`${e}/${t}`,fetchAccess:KFe,prepare:async()=>{FW.branch||await BW()},fetchFork:YFe,prepareFork:async e=>{await eIe(e),await tIe(e)},fetchForkingAllowed:XFe,createFork:QFe})},rIe=async()=>{await gG(nIe)},EG=WO(``),DG={current:0},OG=()=>{let e=DG.current;return()=>e!==DG.current},kG=async()=>{let{repo:e,branch:t}=FW;try{let{commit:{id:e,message:t}}=await SFe();return{hash:e,message:t}}catch(n){throw n.cause?.status===404?kU(`branch_not_found`,{repo:e,branch:t}):n}},iIe=async({action:e,path:t,previousPath:n,previousSha:r},i)=>{if(e===`create`||r)return r;let a=kW(i?wG():FW),o=i??EG.current,s=e===`move`&&n||t;if(!o)throw Error(`The last known version of ${s} could not be determined.`);let{sha:c}=await bW(`${a}/contents/${oP(s)}?ref=${encodeURIComponent(o)}`);return c},AG=async(e,t)=>{yG(t);let n=kW(t.branch?wG():FW),{branch:r=FW.branch,startBranch:i}=t,a=DU(wU(e,t)),{name:o,email:s}=vU.account,c=new Date().toJSON(),l=await Promise.all(e.map(async e=>{let{action:n,path:r,previousPath:i,data:a=``}=e,[o,s]=await Promise.all([Sk(a),iIe(e,t.branch)]);return{operation:n===`move`?`update`:n,path:r,content:o,from_path:i,sha:s}})),u=t.branch?void 0:EG.current,d;try{d=await bW(`${n}/contents`,{method:`POST`,body:{...i?{branch:i,new_branch:r}:{branch:r},author:{name:o,email:s},committer:{name:o,email:s},dates:{author:c,committer:c},message:a,files:l},retryable:!0})}catch(e){throw u&&[409,422].includes(e.cause?.status)&&await AU(u,kG),e}let{commit:f,files:p}=d;return{sha:f.sha,date:new Date(f.created),parentSha:f.parents?.[0]?.sha,files:Object.fromEntries(p.map((t,n)=>[t?.path??e[n].path,{sha:t?.sha??``}]))}},aIe=10,oIe=async e=>{let{branch:t}=FW,n=[];for(let r=1;r<=aIe;r+=1){let i=await bW(`${kW(FW)}/commits?sha=${encodeURIComponent(t??``)}&path=${encodeURIComponent(e)}&limit=100&page=${r}`,{responseType:`raw`});if(!i.ok)throw Error(`Server responded with an error`,{cause:{status:i.status}});if(n.push(...await i.json()),i.headers.get(`X-HasMore`)!==`true`||n.length>=100)break}return n.slice(0,100)},sIe=async e=>jU(e,oIe,e=>({sha:e.sha,message:(e.commit?.message??``).split(/\r?\n/)[0],authorName:e.commit?.author?.name??``,authorEmail:e.commit?.author?.email,authorAvatarURL:e.author?.avatar_url,authorLogin:e.author?.login,date:new Date(e.commit?.author?.date??e.created)})),jG=({name:e,base_url:t,api_root:n})=>t??(e===`forgejo`&&n?OW(n):`https://gitea.com`),MG=/netlify|vercel|cloudflare|workers|deploy|preview|pages|render|surge|amplify|firebase/i,cIe=/prod/i,lIe=/canceled|cancelled|skipped|no (?:changes|build)/i,uIe={deployment:2,status:1,check:0},dIe=()=>{let{backend:e}=$O.current??{};return(e??{}).preview_context??``},NG=e=>{if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.protocol===`https:`)return t.href.replace(/\/$/,``)},fIe=(e,t)=>{if(!e)return;let n=``;try{n=new URL(t??``).host}catch{}return(e.match(/https:\/\/[^\s"'<>)\]]+/g)??[]).map(e=>NG(e)).find(e=>!!e&&new URL(e).host!==n)},pIe=(e,t)=>{try{return new URL(e).host===new URL(t).host}catch{return!1}},PG=({name:e,source:t},n)=>!!n||t===`deployment`||MG.test(e),mIe=(e,t)=>e.source!==`check`||PG(e,t),hIe=(e,{kind:t,previewContext:n})=>{let{name:r,url:i,state:a,source:o}=e,s=cIe.test(r);return(PG(e,n)?0:-64)+(i?32:0)+(a===`ready`?16:0)+uIe[o]*4+(t===`production`===s?2:0)+ +!!MG.test(r)},gIe=(e,{kind:t,selfURL:n})=>{let r=dIe(),i=e;if(r){let e=r.toLowerCase(),t=i.filter(({name:t})=>t.toLowerCase()===e);i=t.length?t:i.filter(({name:t})=>t.toLowerCase().includes(e))}if(i=i.filter(({description:e})=>!e||!lIe.test(e)),i=i.map(e=>({...e,url:e.state===`ready`&&mIe(e,r)&&!pIe(e.url,n)?NG(e.url):void 0})),!i.length)return{state:`unknown`,checkedTime:Date.now()};let[a]=i.map((e,n)=>({candidate:e,index:n,score:hIe(e,{kind:t,previewContext:r})})).sort((e,t)=>t.score-e.score||t.index-e.index).map(({candidate:e})=>e);return{state:a.state,url:a.url,context:a.name,checkedTime:Date.now()}},FG=async e=>{try{await e()}catch(e){console.warn(`Failed to fetch the deployment info.`,e)}},IG=async(e,{collect:t,selfURL:n})=>{let r=e.filter(({sha:e})=>!!e),i=[...new Set(r.map(({sha:e})=>e))];if(!i.length)return{};let a=Object.fromEntries(i.map(e=>[e,[]]));return await t(i,a),Object.fromEntries(r.map(({sha:e,kind:t})=>[e,gIe(a[e],{kind:t,selfURL:n})]))},_Ie=50,vIe={success:`ready`,warning:`ready`,pending:`pending`,failure:`error`,error:`error`},yIe=async()=>{let{branch:e}=FW;if(e)return(await bW(`${kW(FW)}/branches/${oP(e)}`))?.commit?.id??void 0},bIe=async(e,t)=>{[...(await bW(`${kW(FW)}/commits/${encodeURIComponent(e)}/status?limit=${_Ie}`))?.statuses??[]].sort((e,t)=>Date.parse(e.updated_at)-Date.parse(t.updated_at)).forEach(({context:n,status:r,target_url:i,description:a})=>{let o=vIe[r];o&&t[e].push({name:n??``,url:i||void 0,state:o,description:a||void 0,source:`status`})})},xIe=async(e,t)=>{await lU(e,e=>FG(()=>bIe(e,t)))},SIe=async e=>IG(e,{collect:xIe,selfURL:FW.repoURL}),CIe=50,wIe=10,TIe=new Map,LG=()=>bA(TIe,`settings`,async()=>await bW(`/settings/api`)),EIe=async()=>Number((await LG()).max_response_items)||CIe,RG=async e=>{let t=await EIe(),n=e.includes(`?`)?`&`:`?`,r=[];for(let i=1;i<=wIe;i+=1){let a=await bW(`${e}${n}page=${i}&limit=${t}`);if(r.push(...a),a.length<t)return{items:r,complete:!0}}return{items:r,complete:!1}},zG=async e=>(await RG(e)).items,BG=({arrayIndex:e},t)=>e===void 0?t:`${t}#${e}`,DIe=({entries:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.flatMap(e=>Object.values(e.locales).map(({path:t})=>[BG(e,t),e]))),i=new Set;return e.map(e=>{let t=Object.values(e.locales).map(({path:e})=>e),a=t.map(t=>r.get(BG(e,t))).find(e=>!!e&&!i.has(e));if(!a)return e;i.add(a);let o=Object.values(a.locales).map(({path:e})=>e);return t.length===o.length&&t.every(e=>o.includes(e)&&!n.has(e))?a:{...e,id:a.id}})},OIe=({assets:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.map(e=>[e.path,e])),i=new Set(e.map(({path:e})=>e)),a=(e,t)=>{let{workflow:n}=e;return n.replacedAsset===t?e:{...e,workflow:{...n,replacedAsset:t}}};return[...e.map(e=>{let t=r.get(e.path),i=t?.workflow?t.workflow.replacedAsset:t,o=i&&!n.has(e.path)?i:e;return t?.workflow?a(t,o):o}),...t.filter(({path:e,workflow:t})=>!!t&&!i.has(e)).map(e=>a(e,void 0))]},kIe=({collectionName:e,fileName:t})=>{let n=YA(e),{structureMap:r}=((n&&t?ij(n,t):void 0)??n)?._i18n??{};return!!(r?.i18nMultiFile||r?.i18nMultiFolder||r?.i18nMultiRootFolder)},AIe=({entryFiles:e,previous:t,changedPaths:n})=>{let r=new Set(e.map(({path:e})=>e)),i=new Map,a=new Set;t.forEach(e=>{CP(e).forEach(t=>{i.has(t)&&a.add(t),i.set(t,e)})});let o=({path:e},t)=>{let o=i.get(e);if(!o||n.has(e)||a.has(e))return;let s=CP(o);if(t||s.length===1&&s[0]===e)return s.every(e=>r.has(e)&&!n.has(e)&&!a.has(e))?o:void 0},s=new Map,c=[],l=new Map,u=new Map;return e.forEach(e=>{let{collectionName:t,fileName:n}=e.folder,r=`${t}\n${n??``}`,i=l.get(r);i===void 0&&(i=kIe(e.folder),l.set(r,i));let a=o(e,i);if(i){let n=u.get(t)??[];n.push({file:e,entry:a}),u.set(t,n)}else a?s.set(e.path,a):c.push(e)}),u.forEach(e=>{e.every(({entry:e})=>!!e)?e.forEach(({file:e,entry:t})=>{s.set(e.path,t)}):c.push(...e.map(({file:e})=>e))}),{reusedEntries:s,dirtyFiles:c}},jIe=({entryFiles:e,reusedEntries:t,parsedEntries:n})=>{let r=new Map;n.forEach(e=>{CP(e).forEach(t=>{mA(r,t,()=>[]).push(e)})});let i=new Set;return e.forEach(({path:e})=>{let n=t.get(e);(n?[n]:r.get(e)??[]).forEach(e=>{i.add(e)})}),[...i]},VG=({fileInfo:e,fetchedFileMap:t})=>{let{meta:n,size:r,text:i}=t[e.path]??{};return{...e,size:e.size??r,text:e.text??i,meta:e.meta??n}},HG=e=>{let{name:t,meta:n={},...r}=e,i=KU(t);return{...r,...n,name:t,kind:i}},MIe=e=>`locales`in e?Object.values(e.locales).map(({path:e})=>e):[e.path],NIe=({entries:e,assets:t,configFiles:n,errors:r=[],changedPaths:i})=>{let a=i??new Set([...e,...t].flatMap(MIe));tj.current=DIe({entries:e,previous:tj.current,changedPaths:a}),qB.current=OIe({assets:t,previous:qB.current,changedPaths:a}),nV.current=n,rj.current=r,QA.current=!0},PIe=({fetchedFileMap:e,metadataMap:t})=>{Object.entries(t).forEach(([t,n])=>{e[t]&&(e[t].meta=n)});let n=!1,r=!1,i=tj.current.map(e=>{if(e.commitDate)return e;let r=Object.values(e.locales).map(({path:e})=>t[e]).find(Boolean);return r?(n=!0,{...e,...r}):e}),a=qB.current.map(e=>{let n=e.commitDate?void 0:t[e.path];return n?(r=!0,{...e,...n}):e});n&&(tj.current=i),r&&(qB.current=a)},FIe=async({entryFiles:e,changedPaths:t,parsedFileMap:n})=>{let r=tj.current;if(!t||!r.length)return FL(e,{parsedFileMap:n});let{reusedEntries:i,dirtyFiles:a}=AIe({entryFiles:e,previous:r,changedPaths:t}),{entries:o,errors:s}=await FL(a,{parsedFileMap:n});return{entries:jIe({entryFiles:e,reusedEntries:i,parsedEntries:o}),errors:s}},IIe=async({fileList:{entryFiles:e,assetFiles:t,configFiles:n},fetchedFileMap:r,changedPaths:i,parsedFileMap:a})=>{let{entries:o,errors:s}=await FIe({entryFiles:e.map(e=>VG({fileInfo:e,fetchedFileMap:r})),changedPaths:i,parsedFileMap:a});return{entries:o,errors:s,assets:t.map(e=>HG(VG({fileInfo:e,fetchedFileMap:r}))),configFiles:n.map(e=>VG({fileInfo:e,fetchedFileMap:r}))}},UG=(e,{sha:t=``,size:n=0,...r}={})=>({path:e,name:bk(e).basename,sha:t,size:n,...r}),WG=e=>e.filter(({type:e})=>e===`blob`).map(({path:e,sha:t,size:n})=>UG(e,{sha:t,size:n})),LIe=async({metaEntries:e,lastCommitHash:t,cachedFileEntries:n,fetchFileList:r,log:i})=>{let a=tk.current,{last_config_hash:o,last_commit_hash:s,git_config_fetched:c}=Object.fromEntries(e);if(o&&o===a&&s&&s===t&&c&&n.length){let e=ZU(n.map(([e,t])=>UG(e,t)));return i(`Restored the file list from the cache: ${QU(e)}`),e}let l=ZU(await r(t));return i(`Fetched the file list: ${QU(l)}`),l},RIe=async({metaDB:e,lastConfigHash:t,lastCommitHash:n})=>{await e.saveEntries(Object.entries({last_config_hash:t,last_commit_hash:n,git_config_fetched:!0}))},zIe=async({databaseName:e},t,n)=>{EG.current=n;try{let r=new tD(e,`meta`);await r.get(`last_commit_hash`)===t&&await r.set(`last_commit_hash`,n)}catch(e){console.error(`Failed to update the file cache.`,e)}},BIe=({allFiles:e,cachedFiles:t})=>{e.forEach(({sha:n,path:r},i)=>{t[r]?.sha===n&&Object.assign(e[i],t[r])})},VIe=({parsedFileMap:e,fetchedFileMap:t,cachedFiles:n})=>{let r={};return e.forEach((e,i)=>{t[i]?t[i].parsed=e:n[i]&&(r[i]={...n[i],parsed:e})}),r},GG=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a={}})=>{let o=new Set(t.map(({path:e})=>e)),s=Object.keys(n).filter(e=>!o.has(e)),c=[...r.length?Object.entries(i):[],...Object.entries(a)];await Promise.all([c.length?e.saveEntries(c):void 0,s.length?e.deleteEntries(s):void 0])},HIe=({metaDB:e,cacheDB:t})=>XU((async()=>{try{let n=await t.entries();return{metaEntries:await e.entries(),cachedFileEntries:n}}catch(e){return console.error(`Failed to read the file cache.`,e),{metaEntries:[],cachedFileEntries:[]}}})()),UIe=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a,fetchFileMetadata:o,log:s})=>{let c={cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a},l=!0;if(o&&r.length){try{await GG(c),s(`Cached the contents of ${r.length} files`)}catch(e){console.error(`Failed to cache the contents.`,e)}try{PIe({fetchedFileMap:i,metadataMap:await o(r)}),s(`Fetched the commit metadata of ${r.length} files`)}catch(e){console.error(`Failed to fetch the commit metadata.`,e),l=!1}}await GG(c),s(l?`Cached ${r.length} files with their metadata`:`Cached ${r.length} files without their metadata; they are fetched again next time`)},WIe=async({metaDB:e,lastConfigHash:t,lastCommitHash:n,cacheUpdate:r})=>{try{await r,await RIe({metaDB:e,lastConfigHash:t,lastCommitHash:n})}catch(e){console.error(`Failed to update the file cache.`,e)}},KG=(e,t)=>((...n)=>{let r=yH();return r?t(r,...n):e(...n)}),qG=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[t(e),n])),JG=(e,t)=>({...e,path:t(e.path),...e.previousPath!==void 0&&{previousPath:t(e.previousPath)}}),YG=(e,t)=>({...e,files:e.files.map(e=>JG(e,t))}),XG=(e,t)=>({...e,files:qG(e.files,e=>xH(e,t))}),GIe=({repository:e,fetchFileList:t,fetchFileContents:n,fetchFileMetadata:r})=>{let i=(e,t)=>e.map(e=>({...e,path:bH(e.path,t)}));return{fetchFileList:KG(t,async(n,r)=>{let i=(await t(r)).flatMap(e=>{let t=xH(e.path,n);return SH(t)?[{...e,path:t}]:[]});if(!i.length)throw fU(`Failed to list the files.`,`root_dir_not_found`,{repo:`${e.owner}/${e.repo}`,dir:n});return i}),fetchFileContents:KG(n,async(e,t,r)=>qG(await n(i(t,e),r),t=>xH(t,e))),fetchFileMetadata:r&&KG(r,async(e,t)=>qG(await r(i(t,e)),t=>xH(t,e)))}},KIe=e=>{let t=(e,t)=>YG(e,e=>bH(e,t)),n=(e,t)=>YG(e,e=>xH(e,t));return{...e,fetchPullRequests:KG(e.fetchPullRequests,async t=>(await e.fetchPullRequests()).map(e=>n(e,t))),savePullRequest:KG(e.savePullRequest,async(r,i)=>{let{commit:a,pullRequest:o}=await e.savePullRequest({...i,changes:CH(i.changes),pullRequest:i.pullRequest&&t(i.pullRequest,r)});return{commit:XG(a,r),pullRequest:n(o,r)}}),updateStatus:KG(e.updateStatus,async(r,i,a)=>n(await e.updateStatus(t(i,r),a),r)),fetchMergeState:KG(e.fetchMergeState,async(n,r)=>{let i=await e.fetchMergeState(t(r,n)),a=i.files.some(({path:e,previousPath:t})=>[e,t].some(e=>e!==void 0&&e.split(`/`).some(e=>e===`.`||e===`..`)));return{...i,files:i.files.map(e=>JG(e,e=>xH(e,n))),...a&&{complete:!1}}}),fetchUnchangedPaths:KG(e.fetchUnchangedPaths,async(t,{headSHA:n,paths:r})=>(await e.fetchUnchangedPaths({headSHA:n,paths:r.map(e=>bH(e,t))})).map(e=>xH(e,t))),publish:KG(e.publish,(n,r)=>e.publish(t(r,n))),discard:KG(e.discard,(n,r)=>e.discard(t(r,n)))}},ZG=e=>{let{fetchBlob:t,commitChanges:n,fetchFileCommits:r,workflow:i}=e;return{...e,fetchBlob:t&&KG(t,(e,n)=>t({...n,path:bH(n.path,e)})),commitChanges:KG(n,async(e,t,r)=>XG(await n(CH(t),r),e)),fetchFileCommits:r&&KG(r,(e,t)=>r(t.map(t=>bH(t,e)))),workflow:i&&KIe(i)}},QG=WO({}),$G=WO(``),eK=WO({published:!0,time:0}),tK=WO(!1),qIe=e=>{let t=e.filter(e=>!!e);t.length&&(QG.current=Object.fromEntries(Object.entries(QG.current).filter(([e])=>!t.includes(e))))},JIe=()=>{QG.current={},$G.current=``,tK.current=!1,eK.current={published:!0,time:0}},nK=e=>{eK.current={published:e,time:Date.now()}},rK,YIe=e=>`${e}\n${tk.current}`,XIe=async({repository:e,accessPromise:t,fetchDefaultBranchName:n,fetchLastCommit:r,lastCommit:i,log:a})=>{let{branch:o}=e;if(o&&i)return await t,i;if(!o){let r=XU(n());await t,o=await r,e.branch=o,a(`Fetched the default branch name: ${o}`)}let s=XU(r());await t;let c=await s;return a(`Fetched the last commit on ${o}: ${c.hash}`),c},ZIe=async({fileList:{allFiles:e},lastCommitHash:t,cachedFileEntries:n,fetchFileContents:r,fetchFileMetadata:i,log:a})=>{let o=Object.fromEntries(n);BIe({allFiles:e,cachedFiles:o});let s=new Set(e.filter(({path:e,sha:t})=>o[e]?.sha!==t).map(({path:e})=>e)),c=e.filter(({meta:e})=>!e),l=i?c.filter(({type:e,text:t})=>e!==`asset`&&t===void 0):c,u=Object.fromEntries(c.map(({path:e,sha:t,size:n,text:r})=>[e,{sha:t,size:n,text:r,meta:void 0}]));return a(`Restored ${e.length-c.length} files from the cache; fetching ${c.length} files`),l.length&&(Object.assign(u,await r(l,t)),a(`Fetched the contents of ${l.filter(({type:e})=>e!==`asset`).length} files`)),{cachedFiles:o,changedPaths:s,fetchingFiles:c,fetchedFileMap:u}},iK=async({data:e,isStale:t,parseKey:n,metaDB:r,lastConfigHash:i,lastCommitHash:a,startCacheUpdate:o,log:s,readyMessage:c})=>{t()?s(`Discarded: the site data was reset while loading`):(NIe(e),rK=n,EG.current=a,s(c),await WIe({metaDB:r,lastConfigHash:i,lastCommitHash:a,cacheUpdate:o()}))},QIe=async({repository:e,checkAccess:t,checkBranchAccess:n,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,...o})=>{let{service:s,owner:c,repo:l,databaseName:u}=e,{fetchFileList:d,fetchFileContents:f,fetchFileMetadata:p}=GIe({repository:e,...o}),m=$U(`Loading site data`);m(`Started: ${s} ${c}/${l}`);let h=YIe(u),g=OG(),_=!!EG.current&&rK===h,v=new tD(u,`meta`),y=new tD(u,`file-cache`),b=!EG.current,x=t&&b?XU(t()):void 0,S=HIe({metaDB:v,cacheDB:y}),{hash:C,message:w}=await XIe({repository:e,accessPromise:x,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,log:m}),T=n&&b?n():void 0,{metaEntries:ee,cachedFileEntries:E}=await S;m(`Read the file cache: ${E.length} files`);let te=tk.current,ne=await LIe({metaEntries:ee,lastCommitHash:C,cachedFileEntries:E,fetchFileList:d,log:m});nK(!CPe(w)),await T;let re={isStale:g,parseKey:h,metaDB:v,lastConfigHash:te,lastCommitHash:C,log:m};if(!ne.count){await iK({...re,data:{entries:[],assets:[],configFiles:[]},readyMessage:`The site data is ready: no files to load`,startCacheUpdate:()=>GG({cacheDB:y,allFiles:[],cachedFiles:Object.fromEntries(E),fetchingFiles:[],fetchedFileMap:{}})});return}let{cachedFiles:ie,changedPaths:ae,fetchingFiles:oe,fetchedFileMap:se}=await ZIe({fileList:ne,lastCommitHash:C,cachedFileEntries:E,fetchFileContents:f,fetchFileMetadata:p,log:m}),ce=new Map,{entries:le,errors:ue,assets:de,configFiles:fe}=await IIe({fileList:ne,fetchedFileMap:se,changedPaths:_?ae:void 0,parsedFileMap:ce}),pe=VIe({parsedFileMap:ce,fetchedFileMap:se,cachedFiles:ie});m(`Parsed ${le.length} entries (${ue.length} errors)`),await iK({...re,data:{entries:le,assets:de,configFiles:fe,errors:ue,changedPaths:ae},readyMessage:`The site data is ready`,startCacheUpdate:()=>UIe({cacheDB:y,allFiles:ne.allFiles,cachedFiles:ie,fetchingFiles:oe,fetchedFileMap:se,reparsedFileMap:pe,fetchFileMetadata:p,log:m})})},aK=async({isOpenAuthoringConfigured:e,initOpenAuthoring:t,checkAccess:n,checkBranchAccess:r,...i})=>{let a=e();a&&!PB.current&&await t(),await QIe({...i,checkAccess:a?void 0:n,checkBranchAccess:MB.current?void 0:r})},$Ie=10485760,oK=_A(4),eLe=async(e,t)=>{let{dirname:n,basename:r}=bk(t),i=n?`/${oP(n)}`:``,a=await sG(`${kW(FW)}/contents${i}?ref=${encodeURIComponent(e)}`);return Array.isArray(a)?a.find(({type:e,name:t})=>e===`dir`&&t===r)?.sha:void 0},sK=async(e,t)=>{let n=`${FW.owner}/${FW.repo}:${e}:${t}`;if(oK.has(n))return oK.get(n);let r=await eLe(e,t);return/^[\da-f]{40,64}$/.test(e)&&oK.set(n,r),r},tLe=async e=>{let{branch:t}=FW,n=e??t,r=yH(),i=r?await sK(n,r):n;if(!i)return[];let a=oP(i),o=`${kW(FW)}/git/trees/${a}?recursive=1`,s=r?`${r}/`:``,c=async e=>await bW(`${o}&page=${e}`),l=await c(1),u=[l];if(l.tree&&l.truncated){let{tree:{length:e},total_count:t}=l;if(t&&e){let n=Array.from({length:Math.ceil(t/e)-1},(e,t)=>t+2);u.push(...await uU(n,c))}else for(let e=2;;e+=1){let t=await c(e);if(u.push(t),!t.tree||!t.truncated)break}}return WG(u.flatMap(({tree:e})=>(e??[]).map(e=>({...e,path:`${s}${e.path}`}))))},nLe=async(e,t)=>{let n=await Promise.all(e.map(async({path:e,sha:n,size:r,type:i})=>{let a=t[e];if(!a&&i!==`asset`)return[e,{sha:n,size:r??0,text:void 0,meta:void 0}];let{content:o,encoding:s}=a??{};return[e,{sha:n,size:r??0,text:o&&s===`base64`?await bSe(o):``,meta:{}}]}));return Object.fromEntries(n)},cK=async({owner:e,repo:t,path:n,ref:r})=>bW(`${kW({owner:e,repo:t})}/raw/${oP(n)}?ref=${encodeURIComponent(r)}`,{responseType:`text`}),rLe=async(e,t)=>{let{owner:n,repo:r}=t?wG():FW,{branch:i=``}=FW;return cK({owner:n,repo:r,path:e,ref:t??i})},iLe=(e,{maxItems:t,maxResponseSize:n})=>{let r=[],i=[],a=0;return e.forEach(e=>{let o=(e.size??0)*4/3;i.length&&(i.length===t||a+o>n)&&(r.push(i),i=[],a=0),i.push(e),a+=o}),i.length&&r.push(i),r},aLe=async(e,t)=>{let{owner:n,repo:r,branch:i}=FW,{isForgejo:a}=aG,o=String(t??i),s=a?`${kW(FW)}/git/blobs`:`${kW(FW)}/file-contents?ref=${encodeURIComponent(o)}`,c=a?`sha`:`path`,l=e.filter(({type:e})=>e!==`asset`);if(!l.length)return{};$A.current=0;try{let{default_paging_num:t=30,max_response_items:i=1/0,default_max_blob_size:u,default_max_response_size:d=1/0}=await LG(),f=Number(u)||$Ie,p=l.filter(({size:e=0})=>e>=f),m=iLe(l.filter(({size:e=0})=>e<f),{maxItems:Math.min(t,i),maxResponseSize:d}),h={},g=0,_=e=>{g+=e,$A.current=Math.ceil(g/l.length*100)};await lU(m,async e=>{let t=await(a?bW(`${s}?shas=${e.map(({sha:e})=>e).join(`,`)}`):bW(s,{method:`POST`,body:{files:e.map(({path:e})=>e)}})),n=new Map(t.filter(e=>!!e).map(e=>[e[c],e]));e.forEach(e=>{let t=n.get(e[c]);t&&(h[e.path]=t)}),_(e.length)});let v=await nLe(e,h);return await lU(p,async({path:e})=>{let t=await cK({owner:n,repo:r,path:e,ref:o});Object.assign(v[e],{text:t,meta:{}}),_(1)}),v}finally{$A.current=void 0}},oLe=async()=>{let e=CFe();e.catch(()=>void 0),await oG(),await e},sLe=async()=>{await oG(),await rIe()},cLe=async({lastCommit:e}={})=>{await aK({isOpenAuthoringConfigured:GFe,initOpenAuthoring:sLe,repository:FW,checkAccess:oLe,checkBranchAccess:wFe,fetchDefaultBranchName:BW,fetchLastCommit:kG,lastCommit:e,fetchFileList:tLe,fetchFileContents:aLe})},lLe=async e=>{let{path:t}=e,n=kW(e.workflow?wG():FW),r=e.workflow?.branch??FW.branch;return bW(`${n}/media/${`${oP(String(r))}/${oP(t)}`}`,{responseType:`blob`})},lK=({regex:e,prefix:t})=>({strip:t=>{let n=t;for(;e.test(n);)n=n.replace(e,``);return n},format:(e,n)=>n?`${t}${e}`:e}),uK=(e,{removedStatus:t})=>e.map(({filename:e,status:n,previous_filename:r})=>({path:e,sha:``,size:0,deleted:n===t,previousPath:r||void 0})),dK=()=>{let{backend:e}=$O.current??{};return e&&`squash_merges`in e?!!e.squash_merges:!1},fK=async({branch:e,path:t,goneStatuses:n})=>{try{await bW(t,{method:`DELETE`,responseType:`text`})}catch(t){if(n.includes(t.cause?.status))return;console.warn(`Failed to delete the ${e} branch.`,t)}},uLe=async({commit:e,branch:t,title:n,status:r,createPullRequest:i})=>NB.current&&r===`draft`?UFe({commit:e,branch:t,title:n}):i({branch:t,title:n,status:r}),pK=async({changes:e,options:t,branch:n,title:r,status:i,pullRequest:a},{commitToNewBranch:o,commitToExistingBranch:s,createPullRequest:c})=>{if(a)return{commit:await s(e,{...t,branch:n},a),pullRequest:a};let l=await o(e,{...t,branch:n});return{commit:l,pullRequest:await uLe({commit:l,branch:n,title:r,status:i,createPullRequest:c})}},mK=async({branch:e,branchExistsStatus:t,commitFromStart:n,commitOnBranch:r,findOpenPullRequest:i,inUseMessage:a,deleteBranch:o})=>{try{return await n()}catch(e){if(e.cause?.status!==t)throw e}if(NB.current)return r();let s=await i();if(s)throw fU(a,`workflow.branch_in_use`,{number:s});return await o(e),n()},hK=(e,t)=>fU(`Failed to save the changes.`,`branch_not_found`,{repo:t.repo,branch:e}),gK=async({branch:e,headSHA:t,fetchBranchHead:n,getWorkflowRepository:r})=>{let i=await n(e);if(i===void 0)throw hK(e,r());if(!t||i!==t)throw fU(`The workflow branch has moved since the entry was loaded.`,`save_conflict.branch_moved`);return t},_K=async(e,t,{updateForkStatus:n,updateLabels:r,updateDraftState:i})=>{if(NB.current)return n(e,t);let a=t===`draft`;return await r(e,t),a!==(e.status===`draft`)&&await i(e,a),{...e,status:t,updatedDate:new Date}},vK=e=>[...new Set(e.map(e=>e.slice(0,Math.max(e.lastIndexOf(`/`),0))))],yK=async(e,{statusMap:t,headSHA:n,fetchFileModes:r})=>{let i=e.map(({filename:e,status:n,previous_filename:r})=>({path:e,status:t[n]??`modified`,previousPath:r||void 0})),a=await r({headSHA:n,paths:i.filter(({status:e})=>e!==`removed`).map(({path:e})=>e)});return i.map(e=>({...e,mode:a.get(e.path)}))},bK=(e,t)=>t===e.headSHA?void 0:{headSHA:t,onConfiguredBranches:!0,files:[],complete:!0},xK=async({pullRequest:e,headSHA:t,onConfiguredBranches:n,listChangedFiles:r})=>!t||!n?{headSHA:t,onConfiguredBranches:!1,files:[],complete:!1}:bK(e,t)||{headSHA:t,onConfiguredBranches:n,...await r(t)},dLe=async(e,t)=>(await bW(`${jW(e,t)}/merge`,{responseType:`raw`})).ok,fLe=async(e,t)=>{await bW(jW(e,t),{method:`PATCH`,body:{state:`open`}})},SK=async(e,t,n)=>{await bW(`${jW(e,t.number)}/reviews`,{method:`POST`,body:{event:n,commit_id:t.headSHA}})},CK=e=>e.filter(({state:e,dismissed:t,user:n})=>e===`APPROVED`&&!t&&n?.login===vU.account?.login),wK=async(e,t,{deleteBranch:n,closedStatuses:r=[]})=>{if(t.number!==void 0)try{await bW(jW(e,t.number),{method:`PATCH`,body:{state:`closed`}})}catch(e){if(!r.includes(e.cause?.status))throw e}await n(t.branch)},TK=async({pullRequest:e,status:t,state:n,draft:r},{repository:i,updateDraftState:a})=>{let o=n?.toLowerCase();t===`draft`?o===`open`&&!r&&await a(e,!0):(o===`closed`&&await fLe(i,e.number),r&&await a(e,!1))},EK={interval:1e4,maxDuration:36e5},pLe=e=>{let t=e?.cause?.status;return typeof t==`number`&&t>=400&&t<500&&t!==429},DK=async({read:e,evaluate:t,cancel:n,label:r,deadline:i=Date.now()+EK.maxDuration})=>{if(Date.now()>=i)throw await n(),Error(`Timed out waiting for ${r} to be merged`);await Zc(EK.interval);let a;try{a={item:await e()}}catch(e){if(pLe(e))throw e;console.warn(`Failed to read ${r}, still waiting.`,e)}a&&await t(a.item)||await DK({read:e,evaluate:t,cancel:n,label:r,deadline:i})},mLe=[`netlify-cms/`,`decap-cms/`],OK=[`draft`,`pending_review`,`pending_publish`],kK=[`draft`,`pending_review`],AK=[...OK,`pending_deletion`],jK={draft:`status.draft`,pending_review:`status.in_review`,pending_publish:`status.ready`,pending_deletion:`status.pending_deletion`},MK=()=>{let{backend:e}=$O.current??{};return(e&&`cms_label_prefix`in e?e.cms_label_prefix:void 0)||`sveltia-cms/`},NK=()=>[...new Set([MK(),`sveltia-cms/`,...mLe])],PK=e=>`${MK()}${e}`,FK=()=>NK().flatMap(e=>AK.map(t=>`${e}${t}`)),IK=(e,t)=>{let n=FK();return[...e.filter(e=>!n.includes(e)),PK(t)]},LK=e=>{let t;return NK().some(n=>(t=AK.find(t=>e.includes(`${n}${t}`)),!!t)),t},RK=lK({regex:/^\s*(?:\[wip\]|wip:)\s*/i,prefix:`WIP: `}),hLe={draft:`#ededed`,pending_review:`#fbca04`,pending_publish:`#0e8a16`,pending_deletion:`#d93f0b`},gLe=`Editorial Workflow status managed by Sveltia CMS`,zK=({head:e,base:t})=>typeof e?.repo_id==`number`&&e.repo_id!==-1&&e.repo_id===t?.repo_id,_Le=e=>{let t=LK((e.labels??[]).map(({name:e})=>e));if(!t)return;let{ref:n,sha:r}=e.head??{};if(!n||!zK(e)||e.base?.ref!==FW.branch)return;let{full_name:i,login:a,email:o,id:s}=e.user??{};return{number:e.number,nodeId:String(e.id),title:RK.strip(e.title),url:e.html_url,branch:n,headSHA:r,status:t,createdDate:new Date(e.created_at),updatedDate:new Date(e.updated_at),author:a?{name:i||a,email:o??``,id:s,login:a}:void 0,files:[]}},BK=async e=>{let t=`refs/pull/${e}/head`,n=await sG(`${kW(FW)}/git/${t}`);if(n)return(Array.isArray(n)?n:[n]).find(e=>e.ref===t)?.object?.sha},VK=cG,vLe=3,yLe=({contents_url:e})=>{try{return new URL(e).searchParams.get(`ref`)}catch{return null}},HK=(e,t,n=VK.attempts)=>lG(async()=>{let{items:n,complete:r}=await RG(`${jW(FW,e)}/files`),i=n.length?[...new Set(n.map(e=>yLe(e)))]:[await BK(e)],a=i.length===1?i[0]??void 0:void 0;return{files:n,complete:r&&a===t,commit:a}},({commit:e})=>e===t,{...VK,attempts:n}),UK=async e=>{let{number:t,headSHA:n}=e,r;if(n){let i=await HK(t,n,vLe);r=i.files,e.headSHA=i.commit}else r=await zG(`${jW(FW,t)}/files`);e.files=uK(r,{removedStatus:`deleted`})},bLe=e=>{try{return new TextDecoder(`utf-8`,{fatal:!0}).decode(Uint8Array.fromBase64(e))}catch{return}},xLe=async(e,t)=>{let{path:n}=t,r=e.headSHA??e.branch,i=await sG(`${kW(wG())}/contents/${oP(n)}?ref=${encodeURIComponent(r)}`);if(!i){t.deleted=!0;return}let{sha:a,size:o,content:s,encoding:c}=i;Object.assign(t,{sha:a??``,size:Number(o)||0,text:s&&c===`base64`?bLe(s):void 0}),!s&&t.size&&yk(lV.getType(n)??``)&&(t.text=await rLe(n,r))},WK=async e=>{await lU(e.files.filter(({deleted:e})=>!e),async t=>xLe(e,t))},GK=async e=>(await sG(`${kW(wG())}/branches/${oP(e)}`))?.commit?.id,KK=async e=>{await fK({branch:e,path:`${kW(wG())}/branches/${oP(e)}`,goneStatuses:[404]})},SLe=async e=>{await bW(`${kW(FW)}/labels`,{method:`POST`,body:{name:PK(e),color:hLe[e],description:gLe}})},qK=async(e,t,n,r)=>{let i=`${kW(FW)}/issues/${e}/labels`,a=PK(n);(await bW(i,{method:r,body:{labels:t}})).some(({name:e,url:t})=>e===a&&!String(t??``).includes(`/api/v1/orgs/`))||(await SLe(n),await bW(i,{method:r,body:{labels:t}}))},CLe=async(e,t)=>{let{number:n}=e;await qK(n,IK((await bW(`${kW(FW)}/issues/${n}/labels`)).map(({name:e})=>e),t),t,`PUT`)},JK=async(e,t)=>{let{number:n,title:r}=e;await bW(jW(FW,n),{method:`PATCH`,body:{title:RK.format(r,t)}})},YK=async({branch:e,title:t,status:n})=>{let{branch:r}=FW,i=MB.current,a=n===`draft`,o=await bW(`${kW(FW)}/pulls`,{method:`POST`,body:{title:RK.format(t,a),head:i?`${i.owner}:${e}`:e,base:r,body:`Automatically generated by Sveltia CMS`}});return i||await qK(o.number,[PK(n)],n,`POST`),{number:o.number,nodeId:String(o.id),title:t,url:o.html_url,branch:e,headSHA:o.head?.sha,status:n,createdDate:new Date(o.created_at),updatedDate:new Date(o.updated_at),files:[]}},XK=({action:e,path:t,previousPath:n})=>e===`move`&&n?n:t,ZK=async(e,t,{owner:n,repo:r}=wG())=>(await sG(`${kW({owner:n,repo:r})}/contents/${oP(e)}?ref=${encodeURIComponent(t)}`))?.sha,QK=async(e,t)=>{let n=bO(e.filter(({action:e})=>e!==`create`).map(e=>XK(e)));if(!n.length)return e;let r=new Map;return await lU(n,async e=>{let n=await ZK(e,t);n&&r.set(e,n)}),e.flatMap(e=>{if(e.action===`create`)return e;let t=r.get(XK(e));if(t)return{...e,previousSha:t};if(e.action===`delete`)return[];let{previousPath:n,previousSha:i,...a}=e;return{...a,action:`create`}})},wLe=`cms`,TLe=200,ELe=244,DLe=32,$K=new TextEncoder,OLe=new Intl.Segmenter,eq=e=>{let t=MB.current;return[wLe,t?.owner,t?.repo,e].filter(Boolean).map(e=>`${e}/`).join(``)},tq=()=>eq(yH()),nq=()=>eq(``),rq=e=>e.replaceAll(`%`,`%25`).replaceAll(`/`,`%2F`),kLe=e=>e.replaceAll(`%2F`,`/`).replaceAll(`%25`,`%`),iq=e=>$K.encode(rq(e)).length,ALe=({collectionName:e,dirPath:t})=>{let n=`${tq()}${e}/`,r=t?iq(`${t}/`):0,i=ELe-$K.encode(n).length-r;return Math.max(Math.min(TLe,i),DLe)},aq=(e,t)=>{let n=Array.from(OLe.segment(e),({segment:e})=>e),r=0,i=n.findIndex(e=>(r+=iq(e),r>t));return i===-1?e:n.slice(0,i).join(``)},jLe=({collectionName:e,slug:t})=>`${tq()}${e}/${rq(t)}`,oq=e=>{let t=tq(),n=nq(),r=!e.startsWith(t);if(r&&(t===n||!e.startsWith(n)))return;let i=e.slice(r?n.length:t.length),a=i.indexOf(`/`);if(!(a<1||a===i.length-1))return{collectionName:i.slice(0,a),slug:kLe(i.slice(a+1)),...r&&{legacy:r}}},MLe=({branch:e,collectionName:t,slug:n})=>{let r=oq(e);return r?.collectionName===t&&r.slug===n},NLe=async()=>{let e=nq();return(await zG(`${kW(wG())}/branches`)).filter(({name:t})=>t.startsWith(e))},sq=e=>{let t=MB.current,n=vU.account?.id;return!!t&&AW(e.head?.repo?.full_name,t)&&e.base?.ref===FW.branch&&n!==void 0&&e.user?.id===n},PLe=async()=>{let e=vU.account?.login,t=await zG(`${kW(FW)}/pulls?state=all&sort=recentupdate&poster=${encodeURIComponent(e)}`),n=new Map;return t.filter(sq).forEach(e=>{let t=e.head.ref,r=n.get(t);(!r||r.state!==`open`&&e.state===`open`)&&n.set(t,e)}),n},FLe=(e,t)=>{let{name:n,commit:r}=e,{id:i,message:a,timestamp:o,author:s}=r,c=t?.merged?void 0:t,l=c?.state===`open`&&!c.draft;return{number:c?.number,nodeId:c?String(c.id):void 0,title:RK.strip(c?.title??a??``),url:c?.html_url,branch:n,headSHA:i,status:l?`pending_review`:`draft`,createdDate:new Date(c?.created_at??o),updatedDate:new Date(c?.updated_at??o),author:s?.name?{name:s.name,email:s.email??``,login:s.username}:void 0,files:[],canMerge:!1}},ILe=async e=>{let t=oP(FW.branch),n=oP(e.headSHA??e.branch),{commits:r=[]}=await bW(`${kW(wG())}/compare/${t}...${n}`),i=new Map;r.forEach(({files:e=[]})=>{e.forEach(({filename:e})=>{i.set(e,{path:e,sha:``,size:0,deleted:!1})})}),e.files=[...i.values()]},LLe=async()=>{let e=await NLe();if(!e.length)return[];let t=await PLe(),n=new Map;await lU(e.map(({name:e})=>t.get(e)).filter(e=>!!e?.merged),async({number:e})=>{n.set(e,await BK(e))});let r=await SG(e,e=>{let r=t.get(e.name);return r?.merged&&n.get(r.number)===e.commit?.id?{leftover:e.name}:{pending:FLe(e,r)}},KK);return await lU(r,async e=>{e.status===`pending_review`?await UK(e):await ILe(e),await WK(e)}),r.filter(({files:e})=>e.length)},RLe=async({number:e})=>{let t=await bW(jW(FW,e));return{merged:!!t.merged,isEntryRequest:sq(t),getMergedSHA:async()=>await BK(e)??``,state:t.state,draft:t.draft}},zLe=e=>TK(e,{repository:FW,updateDraftState:JK}),BLe=async(e,t)=>CG({pullRequest:e,status:t,requestKey:`number`,createRequest:YK,fetchRequest:RLe,applyStatus:zLe,fetchBranchHead:GK,deleteBranch:KK}),VLe=async()=>{let e=FK(),t=(await zG(`${kW(FW)}/labels`)).filter(({name:t})=>e.includes(t)).map(({id:e})=>e);if(!t.length)return[];let n=t.map(e=>`&labels=${e}`).join(``),r=await zG(`${kW(FW)}/pulls?state=open&sort=recentupdate${n}`),i=[...new Set(r.map(({number:e})=>e))],a=[];return await lU(i,async e=>{let t=_Le(await bW(jW(FW,e)));t&&a.push(t)}),a.sort((e,t)=>t.updatedDate.getTime()-e.updatedDate.getTime()),await lU(a,async e=>{await UK(e),await WK(e)}),a},HLe=async()=>NB.current?LLe():VLe(),ULe=async e=>(await zG(`${kW(FW)}/pulls?state=open&sort=recentupdate`)).find(t=>t.head?.ref===e&&zK(t)),WLe=async(e,t)=>{let{branch:n=``}=t,r=FW.branch,i=await QK(e,r);return mK({branch:n,branchExistsStatus:422,commitFromStart:()=>AG(i,{...t,startBranch:r}),commitOnBranch:async()=>AG(await QK(e,n),t),findOpenPullRequest:async()=>{let e=await ULe(n);return e?`#${e.number}`:void 0},inUseMessage:`The workflow branch is in use by another pull request.`,deleteBranch:KK})},GLe=async(e,t,n)=>{let{branch:r=``}=t;return AG(await QK(e,await gK({branch:r,headSHA:n.headSHA,fetchBranchHead:GK,getWorkflowRepository:wG})),t)},KLe=async e=>pK(e,{commitToNewBranch:WLe,commitToExistingBranch:GLe,createPullRequest:YK}),qLe=(e,t)=>_K(e,t,{updateForkStatus:BLe,updateLabels:CLe,updateDraftState:JK}),JLe=e=>SK(FW,e,`APPROVED`),YLe=async e=>{let t=`${jW(FW,e.number)}/reviews`,n=await zG(t);await Promise.all(CK(n).map(({id:e})=>bW(`${t}/${e}`,{method:`DELETE`,responseType:`text`})))},XLe={added:`added`,copied:`added`,deleted:`removed`,renamed:`renamed`},cq={file:`100644`,symlink:`120000`,submodule:`160000`,dir:`040000`},ZLe=async({headSHA:e,paths:t})=>{let n=new Map;return await lU(vK(t),async t=>{(await bW(`${kW(FW)}/contents${t?`/${oP(t)}`:``}?ref=${encodeURIComponent(e)}`)).forEach(({path:e,type:t})=>{t in cq&&n.set(e,cq[t])})}),n},QLe={fetchPullRequests:HLe,savePullRequest:KLe,updateStatus:qLe,approve:JLe,withdrawApproval:YLe,fetchBranchHead:GK,fetchMergeState:async e=>{let{number:t}=e,n=await bW(jW(FW,t)),r=n.head?.sha;return xK({pullRequest:e,headSHA:r,onConfiguredBranches:n.base?.ref===FW.branch&&zK(n),listChangedFiles:async e=>{let{files:n,complete:r}=await HK(t,e);return{files:await yK(n,{statusMap:XLe,headSHA:e,fetchFileModes:ZLe}),complete:r}}})},fetchUnchangedPaths:async({headSHA:e,paths:t})=>{let{branch:n}=FW,r=new Set;return await lU(t,async t=>{let[i,a]=await Promise.all([ZK(t,n,FW),ZK(t,e,FW)]);i===a&&r.add(t)}),t.filter(e=>r.has(e))},publish:async e=>{vG();let{number:t}=e,n=dK(),r=await bW(`${jW(FW,t)}/merge`,{method:`POST`,responseType:`raw`,body:{Do:n?`squash`:`merge`,MergeTitleField:e.title,MergeMessageField:``,head_commit_id:e.headSHA}});if(r.status===405&&await dLe(FW,t))await KK(e.branch);else{if(!r.ok){let{message:e}=await r.json().catch(()=>({}));throw Error(`Failed to merge the pull request`,{cause:{status:r.status,message:e}})}await KK(e.branch)}},discard:e=>wK(FW,e,{deleteBranch:KK,closedStatuses:[412]})},lq=(e,{authRoot:t,authPath:n,tokenPath:r,api:i,...a})=>{let o=`${XE(t)}/${XE(n)}`;return xFe(e,a),Object.assign(mW,{...i,authURL:o,tokenURL:o.replace(`/authorize`,r)}),e},uq=[`preview`,`editorial_workflow`],dq=e=>typeof e==`string`?e?{type:e}:{}:D(e)?e:{},$Le=e=>Array.isArray(e)?OK.filter(t=>t===`draft`||e.includes(t)):OK,fq=({cmsConfig:e,collection:t})=>{let{type:n,stages:r,direct_publish:i=!1,allow_incomplete_drafts:a=!0}={...dq(e?.publish_mode),...dq(t?.publish_mode)},o=n&&uq.includes(n)?n:`simple`;return{type:o,stages:o===`preview`?[`draft`]:$Le(r),directPublish:o!==`simple`&&i===!0,allowIncompleteDrafts:a!==!1}},pq=({cmsConfig:e,collection:t})=>fq({cmsConfig:e,collection:t}).type,mq=e=>uq.includes(e),hq=e=>[void 0,...Array.isArray(e?.collections)?e.collections.filter(e=>D(e)&&!(`divider`in e)):[]],gq=e=>hq(e).some(t=>mq(pq({cmsConfig:e,collection:t}))),_q={isGit:!0,name:`gitea`,label:`Gitea / Forgejo`,repository:FW,init:()=>{let{backend:e}=$O.current??{};if(!e||!UW(e.name))return;let t=e,{name:n,repo:r,branch:i,auth_endpoint:a=`login/oauth/authorize`,app_id:o=``,api_root:s=`https://gitea.com/api/v1`,include_credentials:c=!1}=t,[l,u]=r.split(`/`);return lq(FW,{service:n,label:n===`forgejo`?`Forgejo`:`Gitea / Forgejo`,owner:l,repo:u,branch:i,restApiRoot:s,defaultApiRoot:`https://gitea.com/api/v1`,getTokenPageURL:IFe,getBaseURLs:RW,authRoot:jG(t),authPath:a,tokenPath:`/access_token`,api:{clientId:o,authScope:[`read:repository`,`write:repository`,...gq($O.current)?[`read:issue`,`write:issue`]:[],`read:user`].join(`,`),restBaseURL:XE(s),includeCredentials:c}}),FW},signIn:LFe,signOut:iG,fetchFiles:cLe,fetchLastCommit:kG,fetchBlob:lLe,fetchDirSHA:sK,commitChanges:AG,fetchFileCommits:sIe,fetchBranchHeadSHA:yIe,fetchDeployments:SIe,workflow:QLe},eRe={..._q,name:`forgejo`,label:`Forgejo`},tRe=e=>(e=XE(e),e===`https://api.github.com`||e.endsWith(`/api/v3`)?e:e.endsWith(`/api`)?`${e}/v3`:`${e}/api/v3`),nRe=e=>(e=XE(e),e===`https://api.github.com`?`${e}/graphql`:e.endsWith(`/graphql`)?e:e.endsWith(`/api/v3`)?e.replace(/\/v3$/,`/graphql`):e.endsWith(`/api`)?`${e}/graphql`:`${e}/api/graphql`),rRe=e=>VW(e,`github`,{name:`name`,login:`login`,profileURL:`html_url`}),iRe=e=>{let{origin:t}=new URL(e),n=new URLSearchParams({name:`Sveltia CMS`,contents:`write`});return gq($O.current)&&n.set(`pull_requests`,`write`),`${t}/settings/personal-access-tokens/new?${n}`},aRe=e=>rG({options:e,getUserProfile:rRe}),vq=2,yq=WO(),oRe=e=>{yq.current=e>=vq?{phase:`preparing`,done:0,total:e,approximate:!1}:void 0},sRe=()=>{let e=yq.current;e?.phase===`preparing`&&(yq.current={...e,done:Math.min(e.done+1,e.total)})},cRe=(e,t)=>{let n=Math.max(e,t);yq.current=n>=vq?{phase:`committing`,done:e,total:n,approximate:!0}:void 0},bq=()=>{yq.current=void 0},xq={...DW},Sq=MW({tree:`/tree`,blob:`/blob`,commit:`/commit`}),Cq=({status:e,headers:t})=>e===429||t.get(`retry-after`)!==null||t.get(`x-ratelimit-remaining`)===`0`,lRe=async()=>{let{repo:e}=xq,t=await bW(kW(xq),{headers:{Accept:`application/json`},responseType:`raw`});if(!t.ok)throw gU(xq,Cq(t)?void 0:t.status);let{permissions:n}=await t.json();if(!n?.push)throw hU(e,n?.pull)},uRe=`
|
||
query($owner: String!, $repo: String!, $qualifiedName: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
ref(qualifiedName: $qualifiedName) {
|
||
refUpdateRule {
|
||
viewerCanPush
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,dRe=async()=>{await jB(xq.branch,async e=>({canPush:(await xW(uRe,{qualifiedName:`refs/heads/${e}`})).repository?.ref?.refUpdateRule?.viewerCanPush}))},fRe=`
|
||
query($owner: String!, $repo: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
defaultBranchRef {
|
||
name
|
||
}
|
||
}
|
||
}
|
||
`,wq=async()=>{let e=await xW(fRe),t=PW(xq,{found:!!e.repository,branch:e.repository?.defaultBranchRef?.name,getBaseURLs:Sq});return Object.assign(hW,{branch:t}),t},pRe=()=>dG(`github`),Tq=()=>fG(xq),mRe=[403,404],hRe=async()=>{try{return(await bW(`/user/repository_invitations`)).some(({repository:e})=>AW(e?.full_name,xq))}catch{return!1}},gRe=async e=>{let{owner:t,repo:n}=xq,r=`${t}/${n}`,i=e=>fU(`Not a collaborator of the repository`,e,{repo:r});if(await hRe())return i(`open_authoring.invitation_pending`);let a=e.headers.get(`x-oauth-scopes`);return a!==null&&!a.split(/,\s*/).includes(`repo`)?i(`open_authoring.private_repo_scope_required`):i(`repository_no_access`)},_Re=async()=>{let{owner:e,repo:t}=xq,n=`${e}/${t}`,r=await bW(kW(xq),{headers:{Accept:`application/json`},responseType:`raw`});if(r.ok){let{permissions:e,private:t,owner:i,allow_forking:a}=await r.json();return t&&i?.type===`User`&&console.warn(`Open Authoring is enabled, but the ${n} repository is private and owned by a personal account. GitHub does not allow read-only collaborators there, so everyone who can sign in can also write to the repository and no one is treated as a contributor. Transfer the repository to an organization to use Open Authoring with it.`),{canWrite:!!e?.push,allowForking:a!==!1}}throw mRe.includes(r.status)&&!Cq(r)?await gRe(r):fU(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:n})},vRe=async()=>{let{repo:e}=xq,t=vU.account?.login,n=await sG(kW({owner:t,repo:e}),{headers:{Accept:`application/json`}});if(!n||!n.fork||!AW(n.parent?.full_name,xq)||n.owner?.login?.toLowerCase()!==t.toLowerCase())return;let[r,i]=n.full_name.split(`/`);return{owner:r,repo:i}},yRe=`
|
||
query($owner: String!, $repo: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
forks(ownerAffiliations: [OWNER], first: 1) {
|
||
nodes {
|
||
nameWithOwner
|
||
owner {
|
||
login
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,bRe=async()=>{let e=vU.account?.login,{repository:t}=await xW(yRe),[n]=t?.forks?.nodes??[];if(n?.owner?.login!==e)return;let[r,i]=n.nameWithOwner.split(`/`);return{owner:r,repo:i}},xRe=async()=>await vRe()??bRe(),SRe=async({owner:e,repo:t},n)=>{await hG({repoPath:`${e}/${t}`,attemptsLeft:n,checkFork:async()=>(await bW(kW({owner:e,repo:t}),{headers:{Accept:`application/json`},responseType:`raw`})).ok?`ready`:`pending`})},CRe=async()=>{let{owner:e,repo:t}=xq,n;try{n=await bW(`${kW(xq)}/forks`,{method:`POST`})}catch(n){throw pG(`${e}/${t}`,n)}let[r,i]=n.full_name.split(`/`),a={owner:r,repo:i};return await SRe(a),a},wRe=async e=>{let t;try{t=await bW(`${kW(e)}/merge-upstream`,{method:`POST`,body:{branch:xq.branch},responseType:`raw`})}catch(t){bG(e,t);return}t.ok||xG(e)},TRe=async()=>{let{owner:e,repo:t}=xq;await _G({repoPath:`${e}/${t}`,fetchAccess:_Re,prepare:async()=>{xq.branch||await wq()},fetchFork:xRe,prepareFork:wRe,fetchForkingAllowed:({allowForking:e})=>e,createFork:CRe})},ERe=async()=>{await gG(TRe)},Eq=(e,t,n,r=(e,t)=>e===t)=>{let i=e.some(e=>r(e,t));return n&&!i?[...e,t]:!n&&i?e.filter(e=>!r(e,t)):e},Dq=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t)),DRe=(e,t,{useBranch:n=!1}={})=>{let r=e.map(({index:e,fragment:n})=>`${t}_${e}: ${n}`).join(`
|
||
`);return`
|
||
query($owner: String!, $repo: String!${n?`, $branch: String!`:``}) {
|
||
repository(owner: $owner, name: $repo) {
|
||
${r}
|
||
}
|
||
}
|
||
`},Oq=async({items:e,alias:t,getFragment:n,chunkSize:r,useBranch:i=!1,variables:a={}})=>{let o=Array(e.length).fill(void 0);return await lU(Dq(e.map((e,t)=>({index:t,fragment:n(e)})).filter(({fragment:e})=>!!e),r),async e=>{let n=await xW(DRe(e,t,{useBranch:i}),{...a});e.forEach(({index:e})=>{o[e]=n?.repository?.[`${t}_${e}`]})}),o},ORe=`
|
||
query($owner: String!, $repo: String!, $branch: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
ref(qualifiedName: $branch) {
|
||
target {
|
||
... on Commit {
|
||
history(first: 1) {
|
||
nodes {
|
||
oid
|
||
message
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,kq=async e=>{let{owner:t,repo:n}=e?Tq():xq,r=e??xq.branch,i=await xW(ORe,{owner:t,repo:n,...e?{branch:r}:{}});if(!i.repository)throw kU(`repository_not_found`,{repo:n});if(!i.repository.ref)throw kU(`branch_not_found`,{repo:n,branch:r});let{oid:a,message:o}=i.repository.ref.target.history.nodes[0];return{hash:a,message:o}},Aq=10485760,kRe=async({headOid:e,branch:t})=>e||(!t&&EG.current?EG.current:(await kq(t)).hash),ARe=5e3,jRe=[408,413,499,502,504],MRe=(e,t=new Set)=>({queue:e.filter(({path:e})=>!t.has(e)).toSorted((e,t)=>Number(typeof e.data==`string`)-Number(typeof t.data==`string`)),addedAgain:e.filter(({path:e})=>t.has(e))}),NRe=(e,t)=>{let n=[],r=0;for(;e.length&&(!n.length||r+e[0].contents.length<=t);){let t=e.shift();n.push(t),r+=t.contents.length}return n},jq=e=>e.reduce((e,{contents:t})=>e+t.length,0),PRe=(e,t)=>Math.max(1,Math.ceil(jq(e)/t)),FRe=(e,t)=>Math.min(16777216,Math.max(262144,Math.floor(e/Math.max(t,1)*ARe))),IRe=e=>e?.message===`Failed to send the request`||jRe.includes(e?.cause?.status),LRe=e=>{let[t,...n]=e.split(/\r?\n/),r=n.join(`
|
||
`).trim();return r?{headline:t,body:r}:{headline:t}},RRe=async({owner:e,repo:t,branch:n,expectedHeadOid:r,additions:i,deletions:a,message:o,onWorkflowBranch:s})=>{let c=`
|
||
mutation($input: CreateCommitOnBranchInput!) {
|
||
createCommitOnBranch(input: $input) {
|
||
commit {
|
||
oid
|
||
committedDate
|
||
${i.map(({index:e,path:t,data:n})=>vP(n??``)<=Aq?`file_${e}: file(path: ${JSON.stringify(t)}) { oid }`:``).filter(Boolean).join(` `)}
|
||
}
|
||
}
|
||
}
|
||
`,l={branch:{repositoryNameWithOwner:`${e}/${t}`,branchName:n},expectedHeadOid:r,fileChanges:{additions:i.map(({path:e,contents:t})=>({path:e,contents:t})),deletions:a},message:LRe(o)};try{let{createCommitOnBranch:{commit:e}}=await xW(c,{input:l},{retryable:!0});return e}catch(e){throw s||await AU(r,kq),e}},Mq=async(e,t)=>{yG(t);let{owner:n,repo:r}=t.branch?Tq():xq,i=t.branch??xq.branch,a=await Promise.all(e.filter(({action:e})=>[`create`,`update`,`move`].includes(e)).map(async({path:e,data:t},n)=>({index:n,path:e,contents:await Sk(t??``),data:t}))),o=e.filter(({action:e})=>[`move`,`delete`].includes(e)).map(({previousPath:e,path:t})=>({path:e??t})),{queue:s,addedAgain:c}=MRe(a,new Set(o.map(({path:e})=>e))),l=DU(wU(e,t)),u=await kRe(t),d=2097152,f=1/0,p=0,m={},h={};try{do{cRe(p,p+PRe(s,d));let e=NRe(s,d),a=!s.length,g=jq(e),_=performance.now();try{m=await RRe({owner:n,repo:r,branch:i,expectedHeadOid:u,additions:a?[...e,...c]:e,deletions:a?o:[],message:l,onWorkflowBranch:!!t.branch})}catch(n){if(e.length>1&&IRe(n)&&(await kq(t.branch).catch(()=>void 0))?.hash===u){s.unshift(...e),f=Math.min(f,g),d=Math.floor(g/2);continue}throw p&&!t.branch&&(EG.current=u),n}d=Math.min(FRe(g,performance.now()-_),f-1),p+=1,Object.assign(h,m),u=m.oid}while(s.length)}finally{bq()}return{sha:m.oid,date:new Date(m.committedDate),files:Object.fromEntries(a.map(({index:e,path:t,data:n})=>[t,{sha:h[`file_${e}`]?.oid,...n instanceof Blob&&n.size>Aq?{file:n}:{}}]))}},zRe=50,BRe=async e=>OU((await Oq({items:e,alias:`history`,useBranch:!0,getFragment:e=>`
|
||
ref(qualifiedName: $branch) {
|
||
target {
|
||
... on Commit {
|
||
history(first: 100, path: ${JSON.stringify(e)}) {
|
||
nodes {
|
||
oid
|
||
messageHeadline
|
||
author {
|
||
name
|
||
email
|
||
avatarUrl
|
||
user { login }
|
||
}
|
||
committedDate
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,chunkSize:zRe})).flatMap(e=>(e?.target?.history?.nodes??[]).map(e=>({sha:e.oid,message:e.messageHeadline??``,authorName:e.author?.name??``,authorEmail:e.author?.email,authorAvatarURL:e.author?.avatarUrl,authorLogin:e.author?.user?.login,date:new Date(e.committedDate)})))),VRe=async()=>bW(`${kW(xq)}/dispatches`,{method:`POST`,body:{event_type:`sveltia-cms-publish`},responseType:`raw`}),Nq={commits:20,deployments:10,checkSuites:10,checkRuns:20},HRe={SUCCESS:`ready`,PENDING:`pending`,EXPECTED:`pending`,FAILURE:`error`,ERROR:`error`},URe={SUCCESS:`ready`,PENDING:`pending`,QUEUED:`pending`,IN_PROGRESS:`pending`,WAITING:`pending`,FAILURE:`error`,ERROR:`error`},WRe={SUCCESS:`ready`,NEUTRAL:`ready`,FAILURE:`error`,TIMED_OUT:`error`,STARTUP_FAILURE:`error`,ACTION_REQUIRED:`error`},GRe=/preview/i,KRe=async()=>{let{repository:e}=await xW(`
|
||
query($owner: String!, $repo: String!, $branch: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
ref(qualifiedName: $branch) {
|
||
target {
|
||
... on Commit {
|
||
oid
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`);return e?.ref?.target?.oid??void 0},Pq=(e,t)=>Oq({items:e,alias:`commit`,getFragment:e=>`object(oid: ${JSON.stringify(e)}) { ... on Commit { ${t} } }`,chunkSize:Nq.commits}),Fq={status:{selection:`status { contexts { context state targetUrl description } }`,parse:(e,t,n)=>{(e?.status?.contexts??[]).forEach(({context:e,state:r,targetUrl:i,description:a})=>{let o=HRe[r];o&&n[t].push({name:e??``,url:i??void 0,state:o,description:a??void 0,source:`status`})})}},deployments:{selection:`deployments(
|
||
last: ${Nq.deployments}
|
||
orderBy: { field: CREATED_AT, direction: ASC }
|
||
) {
|
||
nodes {
|
||
environment
|
||
latestStatus {
|
||
state
|
||
environmentUrl
|
||
description
|
||
}
|
||
}
|
||
}`,parse:(e,t,n)=>{(e?.deployments?.nodes??[]).forEach(({environment:e,latestStatus:r})=>{let i=URe[r?.state];i&&n[t].push({name:e??``,url:r?.environmentUrl??void 0,state:i,description:r?.description??void 0,source:`deployment`})})}},checks:{selection:`checkSuites(last: ${Nq.checkSuites}) {
|
||
nodes {
|
||
checkRuns(last: ${Nq.checkRuns}) {
|
||
nodes {
|
||
name
|
||
status
|
||
conclusion
|
||
detailsUrl
|
||
summary
|
||
}
|
||
}
|
||
}
|
||
}`,parse:(e,t,n)=>{(e?.checkSuites?.nodes??[]).forEach(e=>{(e?.checkRuns?.nodes??[]).forEach(({name:e,status:r,conclusion:i,detailsUrl:a,summary:o})=>{let s=r===`COMPLETED`?WRe[i]:`pending`;s&&n[t].push({name:e??``,url:fIe(o,a)??(GRe.test(e??``)?a??void 0:void 0),state:s,source:`check`})})})}}},Iq=!1,qRe=async(e,t)=>{let n=await Pq(e,Object.values(Fq).map(({selection:e})=>e).join(`
|
||
`));e.forEach((e,r)=>{Object.values(Fq).forEach(({parse:i})=>i(n[r],e,t))})},JRe=async(e,t)=>{await Promise.all(Object.values(Fq).map(({selection:n,parse:r})=>FG(async()=>{let i=await Pq(e,n);e.forEach((e,n)=>r(i[n],e,t))})))},YRe=async(e,t)=>{await lU(Dq(e,Nq.commits),async e=>{if(!Iq)try{await qRe(e,t);return}catch(e){console.warn(`Falling back to a request per deployment source.`,e),Iq=!0}await JRe(e,t)})},XRe=async e=>IG(e,{collect:YRe,selfURL:xq.repoURL}),ZRe=10,Lq=e=>{let t=Math.max(100/(Math.max(e,1)*ZRe)*100,.1),n=0;$A.current=n;let r=window.setInterval(()=>{n=Math.min(n+t,99),$A.current=n},100);return()=>{window.clearInterval(r),$A.current=void 0}},Rq=async(e,t)=>{let n=t?`?recursive=1`:``;return await bW(`${kW(xq)}/git/trees/${oP(e)}${n}`)},QRe=async e=>{let t=e??xq.branch,n=yH(),r=[],i=[n?{sha:`${t}:${n}`,prefix:`${n}/`}:{sha:t,prefix:``}];for(;i.length;){let e=await uU(i,async({sha:e,prefix:r})=>{let{tree:i,truncated:a}=await Rq(e,!0).catch(r=>{throw n&&e===`${t}:${n}`&&r?.cause?.status===404?fU(`Failed to list the files.`,`root_dir_not_found`,{repo:`${xq.owner}/${xq.repo}`,dir:n}):r});if(!a)return{prefix:r,entries:i,subtrees:[]};let{tree:o,truncated:s}=await Rq(e,!1);if(s)throw Error(`The directory '${r||`/`}' has too many files to list.`);return{prefix:r,entries:o,subtrees:o.filter(({type:e})=>e===`tree`)}});i=e.flatMap(({prefix:e,subtrees:t})=>t.map(({path:t,sha:n})=>({sha:n,prefix:`${e}${t}/`}))),e.forEach(({prefix:e,entries:t})=>{t.forEach(t=>{t.type===`blob`&&r.push({...t,path:`${e}${t.path}`})})})}return WG(r)},$Re=`
|
||
query($owner: String!, $repo: String!, $expression: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
object(expression: $expression) {
|
||
oid
|
||
}
|
||
}
|
||
}
|
||
`,eze=async(e,t)=>{let{owner:n,repo:r}=xq;return(await xW($Re,{owner:n,repo:r,expression:`${e}:${t}`})).repository?.object?.oid},tze=250,nze=({type:e,sha:t})=>e===`asset`?``:`object(oid: ${JSON.stringify(t)}) { ... on Blob { text isTruncated } }`,rze=({path:e})=>`
|
||
ref(qualifiedName: $branch) {
|
||
target {
|
||
... on Commit {
|
||
history(first: 1, path: ${JSON.stringify(e)}) {
|
||
nodes {
|
||
author {
|
||
name
|
||
email
|
||
user {
|
||
id: databaseId
|
||
login
|
||
}
|
||
}
|
||
committedDate
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,zq=async({owner:e,repo:t,sha:n,responseType:r})=>bW(`${kW({owner:e,repo:t})}/git/blobs/${n}`,{headers:{Accept:`application/vnd.github.raw`},responseType:r}),Bq=async({owner:e,repo:t,sha:n})=>zq({owner:e,repo:t,sha:n,responseType:`text`}),ize=async(e,t)=>{let n=[],r=e.map(({path:e,sha:r,size:i},a)=>{let{text:o,isTruncated:s}=t[a]??{},c={sha:r,size:i,text:o,meta:void 0};return s&&n.push({sha:r,data:c}),[e,c]}),{owner:i,repo:a}=xq;return await lU(n,async({sha:e,data:t})=>{t.text=await Bq({owner:i,repo:a,sha:e})}),Object.fromEntries(r)},aze=(e,t)=>Object.fromEntries(e.flatMap(({path:e},n)=>{let r=t[n]?.target?.history?.nodes?.[0];if(!r)return[];let{author:i,committedDate:a}=r,o=i?.user;return[[e,{commitAuthor:i?{name:i.name,email:i.email,id:o?.id,login:o?.login}:void 0,commitDate:new Date(a)}]]})),Vq=(e,t,n,{useBranch:r=!1}={})=>Oq({items:e,alias:t,getFragment:n,chunkSize:tze,useBranch:r}),oze=async e=>{let t=Lq(e.length),n;try{n=await Vq(e,`content`,nze)}finally{t()}return ize(e,n)},sze=async e=>aze(e,await Vq(e,`commit`,rze,{useBranch:!0})),cze=async({lastCommit:e}={})=>{await aK({isOpenAuthoringConfigured:pRe,initOpenAuthoring:ERe,repository:xq,checkAccess:lRe,checkBranchAccess:dRe,fetchDefaultBranchName:wq,fetchLastCommit:kq,lastCommit:e,fetchFileList:QRe,fetchFileContents:oze,fetchFileMetadata:sze})},lze=async e=>{let{owner:t,repo:n}=e.workflow?Tq():xq,{sha:r}=e,i=await zq({owner:t,repo:n,sha:r,responseType:`raw`});if(!i.ok)throw Error(`Failed to fetch the blob`,{cause:{status:i.status}});return i.blob()},uze=`https://www.githubstatus.com/api/v2/status.json`,dze=async()=>{try{let{status:{indicator:e}}=await aW(uze);if(e===`none`)return`none`;if(e===`minor`)return`minor`;if(e===`major`||e===`critical`)return`major`}catch{}return`unknown`},Hq=[`PENDING`,`EXPECTED`],fze=[`REVIEW_REQUIRED`,`CHANGES_REQUESTED`],pze=[`CLEAN`,`HAS_HOOKS`,`UNSTABLE`],mze=cG,hze=`
|
||
query($owner: String!, $repo: String!, $number: Int!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
pullRequest(number: $number) {
|
||
id
|
||
state
|
||
merged
|
||
mergeStateStatus
|
||
reviewDecision
|
||
viewerCanEnableAutoMerge
|
||
autoMergeRequest {
|
||
enabledAt
|
||
}
|
||
commits(last: 1) {
|
||
nodes {
|
||
commit {
|
||
statusCheckRollup {
|
||
state
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,gze=`
|
||
mutation($input: EnablePullRequestAutoMergeInput!) {
|
||
enablePullRequestAutoMerge(input: $input) {
|
||
clientMutationId
|
||
}
|
||
}
|
||
`,_ze=`
|
||
mutation($input: DisablePullRequestAutoMergeInput!) {
|
||
disablePullRequestAutoMerge(input: $input) {
|
||
clientMutationId
|
||
}
|
||
}
|
||
`,Uq=async e=>{let{owner:t,repo:n}=xq,{repository:r}=await xW(hze,{owner:t,repo:n,number:e.number}),i=r?.pullRequest;if(i)return{...i,checkState:i.commits?.nodes?.[0]?.commit?.statusCheckRollup?.state}},Wq=e=>e?.state===`OPEN`&&e.mergeStateStatus===`UNKNOWN`,vze=e=>lG(()=>Uq(e),e=>!Wq(e),mze),yze=e=>e.state===`OPEN`&&e.mergeStateStatus===`BLOCKED`&&(!!e.viewerCanEnableAutoMerge||!!e.autoMergeRequest)&&Hq.includes(e.checkState)&&!fze.includes(e.reviewDecision),Gq=async(e,t)=>{try{await xW(_ze,{input:{pullRequestId:e}})}catch(e){console.warn(`Failed to cancel the auto-merge on pull request #${t}.`,e)}},bze=async(e,t)=>{let{number:n}=e;await DK({read:()=>Uq(e),evaluate:async e=>{if(e?.merged)return!0;let{state:r,autoMergeRequest:i,checkState:a}=e??{},o=!!i,s=!Hq.includes(a)&&a!==`SUCCESS`;if(r!==`OPEN`||!o||s)throw r===`OPEN`&&o&&await Gq(t,n),Error(`Pull request #${n} was not merged: ${r}, checks ${a}, auto-merge ${o?`on`:`off`}`);return!1},cancel:()=>Gq(t,n),label:`pull request #${n}`})},xze=async({pullRequest:e,node:t,squash:n,merge:r})=>{if(t.autoMergeRequest)return!0;let{title:i,headSHA:a}=e;try{return await xW(gze,{input:{pullRequestId:t.id,mergeMethod:n?`SQUASH`:`MERGE`,commitHeadline:i,...a?{expectedHeadOid:a}:{}}}),!0}catch{let t=await Uq(e);return t?.merged?!1:t?.autoMergeRequest?!0:(await r(),!1)}},Sze=async({pullRequest:e,squash:t,merge:n,refusal:r})=>{let i=await vze(e);if(!i?.merged){if(Wq(i))throw Error(`Timed out waiting for GitHub to check whether pull request #${e.number} can be merged`,{cause:r});if(pze.includes(i?.mergeStateStatus))await n();else if(i&&yze(i))await xze({pullRequest:e,node:i,squash:t,merge:n})&&await bze(e,i.id);else throw r}},Kq={pullRequests:100,files:100,labels:100,branches:100,branchPullRequests:2},qq=e=>e.map(({path:e,changeType:t})=>({path:e,sha:``,size:0,deleted:t===`DELETED`,renamed:t===`RENAMED`})),Jq=async e=>{e.files=uK(await bW(`${jW(xq,e.number)}/files?per_page=${Kq.files}`),{removedStatus:`removed`})},Cze=100,Yq=async e=>{let t=[];if(e.forEach(e=>{e.files.forEach(n=>{n.deleted||t.push({pullRequest:e,file:n})})}),!t.length)return;let n=Tq(),r=await Oq({items:t,alias:`file`,getFragment:({pullRequest:{headSHA:e,branch:t},file:n})=>`
|
||
object(expression: ${JSON.stringify(`${e??t}:${n.path}`)}) {
|
||
... on Blob {
|
||
oid
|
||
byteSize
|
||
isBinary
|
||
isTruncated
|
||
text
|
||
}
|
||
}
|
||
`,chunkSize:Cze,variables:n}),i=[];t.forEach(({file:e},t)=>{let n=r[t];n?(Object.assign(e,{sha:n.oid,size:n.byteSize,text:n.isBinary?void 0:n.text??void 0}),!n.isBinary&&n.isTruncated&&i.push(e)):e.deleted=!0}),await lU(i,async e=>{e.text=await Bq({...n,sha:e.sha})})},wze=`
|
||
query($owner: String!, $repo: String!, $branch: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
branchHead: ref(qualifiedName: $branch) {
|
||
target {
|
||
oid
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,Xq=async e=>{let{owner:t,repo:n}=Tq(),{repository:r}=await xW(wze,{owner:t,repo:n,branch:`refs/heads/${e}`});return r?.branchHead?.target?.oid},Zq=async e=>{await fK({branch:e,path:`${kW(Tq())}/git/refs/heads/${oP(e)}`,goneStatuses:[404,422]})},Tze=async(e,t)=>{let{labels:n=[]}=await bW(jW(xq,e.number)),r=IK(n.map(({name:e})=>e),t);await bW(`${kW(xq)}/issues/${e.number}`,{method:`PATCH`,body:{labels:r}})},Qq=async(e,t)=>{await xW(`
|
||
mutation($input: ${t?`ConvertPullRequestToDraftInput`:`MarkPullRequestReadyForReviewInput`}!) {
|
||
${t?`convertPullRequestToDraft`:`markPullRequestReadyForReview`}(input: $input) {
|
||
pullRequest {
|
||
isDraft
|
||
}
|
||
}
|
||
}
|
||
`,{input:{pullRequestId:e.nodeId}})},$q=async({branch:e,title:t,status:n})=>{let{branch:r}=xq,i=MB.current,a=n===`draft`,o=await bW(`${kW(xq)}/pulls`,{method:`POST`,body:{title:t,head:i?`${i.owner}:${e}`:e,base:r,draft:a,body:`Automatically generated by Sveltia CMS`}}),s={number:o.number,nodeId:o.node_id,title:o.title,url:o.html_url,branch:e,headSHA:o.head?.sha,status:n,createdDate:new Date(o.created_at),updatedDate:new Date(o.updated_at),files:[]};return i||await bW(`${kW(xq)}/issues/${o.number}/labels`,{method:`POST`,body:{labels:[PK(n)]}}),s},Eze=()=>`
|
||
query($owner: String!, $repo: String!, $prefix: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
refs(refPrefix: $prefix, first: ${Kq.branches}) {
|
||
nodes {
|
||
name
|
||
target {
|
||
... on Commit {
|
||
oid
|
||
message
|
||
committedDate
|
||
author {
|
||
name
|
||
email
|
||
user {
|
||
login
|
||
databaseId
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,Dze=50,Oze=e=>`
|
||
pullRequests(
|
||
headRefName: ${JSON.stringify(e)}
|
||
baseRefName: ${JSON.stringify(xq.branch)}
|
||
states: [OPEN, CLOSED, MERGED]
|
||
first: ${Kq.branchPullRequests}
|
||
orderBy: { field: CREATED_AT, direction: DESC }
|
||
) {
|
||
nodes {
|
||
id
|
||
number
|
||
title
|
||
url
|
||
state
|
||
isDraft
|
||
createdAt
|
||
updatedAt
|
||
headRefOid
|
||
headRepositoryOwner {
|
||
login
|
||
}
|
||
author {
|
||
login
|
||
}
|
||
files(first: ${Kq.files}) {
|
||
nodes {
|
||
path
|
||
changeType
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,eJ=e=>{let t=vU.account?.login?.toLowerCase();return e.headRepositoryOwner?.login===MB.current?.owner&&!!t&&e.author?.login?.toLowerCase()===t},kze=async e=>{let t=new Map;if(!e.length)return t;let n=await Oq({items:e,alias:`pr`,getFragment:Oze,chunkSize:Dze});return e.forEach((e,r)=>{let[i]=(n[r]?.nodes??[]).filter(eJ);i&&t.set(e,i)}),t},Aze=(e,t,n)=>{let{message:r,committedDate:i,author:a}=e.target??{},o=n?.state===`MERGED`?void 0:n,{login:s,databaseId:c}=a?.user??{},l=o?.state===`OPEN`,u=l&&!o.isDraft;return{number:o?.number,nodeId:o?.id,title:o?.title??r??``,url:o?.url,branch:t,headSHA:e.target?.oid,status:u?`pending_review`:`draft`,createdDate:new Date(o?.createdAt??i),updatedDate:new Date(o?.updatedAt??i),author:a?.name?{name:a.name,email:a.email??``,id:c,login:s}:void 0,files:l?qq(o.files?.nodes??[]):[]}},jze=async()=>{let{owner:e,repo:t}=Tq(),n=nq(),{repository:r}=await xW(Eze(),{owner:e,repo:t,prefix:`refs/heads/${n}`}),i=r?.refs?.nodes??[];i.length===Kq.branches&&console.warn(`Only the first ${Kq.branches} Editorial Workflow branches in the fork are listed. Publish or discard some entries to see the rest.`);let a=i.map(({name:e})=>`${n}${e}`),o=await kze(a);return SG(i,(e,t)=>{let n=a[t],r=o.get(n);return r?.state===`MERGED`&&r.headRefOid===e.target?.oid?{leftover:n}:{pending:Aze(e,n,r)}},Zq)},Mze=async e=>{let{branch:t}=xq,{owner:n}=Tq(),r=oP(t),i=`${encodeURIComponent(n)}:${oP(e.branch)}`,{files:a=[]}=await bW(`${kW(xq)}/compare/${r}...${i}?per_page=${Kq.files}`);e.files=uK(a,{removedStatus:`removed`})},Nze=async()=>{let e=await jze();await lU(e.filter(({files:e})=>!e.length),Mze),await lU(e.filter(({files:e})=>e.some(({renamed:e})=>e)),Jq);let t=e.filter(({files:e})=>e.length);return await Yq(t),t},Pze=`
|
||
query($id: ID!) {
|
||
node(id: $id) {
|
||
... on PullRequest {
|
||
state
|
||
isDraft
|
||
baseRefName
|
||
headRefOid
|
||
headRepositoryOwner {
|
||
login
|
||
}
|
||
author {
|
||
login
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,Fze=async({nodeId:e})=>{let{node:t}=await xW(Pze,{id:e});if(t)return{merged:t.state===`MERGED`,isEntryRequest:t.baseRefName===xq.branch&&eJ(t),getMergedSHA:async()=>t.headRefOid,state:t.state,draft:t.isDraft}},Ize=e=>TK(e,{repository:xq,updateDraftState:Qq}),Lze=async(e,t)=>CG({pullRequest:e,status:t,requestKey:`nodeId`,createRequest:$q,fetchRequest:Fze,applyStatus:Ize,fetchBranchHead:Xq,deleteBranch:Zq}),Rze=()=>`
|
||
id
|
||
number
|
||
title
|
||
url
|
||
isDraft
|
||
isCrossRepository
|
||
baseRefName
|
||
createdAt
|
||
updatedAt
|
||
headRefName
|
||
headRefOid
|
||
author {
|
||
login
|
||
avatarUrl
|
||
... on User {
|
||
name
|
||
email
|
||
databaseId
|
||
}
|
||
}
|
||
labels(first: ${Kq.labels}) {
|
||
nodes {
|
||
name
|
||
}
|
||
}
|
||
files(first: ${Kq.files}) {
|
||
nodes {
|
||
path
|
||
changeType
|
||
}
|
||
}
|
||
`,zze=()=>`
|
||
query($owner: String!, $repo: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
pullRequests(
|
||
states: OPEN
|
||
labels: ${JSON.stringify(FK())}
|
||
first: ${Kq.pullRequests}
|
||
orderBy: { field: UPDATED_AT, direction: DESC }
|
||
) {
|
||
nodes {
|
||
${Rze()}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,Bze=(e,t)=>{let{login:n,name:r,email:i,databaseId:a}=e.author??{};return{number:e.number,nodeId:e.id,title:e.title,url:e.url,branch:e.headRefName,headSHA:e.headRefOid,status:t,createdDate:new Date(e.createdAt),updatedDate:new Date(e.updatedAt),author:n?{name:r??n,email:i??``,id:a,login:n}:void 0,files:qq(e.files?.nodes??[])}},Vze=e=>{if(e.isCrossRepository||e.baseRefName!==xq.branch)return;let t=LK(e.labels.nodes.map(e=>e.name));if(t)return Bze(e,t)},Hze=async()=>{let{repository:e}=await xW(zze()),t=(e?.pullRequests?.nodes??[]).map(Vze).filter(Boolean);return await lU(t.filter(({files:e})=>e.some(({renamed:e})=>e)),Jq),await Yq(t),t},Uze=async()=>NB.current?Nze():Hze(),Wze=`
|
||
query(
|
||
$forkOwner: String!
|
||
$forkRepo: String!
|
||
$owner: String!
|
||
$repo: String!
|
||
$branch: String!
|
||
) {
|
||
fork: repository(owner: $forkOwner, name: $forkRepo) {
|
||
id
|
||
ref(qualifiedName: $branch) {
|
||
name
|
||
}
|
||
defaultBranchRef {
|
||
name
|
||
}
|
||
}
|
||
base: repository(owner: $owner, name: $repo) {
|
||
ref(qualifiedName: $branch) {
|
||
target {
|
||
oid
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,Gze=`
|
||
mutation($input: CreateRefInput!) {
|
||
createRef(input: $input) {
|
||
ref {
|
||
name
|
||
}
|
||
}
|
||
}
|
||
`,Kze=()=>`
|
||
query($owner: String!, $repo: String!, $branch: String!) {
|
||
repository(owner: $owner, name: $repo) {
|
||
pullRequests(headRefName: $branch, states: OPEN, first: ${Kq.pullRequests}) {
|
||
nodes {
|
||
number
|
||
isCrossRepository
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,qze=async e=>{let{owner:t,repo:n}=xq,{repository:r}=await xW(Kze(),{owner:t,repo:n,branch:e});return(r?.pullRequests?.nodes??[]).filter(({isCrossRepository:e})=>!e)},Jze=async(e,t)=>{await bW(`${kW(xq)}/git/refs/heads/${oP(e)}`,{method:`PATCH`,body:{sha:t,force:!0}})},tJ=e=>e.cause?.message??``,nJ=async(e,t,n)=>{try{await xW(Gze,{input:{repositoryId:e,name:`refs/heads/${t}`,oid:n}});return}catch(e){return e}},Yze=async(e,t)=>{let{branch:n}=xq,r=oP(n),i=`${encodeURIComponent(e)}:${oP(t)}`;try{let{merge_base_commit:e}=await bW(`${kW(xq)}/compare/${r}...${i}?per_page=1`);return e?.sha}catch{return}},Xze=async e=>{let{repo:t}=xq,{owner:n,repo:r}=Tq(),{fork:i,base:a}=await xW(Wze,{forkOwner:n,forkRepo:r});if(!i)throw fU(`Failed to create the branch.`,`repository_not_found`,{repo:r});if(!a)throw fU(`Failed to create the branch.`,`repository_not_found`,{repo:t});if(!a.ref)throw fU(`Failed to create the branch.`,`branch_not_found`,{repo:t,branch:xq.branch});let o=a.ref.target.oid,s=await nJ(i.id,e,o);if(s&&NB.current&&/permission/i.test(tJ(s))){let t=i.ref?.name??i.defaultBranchRef?.name,r=t?await Yze(n,t):void 0;r&&r!==o&&(o=r,s=await nJ(i.id,e,o))}if(s){let t=tJ(s);if(!t.includes(`already exists`))throw Error(`Failed to create the branch.`,{cause:Error(t||s.message)});if(NB.current)return{};let[n]=await qze(e);if(n)throw fU(`The workflow branch is in use by another pull request.`,`workflow.branch_in_use`,{number:`#${n.number}`});await Jze(e,o)}return{headOid:o}},Zze=(e,t)=>_K(e,t,{updateForkStatus:Lze,updateLabels:Tze,updateDraftState:Qq}),Qze=e=>SK(xq,e,`APPROVE`),$ze=`The entry is no longer ready to publish.`,eBe=async e=>{let t=`${jW(xq,e.number)}/reviews`,n=await bW(`${t}?per_page=100`);await Promise.all(CK(n).map(({id:e})=>bW(`${t}/${e}/dismissals`,{method:`PUT`,body:{message:$ze,event:`DISMISS`}})))},tBe=async(e,t)=>{let{headOid:n}=await Xze(t.branch);return Mq(e,{...t,headOid:n})},nBe=async(e,t,n)=>{let{branch:r=``}=t;try{return await Mq(e,{...t,headOid:n.headSHA})}catch(e){throw await Xq(r).then(e=>e===void 0,()=>!1)?hK(r,Tq()):e}},rBe=async e=>pK(e,{commitToNewBranch:tBe,commitToExistingBranch:nBe,createPullRequest:$q}),iBe=300,aBe={added:`added`,copied:`added`,removed:`removed`,renamed:`renamed`},oBe=async({headSHA:e,paths:t})=>{let n=vK(t),r=await Oq({items:n,alias:`tree`,getFragment:t=>`
|
||
object(expression: ${JSON.stringify(`${e}:${t}`)}) {
|
||
... on Tree {
|
||
entries {
|
||
name
|
||
mode
|
||
}
|
||
}
|
||
}
|
||
`,chunkSize:50}),i=new Map;return n.forEach((e,t)=>{(r[t]?.entries??[]).forEach(({name:t,mode:n})=>{i.set(e?`${e}/${t}`:t,Number(n).toString(8))})}),i},sBe={isGit:!0,name:`github`,label:`GitHub`,repository:xq,statusDashboardURL:`https://www.githubstatus.com/`,checkStatus:dze,init:()=>{let{backend:e}=$O.current??{};if(e?.name!==`github`)return;let{repo:t,branch:n,auth_type:r=``,base_url:i=r===`pkce`?`https://github.com`:`https://api.netlify.com`,auth_endpoint:a=r===`pkce`?`login/oauth/authorize`:`auth`,app_id:o=``,api_root:s=`https://api.github.com`,graphql_api_root:c=s,include_credentials:l=!1,auth_scope:u=`repo`}=e,[d,f]=t.split(`/`);return lq(xq,{service:`github`,label:`GitHub`,owner:d,repo:f,branch:n,restApiRoot:s,defaultApiRoot:`https://api.github.com`,getTokenPageURL:iRe,getBaseURLs:Sq,authRoot:i,authPath:a,tokenPath:`/access_token`,api:{clientId:o,authScope:[u,`user`].flat().join(`,`),restBaseURL:tRe(s),graphqlBaseURL:nRe(c),includeCredentials:l}}),Object.assign(hW,{owner:d,repo:f,branch:n}),xq},signIn:aRe,signOut:iG,fetchFiles:cze,fetchLastCommit:kq,fetchBlob:lze,fetchDirSHA:eze,commitChanges:Mq,fetchFileCommits:BRe,triggerDeployment:VRe,fetchBranchHeadSHA:KRe,fetchDeployments:XRe,workflow:{fetchPullRequests:Uze,savePullRequest:rBe,updateStatus:Zze,approve:Qze,withdrawApproval:eBe,fetchBranchHead:Xq,fetchMergeState:async e=>{let{branch:t}=xq,{head:n,base:r}=await bW(jW(xq,e.number)),i=n?.sha;return xK({pullRequest:e,headSHA:i,onConfiguredBranches:r?.ref===t&&AW(r?.repo?.full_name,xq)&&AW(n?.repo?.full_name,xq),listChangedFiles:async e=>{let n=oP(t),{files:r=[]}=await bW(`${kW(xq)}/compare/${n}...${e}`);return{files:await yK(r,{statusMap:aBe,headSHA:e,fetchFileModes:oBe}),complete:r.length<iBe}}})},fetchUnchangedPaths:async({headSHA:e,paths:t})=>{let n=[xq.branch,e],r=await Oq({items:t.flatMap(e=>n.map(t=>`${t}:${e}`)),alias:`file`,getFragment:e=>`object(expression: ${JSON.stringify(e)}) { oid }`,chunkSize:100});return t.filter((e,t)=>(r[t*2]?.oid??null)===(r[t*2+1]?.oid??null))},publish:async e=>{vG();let{number:t,title:n,headSHA:r}=e,i=dK(),a=()=>bW(`${jW(xq,t)}/merge`,{method:`PUT`,body:{merge_method:i?`squash`:`merge`,commit_title:n,sha:r}});try{await a()}catch(t){if(t.cause?.status!==405)throw t;await Sze({pullRequest:e,squash:i,merge:a,refusal:t})}await Zq(e.branch)},discard:e=>wK(xq,e,{deleteBranch:Zq})}},cBe=e=>VW(e,`gitlab`,{name:`name`,login:`username`,profileURL:`web_url`}),lBe=e=>`${e}/-/user_settings/personal_access_tokens?${new URLSearchParams({name:`Sveltia CMS`,scopes:`api,read_user`})}`,uBe=e=>rG({options:e,getUserProfile:cBe}),dBe=/(?<owner>.+)\/(?<repo>[^/]+)$/,rJ={...DW},iJ=e=>e.match(dBe)?.groups??{},aJ=e=>{let{owner:t,repo:n}=e??rJ;return encodeURIComponent(`${t}/${n}`)},oJ=(e,t)=>`/projects/${aJ(t)}/repository/branches/${encodeURIComponent(e)}`,sJ=MW({tree:`/-/tree`,blob:`/-/blob`,commit:`/-/commit`}),fBe=`
|
||
query($fullPath: ID!) {
|
||
project(fullPath: $fullPath) {
|
||
userPermissions {
|
||
pushCode
|
||
}
|
||
}
|
||
}
|
||
`,cJ=async()=>{let e=await xW(fBe);return{found:!!e.project,canPush:!!e.project?.userPermissions.pushCode}},pBe=async()=>{let{repo:e}=rJ,t;try{t=await cJ()}catch(e){let t=e?.cause?.status;throw gU(rJ,t===404?void 0:t)}if(!t.canPush)throw hU(e,t.found)},mBe=async()=>{await jB(rJ.branch,async e=>({canPush:(await bW(oJ(e))).can_push}))},hBe=`
|
||
query($fullPath: ID!) {
|
||
project(fullPath: $fullPath) {
|
||
repository {
|
||
rootRef
|
||
}
|
||
}
|
||
}
|
||
`,gBe=async()=>{let e=await xW(hBe),t=PW(rJ,{found:!!e.project,branch:e.project?.repository?.rootRef,getBaseURLs:sJ});return Object.assign(hW,{branch:t}),t},_Be=100,lJ={base:void 0,fork:void 0},vBe=()=>dG(`gitlab`),uJ=()=>fG(rJ),yBe=async()=>{let{owner:e,repo:t}=rJ,n=`${e}/${t}`,r;try{r=await cJ()}catch{throw fU(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:n})}if(!r.found)throw mU(n);return{canWrite:r.canPush}},bBe=async()=>{let{owner:e,repo:t}=rJ,n;try{n=await bW(`/projects/${aJ()}`)}catch{throw fU(`Failed to read the repository.`,`open_authoring.permission_check_failed`,{repo:`${e}/${t}`})}let{id:r,forking_access_level:i}=n;return lJ.base=r,{allowForking:i!==`disabled`}},xBe=async()=>{let{repo:e}=rJ,t=vU.account?.login,n=await sG(`/projects/${aJ({owner:t,repo:e})}`);if(n&&AW(n.forked_from_project?.path_with_namespace,rJ)&&n.namespace?.kind===`user`&&n.namespace?.full_path===t)return lJ.fork=n.id,iJ(n.path_with_namespace)},SBe=async()=>{let e=vU.account?.login,t=(await bW(`/projects/${aJ()}/forks?owned=true&per_page=${_Be}`)).find(({namespace:t})=>t?.kind===`user`&&t?.full_path===e);if(t)return lJ.fork=t.id,iJ(t.path_with_namespace)},CBe=async()=>await xBe()??SBe(),wBe=[`none`,`finished`],TBe=async(e,t)=>{await hG({repoPath:`${e.owner}/${e.repo}`,attemptsLeft:t,checkFork:async()=>{let t;try{({import_status:t}=await bW(`/projects/${aJ(e)}`))}catch{return`pending`}return t===void 0||wBe.includes(t)?`ready`:t===`failed`?`failed`:`pending`}})},EBe=async()=>{let e=vU.account?.login;try{return await bW(`/projects/${aJ({owner:e,repo:rJ.repo})}`),!0}catch{return!1}},DBe=async()=>{let{owner:e,repo:t}=rJ,n=`/projects/${aJ()}/fork`,r=`${e.replaceAll(`/`,`-`)}-${t}`,i=await mG({repoPath:`${e}/${t}`,requestFork:()=>bW(n,{method:`POST`}),requestRenamedFork:()=>bW(n,{method:`POST`,body:{name:r,path:r}}),conflictStatuses:[400,409],isNameTaken:EBe}),a=iJ(i.path_with_namespace);return lJ.fork=i.id,await TBe(a),a},OBe=async()=>{let{owner:e,repo:t}=rJ,n=!1;await _G({repoPath:`${e}/${t}`,fetchAccess:yBe,fetchFork:async()=>{let[e,t]=await Promise.all([bBe(),CBe()]);return{allowForking:n}=e,t},fetchForkingAllowed:()=>n,createFork:DBe})},kBe=async()=>{lJ.base=void 0,lJ.fork=void 0,await gG(OBe)},ABe=`
|
||
query($fullPath: ID!, $branch: String!) {
|
||
project(fullPath: $fullPath) {
|
||
repository {
|
||
tree(ref: $branch) {
|
||
lastCommit {
|
||
sha
|
||
message
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,dJ=async()=>{let{repo:e,branch:t}=rJ,n=await xW(ABe);if(!n.project)throw kU(`repository_not_found`,{repo:e});let{lastCommit:r}=n.project.repository.tree??{};if(!r)throw kU(`branch_not_found`,{repo:e,branch:t});let{sha:i,message:a}=r;return{hash:i,message:a}},fJ=async(e,t)=>{yG(t);let n=t.branch?MB.current:void 0,r=t.branch??rJ.branch,i=(t.branch?t.headOid:EG.current)||void 0,a=await Promise.all(e.map(async({action:e,path:t,previousPath:n,data:r=``})=>({action:e,content:typeof r==`string`?r:await Sk(r),encoding:typeof r==`string`?`text`:`base64`,file_path:t,previous_path:n,...i&&e!==`create`?{last_commit_id:i}:{}}))),o=`/projects/${aJ(n)}/repository/commits`,s={branch:r,commit_message:DU(wU(e,t)),actions:a},{startBranch:c}=t,l=n?{start_project:lJ.base}:{},u;try{u=await bW(o,{method:`POST`,body:c?{...s,start_branch:c,...l}:s,retryable:!0})}catch(e){throw i&&!t.branch&&e.cause?.status===400&&await AU(i,dJ),e}let{id:d,committed_date:f,parent_ids:p}=u,m=await Promise.all(e.map(async({path:e,data:t})=>t===void 0?null:[e,{sha:await bP(t)}]));return{sha:d,date:new Date(f),parentSha:p?.[0],files:Object.fromEntries(m.filter(e=>!!e))}},jBe=new Map,MBe=async e=>{try{return await bA(jBe,e,async()=>{let{avatar_url:t}=await bW(`/avatar?email=${encodeURIComponent(e)}&size=48`);return t||void 0})}catch{return}},NBe=async e=>{let{branch:t}=rJ,n=aJ(),r=await jU(e,e=>bW(`/projects/${n}/repository/commits?ref_name=${encodeURIComponent(t??``)}&path=${encodeURIComponent(e)}&per_page=100`),e=>({sha:e.id,message:e.title??``,authorName:e.author_name,authorEmail:e.author_email,authorAvatarURL:void 0,date:new Date(e.committed_date)})),i=[...new Set(r.map(e=>e.authorEmail))].filter(e=>!!e),a=new Map;return await lU(i,async e=>{a.set(e,await MBe(e))}),r.forEach(e=>{e.authorAvatarURL=a.get(e.authorEmail)}),r},pJ=100,PBe=6048e5,FBe={success:`ready`,pending:`pending`,running:`pending`,created:`pending`,preparing:`pending`,manual:`pending`,scheduled:`pending`,waiting_for_resource:`pending`,failed:`error`,canceled:`error`},IBe={success:`ready`,created:`pending`,running:`pending`,blocked:`pending`,failed:`error`,canceled:`error`},LBe=async()=>bW(`/projects/${aJ()}/pipeline`,{method:`POST`,body:{ref:rJ.branch},responseType:`raw`}),RBe=async()=>{let{branch:e}=rJ;if(e)return(await bW(oJ(e)))?.commit?.id??void 0},zBe=async e=>{let t=new Date(Date.now()-PBe).toISOString();[...await bW(`/projects/${aJ()}/deployments?order_by=updated_at&sort=desc&per_page=${pJ}&updated_after=${encodeURIComponent(t)}`)??[]].reverse().forEach(({sha:t,status:n,environment:r})=>{let i=IBe[n],a=r?.external_url??void 0;i&&t&&e[t]?.push({name:r?.name??``,url:a,state:i,source:`deployment`})})},BBe=async({sha:e},t)=>{(await bW(`/projects/${aJ()}/repository/commits/${encodeURIComponent(e)}/statuses?per_page=${pJ}`)??[]).forEach(({name:n,status:r,target_url:i,description:a})=>{let o=FBe[r];o&&t[e].push({name:n??``,url:i??void 0,state:o,description:a??void 0,source:`status`})})},VBe=async(e,t)=>{await Promise.all([FG(()=>zBe(t)),lU(e,e=>FG(()=>BBe({sha:e,branch:``,kind:`preview`},t)))])},HBe=async e=>IG(e,{collect:VBe,selfURL:rJ.repoURL}),UBe=({scoped:e})=>`
|
||
query($fullPath: ID!, $branch: String!, $cursor: String!${e?`, $path: String!`:``}) {
|
||
project(fullPath: $fullPath) {
|
||
repository {
|
||
tree(ref: $branch, ${e?`path: $path, `:``}recursive: true) {
|
||
blobs(after: $cursor) {
|
||
nodes {
|
||
type
|
||
path
|
||
sha
|
||
}
|
||
pageInfo {
|
||
endCursor
|
||
hasNextPage
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,WBe=`
|
||
query($fullPath: ID!, $ref: String!, $path: String!, $cursor: String!) {
|
||
project(fullPath: $fullPath) {
|
||
repository {
|
||
tree(ref: $ref, path: $path) {
|
||
trees(after: $cursor) {
|
||
nodes {
|
||
name
|
||
sha
|
||
}
|
||
pageInfo {
|
||
endCursor
|
||
hasNextPage
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,GBe=async(e,t)=>{let{dirname:n=``,basename:r}=bk(t),i=``;for(;;){let{nodes:t=[],pageInfo:a}=(await xW(WBe,{ref:e,path:n,cursor:i})).project?.repository?.tree?.trees??{},o=t.find(({name:e})=>e===r)?.sha;if(o||!a?.hasNextPage)return o;i=a.endCursor}},KBe=`
|
||
query($fullPath: ID!, $branch: String!, $paths: [String!]!) {
|
||
project(fullPath: $fullPath) {
|
||
repository {
|
||
blobs(ref: $branch, paths: $paths) {
|
||
nodes {
|
||
path
|
||
size
|
||
rawTextBlob
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,mJ=async(e,t,n={})=>{let r;try{r=await xW(t,{...n,paths:e})}catch(r){if(e.length===1)throw r;let i=Math.ceil(e.length/2),a=await mJ(e.slice(0,i),t,n),o=await mJ(e.slice(i),t,n);return[...a,...o]}return r.project.repository.blobs.nodes},hJ=async(e,t,n={})=>{if(!e.length)return[];let{isSelfHosted:r=!1}=rJ,i=r?20:100,a=r?2:4;return(await uU(Dq(e,i),e=>mJ(e,t,n),{concurrency:a})).flat()},gJ=async({ref:e,path:t})=>{let n=UBe({scoped:!!t}),r=[],i=``;for(;;){let{nodes:a,pageInfo:{endCursor:o,hasNextPage:s}}=(await xW(n,{cursor:i,...e&&{branch:e},...t&&{path:t}})).project.repository.tree?.blobs??{nodes:[],pageInfo:{endCursor:``,hasNextPage:!1}};if(r.push(...a),i=o,!s)break}return r},qBe=async e=>{let t=yH(),n=UPe();if(n){let{dirs:t,files:r}=n,[i,a]=await Promise.all([uU(t,t=>gJ({ref:e,path:bH(t)})),hJ(r.map(e=>bH(e)),`
|
||
query($fullPath: ID!, $branch: String!, $paths: [String!]!) {
|
||
project(fullPath: $fullPath) {
|
||
repository {
|
||
blobs(ref: $branch, paths: $paths) {
|
||
nodes {
|
||
path
|
||
oid
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,e?{branch:e}:{})]),o=[...i.flat(),...a.map(({path:e,oid:t})=>({type:`blob`,path:e,sha:t}))];if(o.length)return WG(o)}return WG(await gJ({ref:e,path:t}))},JBe=async(e,t,n={})=>{let r=await hJ(e,t,n);return Object.fromEntries(r.map(e=>[e.path,e]))},YBe=({fetchingFiles:e,blobs:t})=>Object.fromEntries(e.map(({path:e,sha:n,type:r})=>{let i=t[e]?.rawTextBlob??void 0;return[e,{sha:n,size:0,text:i,meta:i===void 0&&r!==`asset`?void 0:{}}]})),_J=({projectId:e,path:t,ref:n,lfs:r=!1})=>`/projects/${e}/repository/files/${encodeURIComponent(t)}/raw?${r?`lfs=true&`:``}ref=${encodeURIComponent(n)}`,XBe=async(e,t)=>{let n=new TextEncoder;await uU(Object.entries(e).filter(([,{size:e,rawTextBlob:t}])=>typeof t==`string`&&t.length<Number(e??0)&&n.encode(t).length<Number(e)),async([e,n])=>{n.rawTextBlob=await bW(_J({projectId:aJ(),path:e,ref:t}),{responseType:`text`})})},ZBe=async(e,t)=>{let n=Lq(e.length),r=e.filter(({type:e})=>e!==`asset`).map(({path:e})=>e),i;try{i=await JBe(r,KBe,t?{branch:t}:{}),await XBe(i,t??rJ.branch)}finally{n()}return YBe({fetchingFiles:e,blobs:i})},QBe=async({lastCommit:e}={})=>{await aK({isOpenAuthoringConfigured:vBe,initOpenAuthoring:kBe,repository:rJ,checkAccess:pBe,checkBranchAccess:mBe,fetchDefaultBranchName:gBe,fetchLastCommit:dJ,lastCommit:e,fetchFileList:qBe,fetchFileContents:ZBe})},$Be=async e=>{let{branch:t=``}=rJ,{path:n,workflow:r}=e,i=r?.branch??t;return bW(_J({projectId:aJ(r?uJ():void 0),path:n,ref:i,lfs:!0}),{responseType:`blob`})},eVe=`https://status-api.hostedstatus.com/1.0/status/5b36dc6502d06804c08349f7`,tVe=async()=>{try{let{result:{status_overall:{status_code:e}}}=await aW(eVe);if(e===100)return`none`;if([200,300,400].includes(e))return`minor`;if([500,600].includes(e))return`major`}catch{}return`unknown`},vJ=e=>`/projects/${aJ()}/merge_requests/${e}`,yJ={mergeRequests:100,files:100,branches:100,authoredMergeRequests:100},bJ=lK({regex:/^\s*(?:\[draft\]|\(draft\)|draft:)\s*/i,prefix:`Draft: `}),nVe=e=>typeof e.user?.can_merge==`boolean`?e.user.can_merge:void 0,xJ=(e,t)=>{let{name:n,username:r,id:i}=e.author??{};return{number:e.iid,nodeId:String(e.id),title:bJ.strip(e.title),url:e.web_url,branch:e.source_branch,headSHA:e.sha,status:t,createdDate:new Date(e.created_at),updatedDate:new Date(e.updated_at),author:r?{name:n??r,email:``,id:i,login:r}:void 0,files:[],canMerge:nVe(e)}},rVe=e=>{if(e.source_project_id!==e.target_project_id||e.target_branch!==rJ.branch)return;let t=LK(e.labels??[]);if(t)return xJ(e,t)},SJ=e=>({path:e.deleted_file?e.old_path:e.new_path,sha:``,size:0,deleted:!!e.deleted_file,previousPath:e.renamed_file?e.old_path:void 0}),CJ=async e=>(await sG(oJ(e,uJ())))?.commit?.id,iVe=async e=>{let{number:t,branch:n,headSHA:r}=e,i=`/projects/${aJ()}`,[a,o]=await Promise.all([CJ(n),bW(`${vJ(t)}/diffs?per_page=${yJ.files}`)]);if(!a||a===r){e.files=o.map(SJ);return}let{diffs:s=[]}=await bW(`${i}/repository/compare?from=${encodeURIComponent(rJ.branch)}&to=${encodeURIComponent(a)}&straight=false`);Object.assign(e,{headSHA:a,files:s.map(SJ)})},aVe=`
|
||
query($fullPath: ID!, $branch: String!, $paths: [String!]!) {
|
||
project(fullPath: $fullPath) {
|
||
repository {
|
||
blobs(ref: $branch, paths: $paths) {
|
||
nodes {
|
||
path
|
||
oid
|
||
size
|
||
rawTextBlob
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,oVe=`
|
||
query($fullPath: ID!, $iids: [String!]) {
|
||
project(fullPath: $fullPath) {
|
||
mergeRequests(iids: $iids, first: 100) {
|
||
nodes {
|
||
iid
|
||
userPermissions {
|
||
canMerge
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,sVe=async e=>{let t=new Map(e.map(e=>[String(e.number),e]));await lU(Dq([...t.keys()],yJ.mergeRequests),async e=>{try{(await xW(oVe,{iids:e})).project?.mergeRequests?.nodes.forEach(({iid:e,userPermissions:n})=>{let r=t.get(String(e));r&&typeof n?.canMerge==`boolean`&&(r.canMerge=n.canMerge)})}catch{}})},wJ=async e=>{let t=e.files.filter(({deleted:e})=>!e);if(!t.length)return;let{owner:n,repo:r}=uJ(),i=await hJ(t.map(({path:e})=>e),aVe,{fullPath:`${n}/${r}`,branch:e.headSHA??e.branch}),a=new Map(i.map(e=>[e.path,e]));t.forEach(e=>{let t=a.get(e.path);t?Object.assign(e,{sha:t.oid,size:Number(t.size)||0,text:t.rawTextBlob??void 0}):e.deleted=!0})},cVe=async()=>{let e=new Map;await lU(FK(),async t=>{(await bW(`/projects/${aJ()}/merge_requests?state=opened&order_by=updated_at&per_page=${yJ.mergeRequests}&labels=${encodeURIComponent(t)}`)).forEach(t=>{let n=rVe(t);n&&e.set(t.iid,n)})});let t=[...e.values()].sort((e,t)=>t.updatedDate.getTime()-e.updatedDate.getTime());return await Promise.all([sVe(t),lU(t,async e=>{await iVe(e),await wJ(e)})]),t},TJ=async e=>{await fK({branch:e,path:oJ(e,uJ()),goneStatuses:[404]})},EJ=async({branch:e,title:t,status:n})=>{let r=n===`draft`,i=MB.current;return{...xJ(await bW(`/projects/${aJ(i)}/merge_requests`,{method:`POST`,body:{title:bJ.format(t,r),source_branch:e,target_branch:rJ.branch,description:`Automatically generated by Sveltia CMS`,remove_source_branch:!0,...i?{target_project_id:lJ.base,allow_collaboration:!0}:{labels:PK(n)}}}),n),title:t,branch:e}},lVe=async e=>(await bW(`/projects/${aJ()}/merge_requests?state=opened&source_branch=${encodeURIComponent(e)}&per_page=${yJ.mergeRequests}`)).filter(({source_project_id:e,target_project_id:t})=>e===t),DJ=async e=>await bW(vJ(e.number)),uVe=async()=>{let e=nq(),t=await bW(`/projects/${aJ(uJ())}/repository/branches?search=${encodeURIComponent(`^${e}`)}&per_page=${yJ.branches}`);return t.length===yJ.branches&&console.warn(`Only the first ${yJ.branches} Editorial Workflow branches in the fork are listed. Publish or discard some entries to see the rest.`),t},OJ=e=>e.source_project_id===lJ.fork&&e.target_branch===rJ.branch,kJ=e=>OJ(e)&&vU.account?.id!==void 0&&e.author?.id===vU.account.id,dVe=async e=>{let t=new Map;if(!e.length)return t;let n=new Set(e);return(await bW(`/projects/${aJ()}/merge_requests?state=all&order_by=created_at&sort=desc&author_id=${vU.account?.id}&per_page=${yJ.authoredMergeRequests}`)).forEach(e=>{kJ(e)&&n.has(e.source_branch)&&!t.has(e.source_branch)&&t.set(e.source_branch,e)}),t},fVe=(e,t)=>{let{name:n,commit:r}=e,{id:i,message:a,committed_date:o,author_name:s,author_email:c}=r??{},l=t?.state===`merged`?void 0:t,u=l?.state===`opened`&&!l.draft,{name:d,username:f,id:p}=l?.author??{},m=f?{name:d??f,email:``,id:p,login:f}:s&&{name:s,email:c??``};return{number:l?.iid,nodeId:l?String(l.id):void 0,title:l?bJ.strip(l.title):a??``,url:l?.web_url,branch:n,headSHA:i,status:u?`pending_review`:`draft`,createdDate:new Date(l?.created_at??o),updatedDate:new Date(l?.updated_at??o),author:m||void 0,files:[],canMerge:!1}},pVe=async e=>{let{branch:t=``}=rJ,{diffs:n=[]}=await bW(`/projects/${aJ(uJ())}/repository/compare?from=${encodeURIComponent(t)}&to=${encodeURIComponent(e.branch)}&from_project_id=${lJ.base}`);e.files=n.map(SJ)},mVe=async()=>{let e=await uVe(),t=await dVe(e.map(({name:e})=>e)),n=await SG(e,e=>{let n=t.get(e.name);return n?.state===`merged`&&n.sha===e.commit?.id?{leftover:e.name}:{pending:fVe(e,n)}},TJ);await lU(n,pVe);let r=n.filter(({files:e})=>e.length);return await lU(r,wJ),r},AJ=({status:e,title:t,state:n,draft:r})=>e===`draft`?n===`opened`&&!r?{title:bJ.format(t,!0)}:{}:{...n===`closed`?{state_event:`reopen`}:{},...r?{title:t}:{}},jJ=async(e,t)=>{Object.keys(t).length&&await bW(vJ(e),{method:`PUT`,body:t})},hVe=409,gVe=async e=>(await bW(`/projects/${aJ()}/merge_requests?state=opened&source_branch=${encodeURIComponent(e)}&per_page=${yJ.mergeRequests}`)).find(OJ),_Ve=async({branch:e,title:t,status:n})=>{try{return await EJ({branch:e,title:t,status:n})}catch(r){if(r.cause?.status!==hVe)throw r;let i=await gVe(e);if(!i)throw r;if(!kJ(i))throw fU(`The workflow branch is in use by another merge request.`,`workflow.branch_in_use`,{number:`!${i.iid}`});return await jJ(i.iid,AJ({status:n,title:t,state:i.state,draft:i.draft})),{...xJ(i,n),title:t,branch:e}}},vVe=async e=>{let t=await DJ(e);return{merged:t.state===`merged`,isEntryRequest:kJ(t),getMergedSHA:async()=>t.sha,state:t.state,draft:t.draft}},yVe=async({pullRequest:{number:e,title:t},status:n,state:r,draft:i})=>{await jJ(e,AJ({status:n,title:t,state:r,draft:i}))},bVe=async(e,t)=>CG({pullRequest:e,status:t,requestKey:`number`,createRequest:_Ve,fetchRequest:vVe,applyStatus:yVe,fetchBranchHead:CJ,deleteBranch:TJ}),MJ=[`preparing`,`unchecked`,`checking`,`approvals_syncing`],xVe=cG,SVe=[...MJ,`ci_still_running`,`mergeable`],CVe=cG,wVe=async()=>NB.current?mVe():cVe(),TVe=async(e,t)=>{let{branch:n=``}=t,r=rJ.branch;return mK({branch:n,branchExistsStatus:400,commitFromStart:()=>fJ(e,{...t,startBranch:r}),commitOnBranch:()=>fJ(e,t),findOpenPullRequest:async()=>{let[e]=await lVe(n);return e?`!${e.iid}`:void 0},inUseMessage:`The workflow branch is in use by another merge request.`,deleteBranch:TJ})},EVe=async(e,t,n)=>{let{branch:r=``}=t,i=await gK({branch:r,headSHA:n.headSHA,fetchBranchHead:CJ,getWorkflowRepository:uJ});try{return await fJ(e,{...t,headOid:i})}catch(e){throw e.cause?.status===400&&await AU(i,async()=>({hash:await CJ(r)})),e}},DVe=async(e,t)=>{if(NB.current)return bVe(e,t);let n=PK(t),r=t===`draft`,i=bJ.format(e.title,r);return await bW(vJ(e.number),{method:`PUT`,body:{title:i,add_labels:n,remove_labels:FK().filter(e=>e!==n).join(`,`)}}),{...e,status:t,updatedDate:new Date}},NJ=async e=>{let{user_has_approved:t,user_can_approve:n}=await bW(`${e}/approvals`);return{hasApproved:t,canApprove:n}},OVe=async e=>{let t=vJ(e.number),{hasApproved:n,canApprove:r}=await NJ(t);n||r===!1||await bW(`${t}/approve`,{method:`POST`,body:{sha:e.headSHA}})},kVe=async e=>{let t=vJ(e.number);(await NJ(t)).hasApproved&&await bW(`${t}/unapprove`,{method:`POST`})},AVe=async e=>pK(e,{commitToNewBranch:TVe,commitToExistingBranch:EVe,createPullRequest:EJ}),jVe=e=>lG(async()=>{let{state:t,detailed_merge_status:n}=await DJ(e);return{state:t,status:n}},({status:e})=>!MJ.includes(e),xVe),PJ=async e=>{try{await bW(`${vJ(e.number)}/cancel_merge_when_pipeline_succeeds`,{method:`POST`})}catch(t){console.warn(`Failed to cancel the auto-merge on merge request !${e.number}.`,t)}},MVe=e=>DK({read:()=>DJ(e),evaluate:async t=>{if(!t)return!1;let{state:n,merge_when_pipeline_succeeds:r,detailed_merge_status:i}=t;if(n===`merged`)return!0;if(!(n===`locked`||n===`opened`&&r&&SVe.includes(i)))throw n===`opened`&&r&&await PJ(e),Error(`Merge request !${e.number} was not merged: ${n}, ${i}, auto-merge ${r?`on`:`off`}`);return!1},cancel:()=>PJ(e),label:`merge request !${e.number}`}),NVe=1e3,PVe=e=>e.new_file?`added`:e.deleted_file?`removed`:e.renamed_file?`renamed`:`modified`,FVe=e=>lG(async()=>{let t=await DJ(e),{sha:n,target_branch:r,source_project_id:i,target_project_id:a}=t;return!n||r!==rJ.branch||i!==a?{item:t,branchHead:void 0}:{item:t,branchHead:await CJ(e.branch)??n}},({item:t,branchHead:n})=>n===void 0||n===t.sha||n!==e.headSHA,CVe),IVe=async e=>{let{item:t,branchHead:n}=await FVe(e);if(!n)return{headSHA:t.sha,onConfiguredBranches:!1,files:[],complete:!1};let r=bK(e,n);if(r)return r;let{diffs:i=[]}=await bW(`/projects/${aJ()}/repository/compare?from=${encodeURIComponent(rJ.branch)}&to=${encodeURIComponent(n)}&straight=false`),a=t.sha===n?t.changes_count:void 0,o=a==null?void 0:`${a}`,s=o===void 0?i.length<NVe:!o.endsWith(`+`)&&i.length>=Number(o);return{headSHA:n,onConfiguredBranches:!0,files:i.map(e=>({path:e.new_path,status:PVe(e),previousPath:e.renamed_file?e.old_path:void 0,mode:e.deleted_file?void 0:e.b_mode})),complete:s}},LVe=async({headSHA:e,paths:t})=>{let[n,r]=await Promise.all([rJ.branch,e].map(async e=>{let n=await hJ(t,`
|
||
query($fullPath: ID!, $branch: String!, $paths: [String!]!) {
|
||
project(fullPath: $fullPath) {
|
||
repository {
|
||
blobs(ref: $branch, paths: $paths) {
|
||
nodes {
|
||
path
|
||
oid
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
`,{branch:e});return new Map(n.map(({path:e,oid:t})=>[e,t]))}));return t.filter(e=>n.get(e)===r.get(e))},RVe=async({pullRequest:e,path:t,body:n,refusal:r})=>{let{state:i,status:a}=await jVe(e);if(i===`merged`)return!0;if(a===`mergeable`)return await bW(t,{method:`PUT`,body:n}),!0;if(a!==`ci_still_running`)throw r;return await bW(t,{method:`PUT`,body:{...n,auto_merge:!0,merge_when_pipeline_succeeds:!0}}),await MVe(e),!1},zVe={isGit:!0,name:`gitlab`,label:`GitLab`,repository:rJ,statusDashboardURL:`https://status.gitlab.com/`,checkStatus:tVe,init:()=>{let{backend:e}=$O.current??{};if(e?.name!==`gitlab`)return;let{repo:t,branch:n,auth_type:r=``,base_url:i=r===`pkce`?`https://gitlab.com`:`https://api.netlify.com`,auth_endpoint:a=r===`pkce`?`oauth/authorize`:`auth`,app_id:o=``,api_root:s=`https://gitlab.com/api/v4`,graphql_api_root:c=s.replace(/\/api\/.+$/,`/api/graphql`),include_credentials:l=!1}=e,{owner:u,repo:d}=iJ(t),f=`${u}/${d}`;return lq(rJ,{service:`gitlab`,label:`GitLab`,owner:u,repo:d,branch:n,restApiRoot:s,defaultApiRoot:`https://gitlab.com/api/v4`,getTokenPageURL:lBe,getBaseURLs:sJ,authRoot:i,authPath:a,tokenPath:`/token`,api:{clientId:o,authScope:`api`,authScheme:`Bearer`,restBaseURL:XE(s),graphqlBaseURL:XE(c),includeCredentials:l}}),Object.assign(hW,{fullPath:f,branch:n}),rJ},signIn:uBe,signOut:iG,fetchFiles:QBe,fetchLastCommit:dJ,fetchBlob:$Be,fetchDirSHA:GBe,commitChanges:fJ,fetchFileCommits:NBe,triggerDeployment:LBe,fetchBranchHeadSHA:RBe,fetchDeployments:HBe,workflow:{fetchPullRequests:wVe,savePullRequest:AVe,updateStatus:DVe,approve:OVe,withdrawApproval:kVe,fetchBranchHead:CJ,fetchMergeState:IVe,fetchUnchangedPaths:LVe,publish:async e=>{vG();let t=dK(),n=`${vJ(e.number)}/merge`,r={squash:t,should_remove_source_branch:!0,...e.headSHA?{sha:e.headSHA}:{},...t?{squash_commit_message:e.title}:{merge_commit_message:e.title}},i=!0;try{await bW(n,{method:`PUT`,body:r})}catch(t){if(t.cause?.status!==405)throw t;i=await RVe({pullRequest:e,path:n,body:r,refusal:t})}i&&await TJ(e.branch)},discard:async e=>{e.number!==void 0&&await bW(vJ(e.number),{method:`PUT`,body:{state_event:`close`}}),await TJ(e.branch)}}},FJ={github:ZG(sBe),gitlab:ZG(zVe),gitea:ZG(_q),forgejo:ZG(eRe)},IJ=`local`,BVe=`Local Repository`,LJ=void 0,VVe={service:``,label:``,owner:``,repo:``,branch:``},RJ=new Proxy({},{get:(e,t)=>(LJ??VVe)[t]}),zJ=`root_dir_handle`,BJ=void 0,VJ=void 0,HJ=void 0,UJ=void 0,HVe=async({forceReload:e=!1,showPicker:t=!0}={})=>{if(!(`showDirectoryPicker`in window))throw Error(`unsupported`);let n=e?null:await BJ?.get(zJ)??null;if(n){if(await n.requestPermission({mode:`readwrite`})!==`granted`)n=null;else try{await n.entries().next()}catch(e){n=null,console.error(e)}}if(!n&&t&&(n=await window.showDirectoryPicker(),n)){try{await n.getDirectoryHandle(`.git`)}catch(e){if(TH(e))await n.getFileHandle(`.git`);else throw e}await BJ?.set(zJ,n)}return n},UVe=()=>{let{name:e}=$O.current.backend;return LJ=FJ[e]?.init?.(),BJ=fR(LJ,`file-system-handles`)??null,VJ=fR(LJ,`asset-hashes`)??null,RJ},WVe=async({auto:e=!1})=>{let t=await HVe({showPicker:!e});if(!t)throw Error(`Directory handle could not be acquired`);try{UJ=await PH(t),HJ=t}catch{throw fU(`Failed to open the root directory.`,`root_dir_not_found`,{repo:`${RJ.owner}/${RJ.repo}`,dir:yH()})}return{backendName:IJ}},GVe=async()=>{try{await BJ?.delete(zJ)}catch{}iU()},KVe=async()=>{await nW(UJ,{hashCacheDB:VJ})},qVe=async(e,t)=>{let n=()=>pW(UJ,e);return CW.localGitCommits&&HJ?IPe({repoRootDirHandle:HJ,changes:e,options:t,save:n}):(iU(),n())},JVe=async()=>HJ?FPe(HJ):void 0,YVe={isGit:!1,name:IJ,label:BVe,repository:RJ,init:UVe,signIn:WVe,signOut:GVe,fetchFiles:KVe,fetchBlob:async({path:e})=>{if(!UJ)throw Error(`Root directory handle is not available`);return MH(UJ,e)},commitChanges:qVe},XVe=`link[rel="cms-seed-url"]`,ZVe=6,WJ=()=>document.querySelector(XVe)?.href||void 0,GJ=e=>e===`test-repo`&&!!WJ(),QVe=e=>typeof e==`string`&&e.split(`/`).every(e=>!!e&&e!==`.`&&e!==`..`),$Ve=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch the seed manifest: ${t.status}`);let{files:n}=await t.json();if(!Array.isArray(n))throw Error("The seed manifest must have a `files` array");return[...new Set(n)].filter(e=>QVe(e)?!0:(console.warn(`Skipping an invalid path in the seed manifest: ${JSON.stringify(e)}`),!1))},eHe=async(e,t)=>{let n=new URL(t.split(`/`).map(encodeURIComponent).join(`/`),e);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.blob()}catch(e){console.warn(`Failed to seed ${t}:`,e);return}},tHe=async(e,t,n)=>{try{await uW(await AH(e,t),n)}catch(e){console.warn(`Failed to seed ${t}:`,e)}},nHe=async(e,t)=>{let n=WJ();if(n){try{await e.getDirectoryHandle(t);return}catch{}try{let r=await $Ve(n),i=await uU(r,e=>eHe(n,e),{concurrency:ZVe});if(!i.some(Boolean))return;let a=await e.getDirectoryHandle(t,{create:!0});await Promise.all(r.map((e,t)=>{let n=i[t];return n?tHe(a,e,n):void 0}))}catch(e){console.warn(`Failed to seed the test repository:`,e)}}},KJ=e=>e?.name===`test-repo`?`test-repo:sveltia-cms-test`:e?.repository?.databaseName,rHe=`Test`,qJ=void 0,iHe={isGit:!1,name:`test-repo`,label:rHe,init:()=>void 0,signIn:async()=>{if(!sW.isTestBackendSupported)throw Error(`Unsupported browser`,{cause:{message:X(`test_repo_unsupported_browser`)}});try{let e=await navigator.storage.getDirectory();await nHe(e,`sveltia-cms-test`),qJ=await PH(await jH(e,`sveltia-cms-test`),{create:!0})}catch{}return{backendName:`test-repo`}},signOut:async()=>{},fetchFiles:async()=>{qJ?await nW(qJ):QA.current=!0},fetchBlob:async({path:e})=>{if(!qJ)throw Error(`Root directory handle is not available`);return MH(qJ,e)},commitChanges:async e=>pW(qJ,e)},JJ={...FJ,local:YVe,"test-repo":iHe},aHe={azure:{label:`Azure DevOps`},bitbucket:{label:`Bitbucket`},"git-gateway":{label:`Git Gateway`,deprecated:!0}},oHe=Object.keys(JJ).filter(e=>e!==`local`),YJ=WO(),XJ=KO(()=>YJ.current?JJ[YJ.current]:void 0),ZJ=e=>{let t=e?JJ[e]:void 0;return t&&t!==XJ.current&&t.init(),YJ.current=e,t},QJ=e=>fq({cmsConfig:$O.current,collection:e}),$J=e=>NB.current?kK:QJ(e).stages,eY=(e,t)=>{if(e===`pending_deletion`)return e;let n=OK.indexOf(e);return t.findLast(e=>OK.indexOf(e)<=n)??`draft`},tY=(e,t)=>eY(e.workflow.status,$J(t)),nY=e=>$J(YA(e.workflow.collectionName)),rY=e=>tY(e,YA(e.workflow.collectionName)),iY=(e,t)=>nY(e).includes(t),sHe=(e,t)=>{let n=$J(t),r=eY(e.workflow.status,n);return r===`pending_deletion`?void 0:n[n.indexOf(r)+1]},cHe=(e,t)=>{let n=$J(t);return eY(e.workflow.status,n)===n.at(-1)},aY=KO(()=>{if(NB.current)return kK;let e=$O.current,t=new Set([`draft`]);return hq(e).forEach(n=>{let r=fq({cmsConfig:e,collection:n});mq(r.type)&&r.stages.forEach(e=>t.add(e))}),OK.filter(e=>t.has(e))}),oY=KO(()=>aY.current.length===1?`drafts`:`editorial_workflow`),sY=KO(()=>gq($O.current)&&!!XJ.current?.workflow),cY=e=>!!XJ.current?.workflow&&(NB.current||mq(pq({cmsConfig:$O.current,collection:e}))),lY=WO([]),uY=WO(!1),dY=WO(!1),fY=WO([]),pY=KO(()=>!sY.current||dY.current),mY=e=>e?lY.current.filter(({workflow:t})=>t.collectionName===e):[],hY=(e,t,n)=>t.flatMap(({workflow:t})=>(t.companions??[]).flatMap(t=>t.collectionName===e&&!!t.edited===n?[t.entry]:[])),gY=(e,t=lY.current)=>hY(e,t,!1),lHe=(e,t=lY.current)=>hY(e,t,!0),_Y=e=>{let t=e.flatMap(({entry:e,edited:t})=>t?[e]:[]);return{paths:bO(t.flatMap(e=>CP(e))),publishedPaths:new Set(t.flatMap(({id:e})=>{let t=tj.current.find(t=>t.id===e);return t?CP(t):[]}))}},vY=e=>lY.current.find(({workflow:t})=>(t.companions??[]).some(t=>t.edited&&t.entry.id===e.id)),yY=e=>[...mY(e),...gY(e)],bY=({collectionName:e,subPath:t})=>lY.current.find(n=>n.workflow.collectionName===e&&(n.workflow.fileName===void 0?n.subPath===t:n.workflow.fileName===t)),xY=({collectionName:e,slug:t,entry:n})=>{if(!n)return;let r=new Set(CP(n));return lY.current.find(n=>MLe({branch:n.workflow.pullRequest.branch,collectionName:e,slug:t})&&CP(n,{includePrevious:!0}).some(e=>r.has(e)))},SY=e=>e?lY.current.find(t=>t.id===e):void 0,CY=e=>lY.current.find(({workflow:t})=>t.pullRequest.branch===e),wY=({collectionName:e,fileName:t,originalEntry:n})=>{if(!n)return;let r=n.workflow?.pullRequest?.branch;return(r?CY(r):void 0)??xY({collectionName:e,slug:t??n.slug,entry:n})},TY=({collection:e,collectionName:t,fileName:n,originalEntry:r})=>cY(e)||!!wY({collectionName:t,fileName:n,originalEntry:r}),EY=e=>e?.workflow?.status===`pending_deletion`,DY=e=>{let{collectionName:t,fileName:n}=e.workflow;return[e,...lY.current.filter(r=>r.id!==e.id&&EY(r)&&r.workflow.collectionName===t&&r.workflow.fileName===n)]},OY=e=>e.canMerge!==!1&&!AB.current,kY=e=>!NB.current&&e?.publish!==!1,AY=e=>e.every(({collectionName:e})=>{let t=YA(e);return!cY(t)||QJ(t).directPublish}),jY=(e,t)=>kY(t)&&OY(e.workflow.pullRequest)&&(EY(e)||cHe(e,t)||QJ(t).directPublish&&AY(e.workflow.companions??[])),uHe=(e,t)=>!!e&&kY(e)&&QJ(e).directPublish&&(t?OY(t.workflow.pullRequest):!kB.current),MY=(e,t)=>{if(!t.length)return e;let n=new Map;return t.forEach(e=>{CP(e,{includePrevious:!0}).forEach(t=>n.set(t,e))}),e.map(e=>Object.values(e.locales).map(({path:e})=>n.get(e)).find(Boolean)??e)},NY=(e,t)=>{let n=MY(e,t),r=new Set(n),i=t.filter(e=>!r.has(e));return i.length?[...n,...i]:n},PY=e=>{let{workflow:t}=e;return t?nj(new Set(CP(e,{includePrevious:!0}))):void 0},dHe=e=>e.workflow.fileName?!0:!!PY(e),FY=e=>e?(tj.current,dHe(e)):!1,fHe=(e,t,n)=>{let r=[...VL(e),...yY(e)].map(e=>t?e.locales[t]?.slug:e.slug).filter(Boolean);if(n===void 0)return r;let i=n?`${n}/`:``;return r.filter(e=>e.startsWith(i)&&!e.slice(i.length).includes(`/`)).map(e=>e.slice(i.length))},IY=(e,t)=>{let{collection:n,content:r,currentSlug:i,locale:a,dateTimeParts:o,isIndexFile:s=!1,dirPath:c}=t,{_type:l,name:u}=n,d=GL(l===`entry`?n:void 0),{slug_length:f=void 0,_file:{basePath:p,fullPathRegEx:m}={}}=l===`entry`?n:{},h=$O.current?.slug,g=f??h?.maxlength,_={replaceSubContext:{...t,dateTimeParts:o??JL({timeZone:rN()}),identifierField:d,basePath:p,fullPathRegEx:m},getFieldArgs:{collectionName:u,keyPath:``,valueMap:r,isIndexFile:s}},v=NM(e,(e,t)=>gH(t,_)).trim();if(i)return v;let y=1/0;if(typeof g==`number`){let e=YE(v,g,{ellipsis:``});v=e===v?v:nN(e)}else y=ALe({collectionName:u,dirPath:c}),iq(v)>y&&(v=nN(aq(v,y)));v.endsWith(`.`)&&(v=nN(v));let b=fHe(u,a,c),x=e=>uP(e,b,{hasExtension:!1}),S=x(v);for(;y!==1/0&&iq(S)>y;){let e=iq(S)-iq(v);v=nN(aq(v,y-e)),S=x(v)}return S},LY=({config:e=QO.current,collection:t,collectionFile:n}={})=>!!(e?.readonly||t?.readonly||n?.readonly),pHe=e=>!!kB.current&&!!e&&!mq(pq({cmsConfig:QO.current,collection:e})),RY=({collection:e,collectionFile:t}={})=>LY({collection:e,collectionFile:t})||pHe(e),zY=e=>!!e&&RY({collection:e.collection,collectionFile:e.collectionFile}),BY=(e,{collection:t,collectionFile:n,folder:r}={})=>QO.current?.readonly?X(`readonly_cms`):!(e===`asset_folder`?r?.readonly:LY({collection:t,collectionFile:n}))&&kB.current?X(`readonly_branch`,{values:{branch:kB.current}}):X(`readonly_${e}`),VY=e=>e.includes(`{{media_folder}}`)||e.includes(`{{public_folder}}`),HY=e=>e.replace(/^\/@/,`@`),mHe=(e,{globalMediaFolder:t,globalPublicFolder:n})=>e.trim().replace(`{{media_folder}}`,`/${t}`).replace(`{{public_folder}}`,`/${n}`).replace(`//`,`/`),UY=(e,t,{isPublicFolder:n=!1}={})=>{if(!VY(e))return e;if(!t)return;let r=mHe(e,t);return n?HY(r):r},WY=e=>{if(`folder`in e&&typeof e.folder==`string`)return e.folder;if(`file`in e&&typeof e.file==`string`)return bk(e.file).dirname},hHe=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i=!1,mediaFolder:a,publicFolder:o,baseFolder:s,globalFolders:c,label:l,icon:u,isAssetCollection:d=!1})=>{let f=UY(a,c),p=o===void 0?f:UY(o,c,{isPublicFolder:!0});if(f===void 0||p===void 0)return;a=f,o=p,a=a.replace(/^\.(?:\/|$)/,``);let m=!a.startsWith(`/`);return{collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i,internalPath:m?XE(s??``).replace(/^\.(?:\/|$)/,``):XE(a),internalSubPath:m?XE(a):void 0,publicPath:/^($|[.@])/.test(o)?o.replace(/(?<=.)\/+$/,``):`/${XE(o)}`,entryRelative:m,hasTemplateTags:IM(a),label:l,icon:u,isAssetCollection:d}},GY=(e,t)=>{if(t.mediaFolder===void 0)return;let n=hHe(t);if(!n)return;let{globalMediaFolder:r,globalPublicFolder:i}=t.globalFolders??{};(n.entryRelative||n.internalPath!==r||n.publicPath!==i)&&e.push(n)},KY=(e,{collectionName:t,files:n,globalFolders:r,mediaFolder:i,publicFolder:a})=>{uk(n).forEach(n=>{let{name:o,file:s,media_folder:c,public_folder:l}=n,u=c===void 0;GY(e,{collectionName:t,fileName:o,mediaFolder:u?i:c,publicFolder:u?a:l,baseFolder:bk(s).dirname,globalFolders:r})})},gHe=(e,{fieldMediaFolders:t,validCollections:n,globalFolders:r})=>{t.forEach(({fieldConfig:t,context:i})=>{let{collection:a,collectionFile:o,componentName:s,typedKeyPath:c,isIndexFile:l}=i;(a&&(a.name===`_singletons`||n.some(e=>e.name===a.name))||s)&&GY(e,{collectionName:a?.name,fileName:o?.name,componentName:s,typedKeyPath:c,isIndexFile:l,mediaFolder:t.media_folder,publicFolder:t.public_folder,baseFolder:o?bk(o.file).dirname:a?WY(a):void 0,globalFolders:r})})},_He=(e,{assetCollections:t,globalFolders:n})=>{t.forEach(t=>{let{name:r,label:i=r,icon:a,media_folder:o,public_folder:s}=t;o!==void 0&&GY(e,{collectionName:`assets:${r}`,mediaFolder:`/${XE(o)}`,publicFolder:s,globalFolders:n,label:i,icon:a,isAssetCollection:!0})})},vHe=({config:e,folder:t,validCollections:n})=>{let{collectionName:r,fileName:i,isAssetCollection:a}=t;if(a){let t=e.asset_collections?.find(({name:e})=>`assets:${e}`===r);return LY({config:e,collection:t})}let o=n.find(({name:e})=>e===r),s=r===`_singletons`?e.singletons:o&&`files`in o?o.files:void 0;return LY({config:e,collection:o,collectionFile:i&&s?uk(s).find(({name:e})=>e===i):void 0})},qY=e=>{let{media_folder:t,public_folder:n}=e;if(t===void 0)return;let r=XE(t).replace(/^\.$/,``);return{globalMediaFolder:r,globalPublicFolder:n?HY(`/${XE(n)}`):`/${r}`}},yHe=(e,{validCollections:t,singletons:n,globalFolders:r})=>{let i=r!==void 0;t.forEach(t=>{let{name:n,files:a,path:o,media_folder:s,public_folder:c}=t,l=i&&s===void 0&&o!==void 0?``:s,u=`files`in t&&typeof l==`string`&&!VY(l)&&!l.startsWith(`/`);u||GY(e,{collectionName:n,mediaFolder:l,publicFolder:c,baseFolder:WY(t),entryPath:o,globalFolders:r}),a?.length&&KY(e,{collectionName:n,files:a,globalFolders:r,...u?{mediaFolder:l,publicFolder:c}:{}})}),n?.length&&KY(e,{collectionName:`_singletons`,files:n,globalFolders:r})},bHe=(e,t)=>new Map(t.map(t=>{let n=zA({cmsConfig:e,collection:t}),r=`folder`in t&&typeof t.folder==`string`&&SA(t.folder)||!!n?.structure&&USe.includes(n.structure);return[t.name,r?n?.locales??[]:[]]})),xHe=(e,t=[])=>{let n=[],{collections:r,singletons:i,asset_collections:a}=e,o=qY(e),s={collectionName:void 0,internalPath:void 0,internalSubPath:void 0,publicPath:void 0,entryRelative:!1,hasTemplateTags:!1,label:void 0,icon:void 0,isAssetCollection:!1},c=o?{...s,internalPath:o.globalMediaFolder,publicPath:o.globalPublicFolder}:void 0,l=KA({collections:r});yHe(n,{validCollections:l,singletons:i,globalFolders:o}),gHe(n,{fieldMediaFolders:t,validCollections:l,globalFolders:o}),n.sort((e,t)=>$E(e.internalPath,t.internalPath));let u=[];c&&u.push(c),a?.length&&_He(n,{assetCollections:a,globalFolders:o}),u.push(...n),u.length&&u.unshift(s);let d=bHe(e,l);return u.map(t=>{let n=t.entryRelative?d.get(t.collectionName):void 0;return{...t,...n?.length?{localeFolderNames:n}:{},...vHe({config:e,folder:t,validCollections:l})?{readonly:!0}:{}}})},JY=e=>eP(e).values().flatMap(t=>{let n=zk(t,e),r=sj(t,e);return r.length?r.map(e=>({collection:t,collectionFile:e,isIndexFile:n})):[{collection:t,isIndexFile:n}]}),YY=xA(()=>qB.current,e=>new Map(e.map(e=>[e.path,e]))),XY=e=>YY().get(e),ZY=({unsaved:e,blobURL:t,path:n})=>e&&t?t:n,QY=(e,{collection:t,entry:n,localeFile:r})=>IY(e,{type:`media_folder`,collection:t,content:r.content,currentSlug:n.slug,entryFilePath:r.path,isIndexFile:zk(t,n)}),$Y=({internalPath:e,collectionName:t,entry:n,locale:r})=>{if(!IM(e))return e;let i=t?YA(t):n?eP(n)[0]:void 0;return!n||!i?void 0:QY(e,{collection:i,entry:n,localeFile:xP(n,{locale:r,defaultLocale:i._i18n.defaultLocale})})},eX=(e,t)=>e===void 0||!VY(e)?e:UY(e,QO.current?qY(QO.current):void 0,t)??e,SHe=({path:e,entry:t,collection:n,file:r,componentName:i,typedKeyPath:a,locale:o})=>{let{_i18n:{defaultLocale:s}}=r??n,c=a?HB({collectionName:n.name,fileName:r?.name,componentName:i,typedKeyPath:a}):void 0,l=r?.media_folder===void 0?n:r,u=c?c.entryRelative?c.internalSubPath??``:`/${c.internalPath}`:eX(l.media_folder),d=c?.publicPath===void 0?eX(l.public_folder,{isPublicFolder:!0}):c.publicPath,f=xP(t,{locale:o,defaultLocale:s}),{path:p,content:m}=f;if(!p||!m)return;u&&IM(u)&&(u=QY(u,{collection:n,entry:t,localeFile:f})),d&&IM(d)&&(d=QY(d,{collection:n,entry:t,localeFile:f}));let h=mP(p),g=e.replace(/^\.\//,``),_=u?.replace(/^\.\//,``).replace(/\/$/,``),v=hP(g,_),y;if(u?.startsWith(`/`)&&d!==void 0){let e=d.replace(/^\.\//,``);g.startsWith(`${e}/`)&&(v=g.slice(e.length+1)),y=gP(pP([u.slice(1),v]))}else y=gP(pP([h,u,v]));return YY().get(y)},tX=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,requireCollectionName:i=!1,skipTemplateFolders:a=!1})=>{let o=!i||!!e;return[n?HB({componentName:n,typedKeyPath:r}):void 0,o&&r?HB({collectionName:e,fileName:t,typedKeyPath:r}):void 0,o?HB({collectionName:e,fileName:t}):void 0,o?HB({collectionName:e}):void 0,zB.current].filter(e=>!!e&&!(a&&e.hasTemplateTags))},CHe=({path:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:a,locale:o})=>t?JY(t).map(({collection:n,collectionFile:r})=>SHe({path:e,entry:t,collection:n,file:r,componentName:i,typedKeyPath:a,locale:o})).find(Boolean)??YY().get(e):tX({collectionName:n,fileName:r,componentName:i,typedKeyPath:a,requireCollectionName:!0,skipTemplateFolders:!0}).values().map(t=>{let n=hP(e,t.publicPath?.replace(/^\//,``));return YY().get(pP([t.internalPath,t.internalSubPath??``,n]))}).find(Boolean)??YY().get(e),wHe=new WeakMap,nX=e=>mA(wHe,e,()=>{let t=e.publicPath??``,n=Mk(t,`.+?`);return RegExp(`^${n}${t?`(?=\\/|$)`:`$`}`)}),rX=e=>!/^[/@]/.test(e),THe=({path:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:a,locale:o})=>{let s=YY().get(XE(e));if(s)return s;let{dirname:c=``,basename:l}=bk(e),u=e=>{let{publicPath:n,collectionName:r}=e,{internalPath:i}=e;if(!(i!==void 0&&(i=$Y({internalPath:i,collectionName:r,entry:t,locale:o}),i===void 0))){if(n&&c){if(n===`/`||c.startsWith(`${n}/`))i&&=n===`/`?`${i}${c}`:c.replace(n,i);else if(!rX(n)&&!nX(e).test(c))return}return YY().get(pP([i,l]))}},d=tX({collectionName:n,fileName:r,componentName:i,typedKeyPath:a}),f;if(d.some(e=>(f=u(e),!!f)),f)return f;let p=RB.current.findLast(e=>nX(e).test(c));return p?u(p):void 0},iX=({value:e,...t})=>{let n=e=>{let n=rP(e);return rX(n)?CHe({path:n,...t}):THe({path:n,...t})},[r]=e.split(`#`);return n(e)??(r===e?void 0:n(r))},aX=({folder:e},t)=>e===t?!0:t.entryRelative?e.collectionName===t.collectionName&&e.fileName===t.fileName&&e.typedKeyPath===t.typedKeyPath&&e.isIndexFile===t.isIndexFile&&e.internalPath===t.internalPath&&e.internalSubPath===t.internalSubPath&&e.publicPath===t.publicPath&&e.entryRelative===t.entryRelative&&e.hasTemplateTags===t.hasTemplateTags:!e.entryRelative&&e.internalPath===t.internalPath,oX=({entryRelative:e,collectionName:t,fileName:n,typedKeyPath:r,isIndexFile:i,internalPath:a,internalSubPath:o,publicPath:s,hasTemplateTags:c})=>JSON.stringify(e?[t,n,r,i,a,o,s,c]:[a]),EHe=xA(()=>qB.current,e=>{let t=new Map;return e.forEach(({folder:e})=>{let n=oX(e);t.set(n,(t.get(n)??0)+1)}),t}),DHe=e=>EHe().get(oX(e))??0,sX=e=>qB.current.filter(t=>mP(t.path)===e),cX=e=>[...sX(e).map(e=>e.name),...$V(e),...QV(e)].map(e=>e.normalize());JO(()=>{BB.current,BV.current,XB.current=void 0,VV.current=void 0});var lX=(e,t)=>{if(!t.length||!e.length)return[];let n=new Set(t.map(({name:e})=>e.normalize().toLowerCase()));return e.filter(e=>n.has(e.name.normalize().toLowerCase()))},uX=(e,{field:t,pattern:n}={field:``,pattern:``})=>{if(!t)return e;if(t===`fileType`)return e.filter(({path:e})=>KU(e)===n);let r=IL(n);return e.filter(e=>{let i=e[t];return Ike(i,n,r)})},OHe=(e,t)=>Fke(e,t,(e,t)=>e[t]),dX=`http://www.w3.org/2000/svg`,kHe=e=>new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`load`,()=>{t(r.result)}),r.addEventListener(`error`,()=>{n(r.error)}),r.readAsDataURL(e)}),AHe=e=>!!e?.trim()&&!e.trim().endsWith(`%`),jHe=e=>{let t=(e??``).trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return;let[n,r,i,a]=t;return i>0&&a>0?{x:n,y:r,width:i,height:a}:void 0},MHe=async e=>{let{documentElement:t}=new DOMParser().parseFromString(await e.text(),`image/svg+xml`),n=t.namespaceURI===dX&&t.localName===`svg`,r=document.createElementNS(dX,`svg`),i=document.createElementNS(dX,`image`),a=n&&[`width`,`height`].every(e=>AHe(t.getAttribute(e)))?[`width`,`height`]:[`width`,`height`,`viewBox`,`preserveAspectRatio`];n&&a.forEach(e=>{let n=t.getAttribute(e);n!==null&&r.setAttribute(e,n)});let o=jHe(r.getAttribute(`viewBox`));return Object.entries(o??{width:`100%`,height:`100%`}).forEach(([e,t])=>{i.setAttribute(e,String(t))}),i.setAttribute(`preserveAspectRatio`,`none`),i.setAttribute(`href`,await kHe(new Blob([e],{type:`image/svg+xml`}))),r.append(i),new Blob([new XMLSerializer().serializeToString(r)],{type:`image/svg+xml`})},fX=uN(`pdfjs-dist`),NHe=`${fX}/build/pdf.worker.min.mjs`,PHe={cMapUrl:`${fX}/cmaps/`,iccUrl:`${fX}/iccs/`,standardFontDataUrl:`${fX}/standard_fonts/`,wasmUrl:`${fX}/wasm/`},FHe=e=>(e.GlobalWorkerOptions.workerSrc=NHe,{options:PHe,dispose:()=>{}}),pX,IHe=async(e,t={})=>{let{format:n,quality:r,width:i,height:a,fit:o,nativeOnly:s}=AV(t);if(!pX)try{pX=await dN(`pdfjs-dist`,`build/pdf.min.mjs`)}catch{throw Error(`Failed to load PDF.js library`)}let c=URL.createObjectURL(e),l=new OffscreenCanvas(512,512),u=l.getContext(`2d`),d,f;try{f=FHe(pX),d=pX.getDocument({disableAutoFetch:!0,...f.options,url:c});let e=await(await d.promise).getPage(1),t=e.getViewport({scale:1}),{scale:n}=jV(l,{width:t.width,height:t.height},{width:i,height:a,fit:o});await e.render({canvasContext:u,viewport:n===1?t:e.getViewport({scale:n})}).promise}catch{throw Error(`Failed to render PDF`)}finally{URL.revokeObjectURL(c);try{await d?.destroy()}catch{}f?.dispose()}return TV(l,{format:n,quality:r,nativeOnly:s})},mX=new Map,hX=new Map,LHe=/[/+]xml$/,gX=async e=>{let t=e.type.split(`;`)[0].trim().toLowerCase();return t===`image/svg+xml`?MHe(e):t===`text/html`||LHe.test(t)?new Blob([e],{type:`text/plain`}):e},_X=async e=>URL.createObjectURL(await gX(e)),vX=async(e,t)=>{if(!e.blobURL){let n=await gX(t);e.blobURL??=URL.createObjectURL(n)}return t},yX=async(e,t)=>(await vX(e,t),e.blobURL&&mX.set(e.blobURL,t),t),bX=(e,t)=>yA(hX,e,t),xX=async e=>{let{name:t}=e,n=await XJ.current?.fetchBlob?.(e);if(!n)throw Error(`Failed to retrieve blob`);return new Blob([n],{type:lV.getType(t)??n.type})},RHe=async e=>yX(e,await xX(e)),SX=async(e,t=async e=>e)=>{try{return await t(await e.getFile())}catch{throw Error(`Failed to retrieve blob from file handle`)}},CX=async e=>{let{file:t,handle:n,blobURL:r,path:i}=e;return t?vX(e,t):r?mX.get(r)??bX(r,()=>fetch(r).then(e=>e.blob())):n?SX(n,t=>yX(e,t)):bX(i,()=>RHe(e))},zHe=async e=>{let{file:t,handle:n,blobURL:r,path:i}=e;return t||(r?CX(e):hX.get(i)||(n?SX(n):xX(e)))},wX=async e=>(e.blobURL||await CX(e),e.blobURL),TX=void 0,EX=new Map,BHe=_A(500),DX=async e=>TX.get(e),OX=()=>{TX??=fR(XJ.current?.repository,`asset-thumbnails`)??BHe},kX=jL(4,{lastInFirstOut:!0}),VHe=async e=>{let{sha:t}=e,n=await DX(t);if(!n){let r=zU(e.name)?IHe:NV;n=await kX(async()=>r(await zHe(e),MV),{key:t}),await TX.set(t,n)}return n},HHe=async e=>{OX();let t=EX.get(e);return t?!!await t.catch(()=>void 0):!!await DX(e)},AX=async(e,{cacheOnly:t=!1}={})=>{if(!BU(e))return;OX();let{sha:n}=e;if(t&&!EX.has(n)){let e=await DX(n);return e?URL.createObjectURL(e):void 0}!t&&EX.has(n)&&kX.prioritize(n);let r=await yA(EX,n,()=>VHe(e));return r?URL.createObjectURL(r):void 0},jX=new Set,MX=new Set,NX=[],PX=[],UHe=()=>{let e=new Set(jX);jX.clear(),document.querySelectorAll(`[src^="blob:"]`).forEach(t=>{e.delete(t.getAttribute(`src`))}),MX.forEach(t=>{e.delete(t)}),e.size&&(e.forEach(e=>{URL.revokeObjectURL(e),mX.delete(e)}),qB.current.forEach(t=>{t.blobURL!==void 0&&e.has(t.blobURL)&&delete t.blobURL}))},FX=e=>{if(!e?.startsWith(`blob:`))return;let t=!jX.size;jX.add(e),t&&window.requestAnimationFrame(UHe)},IX=({blobURL:e,unsaved:t})=>{t||FX(e)},WHe=({path:e,internalPath:t,publicPath:n})=>{let r=new Map,i=cP(t,e=>`${e.split(Ck).map((e,t)=>{if(t%2==0)return JE(e);let n=e.trim(),i=r.get(n);if(i)return`\\k<${i}>`;let a=`tag${r.size}`;return r.set(n,a),`(?<${a}>[^/]+?)`}).join(``)}(?=\\/|$)`);return e.replace(i,(...e)=>{let t=e.at(-1);return n.replaceAll(wk,(e,n)=>{let i=r.get(n.trim());return i?t[i]:e})})},GHe=e=>e.folder.collectionName===void 0?e.folder:UB(e.path).find(({collectionName:e})=>e!==void 0)??zB.current??e.folder,KHe=(e,t,n)=>{let r=mP(e.path),i=t?wP(t,n):void 0;if(i!==void 0){if(r===i)return e.name;let t=i?`${i}/`:``;return e.path.startsWith(t)?e.path.slice(t.length):void 0}let{internalPath:a,internalSubPath:o}=e.folder;if(e.path===pP([a,o,e.name]))return a?e.path.slice(a.length+1):e.path},LX=(e,{pathOnly:t=!1,allowSpecial:n=!1,entry:r=void 0,locale:i=void 0}={})=>{let{publicPath:a,entryRelative:o,hasTemplateTags:s}=GHe(e);if(o)return t?KHe(e,r,i):void 0;let{_baseURL:c=``,output:{encode_file_path:l=!1}={}}=$O.current,u=e.folder.internalPath??``,d=a===`/`?``:a??``,f=s?WHe({path:e.path,internalPath:u,publicPath:d}):u?e.path.replace(u,d):`${d}/${e.path}`;if(a===``&&(f=f.replace(/^\//,``)),l&&(f=lP(f)),f.startsWith(`/`)||n)return t?f:`${c}${f}`},qHe=({folder:e,subfolderPath:t})=>{let{output:{encode_file_path:n=!1}={}}=$O.current,r=(e.publicPath??``).replace(/\/$/,``),i=(t?`${r}/${t}`:r)||`/`;return n?lP(i):i},RX=(e,{keep:t=[]}={})=>{let n=[...e,...t],r=NX.filter(e=>!n.includes(e)),i=e.filter(e=>!PX.includes(e));NX=n,PX=e,t.forEach(e=>{e.blobURL&&MX.add(e.blobURL)}),r.forEach(e=>{e.blobURL&&MX.delete(e.blobURL),IX(e)}),i.forEach(async e=>{try{let t=await wX(e);if(!t)return;if(!NX.includes(e)){IX(e);return}if(MX.add(t),e.kind===`image`){let e=new Image;e.src=t,await e.decode()}}catch{}})},zX=({prefix:e=``})=>e&&!e.endsWith(`/`)?`${e}/`:e,BX=(e,t)=>`${zX(e)}${t}/`,VX=(e,t)=>`${zX(e)}${t}`,HX=(e,t)=>{let n=zX(e);return n&&t.startsWith(n)?t.slice(n.length):t},UX=(e,{slugificationEnabled:t=!1,assetNamesInSameFolder:n=[]}={})=>{let r=dP(e).replace(/^\.+/,``);if(t){let{filename:e,extension:t}=bk(r);r=`${iN(e)}${t?`.${t.toLowerCase()}`:``}`}return uP(r,n)},WX=(e,t)=>UX(e).normalize().toLowerCase()===UX(t).normalize().toLowerCase(),JHe=({name:e,fileName:t,otherNames:n,folderNames:r=[],fileNames:i=[]})=>{if(!e)return`empty`;if(e.includes(`/`)||!t)return`character`;if(e.startsWith(`.`))return`leading_dot`;let a=t.normalize().toLowerCase(),o=e=>e.some(e=>e.normalize().toLowerCase()===a);if(o(n))return`duplicate`;if(o(i))return`file_duplicate`;if(o(r))return`folder_duplicate`},YHe=(e,t)=>{let n=t.toLowerCase();return e.filter(({fileName:e,description:t})=>e.toLowerCase().includes(n)||t.toLowerCase().includes(n))},GX=async(e,{maxPages:t=10}={})=>{let n=[],r;for(let i=1;i<=t;i+=1){let{results:a,next:o}=await e(r);if(n.push(...a),!o||i===t)break;r=o,await Zc(50)}return n},KX=(e,t)=>t?BX(e,t):zX(e),qX=async(e,t,n,{maxPages:r=10,dirPath:i,delimiter:a}={})=>{let o=e.requireCredential(n),s=KX(t,i),c=[],l=[],u=!1;return(await GX(async n=>{let r=await e.listPage({config:t,credential:o,prefix:s,cursor:n,...a&&{delimiter:a}});return u=!!r.cursor,{results:r.items,next:r.cursor}},{maxPages:r})).forEach(n=>{let r=e.getKey(n);if(r.endsWith(`/`)){let e=HX(t,r).replace(/\/$/,``);e&&l.push(e)}else c.push(n)}),{files:c,folders:l,truncated:u}},JX=(e,t,{kind:n})=>n?t.filter(t=>KU(e.getKey(t))===n):t,YX=async(e,t,n,r={})=>{let{files:i}=await qX(e,t,n,r);return e.parseResults(JX(e,i,n),t,n.apiKey)},XHe=async(e,t,n)=>{let{files:r,folders:i,truncated:a}=await qX(e,t,n);return{assets:e.parseResults(JX(e,r,n),t,n.apiKey),folders:i,truncated:a}},ZHe=async(e,t,n,r)=>{let{files:i,folders:a}=await qX(e,n,r,{maxPages:1/0,dirPath:t});return{assets:e.parseResults(i,n,r.apiKey),folders:a}},QHe=async(e,t,n,r)=>YHe(await YX(e,n,r,{maxPages:5}),t),XX=async(e,t,n,r)=>{let i=KX(t,r),{files:a}=await qX(e,t,n,{maxPages:1/0,dirPath:r,delimiter:`/`});return a.map(t=>e.getKey(t).slice(i.length).normalize()).filter(e=>!e.includes(`/`))},$He=async(e,t,n,r)=>{if(t.length===0)return[];let i=e.requireCredential(r),{dirPath:a=``}=r,o=await XX(e,n,r,a),s=t.map(e=>{let t=UX(e.name.split(/[/\\]/).filter(Boolean).at(-1)??``,{assetNamesInSameFolder:o});if(!t)throw Error(`Invalid file name: ${e.name}`);return o.push(t),VX(n,a?`${a}/${t}`:t)}),c=[];for(let[r,a]of t.entries())c.push(await e.putObject({key:s[r],file:a,config:n,credential:i})),t.length>1&&await Zc(50);return e.parseResults(c,n,i)},eUe=async(e,t,n,r)=>{let i=e.requireCredential(r);for(let{id:r}of t)await e.deleteObject({key:r,config:n,credential:i}),t.length>1&&await Zc(50)},tUe=async(e,t,n,r,i)=>{let a=e.requireCredential(i),o=await e.putObject({key:t.id,file:n,config:r,credential:a});return e.parseResults([o],r,a)[0]},ZX=async(e,t,n,r,i)=>{let a=e.requireCredential(i),o=VX(r,n),s=await e.copyObject({asset:t,key:o,config:r,credential:a});return await e.deleteObject({key:t.id,config:r,credential:a}),e.parseResults([s],r,a)[0]},nUe=async(e,t,n,r)=>{let i=e.requireCredential(r);await e.putFolderObject({key:BX(n,t),config:n,credential:i})},rUe=async(e,t,n,r)=>{let i=e.requireCredential(r);await e.deleteObject({key:BX(n,t),config:n,credential:i,allowNotFound:!0})},iUe=(e,t,n)=>{let r=HX(e,t.id).split(`/`).slice(0,-1).join(`/`);return r?`${r}/${n}`:n},aUe=async(e,t,n,r,i)=>{let a=iUe(r,t,n),o=a.split(`/`).slice(0,-1).join(`/`),s=HX(r,t.id).split(`/`).at(-1)?.normalize(),c=await XX(e,r,i,o),l=n.normalize();if(c.some(e=>e!==s&&e===l))throw Error(`A file named “${n}” already exists in the folder.`);return ZX(e,t,a,r,i)},QX=e=>({list:(t,n)=>YX(e,t,n),browse:(t,n)=>XHe(e,t,n),listFolder:(t,n,r)=>ZHe(e,t,n,r),search:(t,n,r)=>QHe(e,t,n,r),upload:(t,n,r)=>$He(e,t,n,r),delete:(t,n,r)=>eUe(e,t,n,r),rename:(t,n,r,i)=>aUe(e,t,n,r,i),replace:(t,n,r,i)=>tUe(e,t,n,r,i),move:(t,n,r,i)=>ZX(e,t,n,r,i),createFolder:(t,n,r)=>nUe(e,t,n,r),deleteFolder:(t,n,r)=>rUe(e,t,n,r)}),$X=class{serviceType=`cloud_storage`;showServiceLink=!0;hotlinking=!0;authType=`api_key`;constructor({serviceId:e,serviceLabel:t,serviceURL:n,developerURL:r,apiKeyURL:i,apiKeyPattern:a,resolveConfig:o=e=>e,isConfigured:s,isConfigURL:c,operations:l}){this.serviceId=e,this.serviceLabel=t,this.serviceURL=n,this.developerURL=r,this.apiKeyURL=i,this.apiKeyPattern=a,this.resolveConfig=o,this.isConfigured=s,this.isConfigURL=c,this.operations=l}getLibraryOptions(e=QO.current){return iB(this.serviceId,e)}getConfig({fieldConfig:e}){let t=oB(this.serviceId,e);if(!t)throw Error(`${this.serviceLabel} configuration is not available`);return this.resolveConfig(t)}isEnabled=e=>{let t=oB(this.serviceId,e);return!!t&&this.isConfigured(this.resolveConfig(t))};isAssetURL=e=>{try{return this.isConfigURL(this.getConfig({}),e)}catch{return!1}};list=async e=>this.operations.list(this.getConfig(e),e);browse=async e=>this.operations.browse(this.getConfig(e),e);listFolder=async(e,t)=>this.operations.listFolder(e,this.getConfig(t),t);search=async(e,t)=>this.operations.search(e,this.getConfig(t),t);upload=async(e,t)=>this.operations.upload(e,this.getConfig(t),t);delete=async(e,t)=>this.operations.delete(e,this.getConfig(t),t);rename=async(e,t,n)=>this.operations.rename(e,t,this.getConfig(n),n);replace=async(e,t,n)=>this.operations.replace(e,t,this.getConfig(n),n);move=async(e,t,n)=>this.operations.move(e,t,this.getConfig(n),n);createFolder=async(e,t)=>this.operations.createFolder(e,this.getConfig(t),t);deleteFolder=async(e,t)=>this.operations.deleteFolder(e,this.getConfig(t),t)},eZ=e=>{let t=new DOMParser().parseFromString(e,`text/xml`),n=e=>{if(e.children.length===0)return e.textContent;let t={};return Array.from(e.children).forEach(e=>{let r=e.tagName,i=n(e);Object.hasOwn(t,r)?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i}),t};return n(t.documentElement)},tZ=e=>e?Array.isArray(e)?e:[e]:[],oUe=`blob.core.windows.net`,sUe=1e3,nZ=({account_name:e,container:t,endpoint:n})=>`${n?sP(n):`https://${e}.${oUe}`}/${t}`,rZ=({url:e,token:t,searchParams:n})=>`${e}?${[n?.toString(),t.trim().replace(/^[?&]/,``)].filter(Boolean).join(`&`)}`,iZ=(e,t,n)=>rZ({url:`${nZ(e)}/${oP(t)}`,token:n}),aZ=new $X({serviceId:`azure_blob_storage`,serviceLabel:`Azure Blob Storage`,serviceURL:`https://azure.microsoft.com/products/storage/blobs/`,developerURL:`https://learn.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api`,apiKeyURL:`https://portal.azure.com/#browse/Microsoft.Storage%2FStorageAccounts`,apiKeyPattern:/^\??(?:[\w-]+=[^&]*&)*sig=[^&]+(?:&[\w-]+=[^&]*)*$/,isConfigured:({container:e,account_name:t,endpoint:n})=>!!(e&&(t||n)),isConfigURL:(e,t)=>{let{public_url:n}=e;return[`${nZ(e)}/`,...n?[`${sP(n)}/`]:[]].some(e=>t.startsWith(e))},operations:QX({requireCredential:({apiKey:e})=>{if(!e)throw Error(`Azure Blob Storage SAS token is required`);return e},listPage:async({config:e,credential:t,prefix:n,cursor:r,delimiter:i})=>{let a=new URLSearchParams({restype:`container`,comp:`list`,maxresults:String(sUe),...n&&{prefix:n},...i&&{delimiter:i},...r&&{marker:r}}),o=nZ(e),s=await fetch(rZ({url:o,token:t,searchParams:a}));await oW(s,`Failed to list blobs`);let c=eZ(await s.text());return{items:tZ(c.Blobs?.Blob),cursor:c.NextMarker||void 0}},getKey:({Name:e})=>e,parseResults:(e,t,n)=>{let{public_url:r}=t,i=nZ(t);return e.map(({Name:e,Properties:a={}})=>{let o=e.split(`/`).pop()||e,s=HX(t,e),c=oP(e),l=`${i}/${c}`,u=r?`${sP(r)}/${c}`:l,d=a[`Last-Modified`],f=a[`Content-Length`];return{id:e,description:s,previewURL:r?u:rZ({url:l,token:n}),downloadURL:u,fileName:o,...d&&{lastModified:new Date(d)},...f&&{size:Number(f)},kind:KU(e)}})},putObject:async({key:e,file:t,config:n,credential:r})=>(await oW(await fetch(iZ(n,e,r),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"Content-Type":t.type||`application/octet-stream`},body:t}),`Failed to upload file ${t.name}`),{Name:e,Properties:{"Last-Modified":new Date().toUTCString(),"Content-Length":String(t.size),"Content-Type":t.type}}),copyObject:async({asset:e,key:t,config:n,credential:r})=>{let{id:i,size:a,lastModified:o}=e,s=await fetch(iZ(n,t,r),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"x-ms-copy-source":iZ(n,i,r)}});if(await oW(s,`Failed to copy blob ${i}`),s.headers.get(`x-ms-copy-status`)===`pending`)throw Error(`Failed to copy blob ${i}: the copy operation is still pending`);return{Name:t,Properties:{...o&&{"Last-Modified":o.toUTCString()},...a&&{"Content-Length":String(a)}}}},deleteObject:async({key:e,config:t,credential:n,allowNotFound:r=!1})=>{await oW(await fetch(iZ(t,e,n),{method:`DELETE`}),`Failed to delete blob ${e}`,{allowNotFound:r})},putFolderObject:async({key:e,config:t,credential:n})=>{await oW(await fetch(iZ(t,e,n),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"Content-Type":`application/x-directory`}}),`Failed to create folder ${e}`)}})}),{isEnabled:cUe,isAssetURL:lUe,list:uUe,browse:dUe,search:fUe,upload:pUe,delete:mUe,rename:hUe,replace:gUe,move:_Ue,createFolder:vUe,deleteFolder:yUe}=aZ,bUe=async({method:e,url:t,headers:n,payloadHash:r,accessKeyId:i,secretAccessKey:a,region:o,service:s,date:c})=>{let l=new URL(t),u=c.toISOString().replace(/[:-]|\.\d{3}/g,``),d=u.slice(0,8),f=l.pathname,p=[...l.searchParams.entries()].sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>`${aP(e)}=${aP(t)}`).join(`&`),m=Object.entries(n).map(([e,t])=>`${e.toLowerCase()}:${t.trim()}`).sort().join(`
|
||
`),h=Object.keys(n).map(e=>e.toLowerCase()).sort().join(`;`),g=[e,f,p,`${m}\n`,h,r].join(`
|
||
`),_=`AWS4-HMAC-SHA256`,v=`${d}/${o}/${s}/aws4_request`,y=[_,u,v,await el(g,{algorithm:`SHA-256`})].join(`
|
||
`),b=GH(await qH(await qH(await qH(await qH(await qH(`AWS4${a}`,d),o),s),`aws4_request`),y));return[`${_} Credential=${i}/${v},`,`SignedHeaders=${h}, Signature=${b}`].join(` `)},oZ=async({method:e,url:t,config:n,secretAccessKey:r,body:i=``,extraHeaders:a={}})=>{let{access_key_id:o,region:s=`us-east-1`}=n;if(!o)throw Error(`S3 access key ID is required`);let c=new Date,l=new URL(t),u=await el(i,{algorithm:`SHA-256`}),d={Host:l.host,"x-amz-date":c.toISOString().replace(/[:-]|\.\d{3}/g,``),"x-amz-content-sha256":u,...a},f=await bUe({method:e,url:t,headers:d,payloadHash:u,accessKeyId:o,secretAccessKey:r,region:s,service:`s3`,date:c});return fetch(t,{method:e,headers:{...d,Authorization:f},...i&&{body:i}})},sZ=({bucket:e,key:t,endpoint:n,region:r,forcePathStyle:i,publicUrl:a})=>a?`${sP(a)}/${t}`:n?`${sP(n)}/${e}/${t}`:i?`https://s3.${r}.amazonaws.com/${e}/${t}`:`https://${e}.s3.${r}.amazonaws.com/${t}`,xUe=(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a,public_url:o}=e;return[sZ({bucket:n,key:``,endpoint:i,region:r,forcePathStyle:a,publicUrl:o}),sZ({bucket:n,key:``,endpoint:i,region:r,forcePathStyle:a})].some(e=>t.startsWith(e))},cZ=e=>oP(e,aP),lZ=(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a}=e;return sZ({bucket:n,key:cZ(t),endpoint:i,region:r,forcePathStyle:a})},uZ=({acl:e})=>e?{"x-amz-acl":e}:{},SUe=QX({requireCredential:({apiKey:e})=>{if(!e)throw Error(`S3 secret access key is required`);return e},listPage:async({config:e,credential:t,prefix:n,cursor:r,delimiter:i})=>{let{bucket:a,region:o,endpoint:s,force_path_style:c}=e,l=new URLSearchParams({"list-type":`2`,"max-keys":`1000`,...n&&{prefix:n},...i&&{delimiter:i},...r&&{"continuation-token":r}}),u=await oZ({method:`GET`,url:s?`${sP(s)}/${a}?${l}`:c?`https://s3.${o}.amazonaws.com/${a}?${l}`:`https://${a}.s3.${o}.amazonaws.com/?${l}`,config:e,secretAccessKey:t});await oW(u,`Failed to list objects`);let d=eZ(await u.text());return{items:tZ(d.Contents),cursor:d.IsTruncated===`true`&&d.NextContinuationToken||void 0}},getKey:({Key:e})=>e,parseResults:(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a,public_url:o}=t;return e.map(e=>{let s=e.Key,c=s.split(`/`).pop()||s,l=HX(t,s),u=sZ({bucket:n,key:cZ(s),endpoint:i,region:r,forcePathStyle:a,publicUrl:o});return{id:s,description:l,previewURL:u,downloadURL:u,fileName:c,lastModified:new Date(e.LastModified),size:Number(e.Size),kind:KU(s)}})},putObject:async({key:e,file:t,config:n,credential:r})=>{let i=await t.arrayBuffer();return await oW(await oZ({method:`PUT`,url:lZ(n,e),config:n,secretAccessKey:r,body:i,extraHeaders:{"Content-Type":t.type||`application/octet-stream`,...uZ(n)}}),`Failed to upload file ${t.name}`),{Key:e,LastModified:new Date().toISOString(),ETag:``,Size:t.size,ContentType:t.type}},copyObject:async({asset:e,key:t,config:n,credential:r})=>{let{bucket:i}=n,{id:a,size:o=0}=e,s=await oZ({method:`PUT`,url:lZ(n,t),config:n,secretAccessKey:r,extraHeaders:{"x-amz-copy-source":`/${i}/${cZ(a)}`,"x-amz-metadata-directive":`COPY`,...uZ(n)}});await oW(s,`Failed to copy object ${a}`);let c=await s.text();if(/^\s*(?:<\?xml[^>]*>\s*)?<Error[\s>]/.test(c))throw Error(`Failed to copy object ${a}: ${c}`);return{Key:t,LastModified:new Date().toISOString(),ETag:``,Size:o}},deleteObject:async({key:e,config:t,credential:n,allowNotFound:r=!1})=>{await oW(await oZ({method:`DELETE`,url:lZ(t,e),config:t,secretAccessKey:n}),`Failed to delete object ${e}`,{allowNotFound:r})},putFolderObject:async({key:e,config:t,credential:n})=>{await oW(await oZ({method:`PUT`,url:lZ(t,e),config:t,secretAccessKey:n,extraHeaders:{"Content-Type":`application/x-directory`,...uZ(t)}}),`Failed to create folder ${e}`)}}),dZ=class extends $X{compatibleAPI=`s3`;constructor({requiredOption:e=`region`,objectAcl:t,resolveConfig:n=e=>e,...r}){super({...r,resolveConfig:e=>({...n(e),acl:t}),isConfigured:t=>!!(t.access_key_id&&t.bucket&&t[e]),isConfigURL:xUe,operations:SUe}),this.requiredOption=e}},CUe=new dZ({serviceId:`aws_s3`,serviceLabel:`Amazon S3`,serviceURL:`https://aws.amazon.com/s3/`,developerURL:`https://docs.aws.amazon.com/s3/`,apiKeyURL:`https://console.aws.amazon.com/iam/home#/security_credentials`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/}),wUe=new dZ({serviceId:`backblaze_b2`,serviceLabel:`Backblaze B2`,serviceURL:`https://www.backblaze.com/cloud-storage`,developerURL:`https://www.backblaze.com/docs/cloud-storage-s3-compatible-api`,apiKeyURL:`https://secure.backblaze.com/app_keys.htm`,apiKeyPattern:/^[A-Za-z0-9/+=]{30,}$/,resolveConfig:e=>({...e,endpoint:`https://s3.${e.region}.backblazeb2.com`,public_url:e.public_url??`https://${e.bucket}.s3.${e.region}.backblazeb2.com`})}),TUe=new dZ({serviceId:`bunny_storage`,serviceLabel:`Bunny Storage`,serviceURL:`https://bunny.net/storage/`,developerURL:`https://bunny.net/docs/storage/s3`,apiKeyURL:`https://dash.bunny.net/storage`,apiKeyPattern:/^[0-9a-f]{8}(?:-[0-9a-f]{4,12}){3,7}$/i,resolveConfig:e=>({...e,access_key_id:e.access_key_id??e.bucket,endpoint:`https://${e.region}-s3.storage.bunnycdn.com`})}),EUe={default:``,eu:`eu.`,fedramp:`fedramp.`},DUe=({account_id:e,jurisdiction:t=`default`})=>`https://${e}.${EUe[t]??``}r2.cloudflarestorage.com`,OUe=new dZ({serviceId:`cloudflare_r2`,serviceLabel:`Cloudflare R2`,serviceURL:`https://www.cloudflare.com/developer-platform/r2/`,developerURL:`https://developers.cloudflare.com/r2/`,apiKeyURL:`https://dash.cloudflare.com/?to=/:account/r2/api-tokens`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/,requiredOption:`account_id`,resolveConfig:e=>({...e,region:`auto`,endpoint:DUe(e)})}),kUe=new dZ({serviceId:`digitalocean_spaces`,serviceLabel:`DigitalOcean Spaces`,serviceURL:`https://www.digitalocean.com/products/spaces`,developerURL:`https://docs.digitalocean.com/products/spaces/`,apiKeyURL:`https://cloud.digitalocean.com/account/api/spaces`,objectAcl:`public-read`,apiKeyPattern:/^[A-Za-z0-9/+=]{43}$/,resolveConfig:e=>({...e,endpoint:`https://${e.region}.digitaloceanspaces.com`,public_url:e.public_url??`https://${e.bucket}.${e.region}.digitaloceanspaces.com`})}),AUe=/^[a-z0-9-]+\.storage\.(?:[a-z0-9-]+\.)?([a-z]{2}-[a-z]+-\d+)\.aws\.neon\.tech$/,jUe=({endpoint:e})=>{let t=URL.parse(e??``);if(t?.protocol!==`https:`||t.port)return;let[,n]=t.hostname.match(AUe)??[];return n?{endpoint:t.origin,region:n}:void 0},MUe=new dZ({serviceId:`neon_object_storage`,serviceLabel:`Neon Object Storage`,serviceURL:`https://neon.com/docs/storage/overview`,developerURL:`https://neon.com/docs/storage/s3-compatibility`,apiKeyURL:`https://neon.com/docs/storage/authentication`,apiKeyPattern:/^nsk_[a-z]+_[0-9a-f]{64}$/,requiredOption:`endpoint`,resolveConfig:e=>{let t=jUe(e);return{...e,endpoint:t?.endpoint,region:e.region??t?.region}}}),NUe=new dZ({serviceId:`scaleway_object_storage`,serviceLabel:`Scaleway Object Storage`,serviceURL:`https://www.scaleway.com/en/object-storage/`,developerURL:`https://www.scaleway.com/en/docs/object-storage/`,apiKeyURL:`https://console.scaleway.com/iam/api-keys`,objectAcl:`public-read`,apiKeyPattern:/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,resolveConfig:e=>({...e,endpoint:`https://s3.${e.region}.scw.cloud`,public_url:e.public_url??`https://${e.bucket}.s3.${e.region}.scw.cloud`})}),PUe=({project_id:e})=>`https://${e}.storage.supabase.co/storage/v1/s3`,FUe=({project_id:e,bucket:t})=>`https://${e}.supabase.co/storage/v1/object/public/${t}`,IUe=new dZ({serviceId:`supabase_storage`,serviceLabel:`Supabase Storage`,serviceURL:`https://supabase.com/storage`,developerURL:`https://supabase.com/docs/guides/storage`,apiKeyURL:`https://supabase.com/dashboard/project/_/storage/settings`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/,requiredOption:`project_id`,resolveConfig:e=>({...e,endpoint:PUe(e),public_url:e.public_url??FUe(e)})}),fZ=`https://ucarecdn.com`,LUe=/^https:\/\/[\w-]+\.ucarecd\.net\//i,RUe=(e=QO.current)=>iB(`uploadcare`,e),pZ=e=>{let t=oB(`uploadcare`,e);return t?t.config?.publicKey:void 0},zUe=e=>!!pZ(e),mZ=(e,{fieldConfig:t}={})=>{let{settings:{autoFilename:n=!1,defaultOperations:r=void 0}={},config:{cdnBase:i=void 0}={}}=oB(`uploadcare`,t)||{};return e.map(e=>{let{uuid:t,original_filename:a,original_file_url:o,mime_type:s,datetime_uploaded:c,size:l}=e,u=`${new URL(i??o).origin}/${t}/`,d=s.startsWith(`image/`),f=s.startsWith(`video/`);return{id:t,description:a,previewURL:`${u}${d?`-/preview/400x400/`:``}`,downloadURL:`${u}${d&&r?`-${r}`:``}${n?aP(a):``}`,fileName:a,lastModified:new Date(c),size:l,kind:d?`image`:f?`video`:`other`}})},hZ=({fieldConfig:e,apiKey:t},{secretKeyRequired:n=!0}={})=>{let r=pZ(e);if(!r)throw Error(`Uploadcare public key is not configured`);if(n&&!t)throw Error(`Uploadcare secret key is not provided`);return{publicKey:r,secretKey:t}},gZ=({publicKey:e,secretKey:t})=>({Accept:`application/vnd.uploadcare-v0.7+json`,Authorization:`Uploadcare.Simple ${e}:${t}`}),BUe=async(e,t)=>{try{let n=await fetch(`https://api.uploadcare.com/files/${e}/`,{headers:gZ(t)});if(n.ok){let{original_file_url:e}=await n.json();if(e)return new URL(e).origin}}catch{}return fZ},_Z=async(e,{maxPages:t=10,filter:n}={})=>{let{kind:r,fieldConfig:i}=e,a=gZ(hZ(e,{secretKeyRequired:!1})),o=new URLSearchParams({limit:`100`,ordering:`-datetime_uploaded`,stored:`true`});return mZ(await GX(async e=>{let t=await fetch(e??`https://api.uploadcare.com/files/?${o}`,{headers:a});await oW(t,`Failed to fetch files`);let i=await t.json(),{results:s}=i;return r===`image`&&(s=s.filter(e=>e.is_image)),n&&(s=s.filter(n)),{results:s,next:i.next}},{maxPages:t}),{fieldConfig:i})},VUe=async e=>_Z(e),HUe=async(e,t)=>{let n=e.toLowerCase();return _Z(t,{filter:e=>e.original_filename.toLowerCase().includes(n)})},UUe=async(e,t)=>GH(await qH(e,String(t))),vZ={aws_s3:CUe,azure_blob_storage:aZ,backblaze_b2:wUe,bunny_storage:TUe,cloudflare_r2:OUe,cloudinary:fMe,digitalocean_spaces:kUe,neon_object_storage:MUe,scaleway_object_storage:NUe,supabase_storage:IUe,uploadcare:{serviceType:`cloud_storage`,serviceId:`uploadcare`,serviceLabel:`Uploadcare`,serviceURL:`https://uploadcare.com/`,showServiceLink:!0,hotlinking:!0,authType:`api_key`,developerURL:`https://uploadcare.com/docs/`,apiKeyURL:`https://app.uploadcare.com/projects/-/api-keys/`,apiKeyPattern:/^[a-f0-9]{20}$/,isEnabled:zUe,isAssetURL:e=>{let t=RUe();if(!t)return!1;let n=t.config?.cdnBase;if(n===void 0)return e.startsWith(`${fZ}/`)||LUe.test(e);try{return e.startsWith(`${new URL(n).origin}/`)}catch{return!1}},list:VUe,search:HUe,upload:async(e,t)=>{if(e.length===0)return[];let{fieldConfig:n}=t,r=hZ(t),{publicKey:i,secretKey:a}=r,o=Math.floor(Date.now()/1e3)+1800,s=await UUe(a,o),c=new FormData;c.append(`UPLOADCARE_PUB_KEY`,i),c.append(`UPLOADCARE_STORE`,`1`),c.append(`signature`,s),c.append(`expire`,String(o));let l=new Map;e.forEach(e=>{let t=UX(e.name,{assetNamesInSameFolder:[...l.keys()]});l.set(t,e),c.append(t,e)});let u=await fetch(`https://upload.uploadcare.com/base/`,{method:`POST`,body:c});await oW(u,`Failed to upload files`);let d=await u.json(),f=Object.entries(d).filter(([e])=>!e.startsWith(`UPLOADCARE_`)),{cdnBase:p}=oB(`uploadcare`,n).config,m=p===void 0&&f.length?await BUe(f[0][1],r):fZ;return mZ(f.map(([e,t])=>{let n=l.get(e),r=n?.type||`application/octet-stream`,i=r.startsWith(`image/`);return{uuid:t,original_filename:e,original_file_url:`${m}/${t}/${e}`,size:n?.size||0,mime_type:r,is_image:i,is_ready:!0,content_info:null,datetime_uploaded:new Date().toISOString(),datetime_stored:new Date().toISOString(),datetime_removed:null}}),{fieldConfig:n})},delete:async(e,t)=>{let n={...gZ(hZ(t)),"Content-Type":`application/json`},r=Dq(e.map(({id:e})=>e),100);for(let e=0;e<r.length;e+=1)e>0&&await Zc(50),await oW(await fetch(`https://api.uploadcare.com/files/storage/`,{method:`DELETE`,headers:n,body:JSON.stringify(r[e])}),`Failed to delete files`)}}},yZ=Object.keys(vZ),WUe=/^(?:https?|data|blob):/,GUe=e=>{if(vZ.cloudinary?.isEnabled?.(e)){let t=fB(e);if(t.output_filename_only&&t.config?.cloud_name)return`https://res.cloudinary.com/${t.config.cloud_name}`}},bZ=({value:e,entry:t,collectionName:n,fileName:r,componentName:i,fieldConfig:a,typedKeyPath:o,locale:s})=>{if(!e)return;if(WUe.test(e))return{url:e};if(rX(e)){let t=GUe(a);if(t)return{url:`${t}/${e}`}}let c=iX({value:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:o,locale:s});return c?{asset:c}:void 0},xZ=async(e,t=!1)=>{let{url:n,asset:r}=e??{};if(n)return n;if(r)return(t?await AX(r):await wX(r))??LX(r)},SZ=async({thumbnail:e=!1,...t})=>xZ(bZ(t),e),CZ=({componentNames:e,...t})=>{let n=e.map(rM).filter(Boolean);return bZ(t)??RB.current.values().filter(({componentName:e,typedKeyPath:t})=>!!t&&n.includes(e)).map(({componentName:e,typedKeyPath:n})=>bZ({...t,componentName:e,typedKeyPath:n})).find(Boolean)},KUe=async e=>xZ(CZ(e)),wZ=/^.+?:\w+:/,TZ=e=>e.replace(wZ,``),qUe=[`rich_text`,`raw`],JUe={rich_text:`rich-text`,raw:`plain-text`},EZ=[`bold`,`italic`,`strikethrough`,`code`,`link`],DZ=[...EZ,`heading-one`,`heading-two`,`heading-three`,`heading-four`,`heading-five`,`heading-six`,`bulleted-list`,`numbered-list`,`quote`],YUe={bold:`bold`,italic:`italic`,strikethrough:`strikethrough`,code:`code`,link:`link`,"heading-one":`heading-1`,"heading-two":`heading-2`,"heading-three":`heading-3`,"heading-four":`heading-4`,"heading-five":`heading-5`,"heading-six":`heading-6`,"bulleted-list":`bulleted-list`,"numbered-list":`numbered-list`,quote:`blockquote`,align:`align`,"code-block":`code-block`,table:`table`,hr:`horizontal-rule`},OZ=[`code-block`,`table`,`hr`],XUe=[`code-block`,`image`],kZ=e=>{if(e.widget!==`richtext`)return`markdown`;let{format:t=$O.current?.field_defaults?.richtext?.format}=e;return t===`html`?`html`:`markdown`},AZ=e=>{let t=$O.current?.field_defaults?.richtext??{},{editor_components:n=t.editor_components??[...XUe,...NO.keys()],linked_images:r=t.linked_images??!0}=e;return n.map(e=>e===`image`&&r?`linked-image`:e)},jZ=e=>AZ(e).map(e=>iM(e)).filter(e=>!!e),ZUe=(e,t)=>[...e,...OZ.filter(e=>t.includes(e))].map(e=>YUe[e]).filter(Boolean),QUe=e=>e?.allow_nested_components??$O.current?.field_defaults?.richtext?.allow_nested_components??!0,$Ue=e=>e.match(/^[^:]+/)?.[0],eWe=({fieldConfig:e,format:t,allowNestedComponents:n,inEditorComponent:r,parentComponentNames:i})=>r&&!n?[]:jZ(e).filter(e=>t!==`html`||Gj(e)).filter(e=>n!==`exclude_self`||!i.includes(e.id)),tWe=(e,t,n)=>Object.keys(e).filter(e=>{let[r]=e.match(wZ)??[];return!!r?.startsWith(`${t}:`)&&!n(r)}),MZ=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t},nWe=e=>MZ(e).content.firstElementChild,NZ=e=>{let{outerHTML:t}=e,n=`</${e.localName}>`;return t.endsWith(n)?t.slice(0,-n.length):t},rWe=(e,t)=>{let n=e.lastIndexOf(`<`,t-1);return t>0&&n>e.lastIndexOf(`>`,t-1)&&/[a-z]/i.test(e[n+1]??``)},PZ={img:[`src`,`srcset`],source:[`src`,`srcset`],video:[`src`,`poster`],audio:[`src`]},FZ=Object.keys(PZ),iWe=FZ.join(`, `),IZ=FZ.join(`|`),LZ=`<(?:${IZ})[\\s/>]`,RZ=new RegExp(LZ,`i`),aWe=new RegExp(LZ,`gi`),zZ=`data-deferred-`,BZ=`:is(${Object.entries(PZ).flatMap(([e,t])=>t.flatMap(t=>[`${e}[${t}]`,`${e}[${zZ}${t}]`])).join(`, `)}):not([data-processed])`,VZ=e=>[...e.content.querySelectorAll(iWe)],oWe=e=>{if(!RZ.test(e))return e;let t=MZ(e);return VZ(t).forEach(e=>{PZ[e.localName].forEach(t=>{let n=e.getAttribute(t);e.removeAttribute(`${zZ}${t}`),n!==null&&(e.setAttribute(`${zZ}${t}`,n),e.removeAttribute(t))})}),t.innerHTML},HZ=e=>{let t=[],n=0;for(;;){let r=e.slice(n).search(/[^\s,]/);if(r===-1)break;n+=r;let i=e.slice(n).match(/^\S+/)?.[0];if(n+=i.length,i.endsWith(`,`))t.push({url:i.replace(/,+$/,``),descriptor:``});else{let r=e.indexOf(`,`,n),a=r===-1?e.length:r;t.push({url:i,descriptor:e.slice(n,a).trim()}),n=a}}return t},sWe=e=>e.map(({url:e,descriptor:t})=>[e.replace(/\s/g,encodeURIComponent),t].filter(Boolean).join(` `)).join(`, `),UZ=(e,t)=>{let n=!1,r=e.flatMap((e,r)=>{let i=t(e.url,r);return i===null?(n=!0,[]):i!==void 0&&i!==e.url?(n=!0,[{...e,url:i}]):[e]});if(n)return r.length?sWe(r):null},cWe=async(e,t)=>{let n=PZ[e.localName]??[],r=async e=>{try{return await t(e)??e}catch{return e}},i=async(e,t)=>{if(!t)return t;if(e!==`srcset`)return r(t);let n=HZ(t),i=await Promise.all(n.map(({url:e})=>r(e)));return UZ(n,(e,t)=>i[t])??t},a=await Promise.all(n.map(async t=>{let n=`${zZ}${t}`,r=e.hasAttribute(n),a=e.getAttribute(r?n:t);return a===null?void 0:{name:t,deferredName:n,deferred:r,value:a,url:await i(t,a)}})),o=!1;a.forEach(t=>{if(!t)return;let{name:n,deferredName:r,deferred:i,value:a,url:s}=t;i&&e.removeAttribute(r),(i||s!==a)&&(e.setAttribute(n,s),o=!0)});let{localName:s,parentElement:c}=e;o&&s===`source`&&/^(?:audio|video)$/.test(c?.localName??``)&&c.load()},lWe=new RegExp(Zj(),`g`),uWe=[`<(?:${IZ})(?=[\\s/>])`,`(?:[^<>"']|"[^"<]*"|'[^'<]*')*>`].join(``),WZ=RegExp(`${lWe.source}|(?<tag>${uWe})`,`gi`),GZ=(e,t)=>{let n=!1;return PZ[e.localName].forEach(r=>{let i=e.getAttribute(r);if(!i)return;if(r!==`srcset`){let a=t(i);a===null?(e.removeAttribute(r),n=!0):a!==void 0&&a!==i&&(e.setAttribute(r,a),n=!0);return}let a=UZ(HZ(i),e=>t(e));a!==void 0&&(a===null?e.removeAttribute(r):e.setAttribute(r,a),n=!0)}),n},KZ=({value:e,tag:t,index:n,callback:r})=>{if(rWe(e,n))return;let i=nWe(t);return GZ(i,r)?i:void 0},dWe=(e,t)=>e.replace(WZ,(n,...r)=>{let{alt:i=``,src:a,tag:o}=r.at(-1),s=r.at(-3);if(o!==void 0){let r=KZ({value:e,tag:o,index:s,callback:e=>t(e)??void 0});return r?NZ(r):n}let c=a;if(!c)return n;let l=c.length>2&&c.startsWith(`<`)&&c.endsWith(`>`),u=t(l?c.slice(1,-1):c);if(typeof u!=`string`)return n;let d=i.length+4,f=l?`<${u}>`:u;return`${n.slice(0,d)}${f}${n.slice(d+c.length)}`}),fWe=(e,t)=>{if(!RZ.test(e))return e;let n=MZ(e),r=!1;return VZ(n).forEach(e=>{r=GZ(e,t)||r}),r?n.innerHTML:e},qZ=(e,t,n)=>t===`html`?fWe(e,n):dWe(e,n),JZ=(e,t)=>{let n=new Set;return qZ(e,t,e=>{n.add(e)}),[...n]},pWe=(e,t,n)=>[...t.values()].some(e=>e!==void 0)?qZ(e,n,e=>t.get(e)):e,YZ=e=>{let t=$O.current?._baseURL;return t&&!e.startsWith(`blob:`)?e.replace(t,``):e},mWe=e=>{let t={targets:e,byURL:new Map,byBlobURL:new Map,byPath:new Map,resolves:!1};return e.forEach(({url:e,asset:n},r)=>{let[i,a]=n?[t.byPath,n.path]:e.startsWith(`blob:`)?[t.byBlobURL,e]:[t.byURL,e];i.set(a,[...i.get(a)??[],r])}),t.resolves=!!(t.byBlobURL.size||t.byPath.size),t},XZ=({entry:e,collectionName:t,fileName:n,locale:r,keyPath:i,valueMap:a,isIndexFile:o,fieldConfig:s})=>{let c;return l=>{c??=vM({collectionName:t,fileName:n,keyPath:i,valueMap:a,isIndexFile:o});let u={entry:e,collectionName:t,fileName:n,typedKeyPath:c,locale:r,value:l},{widget:d=`string`}=s;return mk.includes(d)?bZ({...u,fieldConfig:s}):CZ({...u,componentNames:AZ(s)})}},ZZ=(e,t)=>e.byURL.get(t)??(t.includes(`%`)?e.byURL.get(rP(t)):void 0),QZ=(e,t,n)=>{let r=ZZ(e,t)??[];if(!e.resolves)return r;let{url:i,asset:a}=n(t)??{},o=i??a?.blobURL;return[...r,...o!==void 0&&e.byBlobURL.get(o)||[],...a&&e.byPath.get(a.path)||[]]},$Z=(e,t,n)=>t.map(t=>{let{url:r,newURL:i}=e.targets[t];return typeof i==`function`?i(n):i&&r!==n&&r===rP(n)?i.replaceAll(` `,`%20`):i}).find(Boolean),hWe=(e,t)=>{if(ZZ(e,t))return!0;if(!t.includes(`![`)&&!RZ.test(t))return!1;let n=t=>t.some(t=>!!ZZ(e,t));if(n(JZ(t,`markdown`)))return!0;let r=[...t.matchAll(WZ)].filter(({groups:e})=>e?.tag).length;return(t.match(aWe)?.length??0)>r&&n(JZ(t,`html`))},gWe=({matcher:e,collectionName:t,entry:n,content:r,keyPath:i,value:a,isIndexFile:o,collectionFile:s,locale:c})=>{let l=new Set,u=s?.name,d=_M({collectionName:t,fileName:u,valueMap:r,keyPath:i,isIndexFile:o});if(!d)return{indexes:l};let{widget:f=`string`}=d,p=XZ({entry:n,collectionName:t,fileName:u,locale:c,keyPath:i,valueMap:r,isIndexFile:o,fieldConfig:d});if(mk.includes(f)){let t=QZ(e,a,p),n=$Z(e,t,a);return t.forEach(e=>l.add(e)),n&&(r[i]=n),{indexes:l,field:d}}if(hk.includes(f)){let t=!1,n=qZ(a,kZ(d),n=>{let r=QZ(e,n,p);if(!r.length)return;let i=$Z(e,r,n);return r.forEach(e=>l.add(e)),t||=!!i,i||void 0});t&&(r[i]=n)}return{indexes:l,field:d}},eQ=(e,{entries:t,every:n=!1,onMatch:r})=>{let i=mWe(e.map(e=>e.url===void 0?e:{...e,url:YZ(e.url)})),a=n||e.some(({newURL:e})=>!!e),o=e.map(()=>[]);return t.forEach(t=>{let{locales:n}=t,s,c=new Set,l=()=>!a&&c.size===e.length;for(let[e,{content:a}]of Object.entries(n)){for(let[n,o]of Object.entries(a))if(typeof o==`string`&&o&&(i.resolves||hWe(i,o))){s??=eP(t).map(e=>{let n=sj(e,t);return{collection:e,isIndexFile:zk(e,t),files:n.length?n:[void 0]}});for(let{collection:u,isIndexFile:d,files:f}of s){let s={matcher:i,collectionName:u.name,entry:t,content:a,keyPath:n,locale:e};if(f.map(e=>gWe({...s,value:o,isIndexFile:d,collectionFile:e})).forEach(({indexes:i,field:a},o)=>{i.forEach(e=>c.add(e)),i.size&&r&&r({entry:t,collection:u,collectionFile:f[o],locale:e,keyPath:n,fieldConfig:a})}),l())break}if(l())break}if(l())break}c.forEach(e=>{o[e].push(t)})}),o},tQ=async(e,{entries:t=tj.current,newURL:n=``}={})=>eQ([{url:e,newURL:n}],{entries:t})[0],nQ=(e,{entries:t=tj.current}={})=>eQ(e,{entries:t}),rQ=async(e,t)=>nQ(e,t),_We=async(e,{entries:t=tj.current}={})=>{let n=[];return eQ(e,{entries:t,every:!0,onMatch:e=>{n.push(e)}}),n},vWe=async(e,t)=>{let n=t===`image`?await CX(e):null;if(!n)return{createdDate:void 0,coordinates:void 0};let r={};try{let{parse:e}=await dN(`exifr`,`dist/lite.esm.mjs`);r=await e(n)??{}}catch{}let{latitude:i,longitude:a,DateTimeOriginal:o,CreateDate:s=o}=r;return{createdDate:s instanceof Date?s:void 0,coordinates:Number.isFinite(i)&&Number.isFinite(a)?{latitude:dM(i,7),longitude:dM(a,7)}:void 0}},iQ=({element:e,eventType:t,src:n,getInfo:r})=>new Promise(i=>{e.addEventListener(t,()=>i(r()),{once:!0}),e.addEventListener(`error`,()=>i({}),{once:!0}),e.src=n}),yWe=e=>{let t=new Image;return iQ({element:t,eventType:`load`,src:e,getInfo:()=>({dimensions:{width:t.naturalWidth,height:t.naturalHeight}})})},bWe=async(e,t)=>{let n=document.createElement(t);return iQ({element:n,eventType:`loadedmetadata`,src:e,getInfo:()=>{let{duration:e}=n;if(t===`audio`)return{duration:e};let{videoWidth:r,videoHeight:i}=n;return{dimensions:{width:r,height:i},duration:e}}})},aQ=async(e,t)=>t===`image`?yWe(e):bWe(e,t),xWe=async(e,t,n)=>{let[{dimensions:r,duration:i},{createdDate:a,coordinates:o}]=await Promise.all([aQ(t,n),vWe(e,n)]);return{dimensions:r,duration:i,createdDate:a,coordinates:o}},SWe=new Map,oQ=e=>{let{kind:t,downloadURL:n}=e;return VU(t)?bA(SWe,n,()=>aQ(n,t)):Promise.resolve({})},sQ=async({downloadURL:e})=>tQ(e),CWe=async e=>{if(!e.length)return[];let t=await rQ(e.map(({downloadURL:e})=>({url:e})));return[...new Set(t.flat())]},wWe=6,cQ=WO({}),lQ=new Set,uQ=async e=>{try{let{ok:t,status:n}=await fetch(e,{method:`HEAD`});return t?!0:n>=400&&![405,429,501].includes(n)?!1:void 0}catch{try{await fetch(e,{method:`HEAD`,mode:`no-cors`});return}catch{return!1}}},TWe=e=>window.location.protocol===`https:`&&e.startsWith(`http:`),EWe=async e=>{let{kind:t,downloadURL:n}=e;if(!TWe(n)){if(VU(t)){let t=await oQ(e);return`dimensions`in t||`duration`in t||await uQ(n)===!0}return uQ(n)}},DWe=async e=>{let t=e.filter(({id:e})=>!lQ.has(e));t.forEach(({id:e})=>lQ.add(e)),await lU(t,async e=>{let t=await EWe(e);t!==void 0&&(cQ.current={...cQ.current,[e.id]:t})},{concurrency:wWe})},OWe=/^https?:\/\/\S+$/,kWe=e=>{let t=$O.current?._baseURL;return OWe.test(e)&&!(t&&e.startsWith(t))&&!Object.values(vZ).some(({isEnabled:t,isAssetURL:n})=>(t?.()??!0)&&n?.(e))},AWe=(e,t)=>{let n=e;try{n=decodeURIComponent(new URL(e).pathname.split(`/`).filter(Boolean).at(-1)??``)}catch{}n||=e;let r=KU(n);return{id:e,description:e,previewURL:e,downloadURL:e,fileName:n,kind:r===`other`&&t?`image`:r}},jWe=(e,t,n)=>JY(e).map(({collection:e,collectionFile:r,isIndexFile:i})=>_M({collectionName:e.name,fileName:r?.name,valueMap:t,keyPath:n,isIndexFile:i})?.widget??`string`).toArray(),MWe=e=>{let t=new Map;return e.forEach(e=>{Object.values(e.locales).forEach(({content:n})=>{Object.entries(n).forEach(([r,i])=>{if(typeof i!=`string`||!kWe(i))return;let a=jWe(e,n,r);a.some(e=>mk.includes(e))&&!t.has(i)&&t.set(i,AWe(i,a.includes(`image`)))})})}),[...t.values()]},dQ=KO(()=>MWe(tj.current)),fQ={serviceType:`cloud_storage`,serviceId:`linked`,get serviceLabel(){return X(`linked_files`)},serviceURL:``,showServiceLink:!1,hotlinking:!0,authType:`none`,list:async()=>{let e=dQ.current;return DWe(e),e}},pQ=KO(()=>($O.current,Object.values(vZ).filter(({isEnabled:e})=>e?.()??!0))),NWe=e=>e===`linked`?fQ:pQ.current.find(t=>t.serviceId===e),mQ=({serviceId:e})=>`/assets/-/${e}`,hQ=(e,{id:t})=>`${mQ(e)}/${oP(t)}`,gQ=({kind:e,fileName:t})=>HU(e,t),_Q=(e,t)=>{let n=new Set(e.map(({id:e})=>e));return[...e,...t.filter(({id:e})=>!n.has(e))]},vQ=WO(),yQ=WO(),bQ=e=>!!e?.browse,xQ=WO([]),SQ=WO(``),CQ=WO(),wQ=WO(!1),TQ=WO(),EQ=WO(),DQ=WO({}),OQ=WO(),kQ=WO(!1),AQ=WO([]),PWe=KO(()=>new Set(AQ.current.map(({id:e})=>e))),jQ=WO(),MQ=e=>{let t=AQ.current,n=t.filter(({id:t})=>e(t));n.length!==t.length&&(AQ.current=n),jQ.current&&!e(jQ.current.id)&&(jQ.current=void 0)},FWe=KO(()=>AQ.current.length?[...AQ.current]:jQ.current?[jQ.current]:[]),NQ=WO(),PQ=WO(),FQ=WO(``),IQ=({serviceId:e})=>{let t=CW.apiKeys?.[e]??``,[n=``,r=``]=(CW.logins?.[e]??``).split(` `);return{apiKey:t,userName:n,password:r}},LQ=e=>{let{apiKey:t,password:n}=IQ(e);return e.authType===`none`||!!t||!!n},IWe=()=>{yQ.current=void 0,xQ.current=[],OQ.current=void 0,kQ.current=!1,AQ.current=[],SQ.current=``,jQ.current=void 0,CQ.current=void 0,NQ.current=void 0,PQ.current=void 0,TQ.current=void 0,EQ.current=void 0,FQ.current=``},RQ=e=>{SQ.current=e,AQ.current=[],jQ.current=void 0,CQ.current=void 0},zQ=WO(),LWe={type:`grid`,showInfo:!0,sort:{key:`name`,order:`ascending`}},BQ=WO({type:`grid`,showInfo:!0}),VQ=()=>{let e=vQ.current;return e?`-/${e.serviceId}`:BB.current?.internalPath??`*`},RWe=async({repository:e})=>{await bR(e,`assets-view`,zQ),JO(()=>{BB.current,vQ.current,co(()=>{let e=zQ.current?.[VQ()]??structuredClone(LWe);(0,Cr.default)(e,BQ.current)||(BQ.current=e)})}),JO(()=>{let e=BQ.current;co(()=>{let t=VQ(),n=zQ.current?.[t]??{};(0,Cr.default)(e,n)||(zQ.current={...zQ.current,[t]:e})})})},zWe=(e,t)=>{let{commitAuthor:n,commitDate:r}=e;return t===`commit_author`?XL(n):t===`commit_date`?r:t===`name`?bk(e.name).filename:e[t]??``},BWe=(e,{key:t,order:n}={})=>{if(!t||!n)return e;let r=[...e],i={commit_author:String,commit_date:Date}[t]||r[0]?.[t]?.constructor||String;return _R(r,e=>{let n=zWe(e,t);return i===String?n??``:Number(n??0)},i===String,n),r},HQ=WO(!1),UQ=WO(!1),WQ=WO(!1),VWe=KO(()=>!!QB.current.files.length),GQ=({label:e,collectionName:t,fileName:n,internalPath:r})=>{if(e)return e;if(t===void 0)return X(r===void 0?`all_assets`:`global_assets`);let i=YA(t),a=i?XA(i):t;if(!n)return a;let o=i?ij(i,n):void 0;return`${a} › ${o?oj(o):n}`},KQ=KO(()=>{let{current:e}=JB,{current:t}=BB;return e&&t&&t.internalPath!==void 0?e.filter(e=>aX(e,t)):e?[...e]:[]}),qQ=KO(()=>{let e=KQ.current,t=JV.current;return t===void 0?e:rH({dirPath:t,assets:e})}),JQ=KO(()=>{let e=JV.current;return e===void 0?[]:nH({dirPath:e,assets:KQ.current})}),HWe=KO(()=>{let e=VV.current;if(e){let{name:t,path:n}=e,r=KQ.current;return{name:t,path:n,folderCount:nH({dirPath:n,assets:r}).length,assetCount:rH({dirPath:n,assets:r}).length}}let t=BB.current;if(!t)return;let n=JV.current;return{name:BV.current.split(`/`).at(-1)||Fc.current&&GQ(t),path:n??t.internalPath,folderCount:n===void 0?void 0:JQ.current.length,assetCount:qQ.current.length}}),YQ=(e,t)=>{let n=e.findIndex(t);return n===-1?{}:{previous:e[n-1],next:e[n+1]}},XQ={},UWe=qO(()=>BQ.current.sort),ZQ=qO(()=>BQ.current.filter),WWe=qO(()=>BQ.current.group),GWe=KO(()=>BWe(qQ.current,UWe.current)),KWe=KO(()=>uX(GWe.current,ZQ.current)),QQ=KO(()=>{let e=OHe(KWe.current,WWe.current);return(0,Cr.default)(XQ,e)||(XQ=e),XQ}),qWe=KO(()=>{let e=JQ.current.length;return new Map(Object.values(QQ.current).flat(1).map((t,n)=>[t.path,n+e]))});JO(()=>{let{current:e}=XJ;e&&!co(()=>zQ.current)&&RWe(e)}),JO(()=>{let e=qQ.current,t=ZQ.current,n=co(()=>XB.current);YB.current=[],n&&!uX(e.filter(({path:e})=>e===n.path),t).length&&(XB.current=void 0),co(()=>CW.devModeEnabled)&&console.info(`listedAssets`,e)});var $Q=WO(!1),e$=WO(!1),t$=WO(0),n$=GO({show:!1,multiple:!1}),r$=GO({id:void 0,show:!1,status:`success`,message:void 0,count:1,sourceLanguage:void 0}),i$=GO({id:0,show:!1,status:`success`,message:``}),a$=WO(null),o$=WO(null),s$=WO(),c$=KO(()=>$Q.current||HQ.current),l$=WO(``),u$=WO(``),d$=WO(``),f$=WO(``),p$=(e=window.location.href)=>{let[t,...n]=new URL(e).hash.substring(1).split(`#`)[0].split(`?`),r=new URLSearchParams(n.join(`?`));return{path:rP(`${t.startsWith(`/`)?``:`/`}${t}`.replace(/(?!^)\/+$/,``)),params:Object.fromEntries([...new Set(r.keys())].map(e=>[e,r.getAll(e).join(`,`)]))}},m$=null,h$=new Set,g$=!1,_$=void 0,JWe=e=>{m$&&h$.add(e)},YWe=async()=>{if(!h$.size||g$){h$.clear();return}let e=Promise.withResolvers();_$=e.resolve,await Promise.race([Promise.allSettled(h$),Zc(300),e.promise]),_$=void 0,h$.clear()};globalThis.addEventListener?.(`keydown`,()=>{m$&&(m$.skipTransition(),g$=!0,_$?.())},{capture:!0});var v$=(e,t)=>{if(!document.startViewTransition||m$){t();return}let n={types:[e],update:async()=>{t(),await Zc(50),await new Promise(e=>{Vi(()=>{e(void 0)})}),await YWe()}};try{let e=document.startViewTransition(n);m$=e,g$=!1,e.ready.catch(()=>void 0),e.finished.catch(e=>{console.error(e)}).finally(()=>{m$=null,h$.clear()})}catch{m$=null,t()}},XWe=e=>{let t=window.navigation?.currentEntry?.index??-1;if(t===-1)return;let[n]=window.navigation.entries().filter(({url:n,index:r})=>n===e&&r!==t).map(({index:e})=>e).sort((e,n)=>Math.abs(e-t)-Math.abs(n-t));if(n!==void 0)return n<t?`forwards`:`backwards`},ZWe=(e,t,n)=>{let r=p$(e).path,i=p$(t).path,a=n.test(r)&&n.test(i),o=r.split(`/`).length,s=i.split(`/`).length;return!a||o===s?`unknown`:o<s?`forwards`:`backwards`},y$=(e,t,n)=>{let{isTrusted:r,oldURL:i,newURL:a}=e;r?v$(XWe(i)??ZWe(i,a,n),()=>t()):t()},b$=async(e,{state:t={},replaceState:n=!1,notifyChange:r=!0,transitionType:i=`unknown`}={})=>{let{path:a}=p$();if(a===rP(e)&&!Object.keys(t).length&&!n)return;let{origin:o,pathname:s,hash:c}=window.location,l=`${o}${s}${c}`,u=`${o}${s}#${e}`,d=n?window.history.state?.from:l,f=[{...t,from:d},``,u];n?window.history.replaceState(...f):window.history.pushState(...f),r&&v$(i,()=>{window.dispatchEvent(new HashChangeEvent(`hashchange`,{oldURL:l,newURL:u}))})},QWe=/^\/edit\/(?<collectionName>[^/]+)\/(?<subPath>.+)$/,$We=()=>{let{path:e,params:t}=p$(),{collectionName:n,subPath:r}=e.match(QWe)?.groups??{};if(!n||!r)return!1;let i=new URLSearchParams(t).toString();return b$(`${oP(`/collections/${n}/entries/${r}`)}${i?`?${i}`:``}`,{replaceState:!0}),!0},eGe=[`workflow`,`config`,`menu`],tGe={collections:`contents`,assets:`assets`},nGe=(e,t)=>{let{pageName:n}=e.match(`^\\/(?<pageName>${t.join(`|`)})(?=\\/|$)`)?.groups??{};return n?eGe.includes(n)&&e!==`/${n}`?{notFound:!0}:{pageName:n,searchMode:n===`search`?void 0:tGe[n]??null}:e===`/`?{redirect:`#/collections`}:{notFound:!0}},x$=(e,{returnTo:t,...n}={})=>{let r=`backwards`;if(window.navigation?.currentEntry){let{index:i}=window.navigation.currentEntry,{sameDocument:a,url:o}=window.navigation.entries()[i-1]??{},s=o?p$(o).path:void 0;a&&s!==void 0&&(s===rP(e)||t?.(s))?v$(r,()=>{window.navigation.back()}):b$(e,{...n,transitionType:r})}else window.history.state?.from?v$(r,()=>{window.history.back()}):b$(e,{...n,transitionType:r})},rGe=({collectionName:e,dirPath:t=``})=>e===`_singletons`?`/collections`:t?oP(`/collections/${e}/filter/${t}`):`/collections/${e}`,S$=()=>{let{display_url:e,_siteURL:t}=$O.current;hB(e||t||`/`)},C$=!1,iGe=()=>{C$=!1,Vi()},aGe=()=>{C$||(C$=!0,queueMicrotask(iGe))},oGe=`200px 0px`,w$=200,T$=-1/0,E$=!1,sGe=()=>{E$||(E$=!0,globalThis.addEventListener(`scroll`,()=>{T$=performance.now()},{capture:!0,passive:!0}))},D$=(e,t)=>{if(!(`IntersectionObserver`in globalThis))return Ire(e,t);sGe();let n,r=Fre(e,i=>{r(),i&&performance.now()-T$>w$?t():n=Ire(e,t,{delay:w$,rootMargin:oGe})});return()=>{r(),n?.()}},cGe=new Set([`$$slots`,`$$events`,`$$legacy`,`kind`,`loading`,`asset`,`src`,`variant`,`blurBackground`,`cover`,`checkerboard`,`dissolve`,`alt`,`controls`,`holdTransition`,`onError`]),lGe=V(`<img/>`),uGe=V(`<video></video>`,2),dGe=V(`<audio></audio>`),fGe=V(`<div role="none" class="blur svelte-1yaifwd"><div role="status" class="overlay svelte-1yaifwd"><!></div> <img role="none" loading="lazy" alt=""/></div>`),pGe=V(`<div role="none"><!> <!></div>`),mGe={hash:`svelte-1yaifwd`,code:`.preview.svelte-1yaifwd {display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%;&.tile {border-width:1px;border-style:solid;border-color:transparent;padding:var(--tile-padding, 12px);.sui.icon {font-size:48px;}}&.icon {border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size, 32px);height:var(--icon-size, 32px);}&:is(.tile:where(.svelte-1yaifwd), .icon:where(.svelte-1yaifwd)) {overflow:hidden;aspect-ratio:1 / 1;img:where(.svelte-1yaifwd) {
|
||
/* Prevent the image from being dragged */pointer-events:none;}}.blur:where(.svelte-1yaifwd) {display:contents;& > :where(.svelte-1yaifwd) {position:absolute;inset:0;pointer-events:none;}.overlay:where(.svelte-1yaifwd) {display:flex;justify-content:center;align-items:center;z-index:-1;backdrop-filter:blur(32px) brightness(0.8);}img:where(.svelte-1yaifwd) {width:100%;height:100%;z-index:-2;object-fit:cover;transform:scale(1.2);&.loaded {opacity:1;}}}&.cover {padding:0;& > :is(img, video) {flex:auto;}}& > :is(img, video) {flex:0;max-width:100%;max-height:100%;}&.dissolve {:is(img, video) {opacity:0;transition:opacity 250ms;}&.loaded {:is(img, video) {opacity:1;}}}}
|
||
|
||
/* prettier-ignore */.checkerboard.svelte-1yaifwd img:where(.svelte-1yaifwd) {
|
||
/* hardcoded, the same color as the checkerboard in Photoshop */background-image:linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
|
||
linear-gradient(45deg, #ccc 25%, #fff 25%, #fff 75%, #ccc 75%);background-size:8px 8px;background-position:0 0, 4px 4px;}.svelte-1yaifwd:not(.checkerboard) img:where(.svelte-1yaifwd) {
|
||
/* hardcoded, the same color as the transparent image preview in Chrome and Firefox */background-color:#e5e5e5;}:is(img, video) {object-fit:contain;&:not([src]) {visibility:hidden;}}.cover.svelte-1yaifwd :is(img, video) {object-fit:cover;aspect-ratio:1 / 1;}`};function O$(e,t){k(t,!0),q(e,mGe);let n=Y(t,`loading`,3,`lazy`),r=Y(t,`asset`,3,void 0),i=Y(t,`src`,3,void 0),a=Y(t,`variant`,3,void 0),o=Y(t,`blurBackground`,3,!1),s=Y(t,`cover`,3,!1),c=Y(t,`checkerboard`,3,!1),l=Y(t,`dissolve`,3,!0),u=Y(t,`alt`,3,``),d=Y(t,`controls`,3,!1),f=Y(t,`holdTransition`,3,!1),p=Y(t,`onError`,3,()=>void 0),m=gs(t,cGe),h=M(void 0),g=j(()=>r()??i()),_=M(void 0),v=M(void 0),y=j(()=>!!B(g)&&B(_)===B(g)),b=j(()=>!!B(g)&&B(v)===B(g)),x=M(void 0),S=j(()=>(r(),i())),C=M(void 0),w=j(()=>!!r()&&!!a()&&!d()),T=j(()=>t.kind===`image`||!!r()&&zU(r().name)||B(w)&&RU.includes(t.kind)),ee=AL(),E,te=[],ne,re=!1,ie,ae=()=>{ie?.(),ie=void 0},oe=e=>{e&&!te.includes(e)&&te.push(e)},se=e=>{let t=e?te.indexOf(e):-1;t>-1&&(te.splice(t,1),FX(e))},ce,le=e=>new Promise(t=>{ce?.(),ce=D$(e,()=>{ce=void 0,t()})}),ue=async()=>{if(!r()||!B(h))return;let e=ee.next(),t=r(),i=B(w);n()===`lazy`&&(i?await le(B(h)):await al(B(h)));let a,s=!1;try{a=i?await AX(t):await wX(t)}catch{s=!0}if(re){FX(a);return}if(!e()){i&&FX(a);return}s?N(_,t):N(S,a);let c=E,l=s?c:a;E=l,i&&oe(l),c!==l&&se(c),o()&&!B(x)&&l&&N(x,l,!0),aGe()},de=async()=>{if(!B(h)||!B(C))return;let e=B(h).getAttribute(`src`)===B(C)&&(B(T)?B(h).complete:!!B(h).readyState),t=B(g),n=B(C);if(!e){let e=await new Promise(e=>{B(h)?.addEventListener(B(T)?`load`:`loadedmetadata`,()=>e(!1),{once:!0}),B(h)?.addEventListener(`error`,()=>e(!0),{once:!0})});if(B(C)!==n)return;if(e){N(_,t);return}}ae(),B(h)&&(l()&&await al(B(h)),N(v,t))};R(()=>{o()&&r()&&!B(x)&&(async()=>{let e=await AX(r(),{cacheOnly:!0});re?FX(e):e&&(N(x,e,!0),oe(e))})()}),R(()=>{o()&&!r()&&t.kind===`image`&&B(S)&&N(x,B(S),!0)}),R(()=>{ne=r()}),R(()=>{if(f()&&B(g)){ae();let{promise:e,resolve:t}=Promise.withResolvers();ie=t,JWe(e)}}),R(()=>{B(y)&&(ae(),co(()=>p()()))}),R(()=>{B(h)&&r()&&ue()}),XO(()=>{if(r()||!B(S)||!B(h)||n()!==`lazy`){N(C,B(S),!0);return}N(C,void 0);let e=B(S),t=B(h);return(async()=>(await al(t),e))()},e=>{N(C,e,!0)}),R(()=>{B(h)&&B(C)&&de()}),vs(()=>()=>{re=!0,ae(),ne&&IX(ne),te.splice(0).forEach(e=>{FX(e)}),B(h)&&il(B(h)),ce?.()});var fe=pGe();let pe;var me=P(fe),he=e=>{Lc(e,{name:`draft`})},ge=e=>{var t=lGe();us(t,()=>({loading:n(),src:B(C),alt:u(),...m}),void 0,void 0,void 0,`svelte-1yaifwd`),ms(t,e=>N(h,e),()=>B(h)),xte(t),W(e,t)},_e=e=>{var t=uGe();us(t,()=>({src:B(C),controls:d()||void 0,playsinline:!0,...m}),void 0,void 0,void 0,`svelte-1yaifwd`),ms(t,e=>N(h,e),()=>B(h)),W(e,t)},ve=e=>{var t=U(),n=F(t),r=e=>{var t=dGe();us(t,()=>({src:B(C),controls:!0,playsinline:!0,...m}),void 0,void 0,void 0,`svelte-1yaifwd`),ms(t,e=>N(h,e),()=>B(h)),W(e,t)},i=e=>{Lc(e,{name:`audio_file`})};K(n,e=>{d()?e(r):e(i,-1)}),W(e,t)},ye=e=>{Lc(e,{name:`draft`})};K(me,e=>{B(y)?e(he):B(T)?e(ge,1):t.kind===`video`?e(_e,2):t.kind===`audio`?e(ve,3):e(ye,-1)});var be=L(me,2),xe=e=>{var t=fGe(),n=P(t),r=P(n),i=e=>{var t=H();z(e=>G(t,e),[()=>X(`loading`)]),W(e,t)};K(r,e=>{!B(w)&&!B(b)&&e(i)}),O(n);var a=L(n,2);let o;O(t),z(()=>{J(a,`src`,B(x)),o=rs(a,1,`svelte-1yaifwd`,null,o,{loaded:!!B(x)})}),W(e,t)};K(be,e=>{o()&&e(xe)}),O(fe),z(()=>pe=rs(fe,1,`preview ${a()??``}`,`svelte-1yaifwd`,pe,{cover:s(),checkerboard:c(),dissolve:l(),loaded:B(b)})),W(e,fe),A()}var hGe=({serviceId:e,compatibleAPI:t,authType:n})=>{let r=X(`cloud_storage.auth.${n}.key_label`),i=t?X(`cloud_storage.${t}.auth_key_label`,{default:r}):r;return X(`cloud_storage.${e}.auth_key_label`,{default:i})},k$=(e,{service:t,developerURL:n,apiKeyURL:r})=>_t(X(e,{values:{service:t,homeHref:`href="${n}"`,apiKeyHref:`href="${r}"`}}).replace(/[\u2068\u2069]/g,``),Qk),A$=(e,t)=>{CW.apiKeys??={},CW.apiKeys[e]=t},j$=(e,t,n)=>{let r=t.trim();if(n?.test(r))return A$(e,r),r},gGe=V(`<p role="alert" class="error svelte-6ieow"> </p>`),_Ge=V(`<div role="none" class="input-outer svelte-6ieow"><!></div>`),vGe=V(`<div role="none" class="input-outer svelte-6ieow"><!></div> <div role="none" class="input-outer svelte-6ieow"><!></div> <div role="none" class="input-outer svelte-6ieow"><!></div>`,1),yGe=V(`<!> <p role="alert" class="svelte-6ieow"><!> <!></p> <!> <!>`,1),bGe={hash:`svelte-6ieow`,code:`p.svelte-6ieow {margin:0 0 8px;&.error {color:var(--sui-error-foreground-color);}}.input-outer.svelte-6ieow {width:400px;max-width:100%;text-align:center;}`};function M$(e,t){k(t,!0),q(e,bGe);let n=Y(t,`error`,3,void 0),r=Y(t,`onAuth`,3,void 0),i=j(()=>Nr(t.serviceProps.serviceType,`stock_assets`)),a=j(()=>Nr(t.serviceProps.serviceId,``)),o=j(()=>Nr(t.serviceProps.serviceLabel,``)),s=j(()=>Nr(t.serviceProps.authType,`api_key`)),c=j(()=>t.serviceProps.compatibleAPI),l=j(()=>Nr(t.serviceProps.developerURL,``)),u=j(()=>Nr(t.serviceProps.apiKeyURL,``)),d=j(()=>t.serviceProps.apiKeyPattern),f=j(()=>t.serviceProps.signIn),p=j(()=>B(i)===`stock_assets`),m=na({userName:``,password:``}),h=M(`initial`);DO(e,{children:(e,t)=>{var g=yGe(),_=F(g),v=e=>{var t=gGe(),r=I(t,!0);z(()=>G(r,n())),W(e,t)};K(_,e=>{n()&&e(v)});var y=L(_,2),b=P(y),x=e=>{var t=U();Ho(F(t),()=>k$(`prefs.media.stock_photos.description`,{service:B(o),developerURL:B(l),apiKeyURL:B(u)})),W(e,t)};K(b,e=>{B(p)&&e(x)});var S=L(b,2),C=e=>{var t=U();Ho(F(t),()=>_t(X(`cloud_storage.${B(a)}.auth.${B(h)}`,{default:X(`cloud_storage.auth.${B(s)}.${B(h)}`,{values:{service:B(o),key:hGe({serviceId:B(a),compatibleAPI:B(c),authType:B(s)})}})}),Qk)),W(e,t)};K(S,e=>{B(i)===`cloud_storage`&&e(C)}),O(y);var w=L(y,2),T=e=>{var t=_Ge(),n=P(t);{let e=j(()=>X(`prefs.media.stock_photos.field_label`,{values:{service:B(o)}}));Gl(n,{dir:`ltr`,flex:!0,monospace:!0,spellcheck:`false`,get ariaLabel(){return B(e)},oninput:e=>{let{value:t}=e.target;j$(B(a),t,B(d))!==void 0&&r()?.()}})}O(t),W(e,t)};K(w,e=>{B(s)===`api_key`&&e(T)});var ee=L(w,2),E=e=>{var t=vGe(),n=F(t),i=P(n);{let e=j(()=>X(`username`)),t=j(()=>B(h)===`requested`);Gl(i,{dir:`ltr`,flex:!0,spellcheck:`false`,get ariaLabel(){return B(e)},get disabled(){return B(t)},get value(){return m.userName},set value(e){m.userName=e}})}O(n);var o=L(n,2),s=P(o);{let e=j(()=>X(`password`)),t=j(()=>B(h)===`requested`);Oxe(s,{get ariaLabel(){return B(e)},get disabled(){return B(t)},get value(){return m.password},set value(e){m.password=e}})}O(o);var c=L(o,2),l=P(c);{let e=j(()=>X(`sign_in`)),t=j(()=>!m.userName||!m.password||B(h)===`requested`);ll(l,{variant:`secondary`,get label(){return B(e)},get disabled(){return B(t)},onclick:async()=>{N(h,`requested`),m.userName=m.userName.trim(),m.password=m.password.trim(),await B(f)?.(m.userName,m.password)?(N(h,`success`),CW.logins??={},CW.logins[B(a)]=[m.userName,m.password].join(` `),r()?.()):N(h,`error`)}})}O(c),W(e,t)};K(ee,e=>{B(s)===`password`&&e(E)}),W(e,g)},$$slots:{default:!0}}),A()}var xGe=new Set([`$$slots`,`$$events`,`$$legacy`]);function N$(e,t){let n=gs(t,xGe);O$(e,_s({kind:`image`},()=>n))}function P$(e,t){k(t,!0);let n=Y(t,`variant`,3,void 0),r=Y(t,`size`,3,`small`),i=Y(t,`disabled`,3,!1),a=Y(t,`hidden`,3,!1),o=Y(t,`onclick`,3,void 0);{let t=e=>{Lc(e,{name:`close`})},s=j(()=>X(`remove`));ll(e,{get variant(){return n()},get size(){return r()},iconic:!0,get disabled(){return i()},get hidden(){return a()},get"aria-label"(){return B(s)},get onclick(){return o()},startIcon:t,$$slots:{startIcon:!0}})}A()}var SGe=new Map,F$=e=>{let t=Fc.current,n=mA(SGe,t,()=>new Intl.NumberFormat(t,{maximumFractionDigits:1})),r=1e3,i=r*1e3,a=i*1e3,o=a*1e3;return e<r?X(`file_size_units.b`,{values:{size:n.format(e)}}):e<i?X(`file_size_units.kb`,{values:{size:n.format(e/r)}}):e<a?X(`file_size_units.mb`,{values:{size:n.format(e/i)}}):e<o?X(`file_size_units.gb`,{values:{size:n.format(e/a)}}):X(`file_size_units.tb`,{values:{size:n.format(e/o)}})},I$=(e,{fallback:t}={})=>{let n=bk(e).extension?.toLowerCase()??``;return X(`file_type_labels.${n}`,{default:t??n.toUpperCase()})},CGe=V(`<span role="none" class="image svelte-lbhi1w"><!></span>`),wGe=V(`<bdi> </bdi> · <bdi> </bdi>`,1),TGe=V(`<div role="listitem" class="file svelte-lbhi1w"><!> <div role="none" class="info svelte-lbhi1w"><div role="none" class="name"><!></div> <div role="none" class="meta svelte-lbhi1w"><!> <!></div></div> <!></div>`),EGe=V(`<div role="list" class="files svelte-lbhi1w"></div>`),DGe={hash:`svelte-lbhi1w`,code:`.files.svelte-lbhi1w {display:flex;flex-direction:column;gap:16px;margin:0 8px;}.file.svelte-lbhi1w {display:flex;align-items:center;gap:16px;overflow:hidden;.preview {flex:none;}.image:where(.svelte-lbhi1w) {flex:none;display:flex;justify-content:center;align-items:center;width:40px;height:40px;aspect-ratio:1 / 1;object-fit:cover;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-tertiary-background-color);}.info:where(.svelte-lbhi1w) {flex:auto;display:flex;flex-direction:column;gap:4px;overflow:hidden;text-align:start;.meta:where(.svelte-lbhi1w) {font-size:var(--sui-font-size-small);color:var(--sui-secondary-foreground-color);}}}`};function L$(e,t){k(t,!0),q(e,DGe);let n=Y(t,`files`,31,()=>na([])),r=Y(t,`transformedFileMap`,3,void 0),i=Y(t,`removable`,3,!0),a=Y(t,`showThumbnail`,3,!0),o=new Map,s=e=>{let t=o.get(e);return t===void 0&&(t=URL.createObjectURL(e),o.set(e,t)),t};R(()=>{let e=new Set(n());o.forEach((t,n)=>{e.has(n)||(URL.revokeObjectURL(t),o.delete(n))})}),ys(()=>{o.forEach(e=>URL.revokeObjectURL(e)),o.clear()});var c=EGe();Ro(c,23,n,(e,t)=>`${e.name}-${t}`,(e,t,o)=>{var c=U();Mo(F(c),Zc,null,e=>{let c=j(()=>B(t)),l=j(()=>r()?.get(B(t)));var u=TGe(),d=P(u),f=e=>{{let n=j(()=>s(B(t)));N$(e,{get src(){return B(n)},variant:`icon`,checkerboard:!0})}},p=j(()=>a()&&hV.includes(B(c).type)),m=e=>{var t=CGe();Lc(P(t),{name:`draft`}),O(t),W(e,t)};K(d,e=>{B(p)?e(f):e(m,-1)});var h=L(d,2),g=P(h);Xc(P(g),{children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>B(c).name.normalize()]),W(e,n)},$$slots:{default:!0}}),O(g);var _=L(g,2),v=P(_);No(v,()=>Fc.current,e=>{var t=wGe(),n=F(t),r=I(n,!0),i=I(L(n,2),!0);z((e,t)=>{G(r,e),G(i,t)},[()=>I$(B(c).name),()=>F$(B(c).size)]),W(e,t)});var y=L(v,2),b=e=>{var t=H();z(e=>G(t,e),[()=>X(`file_meta_converted_from_x`,{values:{type:I$(B(l).name)}})]),W(e,t)};K(y,e=>{B(l)&&B(l).type!==B(t).type&&e(b)}),O(_),O(h);var x=L(h,2);{let e=j(()=>!i()||n().length===1);P$(x,{variant:`ghost`,size:`medium`,get hidden(){return B(e)},onclick:e=>{e.stopPropagation(),n(n().toSpliced(B(o),1))}})}O(u),W(e,u)}),W(e,c)}),O(c),W(e,c),A()}var OGe=V(`<div role="alert"><!></div>`),kGe=V(`<div role="none"><!></div> <div role="none"><!></div> <!>`,1),AGe=V(`<div role="none" class="content svelte-1hhq62q"><!> <!></div>`),jGe=V(`<div role="none" class="drop-indicator svelte-1hhq62q"><div role="none" class="svelte-1hhq62q"><!> <span role="none"> </span></div></div>`),MGe=V(`<div role="none" class="drop-target svelte-1hhq62q"><!> <!></div> <!> <!>`,1),NGe={hash:`svelte-1hhq62q`,code:`.drop-target.svelte-1hhq62q {display:flex;flex-direction:column;position:relative;overflow:hidden;height:100%;pointer-events:auto;& > .group {overflow-y:auto;padding:16px;width:100%;height:100%;}button:not(:disabled) {pointer-events:auto;}}.drop-indicator.svelte-1hhq62q {position:absolute;inset:0;z-index:10;border-radius:var(--sui-control-large-border-radius);background-color:hsl(var(--sui-background-color-4-hsl) / 80%);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);text-align:center;pointer-events:none;div:where(.svelte-1hhq62q) {position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;border:4px dashed var(--sui-primary-accent-color);border-radius:var(--sui-control-large-border-radius);font-size:var(--sui-font-size-x-large);.icon {color:var(--sui-secondary-foreground-color);font-size:48px;}}}.content.svelte-1hhq62q {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;overflow:auto;height:100%;min-height:320px;text-align:center;}`};function R$(e,t){k(t,!0),q(e,NGe);let n=e=>{var t=U(),n=F(t),i=e=>{var t=H();z(e=>G(t,e),[()=>X(`dropped_image_type_mismatch`,{values:{types:x(B(v))}})]),W(e,t)},a=e=>{var t=H();z(e=>G(t,e),[()=>X(`dropped_file_type_mismatch`,{values:{types:x(r().split(/,\s*/))}})]),W(e,t)};K(n,e=>{B(v)?e(i):e(a,-1)}),W(e,t)},r=Y(t,`accept`,3,void 0),i=Y(t,`disabled`,3,!1),a=Y(t,`multiple`,3,!1),o=Y(t,`showUploadButton`,3,!1),s=Y(t,`showFilePreview`,3,!1),c=Y(t,`filterDroppedFiles`,3,!0),l=Y(t,`onDrop`,3,void 0),u=Y(t,`children`,3,void 0),d=M(void 0),f=M(!1),p=M(!1),m=M(!1),h=M(void 0),g=M(na([])),_=j(()=>o()||s()&&B(g).length),v=j(()=>_V(r())),y=()=>{B(h)?.open()},b=()=>{B(g).length&&(N(g,[],!0),l()?.({files:B(g)}))},x=e=>AA(Fc.current,{type:`disjunction`}).format(e),S=e=>{N(g,a()?e:e.slice(0,1),!0),l()?.({files:B(g)})},C=e=>{l()?.({files:e.detail.files})};vs(()=>(B(d)?.addEventListener(`Select`,C),()=>{B(d)?.removeEventListener(`Select`,C)})),R(()=>{!B(_)&&B(p)&&N(m,!0)});var w={openFilePicker:y,reset:b},T=MGe(),ee=F(T),E=P(ee),te=e=>{var t=AGe(),r=P(t),c=e=>{var t=kGe(),r=F(t),o=P(r),s=e=>{var t=H();z(e=>G(t,e),[()=>X(`drop_files_or_click_to_browse`,{values:{count:a()?2:1}})]),W(e,t)},c=e=>{var t=H();z(e=>G(t,e),[()=>X(`tap_to_browse`)]),W(e,t)};K(o,e=>{sW.hasMouse?e(s):e(c,-1)}),O(r);var l=L(r,2),u=P(l);{let e=e=>{Lc(e,{name:`cloud_upload`})},t=j(()=>X(`choose_files`,{values:{count:a()?2:1}}));ll(u,{variant:`primary`,get label(){return B(t)},get disabled(){return i()},onclick:()=>{y()},startIcon:e,$$slots:{startIcon:!0}})}O(l);var d=L(l,2),f=e=>{var t=OGe(),r=P(t);n(r),O(t),W(e,t)};K(d,e=>{B(p)&&e(f)}),W(e,t)};K(r,e=>{o()&&e(c)});var l=L(r,2),u=e=>{L$(e,{get files(){return B(g)},set files(e){N(g,e,!0)}})};K(l,e=>{s()&&B(g).length&&e(u)}),O(t),W(e,t)},ne=e=>{var t=U();Uo(F(t),()=>u()??jr),W(e,t)};K(E,e=>{B(_)?e(te):e(ne,-1)});var re=L(E,2),ie=e=>{var t=jGe(),n=P(t),r=P(n);Lc(r,{name:`download`});var i=I(L(r,2),!0);O(n),O(t),z(e=>G(i,e),[()=>X(`drop_files_here`,{values:{count:a()?2:1}})]),W(e,t)};K(re,e=>{B(f)&&e(ie)}),O(ee),ms(ee,e=>N(d,e),()=>B(d));var ae=L(ee,2);ms(Jl(ae,{get accept(){return r()},get multiple(){return a()},onSelect:({files:e})=>{S(e)}}),e=>N(h,e,!0),()=>B(h));var oe=L(ae,2),se=e=>{{let t=j(()=>X(`unsupported_file_type`));Fl(e,{get title(){return B(t)},get open(){return B(m)},set open(e){N(m,e,!0)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}};return K(oe,e=>{B(_)||e(se)}),go(`dragover`,ee,e=>{e.preventDefault(),!i()&&e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`,N(f,!0),N(p,!1))}),go(`dragleave`,ee,e=>{e.preventDefault(),i()||N(f,!1)}),go(`dragend`,ee,e=>{e.preventDefault(),i()||N(f,!1)}),go(`drop`,ee,async e=>{if(e.preventDefault(),i()||!e.dataTransfer)return;N(f,!1);let t=Array.from(e.dataTransfer.items).some(({kind:e})=>e===`file`),n=await _Se(e.dataTransfer,{accept:c()?r():void 0});n.length?S(n):c()&&r()&&t&&N(p,!0)}),W(e,T),A(w)}var z$=(e,t=jr)=>{var n=FGe();Ro(n,23,t,(e,t)=>`${e}-${t}`,(e,t)=>{var n=PGe(),r=I(n,!0);z(()=>G(r,B(t))),W(e,n)}),O(n),W(e,n)},PGe=V(`<li class="svelte-1luofoe"> </li>`),FGe=V(`<ul class="filenames svelte-1luofoe"></ul>`),B$=V(`<div class="svelte-1luofoe"> </div> <!>`,1),IGe=V(`<div class="svelte-1luofoe"><!></div> <!>`,1),LGe=V(`<!> <!> <!>`,1),RGe={hash:`svelte-1luofoe`,code:`div.svelte-1luofoe:not(:first-child) {margin-top:8px;}.filenames.svelte-1luofoe {border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);}ul.svelte-1luofoe {margin:8px 0 0;padding:0;list-style:none;}li.svelte-1luofoe {margin:0;padding:0;}`};function V$(e,t){k(t,!0),q(e,RGe);let n=Y(t,`accept`,3,void 0),r=M(!1),i=M([]),a=M([]),o=M([]),s=e=>{let{mismatchedFileNames:t=[]}=e;(e.oversizedFileNames.length||e.invalidFileNames.length||t.length)&&(N(i,e.oversizedFileNames),N(a,e.invalidFileNames),N(o,t),N(r,!0))},c=j(()=>[B(i),B(a),B(o)].filter(e=>e.length).length>1?X(`assets_dialog.rejected_files.title`):B(o).length?X(`unsupported_file_type`):B(a).length?X(`assets_dialog.invalid_file.title`):X(`assets_dialog.large_file.title`)),l=j(()=>_V(n())),u=e=>AA(Fc.current,{type:`disjunction`}).format(e);var d={report:s};return Fl(e,{get title(){return B(c)},get open(){return B(r)},set open(e){N(r,e,!0)},children:(e,r)=>{var s=LGe(),c=F(s),d=e=>{var n=B$(),r=F(n),a=I(r,!0);z$(L(r,2),()=>B(i)),z(e=>G(a,e),[()=>X(`warning_oversized_files`,{values:{count:B(i).length,size:F$(t.maxSize)}})]),W(e,n)};K(c,e=>{B(i).length&&e(d)});var f=L(c,2),p=e=>{var t=B$(),n=F(t),r=I(n,!0);z$(L(n,2),()=>B(a)),z(e=>G(r,e),[()=>X(`warning_invalid_files`,{values:{count:B(a).length}})]),W(e,t)};K(f,e=>{B(a).length&&e(p)});var m=L(f,2),h=e=>{var t=IGe(),r=F(t),i=P(r),a=e=>{var t=H();z(e=>G(t,e),[()=>X(`warning_unsupported_image_files`,{values:{count:B(o).length,types:u(B(l))}})]),W(e,t)},s=e=>{var t=H();z(e=>G(t,e),[()=>X(`warning_unsupported_files`,{values:{count:B(o).length,types:u(n().split(/,\s*/))}})]),W(e,t)};K(i,e=>{B(l)?e(a):e(s,-1)}),O(r),z$(L(r,2),()=>B(o)),W(e,t)};K(m,e=>{B(o).length&&e(h)}),W(e,s)},$$slots:{default:!0}}),A(d)}var H$=e=>{try{let{language:t,script:n}=new Intl.Locale(e).maximize();return`${t}-${n}`}catch{return}},U$=(e,t)=>{let n=Fc.current.toLowerCase(),[r]=n.split(`-`),i=H$(n);return e.find(e=>e.toLowerCase()===n)??(i?e.find(e=>H$(e)===i):void 0)??e.find(e=>e.split(`-`)[0]===r)??t},W$=async(e,t)=>{let n=t?await fetch(e,t):await fetch(e);if(!n.ok)throw Error(`Failed to fetch ${e}: ${n.status}`);return n.json()},G$=async({maxPages:e,fetchPage:t,parsePage:n})=>GX(async e=>{let r=e??1,{results:i,hasMore:a}=n(await t(r),r);return{results:i,next:a?r+1:void 0}},{maxPages:e}),zGe=`en-US,pt-BR,es-ES,ca-ES,de-DE,it-IT,fr-FR,sv-SE,id-ID,pl-PL,ja-JP,zh-TW,zh-CN,ko-KR,th-TH,nl-NL,hu-HU,vi-VN,cs-CZ,da-DK,fi-FI,uk-UA,el-GR,ro-RO,nb-NO,sk-SK,tr-TR,ru-RU`.split(`,`),K$=`https://api.pexels.com/v1`,q$={per_page:80},BGe=/\/photo\/(?<alt>.+?)-\d+\/$/,VGe=()=>U$(zGe,`en-US`),J$=e=>e.map(({id:e,url:t,alt:n,src:{large2x:r,medium:i},photographer:a})=>({id:String(e),description:t.match(BGe)?.groups?.alt.replace(/-/g,` `)??n,previewURL:i,downloadURL:r,fileName:`pexels-${a.split(/\s+/).join(`-`).toLowerCase()}-${e}.jpg`,kind:`image`,credit:`<a href="${Xk(t)}">Photo by ${Zk(a)} on Pexels</a>`})),HGe={serviceType:`stock_assets`,serviceId:`pexels`,serviceLabel:`Pexels`,serviceURL:`https://www.pexels.com/`,showServiceLink:!0,hotlinking:!1,authType:`api_key`,developerURL:`https://www.pexels.com/api/`,apiKeyURL:`https://www.pexels.com/api/new/`,apiKeyPattern:/^[a-zA-Z\d]{56}$/,list:async({apiKey:e})=>{let t={Authorization:e},n=(await W$(`${K$}/curated?${new URLSearchParams(q$)}`,{headers:t})).photos;return J$(n)},search:async(e,{apiKey:t})=>{let n={Authorization:t},r=new URLSearchParams({...q$,query:e,locale:VGe()});return J$(await G$({maxPages:2,fetchPage:e=>(r.set(`page`,String(e)),W$(`${K$}/search?${r}`,{headers:n})),parsePage:({photos:e,next_page:t})=>({results:e,hasMore:!!t})}))}},UGe=`https://picsum.photos/v2/list`,WGe=100,GGe=10,KGe=3,qGe=e=>e.map(({id:e,width:t,height:n})=>{let r=t>=n,[i,a]=r?[1920,1280]:[1280,1920],[o,s]=r?[480,320]:[320,480];return{id:e,description:``,previewURL:`https://picsum.photos/id/${e}/${o}/${s}.webp`,downloadURL:`https://picsum.photos/id/${e}/${i}/${a}.webp`,fileName:`picsum-${e}.webp`,kind:`image`}}),JGe={serviceType:`stock_assets`,serviceId:`picsum`,serviceLabel:`Lorem Picsum`,serviceURL:`https://picsum.photos/`,showServiceLink:!0,hotlinking:!0,authType:`none`,list:async()=>{let e=Array.from({length:GGe},(e,t)=>t+1).sort(()=>Math.random()-.5).slice(0,KGe);return qGe((await Promise.all(e.map(e=>W$(`${UGe}?page=${e}&limit=${WGe}`)))).flat().sort(()=>Math.random()-.5))}},YGe=`cs,da,de,en,es,fr,id,it,hu,nl,no,pl,pt,ro,sk,fi,sv,tr,vi,th,bg,ru,el,ja,ko,zh`.split(`,`),Y$=`https://pixabay.com/api`,X$={image_type:`photo`,min_width:1280,safesearch:!0,per_page:150},Z$=e=>e.map(({id:e,webformatURL:t,previewURL:n,largeImageURL:r,imageWidth:i,imageHeight:a,pageURL:o,tags:s,user:c})=>({id:String(e),description:s,previewURL:t.replace(`_640.`,i>a?`_180.`:`_340.`),downloadURL:r,fileName:n.split(`/`).pop().replace(`_150.`,`_1280.`),kind:`image`,credit:`<a href="${Xk(o)}">Photo by ${Zk(c)} on Pixabay</a>`})),Q$=()=>U$(YGe,`en`),XGe={serviceType:`stock_assets`,serviceId:`pixabay`,serviceLabel:`Pixabay`,serviceURL:`https://pixabay.com/`,showServiceLink:!0,hotlinking:!1,authType:`api_key`,developerURL:`https://pixabay.com/service/about/api/`,apiKeyURL:`https://pixabay.com/api/docs/#api_key`,apiKeyPattern:/^\d+-[a-f\d]{25}$/,list:async({apiKey:e})=>{let t=(await W$(`${Y$}/?${new URLSearchParams({...X$,key:e,lang:Q$(),editors_choice:`true`})}`)).hits;return Z$(t)},search:async(e,{apiKey:t})=>{let n=(await W$(`${Y$}/?${new URLSearchParams({...X$,key:t,lang:Q$(),q:e})}`)).hits;return Z$(n)}},ZGe=`af,sq,am,ar,hy,as,az,bn,ba,eu,bs,bg,yue,ca,lzh,zh-Hans,zh-Hant,hr,cs,da,prs,dv,nl,en,et,fo,fj,fil,fi,fr,fr-ca,gl,ka,de,el,gu,ht,he,hi,mww,hu,is,id,ikt,iu,iu-Latn,ga,it,ja,kn,kk,km,ko,ku,kmr,ky,lo,lv,lt,mk,mg,ms,ml,mt,mi,mr,mn-Cyrl,mn-Mong,my,ne,nb,or,ps,fa,pl,pt,pt-pt,pa,otq,ro,ru,sm,sr-Cyrl,sr-Latn,sk,sl,so,es,sw,sv,ty,ta,tt,te,th,bo,ti,to,tr,tk,uk,hsb,ur,ug,uz,vi,cy,yua,zu`.split(`,`),$$=`https://api.unsplash.com`,e1=`utm_source=sveltia-cms&utm_medium=referral`,t1={per_page:30},QGe=()=>U$(ZGe,`en`),n1=e=>e.map(({id:e,description:t,alt_description:n,urls:{regular:r,thumb:i},user:{username:a,name:o},links:s})=>({id:String(e),description:[t,n].filter(Boolean).join(` — `),previewURL:i,downloadURL:r,fileName:`${o.split(/\s+/).join(`-`).toLowerCase()}-${e}-unsplash.jpg`,kind:`image`,credit:`Photo by <a href="https://unsplash.com/@${Xk(a)}?${e1}">${Zk(o)}</a> on <a href="https://unsplash.com/?${e1}">Unsplash</a>`,downloadTrackingURL:s?.download_location})),r1={pexels:HGe,picsum:JGe,pixabay:XGe,unsplash:{serviceType:`stock_assets`,serviceId:`unsplash`,serviceLabel:`Unsplash`,serviceURL:`https://unsplash.com/`,showServiceLink:!0,hotlinking:!0,authType:`api_key`,developerURL:`https://unsplash.com/developers`,apiKeyURL:`https://unsplash.com/oauth/applications`,apiKeyPattern:/^[a-zA-Z\d_-]{40,}$/,list:async({apiKey:e})=>{let t={Authorization:`Client-ID ${e}`};return n1(await W$(`${$$}/photos?${new URLSearchParams(t1)}`,{headers:t}))},search:async(e,{apiKey:t})=>{let n={Authorization:`Client-ID ${t}`},r=new URLSearchParams({...t1,query:e,lang:QGe()});return n1(await G$({maxPages:5,fetchPage:e=>(r.set(`page`,String(e)),W$(`${$$}/search/photos?${r}`,{headers:n})),parsePage:({results:e,total_pages:t},n)=>({results:e,hasMore:n<t})}))},trackDownload:async({downloadTrackingURL:e},{apiKey:t})=>{if(e)try{await W$(e,{headers:{Authorization:`Client-ID ${t}`}})}catch(e){console.error(e)}}}},i1=({fieldConfig:e}={})=>{let t=uV({libraryName:`stock_assets`,fieldConfig:e});if(t===!1)return{providers:[]};let n=Object.keys(r1),{providers:r}=t;return{providers:Array.isArray(r)?r:n}},a1=(e,t)=>{let n=e[1].serviceLabel.toLowerCase(),r=t[1].serviceLabel.toLowerCase();return n.localeCompare(r)},o1=({folder:e,enabled:t},n)=>t&&(!n||WV(e)),$Ge=({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n})=>{if(!t)return;let r=Object.entries(e).find(([,e])=>o1(e,n))?.[0];return r?`default-${r}`:void 0},eKe=({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n,hasPendingFiles:r,cloudServiceEntries:i,externalServiceEntries:a})=>{let o=$Ge({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n});if(o)return o;let[s]=(r?i[0]:void 0)??a[0]??[``];return s},tKe=({fieldConfig:e,selectFolder:t,isDefaultLibraryEnabled:n})=>{if(t)return[];let{providers:r=[]}=i1({fieldConfig:e});return Object.entries(r1).filter(([e,{hotlinking:t}])=>r.includes(e)&&(t||n)).sort(a1)},nKe=({selectFolder:e,browsingSubfolders:t,folder:n,basePath:r,subfolderPath:i,selectedSubfolderPaths:a})=>{if(!e||!t)return[];let o=a.length?a.map(e=>GV(e,r)):[i],s=n;return o.map(e=>qHe({folder:s,subfolderPath:e}))},rKe=({path:e},t)=>t===void 0?``:mP(GV(e,t)),iKe=({resources:e,targetFolderPath:t})=>e.map(e=>{let{asset:n,replace:r}=e;return n?.unsaved?{file:n.file,folder:ai(n.folder),subfolderPath:rKe(n,t),replace:r}:ai(e)}),s1=({resources:e,resource:t,isSame:n,multiple:r=!1})=>r?[...e.filter(e=>!n(e)),t]:[t],c1=({libraryName:e,enteredURL:t})=>{let n=e===`enter-url`?t.trim():``;return n?[{url:n}]:[]},aKe=({trackDownload:e,resources:t,assets:n,options:r})=>{e&&t.forEach(({url:t})=>{let i=t?n.get(t):void 0;i&&e(i,r).catch(()=>{})})},l1={saved:!1,moved:!1,renamed:!1,deleted:!1,folderCreated:!1,folderRenamed:!1,folderDeleted:!1,deletionPending:!1,discarded:!1,deletionCancelled:!1,alreadyPublished:!1,published:!1,count:1},u1=GO({...l1}),d1=GO({...l1}),f1=e=>{[XB,ZB].forEach(t=>{let n=t.current?e(t.current):void 0;n!==void 0&&(t.current=XY(n))})},p1=(e,{slugificationEnabled:t=!1}={})=>({template:e,slugificationEnabled:t,randomValues:new Map,dateTimeParts:JL({timeZone:rN()})}),m1=({nameTemplate:{template:e,randomValues:t,dateTimeParts:n},originalName:r,collection:i,collectionFileName:a,content:o={},slug:s,isIndexFile:c=!1})=>{let{extension:l}=bk(r),u={replaceSubContext:{collection:i,content:o,currentSlug:s,dateTimeParts:n,randomValues:t,assetFileName:r,identifierField:GL(i?._type===`entry`?i:void 0),basePath:void 0},getFieldArgs:{collectionName:i?.name??``,fileName:a,keyPath:``,valueMap:o,isIndexFile:c}},d=NM(e,(e,t)=>gH(t,u)).trim();return l?`${d}.${l}`:d},h1=({draft:e,item:{file:t,nameTemplate:n},defaultLocaleSlug:r})=>{if(!n)return t.name;let{collection:i,fileName:a,defaultLocale:o,currentValues:s,isIndexFile:c}=e;return UX(m1({nameTemplate:n,originalName:t.name,collection:i,collectionFileName:a,content:s[o],slug:r,isIndexFile:c}),{slugificationEnabled:n.slugificationEnabled})},oKe=async(e,{convertHEIC:t=!1}={})=>{if(!fV.includes(e.type))return!0;if(await CV(e)===`heic`)return t;try{return(await createImageBitmap(e)).close(),!0}catch{return!1}},sKe=async(e,t)=>{if(!fV.includes(e.type))return!0;if(await CV(e)!==`heic`)try{if(await HHe(await bP(e)))return!0}catch{}return oKe(e,{convertHEIC:t})},g1=async(e,{slugify_filename:t=!1,transformations:n,max_file_size:r=1/0}={},{nameTemplate:i}={})=>{let a=await sKe(e,LV(n));if(i||t){let{name:n,type:r,lastModified:a}=e,o=i?m1({nameTemplate:p1(i),originalName:n}):n;o=UX(o,{slugificationEnabled:t}),e=new File([e],o,{type:r,lastModified:a})}if(!a)return{file:e,originalFile:void 0,oversized:!1,invalid:!0};let o=e;if(n)try{e=await vNe(e,n)}catch{return{file:e,originalFile:void 0,oversized:!1,invalid:!0}}return{file:e,originalFile:e===o?void 0:o,oversized:e.size>r,invalid:!1}},_1=e=>({validFiles:e.filter(({oversized:e,invalid:t})=>!e&&!t).map(({file:e})=>e),oversizedFiles:e.filter(({oversized:e,invalid:t})=>e&&!t).map(({file:e})=>e),invalidFiles:e.filter(({invalid:e})=>e).map(({file:e})=>e)}),cKe=jL(4),v1=()=>({processing:!1,validFiles:[],oversizedFiles:[],invalidFiles:[],transformedFileMap:new WeakMap}),y1=WO(v1());JO(()=>{let e=!1,t=QB.current.files,{config:n}=FV();return y1.current=v1(),(async()=>{t.length&&n.transformations&&(y1.current={...v1(),processing:!0});let r=QB.current.originalAssets?.length?void 0:n.filename_template,i=await Promise.all(t.map(t=>cKe(async()=>e?void 0:g1(t,n,{nameTemplate:r}))));if(e)return;let a=i;y1.current={processing:!1,..._1(a),transformedFileMap:new WeakMap(a.filter(({originalFile:e})=>e!==void 0).map(({file:e,originalFile:t})=>[e,t]))}})(),()=>{e=!0}});var b1=GO({show:!1,status:`info`,message:``}),x1=WO({files:[]}),S1=e=>({...$O.current?.media_libraries?.all,...e?.media_libraries?.all}),C1=(e,t)=>{b1.current={show:!0,status:`error`,message:e},console.error(t)},w1=(e,t=1)=>{b1.current.show=!1,d1.current={...l1,[e]:!0,count:t}},T1=e=>{let t=vQ.current;yQ.current=e,e&&t&&(DQ.current={...DQ.current,[t.serviceId]:e.length})},E1=e=>{let t=new Set(e.map(({id:e})=>e));T1(yQ.current?.filter(({id:e})=>!t.has(e))),MQ(e=>!t.has(e))},D1=(e,t)=>{let n=n=>n.id===e.id?t:n;T1(yQ.current?.map(n)),AQ.current=AQ.current.map(n),jQ.current?.id===e.id&&(jQ.current=t)},O1=(e,t=[])=>{let n=new Set(e.map(({id:e})=>e));MQ(e=>n.has(e));let r=CQ.current?.path;r!==void 0&&!e.some(({description:e})=>e.startsWith(`${r}/`))&&!t.some(e=>e===r||e.startsWith(`${r}/`))&&(CQ.current=void 0)},k1=0,A1=async({downloadURL:e})=>{let t=await fetch(e);if(!t.ok)throw Error(`The response returned with HTTP status ${t.status}.`);return t.blob()},j1=async e=>{k1+=1;let t=k1;T1(void 0),OQ.current=void 0,kQ.current=!1;try{let n=IQ(e),{assets:r,folders:i,truncated:a=!1}=e.browse?await e.browse(n):{assets:await e.list?.(n)??[],folders:[]};vQ.current===e&&t===k1&&(T1(r),xQ.current=i,kQ.current=a,O1(r,i))}catch(n){vQ.current===e&&t===k1&&(T1([]),xQ.current=[],OQ.current=`search_fetch_failed`,O1([])),console.error(n)}},M1=async(e,t,{replacing:n=!1}={})=>{let r=n?void 0:PV(t.filename_template),{validFiles:i,oversizedFiles:a,invalidFiles:o}=_1(await Promise.all(e.map(e=>g1(e,t,{nameTemplate:r}))));return{validFiles:i,oversizedFileNames:a.map(({name:e})=>e),invalidFileNames:o.map(({name:e})=>e)}},lKe=async(e,{originalAsset:t}={})=>{let n=vQ.current,{validFiles:r,oversizedFileNames:i,invalidFileNames:a}=await M1(e,S1(),{replacing:!!t});if(n&&r.length){b1.current={show:!0,status:`info`,message:`uploading_files_progress`};try{let e={...IQ(n),dirPath:SQ.current};if(t)n.replace&&(D1(t,await n.replace(t,r[0],e)),w1(`saved`,1));else if(n.upload){let t=await n.upload(r,e);T1(_Q(t,yQ.current??[])),w1(`saved`,t.length)}}catch(e){C1(`uploading_files_failed`,e),await j1(n)}}return{oversizedFileNames:i,invalidFileNames:a}},N1=async e=>{let t=vQ.current;if(!t?.delete||!e.length)return!1;try{await t.delete(e,IQ(t))}catch(e){return C1(`deleting_assets_failed`,e),await j1(t),!1}return E1(e),w1(`deleted`,e.length),!0},uKe=async(e,t)=>{let n=vQ.current;if(n?.rename)try{let r=await n.rename(e,t,IQ(n));return D1(e,r),w1(`renamed`,1),r}catch(e){C1(`renaming_asset_failed`,e);return}},P1=e=>(yQ.current??[]).filter(({description:t})=>t.startsWith(`${e}/`)),dKe=e=>xQ.current.filter(t=>t===e||t.startsWith(`${e}/`)),F1=async(e,t,n)=>e.listFolder?e.listFolder(t,n):{assets:P1(t),folders:dKe(t)},fKe=async e=>{let t=vQ.current;if(!t?.createFolder)return!1;let n=pP([SQ.current,e]);try{await t.createFolder(n,IQ(t))}catch(e){return C1(`creating_folder_failed`,e),!1}return xQ.current=[...xQ.current,n],w1(`folderCreated`),!0},pKe=async({path:e},t)=>{let n=vQ.current;if(!n?.move||!n.createFolder||!n.deleteFolder)return!1;let r=[...e.split(`/`).slice(0,-1),t].join(`/`),i=t=>`${r}${t.slice(e.length)}`,a=IQ(n),o=CQ.current?.path===e;b1.current={show:!0,status:`info`,message:`renaming_folder`};try{let{assets:t,folders:r}=await F1(n,e,a);for(let e of t)await n.move(e,i(e.description),a);for(let e of r)await n.createFolder(i(e),a),await n.deleteFolder(e,a)}catch(e){return C1(`renaming_folder_failed`,e),await j1(n),!1}return await j1(n),o&&(CQ.current={name:t,path:r}),w1(`folderRenamed`),!0},mKe=async({path:e})=>{let t=vQ.current;if(!t?.delete||!t.deleteFolder)return!1;let n=IQ(t),r=[],i=[];b1.current={show:!0,status:`info`,message:`deleting_folder`};try{({assets:r,folders:i}=await F1(t,e,n)),await t.delete(r,n);for(let e of i)await t.deleteFolder(e,n)}catch(e){return C1(`deleting_folder_failed`,e),await j1(t),!1}return E1(r),xQ.current=xQ.current.filter(e=>!i.includes(e)),CQ.current?.path===e&&(CQ.current=void 0),w1(`folderDeleted`),!0},hKe=new WeakMap,I1=e=>mA(hKe,e,()=>new Map),gKe=RegExp(`([${[`Latin`,`Greek`,`Hebrew`,`Arabic`].map(e=>`\\p{Script=${e}}`).join(``)}])\\p{M}+|(\\p{Script=Cyrillic})(\\p{M}+)`,`gv`),_Ke=RegExp(`[\\p{M}--[\\u0306]]`,`gv`),vKe=(e,t,n,r)=>t??`${n}${r.replace(_Ke,``)}`,yKe=/^[\x00-\x7F]*$/,L1=e=>(e=e.trim(),e?yKe.test(e)?e.toLowerCase():e.normalize(`NFD`).replace(gKe,vKe).toLowerCase().normalize(`NFC`):``),R1=(e,t=void 0)=>{if(!t)return L1(e);let n=t.get(e);if(n!==void 0)return n;let r=L1(e);return t.set(e,r),r},z1=({value:e,terms:t,normalizedValueCache:n=void 0})=>R1(e,n).includes(t),B1=e=>[...new Set(L1(e).split(/\s+/).filter(Boolean))],V1=({value:e,tokens:t,normalizedValueCache:n=void 0})=>{let r=R1(e,n);return t.every(e=>r.includes(e))},H1={name:void 0,last_modified:`date`,size:`number`},bKe=Object.keys(H1),xKe=KO(()=>Object.entries(H1).map(([e,t])=>({key:e,label:X(`sort_keys.${e}`),type:t}))),SKe=(e,t)=>t===`last_modified`?e.lastModified?.getTime()??0:t===`size`?e.size??0:e.fileName.split(`.`)[0],CKe=(e,{key:t,order:n}={})=>!t||!n||!bKe.includes(t)?e:_R([...e],e=>SKe(e,t),t===`name`,n),wKe=(e,{field:t,pattern:n}={field:``,pattern:``})=>t===`fileType`?e.filter(({kind:e})=>e===n):e,TKe=(e,t)=>{if(t===`domain`)try{return new URL(e.downloadURL).hostname}catch{return}},EKe=(e,t)=>Fke(e,t,TKe),DKe=KO(()=>vQ.current?.serviceId===`linked`?[{label:X(`domain`),field:`domain`}]:[]),OKe=(e,t)=>{let n=L1(t);return n?e.filter(e=>{let t=I1(e);return z1({value:e.fileName,terms:n,normalizedValueCache:t})||z1({value:e.description,terms:n,normalizedValueCache:t})}):e},U1=({dirPath:e,assets:t,folders:n})=>XV({dirPath:e,paths:[...t.map(({description:e})=>e),...n.map(e=>`${e}/`)]}),W1=({dirPath:e,assets:t})=>t.filter(({description:t})=>mP(t)===e),G1=({dirPath:e,serviceLabel:t})=>e?`/${e}`:t,K1=KO(()=>bQ(vQ.current)&&!FQ.current),q1=KO(()=>K1.current?U1({dirPath:SQ.current,assets:yQ.current??[],folders:xQ.current}):[]),kKe=qO(()=>BQ.current.sort),AKe=qO(()=>BQ.current.filter),jKe=KO(()=>{let e=yQ.current??[];return K1.current&&(e=W1({dirPath:SQ.current,assets:e})),wKe(CKe(e,kKe.current),AKe.current)}),J1=KO(()=>OKe(jKe.current,FQ.current)),MKe=KO(()=>{let e=CQ.current;if(e){let{name:t,path:n}=e,r=yQ.current??[];return{name:t,path:n,folderCount:U1({dirPath:n,assets:r,folders:xQ.current}).length,assetCount:W1({dirPath:n,assets:r}).length}}let t=vQ.current;if(!t)return;let n=K1.current,r=n?SQ.current:``;return{name:r.split(`/`).at(-1)||t.serviceLabel,path:r||void 0,folderCount:n?q1.current.length:void 0,assetCount:J1.current.length}}),Y1=KO(()=>EKe(J1.current,BQ.current.group)),NKe=KO(()=>{let e=q1.current.length;return new Map(Object.values(Y1.current).flat(1).map(({id:t},n)=>[t,n+e]))});JO(()=>{let e=new Set(J1.current.map(({id:e})=>e));co(()=>MQ(t=>e.has(t)))});var X1=V(`<span role="alert"> </span>`),Z1=V(`<!> <!>`,1),PKe=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),FKe=V(`<!> <!> <div role="none" class="grid-wrapper svelte-mqll9n"><!> <!></div>`,1),IKe=V(`<!> <!> <!> <!> <!> <!>`,1),LKe={hash:`svelte-mqll9n`,code:`.grid-wrapper.svelte-mqll9n {overflow-y:auto;height:100%;}`};function RKe(e,t){k(t,!0),q(e,LKe);let n=e=>{var t=U(),n=F(t),r=e=>{oH(e,{get rootLabel(){return B(d)},get path(){return B(ae)},onNavigate:e=>{N(ae,e,!0)}})};K(n,e=>{B(he)&&e(r)}),W(e,t)},r=e=>{var t=U(),r=F(t),i=e=>{DO(e,{children:(e,t)=>{var n=X1(),r=I(n,!0);z(e=>G(r,e),[()=>X(B(me)?`searching`:`loading`)]),W(e,n)},$$slots:{default:!0}})},o=e=>{var t=Z1(),r=F(t);n(r),DO(L(r,2),{children:(e,t)=>{var n=X1(),r=I(n,!0);z(e=>G(r,e),[()=>X(`no_files_found`)]),W(e,n)},$$slots:{default:!0}}),W(e,t)},c=e=>{var t=FKe(),r=F(t);n(r);var i=L(r,2),o=e=>{var t=PKe(),n=F(t);Po(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{status:`warning`,dismissible:!1,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`external_assets_truncated`)]),W(e,n)},$$slots:{default:!0}}),O(n),W(e,t)};K(i,e=>{B(oe)&&e(o)});var c=L(i,2),l=P(c),u=e=>{fH(e,{get subfolders(){return B(_e)},get viewType(){return B(x)},onOpen:({path:e})=>{N(ae,e,!0)}})};K(l,e=>{B(_e).length&&e(u)}),cH(L(l,2),{get viewType(){return B(x)},get gridId(){return s()},get multiple(){return a()},children:(e,t)=>{gu(e,{get items(){return B(ge)},itemKey:`id`,renderItem:(e,t=jr)=>{let n=j(()=>{let{id:e,previewURL:n,description:r,kind:i}=t();return{id:e,previewURL:n,description:r,_kind:i}});{let r=j(()=>Oe(t()));sH(e,{get value(){return B(n).id},get ariaLabel(){return B(n).description},get viewType(){return B(x)},get multiple(){return a()},get selected(){return B(r)},onChange:({detail:{selected:e}})=>{Me(t(),e)},children:(e,t)=>{var r=Z1(),i=F(r);O$(i,{get kind(){return B(n)._kind},get src(){return B(n).previewURL},get alt(){return B(n).description},variant:`tile`,crossorigin:`anonymous`});var a=L(i,2),o=e=>{{let t=j(()=>B(S)?{caption:B(n).description}:{path:B(he)?GV(B(n).description,B(ae)):B(n).description});_B(e,_s(()=>B(t)))}};K(a,e=>{(B(x)===`list`||!sW.isSmallScreen&&!B(S))&&e(o)}),W(e,r)},$$slots:{default:!0}})}},$$slots:{renderItem:!0}})},$$slots:{default:!0}}),O(c),W(e,t)};K(r,e=>{B(re)?!B(ge).length&&!B(_e).length?e(o,1):e(c,-1):e(i)}),W(e,t)},i=Y(t,`fieldConfig`,3,void 0),a=Y(t,`multiple`,3,!1),o=Y(t,`searchTerms`,3,``),s=Y(t,`gridId`,3,void 0),c=Y(t,`selectedResources`,31,()=>na([])),l=j(()=>Nr(t.serviceProps.serviceType,`stock_assets`)),u=j(()=>Nr(t.serviceProps.serviceId,``)),d=j(()=>Nr(t.serviceProps.serviceLabel,``)),f=j(()=>Nr(t.serviceProps.hotlinking,!1)),p=j(()=>Nr(t.serviceProps.authType,`api_key`)),m=j(()=>t.serviceProps.init),h=j(()=>t.serviceProps.list),g=j(()=>t.serviceProps.browse),_=j(()=>t.serviceProps.search),v=j(()=>t.serviceProps.upload),y=j(()=>t.serviceProps.createFolder),b=j(()=>t.serviceProps.trackDownload),x=j(()=>B(u)===`picsum`?`grid`:s$.current?.type),S=j(()=>B(l)===`stock_assets`),C=j(()=>S1(i())),w=j(()=>B(C).max_file_size??1/0),T=M(!0),ee=M(!1),E=M(``),te=M(``),ne=M(``),re=M(null),ie=M(na([])),ae=M(``),oe=M(!1),se=M(!1),ce=M(!1),le=M(void 0),ue=M(!1),de=M(!1),fe=M(void 0),pe=j(()=>({kind:t.kind,fieldConfig:i(),apiKey:B(E),userName:B(te),password:B(ne)})),me=j(()=>B(_)?o().trim():``),he=j(()=>!!B(g)&&!B(me)),ge=j(()=>{let e=B(re)??[];return B(he)?W1({dirPath:B(ae),assets:e}):e}),_e=j(()=>B(he)?U1({dirPath:B(ae),assets:B(re)??[],folders:B(ie)}):[]),ve=j(()=>ZV({subfolders:B(_e),fileNames:B(ge).map(({fileName:e})=>e)})),ye=j(()=>G1({dirPath:B(ae),serviceLabel:B(d)})),be=AL(),xe=async e=>{let t=be.next();N(re,null),N(le,void 0),N(oe,!1);try{let n,r,i=!1;if(e?n=await B(_)(e,B(pe)):B(g)?{assets:n,folders:r,truncated:i=!1}=await B(g)(B(pe)):n=await B(h)?.(B(pe))??[],!t())return;N(re,n),N(oe,i,!0),r&&N(ie,r,!0)}catch(e){if(!t())return;N(le,`search_fetch_failed`),console.error(e)}},Se=async e=>{let{downloadURL:t,fileName:n,credit:r}=e;if(B(f))return{url:t,credit:r};try{let i=await A1(e);return{url:t,credit:r,file:new File([i],n,{type:i.type})}}catch(e){N(le,`image_fetch_failed`),console.error(e)}},Ce=async e=>{if(!B(v))return;let t=await M1(e,B(C));if(e=t.validFiles,B(fe)?.report(t),e.length){N(ue,!0),N(de,!1);try{let t=await B(v)(e,{...B(pe),dirPath:B(ae)}),n=await Promise.all(t.map(e=>Se(e)));c(n.filter(e=>!!e).slice(0,a()?void 0:1)),N(re,_Q(t,B(re)??[]))}catch(e){N(de,!0),console.error(e),xe(B(me))}finally{N(ue,!1)}}},we=()=>B(he)&&!!B(y),Te=()=>{N(se,!0)},Ee=async e=>{let t=B(ae)?`${B(ae)}/${e}`:e;try{await B(y)(t,B(pe)),N(ie,[...B(ie),t],!0)}catch(e){N(ce,!0),console.error(e)}},De=j(()=>new Set(c().map(({url:e})=>e))),Oe=e=>B(De).has(e.downloadURL),ke=new Map,Ae=new Map,je=()=>{aKe({trackDownload:B(b),resources:c(),assets:Ae,options:B(pe)})},Me=async(e,t)=>{let{downloadURL:n}=e;if(t&&!a()&&[...ke.keys()].forEach(e=>{ke.set(e,!1)}),ke.set(n,t),t){let t=await Se(e);t&&ke.get(n)&&(Ae.set(n,e),c(s1({resources:c(),resource:t,isSame:e=>e.url===n,multiple:a()})))}else c(c().filter(e=>e.url!==n))},Ne=()=>{let e=IQ(t.serviceProps);N(E,e.apiKey,!0),N(te,e.userName,!0),N(ne,e.password,!0),N(ee,B(p)===`none`||!!B(E)||!!B(ne),!0)};vs(()=>{(async()=>{typeof B(m)==`function`&&(N(T,!1),N(T,await B(m)(),!0)),B(T)&&(Ne(),N(re,null))})()}),YO(()=>[B(me),B(ee)],()=>{B(ee)&&xe(B(me))});var Pe={uploadFiles:Ce,canCreateFolder:we,showNewFolderDialog:Te,trackDownloads:je},Fe=IKe(),Ie=F(Fe),Le=e=>{var t=U(),n=F(t),a=e=>{DO(e,{children:(e,t)=>{var n=X1(),r=I(n,!0);z(e=>G(r,e),[()=>X(`assets_dialog.error.${B(le)}`)]),W(e,n)},$$slots:{default:!0}})},o=e=>{{let t=j(()=>i()?.accept);R$(e,{get accept(){return B(t)},multiple:!0,onDrop:({files:e})=>Ce(e),children:(e,t)=>{r(e)},$$slots:{default:!0}})}},s=e=>{r(e)};K(n,e=>{B(le)?e(a):B(v)?e(o,1):e(s,-1)}),W(e,t)},Re=e=>{M$(e,{get serviceProps(){return t.serviceProps},onAuth:Ne})},ze=e=>{DO(e,{children:(e,t)=>{var n=X1(),r=I(n,!0);z(e=>G(r,e),[()=>X(`cloud_storage.invalid`)]),W(e,n)},$$slots:{default:!0}})};K(Ie,e=>{B(ee)?e(Le):B(T)?e(Re,1):e(ze,-1)});var Be=L(Ie,2);Pu(Be,{get show(){return B(ue)},duration:0,children:(e,t)=>{Vc(e,{status:`info`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`uploading_files_progress`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var Ve=L(Be,2);Pu(Ve,{get show(){return B(de)},set show(e){N(de,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`uploading_files_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var He=L(Ve,2);ms(V$(He,{get maxSize(){return B(w)}}),e=>N(fe,e,!0),()=>B(fe));var Ue=L(He,2);Pu(Ue,{get show(){return B(ce)},set show(e){N(ce,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`creating_folder_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var We=L(Ue,2),Ge=e=>{{let t=j(()=>X(`new_folder`)),n=j(()=>X(`new_folder_create`)),r=j(()=>X(`new_folder_description`,{values:{folder:B(ye)}}));pH(e,{get title(){return B(t)},get okLabel(){return B(n)},get description(){return B(r)},get takenNames(){return B(ve)},onSubmit:e=>{Ee(e)},get open(){return B(se)},set open(e){N(se,e,!0)}})}};return K(We,e=>{B(y)&&e(Ge)}),W(e,Fe),A(Pe)}var Q1=V(`<div role="none" class="unsaved svelte-1ong0f1"> </div>`),zKe=V(`<!> <!> <!>`,1),BKe=V(`<div role="none" class="grid-wrapper svelte-1ong0f1"><!> <!></div>`),VKe=V(`<span role="none"> </span>`),HKe={hash:`svelte-1ong0f1`,code:".grid-wrapper.svelte-1ong0f1 {overflow-y:auto;height:100%;[role='listbox'] {background-color:transparent;&.grid {.unsaved {position:absolute;inset-block-start:8px;inset-inline-end:8px;z-index:1;}}&.list {.name {display:flex;gap:8px;align-items:center;justify-content:space-between;\n\n /* `Option` pins button descendants to `flex: none`, so a long name can’t shrink */.truncated-text {flex:auto;min-width:0;}}}}}.unsaved.svelte-1ong0f1 {display:flex;justify-content:center;align-items:center;border-color:var(--sui-info-border-color);border-radius:4px;padding:2px 6px;color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);font-size:var(--sui-font-size-small);}"};function $1(e,t){k(t,!0),q(e,HKe);let n=Y(t,`multiple`,3,!1),r=Y(t,`kind`,3,void 0),i=Y(t,`assets`,19,()=>[]),a=Y(t,`viewType`,3,`grid`),o=Y(t,`searchTerms`,3,``),s=Y(t,`basePath`,3,void 0),c=Y(t,`gridId`,3,void 0),l=Y(t,`checkerboard`,3,!1),u=Y(t,`emptyMessage`,3,void 0),d=Y(t,`selectedResources`,31,()=>na([])),f=Y(t,`subfolders`,19,()=>[]),p=Y(t,`onSelect`,3,void 0),m=Y(t,`onOpenSubfolder`,3,void 0),h=Y(t,`selectedSubfolderPaths`,19,()=>[]),g=Y(t,`onSelectSubfolder`,3,void 0),_=j(()=>B1(o())),v=j(()=>i().map(e=>{let{folder:t,name:n,path:r}=e;return{asset:e,relPath:s()&&!t.entryRelative?XE(r.replace(s(),``)):n,key:ZY(e)}})),y=j(()=>B(_).length?B(v).filter(e=>V1({value:e.relPath,tokens:B(_),normalizedValueCache:I1(e)})):B(v)),b=j(()=>new Set(d().flatMap(({asset:e})=>e?[ZY(e)]:[]))),x=e=>B(b).has(ZY(e)),S=(e,t)=>{let r=ZY(e),i=e=>!!e.asset&&ZY(e.asset)===r;t?(d(s1({resources:d(),resource:{asset:e},isSame:i,multiple:n()})),p()?.({asset:e})):d(d().filter(e=>!i(e)))};var C=U(),w=F(C),T=e=>{var t=BKe(),i=P(t),o=e=>{fH(e,{get subfolders(){return f()},get viewType(){return a()},get multiple(){return n()},get onOpen(){return m()},get selectedPaths(){return h()},get onSelect(){return g()}})};K(i,e=>{f().length&&e(o)});var s=L(i,2),u=e=>{{let t=j(()=>X(`assets_dialog.available_${r()===`image`?`images`:`files`}`));cH(e,{get multiple(){return n()},get gridId(){return c()},get viewType(){return a()},get ariaLabel(){return B(t)},children:(e,t)=>{gu(e,{get items(){return B(y)},itemKey:`key`,renderItem:(e,t=jr)=>{let r=j(()=>t()),i=j(()=>{let{kind:e,unsaved:t}=B(r).asset;return{assetKind:e,unsaved:t}});{let t=j(()=>x(B(r).asset));sH(e,{get value(){return B(r).key},get ariaLabel(){return B(r).relPath},get viewType(){return a()},get multiple(){return n()},get selected(){return B(t)},onChange:({detail:{selected:e}})=>{S(B(r).asset,e)},children:(e,t)=>{var n=zKe(),o=F(n),s=e=>{var t=Q1(),n=I(t,!0);z(e=>G(n,e),[()=>X(`assets_dialog.unsaved`)]),W(e,t)};K(o,e=>{a()===`grid`&&B(i).unsaved&&e(s)});var c=L(o,2);O$(c,{get kind(){return B(i).assetKind},get asset(){return B(r).asset},get alt(){return B(r).relPath},variant:`tile`,get checkerboard(){return l()}});var u=L(c,2),d=e=>{_B(e,{get path(){return B(r).relPath},children:(e,t)=>{var n=U(),r=F(n),o=e=>{var t=Q1(),n=I(t,!0);z(e=>G(n,e),[()=>X(`assets_dialog.unsaved`)]),W(e,t)};K(r,e=>{a()===`list`&&B(i).unsaved&&e(o)}),W(e,n)},$$slots:{default:!0}})};K(u,e=>{sW.isSmallScreen&&a()!==`list`||e(d)}),W(e,n)},$$slots:{default:!0}})}},$$slots:{renderItem:!0}})},$$slots:{default:!0}})}};K(s,e=>{B(y).length&&e(u)}),O(t),W(e,t)},ee=e=>{DO(e,{children:(e,t)=>{var n=VKe(),r=I(n,!0);z(e=>G(r,e),[()=>u()??X(`no_files_found`)]),W(e,n)},$$slots:{default:!0}})};K(w,e=>{B(y).length||f().length?e(T):e(ee,-1)}),W(e,C),A()}var UKe=V(`<div role="none" class="wrapper svelte-x4ewel"><!> <div role="none" class="panel svelte-x4ewel"><!></div></div>`),WKe={hash:`svelte-x4ewel`,code:`.wrapper.svelte-x4ewel {display:flex;flex-direction:column;height:100%;}.panel.svelte-x4ewel {flex:auto;overflow:hidden;}`};function GKe(e,t){k(t,!0),q(e,WKe);let n=Y(t,`multiple`,3,!1),r=Y(t,`kind`,3,void 0),i=Y(t,`selectFolder`,3,!1),a=Y(t,`uploadDisabled`,3,!1),o=Y(t,`accept`,3,void 0),s=Y(t,`assets`,19,()=>[]),c=Y(t,`searchTerms`,3,``),l=Y(t,`basePath`,3,void 0),u=Y(t,`folderLabel`,3,``),d=Y(t,`subfolderPath`,3,``),f=Y(t,`subfolders`,19,()=>[]),p=Y(t,`selectedResources`,31,()=>na([])),m=Y(t,`onNavigate`,3,void 0),h=Y(t,`onOpenSubfolder`,3,void 0),g=Y(t,`selectedSubfolderPaths`,19,()=>[]),_=Y(t,`onSelectSubfolder`,3,void 0),v=M(void 0);R(()=>{p().length||co(()=>{B(v)?.reset()})});{let y=j(()=>i()||a());ms(R$(e,{get disabled(){return B(y)},get multiple(){return n()},get accept(){return o()},filterDroppedFiles:!1,get onDrop(){return t.onDrop},children:(e,t)=>{var a=UKe(),o=P(a);oH(o,{get rootLabel(){return u()},get path(){return d()},get onNavigate(){return m()}});var v=L(o,2),y=P(v);{let e=j(()=>s$.current?.type),t=j(()=>i()?X(`assets_dialog.no_subfolders`):void 0);$1(y,{get multiple(){return n()},get kind(){return r()},get assets(){return s()},get viewType(){return B(e)},get searchTerms(){return c()},get basePath(){return l()},get subfolders(){return f()},gridId:`select-assets-grid`,checkerboard:!0,get emptyMessage(){return B(t)},get onOpenSubfolder(){return h()},get selectedSubfolderPaths(){return g()},get onSelectSubfolder(){return _()},get selectedResources(){return p()},set selectedResources(e){p(e)}})}O(v),O(a),W(e,a)},$$slots:{default:!0}}),e=>N(v,e,!0),()=>B(v))}A()}var KKe=V(`<!> <!>`,1),qKe=V(`<!> <!> <!>`,1);function JKe(e,t){k(t,!0);let n=(e,n)=>{let r=()=>(n?.()).name,i=()=>(n?.()).label,a=()=>(n?.()).icon,o=()=>(n?.()).onclick;{let n=e=>{Lc(e,{get name(){return a()}})},s=j(()=>t.libraryName===r());nu(e,{get name(){return r()},get label(){return i()},get selected(){return B(s)},get onclick(){return o()},startIcon:n,$$slots:{startIcon:!0}})}},r=j(()=>sW.isSmallScreen?yu:eu);var i=U(),a=F(i);{let e=j(()=>X(`assets_dialog.locations`));Wo(a,()=>B(r),(r,i)=>{i(r,{class:`tabs`,get ariaLabel(){return B(e)},get"aria-controls"(){return t.controlsId},filterThreshold:-1,onChange:e=>{t.onChange(e.detail.name)},children:(e,r)=>{var i=qKe(),a=F(i),o=e=>{{let r=j(()=>X(`asset_location.repository`));tu(e,{get label(){return B(r)},children:(e,r)=>{var i=U();Ro(F(i),17,()=>Object.entries(t.assetLibraryFolderMap),([e,t])=>e,(e,r)=>{var i=j(()=>Pr(B(r),2));let a=()=>B(i)[0],o=()=>B(i)[1];var s=U(),c=F(s),l=e=>{{let t=j(()=>({name:`default-${a()}`,label:o().folder?.label||X(`assets_dialog.folder.${a()}`),icon:`folder`}));n(e,()=>B(t))}},u=j(()=>o1(o(),t.selectFolder));K(c,e=>{B(u)&&e(l)}),W(e,s)}),W(e,i)},$$slots:{default:!0}})}};K(a,e=>{t.showRepository&&e(o)});var s=L(a,2),c=e=>{{let r=j(()=>X(`asset_location.external`));tu(e,{get label(){return B(r)},children:(e,r)=>{var i=KKe(),a=F(i);Ro(a,17,()=>t.cloudServiceEntries,([,{serviceId:e,serviceLabel:t}])=>e,(e,t)=>{var r=j(()=>Pr(B(t),2));let i=()=>B(r)[1].serviceId,a=()=>B(r)[1].serviceLabel;n(e,()=>({name:i(),label:a(),icon:`cloud`,onclick:()=>{i()===`cloudinary`&&sB.current&&(lB.current=!0)}}))});var o=L(a,2),s=e=>{{let t=j(()=>({name:`enter-url`,label:X(`assets_dialog.enter_url`),icon:`link_2`}));n(e,()=>B(t))}};K(o,e=>{t.showURLInput&&e(s)}),W(e,i)},$$slots:{default:!0}})}};K(s,e=>{(t.showURLInput||t.cloudServiceEntries.length)&&e(c)});var l=L(s,2),u=e=>{{let r=j(()=>X(`asset_location.stock_photos`));tu(e,{get label(){return B(r)},children:(e,r)=>{var i=U();Ro(F(i),17,()=>t.stockAssetProviderEntries,([e,{serviceLabel:t}])=>e,(e,t)=>{var r=j(()=>Pr(B(t),2));let i=()=>B(r)[0],a=()=>B(r)[1].serviceLabel;n(e,()=>({name:i(),label:a(),icon:`photo_camera_back`}))}),W(e,i)},$$slots:{default:!0}})}};K(l,e=>{t.stockAssetProviderEntries.length&&e(u)}),W(e,i)},$$slots:{default:!0}})})}W(e,i),A()}var e0=e=>{let t=e.folder.entryRelative?void 0:LX(e,{allowSpecial:!0,pathOnly:!0});return t===void 0?{asset:e}:{url:t}},t0=({field:e,keyPath:t,keyPathList:n})=>{let{widget:r}=e,i=r===`list`;if(n.push(t),i||r===`object`){let{fields:r}=e,{types:a,typeKey:o=`type`}=e;if(r)r.forEach(e=>{t0({field:e,keyPath:i?`${t}.*.${e.name}`:`${t}.${e.name}`,keyPathList:n})});else if(a)n.push(i?`${t}.*.${o}`:`${t}.${o}`),a.forEach(e=>{e.fields?.forEach(e=>{t0({field:e,keyPath:i?`${t}.*.${e.name}`:`${t}.${e.name}`,keyPathList:n})})});else if(i){let{field:r}=e;r?t0({field:r,keyPath:`${t}.*`,keyPathList:n}):n.push(`${t}.*`)}}else r&&_k.includes(r)&&mM(e)&&n.push(`${t}.*`)},YKe=e=>{let t=[];return e.forEach(e=>{t0({field:e,keyPath:e.name,keyPathList:t})}),t},n0=({collection:e,fields:t=[],option:n,defaultKey:r})=>{if(e?._type!==`entry`)return;let i=n===!0?r:n||void 0;if(i&&!t.some(({name:e})=>e===i))return i},r0=({collection:e,fields:t})=>{let{aliases_field:n=`aliases`}=e??{};return n0({collection:e,fields:t,option:n,defaultKey:`aliases`})},i0=(e,t)=>{let n=`${t}.`;return Object.keys(e).filter(e=>e.startsWith(n)&&cM(e.slice(n.length))).sort((e,t)=>Number(e.slice(n.length))-Number(t.slice(n.length)))},a0=(e,t)=>{t&&(i0(e,t).forEach(t=>{delete e[t]}),delete e[t])},o0=(e,t)=>({...e,locales:Object.fromEntries(Object.entries(e.locales).map(([e,n])=>[e,n.content?{...n,content:t({locale:e,localizedEntry:n})}:n]))});zM.default.extend(BM.default),zM.default.extend(VM.default),zM.default.extend(HM.default);var s0=({dateFieldName:e,fields:t,content:n,locale:r,inSlugTimeZone:i})=>{let a=e?t.find(({widget:t,name:n})=>t===`datetime`&&n===e):t.find(({widget:e})=>e===`datetime`),o=a?n[a.name]:void 0;if(!a||!o)return;let s=a,c=MN(o,s,r);if(!bN(c))return;let{format:l,dateOnly:u,utc:d,outputUTC:f,singleCustomTimeZone:p}=lN(s);return JL(i&&!u?{date:c,timeZone:rN()}:{date:c,timeZone:d||f||u&&!l?`UTC`:u?void 0:p})},c0=({pathTemplate:e,dateFieldName:t,fields:n,collection:r,locale:i,slug:a,entryFilePath:o,content:s,isIndexFile:c=!1})=>{let l;if(!(Ek.test(e)&&(l=s0({dateFieldName:t,fields:n,content:s,locale:i}),!l)))try{return IY(e,{type:`preview_path`,collection:r,content:s,locale:i,currentSlug:a,entryFilePath:o,dateTimeParts:l,isIndexFile:c})}catch{return}},l0=({collection:e,collectionFile:t,locale:n,slug:r,path:i,content:a,defaultContent:o,isIndexFile:s=!1})=>{let{preview_path:c,preview_path_date_field:l,fields:u=[],_i18n:{defaultLocale:d,omitDefaultLocaleFromPreviewPath:f}}=t??e;if(!i||!a||!c)return;let p=s?Lk(e):void 0,m=c;return n===d&&f&&(m=CA(m)??m),c0({pathTemplate:m,dateFieldName:l,fields:p?.fields??u,collection:e,locale:n,slug:r,entryFilePath:i,content:Dke({getFieldArgs:{collectionName:e.name,fileName:t?.name,isIndexFile:s},locale:n,defaultLocale:d,content:a,defaultContent:o}),isIndexFile:s})},XKe=(e,t,n,r,i={})=>{let{show_preview_links:a=!0,_baseURL:o}=$O.current??{},s=i.baseURL||o,{slug:c,path:l,content:u}=e.locales[t]??{};if(!a||!s)return;let{preview_path:d}=r??n;if(i.fallbackToRoot&&!d)return`${s.replace(/\/$/,``)}/`;let f=l0({collection:n,collectionFile:r,locale:t,slug:c,path:l,content:u,defaultContent:e.locales[(r??n)._i18n.defaultLocale]?.content,isIndexFile:zk(n,e)});if(f!==void 0)return`${s.replace(/\/$/,``)}/${f.replace(/^\//,``)}`},ZKe=(e,t)=>{let n=e.locales[t]?.path;return`${XJ.current?.repository?.blobBaseURL}/${n?oP(n):``}?plain=1`},u0=e=>{let t=l0(e);return t===void 0?void 0:`/${t.replace(/^\//,``)}`},d0=({collection:e,fields:t})=>n0({collection:e,fields:t,option:e?.permalink_field,defaultKey:`permalink`}),f0=({collection:e,fields:t,isIndexFile:n=!1,locale:r,content:i,defaultContent:a,slug:o,path:s})=>{let c=d0({collection:e,fields:t});if(!c||n||!e.preview_path||typeof(i[c]??``)!=`string`||Object.keys(i).some(e=>e.startsWith(`${c}.`)))return;let l=u0({collection:e,locale:r,slug:o,path:s,content:i,defaultContent:a});l===void 0?delete i[c]:i[c]=l},p0=({collection:e,isIndexFile:t=!1,entry:n})=>{let{fields:r}=e;if(t||!d0({collection:e,fields:r}))return n;let i=n.locales[e._i18n.defaultLocale]?.content;return o0(n,({locale:t,localizedEntry:{slug:n,path:a,content:o}})=>{let s={...o};return f0({collection:e,fields:r,locale:t,content:s,defaultContent:i,slug:n,path:a}),s})},QKe=new Map,$Ke=e=>mA(QKe,e,()=>RegExp(`^(${uj(e)})(?:\\.|$)`)),m0=({key:e,field:t,locale:n,unsortedMap:r,sortedMap:i,isTomlOutput:a,omitEmptyOptionalFields:o})=>{if(nz.test(e)){delete r[e];return}let s=r[e];if(a&&t?.widget===`datetime`&&!lN(t).format){if(Nj(s))s=void 0;else{let e=new vL(s);e.isValid()&&(s=e)}}if(o&&t&&!bM({fieldConfig:t,locale:n})&&Nj(s)){let t=Object.keys(r).filter(t=>t.startsWith(`${e}.`));t.some(e=>!nz.test(e)&&!Nj(r[e]))?i[e]=s:t.forEach(e=>{delete r[e]})}else i[e]=s;delete r[e]},eqe=[`code`,`hidden`],tqe=e=>eqe.includes(String(e.widget))||yM(e)===`custom`,nqe=(e,t,n)=>{let{unsortedMap:r,sortedMap:i,copyArgs:a}=e,o=`${t}.`,s=Object.keys(r).filter(e=>e.startsWith(o)?!e.slice(o.length).trim()&&!r[e]?(delete r[e],!1):!0:!1);s.length?(i[t]={},delete r[t],s.forEach(e=>{m0({...a,key:e,field:n})})):(Object.hasOwn(r,t)||uR({...e,keyPath:t}))&&(r[t]??={},m0({...a,key:t,field:n}))},rqe=({unsortedMap:e,copyArgs:t},n,r)=>{Object.hasOwn(e,n)&&m0({...t,key:n,field:r});let i=`${n}.`;Object.keys(e).filter(e=>e.startsWith(i)).forEach(e=>{m0({...t,key:e})})},iqe=({unsortedMap:e,sortedMap:t},n,r)=>{r?.widget===`object`&&lCe(e,n)&&(t[n]={})},h0=(e,t,n)=>{let r=!t.includes(`*`);if(n?.widget===`keyvalue`&&r)nqe(e,t,n);else if(n&&r&&tqe(n))rqe(e,t,n);else if(Object.hasOwn(e.unsortedMap,t))m0({...e.copyArgs,key:t,field:n});else return!1;return!0},aqe=(e,t,n)=>{let r=$Ke(t);[...new Set(Object.keys(e.unsortedMap).map(e=>e.match(r)?.[1]).filter(e=>e!==void 0))].sort((e,t)=>$E(e,t)).forEach(t=>{let r=n??_M({...e.getFieldArgs,keyPath:t});h0(e,t,r)||iqe(e,t,r)})},oqe=({collectionName:e,fileName:t,fields:n,locale:r,defaultLocale:i,valueMap:a,canonicalSlugKey:o,permalinkKey:s,aliasesKey:c,orderKey:l,isIndexFile:u=!1,isTomlOutput:d=!1})=>{let f=Sr(a),p={},{omit_empty_optional_fields:m=!1}=$O.current?.output??{},h={collectionName:e,fileName:t,valueMap:a,isIndexFile:u},g={locale:r,unsortedMap:f,sortedMap:p,isTomlOutput:d,omitEmptyOptionalFields:m},_={locale:r,defaultLocale:i,getFieldArgs:h,unsortedMap:f,sortedMap:p,copyArgs:g};return[o,s,c,...c?i0(f,c):[],l].forEach(e=>{e&&Object.hasOwn(f,e)&&m0({...g,key:e})}),YKe(n).forEach(e=>{let t=_M({...h,keyPath:e});h0(_,e,t)||aqe(_,e,t)}),Object.keys(f).sort((e,t)=>$E(e,t)).forEach(e=>{m0({...g,key:e})}),jj(p)},g0=e=>Array.isArray(e)?e.filter(e=>e!=null).map(g0):Tj(e)?Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>[e,g0(t)])):e,_0=({draft:e,locale:t,valueMap:n,format:r})=>{let{collection:i,collectionName:a,collectionFile:o,fields:s,isIndexFile:c}=e,{_i18n:{defaultLocale:l,canonicalSlug:{key:u}}}=o??i,d=Gk.includes(r??IA({collection:i,collectionFile:o,isIndexFile:c}).format),f=OP(oqe({collectionName:a,fileName:o?.name,fields:s,locale:t,defaultLocale:l,valueMap:n,canonicalSlugKey:u,permalinkKey:d0({collection:i,fields:s}),aliasesKey:r0({collection:i,fields:s}),orderKey:HL(i),isIndexFile:c,isTomlOutput:d}),s,!1),p=d?g0(f):f;if(pM(s,`list`)){let e=!!EP(s[0]);if(e||!d)return p[s[0].name]??(e?{}:[])}return pM(s,`keyvalue`)?p[s[0].name]??{}:p},v0=(e,t)=>Object.fromEntries(e.flatMap(e=>{let{name:n,widget:r=`string`,comment:i}=e,a=`${t}${n}`,o=Jk(i)?[[a,i]]:[];return r===`object`&&`fields`in e&&Array.isArray(e.fields)&&o.push(...Object.entries(v0(e.fields,`${a}.`))),o})),y0=(e=[],t=``)=>pM(e,`list`)||pM(e,`keyvalue`)?{}:v0(e,t),sqe=({config:e,fields:t})=>{let{_i18n:{i18nEnabled:n,allLocales:r,defaultLocale:i,structureMap:{i18nSingleFileDefaultRoot:a}={}}}=e;return n?Object.assign({},...r.map(e=>y0(t,a&&e===i?``:`${e}.`))):y0(t)},cqe=({config:e,entry:t,draft:n,format:r})=>{let{_i18n:{i18nEnabled:i,defaultLocale:a,structureMap:{i18nSingleFileDefaultRoot:o}={}}}=e;if(!i)return _0({draft:n,locale:`_default`,valueMap:t.locales[a].content,format:r});let s=Object.fromEntries(Object.entries(t.locales).filter(([,e])=>!!e.content).map(([e,t])=>[e,_0({draft:n,locale:e,valueMap:t.content,format:r})]));if(o){let{lang:e,...t}=s[a]??{},n=Object.fromEntries(Object.entries(s).filter(([e])=>e!==a));return{lang:[a,...Object.keys(n)],...t,...n}}return s},lqe=()=>JSON.rawJSON,uqe=e=>function(t,n){let r=this[t],i=r instanceof sL?HEe(r):hL(n);return i===void 0?n:e(i)},dqe=(e,t=$O.current?.output?.json??{})=>{let{indent_style:n=`space`,indent_size:r=n===`tab`?1:2}=t,i=lqe();return JSON.stringify(e,i?uqe(i):void 0,n===`tab`?` `.repeat(r):r).trim()},fqe=e=>vDe(YEe()?gL(e):e).trim(),b0=(e,t,n=``)=>{BP(e)&&e.items.forEach(({key:e,value:r})=>{let i=e,a=`${n}${i.value}`,o=Object.hasOwn(t,a)?t[a]:void 0;o&&(i.commentBefore=o.split(/\\n|\n/).map(e=>` ${e}`).join(`
|
||
`)),b0(r,t,`${a}.`)})},pqe=/^(?:y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)$/,mqe=RegExp(`^[-+]?(?:0b[01_,]+|0[0-7_,]+|0x[\\da-fA-F_,]+|(?:\\d[\\d_,]*)?\\.[\\d_,]*(?:[eE][-+]?\\d+)?|\\d[\\d_,]*|\\d[\\d_]*(?::[0-5]?\\d)+(?:\\.[\\d_]*)?)$`),hqe=e=>pqe.test(e)||mqe.test(e),gqe=(e,t=$O.current?.output?.yaml??{},n={},r={})=>{let{indent_size:i=2,indent_sequences:a=!0,quote:o=`none`}=t,{quote:s=!1}=n,c={indent:i,indentSeq:a,lineWidth:0,defaultKeyType:`PLAIN`,defaultStringType:s||o===`double`?`QUOTE_DOUBLE`:o===`single`?`QUOTE_SINGLE`:`PLAIN`,singleQuote:!(s||o===`double`)},l=new DI(e,{customTags:[UEe]});return YP(l,{Scalar:(e,t)=>{typeof t.value==`string`&&hqe(t.value)&&(t.type=c.singleQuote?`QUOTE_SINGLE`:`QUOTE_DOUBLE`);let n=hL(t.value);n!==void 0&&(t.value=BigInt(n))}}),b0(l.contents,r),l.toString(c).trim()},x0={yaml:(e,{yamlQuote:t=!1},n)=>gqe(e,void 0,{quote:t},n),toml:e=>fqe(e),json:e=>dqe(e)},S0=e=>e===`frontmatter`||Uk.includes(e),_qe=({content:e,_file:t,comments:n})=>{let{format:r,fmDelimiters:i,bodyField:{key:a=`body`,inline:o=!1}={}}=t,[s,c]=i??Hk[`yaml-frontmatter`],l=``;if(!o&&Object.hasOwn(e,a)){let t=e[a];(typeof t==`string`||t==null)&&(l=t??``,delete e[a])}if(!Object.keys(e).length){let e=l.split(`
|
||
`,1)[0].trimEnd();return[s,...Object.values(Hk).map(([e])=>e)].includes(e)?`${s}\n\n${c}\n\n${l}\n`:`${l}\n`}let u=S0(r)?qk(r):void 0;if(!u)throw Error(`Unsupported front matter format: ${r}`);let d=x0[u](e,t,n);return u===`json`&&s===`{`&&c===`}`&&(d=d.slice(1,-1).replace(/^\n/,``).replace(/\n$/,``)),`${s}\n${d}\n${c}\n${!o&&l?`\n${l}\n`:``}`},C0=({content:e,_file:t,comments:n,valueSources:r})=>{let{format:i}=t;if(i===`raw`)return typeof e.body==`string`?`${e.body}\n`:``;r&&(e=Gk.includes(i)?jDe(e,r):lL(e,r));try{return S0(i)?_qe({content:e,_file:t,comments:n}):`${x0[qk(i)](e,t,n)}\n`}catch(e){throw Error(`The entry could not be formatted due to ${e.name}: ${e.message}`,{cause:e})}},w0=async({content:e,_file:t,comments:n,valueSources:r})=>{let{format:i,configuredFormat:a=i}=t,o=IO.get(a)?.formatter,s=o?a:i,c=o??IO.get(s)?.formatter,l=Wk.includes(i);if(!c){if(!l)throw Error(IO.has(i)?`Entries in the custom “${i}” format can’t be saved, as no \`toFile\` method was registered for it with \`CMS.registerCustomFormat()\``:`Entries in the unknown “${i}” format can’t be saved`);return C0({content:e,_file:t,comments:n,valueSources:r})}let u=await c(e,{serialize:async e=>{if(typeof e!=`object`||!e)throw TypeError("The `serialize` function must be given the entry content");if(!l)throw Error(`Entries in the custom “${i}” format can’t be serialized, as there’s no built-in formatter for it`);return C0({content:Array.isArray(e)?[...e]:{...e},_file:t,comments:n,valueSources:r})}});if(typeof u!=`string`)throw TypeError(`The \`toFile\` method registered for the custom “${s}” format must return a string`);return`${u.trim()}\n`},vqe=({draft:e,config:t,_file:n,entry:r,locale:i,valueSources:a})=>w0(i===void 0?{content:cqe({config:t,entry:r,draft:e,format:n.format}),_file:n,comments:sqe({config:t,fields:e.fields}),valueSources:a}:{content:_0({draft:e,locale:i,valueMap:r.locales[i].content,format:n.format}),_file:n,comments:y0(e.fields),valueSources:a}),T0=e=>e||fR(XJ.current?.repository,`file-cache`),E0=async({previousPath:e,cacheDB:t})=>{if(e)return(await t?.get(e))?.sha},yqe=({i18nEnabled:e,structureMap:t={}})=>!e||VA(t),D0=async({draft:e,config:t,_file:n,entry:r,cacheDB:i,planChange:a})=>{let o=yqe(t._i18n)?[void 0]:t._i18n.allLocales;return(await Promise.all(o.map(async o=>{let s=a(o);if(!s)return;let{currentPath:c,...l}=s;if(l.action===`delete`)return{...l,previousSha:await E0({cacheDB:i,previousPath:c})};let[u,d]=await Promise.all([E0({cacheDB:i,previousPath:c}),vqe({draft:e,config:t,_file:WEe({_file:n,previousPath:c,path:l.path}),entry:r,locale:o,valueSources:n.arrayFile?void 0:zEe({previousPath:c,path:l.path})})]);return{...l,previousSha:u,data:d}}))).filter(Boolean)},O0=({loader:e,notLoadedMessage:t})=>{let n,r,i=WO(!1),a=async()=>(r??=(async()=>{let t;try{t=await e()}catch(e){throw r=void 0,e}return n=t,i.current=!0,t})(),r);return{loaded:i,load:a,preload:()=>{a().catch(()=>{})},get:()=>{if(!n)throw Error(t);return n},reset:()=>{n=void 0,r=void 0,i.current=!1}}},k0=O0({loader:()=>dN(`immutable`,`dist/immutable.es.js`),notLoadedMessage:"Immutable.js is not loaded yet. Call `loadImmutable()` first."}),A0=k0.loaded,j0=k0.load,M0=k0.preload,N0=k0.get;k0.reset;var P0=WO(0),F0=new WeakMap,bqe=async e=>F0.get(e)??!1,xqe=class{#e;constructor(e){this.#e=e,this.path=LX(e,{pathOnly:!0})??``,this.url=e.blobURL??this.path,this.field=void 0,this.fileObj=e.file,F0.set(this,(async()=>{try{let t=await wX(e);if(t&&t!==this.url)return this.url=t,P0.current+=1,!0}catch{}return!1})())}toString(){return this.url}async toBase64(){try{return Sk(await CX(this.#e))}catch(e){throw Error(`Failed to encode asset as base64: ${e.message}`)}}},Sqe=class{constructor(e){this.path=e,this.url=e,this.field=void 0,this.fileObj=void 0}toString(){return this.url}async toBase64(){try{let e=await fetch(this.url);if(!e.ok)throw Error(`HTTP ${e.status}`);return Sk(await e.blob())}catch(e){throw Error(`Failed to encode asset as base64: ${e.message}`)}}},Cqe=class{#e;constructor(e,t){this.#e=t,this.path=e,this.url=e,this.field=void 0,this.fileObj=t}toString(){return this.url}async toBase64(){return Sk(this.#e)}},I0=({content:e,otherLocales:t,locales:n,slug:r,path:i,isNew:a,collectionName:o,associatedAssets:s})=>N0().fromJS({data:Mj(e),i18n:Object.fromEntries(t.map(e=>[e,{data:Mj(n[e].content)}])),slug:r,path:i,newRecord:a,collection:o,mediaFiles:s.map(({sha:e,file:t,size:n,blobURL:r,...i})=>({id:e,name:i.name,path:i.path,file:t,size:n,url:r,displayURL:r})),meta:{path:i},isModification:null,label:null,partial:!1,author:``,raw:``,status:``,updatedOn:``}),L0=({entry:e,locale:t,collectionName:n,associatedAssets:r,content:i})=>I0({content:i??e?.locales?.[t]?.content??{},otherLocales:Object.keys(e?.locales??{}).filter(e=>e!==t),locales:e?.locales??{},slug:e?.slug??``,path:e?.locales?.[t]?.path??``,isNew:!1,collectionName:n,associatedAssets:r}),R0=({entry:e,collectionName:t,fileName:n,files:r,typedKeyPath:i,componentNames:a,locale:o})=>s=>{let c=r?.[s]?.file;if(c)return new Cqe(s,c);let l={value:s,entry:e,collectionName:t,fileName:n,typedKeyPath:i,locale:o},{asset:u,url:d}=(a?CZ({...l,componentNames:a}):bZ(l))??{};if(u)return new xqe(u);if(d)return new Sqe(d)},wqe=new WeakMap,Tqe=(e,t,n)=>mA(mA(mA(wqe,e,()=>new WeakMap),n,()=>new Map),t,()=>{let r=new Map;return e.forEach(e=>{FR({locale:t,fieldConfig:n,refEntry:e}).forEach(({value:t})=>{r.has(t)||r.set(t,e)})}),r}),z0=({getFieldArgs:e,keyPath:t})=>{let n=t.split(`.`);return n.flatMap((t,r)=>{if(!r||!cM(t))return[t];let i=_M({...e,keyPath:n.slice(0,r).join(`.`)});if(i?.widget===`object`)return[t];let{field:a}=i??{};return i?.widget===`list`&&a?[a.name]:[]})},Eqe=({locale:e,getFieldArgs:t})=>{let{valueMap:n={}}=t,r=Object.create(null),i=new Map;return Object.entries(n).forEach(([n,a])=>{let o=n,s=_M({...t,keyPath:o});if(s?.widget===`relation`){let{collection:c,file:l}=s,u=Tqe((()=>{let e=`${c}:${l??``}`,t=i.get(e);if(t)return t;let n=l?[cj(c,l)].filter(e=>!!e):BL(c);return i.set(e,n),n})(),e,s).get(String(a)),d=YA(c)?._i18n.defaultLocale,f=(u?.locales[e]??(d?u?.locales[d]:void 0)??u?.locales._default)?.content,p=f?Mj(f):void 0,m=z0({getFieldArgs:t,keyPath:o}),h=m.at(-1)===n.split(`.`).at(-1)?n:n.replace(mj,``);(m.length===1&&m[0]===h?[m]:[m,[h]]).forEach(e=>{let t=[...e,c].reduce((e,t)=>(e[t]??=Object.create(null),e[t]),r);t[a]=p})}}),N0().fromJS(r)},Dqe=({originalEntry:e,currentValues:t})=>({...e,locales:Object.fromEntries(Object.entries(t).map(([t,n])=>[t,{slug:e?.locales[t]?.slug??e?.slug,path:e?.locales[t]?.path??e?.subPath,content:oz(n)}]))}),Oqe=xA(()=>qB.current,()=>new WeakMap),B0=({collectionName:e,fileName:t})=>{let n=HB({collectionName:e,fileName:t});return n?mA(Oqe(),n,()=>qB.current.filter(e=>aX(e,n))):[]},V0=({draft:e,locale:t})=>{let{collectionName:n,fileName:r,isIndexFile:i,originalEntry:a,currentValues:o,files:s}=e,c=Dqe({originalEntry:a,currentValues:o}),l=c.locales[t].content??{},u={collectionName:n,fileName:r,valueMap:l,isIndexFile:i},d;return{entryMap:L0({entry:c,locale:t,collectionName:n,associatedAssets:B0({collectionName:n,fileName:r}),content:l}),valueMap:l,getFieldArgs:u,get fieldsMetaData(){return d??=Eqe({locale:t,getFieldArgs:u}),d},getAsset:R0({entry:c,collectionName:n,fileName:r,files:s,locale:t})}},H0=new WeakMap,U0=e=>{let t=H0.get(e);if(t)return t;let n=N0().fromJS(e);return H0.set(e,n),n},W0=new Map,G0=!1,K0=({draft:e,locale:t})=>{let n=W0.get(e)??new Map,r=n.get(t);if(r)return r;let i=V0({draft:{...e,currentValues:yz(e)},locale:t});return n.set(t,i),W0.set(e,n),G0||(G0=!0,queueMicrotask(()=>{W0.clear(),G0=!1})),i},q0=new Map,J0=new Map,Y0=new Map,X0=new Map,Z0=(e,t)=>`${e}:${t}`,Q0=({locale:e,keyPath:t,instance:n})=>{n&&typeof n==`object`&&q0.set(Z0(e,t),n)},$0=({locale:e,keyPath:t,instance:n})=>{let r=Z0(e,t);q0.has(r)&&q0.get(r)!==n||(q0.delete(r),J0.delete(r),Y0.delete(r),X0.set(r,(X0.get(r)??0)+1))},kqe=()=>{q0.clear(),J0.clear(),Y0.clear(),X0.clear()},Aqe=e=>{if(e===!1)return{valid:!1};if(typeof e==`object`&&e){let{error:t}=e;if(typeof t==`object`&&t&&typeof t.message==`string`)return{valid:!1,message:t.message}}return{valid:!0}},jqe=async({locale:e,keyPath:t,value:n,fieldConfig:r})=>{let i=Z0(e,t),a=q0.get(i);if(typeof a?.isValid!=`function`){J0.set(i,{valid:!0,pending:!1});return}let o=(X0.get(i)??0)+1;X0.set(i,o);let s=J0.get(i);J0.set(i,{valid:s?.valid??!0,message:s?.message,pending:!0});let c=(async()=>{await j0();let e=U0(r),t;try{t=Aqe(await a.isValid(n,e))}catch(e){t={valid:!1,message:e instanceof Error?e.message:X(`validation.unexpected_error`)}}X0.get(i)===o&&J0.set(i,{...t,pending:!1})})();Y0.set(i,c);try{await c}finally{Y0.get(i)===c&&Y0.delete(i)}},Mqe=async()=>{for(;Y0.size;)await Promise.all(Y0.values())},Nqe=({locale:e,keyPath:t,validity:n})=>{let r=Z0(e,t);if(typeof q0.get(r)?.isValid!=`function`)return;let i=J0.get(r);i&&(n.customError=!i.valid,!i.valid&&i.message?n.customErrorMessage=i.message:delete n.customErrorMessage)},Pqe=({fieldConfig:e,value:t,locale:n})=>{let r=e,{type:i,min:a,max:o,singleCustomTimeZone:s}=lN(r),c=typeof a==`string`&&!!a,l=typeof o==`string`&&!!o,u=!1,d=!1;if(t&&(c||l)){let e=tje({currentValue:t,fieldConfig:r,timeZone:s,locale:n});if(e){let t=document.createElement(`input`);t.type=i,c&&(t.min=a),l&&(t.max=o),t.value=e,{rangeUnderflow:u,rangeOverflow:d}=t.validity}}return{validity:{rangeUnderflow:u,rangeOverflow:d},detail:{hasMin:c,hasMax:l,invalid:u||d}}},Fqe=new Intl.DateTimeFormat(`en-GB`,{hour12:!0,timeZone:`UTC`,hour:`2-digit`,minute:`2-digit`}),e2=e=>Fqe.format(new Date(`1970-01-01T${e}Z`)).toUpperCase(),Iqe=(e,t)=>{if(e===`date`)return t;if(e===`time`)return e2(t);let[n,r]=t.split(`T`);return`${n}, ${e2(r)}`},t2=({direction:e,limitKey:t,limitValue:n,fieldType:r,type:i,canAddMultiValue:a})=>r===`datetime`&&typeof n==`string`?X(`validation.range_${e}.${i}`,{values:{[t]:Iqe(i,n)}}):X(r===`number`?`validation.range_${e}.number`:a?`validation.range_${e}.add`:`validation.range_${e}.select`,{values:{[t]:n}}),n2=({validity:e,fieldConfig:t})=>{let n=[],{widget:r=`string`}=t,{pattern:i=[]}=t,a=r===`datetime`,o=a?lN(t):{},s=r===`string`?t.type??`text`:a?o.type:r===`number`?`number`:void 0,{min:c,max:l}=a?o:t,u=r===`list`||r===`keyvalue`||mk.includes(r)&&mM(t);if(e.valueMissing&&n.push(X(`validation.value_missing`)),e.tooShort){let{minlength:e}=t;n.push(X(`validation.too_short`,{values:{min:e}}))}if(e.tooLong){let{maxlength:e}=t;n.push(X(`validation.too_long`,{values:{max:e}}))}return e.rangeUnderflow&&n.push(t2({direction:`underflow`,limitKey:`min`,limitValue:c,fieldType:r,type:s,canAddMultiValue:u})),e.rangeOverflow&&n.push(t2({direction:`overflow`,limitKey:`max`,limitValue:l,fieldType:r,type:s,canAddMultiValue:u})),e.patternMismatch&&n.push(i[1]),e.typeMismatch&&n.push(X(`validation.type_mismatch.${s}`)),e.duplicateError&&n.push(X(`validation.value_not_unique`)),e.mapKeyDuplicate&&n.push(X(`validation.key_not_unique`)),e.mapKeyNumeric&&n.push(X(`validation.key_numeric`)),e.customError&&n.push(e.customErrorMessage??X(`validation.invalid_value`)),n},r2=e=>{let t=[];return e?.patternMismatch&&t.push(X(`edit_path_error.invalid`)),e?.customError&&t.push(X(`edit_path_error.recursive`)),e?.duplicateError&&t.push(X(`edit_path_error.duplicate`)),t},Lqe=({draft:e,locale:t})=>{let{currentValues:n,extraValues:r}=e,i=n[t]??{},a=r[t]??{};return Object.entries(e.validationMessages[t]??{}).filter(([,e])=>!!e.length).map(([e,t])=>{let[n]=e.match(wZ)??[];return{keyPath:e,messages:t,prefix:n,valueMap:n?a:i}}).filter(({keyPath:e,valueMap:t})=>e in t||Object.keys(t).some(t=>t.startsWith(`${e}.`))).map(({keyPath:n,messages:r,prefix:i,valueMap:o})=>{let s=_M(gM(e,{keyPath:TZ(n),valueMap:o,componentName:i?a[`${i}__sc_component_name`]:void 0}));return{keyPath:n,label:s?ER({config:s,locale:t}):``,messages:r}})},Rqe=({fieldConfig:e,locale:t,value:n})=>{let r=e,{value_type:i=`int`,min:a,max:o}=r,s=n===null||typeof n==`string`&&!n.trim()?NaN:Number(n),c=ZN(n,r),l=!c&&Number.isFinite(s),u=l&&typeof a==`number`&&s<a;return{validity:{rangeUnderflow:u,rangeOverflow:!u&&l&&typeof o==`number`&&s>o,typeMismatch:c||(i===`int`||i===`float`)&&bM({fieldConfig:e,locale:t})&&n===null}}},i2=({fieldConfig:e,value:t})=>{let n=e,{widget:r=`string`,minlength:i,maxlength:a}=n,o=Number.isInteger(i)&&i<=(a??1/0),s=Number.isInteger(a)&&(i??0)<=a,{type:c=`text`,prefix:l,suffix:u}=n,d=typeof t==`string`?t:String(t??``);r===`string`&&(l&&d.startsWith(l)&&(d=d.slice(l.length)),u&&d.endsWith(u)&&(d=d.slice(0,-u.length)));let f=[...d.trim()].length,p=o&&f<i,m=s&&f>a,h=!1;if(r===`string`&&d){if(c!==`text`){let e=document.createElement(`input`);e.type=c,e.value=d,{typeMismatch:h}=e.validity}c===`email`&&!h&&!d.split(`@`)[1]?.includes(`.`)&&(h=!0)}return{validity:{tooShort:p,tooLong:m,typeMismatch:h},detail:{count:f,hasMin:o,hasMax:s,invalid:p||m||h}}},zqe={datetime:Pqe,number:Rqe,string:i2,text:i2},a2=({value:e,validation:t,validity:n})=>{if(Array.isArray(t)){let r=IL(t[0]);r&&!r.test(String(e))&&(n.patternMismatch=!0)}},Bqe=({value:e,required:t,validation:n,validity:r,selected:i=!1})=>{let a=typeof e==`string`?e.trim():e,o=!i&&(a==null||a===``);return t&&o&&(r.valueMissing=!0),a2({value:a,validation:n,validity:r}),{empty:o}},Vqe=e=>{let{keyPath:t}=e,n=t.lastIndexOf(`.`);if(n===-1)return;let r=_M({...e,keyPath:t.slice(0,n)});if(r?.widget!==`code`)return;let{output_code_only:i=!1,keys:a={code:`code`,lang:`lang`}}=r;return!i&&[a.code,a.lang].includes(t.slice(n+1))?r:void 0},Hqe=({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a})=>{let{output_code_only:o=!1,keys:s={code:`code`,lang:`lang`}}=r;return e in i[a]?{skip:!0,keyPath:e,value:t}:{skip:!1,keyPath:e,value:o?t:n[`${e}.${s.code}`]}},Uqe={valueMissing:!1,tooShort:!1,tooLong:!1,rangeUnderflow:!1,rangeOverflow:!1,patternMismatch:!1,typeMismatch:!1,customError:!1,duplicateError:!1,mapKeyDuplicate:!1,mapKeyNumeric:!1},o2=e=>{let t={...e};return t.valid=!Object.values(e).some(Boolean),t},s2=(e,{count:t,required:n,min:r,max:i})=>{n&&!t?e.valueMissing=!0:typeof r==`number`&&t<r?e.rangeUnderflow=!0:typeof i==`number`&&t>i&&(e.rangeOverflow=!0)},Wqe=/(.+?)(?:\.[^.]*)?$/,Gqe=({keyPath:e,getFieldArgs:t,validity:n,validities:r,locale:i,required:a,min:o,max:s})=>{let c=e=>_M({...t,keyPath:TZ(e)})?.widget===`keyvalue`,l=e.match(Wqe)?.[1],u=c(l);if(!u&&c(e)&&(l=e,u=!0),l in r[i]||!u)return{skip:!0,keyPath:e};let d=ez(t.valueMap??{},l).filter(([e,t])=>e.trim()||t);return s2(n,{count:d.length,required:a,min:o,max:s}),{skip:!1,keyPath:l,empty:!d.length}},Kqe=/^\d+/,qqe=({keyPath:e,value:t,valueMap:n,validity:r,validities:i,locale:a,required:o,min:s,max:c})=>{if(e in i[a])return{skip:!0};let l=Array.isArray(t)&&t.length?t.length:(()=>{let t=`${e}.`,r=new Set;return Object.keys(n).forEach(e=>{if(e.startsWith(t)){let n=e.slice(t.length).match(Kqe)?.[0];n!==void 0&&r.add(n)}}),r.size})();return s2(r,{count:l,required:o,min:s,max:c}),{skip:!1,empty:!l}},Jqe=({keyPath:e,value:t,valueMap:n})=>{if(Array.isArray(t)&&t.length)return t;let r=`${e}.`;return Object.keys(n).flatMap(e=>{let t=e.startsWith(r)?e.slice(r.length):void 0;return t!==void 0&&cM(t)?[[Number(t),n[e]]]:[]}).sort(([e],[t])=>e-t).map(([,e])=>e)},c2=({fieldType:e,value:t,files:n})=>mk.includes(e)&&typeof t==`string`&&t.startsWith(`blob:`)?n[t]?.file?.name:t,Yqe=({keyPath:e,value:t,valueMap:n,fieldConfig:r,files:i,validity:a,validities:o,locale:s,required:c,min:l,max:u})=>{let{skip:d,empty:f}=qqe({keyPath:e,value:t,valueMap:n,validity:a,validities:o,locale:s,required:c,min:l,max:u}),{widget:p=`string`,pattern:m}=r;return!d&&!f&&Array.isArray(m)&&(p===`list`?!KR(r).hasSubFields:_k.includes(p))&&a2({value:Jqe({keyPath:e,value:t,valueMap:n}).map(e=>c2({fieldType:p,value:e,files:i})).join(`,`),validation:m,validity:a}),{skip:d,keyPath:e,value:t,empty:!!f}},Xqe={object:({keyPath:e,value:t,valueMap:n,validity:r,required:i})=>{let a=t===void 0?!Object.keys(n).some(t=>t.startsWith(`${e}.`)):!t;return i&&a&&(r.valueMissing=!0),{skip:!1,keyPath:e,value:t,empty:a}},keyvalue:({keyPath:e,value:t,getFieldArgs:n,validity:r,validities:i,locale:a,required:o,min:s,max:c})=>{let l=Gqe({keyPath:e,getFieldArgs:n,validity:r,validities:i,locale:a,required:o,min:s,max:c});return{skip:l.skip,keyPath:l.keyPath,value:t,empty:!!l.empty}},code:({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a})=>{let o=Hqe({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a});return{skip:o.skip,keyPath:o.keyPath,value:o.value,empty:!1}}},Zqe=(e,t)=>{Object.assign(e,{patternMismatch:!1,tooShort:!1,rangeUnderflow:!1,typeMismatch:!1}),t||(e.valueMissing=!1)},Qqe=e=>{let t=wY(e)??e.originalEntry;return t?.workflow?tY(t,e.collection):`draft`},l2=e=>!TY(e)||!QJ(e.collection).allowIncompleteDrafts||Qqe(e)!==`draft`,u2=({slug:e})=>{if(typeof e==`string`)return e;if(D(e)&&typeof e.template==`string`)return e.template},d2=e=>!!e?.includes(`{{fields._slug}}`)||!!e?.includes(`{{fields._slug | localize}}`),$qe=(e=!0)=>typeof e==`boolean`?e?[`create`,`update`]:[]:Array.isArray(e)?e:[],f2=e=>{let{slug:t,file:n}=e,r=GL(e),i=D(t)?t:{},a=u2(e),o=typeof n==`string`?[]:$qe(i.editable),s=o.includes(`update`);if(i.auto_increment===!0&&typeof n!=`string`)return{template:``,editorRequired:!1,editorValueIsSlug:!0,editable:{create:o.includes(`create`),update:s},localized:i.i18n===!0,autoIncrement:!0,hint:i.hint,pattern:i.pattern};let c=!!a?.includes(`{{fields._slug | localize}}`),l=d2(a)||o.includes(`create`),u=c||i.i18n===!0,d=a===void 0&&i.editable!==void 0&&o.includes(`create`),f=a??(d?u?`{{fields._slug | localize}}`:`{{fields._slug}}`:`{{${r}}}`),p=d2(f);return{template:f,editorRequired:p,editorValueIsSlug:!p||[`{{fields._slug}}`,`{{fields._slug | localize}}`].includes(f),editable:{create:l,update:s},localized:u,autoIncrement:!1,hint:i.hint,pattern:i.pattern}},p2=(e,t)=>{let n={...e};return Object.entries(n).forEach(([e,r])=>{typeof r==`string`&&r.startsWith(`blob:`)&&t[r]&&(n[e]=t[r].file.name.replace(/\.[^.]+$/,``))}),n},eJe=new WeakMap,tJe=e=>mA(eJe,e,()=>new Map),m2=e=>{let{collection:t,isNew:n,currentPath:r}=e;if(n&&uA(e)&&!cA(t))return XE(r)},nJe=[`date`,`publishDate`,`publish_date`],h2=e=>{let{collection:t,collectionFile:n,currentValues:r}=e,{fields:i=[],_i18n:{defaultLocale:a}}=n??t,o=i.find(({widget:e,name:t})=>e===`datetime`&&nJe.includes(t))?.name;if(o)return s0({dateFieldName:o,fields:i,content:r[a]??{},locale:a,inSlugTimeZone:!0})},g2=({currentSlugs:e},t)=>e?.[t]??e?._,_2=({draft:e})=>{let{collection:t,collectionFile:n,currentValues:r,files:i,isIndexFile:a}=e,{_i18n:{defaultLocale:o}}=n??t;return{collection:t,content:{...p2(r[o],i),_slug:g2(e,o)},locale:o,dateTimeParts:h2(e),isIndexFile:a,randomValues:tJe(e)}},v2=({draft:e,locale:t})=>{let n=g2(e,t);return!!e.slugEditor[t]&&!!n?.trim()},y2=({draft:e,locale:t,templateOnly:n=!1})=>{let{collection:r}=e;if(r._type!==`entry`)return``;let{template:i,editorRequired:a}=f2(r);return!n&&!a&&v2({draft:e,locale:t})?`{{fields._slug}}`:i},b2=({draft:e,locale:t,templateOnly:n=!1})=>{let{collection:r}=e;return r._type!==`entry`||!f2(r).autoIncrement?!1:n||!v2({draft:e,locale:t})},rJe=({draft:e,pendingEntries:t=e.pendingEntries})=>{let{collection:n,collectionName:r}=e,i=[...VL(r),...yY(r),...t.filter(e=>e.collectionName===r).map(({entry:e})=>e)].flatMap(({slug:e,locales:t})=>[e,...Object.values(t).map(e=>e.slug)]).reduce((e,t)=>{let r=lA(n,t).split(`/`).pop();return cM(r)?Math.max(e,Number(r)):e},0);return String(i+1)},iJe=({draft:e,locale:t,localizingKeyPaths:n,defaultLocaleSlug:r,templateOnly:i=!1})=>{let{isNew:a,originalLocales:o,currentValues:s,files:c}=e,l=g2(e,t);if(a||!o[t]){if(b2({draft:e,locale:t,templateOnly:i}))return r.split(`/`).pop();let a=_2({draft:e});return IY(y2({draft:e,locale:t,templateOnly:i}),{...a,locale:t,content:{...a.content,...p2(Object.fromEntries(n.map(e=>[e,s[t]?.[e]]).filter(([,e])=>e!==void 0)),c),_slug:l}})}return l},aJe=[...Tk,...Object.keys(Ok),`slug`],x2=e=>{let{template:t,localized:n}=f2(e),r=new Set;return FM(t).forEach(({content:e})=>{let{value:t,transformations:i}=IN(e),a=kk(t);(i.some(({method:e})=>e===`localize`)||n&&!aJe.includes(a))&&r.add(a)}),[...r]},S2=e=>{let{_i18n:{i18nEnabled:t,structureMap:n}}=e;return t&&!VA(n)&&e._type===`entry`&&(f2(e).localized||!!x2(e).length)},oJe=({draft:e,defaultLocaleSlug:t,templateOnly:n=!1})=>{let{collection:r,collectionFile:i,currentLocales:a}=e,{_i18n:{defaultLocale:o}}=i??r;if(i||!S2(r))return;let s=x2(r);return Object.fromEntries(Object.entries(a).map(([r])=>[r,r===o?t:iJe({draft:e,locale:r,localizingKeyPaths:s,defaultLocaleSlug:t,templateOnly:n})]))},C2=({draft:e,defaultLocaleSlug:t,localizedSlugs:n,fillSlugOptions:r})=>{if(!n)return;let{collection:i,collectionFile:a}=e,{_i18n:{canonicalSlug:{value:o}}}=a??i;return o===`{{slug}}`?t:IY(o,{...r,currentSlug:t})},w2=({draft:e,templateOnly:t=!1,pendingEntries:n=void 0})=>{let{isNew:r,collection:i,collectionFile:a,fileName:o,isIndexFile:s}=e;if(s)return{defaultLocaleSlug:Lk(i)?.name,localizedSlugs:void 0,canonicalSlug:void 0};let{_i18n:{defaultLocale:c}}=a??i,l=_2({draft:e}),u=o??(r?b2({draft:e,locale:c,templateOnly:t})?rJe({draft:e,pendingEntries:n}):IY(y2({draft:e,locale:c,templateOnly:t}),{...l,dirPath:m2(e)}):g2(e,c)),d=oJe({draft:e,defaultLocaleSlug:u,templateOnly:t});return{defaultLocaleSlug:u,localizedSlugs:d,canonicalSlug:C2({draft:e,defaultLocaleSlug:u,localizedSlugs:d,fillSlugOptions:l})}},T2=(e,{inFolder:t=!0}={})=>{let{collectionName:n,originalEntry:r}=e,i=new Set(r?CP(r,{includePrevious:!0}):[]);return[...(t?VL:BL)(n),...yY(n)].filter(e=>!Object.values(e.locales).some(({path:e})=>i.has(e)))},E2=(e,t=Object.keys(e.currentSlugs))=>{let{collection:n,originalSlugs:r}=e,i=T2(e),a=m2(e),o=a?`${a}/`:``,s=e=>{let t=e.startsWith(o)?e.slice(o.length):void 0;return t?.includes(`/`)?void 0:t};return Object.fromEntries(t.map(e=>{let t=r[e]??r._,o=a!==void 0&&(e===`_`||e===n._i18n.defaultLocale);return[e,i.flatMap(t=>e===`_`?Object.values(t.locales).map(({slug:e})=>e):[t.locales[e]?.slug]).flatMap(e=>{if(typeof e!=`string`||e===t)return[];let n=o?s(e):e;return n===void 0?[]:[n]})]}))},D2=()=>$O.current?.slug?.sanitize_replacement?.includes(` `)??!1,O2=({slug:e,required:t=!0,pattern:n,allowSpaces:r=D2(),takenSlugs:i=[],locale:a})=>{let o=e?.trim()??``;if(!o)return t?`empty`:void 0;if((r?/[/]|[^\S ]/:/[/\s]/).test(e)||o.startsWith(`.`))return`invalid`;if(Array.isArray(n)){let e=IL(n[0]);if(e&&!e.test(o))return`pattern`}if(i.includes(iN(o,{locale:a})))return`duplicate`},k2=({error:e,pattern:t})=>e===`pattern`&&t?.[1]?t[1]:X(`edit_slug_error.${e}`),sJe=({draft:e,locale:t})=>{let{collection:n,isNew:r,currentLocales:i,currentSlugs:a,originalSlugs:o,slugEditor:s}=e;return n._type!==`entry`||t!==`_`&&!i?.[t]?!1:r?!!s[t]:a[t]!==o[t]&&!cA(n)},cJe=e=>{let{collection:t,isNew:n,currentSlugs:r,slugEditor:i}=e,a={},o=!0,s,{editorRequired:c,editorValueIsSlug:l,pattern:u}=f2(t),d=!n||l,f=D2();return new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let i=r[t],l=sJe({draft:e,locale:t})?O2({slug:i,required:!n||c,pattern:u,allowSpaces:f,takenSlugs:d&&i?.trim()?(s??=E2(e))[t]:[],locale:t}):void 0,p={valueMissing:l===`empty`,patternMismatch:l===`invalid`,customError:l===`pattern`,duplicateError:l===`duplicate`,valid:!l};l&&(o=!1,p.customErrorMessage=k2({error:l,pattern:u})),a[t]={_slug:p}}),{valid:o,validities:a}},lJe=/\.\d+(?=\.|$)/,A2=({collection:e,isIndexFile:t=!1,keyPath:n,inEditorComponent:r=!1})=>e._type===`entry`&&!t&&!r&&!lJe.test(n),uJe=[`color`,`datetime`,`file`,`image`,`markdown`,`number`,`relation`,`richtext`,`select`,`string`,`text`],j2=(e,t)=>{if(e==null||typeof e==`object`)return;let n=String(e).trim();if(n){if(t===`number`){let e=Number(n);return Number.isFinite(e)?e:void 0}if(t===`color`)return n.toLowerCase();if(!(mk.includes(t)&&n.startsWith(`blob:`)))return n}},M2=({draft:e,fieldConfig:t,keyPath:n,componentName:r})=>{let{widget:i=`string`}=t;return uJe.includes(i)&&t.unique===!0&&!mM(t)&&A2({collection:e.collection,isIndexFile:e.isIndexFile,keyPath:n,inEditorComponent:!!r})},dJe=({draft:e,locale:t,keyPath:n,value:r,fieldType:i})=>{let a=j2(r,i);if(a===void 0)return!1;let{collection:o}=e;return T2(e,{inFolder:!1}).some(e=>!zk(o,e)&&j2(e.locales[t]?.content[n],i)===a)},N2=e=>{if(e.widget!==`datetime`)return[];let{auto_now:t=!1}=e;return typeof t==`boolean`?t?[`create`,`update`]:[]:Array.isArray(t)?t:[]},P2=e=>N2(e).length>0,fJe=({stages:e,isNew:t,value:n})=>e.includes(`create`)&&(t||Nj(n))||e.includes(`update`)&&!t,F2=e=>{let{isNew:t,collectionName:n,fileName:r,isIndexFile:i,currentValues:a}=e,o=new Date;Object.entries(a).forEach(([e,a])=>{let s=new Map;Object.entries(a).forEach(([c,l])=>{let u=_M({collectionName:n,fileName:r,keyPath:c,valueMap:a,isIndexFile:i});u&&fJe({stages:N2(u),isNew:t,value:l})&&(a[c]=mA(s,u,()=>eje(u,{date:o,includeSeconds:!0,locale:e})))})})},I2=({collectionName:e,keyPath:t,locale:n})=>[...BL(e),...yY(e)].reduce((e,r)=>{let i=Number(r.locales[n]?.content?.[t]);return Number.isFinite(i)&&i>e?i:e},0),pJe=(e,t=0)=>{let{collection:n,currentValues:r}=e,i=HL(n);if(!i)return;let{defaultLocale:a}=BA(e),o=I2({collectionName:n.name,keyPath:i,locale:a})+t+1;Object.values(r).forEach(e=>{e[i]=o})},L2=({fieldConfig:e,...t})=>e.widget===`number`&&e.auto_increment===!0&&A2(t),mJe=({fieldConfig:e,collection:t,keyPath:n,offset:r})=>{let{value_type:i=`int`,min:a}=e,o=Math.floor(I2({collectionName:t.name,keyPath:n,locale:t._i18n.defaultLocale})),s=typeof a==`number`&&Number.isFinite(a)?Math.ceil(a):1,c=Math.max(o+1,s)+r;return i.endsWith(`/string`)?String(c):c},hJe=(e,t=0)=>{let{isNew:n,collection:r,collectionName:i,isIndexFile:a,currentValues:o,originalValues:s}=e;if(r._type!==`entry`||a)return;let{defaultLocale:c}=r._i18n,l=o[c]??{};Object.keys(l).forEach(e=>{let u=_M({collectionName:i,keyPath:e,valueMap:l,isIndexFile:a});if(!u||!L2({fieldConfig:u,collection:r,isIndexFile:a,keyPath:e})||!(n||Nj(s[c]?.[e])))return;let d=mJe({fieldConfig:u,collection:r,keyPath:e,offset:t});Object.values(o).forEach(t=>{e in t&&(t[e]=d)})})},gJe=/\.\d+(?=\.)/g,_Je=/\.\d+(?=\.|$)/g,vJe=/^\.\d+$/,R2=({validities:e,validationMessages:t,locale:n,keyPath:r,fieldConfig:i})=>{let a=e[n][r];a&&(t[n][r]=n2({validity:a,fieldConfig:i}))},z2=e=>{let{draft:t,locale:n,valueMap:r,componentName:i,validities:a,enforceRequired:o=!0}=e,{collection:s,files:c,isIndexFile:l}=t,{keyPath:u,value:d}=e,f=gM(t,{keyPath:TZ(u),valueMap:r,componentName:i}),p=_M({...f})??$R({...f});if(!p)return;let{widget:m=`string`,i18n:h=!1,pattern:g}=p,_=mM(p)||yM(p)===`custom`&&Array.isArray(d),{min:v=0,max:y=1/0}=mSe.includes(m)?p:{},{i18nEnabled:b,defaultLocale:x}=BA(t);if(!i&&n!==x&&(!b||oR(h)||h===`duplicate`)&&!lR({fieldConfig:p,getFieldArgs:f})||!i&&P2(p)||L2({fieldConfig:p,collection:s,isIndexFile:l,keyPath:u,inEditorComponent:!!i}))return;let S=bM({fieldConfig:p,locale:n}),C=kP(f),w={...Uqe},T=!1,ee=m===`list`||_?Yqe:Xqe[m];if(ee){let e=ee({keyPath:u,value:d,valueMap:r,fieldConfig:p,getFieldArgs:f,files:c,validity:w,validities:a,locale:n,required:S,min:v,max:y});if(e.skip)return;({keyPath:u,value:d,empty:T}=e)}let E=d;if(d=c2({fieldType:m,value:d,files:c}),!([`object`,`list`,`hidden`,`compute`,`keyvalue`].includes(m)||_)){let e=m===`select`&&MAe({fieldConfig:p,value:d});({empty:T}=Bqe({value:d,required:S,validation:g,validity:w,selected:e}))}let te=zqe[m];return te&&Object.assign(w,te({fieldConfig:p,locale:n,value:d}).validity),!T&&M2({draft:t,fieldConfig:p,keyPath:u,componentName:i})&&(w.duplicateError=dJe({draft:t,locale:n,keyPath:u,value:E,fieldType:m})),!T&&C&&(w.mapKeyDuplicate=uTe({...C,valueMap:r,keyPath:u,value:d}),w.mapKeyNumeric=aTe(String(d))),Nqe({locale:n,keyPath:u,validity:w}),T&&Zqe(w,o||!!C),o2(w)},B2=e=>{let{validities:t,locale:n,keyPath:r}=e,i=z2(e),a=!0;return i&&(t[n][r]=i,i.valid||(a=!1)),a},V2=({draft:e,locale:t,keyPath:n,value:r,valueMap:i})=>{let{validities:a,validationMessages:o}=e,s=gM(e,{keyPath:n,valueMap:i}),c=_M(s)?void 0:$R(s),l=c?n.replace(QR,``):n;if(!a?.[t]?.[l])return;let u=z2({draft:e,locale:t,keyPath:n,value:r,valueMap:i,enforceRequired:l2(e),validities:{[t]:{}}});u&&(a[t][l]=u,R2({validities:a,validationMessages:o,locale:t,keyPath:l,fieldConfig:c??_M(s)}))},H2=({draft:e,locale:t,keyPath:n,value:r,valueMap:i,keyAdded:a=!0})=>{V2({draft:e,locale:t,keyPath:n,value:r,valueMap:i});let o=kP(gM(e,{keyPath:n,valueMap:i}));o&&AP({...o,valueMap:i}).forEach(a=>{a!==n&&(e.validities?.[t]?.[a]?.mapKeyDuplicate||String(i[a])===String(r))&&V2({draft:e,locale:t,keyPath:a,value:i[a],valueMap:i})}),[...n.matchAll(_Je)].forEach(({index:r})=>{let o=n.slice(0,r);if(!a&&!vJe.test(n.slice(r)))return;let s=_M(gM(e,{keyPath:o,valueMap:i}));s&&(s.widget===`list`||mM(s))&&V2({draft:e,locale:t,keyPath:o,value:i[o],valueMap:i})})},yJe=({fieldConfig:e,validateArgs:t})=>{let{validities:n,locale:r,keyPath:i}=t,a=n[r][i]?.valid??B2(t),{widget:o=`string`}=e;return o===`list`&&!KR(e).hasSubFields||mM(e)?{valid:a,validateItems:!1}:{valid:a,validateItems:!0}},U2=({getFieldArgs:e},t)=>_M({...e,keyPath:TZ(t)}),W2=(e,{listKeyPath:t,fieldConfig:n,listFieldConfig:r})=>{let{validateArgs:i,validationMessages:a}=e,{validities:o,locale:s}=i,c=yJe({fieldConfig:n,validateArgs:{...i,keyPath:t,value:``}});return t in a[s]||R2({validities:o,validationMessages:a,locale:s,keyPath:t,fieldConfig:r}),c},G2=(e,{keyPath:t,value:n,getParentField:r,viaSubKey:i})=>{let{validateArgs:a,validationMessages:o,getFieldArgs:s}=e,{validities:c,locale:l,valueMap:u}=a,d=r({...s}),f=t.replace(QR,``);if(!d||f in c[l])return!0;let p=i?t:f,m=B2({...a,keyPath:p,value:i?n:u[f]}),h=c[l][p];return i&&h&&(delete c[l][t],c[l][f]=h),R2({validities:c,validationMessages:o,locale:l,keyPath:f,fieldConfig:d}),m},bJe=({draft:e,locale:t,valueMap:n,keyPath:r,value:i,validities:a,validationMessages:o,enforceRequired:s})=>{let[c]=r.match(wZ)??[],l=c?n[`${c}__sc_component_name`]:void 0;if(c&&!l)return!0;let u=!0,d={validateArgs:{draft:e,locale:t,valueMap:n,validities:a,enforceRequired:s,componentName:l},validationMessages:o,getFieldArgs:gM(e,{keyPath:TZ(r),valueMap:n,componentName:l})};[...r.matchAll(gJe)].forEach(({index:e})=>{let t=r.slice(0,e),n=U2(d,t);n?.widget===`list`&&!W2(d,{listKeyPath:t,fieldConfig:n,listFieldConfig:n}).valid&&(u=!1)});let f=mj.test(r)?r.replace(mj,``):void 0,p=f===void 0?void 0:U2(d,f),m=U2(d,r)??(p?.widget===`list`&&!KR(p).hasSubFields?p:void 0);if(!m){let e=G2(d,{keyPath:r,value:i,getParentField:$R,viaSubKey:!0}),t=G2(d,{keyPath:r,value:i,getParentField:Vqe,viaSubKey:!1});return e&&t||(u=!1),u}if(yM(m)===`unknown`)return u;if(f!==void 0){let{valid:e,validateItems:t}=W2(d,{listKeyPath:f,fieldConfig:m,listFieldConfig:p});if(e||(u=!1),!t)return u}return B2({...d.validateArgs,keyPath:r,value:i})||(u=!1),R2({validities:a,validationMessages:o,locale:t,keyPath:r,fieldConfig:m}),u},K2=(e,{draft:t,enforceRequired:n=!0})=>{let{currentLocales:r}=t,i={},a={},o=!0;return Object.entries(t[e]).forEach(([e,s])=>{let c=Object.entries(s);r[e]?(i[e]={},a[e]={},c.forEach(([r,c])=>{bJe({draft:t,locale:e,valueMap:s,keyPath:r,value:c,validities:i,validationMessages:a,enforceRequired:n})||(o=!1)})):(i[e]=Object.fromEntries(c.map(([e])=>[e,{valid:!0}])),a[e]=Object.fromEntries(c.map(([e])=>[e,[]])))}),{valid:o,validities:i,validationMessages:a}},q2=e=>e.slice(e.lastIndexOf(`/`)+1),J2=e=>q2(dA(e)),xJe=e=>aA(e)&&S2(e),SJe=({entries:e,dirPath:t,indexFileNames:n,locale:r})=>{let i=e.find(({subPath:e})=>n.some(n=>e===`${t}/${n}`));if(i){let e=i.locales[r]?.slug;return e&&J2(e)||void 0}let a=e.find(({subPath:e})=>e===t)?.locales[r]?.slug;return a?bk(a).basename:void 0},Y2=e=>{let{name:t}=e;return NY(BL(t),lY.current.filter(({workflow:e})=>e.collectionName===t))},X2=({collection:e,dirPath:t,locale:n,entries:r})=>{let i=XE(t);if(!i||n===e._i18n.defaultLocale||!xJe(e))return i;let a=sA(e),o=a?[a]:nA,s=r??Y2(e),c=``;return i.split(`/`).map(e=>(c=c?`${c}/${e}`:e,SJe({entries:s,dirPath:c,indexFileNames:o,locale:n})??e)).join(`/`)},CJe=({basePath:e,path:t,extension:n,locale:r,omitLocale:i,structure:a})=>{if(SA(e))return`${TA({path:e,locale:r,omitLocale:i})}/${t}.${n}`;switch(a){case`multiple_folders`:return i?`${e}/${t}.${n}`:`${e}/${r}/${t}.${n}`;case`multiple_folders_i18n_root`:case`multiple_root_folders`:return i?`${e}/${t}.${n}`:`${r}/${e}/${t}.${n}`;case`multiple_files`:return i?`${e}/${t}.${n}`:`${e}/${t}.${r}.${n}`;default:return`${e}/${t}.${n}`}},Z2=({draft:e,slug:t,indexFileName:n,locale:r})=>{let{collection:i,isNew:a,originalEntry:o,currentPath:s}=e,c=XE(s??``),l=r!==i._i18n.defaultLocale&&S2(i);if(n)return pP(a?[X2({collection:i,dirPath:c,locale:r}),t,n]:[X2({collection:i,dirPath:dA(c),locale:r}),l?J2(t)||t:q2(c),n]);let u=o?.locales[r]?.slug??(l?void 0:o?.subPath),d=u?bk(u).basename:t;return pP([X2({collection:i,dirPath:c,locale:r}),d])},Q2=({draft:e,locale:t,slug:n})=>{let{originalEntry:r,originalPath:i,currentPath:a}=e;return r?.locales?.[t]?.slug===n?!uA(e)||XE(i??``)===XE(a):!1},$2=({draft:e,locale:t,slug:n})=>{let{collection:r,collectionFile:i,originalEntry:a,currentValues:o,isIndexFile:s}=e,{_i18n:{defaultLocale:c,structure:l,omitDefaultLocaleFromFilePath:u}}=i??r;if(i){let{_i18n:e,file:n}=i;return jA({_i18n:e,locale:t,path:XE(n)})}if(ck(r))return r._file.fullPath;let d=r,f=cA(d),p=uA(e);if(Q2({draft:e,locale:t,slug:n}))return a.locales[t].path;let{basePath:m,subPath:h,extension:g}=IA({collection:d,isIndexFile:s}),_=s?Lk(d)?.name:p?Z2({draft:e,slug:n,indexFileName:f,locale:t}):h?IY(h,{collection:d,locale:t,content:o[c],currentSlug:n,dateTimeParts:h2(e)}):n;return s&&_?.endsWith(`.${g}`)&&(_=_.slice(0,-g.length-1)),pP(CJe({basePath:m,path:_,extension:g,locale:t,omitLocale:u&&t===c,structure:l}).split(`/`))},wJe=/(?<path>.+?)(?:\/[^/]+)?$/,e4=(e,t)=>e.includes(`{{`)?IY(e,t):e,TJe=(e,t)=>{if(!t)return!1;let n=e.slice(e.lastIndexOf(`/`)+1);return n===t||n.startsWith(`${t}.`)},t4=(e,t)=>{if(e._type!==`entry`)return;let{subPath:n}=e._file,r=t.substring(0,t.lastIndexOf(`.`)),i=n?.includes(`/`)?n.split(`/`).at(-1):void 0;if(i&&!i.includes(`{{`)||TJe(r,cA(e)))return r.match(wJe)?.groups?.path;if(n?.includes(`/`))return r},n4=({collection:e,entryFilePath:t,internalPath:n})=>t4(e,t)??(e._type===`entry`?bk(t).dirname??n:n),EJe=({internalSubPath:e,assetFolderPath:t,fillSlugOptions:n})=>gP(e4(pP([t,e]),n)),DJe=({publicPath:e,fillSlugOptions:t})=>/^\.?$/.test(e)?e:gP(e4(e,t)),OJe=({folder:e,fillSlugOptions:t})=>{let{entryRelative:n,internalPath:r,internalSubPath:i,publicPath:a}=e;if(r===void 0||a===void 0)return{resolvedInternalPath:``,resolvedPublicPath:``};if(!n)return{resolvedInternalPath:IY(r,t),resolvedPublicPath:IY(a,t)};let{collection:o,entryFilePath:s}=t;return{resolvedInternalPath:EJe({internalSubPath:i,assetFolderPath:n4({collection:o,entryFilePath:s??``,internalPath:r}),fillSlugOptions:t}),resolvedPublicPath:DJe({publicPath:a,fillSlugOptions:t})}},r4=({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i})=>{let{collection:a,collectionFile:o,isIndexFile:s}=e,{_i18n:{defaultLocale:c}}=o??a;return OJe({folder:i,fillSlugOptions:{..._2({draft:e}),type:`media_folder`,dateTimeParts:void 0,currentSlug:r,entryFilePath:$2({draft:e,locale:t??c,slug:n??r}),isIndexFile:s}})},i4=(e,t)=>e?`${e===`/`?``:e}/${t}`:t,kJe=({draft:e,locale:t,entryFilePath:n,folderPath:r})=>{let{collection:i,isNew:a,originalEntry:o}=e,s=a?void 0:o?.locales[t]?.path;if(!s)return;let c=t4(i,s),l=t4(i,n);if(c&&l&&c!==l&&(r===l||r.startsWith(`${l}/`)))return`${c}${r.slice(l.length)}`},AJe=({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i,subfolderPath:a=``})=>{let{collectionName:o}=e,s=r4({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i});if(a){let{resolvedInternalPath:e,resolvedPublicPath:t}=s;s={...s,resolvedInternalPath:pP([e,a]),resolvedPublicPath:i4(t,a)}}let{resolvedInternalPath:c}=s,l=t??BA(e).defaultLocale,u=i.entryRelative?kJe({draft:e,locale:l,entryFilePath:$2({draft:e,locale:l,slug:n??r}),folderPath:c}):void 0,d=e=>sX(e).map(e=>e.name.normalize());return{assetFolderPaths:s,assetNamesInSameFolder:d(c),takenNamesInSameFolder:cX(c),assetNamesMovingIn:u?d(u):[],savingAssetProps:{collectionName:o,folder:i}}},jJe=async({file:e,folder:t,subfolderPath:n,replace:r,nameTemplate:i,blobURL:a,draft:o,locale:s,slug:c,defaultLocaleSlug:l,keyPath:u,content:d,changes:f,savingAssets:p,encodingEnabled:m})=>{let h=await bP(e);sRe();let{savingAssetProps:g,assetNamesInSameFolder:_,takenNamesInSameFolder:v,assetNamesMovingIn:y,assetFolderPaths:{resolvedInternalPath:b,resolvedPublicPath:x}}=AJe({draft:o,locale:s,slug:c,defaultLocaleSlug:l,folder:t,subfolderPath:n}),S=p.filter(e=>mP(e.path)===b),C=S.find(n=>n.sha===h&&(!t.entryRelative||(0,Cr.default)(n.folder,t))&&(!r||WX(n.name,e.name))),w=``;if(C)w=C.name;else{let n=h1({draft:o,item:{file:e,folder:t,replace:r,nameTemplate:i},defaultLocaleSlug:l}),s=S.map(e=>e.name.normalize()),c=r?UX(n):void 0,u=(e,t)=>e.some(e=>e.toLowerCase()===t.toLowerCase()),d=c!==void 0&&!u(s,c)&&(u(_,c)||!u(v,c));w=d?c:UX(n,{assetNamesInSameFolder:[...v,...y,...s]});let m=d?_.find(e=>e.toLowerCase()===w.toLowerCase()):void 0,x=!!m;m&&(w=m);let C=b?`${b}/${w}`:w;OB([C]),f.push({action:x?`update`:`create`,path:C,data:e}),p.push({...g,blobURL:a,name:w,path:C,sha:h,size:e.size,kind:KU(w)})}let T=i4(x,w);m&&(T=lP(T)),d[u]=d[u].replaceAll(a,()=>T)},a4=(e,t)=>{let n=e?.workflow?.branch;return!n||n===t?.workflow?.pullRequest.branch?e:e.workflow?.replacedAsset},o4=e=>{if(!e.length)return;let t=new Map(qB.current.map(e=>[e.path,e]));e.forEach(e=>{let n=t.get(e.path);t.set(e.path,{...e,workflow:{branch:e.workflow?.branch,replacedAsset:n?.workflow?n.workflow.replacedAsset:n}})}),qB.current=[...t.values()]},s4=e=>{qB.current=qB.current.flatMap(t=>t.workflow?.branch===e?t.workflow.replacedAsset??[]:t)},MJe=e=>{qB.current=qB.current.map(t=>{if(t.workflow?.branch!==e)return t;let{workflow:n,...r}=t;return r})},NJe=new Map,PJe=e=>e.startsWith(`/`),FJe=async(e,t)=>{let{name:n,fields:r=[],preview_path_date_field:i,_i18n:{defaultLocale:a},_thumbnailFieldNames:o}=e,{locales:s}=t,c=SP(s,a),{content:l,slug:u,path:d}=s[c]??{};if(!l)return;let f=o.some(e=>e.includes(`*`))?Object.keys(l):void 0,p=o.flatMap(n=>{if(PJe(n))return[{value:c0({pathTemplate:n,dateFieldName:i,fields:r,collection:e,locale:c,slug:u,entryFilePath:d,content:l,isIndexFile:zk(e,t)})}];if(n.includes(`*`)){let e=mA(NJe,n,()=>RegExp(`^${JE(n).replaceAll(`\\*`,`.+`)}$`));return f.filter(t=>e.test(t)).map(e=>({value:l[e],keyPath:e}))}return[{value:l[n],keyPath:n}]});for(let{value:e,keyPath:r}of p){let i={value:e,entry:t,collectionName:n,typedKeyPath:r,locale:c},{asset:a}=e&&bZ(i)||{},o=e&&(!a||BU(a))?await SZ({...i,thumbnail:!0}):void 0;if(o)return{src:o,owned:!!a&&o.startsWith(`blob:`)}}},IJe=(e,t,n)=>{let r=!1,i;return FJe(e,t).then(e=>{r?e?.owned&&FX(e.src):(i=e,e&&n(e.src))},()=>{}),()=>{r=!0,i?.owned&&FX(i.src)}},LJe=new WeakMap,RJe=e=>{let t=BL(e);return mA(LJe,t,()=>{let e=new Map;return t.forEach(({id:t,locales:n})=>{Object.values(n).forEach(({path:n})=>{let r=bk(n).dirname;r!==void 0&&mA(e,r,()=>new Set).add(t)})}),e})},zJe=xA(()=>qB.current,e=>{let t=new Map;return e.forEach(e=>{let n=bk(e.path).dirname;if(n===void 0)return;let r={asset:e,dirPath:n};for(let e=n;mA(t,e,()=>[]).push(r),e.includes(`/`);e=e.slice(0,e.lastIndexOf(`/`)));}),t}),BJe=e=>zJe().get(e)??[],c4=({locales:e},t)=>Object.values(e).flatMap(({path:e})=>t(e)??[]),l4=(e,t)=>c4(t,t=>t4(e,t)),u4=e=>c4(e,e=>bk(e).dirname),d4=({entry:e,collectionName:t,fileName:n,relative:r=!1})=>{let{locales:i}=e,a=YA(t);if(!a)return[];let o=zk(a,e),s=bO(Object.entries(i).flatMap(([i,{content:a}])=>Object.entries(a??{}).map(([a,s])=>{if(typeof s==`string`&&(!r||rX(s))){let c=_M({collectionName:t,fileName:n,keyPath:a,isIndexFile:o})?.widget??`string`;if(!mk.includes(c))return;let l=iX({value:s,entry:e,collectionName:t,fileName:n,locale:i});if(l&&UB(l.path).some(e=>e.collectionName===t&&e.fileName===n&&(!r||e.entryRelative)))return l}})).filter(Boolean));if(r&&HB({collectionName:t,fileName:n})?.entryRelative){let n=new Set(l4(a,e)),r=new Set(s.map(({path:e})=>e)),i=RJe(t);n.forEach(t=>{let n=n=>{let r=n;for(;r.length>t.length;){let t=i.get(r);if(t&&(t.size>1||!t.has(e.id)))return!0;r=r.slice(0,r.lastIndexOf(`/`))}return!1};BJe(t).forEach(({asset:e,dirPath:t})=>{!n(t)&&!r.has(e.path)&&(s.push(e),r.add(e.path))})})}return s},VJe=({entry:e,collectionName:t,fileName:n})=>[...new Set(d4({entry:e,collectionName:t,fileName:n,relative:!0}).map(t=>a4(t,e)).filter(Boolean))],HJe=(e,t,n)=>{let r=new Map;return t.forEach((t,i)=>{let a=l4(e,t);n[i].forEach(e=>{a.some(t=>e.path.startsWith(`${t}/`))||r.set(e.path,e)})}),[...r.values()]},UJe=(e,t,n)=>{let r=new Set(t.flatMap(u4)),i=nQ(e.map(e=>({asset:e})),{entries:[...new Set([...BL(n),...tj.current.filter(e=>u4(e).some(e=>r.has(e)))])]});return new Map(e.map((e,t)=>[e.path,i[t].map(({id:e})=>e)]))},f4=({entries:e,collectionName:t,fileName:n})=>{let r=HB({collectionName:t,fileName:n})?.entryRelative?YA(t):void 0;if(!r||ck(r))return e.map(()=>[]);let i=e.map(e=>VJe({entry:e,collectionName:t,fileName:n})),a=HJe(r,e,i);if(!a.length)return i;let o=UJe(a,e,t);return i.map((t,n)=>t.filter(t=>(o.get(t.path)??[]).every(t=>t===e[n].id)))},p4=({entry:e,collectionName:t,fileName:n})=>f4({entries:[e],collectionName:t,fileName:n})[0],m4=[`preSave`,`postSave`,`prePublish`,`postPublish`,`preUnpublish`,`postUnpublish`],WJe=[`preSave`],h4=async({type:e,entry:t,collection:n,collectionFile:r,isNew:i=!1})=>{let{login:a,name:o}=vU.account,s=a??``,c=o??``,l=n.name,u=r?.name,{_i18n:{defaultLocale:d}}=r??n,f=[...BO].filter(t=>t.name===e);if(!f.length)return;let p;try{({isMap:p}=await j0())}catch(t){console.error(`Skipping the ${e} event hooks: Immutable.js could not be loaded`,t);return}let{slug:m,locales:h}=t,g=SP(h,d),_=Object.keys(h).filter(e=>e!==g),v=d4({entry:t,collectionName:l,fileName:u});for(let n of f){let{content:r,path:a}=xP(t,{locale:g})??{},o;try{o=await n.handler({author:{login:s,name:c},entry:I0({content:r,otherLocales:_,locales:h,slug:m,path:a,isNew:i,collectionName:l,associatedAssets:v})})}catch(t){if(!e.startsWith(`post`))throw t;console.error(`The ${e} event hook failed`,t)}if(WJe.includes(e)&&p(o)){let e=o.toJS();D(e.data)&&D(e.i18n)?(h[g].content=Aj(e.data),_.forEach(t=>{D(e.i18n[t]?.data)&&(h[t].content=Aj(e.i18n[t].data))})):h[g].content=Aj(e)}}},GJe=({draft:e,locale:t,content:n,slug:r,path:i})=>{let{isNew:a,isIndexFile:o,collection:s,fields:c,originalEntry:l}=e;if(a||o||!l)return;let{preview_path:u}=s,d=r0({collection:s,fields:c});if(!u||!d)return;let{slug:f,path:p,content:m}=l.locales[t]??{};if(f===void 0||f===r)return;let{defaultLocale:h}=s._i18n,g=u0({collection:s,locale:t,slug:f,path:p,content:m,defaultContent:l.locales[h]?.content}),_=u0({collection:s,locale:t,slug:r,path:i,content:n,defaultContent:vz(e,h)});if(g===void 0||g===_)return;let v=i0(n,d);if(!v.length&&!Nj(n[d]))return;let y=v.map(e=>n[e]).filter(Jk).filter(e=>e!==g&&e!==_);a0(n,d),[...y,g].forEach((e,t)=>{n[`${d}.${t}`]=e})},KJe=({draft:e,locale:t,content:n,slug:r,path:i})=>{let{collection:a,fields:o,isIndexFile:s}=e;d0({collection:a,fields:o})&&f0({collection:a,fields:o,isIndexFile:s,locale:t,content:n,defaultContent:vz(e,a._i18n.defaultLocale),slug:r,path:i})},g4=({collection:{_file:e},path:t,fallback:n})=>e.fullPathRegEx?t.match(e.fullPathRegEx)?.groups?.subPath??n:n,qJe=({draft:e,slugs:{defaultLocaleSlug:t,localizedSlugs:n}})=>{let{collection:r,defaultLocale:i}=e;return!n||!aA(r)?void 0:C2({draft:e,defaultLocaleSlug:g4({collection:r,path:$2({draft:e,locale:i,slug:t}),fallback:t}),localizedSlugs:n,fillSlugOptions:_2({draft:e})})},JJe=async({draft:e,files:t,defaultLocaleSlug:n,changes:r,savingAssets:i,getFieldArgs:a,encodingEnabled:o,globalAssetFolder:s,locale:c,slug:l,content:u,keyPath:d,matches:f})=>{let p=_M({...a,valueMap:u,keyPath:d}),m={draft:e,defaultLocaleSlug:n,changes:r,savingAssets:i,locale:c,slug:l,keyPath:d,content:u,encodingEnabled:hk.includes(p?.widget??``)||o};await Promise.all(f.map(async([e])=>{let{file:n,folder:r=s,replace:i,subfolderPath:a,nameTemplate:o}=t[e]??{};if(!n)throw Error(`The file referenced in the "${p?.label??d}" field is no longer available. Select the file again.`);if(!r)throw Error(`There is no asset folder to save the file "${n.name}" to`);await jJe({...m,file:n,folder:r,replace:i,subfolderPath:a,nameTemplate:o,blobURL:e})}))},YJe=[`text`,...hk],XJe=({getFieldArgs:e,content:t,keyPath:n,value:r})=>{let i={...e,valueMap:t},a=_M({...i,keyPath:n}),o=n.split(`.`).slice(0,-1).join(`.`),s=a?a.widget??`string`:o&&_M({...i,keyPath:o})?.widget;return s===`code`?r:YJe.includes(String(s))?r.trimEnd():r.trim()},ZJe=async({keyPath:e,value:t,...n})=>{let{content:r}=n;if(t===void 0){delete r[e];return}if(typeof t!=`string`)return;r[e]=XJe({getFieldArgs:n.getFieldArgs,content:r,keyPath:e,value:t});let i=[...t.matchAll(vk(`g`))];i.length&&await JJe({...n,keyPath:e,matches:i})},QJe=async({path:e,canonicalSlug:t,canonicalSlugKey:n,...r})=>{let{draft:i,locale:a,slug:o,content:s}=r;t!==void 0&&(s[n]=t),GJe({draft:i,locale:a,content:s,slug:o,path:e}),await Promise.all(Object.entries(s).map(([e,t])=>ZJe({...r,keyPath:e,value:t}))),KJe({draft:i,locale:a,content:s,slug:o,path:e})},$Je=async({draft:e,slugs:t})=>{let{defaultLocaleSlug:n,localizedSlugs:r}=t,i=zB.current,{collection:a,collectionFile:o,currentLocales:s,currentValues:c,files:l}=e,{_i18n:{canonicalSlug:{key:u}}}=o??a,d=[],f=[],{encode_file_path:p=!1}=$O.current?.output??{},m=gM(e,{keyPath:``,valueMap:{}}),h=qJe({draft:e,slugs:t})??t.canonicalSlug,g={draft:e,files:l,defaultLocaleSlug:n,changes:d,savingAssets:f,getFieldArgs:m,encodingEnabled:p,globalAssetFolder:i};return{localizedEntryMap:Object.fromEntries(await Promise.all(Object.entries(c).map(async([t,i])=>{let a=oz(i),o=r?.[t]??n,c=$2({draft:e,locale:t,slug:o});return s[t]?(await QJe({...g,locale:t,slug:o,path:c,content:a,canonicalSlug:h,canonicalSlugKey:u}),[t,{slug:o,path:c,content:Sr(a)}]):[t,{path:c}]}))),changes:d,savingAssets:f}},_4=e=>({...e,locales:Object.fromEntries(Object.entries(e.locales).filter(([,{content:e}])=>e!==void 0))}),v4=e=>{if(e?.arrayIndex===void 0)return{};let{locales:t}=tj.current.find(({id:t})=>t===e.id)??e;return{arrayItem:{index:e.arrayIndex,locales:t}}},eYe=({draft:e,savingEntry:t,recreate:n=!1})=>{let{collection:r,originalEntry:i,collectionFile:a}=e,o=e.isNew||n,{_i18n:{defaultLocale:s}}=a??r,{slug:c,path:l}=t.locales[s],u=o?void 0:i?.locales[s]?.path,d=!o&&!!u&&u!==l;return{action:o?`create`:d?`move`:`update`,slug:c,path:l,previousPath:d?u:void 0,currentPath:u,...ck(r)&&!o?v4(i):{}}},tYe=({draft:e,savingEntry:t,locale:n,recreate:r=!1})=>{let{originalLocales:i,currentLocales:a,originalEntry:o}=e,s=e.isNew||r,{slug:c,path:l}=t.locales[n]??{},u=s?void 0:o?.locales[n]?.path;if(a[n]){let e=!s&&!!i[n]&&!!u&&u!==l;return{action:s||!i[n]?`create`:e?`move`:`update`,slug:c,path:l,previousPath:e?u:void 0,currentPath:u}}if(!s&&i[n])return{action:`delete`,slug:o?.locales[n]?.slug??c,path:u,currentPath:u}},y4=async({draft:e,slugs:t,recreate:n=!1,runPreSave:r=!0})=>{let{id:i,collection:a,collectionFile:o}=e,{defaultLocaleSlug:s}=t,c=o??a,{defaultLocale:l}=c._i18n,{localizedEntryMap:u,changes:d,savingAssets:f}=await $Je({draft:e,slugs:t}),{path:p}=u[l]??Object.values(u).find(({content:e})=>e)??Object.values(u)[0],m=g4({collection:c,path:p,fallback:s}),h=aA(a),g={id:i,slug:h?m:s,subPath:m,...e.isNew||e.originalEntry?.arrayIndex===void 0?{}:{arrayIndex:e.originalEntry.arrayIndex},locales:Object.fromEntries(Object.entries(u).map(([e,t])=>[e,h?{...t,slug:g4({collection:c,path:t.path,fallback:s})}:t]))};return r&&await h4({type:`preSave`,entry:g,collection:a,collectionFile:o,isNew:e.isNew}),d.push(...await D0({draft:e,config:c,_file:IA({collection:a,collectionFile:o,isIndexFile:e.isIndexFile}),entry:g,cacheDB:T0(),planChange:t=>t===void 0?eYe({draft:e,savingEntry:g,recreate:n}):tYe({draft:e,savingEntry:g,locale:t,recreate:n})})),{savingEntry:g,savingAssets:f,changes:d}},nYe=async e=>{let{collectionName:t,entry:n,changes:r,baseEntry:i}=e,a=!i,o=YA(t),s={...n,locales:Object.fromEntries(Object.entries(n.locales).map(([e,t])=>[e,{...t}]))};if(await h4({type:`preSave`,entry:s,collection:o,isNew:a}),!Object.entries(s.locales).some(([e,{content:t}])=>t!==n.locales[e].content))return e;let{defaultLocale:c}=o._i18n,l=new Set(Object.values(n.locales).map(({path:e})=>e)),u=await D0({draft:{collection:o,collectionName:t,fields:o.fields,isIndexFile:!1},config:o,_file:IA({collection:o}),entry:s,cacheDB:T0(),planChange:e=>{let t=s.locales[e??c];if(!t)return;let{slug:n,path:i}=t,{action:o}=a?{action:`create`}:r.find(e=>e.path===i);return{action:o,slug:n,path:i,currentPath:o===`create`?void 0:i}}});return{...e,entry:s,changes:[...r.filter(({path:e})=>!l.has(e)),...u]}},b4=({collection:e,collectionFile:t,isIndexFile:n=!1})=>({collection:e,collectionName:e.name,collectionFile:t,fileName:t?.name,fields:t?.fields??e.fields,isIndexFile:n}),x4=async({collection:e,collectionFile:t,entry:n,draft:r,cacheDB:i})=>{let a=t??e;return D0({draft:r,config:a,_file:IA({collection:e,collectionFile:t,isIndexFile:r.isIndexFile}),entry:n,cacheDB:i,planChange:e=>{if(e===void 0){let{slug:e,path:t}=n.locales[a._i18n.defaultLocale];return{action:`update`,slug:e,path:t,currentPath:t,...v4(n)}}let{slug:t,path:r,content:i}=n.locales[e]??{};return i?{action:`update`,slug:t,path:r,currentPath:r}:void 0}})},S4=e=>LY()||eP(e).some(t=>LY({collection:t})||sj(t,e).some(e=>LY({collection:t,collectionFile:e}))),C4=(e,t=eP(e)[0])=>t?`${XA(t)} › ${$L(t,e)}`:e.slug,w4=({content:e,listKeyPath:t,isStale:n})=>{let r=_j(e,t,{live:!0}),i=r.filter(t=>!n(t,e[t])).map(t=>e[t]);r.forEach(t=>{delete e[t]}),i.length?i.forEach((n,r)=>{e[`${t}.${r}`]=n}):e[t]=[]},T4=({draft:e,entry:t,collection:n,collectionFile:r,locale:i,content:a,fields:o})=>{let s=LY({collection:n,collectionFile:r})||S4(t);return[...o].flatMap(([r,o])=>{let c;if(s)c=[X(`readonly_reference`)];else{let t=z2({draft:e,locale:i,keyPath:r,value:a[r],valueMap:a,validities:{[i]:{}}});if(!t||t.valid)return[];c=n2({validity:t,fieldConfig:o})}let l=n.name;return[{collectionName:l,collectionLabel:n.label||l,fieldLabel:ER({config:o}),entry:t,summary:$L(n,t),locale:i,keyPath:r,messages:c}]})},E4=e=>{let t=new Set;return e.filter(({entry:e,keyPath:n})=>{let r=`${e.id}\0${n}`;return!t.has(r)&&(t.add(r),!0)})},D4=async({targets:e,cacheDB:t})=>{if(!e.length)return{changes:[],savingEntries:[]};let n=T0(t),r=e.map(({entry:e,collection:t,collectionFile:n})=>{let r=zk(t,e);return{collection:t,collectionFile:n,isIndexFile:r,entry:p0({collection:t,isIndexFile:r,entry:e})}});return{changes:(await Promise.all(r.map(({entry:e,collection:t,collectionFile:r,isIndexFile:i})=>x4({collection:t,collectionFile:r,entry:e,draft:b4({collection:t,collectionFile:r,isIndexFile:i}),cacheDB:n})))).flat(),savingEntries:r.map(({entry:e})=>e)}},rYe=e=>{let t=[],n=new Set;return e.forEach(e=>{let{url:r,asset:i}=e0(e);if(r===void 0){t.push({asset:i});return}let a=YZ(r);n.has(a)||(n.add(a),t.push({url:a}))}),t},O4=(e,t,n)=>{let r=t+n,i=e.lastIndexOf(`
|
||
`,t-1)+1,a=e.indexOf(`
|
||
`,r),o=a===-1?e.length:a;if(e.slice(i,t).trim()||e.slice(r,o).trim())return e.slice(0,t)+e.slice(r);let s=e.slice(0,i),c=e.slice(o),l=!s||/\n[ \t]*\n$/.test(s),u=!c||/^\n[ \t]*\n/.test(c);return l&&u?c?s+c.replace(/^\n[ \t]*\n/,``):s.replace(/\n[ \t]*\n$/,`
|
||
`):c?s+c.slice(1):s.replace(/\n$/,``)},iYe=[`a`,`div`,`figure`,`p`,`picture`,`span`],aYe=e=>[`img`,`source`].includes(e.localName)?!e.hasAttribute(`src`)&&!e.hasAttribute(`srcset`):!e.hasAttribute(`src`)&&!e.querySelector(`:scope > source`),oYe=e=>{let t=e;for(e.localName===`img`&&e.parentElement?.localName===`picture`&&(t=e.parentElement);;){let e=t.parentElement;if(t.remove(),!e||!iYe.includes(e.localName)||e.childElementCount||e.textContent.trim())break;t=e}},sYe=(e,t)=>{let n=MZ(e),r=VZ(n),i=new Set(r.filter(e=>GZ(e,e=>t(e)?null:void 0)));return i.size?(r.reverse().forEach(e=>{if(!i.has(e)||!aYe(e))return;let{parentElement:t}=e;e.localName===`source`&&t&&[`audio`,`video`].includes(t.localName)&&i.add(t),oYe(e)}),n.innerHTML):e},cYe=(e,t)=>[...e.matchAll(WZ)].reduceRight((n,r)=>{let{index:i,0:a,groups:{src:o=``,tag:s=void 0}={}}=r;if(s===void 0)return t(o)?O4(n,i,a.length):n;let c=KZ({value:e,tag:s,index:i,callback:e=>t(e)?null:void 0});return c?[`img`,`source`].includes(c.localName)&&aYe(c)?O4(n,i,a.length):n.slice(0,i)+NZ(c)+n.slice(i+a.length):n},e),lYe=({value:e,format:t,urls:n,paths:r=new Set,entry:i,collectionName:a,fileName:o,locale:s,keyPath:c,valueMap:l,isIndexFile:u,fieldConfig:d})=>{let f=XZ({entry:i,collectionName:a,fileName:o,locale:s,keyPath:c,valueMap:l,isIndexFile:u,fieldConfig:d}),p=e=>{if(n.has(e))return!0;if(!r.size)return!1;let t=f(e)?.asset?.path;return t!==void 0&&r.has(t)};return t===`html`?sYe(e,p):cYe(e,p)},uYe=({content:e,references:t,urls:n,paths:r=new Set})=>{let i={...e},a=new Map,o=new Map;return t.forEach(({entry:t,collection:s,collectionFile:c,locale:l,keyPath:u,fieldConfig:d})=>{let{widget:f=`string`}=d;if(!mk.includes(f)){let o=d;i[u]=lYe({value:e[u],format:kZ(o),urls:n,paths:r,entry:t,collectionName:s.name,fileName:c?.name,locale:l,keyPath:u,valueMap:e,isIndexFile:zk(s,t),fieldConfig:o}),a.set(u,d)}else if(mM(d)){let e=u.replace(mj,``);o.set(e,(o.get(e)??new Set).add(u)),a.set(e,d)}else i[u]=``,a.set(u,d)}),o.forEach((e,t)=>{w4({content:i,listKeyPath:t,isStale:t=>e.has(t)})}),{content:i,fields:a}},dYe=async e=>{let t=rYe(e),n=new Set,r=new Set;t.forEach(({url:e,asset:t})=>{t?r.add(t.path):n.add(e)});let i=await _We(t),a=[...Map.groupBy(i,({entry:e})=>e.id).values()].map(e=>{let[{entry:t,collection:i,collectionFile:a}]=e,o=b4({collection:i,collectionFile:a,isIndexFile:zk(i,t)}),s=Map.groupBy(e.filter(e=>e.collection===i&&e.collectionFile===a),({locale:e})=>e),c={},l=[];return s.forEach((e,s)=>{let u=t.locales[s],{content:d,fields:f}=uYe({content:u.content,references:e,urls:n,paths:r});c[s]={...u,content:d},l.push(...T4({draft:o,entry:t,collection:i,collectionFile:a,locale:s,content:d,fields:f}))}),{target:{entry:{...t,locales:{...t.locales,...c}},collection:i,collectionFile:a},blockers:l}});return{targets:a.map(({target:e})=>e),blockers:E4(a.flatMap(({blockers:e})=>e))}},k4=void 0,A4=e=>{let t=e.map(({path:e})=>e).join(`
|
||
`),{current:n}=tj,{current:r}=qB,{current:i}=$O;if(k4?.key===t&&k4.entries===n&&k4.assets===r&&k4.config===i)return k4.plan;let a=dYe(e);return k4={key:t,entries:n,assets:r,config:i,plan:a},a.catch(()=>{k4?.plan===a&&(k4=void 0)}),a},j4=`commit_cancelled`,M4=WO(),N4=``,P4=e=>e?.message===j4,F4=async e=>{try{return{ok:!0,cancelled:!1,result:await e(),error:void 0}}catch(e){let t=P4(e);return t||console.error(e),{ok:!1,cancelled:t,result:void 0,error:e}}},I4=()=>{let{current:e}=$O,{current:t}=XJ;if(!e||!t||!(t.isGit||t.name===`local`&&CW.localGitCommits))return;let{prompt_commit_messages:n}=e.backend;return n===!0||n===`prefix`||n===`suffix`?n:void 0},fYe=async({mode:e,defaultMessage:t})=>(M4.current?.respond(null),new Promise(n=>{let r={mode:e,defaultMessage:t,initialValue:e===!0?t:N4,respond:e=>{M4.current===r&&(M4.current=void 0),n(e)}};M4.current=r})),L4=async(e,t)=>{let n=I4();if(!n||t.userMessage!==void 0)return t;let r=CU(CH(e),t),i=await fYe({mode:n,defaultMessage:r});if(i===null)throw Error(j4);let a=i.trim();return n===!0?a===r&&(a=``):N4=a,{...t,userMessage:a}},R4,z4=0,B4=0,V4=Promise.resolve(),pYe=({entriesBefore:e,assetsBefore:t})=>{let n=new Map(e.map(e=>[e.id,e])),r=new Map(t.map(e=>[e.path,e])),i=tj.current,a=qB.current,o=new Set(i.map(({id:e})=>e)),s=new Set(a.map(({path:e})=>e));return{addedEntries:i.filter(({id:e})=>!n.has(e)),modifiedEntries:i.filter(e=>{let t=n.get(e.id);return!!t&&t!==e}),deletedEntries:e.filter(({id:e})=>!o.has(e)),addedAssets:a.filter(({path:e})=>!r.has(e)),modifiedAssets:a.filter(e=>{let t=r.get(e.path);return!!t&&t!==e}),deletedAssets:t.filter(({path:e})=>!s.has(e))}},mYe=e=>Object.values(e).some(e=>e.length>0),H4,hYe=async({fetchDirSHA:e},t,n)=>{let r=yH();if(!r||!e)return!1;try{let[i,a]=await Promise.all([H4?.rootDir===r&&H4.commit===t?H4.sha:e(t,r),e(n,r)]);return H4={rootDir:r,commit:n,sha:a},!!i&&i===a}catch(e){return console.error(`Failed to look up the root directory.`,e),!1}},gYe=async e=>{let{fetchLastCommit:t,fetchFiles:n}=e,r=OG(),i=await t();if(r()||i.hash===EG.current)return;if(await hYe(e,EG.current,i.hash)){if(r())return;await zIe(e.repository,EG.current,i.hash);return}let a=tj.current,o=qB.current;if(await n({lastCommit:i}),r())return;$G.current=EG.current;let s=pYe({entriesBefore:a,assetsBefore:o});return mYe(s)?s:void 0},U4=async({maxAge:e=0}={})=>{let t=XJ.current;if(t?.fetchLastCommit&&EG.current&&!B4&&!(e&&!R4&&Date.now()-z4<e))return R4||=(z4=Date.now(),gYe(t).finally(()=>{R4=void 0})),R4},_Ye=async e=>{let t=V4,{promise:n,resolve:r}=Promise.withResolvers();V4=n,B4+=1;try{return await t,await R4?.catch(()=>void 0),await e()}finally{--B4,r(void 0)}},vYe=e=>{let t=$N(e).find(({fileName:e,filePathMap:t})=>!e&&!!t),n=t?YA(t.collectionName):void 0;return ck(n)?n:void 0},yYe=e=>{let t=new Map;return e.forEach(e=>{let{path:n}=e,r=t.get(n);if(r){r.changes.push(e);return}let i=vYe(n);i&&t.set(n,{collection:i,changes:[e]})}),t},bYe=({collection:e,path:t,items:n,changes:r})=>{let i=n.map((e,t)=>({item:e,from:t})),a=new Set,o=({index:r,locales:i})=>{let a=r<n.length?PL({collection:e,item:n[r],index:r,path:t}):void 0;if(r>=n.length||i&&!(0,Cr.default)(a?.locales,i))throw fU(`The item at ${r} in ${t} has been changed since it was loaded.`,`save_conflict.array_item_changed`)};return r.forEach(e=>{let{action:t,data:n,arrayItem:r,arrayOrder:s}=e;if(s){s.forEach(o);let e=s.map(({index:e})=>e).sort((e,t)=>e-t),t=s.map(({index:e})=>i[e]);e.forEach((e,n)=>{i[e]=t[n]});return}if(r&&o(r),t===`delete`){r&&a.add(r.index);return}let c=JSON.parse(n);if(r){let e=i.find(({from:e})=>e===r.index);e.item=c}else i.push({item:c})}),i.filter(({from:e})=>e===void 0||!a.has(e))},xYe=({collection:e,path:t,items:n,change:r})=>{let{data:i,arrayItem:a,arrayOrder:o}=r,s=(o?.[0]??a)?.index??n.length,c=PL({collection:e,item:i?JSON.parse(i):n[s],index:s,path:t})?.locales[e._i18n.defaultLocale]?.content;return c&&ZL(c,{identifierField:e.identifier_field,useBody:!1})||void 0},SYe=async e=>{let t=yYe(e);if(!t.size)return{changes:e,arrayFileUpdates:[]};let n=T0(),r=await Promise.all([...t].map(async([e,{collection:t,changes:r}])=>{let i=NL.get(e);if(i===null)throw fU(`${e} can’t be updated, as it doesn’t contain a valid array.`,`save_conflict.array_file_invalid`,{path:e});let a=bYe({collection:t,path:e,items:i??[],changes:r}),o=await n?.get(e),s=nL.get(e),c=s?BEe(s,a.map(({from:e})=>e)):void 0;return{collection:t,path:e,slots:a,change:{action:i?`update`:`create`,slug:xYe({collection:t,path:e,items:i??[],change:r[0]})??r[0].slug,path:e,previousSha:o?.sha,data:await w0({content:a.map(({item:e})=>e),_file:t._file,valueSources:c})},sourceMap:c}}));return{changes:[...e.filter(({path:e})=>!t.has(e)),...r.map(({change:e})=>e)],arrayFileUpdates:r}},CYe=({arrayFileUpdates:e,savingEntries:t,meta:n})=>{let r=[],i=new Map;return e.forEach(({collection:e,path:a,slots:o,sourceMap:s})=>{let{defaultLocale:c}=e._i18n,l=e=>e.arrayIndex!==void 0&&e.locales[c]?.path===a,u=new Map(tj.current.filter(l).map(e=>[e.arrayIndex,e]));NL.set(a,o.map(({item:e})=>e)),s&&nL.set(a,s);let d=new Map(t.filter(l).map(e=>[e.arrayIndex,e])),f=t.filter(e=>e.arrayIndex===void 0&&e.locales[c]?.path===a),p=0;o.forEach(({item:t,from:o},s)=>{let c=o===void 0?f[p]:d.get(o),l=o===void 0?void 0:u.get(o);o===void 0&&(p+=1);let m=PL({collection:e,item:t,index:s,path:a,meta:n});m&&(m.id=c?.id??l?.id??Qc(),r.push(m),c&&i.set(c,m))})}),{entries:r,savedEntries:i}},W4=()=>{let e=vU.account;if(!e)return;let{name:t,email:n,id:r,login:i}=e;if(t&&n)return{name:t,email:n,id:r,login:i}},wYe=async({changes:e,commit:t})=>{let n=fR(XJ.current?.repository,`file-cache`);if(!n)return;let{files:r,author:i,date:a}=t,o={commitAuthor:i,commitDate:a};await Promise.all(e.map(async e=>{let{action:t,path:i,previousPath:a,data:s}=e;if(t===`delete`){await n.delete(i);return}t===`move`&&await n.delete(a);let c={sha:r[i]?.sha,size:vP(s),text:typeof s==`string`?s:void 0,meta:o};await n.set(i,c)}))},TYe=({changes:e,savedEntries:t,savedAssets:n,arrayFileEntries:r=[]})=>{let i=new Set([...t,...r].map(e=>e.id)),a=new Set(r.flatMap(e=>CP(e)));tj.current=[...tj.current.filter(e=>!i.has(e.id)&&!(e.arrayIndex!==void 0&&Object.values(e.locales).some(({path:e})=>a.has(e)))),...t.filter(e=>!r.includes(e)),...r];let o=new Set(n.map(e=>e.path));e.forEach(e=>{e.action===`move`&&e.previousPath?o.add(e.previousPath):e.action===`delete`&&o.add(e.path)}),qB.current=[...qB.current.filter(e=>!o.has(e.path)),...n]},G4=async({changes:e,savingEntries:t=[],savingAssets:n=[],options:r})=>{let{commitChanges:i,fetchLastCommit:a}=XJ.current,o=await L4(e,r);try{await U4()}catch(e){console.error(`Failed to check the repository for changes.`,e)}let s=!1,c=await _Ye(async()=>{let r=EG.current,{changes:c,arrayFileUpdates:l}=await SYe(e),u={...await i(c,o),author:W4()};CW.devModeEnabled&&(console.debug(`Commit changes:`,c),console.debug(`Commit results:`,u));let{files:d,author:f,date:p}=u,{entries:m,savedEntries:h}=CYe({arrayFileUpdates:l,savingEntries:t,meta:{commitAuthor:f,commitDate:p}}),g=t.map(e=>h.get(e)??{...e,commitAuthor:f,commitDate:p}),_=await Promise.all(n.map(async e=>{let{sha:t,file:n}=d[e.path]??{},r={...e,sha:t,blobURL:void 0,commitAuthor:f,commitDate:p};if(n)try{await yX(r,n)}catch(e){console.error(`Failed to cache the saved asset.`,e)}return r}));try{await wYe({changes:c,commit:u})}catch(e){console.error(`Failed to update the file cache.`,e)}return TYe({changes:c,savedEntries:g,savedAssets:_,arrayFileEntries:m}),$G.current=u.sha,a&&(u.parentSha===void 0||u.parentSha===r?EG.current=u.sha:s=!0),{commit:u,savedEntries:g,savedAssets:_}});return s&&U4().catch(e=>{console.error(`Failed to check the repository for changes.`,e)}),c},EYe=({assets:e,notify:t=!0})=>{e.some(({path:e})=>XB.current?.path===e)&&(XB.current=void 0),t&&(d1.current={...l1,deleted:!0,count:e.length})},K4=async(e,{extraChanges:t=[],notify:n=!0}={})=>{OB([...e,...t].map(({path:e})=>e));let{targets:r,blockers:i}=await A4(e);if(i.length)throw Error(`Cannot delete assets that entries require`,{cause:i});let{changes:a,savingEntries:o}=await D4({targets:r});await G4({changes:[...e.map(({path:e,sha:t})=>({action:`delete`,path:e,previousSha:t})),...a,...t],savingEntries:o,options:{commitType:`deleteMedia`}}),EYe({assets:e,notify:n})},DYe=({entry:e})=>{let{locales:t}=e,n=Object.entries(t),r=Object.fromEntries(n.map(([e])=>[e,!0])),i=Object.fromEntries(n.map(([e,{slug:t}])=>[e,t])),a=Object.fromEntries(n.map(([e,{content:t}])=>[e,t]));return{createdAt:Date.now(),isNew:!1,canPreview:!0,originalEntry:e,originalLocales:r,currentLocales:structuredClone(r),originalSlugs:i,currentSlugs:structuredClone(i),originalValues:a,currentValues:structuredClone(a),files:{},validities:{},validationMessages:{},expanderStates:{}}},OYe=async({draftProps:e,indexFile:t,savingEntries:n,changes:r})=>{let{collection:i,collectionFile:a}=e,{fields:o=[]}=a??i,s={...e,fields:t?.fields??o},{savingEntry:c,changes:l}=await y4({draft:s,slugs:w2({draft:s})});n.push(c),r.push(...l)},kYe=async({entry:e,savingEntries:t,changes:n})=>{let r=DYe({entry:e});await Promise.all(JY(e).map(({collection:e,collectionFile:i,isIndexFile:a})=>OYe({draftProps:{...r,collection:e,collectionName:e.name,isIndexFile:a,...i?{collectionFile:i,fileName:i.name}:{}},indexFile:a?Lk(e):void 0,savingEntries:t,changes:n})))},AYe=({_globalAssetFolder:e,newPath:t,asset:n})=>{let{publicPath:r}=UB(n.path).find(({collectionName:e})=>e!==void 0)??e??n.folder;return t.replace(n.folder.internalPath??``,r??``)},jYe=(e,t)=>n=>{let[r,i]=[[e,t],[lP(e),lP(t)],[encodeURI(e),encodeURI(t)]].find(([e])=>n===e||n.endsWith(`/${e}`))??[];return r===void 0?void 0:`${n.slice(0,-r.length)}${i}`},MYe=async({_globalAssetFolder:e,movingAssets:t,updatingEntryMap:n})=>{let r=t.map(({asset:e})=>{let t=LX(e);return t?{url:t}:{asset:e}});if(!r.length)return;let i=await rQ(r),a=[],o=new Set;if(t.forEach(({asset:t,path:n},s)=>{if(!i[s].length)return;let c=n.slice(n.lastIndexOf(`/`)+1),l=LX({...t,path:n,name:c},{pathOnly:!0,allowSpecial:!0})??(t.folder.entryRelative&&n.slice(0,-c.length)===t.path.slice(0,-t.name.length)?jYe(t.name,c):AYe({_globalAssetFolder:e,newPath:n,asset:t}));a.push({...r[s],newURL:l}),i[s].forEach(e=>o.add(e))}),!a.length)return;let s=[...o].filter(e=>S4(e));if(s.length)throw Error(X(`cannot_move_referenced_asset`,{values:{entries:s.map(e=>C4(e)).join(`, `)}}));await rQ(a,{entries:[...o].map(e=>mA(n,e.id,()=>structuredClone(e)))})},NYe=({action:e,movedAssets:t,notify:n=!0})=>{f1(({path:e})=>t.find(t=>t.asset.path===e)?.path),n&&(d1.current={...l1,moved:e===`move`,renamed:e===`rename`,count:t.length})},q4=async(e,t,{extraChanges:n=[],notify:r=!0}={})=>{OB([...t.flatMap(({asset:e,path:t})=>[e.path,t]),...n.flatMap(({path:e,previousPath:t})=>[e,...t?[t]:[]])]);let i=zB.current,a=[],o=[],s=[],c=new Map;await Promise.all(t.map(async({asset:e,path:t})=>{let n=t,r=bk(n).basename,i=e.file??await CX(e);s.push({...e,path:n,name:r}),a.push({action:`move`,path:n,previousPath:e.path,previousSha:e.sha,data:new File([await i.arrayBuffer()],r,{type:i.type})})})),await MYe({_globalAssetFolder:i,movingAssets:t,updatingEntryMap:c}),await Promise.all([...c.values()].map(e=>kYe({entry:e,savingEntries:o,changes:a}))),await G4({changes:[...a,...n],savingEntries:o,savingAssets:s,options:{commitType:`uploadMedia`}}),NYe({action:e,movedAssets:t,notify:r})},J4=e=>{let t=`${e}/`,n=RB.current.map(({internalPath:e})=>e).filter(n=>n!==void 0&&(n===e||n.startsWith(t))).map(e=>`${e}/`);return e=>e.startsWith(t)&&!n.some(t=>e.startsWith(t))},Y4=e=>{let t=J4(e);return JB.current.filter(({path:e})=>t(e))},X4=e=>{let t=J4(e);return nV.current.filter(({path:e})=>t(e))},PYe=async e=>{let t=`${e}/.gitkeep`;OB([t]);let{commit:n}=await G4({changes:[{action:`create`,path:t,data:new File([],`.gitkeep`)}],options:{commitType:`uploadMedia`}}),r={type:`config`,path:t,name:`.gitkeep`,sha:n.files[t]?.sha??``,size:0,text:``};nV.current=[...nV.current,r],d1.current={...l1,folderCreated:!0}},FYe=async({dirPath:e,newDirPath:t})=>{let n=X4(e),r=n=>`${t}${n.slice(e.length)}`;await q4(`move`,Y4(e).map(e=>({asset:e,path:r(e.path)})),{extraChanges:n.map(({path:e,sha:t,name:n,text:i})=>({action:`move`,path:r(e),previousPath:e,previousSha:t,data:new File([i??``],n)})),notify:!1}),nV.current=nV.current.map(e=>n.includes(e)?{...e,path:r(e.path)}:e),VV.current?.path===e&&(VV.current={name:bk(t).basename,path:t}),d1.current={...l1,folderRenamed:!0}},IYe=async e=>{let t=X4(e);await K4(Y4(e),{extraChanges:t.map(({path:e,sha:t})=>({action:`delete`,path:e,previousSha:t})),notify:!1}),nV.current=nV.current.filter(e=>!t.includes(e)),VV.current?.path===e&&(VV.current=void 0),d1.current={...l1,folderDeleted:!0}},LYe=V(`<!> <!> <!>`,1);function Z4(e,t){k(t,!0);let n=Y(t,`open`,15,!1),r=M(!1),i=M(!1),a=async e=>{N(r,!0);let{ok:n,cancelled:a}=await F4(()=>PYe(pP([t.dirPath,e])));N(r,!1),!n&&!a&&N(i,!0)};var o=LYe(),s=F(o);{let e=j(()=>X(`new_folder`)),r=j(()=>X(`new_folder_create`)),i=j(()=>X(`new_folder_description`,{values:{folder:`/${t.dirPath}`}}));pH(s,{get title(){return B(e)},get okLabel(){return B(r)},get description(){return B(i)},get takenNames(){return t.takenNames},onSubmit:e=>{a(e)},get open(){return n()},set open(e){n(e)}})}var c=L(s,2);Pu(c,{get show(){return B(r)},duration:0,children:(e,t)=>{Vc(e,{status:`info`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`creating_folder`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(c,2),{get show(){return B(i)},set show(e){N(i,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`creating_folder_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,o),A()}var Q4=e=>e.match(qke)?.[1],RYe=e=>!!wR(e)?.length,zYe=(e,t)=>{if(typeof t!=`string`||!t)return;if(t===`_summary`||SR.includes(t)||CR(t))return{};let n=_M({collectionName:e.name,keyPath:t});if(n)return{fieldConfig:n};let{i18nEnabled:r,canonicalSlug:i}=e._i18n;return r&&t===i.key?{}:void 0},BYe=(e,t)=>{let{i18nEnabled:n,canonicalSlug:r}=e._i18n,i=[`_summary`,`_manual`,GL(e)];return n&&i.push(r.key),[{key:`_summary`},...t.filter(e=>!i.includes(e)).map(e=>({key:e}))]},VYe=(e,t)=>{if(t===`_summary`){let{summary:t}=e,n=GL(e);return TR({config:t?void 0:_M({collectionName:e.name,keyPath:n}),option:`label`})||X(`sort_keys._summary`)}if(CR(t)){let n=Q4(t);return n?Kke.includes(n)?X(`table_column_keys.${n}`):AR({collection:e,key:n}):t}return AR({collection:e,key:t})},$4=(e,t)=>{let n=new Set;return t.flatMap(({key:t,label:r})=>{let i=zYe(e,t);return!i||n.has(t)?[]:(n.add(t),[{key:t,label:r||VYe(e,t),...i}])})},HYe=({collection:e,sortKeys:t})=>{let n=wR(e),r=n?$4(e,n):[];return r.length?r:$4(e,BYe(e,t))},UYe=new WeakMap,WYe=({collection:e,entry:t,column:n})=>{let{fieldConfig:r}=n,i=CR(n.key)?Q4(n.key):void 0,a=i&&SR.includes(i)?i:n.key;if(a===`_summary`)return{type:`text`,value:$L(e,t,{useTemplate:!0})};if(CR(a))return{type:`text`,value:$L(e,t,{useTemplate:!0,template:a,useIndexFileLabel:!1})};if(a===`slug`)return{type:`text`,value:t.slug};if(a===`commit_author`)return{type:`text`,value:XL(t.commitAuthor)||``};if(a===`commit_date`){let{commitDate:e}=t;return{type:`text`,value:e?BN(e,Fc.current):``}}let{defaultLocale:o}=e._i18n,s=SP(t.locales,o),c=t.locales[s]?.content??{};if(r?.widget===`boolean`)return{type:`boolean`,value:c[a]===!0};let l=()=>({type:`text`,value:RR({collectionName:e.name,valueMap:c,keyPath:a,locale:s,plainText:!0,isIndexFile:zk(e,t)})});if(r?.widget===`relation`){let{current:e}=tj,n=`${a}\0${s}`,r=mA(UYe,t,()=>new Map),i=r.get(n);if(i&&i.entries===e)return i.value;let o=l();return r.set(n,{entries:e,value:o}),o}return l()},GYe=({collection:e,column:{key:t},sortKeys:n})=>{if(t===`_summary`&&!n.includes(t)){let t=GL(e);return n.includes(t)?t:void 0}let r=CR(t)?Q4(t):t;return r&&n.includes(r)?r:void 0},e3=WO(),t3=WO({}),n3=e=>[...e&&RYe(e)?[`table`]:[],`list`,...e?._thumbnailFieldNames.length?[`grid`]:[]],r3=(e,t)=>e&&t.includes(e)?e:t[0],KYe=({type:e,types:t,isLargeScreen:n,reordering:r=!1})=>{if(r)return`list`;let i=r3(e,t);return i===`table`&&!n?`list`:i},i3={current:void 0},qYe=({sort:e,filter:t,filters:n,group:r})=>JSON.stringify([e,t,n,r]),JYe=async({repository:e})=>{await bR(e,`contents-view`,e3),JO(()=>{let e=t3.current;co(()=>{let{name:t}=WA.current??{},n=i3.current,r=n&&n.collectionName===t?n.view:e,i=e3.current?.[t??``]??{};t&&!(0,Cr.default)(r,i)&&(e3.current={...e3.current,[t]:r})})})},YYe=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`currentView`,`types`]),XYe=V(`<div role="none" class="wrapper svelte-8v3idr"><!></div>`),ZYe={hash:`svelte-8v3idr`,code:`.wrapper.svelte-8v3idr {display:contents;.select-button-group button {border-radius:var(--sui-button-medium-border-radius) !important;}}`};function a3(e,t){k(t,!0),q(e,ZYe);let n=Y(t,`disabled`,3,!1),r=Y(t,`currentView`,7),i=Y(t,`types`,19,()=>[`list`,`grid`]),a=gs(t,YYe),o={table:`table`,list:`format_list_bulleted`,grid:`grid_view`},s=j(()=>r3(r().current.type,i())),c=j(()=>B(s)===`grid`),l=j(()=>i().includes(`list`)&&i().includes(`grid`)),u=e=>{r().current={...r().current,type:e}};var d=XYe(),f=P(d),p=e=>{var t=U(),r=F(t),c=e=>{{let t=j(()=>X(`switch_view`));Dl(e,_s({get disabled(){return n()},get ariaLabel(){return B(t)}},()=>a,{children:(e,t)=>{var r=U();Ro(F(r),16,i,e=>e,(e,t)=>{{let r=e=>{Lc(e,{get name(){return o[t]}})},i=j(()=>B(s)===t),a=j(()=>X(`${t}_view`));Ol(e,{get disabled(){return n()},get selected(){return B(i)},variant:`ghost`,iconic:!0,get"aria-label"(){return B(a)},onSelect:()=>{u(t)},startIcon:r,$$slots:{startIcon:!0}})}}),W(e,r)},$$slots:{default:!0}}))}};K(r,e=>{i().length>1&&e(c)}),W(e,t)},m=e=>{{let t=e=>{{let t=j(()=>B(c)?o.list:o.grid);Lc(e,{get name(){return B(t)}})}},r=j(()=>X(B(c)?`switch_to_list_view`:`switch_to_grid_view`));ll(e,{get disabled(){return n()},variant:`ghost`,iconic:!0,get"aria-label"(){return B(r)},onclick:()=>{u(B(c)?`list`:`grid`)},startIcon:t,$$slots:{startIcon:!0}})}};K(f,e=>{sW.isLargeScreen?e(p):B(l)&&e(m,1)}),O(d),W(e,d),A()}var o3={count:0,name:``,showDialog:!1,resolve:()=>{}},s3=na({...o3}),c3=async({files:e,listedAssets:t})=>{let n=lX(e,t),r=n.length;if(!r)return!1;let{promise:i,resolve:a}=Promise.withResolvers();Object.assign(s3,{count:r,name:n[0].name,showDialog:!0,resolve:a});let o=await i;return Object.assign(s3,{...o3}),o},QYe=/(?<=.)\/(?=\/|$)/g,l3=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i})=>{let a=HB({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i}),o=t?HB({collectionName:e,fileName:t}):void 0,s=HB({collectionName:e}),c=o??s,l=zB.current,u={field:{folder:a,enabled:a!==void 0},entry:{folder:c,enabled:!!c&&(c.entryRelative||c.hasTemplateTags)},file:{folder:o,enabled:!!o&&!o.entryRelative&&!o.hasTemplateTags},collection:{folder:s,enabled:!!s&&!s.entryRelative&&!s.hasTemplateTags},global:{folder:l,enabled:l!==void 0}};return RB.current.forEach(e=>{e.isAssetCollection&&e.collectionName&&(u[e.collectionName]={folder:e,enabled:!0})}),u},u3=e=>Object.values(e).find(({enabled:e})=>e)?.folder,d3=e=>u3(l3(e)),$Ye=({entry:e,folder:t,locale:n})=>{let{collectionName:r,entryRelative:i,internalPath:a,internalSubPath:o}=t??{};if(!i)return a===void 0?void 0:$Y({internalPath:a,collectionName:r,entry:e,locale:n})??a.replaceAll(wk,`-`);let s=o||void 0;return e?pP([wP(e,n),s]):s?`${a}/${s}/-`:`${a}/-`},eXe=({draft:e,blobURL:t})=>{let n=e.files[t];if(n)return h1({draft:e,item:n,defaultLocaleSlug:n.nameTemplate?w2({draft:e}).defaultLocaleSlug:``})},tXe=({draft:e,blobURL:t,fileName:n})=>{let{folder:r,subfolderPath:i}=e.files[t]??{},{entryRelative:a,publicPath:o=``}=r??{},s=pP([i,n]);if(!r||!a&&!IM(o))return i4(o,s);let{defaultLocaleSlug:c}=w2({draft:e}),{resolvedPublicPath:l}=r4({draft:e,defaultLocaleSlug:c,folder:r});return i4(l.replace(QYe,``),s)},nXe=({draft:e,value:t,unsavedFileName:n})=>{if(!t||typeof t!=`string`)return``;if(n)return tXe({draft:e,blobURL:t,fileName:nP(n.normalize())});if(t.startsWith(`blob:`))return``;let r=nP(t);if(QE(r)){let e=new URL(r);if(e.search)return e.search=``,`${e}…`}return r},f3=({path:e,folderPath:t})=>t!==void 0&&(t===``||e===t||`${e}/-`===t||e.startsWith(`${t}/`)),rXe=({asset:e,folder:t,folderPath:n})=>t===void 0?!1:t.entryRelative?f3({path:mP(e.path),folderPath:n}):e.folder?.internalPath===t.internalPath&&!e.folder?.entryRelative&&f3({path:e.path,folderPath:n}),iXe=({savedAssets:e,unsavedAssets:t,slugificationEnabled:n})=>{if(!t.length)return{savedAssets:e,unsavedAssets:t};let r=new Map,i=new Set;e.forEach(({path:e,name:t})=>{mA(r,mP(e),()=>[]).push(t.normalize())});let a=t.map(e=>{let{name:t,path:a,replace:o}=e,s=mP(a),c=r.get(s)??[],l=UX(t,{slugificationEnabled:n,assetNamesInSameFolder:o?[]:c}),u=s?`${s}/${l}`:l;return o?i.add(u):(c.push(l.normalize()),r.set(s,c)),u===a?e:{...e,name:l,path:u}});return{savedAssets:i.size?e.filter(({path:e})=>!i.has(e)):e,unsavedAssets:a}},aXe=({kind:e,accept:t,folder:n,folderPath:r,unsavedAssets:i,uncheckedFiles:a=[],slugificationEnabled:o=!1})=>{let s=e=>rXe({asset:e,folder:n,folderPath:r}),c=iXe({savedAssets:qB.current.filter(s),unsavedAssets:i.filter(s),slugificationEnabled:o});return[...c.unsavedAssets,...c.savedAssets].filter(n=>!!n.file&&a.includes(n.file)||(!e||e===n.kind)&&zV({name:n.name},t)).sort((e,t)=>e.name.localeCompare(t.name)).sort((e,t)=>Number(!!t.unsaved)-Number(!!e.unsaved))},oXe=({sha:e,folder:t,unsavedAssets:n})=>n.some(n=>!!n.file&&n.sha===e&&(0,Cr.default)(n.folder,t)),p3=async({draft:e,file:t,folder:n,subfolderPath:r=``,replace:i=!1})=>{let a=await bP(t),o;return await Promise.all(Object.entries(e.files??{}).map(async([e,s])=>{!o&&await bP(s.file)===a&&(!n?.entryRelative||(0,Cr.default)(s.folder,n))&&(s.subfolderPath??``)===r&&(!i||s.replace&&WX(s.file.name,t.name))&&(o=e)})),o},m3=async({file:e,name:t=e.name,blobURL:n,folder:r,targetFolderPath:i,subfolderPath:a,replace:o})=>{let{size:s}=e;return{unsaved:!0,replace:!!o,file:e,blobURL:n??await _X(e),name:t,path:pP([i,a,t]),sha:await bP(e),size:s,kind:KU(t),folder:r}},h3=async({draft:e,targetFolderPath:t})=>{let n=Object.entries(e.files),r=n.some(([,{nameTemplate:e}])=>e)?w2({draft:e}).defaultLocaleSlug:``;return Promise.all(n.map(async([n,i])=>{let{file:a,folder:o,replace:s,subfolderPath:c}=i;return m3({file:a,name:h1({draft:e,item:i,defaultLocaleSlug:r}),blobURL:n,folder:o,targetFolderPath:t,subfolderPath:c,replace:s})}))},sXe=(e,t,n)=>{let r=qB.current;if(!t?.entryRelative)return r;let{originalEntry:i,defaultLocale:a,collection:o}=e,s=((n?i?.locales[n]:void 0)??i?.locales[a])?.path;if(!s)return[];let c=pP([n4({collection:o,entryFilePath:s,internalPath:t.internalPath}),t.internalSubPath]);return r.filter(e=>e.path.startsWith(`${c}/`))},g3=e=>({value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:void 0,mismatchedFileName:e.name}),_3=async({draft:e,resource:t,libraryConfig:n,accept:r,locale:i})=>{let{url:a,folderPath:o,credit:s,replace:c=!1,subfolderPath:l}=t,{asset:u,file:d}=t,f=``;if(d){let{folder:a}=t;if(!a)return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:void 0};let o;try{o=await p3({draft:e,file:d,folder:a,subfolderPath:l,replace:c})}catch{return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:d.name}}if(o){if(!zV(d,r))return g3(d);f=o}else{let{file:o,oversized:s,invalid:p}=await g1(d,n??{});if(d=o,p)return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:d.name};if(!zV(d,r))return g3(t.file);let m=await bP(d),{name:h}=d,g=[...sXe(e,a,i),...await h3({draft:e})].find(e=>e.sha===m&&(0,Cr.default)(e.folder,a)&&(!c||(!e.unsaved||e.replace)&&WX(e.name,h)));if(g)u=g,d=void 0;else if(s)return{value:void 0,credit:``,oversizedFileName:d.name,invalidFileName:void 0};else{f=await _X(d);let t=c?void 0:n?.filename_template;e.files[f]={file:d,folder:a,replace:c,subfolderPath:l,...t?{nameTemplate:p1(t,{slugificationEnabled:n.slugify_filename})}:{}}}}}return u&&(u.unsaved?u.blobURL?f=u.blobURL:u.file&&(f=await p3({draft:e,file:u.file,folder:u.folder})):f=LX(u,{pathOnly:!0,allowSpecial:!0,entry:e.originalEntry,locale:i})),a&&!d&&!u&&(f=a),o&&(f=o),{value:f,credit:s?_t(s,Qk):``,oversizedFileName:void 0,invalidFileName:void 0}},v3=({getDraft:e,getFolder:t,getLocale:n,getKind:r,getAccept:i,getSlugificationEnabled:a,getDroppedAssets:o=()=>[]})=>{let s=M(na([])),c=j(()=>$Ye({entry:e()?.originalEntry,folder:t(),locale:n()})),l=j(()=>aXe({kind:r(),accept:i(),folder:t(),folderPath:B(c),unsavedAssets:B(s),uncheckedFiles:o().map(({file:e})=>e),slugificationEnabled:a()}));return XO(async()=>{let t=e(),n=[...o()];return[...t?await h3({draft:t,targetFolderPath:B(c)}):[],...n]},e=>{N(s,e,!0)}),{get targetFolderPath(){return B(c)},get listedAssets(){return B(l)},get unsavedAssets(){return B(s)},reset:()=>{N(s,[],!0)}}},y3=(e,t=jr,n)=>{let r=Ei(()=>Nr(n?.(),!1));{let n=e=>{Lc(e,{name:`create_new_folder`})},i=j(()=>X(`new_folder`));ll(e,{variant:`ghost`,iconic:!0,get disabled(){return B(r)},get"aria-label"(){return B(i)},get onclick(){return t()},startIcon:n,$$slots:{startIcon:!0}})}},b3=V(`<!> <!>`,1),x3=V(`<!> <!> <!>`,1),cXe=V(`<div role="status" class="selected-folder svelte-5b1zbe" dir="auto"><!></div>`),lXe=V(`<a class="service-link svelte-5b1zbe"> </a>`),uXe=V(`<div role="none" class="filter-tools svelte-5b1zbe"><!></div>`),dXe=V(`<div role="none"> </div> <!>`,1),fXe=V(`<div role="none" class="wrapper svelte-5b1zbe"><div role="none" class="nav svelte-5b1zbe"><!> <!></div> <div role="none" class="content-pane svelte-5b1zbe" data-focus-scope=""><!> <!> <!></div></div>`),pXe={hash:`svelte-5b1zbe`,code:`.wrapper.svelte-5b1zbe {display:flex;gap:16px;height:60dvh;max-height:800px;--tile-padding: 4px;
|
||
|
||
@media (width < 768px) {flex-direction:column;overflow:hidden;height:72dvh;
|
||
}.nav:where(.svelte-5b1zbe) {flex:none;display:flex;gap:4px;
|
||
|
||
@media (width < 768px) {flex-direction:column;
|
||
}}.listbox {flex:none;background-color:transparent;.option button .icon:not(.check) {display:block;}}.content-pane:where(.svelte-5b1zbe) {overflow:auto;flex:auto;}}.service-link.svelte-5b1zbe,
|
||
.selected-folder.svelte-5b1zbe {font-size:var(--sui-font-size-small);}.selected-folder.svelte-5b1zbe {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.filter-tools.svelte-5b1zbe {display:flex;gap:8px;}`};function S3(e,t){let n=Co();k(t,!0),q(e,pXe);let r=e=>{var n=x3(),r=F(n),i=e=>{var n=b3(),r=F(n),i=e=>{a3(e,{get currentView(){return C},"aria-controls":`select-assets-grid`})};K(r,e=>{s$.current&&e(i)});var a=L(r,2),o=e=>{{let n=j(()=>!B(ae)),r=j(()=>B(x).some(e=>e.file)),i=j(()=>X(`assets_dialog.search_for_${t.kind??`file`}`));vu(e,{dir:`auto`,get flex(){return sW.isSmallScreen},get debounce(){return B(n)},get disabled(){return B(r)},get ariaLabel(){return B(i)},get value(){return B(h)},set value(e){N(h,e,!0)}})}};K(a,e=>{c()||e(o)}),W(e,n)};K(r,e=>{(B(ae)||B(be)&&B(ie)!==`cloudinary`||B(xe)&&B(ie)!==`picsum`)&&e(i)});var a=L(r,2),o=e=>{y3(e,()=>()=>{N(v,!0)},()=>GB.current||B(pe))},s=e=>{y3(e,()=>()=>{B(S)?.showNewFolderDialog()})},l=j(()=>B(be)&&B(S)?.canCreateFolder());K(a,e=>{B(ue)?e(o):B(l)&&e(s,1)});var u=L(a,2),d=e=>{{let t=e=>{Lc(e,{name:`cloud_upload`})},n=j(()=>X(`upload`));ll(e,{variant:`primary`,get label(){return B(n)},get disabled(){return B(pe)},onclick:()=>{B(b)?.open()},startIcon:t,$$slots:{startIcon:!0}})}};K(u,e=>{!c()&&(B(ae)||B(be)&&B(ie)!==`cloudinary`)&&e(d)}),W(e,n)},i=Y(t,`open`,15,!1),a=Y(t,`multiple`,3,!1),o=Y(t,`accept`,19,()=>t.kind===`image`?hV.join(`,`):void 0),s=Y(t,`canEnterURL`,3,!0),c=Y(t,`selectFolder`,3,!1),l=Y(t,`draft`,3,void 0),u=Y(t,`locale`,3,void 0),d=Y(t,`onSelect`,3,void 0),f=Y(t,`onClose`,3,void 0),p=Y(t,`pendingFiles`,31,()=>na([])),m=M(``),h=M(``),g=M(``),_=M(na([])),v=M(!1),y=M(na([])),b=M(void 0),x=M(na([])),S=M(void 0),C=s$,w=j(()=>c()?X(`assets_dialog.title.folder`):t.kind===`image`?X(`assets_dialog.title.image`):X(`assets_dialog.title.file`)),T=j(()=>L1(B(h))),ee=j(()=>uV({fieldConfig:t.fieldConfig})!==!1&&Object.values(t.assetLibraryFolderMap).some(e=>o1(e,c()))),E=j(()=>s()&&!c()),te=j(()=>c()?[]:t.enabledCloudServiceEntries),ne=j(()=>tKe({fieldConfig:t.fieldConfig,selectFolder:c(),isDefaultLibraryEnabled:B(ee)})),re=j(()=>[...B(te),...B(ne)].sort(a1)),ie=j(()=>eKe({assetLibraryFolderMap:t.assetLibraryFolderMap,isDefaultLibraryEnabled:B(ee),selectFolder:c(),hasPendingFiles:co(()=>!!p().length),cloudServiceEntries:B(te),externalServiceEntries:B(re)})),ae=j(()=>B(ie).startsWith(`default-`)),oe=j(()=>{if(!B(ae))return;let e=B(ie).replace(`default-`,``),{folder:n}=t.assetLibraryFolderMap[e];return n}),se=v3({getDraft:()=>l(),getFolder:()=>B(oe),getLocale:()=>u(),getKind:()=>t.kind,getAccept:()=>o(),getSlugificationEnabled:()=>FV({fieldConfig:t.fieldConfig}).config.slugify_filename,getDroppedAssets:()=>B(y)}),ce=j(()=>se.targetFolderPath),le=j(()=>se.listedAssets),ue=j(()=>WV(B(oe))&&B(ce)!==void 0&&!B(T)),de=j(()=>pP([B(ce),B(g)])),fe=j(()=>B(ae)&&EB(B(de))),pe=j(()=>B(fe)||!!B(oe)?.readonly),me=j(()=>B(le).filter(({path:e})=>mP(e)===B(de))),he=j(()=>B(ue)?B(me):B(le)),ge=j(()=>B(ue)?nH({dirPath:B(de),assets:B(le)}):[]),_e=j(()=>ZV({subfolders:B(ge),fileNames:B(he).map(({name:e})=>e),dirPath:B(de)})),ve=j(()=>B(oe)?.label||X(`assets_dialog.folder.${B(ie).replace(`default-`,``)}`)),ye=j(()=>B(ne).some(([e,{authType:t}])=>e===B(ie)&&(t===`none`||!!CW.apiKeys?.[B(ie)]))),be=j(()=>B(te).map(([e])=>e).includes(B(ie))),xe=j(()=>B(ne).map(([e])=>e).includes(B(ie))),Se=j(()=>nKe({selectFolder:c(),browsingSubfolders:B(ue),folder:B(oe),basePath:B(ce),subfolderPath:B(g),selectedSubfolderPaths:B(_)})),Ce=({path:e},t)=>{let n=B(_).filter(t=>t!==e);N(_,t?[...a()?n:[],e]:n,!0)},we=e=>{N(g,e,!0),a()||N(_,[],!0)},Te=async(e,t)=>{let n=await bP(e),r=B(oe);if(oXe({sha:n,folder:r,unsavedAssets:se.unsavedAssets}))return;let i=await m3({file:e,folder:r,targetFolderPath:B(ce),subfolderPath:B(g),replace:t});return B(y).push(i),i},Ee=async e=>{if(B(pe))return;let t=await c3({files:e,listedAssets:B(me)});t!==void 0&&N(x,(await Promise.all(e.map(e=>Te(e,t)))).filter(e=>!!e).map(e=>({asset:e,replace:t})),!0)},De=()=>{N(m,``),N(h,``),N(g,``),N(_,[],!0),B(y).forEach(e=>FX(e.blobURL)),N(y,[],!0),se.reset(),N(x,[],!0)},Oe=()=>{if(c()){if(!B(Se).length)return;d()?.(B(Se).map(e=>({folderPath:e})))}else B(x).length&&(B(S)?.trackDownloads(),d()?.(iKe({resources:B(x),targetFolderPath:B(ce)})))};R(()=>{$Q.current||i(!1)}),R(()=>{B(S)&&B(be)&&p().length&&(B(S).uploadFiles(p()),p([]))});var ke=x3(),Ae=F(ke);{let e=e=>{var t=U(),n=F(t),i=e=>{r(e)};K(n,e=>{sW.isSmallScreen||e(i)}),W(e,t)},s=e=>{var t=b3(),n=F(t),r=e=>{var t=cXe(),n=P(t),r=e=>{var t=H();z(e=>G(t,e),[()=>X(`assets_dialog.selected_folder`,{values:{path:B(Se)[0]}})]),W(e,t)},i=e=>{var t=H();z(e=>G(t,e),[()=>X(`assets_dialog.selected_folders`,{values:{count:B(Se).length}})]),W(e,t)};K(n,e=>{B(Se).length===1?e(r):e(i,-1)}),O(t),z(()=>t.dir=t.dir),W(e,t)};K(n,e=>{B(Se).length&&e(r)});var i=L(n,2),a=e=>{let t=j(()=>r1[B(ie)]);var n=U(),r=F(n),i=e=>{var n=lXe(),r=I(n,!0);z(e=>{J(n,`href`,B(t).serviceURL),G(r,e)},[()=>X(`prefs.media.stock_photos.credit`,{values:{service:B(t).serviceLabel}})]),W(e,n)};K(r,e=>{B(t).showServiceLink&&e(i)}),W(e,n)};K(i,e=>{B(ye)&&e(a)}),W(e,t)},l=j(()=>c()?X(`select`):X(`insert`)),u=j(()=>c()?!B(Se).length:!B(x).length);Pl(Ae,{get title(){return B(w)},size:`x-large`,get okLabel(){return B(l)},get okDisabled(){return B(u)},focusInput:!1,onOk:Oe,onClose:()=>{De(),f()?.()},get open(){return i()},set open(e){i(e)},headerExtra:e,footerExtra:s,children:(e,s)=>{var l=fXe(),u=P(l),d=P(u);JKe(d,{get libraryName(){return B(ie)},get assetLibraryFolderMap(){return t.assetLibraryFolderMap},get showRepository(){return B(ee)},get selectFolder(){return c()},get cloudServiceEntries(){return B(te)},get showURLInput(){return B(E)},get stockAssetProviderEntries(){return B(ne)},get controlsId(){return`${n}-content-pane`},onChange:e=>{N(ie,e),N(g,``),N(_,[],!0),N(x,c1({libraryName:B(ie),enteredURL:B(m)}),!0)}});var f=L(d,2),p=e=>{var t=uXe(),n=P(t);r(n),O(t),W(e,t)};K(f,e=>{sW.isSmallScreen&&e(p)}),O(u);var h=L(u,2),v=P(h),y=e=>{{let n=j(()=>c()?[]:B(he)),r=j(()=>B(ue)?B(de):B(oe).internalPath),i=j(()=>B(ue)?B(g):``),s=j(()=>c()?Ce:void 0);GKe(e,{get accept(){return o()},get multiple(){return a()},get kind(){return t.kind},get selectFolder(){return c()},get uploadDisabled(){return B(pe)},get assets(){return B(n)},get searchTerms(){return B(T)},get basePath(){return B(r)},get folderLabel(){return B(ve)},get subfolderPath(){return B(i)},get subfolders(){return B(ge)},onDrop:({files:e})=>{Ee(e)},get selectedSubfolderPaths(){return B(_)},get onSelectSubfolder(){return B(s)},onNavigate:we,onOpenSubfolder:({path:e})=>{we(GV(e,B(ce)))},get selectedResources(){return B(x)},set selectedResources(e){N(x,e,!0)}})}};K(v,e=>{B(ae)&&B(oe)&&e(y)});var b=L(v,2),C=e=>{DO(e,{children:(e,n)=>{var r=dXe(),i=F(r),a=I(i,!0);Gl(L(i,2),{dir:`ltr`,flex:!0,oninput:()=>{N(x,c1({libraryName:B(ie),enteredURL:B(m)}),!0)},get value(){return B(m)},set value(e){N(m,e,!0)}}),z(e=>G(a,e),[()=>t.kind===`image`?X(`assets_dialog.enter_image_url`):X(`assets_dialog.enter_file_url`)]),W(e,r)},$$slots:{default:!0}})};K(b,e=>{B(E)&&B(ie)===`enter-url`&&e(C)}),Ro(L(b,2),17,()=>B(re),([e,t])=>e,(e,n)=>{var r=j(()=>Pr(B(n),2));let o=()=>B(r)[0],s=()=>B(r)[1];var c=U(),l=F(c),u=e=>{{let n=j(()=>B(ie)!==`cloudinary`);gB(e,{get kind(){return t.kind},get fieldConfig(){return t.fieldConfig},get multiple(){return a()},get hidden(){return B(n)},onSelect:e=>{N(x,e,!0),Oe(),i(!1)}})}},d=e=>{ms(RKe(e,{get kind(){return t.kind},get fieldConfig(){return t.fieldConfig},get multiple(){return a()},get searchTerms(){return B(T)},get serviceProps(){return s()},gridId:`select-assets-grid`,get selectedResources(){return B(x)},set selectedResources(e){N(x,e,!0)}}),e=>N(S,e,!0),()=>B(S))};K(l,e=>{o()===`cloudinary`?e(u):B(ie)===o()&&e(d,1)}),W(e,c)}),O(h),O(l),z(()=>J(h,`id`,`${n}-content-pane`)),W(e,l)},$$slots:{headerExtra:!0,footerExtra:!0,default:!0}})}var je=L(Ae,2),Me=e=>{Z4(e,{get dirPath(){return B(de)},get takenNames(){return B(_e)},get open(){return B(v)},set open(e){N(v,e,!0)}})};K(je,e=>{B(ue)&&e(Me)}),ms(Jl(L(je,2),{get accept(){return o()},get multiple(){return a()},onSelect:({files:e})=>{B(be)?B(S)?.uploadFiles(e):Ee(e)}}),e=>N(b,e,!0),()=>B(b)),W(e,ke),A()}var mXe=V(`<!> <!> <!> <!>`,1);function C3(e,t){k(t,!0);{let t=e=>{var t=mXe(),n=F(t);Ml(n,{flex:!0});var r=L(n,2);ll(r,{variant:`primary`,onclick:()=>s3.resolve(!0),children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`replace`)]),W(e,n)},$$slots:{default:!0}});var i=L(r,2);ll(i,{variant:`primary`,onclick:()=>s3.resolve(!1),children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`keep_both`)]),W(e,n)},$$slots:{default:!0}}),ll(L(i,2),{variant:`secondary`,onclick:()=>s3.resolve(void 0),children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`cancel`)]),W(e,n)},$$slots:{default:!0}}),W(e,t)},n=j(()=>X(`file_name_conflict_resolution`));Il(e,{get title(){return B(n)},onCancel:()=>s3.resolve(void 0),get open(){return s3.showDialog},set open(e){s3.showDialog=e},footer:t,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`file_name_conflict_confirmation_with_name`,{values:{count:s3.count,name:s3.name}})]),W(e,n)},$$slots:{footer:!0,default:!0}})}A()}var w3=({collectionName:e,fileName:t,isIndexFile:n,componentName:r,typedKeyPath:i,fieldConfig:a})=>{let o=l3({collectionName:e,fileName:t,componentName:r,typedKeyPath:i,isIndexFile:n}),{enabled:s,config:c}=FV({fieldConfig:a}),l=Object.entries(vZ).filter(([,{isEnabled:e}])=>e?.(a)??!0);return{folderMap:o,folder:u3(o),enabled:s,libraryConfig:c,cloudServiceEntries:l}},T3=({draft:e,resources:t,folder:n,libraryConfig:r,accept:i,locale:a})=>Promise.all(t.map(t=>(t.file&&!t.folder&&(t.folder=n),_3({draft:e,resource:t,libraryConfig:r,accept:i,locale:a})))),E3=e=>({oversizedFileNames:e.flatMap(({oversizedFileName:e})=>e??[]),invalidFileNames:e.flatMap(({invalidFileName:e})=>e??[]),mismatchedFileNames:e.flatMap(({mismatchedFileName:e})=>e??[])}),D3=(e,t)=>t?e.replaceAll(` `,`%20`):e,hXe=({resources:e,multiple:t,previousValue:n,inEditorComponent:r})=>{let i=e.flatMap(({value:e})=>e??[]),a;return t||(a=i.length?D3(i.at(-1),r):n??``),{values:i,value:a,credit:e.flatMap(({credit:e})=>e||[]).join(`
|
||
`),rejected:E3(e)}},O3=({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r})=>{let{collectionName:i,fileName:a,isIndexFile:o}=e;return w3({collectionName:i,fileName:a,isIndexFile:o,componentName:r,typedKeyPath:n,fieldConfig:t})},gXe=async({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,file:a,options:o={}})=>{let s=o.name??(a instanceof File?a.name:``);if(!(a instanceof Blob)||!s)throw TypeError("addFile() expects a File, or a Blob along with the `name` option");let c=a instanceof File&&a.name===s?a:new File([a],s,{type:a.type}),{folder:l,libraryConfig:u}=O3({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r});if(!l)throw Error(`There is no asset folder to upload the file "${s}" to`);let{value:d,oversizedFileName:f,invalidFileName:p}=await _3({draft:e,resource:{file:c,folder:l,replace:!!o.replace},libraryConfig:u,locale:i});if(p)throw Error(`The file "${p}" is corrupt or mislabeled and cannot be used`);if(f){let{max_file_size:e}=u;throw Error(`The file "${f}" exceeds the maximum size of ${e} bytes`)}return d},_Xe=({kind:e,accept:t})=>{if(e)return e===`image`?`image`:void 0;let n=(t??``).split(`,`).map(e=>e.trim()).filter(Boolean);return n.length&&n.every(e=>e.startsWith(`image/`))?`image`:void 0},vXe=async({draft:e,typedKeyPath:t,componentName:n,locale:r,resource:i,value:a})=>{if(a.startsWith(`blob:`))return e.files[a]?.file;let{collectionName:o,fileName:s,originalEntry:c}=e,l=i.asset??(i.file?iX({value:a,entry:c,collectionName:o,fileName:s,componentName:n,typedKeyPath:t,locale:r}):void 0);return l?CX(l):void 0},yXe=async({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,inEditorComponent:a=!1,resources:o,accept:s})=>{let{folder:c,libraryConfig:l}=O3({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r}),u=await T3({draft:e,resources:o,folder:c,libraryConfig:l,accept:s,locale:i});return{files:(await Promise.all(u.map(async({value:s,credit:c},l)=>s?{value:D3(s,a),file:await vXe({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,resource:o[l],value:s}),credit:c||void 0}:void 0))).filter(Boolean),...E3(u)}},bXe=V(`<!> <!> <!>`,1);function xXe(e,t){k(t,!0);let n=Y(t,`componentName`,3,void 0),r=Y(t,`inEditorComponent`,3,!1),i=Y(t,`locale`,3,void 0),a=Ez(),o=M(!1),s=M({}),c=M(void 0),l,u=j(()=>a.current?O3({draft:a.current,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:n()}):void 0),d=j(()=>_Xe(B(s))),f=j(()=>RV({accept:B(s).accept,image:B(d)===`image`,transformations:B(u)?.libraryConfig.transformations})),p=j(()=>B(u)?.libraryConfig.max_file_size??1/0),m=j(()=>t.fieldConfig),h=async(e={})=>{if(!a.current)throw Error(`pickFile() can only be called while an entry is being edited`);return l||(l=Promise.withResolvers(),N(s,e),N(o,!0)),l.promise},g=async e=>{let o=a.current,{resolve:u,reject:d}=l??{},{multiple:p=!1}=B(s);if(l=void 0,u&&d){if(!o)u(null);else try{let{files:a,...s}=await yXe({draft:o,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:n(),locale:i(),inEditorComponent:r(),resources:e,accept:B(f)});B(c)?.report(s),a.length?u(p?a:a[0]):u(null)}catch(e){d(e)}}},_=()=>{l?.resolve(null),l=void 0};ys(_);var v={pick:h},y=U(),b=F(y),x=e=>{var t=bXe(),n=F(t);{let e=j(()=>!!B(s).multiple),t=j(()=>B(s).allowURL??!0);S3(n,{get kind(){return B(d)},get accept(){return B(f)},get multiple(){return B(e)},get canEnterURL(){return B(t)},get draft(){return a.current},get locale(){return i()},get fieldConfig(){return B(m)},get assetLibraryFolderMap(){return B(u).folderMap},get enabledCloudServiceEntries(){return B(u).cloudServiceEntries},onSelect:g,onClose:_,get open(){return B(o)},set open(e){N(o,e,!0)}})}var r=L(n,2);C3(r,{}),ms(V$(L(r,2),{get maxSize(){return B(p)},get accept(){return B(f)}}),e=>N(c,e,!0),()=>B(c)),W(e,t)};return K(b,e=>{B(u)&&e(x)}),W(e,y),A(v)}var k3=(0,br.createContext)({}),A3=O0({loader:()=>pN(`react-dom`),notLoadedMessage:"react-dom is not loaded yet. Call `loadReactDom()` first."}),j3=A3.loaded,M3=A3.load,N3=A3.preload;A3.get,A3.reset;var P3=e=>{let t;return{render:n=>{t??=A3.get().createRoot(e),t.render(n)},unmount:()=>{t?.unmount(),t=void 0}}},F3=(e,t)=>{let n,r=!1;return A3.load().then(()=>{r||(n=P3(e),n.render(t))},e=>{console.error(e)}),()=>{r=!0,n?.unmount()}},I3=e=>{let t;return R(()=>co(()=>(Promise.all([j0(),M3()]).catch(e=>{console.error(e)}),()=>{t?.unmount()}))),{get ready(){return A0.current&&j3.current&&!!e()},render:n=>{t??=P3(e()),t.render(n)}}},SXe=/(?<path>.+?)\.[^.]*$/,L3=({fieldConfig:e,getFieldArgs:t})=>{let{keyPath:n}=t,r=n.split(`.`),i=r.map((e,n)=>{if(n===0||!cM(e))return;let i=r.slice(0,n).join(`.`),a={...t,keyPath:i},o=_M(a);if(!(o?.widget!==`list`||cR({fieldConfig:o,getFieldArgs:a})))return`${i}.${e}`}).filter(e=>e!==void 0);return i.length?r=>{let a=e=>n in r||e in r||Object.keys(r).some(t=>t.startsWith(`${e}.`));return _M({...t,valueMap:r})===e&&i.every(a)}:()=>!0},CXe=({getFieldArgs:e,content:t})=>{let{keyPath:n}=e;if(!n.includes(`.`))return!0;let r=n.match(SXe)?.groups?.path;return!!_M({...e,keyPath:r})||Object.keys(t).some(e=>e.startsWith(`${r}.`))},R3=({draft:e,getFieldArgs:t,sourceLanguage:n,matchesListItems:r},i)=>{Object.entries(e.currentValues).forEach(([e,a])=>{e!==n&&CXe({getFieldArgs:t,content:a})&&r(a)&&i(a,e)})},wXe=({draft:e,getFieldArgs:t,fieldConfig:n,fieldKeyPath:r=t.keyPath,sourceLanguage:i,value:a})=>{let{keyPath:o}=t;R3({draft:e,getFieldArgs:t,sourceLanguage:i,matchesListItems:L3({fieldConfig:n,getFieldArgs:{...t,keyPath:r}})},(e,t)=>{let r=UR({fieldConfig:n,value:a,sourceLocale:i,targetLocale:t});e[o]!==r&&(e[o]=r)})},TXe=({draft:e,getFieldArgs:t,fieldConfig:n,fieldKeyPath:r,sourceLanguage:i,value:a,previousValue:o,deleted:s=!1})=>{let{keyPath:c,valueMap:l}=t,u=GR(n,r),d=c===u?o:l[u];R3({draft:e,getFieldArgs:t,sourceLanguage:i,matchesListItems:L3({fieldConfig:n,getFieldArgs:{...t,keyPath:r}})},(e,t)=>{let r=e[u],o=sje({fieldConfig:n,targetValue:r,previousValue:d,sourceLocale:i,targetLocale:t});if(s){o&&c in e&&delete e[c];return}let l=UR({fieldConfig:n,value:a,sourceLocale:i,targetLocale:t});o&&!(D(a)&&D(e[c]))&&e[c]!==l&&(e[c]=l)})},z3=({draft:e,locale:t,target:n={},getValueMap:r})=>{let{collectionName:i,fileName:a,isIndexFile:o}=e,s={collectionName:i,fileName:a,isIndexFile:o},c=aj(i,a);if(!c)return;let{collection:l,collectionFile:u}=c,{defaultLocale:d,canonicalSlug:{key:f}}=(u??l)._i18n,p=()=>hje()&&t===d,m=(e,n)=>hje()&&(t===d?cR({fieldConfig:e,getFieldArgs:n}):lR({fieldConfig:e,getFieldArgs:n})),h=(e,t)=>{let n=typeof r==`function`?r():e,i=gM(s,{keyPath:t,valueMap:n});return{valueMap:n,getFieldArgs:i,fieldConfig:_M({...i})}},g=(e,t)=>{let n=e?{keyPath:t.keyPath,fieldConfig:e}:ZR(t);return n&&m(n.fieldConfig,{...t,keyPath:n.keyPath})?n:void 0},_=({fieldConfig:n,getFieldArgs:r,value:i,previousValue:a,deleted:o})=>{if(!p())return;let{keyPath:s}=r,c=oje(s,e=>e===s?n:_M({...r,keyPath:e}));c&&TXe({draft:e,getFieldArgs:r,...c,sourceLanguage:t,value:i,previousValue:a,deleted:o})};return gz(n,{onSet:(n,r,i,a,o)=>{if([f].includes(r))return;let{fieldConfig:s,getFieldArgs:c,valueMap:l}=h(n,r);H2({draft:e,locale:t,keyPath:r,value:i,valueMap:l,keyAdded:o});let u=g(s,c);u&&iz(()=>{wXe({draft:e,getFieldArgs:c,fieldConfig:u.fieldConfig,fieldKeyPath:u.keyPath,sourceLanguage:t,value:i})}),_({fieldConfig:s,getFieldArgs:c,value:i,previousValue:a})},onDelete:(n,r,i)=>{let{fieldConfig:a,getFieldArgs:o,valueMap:s}=h(n,r);r!==f&&H2({draft:e,locale:t,keyPath:r,value:void 0,valueMap:s});let c=g(a,o);if(c){let n=L3({fieldConfig:c.fieldConfig,getFieldArgs:{...o,keyPath:c.keyPath}});iz(()=>{R3({draft:e,getFieldArgs:o,sourceLanguage:t,matchesListItems:n},e=>{r in e&&delete e[r]})})}_({fieldConfig:a,getFieldArgs:o,previousValue:i,deleted:!0})}})},EXe=({fieldConfig:e,dynamicValue:t})=>{if(t!==void 0)return t===`true`;let{default:n}=e;return typeof n==`boolean`&&n},B3=e=>({[e.keyPath]:EXe(e)}),DXe=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let{default:r,output_code_only:i=!1,keys:a={code:`code`,lang:`lang`}}=e,o=n===void 0?r:n;if(i)return{[t]:typeof o==`string`?o:``};let s=D(o)?o:void 0,c=s?.[a.code]??o,l=s?.[a.lang]??``;return Fj(t,{[a.code]:typeof c==`string`?c:``,[a.lang]:typeof l==`string`?l:``})},OXe=({fieldConfig:e,dynamicValue:t,locale:n})=>{let r=e,i=r.default,a=t??i;return typeof a==`string`?a===`{{now}}`?eje(r,{locale:n}):a:``},kXe=e=>({[e.keyPath]:OXe(e)}),V3=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,i=r.default,a=sM(r),o=``;o=n===void 0?a?Array.isArray(i)?i:[]:typeof i==`string`?i:``:a?n.split(/,\s*/):n;let s={};return a&&Array.isArray(o)&&(o=o.map(e=>e.trim()).filter(e=>e!==``),Object.assign(s,Fj(t,o))),!a&&typeof o==`string`&&(s[t]=o.trim()),s},AXe=(e,{locale:t,account:{email:n=``,login:r=``,name:i=``}})=>e===`locale`?t:e===`datetime`?new Date().toJSON().replace(/\d+\.\d+Z$/,`00.000Z`):e===`uuid`?Qc():e===`uuid_short`?Qc(`short`):e===`uuid_shorter`?Qc(`shorter`):e===`author-email`?n:e===`author-login`?r:e===`author-name`?i:``,jXe=({fieldConfig:e,locale:t,dynamicValue:n})=>{let{default:r}=e,i=n??r;if(typeof i!=`string`)return i;let a={locale:t,account:vU.account},o=e=>{let{value:n,transformations:r}=IN(e),i=AXe(n,a),s=RM(r,o);return s.length?LN({value:i,transformations:s,locale:t}):i};return NM(i,(e,t)=>o(t))},H3=e=>({[e.keyPath]:jXe(e)}),MXe=({fieldConfig:e,locale:t})=>{let{default:n}=e,r=bM({fieldConfig:e,locale:t});return D(n)?n:r?{"":``}:{}},NXe=e=>{let{keyPath:t,dynamicValue:n}=e,r;if(n!==void 0)try{let e=JSON.parse(n);D(e)&&(r=e)}catch{}return r??=MXe(e),Object.fromEntries(Object.entries(r).filter(([,e])=>typeof e==`string`).map(([e,n])=>[`${t}.${Dj(e)}`,n]))},PXe=[`int`,`float`,`int/string`,`float/string`],U3=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,i=n??r.default;if(i===void 0)return{[t]:KN(r)?``:null};if(!PXe.includes(WN(r)))return{};let a=YN(i);return ZN(a,r)?{}:{[t]:QN({inputValue:a,fieldConfig:r})}},W3=e=>e.replaceAll(/<(?=[!/?a-z])/gi,`<`),FXe=e=>{try{return W3(xge(e))}catch{return W3(e.replace(/<[^>]*>/g,``))}},G3=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let{default:r=$O.current?.field_defaults?.richtext?.default}=e,i=n===void 0?r||``:FXe(n);return{[t]:i}},K3=({content:e,itemKeyPath:t,fields:n,funcArgs:r})=>{let{locale:i,defaultLocale:a,populateDefault:o}=r,s=Object.keys(e);n.forEach(n=>{let r=`${t}.${n.name}`;s.some(e=>dj(e,r))||o?.({content:e,keyPath:r,fieldConfig:n,locale:i,defaultLocale:a,dynamicValues:{}})})},q3=({fieldConfig:e,locale:t})=>e.max===1&&(`fields`in e||`field`in e)&&bM({fieldConfig:e,locale:t}),IXe={boolean:B3,number:U3,markdown:G3,richtext:G3},LXe=(e,t,n)=>{let r=IXe[t?.widget??`string`];if(!r)return e;let i=t,a=r({...n,fieldConfig:i,keyPath:`_`,dynamicValue:e})._;return typeof a==`string`?a.trim():a},RXe=e=>{let{fieldConfig:t,keyPath:n,dynamicValue:r,locale:i,defaultLocale:a,populateDefault:o}=e,{default:s}=t,{field:c}=t,{fields:l}=t,{types:u,typeKey:d=`type`}=t,f;if(f=r===void 0?Array.isArray(s)?s:[]:r.split(/,\s*/).map(e=>LXe(e.trim(),c,{locale:i,defaultLocale:a})).filter(e=>e!==``&&e!==void 0),!(Array.isArray(f)&&f.length)){let r=Fj(n,[]);if(q3({fieldConfig:t,locale:i})){let t=`${n}.0`;c?o?.({content:r,keyPath:t,fieldConfig:c,locale:i,defaultLocale:a,dynamicValues:{}}):K3({content:r,itemKeyPath:t,fields:l,funcArgs:e})}return r}let p=c||l||u?f:f.filter(e=>!D(e)),m=Fj(n,p);return(l||u)&&p.forEach((t,r)=>{if(!D(t))return;let i=l??u.find(({name:e})=>e===t[d])?.fields;i&&K3({content:m,itemKeyPath:`${n}.${r}`,fields:i,funcArgs:e})}),m},zXe=e=>{let{fieldConfig:t,keyPath:n,locale:r,defaultLocale:i,dynamicValues:a={},populateDefault:o}=e,{default:s}=t,{fields:c}=t,{types:l,typeKey:u=`type`}=t,d=bM({fieldConfig:t,locale:r}),f={};if(D(s)){Object.entries(Aj(s)).forEach(([e,t])=>{f[`${n}.${e}`]=t});let t=Array.isArray(l)?l.find(({name:e})=>e===s[u])?.fields:c;return t&&K3({content:f,itemKeyPath:n,fields:t,funcArgs:e}),f}let p=Object.keys(a).some(e=>e.startsWith(`${n}.`));return!d&&!p||Array.isArray(l)?(f[n]=null,f):(c&&c.length>0&&c.forEach(e=>{o?.({content:f,keyPath:[n,e.name].join(`.`),fieldConfig:e,locale:r,defaultLocale:i,dynamicValues:{}})}),f)},J3=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,{default:i,multiple:a=!1}=r,o=r.options??[],[s]=o,c=e=>{let t=o.findIndex(t=>String(IR(t))===e);return t>-1?IR(o[t]):e};if(n!==void 0&&!a){let e=n.trim();return{[t]:e?c(e):LR(IR(s))}}let l=n===void 0?Array.isArray(i)?i.map(IR):IR(i):n.split(/,\s*/).map(e=>e.trim()).filter(e=>e!==``).map(c);return a?Array.isArray(l)&&l.length?Object.fromEntries(l.map((e,n)=>[`${t}.${n}`,e])):{[t]:[]}:{[t]:l===void 0?LR(IR(s)):l}},BXe={boolean:B3,code:DXe,datetime:kXe,file:V3,hidden:H3,image:V3,keyvalue:NXe,list:RXe,markdown:G3,number:U3,object:zXe,relation:J3,richtext:G3,select:J3},Y3=({content:e,keyPath:t,fieldConfig:n,locale:r,defaultLocale:i,dynamicValues:a})=>{let o=Qke({fieldConfig:n,locale:r,defaultLocale:i}),{widget:s=`string`,default:c,i18n:l=!1}=o;if(r!==i&&oR(l))return;if(s===`compute`){e[t]=``;return}let u=Object.hasOwn(a,t)&&!/\.\d+(?:\.|$)/.test(t)&&a[t].trim()||void 0,d=BXe[s];d?Object.assign(e,d({fieldConfig:o,keyPath:t,locale:r,defaultLocale:i,dynamicValue:u,dynamicValues:a,populateDefault:e=>Y3({...e,dynamicValues:a})})):e[t]=u??c??``},X3=({fields:e,locale:t,defaultLocale:n,dynamicValues:r={}})=>{let i={};return e.forEach(e=>{Y3({content:i,keyPath:e.name,fieldConfig:e,locale:t,defaultLocale:n,dynamicValues:r})}),i},VXe=(e,t)=>{let n=e.map(([e])=>e);return e.map(([e],r)=>{let i=t.find(([t])=>t===e);if(i)return i;let a=t[r];return a&&!n.includes(a[0])?[e,a[1]]:[e,``]})},Z3=({valueStore:e,defaultLocale:t,keyPath:n})=>{let r=ez(e[t]??{},n);Object.entries(e).forEach(([i,a])=>{if(i===t)return;let o=ez(a,n),s=VXe(r,o);(s.length!==o.length||s.some(([e,t],n)=>{let[r,i]=o[n];return e!==r||t!==i}))&&tz(a,n,s),!s.length&&e[t]?.[n]===null&&a[n]!==null&&(a[n]=null)})},HXe=({valueStore:e,getFieldArgs:t})=>{let n=new Set;return Object.values(e).forEach(e=>{Object.keys(e).forEach(r=>{$R({...t,keyPath:r,valueMap:e})?.i18n===`duplicate_keys`&&n.add(r.replace(QR,``))})}),[...n]},Q3=({valueStore:e,defaultLocale:t,getFieldArgs:n})=>{HXe({valueStore:e,getFieldArgs:n}).forEach(n=>{Z3({valueStore:e,defaultLocale:t,keyPath:n})})},$3=e=>{let{prefix:t,use_b32_encoding:n}=e,r=n?$c():Qc();return t?`${t}${r}`:r},e6=({valueStore:e,locale:t,i18n:n,draft:r,keyPath:i},a)=>{let o=r&&i&&e===r.currentValues?gM(r,{keyPath:i,valueMap:e[t]}):void 0,s=o?_M(o):void 0,c=iR(n)||!!o&&cR({fieldConfig:s??{i18n:n},getFieldArgs:o}),l=c&&o?L3({fieldConfig:s,getFieldArgs:o}):()=>!0;iz(()=>{Object.entries(e??{}).forEach(([e,n])=>{(e===t||c&&l(n))&&a(n,e)})})},UXe=({draft:e,content:t,targetLanguage:n,keyPathPrefix:r})=>{let{currentValues:i}=e,{defaultLocale:a}=BA(e),o=Sr(i[a]),s={...Sr(t),...o},c=gM(e,{valueMap:s}),l=[];return Object.keys(s).forEach(e=>{let r=_M({...c,keyPath:e});if(!r)return;let{widget:i=`text`}=r,u=r.i18n??(cR({fieldConfig:r,getFieldArgs:{...c,keyPath:e}})?`duplicate`:!1);if(gk.includes(i)&&rR(u)&&u!==`duplicate_if_empty`&&(s[e]=t[e]??``),rR(u)&&(i===`uuid`&&(s[e]=t[e]||$3(r)),i===`compute`&&nB(r.value)&&(s[e]=``)),i===`hidden`&&rR(u)){let{default:t}=r;t===`{{locale}}`&&(s[e]=n)}e in o&&(s[e]=UR({fieldConfig:r,value:s[e],sourceLocale:a,targetLocale:n})),i===`object`&&aR(u)&&o[e]!==null&&delete s[e],(oR(u)||l.some(t=>dj(e,t)))&&(delete s[e],l.push(e))}),HXe({valueStore:{[n]:s},getFieldArgs:c}).forEach(e=>{tz(s,e,ez(o,e).map(([n])=>[n,t[`${e}.${n}`]??``]))}),r===void 0?s:Object.fromEntries(Object.entries(s).filter(([e])=>e.startsWith(`${r}.`)))},WXe=({draft:e,locale:t})=>{let{fields:n,defaultLocale:r,currentLocales:i,currentValues:a,validities:o,validationMessages:s}=e,c=!i[t];if(i[t]=c,c&&!a[t]){let i=X3({fields:n,locale:t,defaultLocale:r});e.originalValues[t]=i,a[t]=z3({draft:e,locale:t,target:UXe({draft:e,content:i,targetLanguage:t})})}else o[t]={},s[t]={}},GXe=({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a})=>{e6({valueStore:e[t],locale:n,i18n:i,draft:e,keyPath:r},e=>{fCe(e,r,a)})},KXe=({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a})=>{Array.isArray(a)||D(a)?GXe({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a}):e6({valueStore:e[t],locale:n,i18n:i,draft:e,keyPath:r},e=>{pj(e,`${r}.`,{live:!0}).forEach(t=>{delete e[t]}),e[r]=a})},qXe=[Symbol.for(`react.forward_ref`),Symbol.for(`react.memo`)],t6=e=>typeof e==`function`||qXe.includes(e?.$$typeof),JXe=(e,t=new Set)=>{if(t6(e))return e;if(typeof e==`string`){if(t.has(e)){console.warn(`Custom field type "${e}" references itself through its control.`);return}t.add(e);let n=FO.get(e);if(n?.control)return t6(n.control)?n.control:JXe(n.control,t);if(dk.includes(e)){console.warn(`Custom field references built-in editor "${e}" which is not a React component.`);return}}},YXe=({fieldId:e,fieldClassName:t,fieldConfig:n,currentValue:r,draft:i,locale:a,onChange:o,addFile:s,pickFile:c,handleRef:l})=>{let u=i?K0({draft:i,locale:a}):void 0;return{value:r,field:U0(n),forID:e??``,classNameWrapper:t??``,entry:u?.entryMap,getAsset:u?.getAsset,onChange:o,addFile:s,pickFile:c,ref:l}},n6=void 0,XXe=()=>{if(n6===void 0){let e=document.createElement(`div`);To(Gl,{target:e}),n6=e.querySelector(`input`).className}return n6},ZXe=V(`<div role="none"></div> <!>`,1);function QXe(e,t){k(t,!0);let n=Ez(),{valueStoreKey:r=`currentValues`,parentComponentNames:i=[]}=Mz(),a=jz(r),o=Y(t,`required`,3,!0),s=Y(t,`readonly`,3,!1),c=Y(t,`invalid`,3,!1),l=M(void 0),u=I3(()=>B(l)),d=M(void 0),f=M(void 0),p={locale:t.locale,keyPath:t.keyPath},m=j(()=>Nr(t.fieldConfig.i18n,!1)),h=j(()=>JXe(t.control)),g=i.at(-1),_=e=>{let i=n.current;i&&KXe({draft:i,valueStoreKey:r,locale:t.locale,keyPath:t.keyPath,i18n:B(m),value:e})},v=async(e,r)=>{if(!n.current)throw Error(`addFile() can only be called while an entry is being edited`);return gXe({draft:n.current,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:g,locale:t.locale,file:e,options:r})},y=async e=>{if(!B(f))throw Error(`pickFile() can only be called while an entry is being edited`);return B(f).pick(e)},b=e=>{let t=B(d);N(d,e),e?Q0({...p,instance:e}):$0({...p,instance:t})},x=()=>{if(!u.ready||!B(h))return;let e=YXe({fieldId:t.fieldId,fieldClassName:XXe(),fieldConfig:t.fieldConfig,currentValue:t.currentValue,draft:n.current,locale:t.locale,onChange:_,addFile:v,pickFile:y,handleRef:b});u.render((0,br.createElement)(k3.Provider,{value:{locale:t.locale,keyPath:t.keyPath,required:o(),readonly:s(),invalid:c()}},(0,br.createElement)(B(h),e))),B(l)?.querySelector(`input`)?.setAttribute(`aria-invalid`,String(c()))};vs(()=>()=>{$0({...p,instance:B(d)})}),R(()=>{let e={locale:t.locale,keyPath:t.keyPath};co(()=>{B(d)&&($0({...p,instance:B(d)}),Q0({...e,instance:B(d)}))}),p=e}),R(()=>{vz(n.current,t.locale,r),P0.current,u.ready&&B(h)&&x()}),R(()=>{vz(n.current,t.locale,r),typeof B(d)?.isValid==`function`&&jqe({locale:t.locale,keyPath:t.keyPath,value:t.currentValue,fieldConfig:t.fieldConfig})});var S=ZXe(),C=F(S);ms(C,e=>N(l,e),()=>B(l)),ms(xXe(L(C,2),{get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get componentName(){return g},get inEditorComponent(){return a},get locale(){return t.locale}}),e=>N(f,e,!0),()=>B(f)),W(e,S),A()}var $Xe=e=>{let{widget:t}=e??{};return t?FO.get(t)?.summary:void 0},eZe=({locale:e,keyPath:t,fieldConfig:n,currentValue:r,draft:i,preview:a})=>{if(!t6(a)||!i)return;let{entryMap:o,getFieldArgs:s,fieldsMetaData:c,getAsset:l}=K0({draft:i,locale:e});return{value:r,field:U0(n),metadata:c.getIn(z0({getFieldArgs:s,keyPath:t}))??N0().fromJS({}),getAsset:l,entry:o,fieldsMetaData:c}},tZe=V(`<div class="svelte-7ynvbs"></div>`),nZe={hash:`svelte-7ynvbs`,code:`div.svelte-7ynvbs {
|
||
/* Allow the React component to use the full width, but let it shrink beside a list item
|
||
thumbnail rather than overflow */width:100%;min-width:0;}`};function rZe(e,t){k(t,!0),q(e,nZe);let n=Ez(),r=M(void 0),i=I3(()=>B(r)),a=()=>{if(!i.ready)return;let e=eZe({locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig,currentValue:t.currentValue,draft:n.current,preview:t.preview});e&&i.render((0,br.createElement)(k3.Provider,{value:{locale:t.locale,keyPath:t.keyPath}},(0,br.createElement)(t.preview,e)))};R(()=>{vz(n.current,t.locale),P0.current,i.ready&&a()});var o=tZe();ms(o,e=>N(r,e),()=>B(r)),W(e,o),A()}var iZe=V(`<p> <!></p>`);function aZe(e,t){k(t,!0);let n=j(()=>lN(t.fieldConfig)),r=j(()=>B(n).utc),i=j(()=>B(n).singleCustomTimeZone),a=j(()=>HN({locale:t.locale,fieldConfig:t.fieldConfig,currentValue:t.currentValue}));var o=U(),s=F(o),c=e=>{var n=iZe(),o=P(n),s=L(o),c=e=>{var n=H();z(e=>G(n,`— ${e??``}`),[()=>GAe(B(i),MN(t.currentValue,t.fieldConfig,t.locale))]),W(e,n)},l=e=>{W(e,H(`— UTC`))};K(s,e=>{B(i)?e(c):B(r)&&e(l,1)}),O(n),z((e,t)=>{J(n,`lang`,e),J(n,`dir`,t),G(o,`${B(a)??``} `),n.dir=n.dir},[()=>DA(t.locale),()=>OA(t.locale)]),W(e,n)};K(s,e=>{B(a)&&e(c)}),W(e,o),A()}var oZe=V(`<div role="none" class="timezone svelte-1dnhck7"> </div>`),sZe=V(`<div role="none" class="timezone svelte-1dnhck7">UTC</div>`),cZe=V(`<div role="none" class="svelte-1dnhck7"><!> <!> <!></div> <!>`,1),lZe={hash:`svelte-1dnhck7`,code:`div.svelte-1dnhck7 {display:flex;align-items:center;}.timezone.svelte-1dnhck7 {margin:4px 8px 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);white-space:nowrap;}`};function uZe(e,t){k(t,!0),q(e,lZe);let n=Y(t,`currentValue`,15),r=Y(t,`required`,3,!0),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1),o=M(``),s=M(!1),c=j(()=>lN(t.fieldConfig)),l=j(()=>B(c).type),u=j(()=>B(c).min),d=j(()=>B(c).max),f=j(()=>B(c).step),p=j(()=>B(c).dateOnly),m=j(()=>B(c).utc),h=j(()=>B(c).singleCustomTimeZone),g=j(()=>WAe(n(),t.fieldConfig)),_=``,v=()=>{if(B(s))return;let e=tje({currentValue:n(),fieldConfig:t.fieldConfig,timeZone:B(g),locale:t.locale});e!==void 0&&e!==B(o)&&N(o,e,!0),_=B(o)},y=()=>{if(B(o)===_)return;_=B(o);let e=$Ae({inputValue:B(o),currentValue:n(),fieldConfig:t.fieldConfig,timeZone:B(g),locale:t.locale});XAe({newValue:e,currentValue:n(),fieldConfig:t.fieldConfig,locale:t.locale})&&n(e)};YO(()=>n(),()=>{v()}),YO(()=>B(o),()=>{y()});let b=()=>{N(s,!0)},x=()=>{N(s,!1),v()};var S=U(),C=F(S),w=e=>{aZe(e,{get locale(){return t.locale},get keyPath(){return t.keyPath},get typedKeyPath(){return t.typedKeyPath},get fieldConfig(){return t.fieldConfig},get currentValue(){return n()}})},T=j(()=>i()&&P2(t.fieldConfig)),ee=e=>{var s=cZe(),c=F(s),_=P(c);Sxe(_,{get type(){return B(l)},get min(){return B(u)},get max(){return B(d)},get step(){return B(f)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onfocus:b,onblur:x,get value(){return B(o)},set value(e){N(o,e,!0)}});var v=L(_,2),y=e=>{{let n=j(()=>X(B(p)?`today`:`now`));ll(e,{variant:`tertiary`,get label(){return B(n)},onclick:()=>{N(o,ZAe(t.fieldConfig,B(g)),!0)}})}};K(v,e=>{i()||e(y)});var S=L(v,2),C=e=>{{let t=j(()=>X(`clear`)),r=j(()=>!n());ll(e,{variant:`tertiary`,get label(){return B(t)},get disabled(){return B(r)},onclick:()=>{n(``)}})}};K(S,e=>{!i()&&!r()&&e(C)}),O(c);var w=L(c,2),T=e=>{var r=oZe(),i=I(r,!0);z(e=>G(i,e),[()=>GAe(B(h),MN(n(),t.fieldConfig,t.locale))]),W(e,r)},ee=e=>{W(e,sZe())};K(w,e=>{B(h)?e(T):B(m)&&e(ee,1)}),W(e,s)};K(C,e=>{B(T)?e(w):e(ee,-1)}),W(e,S),A()}var dZe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`oldExtension`,`newExtension`,`okLabel`,`onOk`,`onCancel`]),fZe=V(`<p class="svelte-8pzyo8"> </p> <p class="svelte-8pzyo8"> </p>`,1),pZe={hash:`svelte-8pzyo8`,code:`p.svelte-8pzyo8 {margin:0 0 8px;}p.svelte-8pzyo8:last-child {margin:0;}`};function mZe(e,t){k(t,!0),q(e,pZe);let n=Y(t,`open`,15,!1),r=Y(t,`oldExtension`,3,void 0),i=Y(t,`newExtension`,3,void 0),a=Y(t,`okLabel`,3,``),o=Y(t,`onOk`,3,void 0),s=Y(t,`onCancel`,3,void 0),c=gs(t,dZe),l=j(()=>r()?i()?`change`:`remove`:`add`);{let t=j(()=>X(`change_file_extension`));Il(e,_s(()=>c,{get title(){return B(t)},get okLabel(){return a()},get onOk(){return o()},get onCancel(){return s()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=fZe(),a=F(n),o=I(a,!0),s=I(L(a,2),!0);z((e,t)=>{G(o,e),G(s,t)},[()=>X(`confirm_file_extension_change.${B(l)}`,{values:{oldExtension:r(),newExtension:i()}}),()=>X(`file_extension_change_warning`)]),W(e,n)},$$slots:{default:!0}}))}A()}var hZe=V(`<!> <!> <!>`,1),gZe=V(`<div role="textbox" tabindex="0" class="value svelte-15viu92"> </div> <!>`,1),_Ze=V(`<div role="none" class="editable-text svelte-15viu92"><!></div>`),vZe={hash:`svelte-15viu92`,code:`.editable-text.svelte-15viu92 {display:flex;align-items:center;gap:4px;}.value.svelte-15viu92 {flex:auto;margin:var(--sui-focus-ring-width);padding:4px;word-break:break-all;&:empty {margin:0;padding:0;}}`};function r6(e,t){k(t,!0),q(e,vZe);let n=Y(t,`initialText`,3,void 0),r=Y(t,`editing`,15),i=Y(t,`text`,15),a=Y(t,`inputElement`,15),o=Y(t,`canEdit`,3,!0),s=Y(t,`editLabel`,3,void 0),c=Y(t,`placeholder`,3,void 0),l=Y(t,`readonly`,3,!0),u=Y(t,`invalid`,3,!1),d=Y(t,`required`,3,!1),f=Y(t,`applyDisabled`,3,!1),p=Y(t,`dir`,3,`auto`),m=Y(t,`ariaLabelledby`,3,void 0),h=Y(t,`ariaErrormessage`,3,void 0),g=Y(t,`getSelectionEnd`,3,void 0),_=Y(t,`onApply`,3,void 0),v=M(void 0),y=M(void 0),b=async()=>{let e=n()??t.value;i(e),r(!0),await ao(),a()?.focus(),a()?.setSelectionRange(0,g()?.(e)??e.length)},x=async()=>{r(!1),await ao(),(B(v)??B(y))?.focus()},S=()=>{_()(i())!==!1&&x()};R(()=>{if(r())return co(()=>{t$.current+=1}),()=>{--t$.current}});var C=_Ze(),w=P(C),T=e=>{var n=hZe(),r=F(n);Gl(r,{get id(){return t.id},dir:`auto`,flex:!0,get placeholder(){return c()},get invalid(){return u()},get required(){return d()},get"aria-labelledby"(){return m()},get"aria-errormessage"(){return h()},onkeydown:e=>{let{key:t,isComposing:n}=e;n||t!==`Enter`&&t!==`Escape`||(e.preventDefault(),e.stopPropagation(),t===`Escape`?x():S())},get value(){return i()},set value(e){i(e)},get element(){return a()},set element(e){a(e)}});var o=L(r,2);{let e=e=>{Lc(e,{name:`check`})},n=j(()=>X(`done`));ll(o,{size:`small`,iconic:!0,get disabled(){return f()},get"aria-label"(){return B(n)},get"aria-controls"(){return t.id},onclick:()=>{S()},startIcon:e,$$slots:{startIcon:!0}})}var s=L(o,2);{let e=e=>{Lc(e,{name:`close`})},n=j(()=>X(`cancel`));ll(s,{size:`small`,iconic:!0,get"aria-label"(){return B(n)},get"aria-controls"(){return t.id},onclick:()=>{x()},startIcon:e,$$slots:{startIcon:!0}})}W(e,n)},ee=e=>{var n=gZe(),r=F(n),i=I(r,!0);ms(r,e=>N(y,e),()=>B(y));var a=L(r,2),c=e=>{ll(e,{size:`small`,iconic:!0,get"aria-label"(){return s()},get"aria-controls"(){return t.id},onclick:()=>{b()},get element(){return B(v)},set element(e){N(v,e,!0)},startIcon:e=>{Lc(e,{name:`edit`})},$$slots:{startIcon:!0}})};K(a,e=>{o()&&e(c)}),z(()=>{J(r,`id`,t.id),J(r,`dir`,p()),J(r,`aria-readonly`,l()),J(r,`aria-invalid`,u()),J(r,`aria-required`,d()),J(r,`aria-labelledby`,m()),J(r,`aria-errormessage`,h()),G(i,t.value),r.dir=r.dir}),W(e,n)};K(w,e=>{r()?e(T):e(ee,-1)}),O(C),W(e,C),A()}var yZe=({index:e,clientY:t,rect:n})=>t<n.top+n.height/2?e:e+1,i6=(e,t,n)=>{let r=[...e];return r.splice(n,0,...r.splice(t,1)),r},bZe=({dragIndex:e,dropIndex:t})=>{if(e!==void 0&&t!==void 0&&t!==e&&t!==e+1)return t>e?t-1:t},xZe=({key:e,index:t,itemCount:n})=>{if(e===`ArrowUp`||e===`Home`){let n=e===`ArrowUp`?t-1:0;return t>0?n:void 0}if(e===`ArrowDown`||e===`End`){let r=e===`ArrowDown`?t+1:n-1;return t<n-1?r:void 0}},SZe=e=>e>=3,CZe=({position:e,itemCount:t})=>{if(e!==void 0&&Number.isInteger(e))return e>=1&&e<=t?e-1:void 0},wZe=({target:e,listElement:t})=>{if(!t||!(e instanceof Element)||e===t||!t.contains(e))return;let n=e;for(;n.parentElement!==t;)n=n.parentElement;return{element:n,index:[...t.children].indexOf(n)}},TZe=[`move-up`,`move-down`,`reorder`,`move-options`],EZe=({item:e,action:t=`reorder`})=>{[t,...TZe].map(t=>e?.querySelector(`button[data-action="${t}"]`)).find(e=>e&&!e.disabled)?.focus()},DZe=({listElement:e,index:t,action:n})=>{EZe({item:e?.children[t],action:n})},a6=({index:e,getTarget:t,fallback:n})=>{let r=t(e)??t(e-1);r?r.focus():n?.()},o6=64,OZe=16,s6=void 0,kZe=e=>{let t=e.parentElement;for(;t;){let{overflowY:e}=globalThis.getComputedStyle(t);if([`auto`,`scroll`].includes(e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}},AZe=({clientY:e,rect:t})=>{let n=e-t.top,r=t.bottom-e;return n<o6?-16*(1-Math.max(n,0)/o6):r<o6?OZe*(1-Math.max(r,0)/o6):0},jZe=()=>{if(!s6)return;let{container:e,speed:t}=s6,{scrollTop:n,scrollHeight:r,clientHeight:i}=e,a=Math.min(Math.max(n+t,0),r-i);!t||a===n?s6.frame=void 0:(e.scrollTop=a,s6.frame=requestAnimationFrame(jZe))},MZe=e=>{let t=s6;t.speed=AZe({clientY:e.clientY,rect:t.container.getBoundingClientRect()}),t.speed&&t.frame===void 0&&(t.frame=requestAnimationFrame(jZe))},NZe=e=>{let t=e?kZe(e):void 0;t&&(s6={container:t,speed:0,frame:void 0},globalThis.addEventListener(`dragover`,MZe,!0))},PZe=()=>{s6&&=(globalThis.removeEventListener(`dragover`,MZe,!0),void 0)};function FZe(e,t){k(t,!0);let n=Y(t,`open`,15,!1),r=M(void 0),i=j(()=>CZe({position:B(r),itemCount:t.itemCount})),a=M(!1);R(()=>{n()&&(N(a,!0),N(r,t.index+1))});let o=()=>B(i)!==void 0&&(t.onMove(B(i)),!0);var s=U(),c=F(s),l=e=>{{let a=e=>{{let i=j(()=>X(`move_to_position`));CO(e,{flex:!0,autofocus:!0,min:1,get max(){return t.itemCount},required:!0,get ariaLabel(){return B(i)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(e.preventDefault(),o()&&n(!1))},get value(){return B(r)},set value(e){N(r,e,!0)}})}},s=j(()=>X(`move_to`)),c=j(()=>B(i)===void 0);Kl(e,{size:`x-small`,get title(){return B(s)},get okDisabled(){return B(c)},onOk:()=>{o()},get open(){return n()},set open(e){n(e)},input:a,children:(e,n)=>{$r();var r=H();z(e=>G(r,e),[()=>X(`move_to_description`,{values:{count:t.itemCount}})]),W(e,r)},$$slots:{input:!0,default:!0}})}};K(c,e=>{B(a)&&e(l)}),W(e,s),A()}var IZe=V(`<!> <!> <!>`,1);function LZe(e,t){k(t,!0);var n=IZe(),r=F(n);{let e=j(()=>X(`move_to_top`)),n=j(()=>t.index===0);iu(r,{get label(){return B(e)},get disabled(){return B(n)},onclick:()=>t.onMove(0,`move-options`)})}var i=L(r,2);{let e=j(()=>X(`move_to_bottom`)),n=j(()=>t.index===t.itemCount-1);iu(i,{get label(){return B(e)},get disabled(){return B(n)},onclick:()=>t.onMove(t.itemCount-1,`move-options`)})}var a=L(i,2);{let e=j(()=>X(`move_to`));iu(a,{get label(){return B(e)},get onclick(){return t.onMoveTo}})}W(e,n),A()}var RZe=V(`<!> <!> <!>`,1),zZe=V(`<!> <!>`,1),BZe={hash:`svelte-1djdbgy`,code:`button.drag-handle:not(:disabled) {cursor:grab;&:active {cursor:grabbing;}}`};function c6(e,t){k(t,!0),q(e,BZe);let n=Y(t,`disabled`,3,!1),r=Y(t,`size`,3,`small`),i=Y(t,`icon`,3,`drag_indicator`),a=Y(t,`part`,3,`auto`),o=Y(t,`menu`,3,!0),s=Y(t,`onGrab`,3,void 0),c=Y(t,`onRelease`,3,void 0),l=Y(t,`onMove`,3,void 0),u=()=>{globalThis.removeEventListener(`pointerup`,u),globalThis.removeEventListener(`pointercancel`,u),c()?.()},d=j(()=>sW.hasMouse&&a()!==`buttons`),f=M(!1),p=j(()=>a()===`buttons`||a()===`auto`&&!sW.hasMouse),m=j(()=>o()&&a()!==`handle`&&SZe(t.itemCount));var h=RZe(),g=F(h),_=e=>{{let a=e=>{Lc(e,{get name(){return i()}})},o=j(()=>X(`reorder_item`));ll(e,{get size(){return r()},get disabled(){return n()},iconic:!0,class:`drag-handle`,"data-action":`reorder`,get"aria-label"(){return B(o)},"aria-keyshortcuts":`ArrowUp ArrowDown Home End`,onpointerdown:()=>{s()?.(),globalThis.addEventListener(`pointerup`,u),globalThis.addEventListener(`pointercancel`,u)},onkeydown:e=>{let n=xZe({key:e.key,index:t.index,itemCount:t.itemCount});n!==void 0&&(e.preventDefault(),l()?.(n,`reorder`))},startIcon:a,$$slots:{startIcon:!0}})}};K(g,e=>{B(d)&&e(_)});var v=L(g,2),y=e=>{var i=RZe(),o=F(i);{let e=e=>{Lc(e,{name:`arrow_upward`})},i=j(()=>n()||t.index===0),a=j(()=>X(`move_up`));ll(o,{get size(){return r()},iconic:!0,get disabled(){return B(i)},"data-action":`move-up`,get"aria-label"(){return B(a)},onclick:()=>l()?.(t.index-1,`move-up`),startIcon:e,$$slots:{startIcon:!0}})}var s=L(o,2),c=e=>{Ml(e,{})};K(s,e=>{a()!==`buttons`&&e(c)});var u=L(s,2);{let e=e=>{Lc(e,{name:`arrow_downward`})},i=j(()=>n()||t.index===t.itemCount-1),a=j(()=>X(`move_down`));ll(u,{get size(){return r()},iconic:!0,get disabled(){return B(i)},"data-action":`move-down`,get"aria-label"(){return B(a)},onclick:()=>l()?.(t.index+1,`move-down`),startIcon:e,$$slots:{startIcon:!0}})}W(e,i)};K(v,e=>{B(p)&&e(y)});var b=L(v,2),x=e=>{var i=zZe(),a=F(i);{let e=e=>{{let n=j(()=>X(`reorder_options`));ru(e,{get ariaLabel(){return B(n)},children:(e,n)=>{LZe(e,{get index(){return t.index},get itemCount(){return t.itemCount},onMove:(e,t)=>l()?.(e,t),onMoveTo:()=>{N(f,!0)}})},$$slots:{default:!0}})}},i=j(()=>X(`reorder_options`));kl(a,{variant:`ghost`,get size(){return r()},iconic:!0,get disabled(){return n()},popupPosition:`bottom-right`,"data-action":`move-options`,get"aria-label"(){return B(i)},popup:e,$$slots:{popup:!0}})}FZe(L(a,2),{get index(){return t.index},get itemCount(){return t.itemCount},onMove:e=>l()?.(e,`move-options`),get open(){return B(f)},set open(e){N(f,e,!0)}}),W(e,i)};K(b,e=>{B(m)&&e(x)}),W(e,h),A()}var VZe=async({kind:e,...t})=>{let n=e??await BPe(t.value);return{kind:n,src:n?await SZ(t):void 0}},HZe=V(`<div role="none" class="reorder-controls svelte-1yfgkx5"><!></div>`),UZe=V(`<span role="none" class="preview no-thumbnail"><!></span>`),WZe=V(`<div role="status" class="note svelte-1yfgkx5"> </div>`),GZe=V(`<div role="none"><!> <!> <div role="none" class="svelte-1yfgkx5"><div role="none" class="path svelte-1yfgkx5"><!></div> <!> <div role="none"><!> <!></div></div></div> <!>`,1),KZe={hash:`svelte-1yfgkx5`,code:`.filled.svelte-1yfgkx5 {display:flex !important;align-items:center;position:relative;gap:12px;margin:var(--sui-focus-ring-width);background-color:var(--sui-primary-background-color); /* for dragging opacity */
|
||
|
||
/* The dragged item is left as a faint placeholder marking the gap it would drop into. The
|
||
pointer already carries the browser’s own drag image of it, so showing it twice at full
|
||
strength would just be confusing. */&.dragging {opacity:0.25;}.preview {flex:none;width:120px !important;height:120px !important;border-color:var(--sui-control-border-color) !important;border-radius:var(--sui-control-medium-border-radius);padding:8px !important;&.no-thumbnail {display:flex;align-items:center;justify-content:center;background-color:var(--sui-secondary-background-color);.icon {font-size:64px;}}}.sui.button.tertiary.small {margin:var(--sui-focus-ring-width);}& > div:where(.svelte-1yfgkx5) {flex:auto;overflow:hidden;.note:where(.svelte-1yfgkx5) {margin:4px 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.path:where(.svelte-1yfgkx5) {
|
||
@media (width < 768px) {font-size:var(--sui-font-size-small);
|
||
}}}&.sortable {gap:0;border-width:1px;border-style:solid;border-color:var(--sui-control-border-color) !important;border-radius:var(--sui-control-medium-border-radius);.preview {margin-inline-end:12px;border-radius:0;border-width:0 1px 0 0;}}}.reorder-controls.svelte-1yfgkx5 {flex:none !important;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;align-self:stretch;width:28px;background-color:var(--sui-secondary-border-color);}`};function qZe(e,t){k(t,!0),q(e,KZe);let n=Ez(),r=Y(t,`groupFieldId`,19,()=>t.fieldId),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1),o=Y(t,`required`,3,!1),s=Y(t,`collectionName`,3,``),c=Y(t,`fileName`,3,void 0),l=Y(t,`typedKeyPath`,3,void 0),u=Y(t,`componentName`,3,void 0),d=Y(t,`entry`,3,void 0),f=Y(t,`locale`,3,void 0),p=Y(t,`index`,3,0),m=Y(t,`itemCount`,3,1),h=Y(t,`dragging`,3,!1),g=M(void 0),_=M(void 0),v=M(void 0),y=M(void 0),b=M(!1),x=M(``),S=M(void 0),C=M(!1),w=M(!1),T=j(()=>t.fieldConfig.widget),ee=j(()=>B(T)===`image`),E=j(()=>B(T)===`file`&&t.fieldConfig.select_folder===!0),te=j(()=>!!t.onMove&&!i()),ne=j(()=>!!B(_)&&!!t.value?.startsWith(`blob:`)),re=j(()=>B(ne)&&!i()),ie=j(()=>B(_)?eXe({draft:n.current,blobURL:t.value}):void 0),ae=j(()=>B(_)?bk(B(_).name).extension:void 0),oe=j(()=>{let e=B(x).trim();return e?UX(e,{slugificationEnabled:FV({fieldConfig:t.fieldConfig}).config.slugify_filename}):``}),se=j(()=>bk(B(oe)).extension),ce=j(()=>({value:t.value,entry:d(),collectionName:s(),fileName:c(),componentName:u(),typedKeyPath:l(),fieldConfig:t.fieldConfig,locale:f()})),le=j(()=>nXe({draft:n.current,value:t.value,unsavedFileName:B(ie)})),ue=()=>{if(!B(_)||!n.current?.files[t.value])return;let e=new File([B(_)],B(oe),{type:B(_).type,lastModified:B(_).lastModified});n.current.files[t.value].file=e,delete n.current.files[t.value].nameTemplate,N(_,e,!0),N(b,!1)},de=()=>!B(_)||!B(oe)||B(oe)===B(ie)?!0:fP(B(ae),B(se))?(ue(),!0):(N(C,!0),!1),fe=async e=>{if(N(_,t.value?.startsWith(`blob:`)?n.current?.files[t.value]?.file:void 0,!0),N(g,void 0),N(v,void 0),N(y,void 0),!B(E)&&t.value){if(B(ee)&&/^https?:/.test(t.value))N(v,`image`),N(y,t.value,!0);else if(t.value.startsWith(`blob:`)||N(g,iX({...B(ce)}),!0),!B(g)){let t=await VZe({...B(ce),thumbnail:!0});e()||(N(v,t.kind,!0),N(y,t.src,!0))}}};YO(()=>t.value,()=>{let e=!1;return fe(()=>e),()=>{e=!0}});var pe=GZe(),me=F(pe);let he;var ge=P(me),_e=e=>{var n=HZe(),r=P(n);{let e=j(()=>m()<2);c6(r,{get index(){return p()},get itemCount(){return m()},get disabled(){return B(e)},onGrab:()=>{N(w,!0)},onRelease:()=>{N(w,!1)},get onMove(){return t.onMove}})}O(n),W(e,n)};K(ge,e=>{B(te)&&e(_e)});var ve=L(ge,2),ye=e=>{O$(e,{get kind(){return B(v)},get src(){return B(y)},variant:`tile`,checkerboard:!0})},be=e=>{O$(e,{get kind(){return B(g).kind},get asset(){return B(g)},variant:`tile`,checkerboard:!0})},xe=e=>{var t=UZe(),n=P(t);{let e=j(()=>B(E)?`folder`:`draft`);Lc(n,{get name(){return B(e)}})}O(t),W(e,t)};K(ve,e=>{B(v)&&B(y)?e(ye):B(g)?e(be,1):e(xe,-1)});var Se=L(ve,2),Ce=P(Se),we=P(Ce);{let e=j(()=>X(`rename`)),n=j(()=>!B(oe));r6(we,{get id(){return`${t.fieldId??``}-value`},get value(){return B(le)},get initialText(){return B(ie)},get canEdit(){return B(re)},get editLabel(){return B(e)},get readonly(){return i()},get invalid(){return a()},get required(){return o()},get applyDisabled(){return B(n)},dir:`ltr`,get ariaLabelledby(){return`${r()??``}-label`},get ariaErrormessage(){return`${r()??``}-error`},getSelectionEnd:e=>bk(e).filename.length,onApply:de,get editing(){return B(b)},set editing(e){N(b,e,!0)},get text(){return B(x)},set text(e){N(x,e,!0)},get inputElement(){return B(S)},set inputElement(e){N(S,e,!0)}})}O(Ce);var Te=L(Ce,2),Ee=e=>{var t=WZe(),n=I(t,!0);z(e=>G(n,e),[()=>X(`file_will_be_saved_as`,{values:{name:B(oe)}})]),W(e,t)},De=j(()=>B(b)&&B(oe)!==B(x).trim());K(Te,e=>{B(De)&&e(Ee)});var Oe=L(Te,2),ke=P(Oe),Ae=e=>{{let n=j(()=>X(`replace`)),r=j(()=>X(`replace_${B(T)}`));ll(e,{get disabled(){return i()},variant:`tertiary`,size:`small`,get label(){return B(n)},get"aria-label"(){return B(r)},get"aria-controls"(){return`${t.fieldId??``}-value`},onclick:()=>{t.onReplace()}})}};K(ke,e=>{t.onReplace&&e(Ae)});var je=L(ke,2),Me=e=>{{let n=j(()=>X(`remove`)),r=j(()=>X(`remove_${B(T)}`));ll(e,{get disabled(){return i()},variant:`tertiary`,size:`small`,get label(){return B(n)},get"aria-label"(){return B(r)},get"aria-controls"(){return`${t.fieldId??``}-value`},onclick:()=>{t.onRemove()}})}};K(je,e=>{t.onRemove&&e(Me)}),O(Oe),O(Se),O(me);var Ne=L(me,2);{let e=j(()=>X(`rename`));mZe(Ne,{get oldExtension(){return B(ae)},get newExtension(){return B(se)},get okLabel(){return B(e)},onOk:()=>{ue()},onCancel:()=>{B(S)?.focus()},get open(){return B(C)},set open(e){N(C,e,!0)}})}z(()=>{he=rs(me,1,`filled svelte-1yfgkx5`,null,he,{sortable:B(te),dragging:h()}),J(me,`draggable`,B(w))}),go(`dragstart`,me,e=>{t.onDragStart?.(),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,B(le)))}),go(`dragend`,me,()=>{N(w,!1),t.onDragEnd?.()}),W(e,pe),A()}var JZe=V(`<div role="none" class="buttons"><!> <!></div>`),YZe=V(`<div role="status"> </div>`),XZe=V(`<!> <!>`,1),ZZe=V(`<div role="none"><!> <div role="none" class="label svelte-1jvz1op"><!></div></div> <!>`,1),QZe={hash:`svelte-1jvz1op`,code:`.empty.svelte-1jvz1op {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;height:120px;margin:var(--sui-focus-ring-width);border-width:1px;border-style:solid;border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));border-radius:var(--sui-button-medium-border-radius);color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(
|
||
--sui-button-tertiary-background-color,
|
||
var(--sui-button-background-color)
|
||
);font-family:var(--sui-control-font-family);font-size:var(--sui-font-size-small);cursor:pointer;transition:all 200ms;&:not(.disabled):hover {background-color:var(
|
||
--sui-button-tertiary-background-color-focus,
|
||
var(--sui-hover-background-color)
|
||
);}&:not(.disabled):active {background-color:var(
|
||
--sui-button-tertiary-background-color-active,
|
||
var(--sui-active-background-color)
|
||
);}.icon {color:var(--sui-secondary-foreground-color);font-size:48px;}&.disabled {pointer-events:none !important;* {opacity:0.5;}}
|
||
|
||
@media (pointer: coarse) {cursor:default;&:active {
|
||
/* Reset the style because the element is non-interactive on touch devices */background-color:var(--sui-button-background-color) !important;}
|
||
}&.invalid {border-color:var(--sui-error-border-color);}}.label.svelte-1jvz1op {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0 4px;white-space:nowrap;.button {margin-block:0;}}`};function $Ze(e,t){k(t,!0),q(e,QZe);let n=e=>{var n=JZe(),r=P(n);{let e=j(()=>X(`browse`));ll(r,{get label(){return B(e)},variant:`tertiary`,size:`small`,get disabled(){return B(c)},onclick:e=>{e.stopPropagation(),a(!1),i(!0)},get element(){return B(l)},set element(e){N(l,e,!0)}})}var s=L(r,2),u=e=>{{let n=j(()=>X(t.isImageField?`paste_image`:`paste`));ll(e,{get label(){return B(n)},variant:`tertiary`,size:`small`,get disabled(){return B(c)},onclick:e=>{e.stopPropagation(),d()}})}};K(s,e=>{o()&&e(u)}),O(n),W(e,n)},r=Y(t,`selectFolder`,3,!1),i=Y(t,`showSelectAssetsDialog`,15,!1),a=Y(t,`replaceMode`,15,!1),o=Y(t,`onFilePaste`,3,void 0),s=na({show:!1,message:``}),c=j(()=>t.readonly||t.processing),l=M(void 0),u=()=>{B(l)?.focus()},d=async()=>{if(!B(c)&&o())try{let e=await navigator.clipboard.read(),t,n=e.find(e=>e.types.some(e=>{let n=e.startsWith(`image/`);return n&&(t=e),n}));if(n&&t){let e=await n.getType(t),r=t.split(`/`)[1].replace(`+xml`,``),i=new File([e],`pasted-image-${Date.now()}.${r}`,{type:t});o()(i);return}Object.assign(s,{message:X(`no_image_in_clipboard`),show:!0})}catch{Object.assign(s,{message:X(`clipboard_access_denied`),show:!0})}};var f={focus:u},p=ZZe(),m=F(p);let h;var g=P(m);{let e=j(()=>r()?`folder`:`cloud_upload`);Lc(g,{get name(){return B(e)}})}var _=L(g,2),v=P(_),y=e=>{var n=YZe(),r=I(n,!0);z(e=>G(r,e),[()=>X(`processing_files`,{values:{count:t.multiple?2:1}})]),W(e,n)},b=e=>{var r=XZe(),i=F(r),a=e=>{var t=H();z(e=>G(t,e),[()=>X(`click_to_browse`)]),W(e,t)},o=e=>{var n=H();z(e=>G(n,e),[()=>X(`drop_image_files_or`,{values:{count:t.multiple?2:1}})]),W(e,n)},s=e=>{var n=H();z(e=>G(n,e),[()=>X(`drop_files_or`,{values:{count:t.multiple?2:1}})]),W(e,n)};K(i,e=>{t.allowDrop?t.isImageField?e(o,1):e(s,-1):e(a)});var c=L(i,2);n(c),W(e,r)},x=e=>{n(e)};return K(v,e=>{t.processing?e(y):sW.hasMouse?e(b,1):e(x,-1)}),O(_),O(m),Pu(L(m,2),{get show(){return s.show},set show(e){s.show=e},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(()=>G(n,s.message)),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),z(()=>h=rs(m,1,`empty svelte-1jvz1op`,null,h,{invalid:t.invalid,processing:t.processing,disabled:B(c)})),_o(`click`,m,()=>{sW.hasMouse&&!B(c)&&(a(!1),i(!0))}),_o(`keydown`,m,e=>{!B(c)&&qc(e,`Accel+V`)&&(e.preventDefault(),d())}),W(e,p),A(f)}vo([`click`,`keydown`]);var l6=(e,t)=>{Object.entries(t).forEach(([t,n])=>{e[t]!==n&&(e[t]=n)}),Object.keys(e).forEach(n=>{n in t||delete e[n]})},eQe=(e,t)=>[Ij(e,t,{live:!0})??[],Object.fromEntries(Object.entries(e).filter(([e])=>!dj(e,t)))],tQe=(e,t,n)=>{let r=`${t}.`,i={},a=new Map;return Object.entries(e).forEach(([e,t])=>{let[,n,o]=e.startsWith(r)?e.slice(r.length).match(/^(\d+)($|[.#].*)/)??[]:[];n===void 0?i[e]=t:a.set(Number(n),[...a.get(Number(n))??[],[o,t]])}),n.forEach((e,t)=>{typeof e==`number`?a.get(e)?.forEach(([e,n])=>{i[`${r}${t}${e}`]=n}):i[`${r}${t}`]=e}),i},nQe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,manipulate:i})=>{let{defaultLocale:a}=BA(e),[o,s]=eQe(e[n][t],r),c=t===a,l=c?[...Array(o.length).keys()]:[];i({valueList:o,expanderStateList:l}),iz(()=>{l6(e[n][t],{...Aj(o,r),...s}),c&&l6(e.expanderStates._,tQe(e.expanderStates._,r,l))})},u6=({draft:e,locale:t,i18n:n,pairedItems:r=!1,fieldConfig:i,valueStoreKey:a=`currentValues`,keyPath:o,manipulate:s})=>{let c=(e,t,n)=>e.map(e=>rje({fieldConfig:i,value:e,sourceLocale:t,targetLocale:n})),{defaultLocale:l}=BA(e);e6({valueStore:e[a],locale:t,i18n:r&&t===l?`duplicate`:n,draft:e,keyPath:o},(n,r)=>{nQe({draft:e,locale:r,valueStoreKey:a,keyPath:o,manipulate:!i||r===t?({valueList:e,expanderStateList:t})=>s({valueList:e,expanderStateList:t,locale:r}):({valueList:e,expanderStateList:n})=>{let i=c(e,r,t);s({valueList:i,expanderStateList:n,locale:t}),e.splice(0,e.length,...c(i,t,r))}})})},rQe=(e,t)=>Ij(e,t,{live:!0})??[],iQe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,from:i,to:a})=>{let o=e[n][t],s=rQe(o,r);i!==a&&i in s&&a in s&&(s.splice(a,0,...s.splice(i,1)),s.forEach((e,t)=>{o[`${r}.${t}`]=e}))},aQe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,newValues:i,replaceIndex:a,max:o=1/0})=>{let s=e[n][t];if(a!==void 0){let[e]=i;e!==void 0&&(s[`${r}.${a}`]=e);return}let{length:c}=rQe(s,r);i.slice(0,Math.max(0,o-c)).forEach((e,t)=>{s[`${r}.${c+t}`]=e})},oQe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,index:i})=>{let a=e[n][t];for(let e=i;;e+=1){let t=`${r}.${e}`,n=`${r}.${e+1}`;if(n in a)a[t]=a[n];else{a[t]=null,delete a[t];break}}},d6=({getItemCount:e,getListElement:t,onMove:n,getItemData:r,settle:i=ao,getItemRect:a=e=>e.getBoundingClientRect()})=>{let o=M(void 0),s=M(void 0),c=[],l=j(()=>{let t=e(),n=B(s)?.previewOrder.length===t?B(s).previewOrder:[...Array(t).keys()];return(n.length!==c.length||n.some((e,t)=>e!==c[t]))&&(c=n),c}),u=()=>{PZe(),N(o,void 0),N(s,void 0)},d=async(e,r,a=`reorder`)=>{n(e,r),await i(),DZe({listElement:t(),index:r,action:a})},f=(e,n,r)=>{N(s,{index:e,previewOrder:[...B(l)]}),NZe(t()),n?.dataTransfer&&(n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,r??``))},p={get grabbedIndex(){return B(o)},get dragIndex(){return B(s)?.index},get displayOrder(){return B(l)},grab:e=>{N(o,e,!0)},release:()=>{N(o,void 0)},move:d,onDragStart:f,onDragOver:e=>{if(!B(s))return;e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let n=wZe({target:e.target,listElement:t()});if(!n)return;let{index:r,previewOrder:i}=B(s),o=i.indexOf(r),c=bZe({dragIndex:o,dropIndex:yZe({index:n.index,clientY:e.clientY,rect:a(n.element)})});c!==void 0&&N(s,{index:r,previewOrder:i6(i,o,c)})},onDrop:e=>{if(!B(s))return;e.stopPropagation(),e.preventDefault();let{index:t,previewOrder:n}=B(s),r=n.indexOf(t);u(),r!==t&&d(t,r)},onDragEnd:u,get listProps(){return{ondragovercapture:p.onDragOver,ondropcapture:p.onDrop}},reorderControlProps:e=>({onGrab:()=>{N(o,e,!0)},onRelease:()=>{N(o,void 0)},onMove:(t,n)=>d(e,t,n)}),itemProps:(e,{ownEventsOnly:t=!1}={})=>({draggable:B(o)===e,ondragstart:n=>{t&&n.target!==n.currentTarget||f(e,n,r?.(e))},ondragend:e=>{t&&e.target!==e.currentTarget||u()}})};return p},sQe=V(`<div role="none"><!></div>`),cQe=V(`<div></div> <!>`,1),lQe=V(`<div role="none"> </div> <div role="none"><!></div>`,1),uQe=V(`<!> <!> <!> <!> <!>`,1),dQe={hash:`svelte-17jic1t`,code:`.item-list.svelte-17jic1t {display:flex;flex-direction:column;gap:4px;& ~ [role='button'] {margin-top:calc(4px + var(--sui-focus-ring-width));}}`};function fQe(e,t){k(t,!0),q(e,dQe);let n=e=>{{let t=j(()=>B(ne)?void 0:e=>{N(h,!1),De([{file:e,folder:B(pe)}])});ms($Ze(e,{get allowDrop(){return B(we)},get invalid(){return p()},get readonly(){return f()},get processing(){return B(b)},get isImageField(){return B(se)},get multiple(){return B(he)},get selectFolder(){return B(ne)},get onFilePaste(){return B(t)},get showSelectAssetsDialog(){return B(m)},set showSelectAssetsDialog(e){N(m,e,!0)},get replaceMode(){return B(h)},set replaceMode(e){N(h,e,!0)}}),e=>N(w,e,!0),()=>B(w))}},r=e=>{var r=U(),i=F(r),a=e=>{var r=U(),i=F(r),a=e=>{var r=U(),i=F(r),a=e=>{var r=cQe(),i=F(r);us(i,()=>({role:`none`,class:`item-list`,...Ae.listProps}),void 0,void 0,void 0,`svelte-17jic1t`),Ro(i,29,()=>Ae.displayOrder,e=>`${u()[e]}|${e}`,(e,n)=>{var r=sQe(),i=P(r);{let e=j(()=>Ae.dragIndex===B(n));qZe(i,_s(()=>B(be),{get index(){return B(n)},get itemCount(){return B(ge)},get value(){return u()[B(n)]},get fieldId(){return`${t.fieldId??``}-${B(n)??``}`},get groupFieldId(){return t.fieldId},get dragging(){return B(e)},onReplace:()=>{N(h,!0),N(g,B(n),!0),N(m,!0)},onRemove:()=>ke(B(n)),onDragStart:()=>Ae.onDragStart(B(n)),get onDragEnd(){return Ae.onDragEnd},onMove:(e,t)=>Ae.move(B(n),e,t)}))}O(r),Xo(r,()=>_u,()=>({duration:200})),W(e,r)}),O(i),ms(i,e=>N(C,e),()=>B(C));var a=L(i,2),o=e=>{n(e)};K(a,e=>{u().length<B(ee)&&e(o)}),W(e,r)},o=j(()=>Array.isArray(u()));K(i,e=>{B(o)&&e(a)}),W(e,r)},o=e=>{{let n=j(()=>B(ye)?Ee:void 0);qZe(e,_s(()=>B(be),{get value(){return u()},get fieldId(){return t.fieldId},onReplace:()=>{N(h,!0),N(m,!0)},get onRemove(){return B(n)}}))}};K(i,e=>{B(he)?e(a):typeof u()==`string`&&u()&&e(o,1)}),W(e,r)},o=e=>{n(e)};K(i,e=>{u()?.length&&!B(b)?e(a):e(o,-1)}),W(e,r)},i=Ez(),{valueStoreKey:a=`currentValues`,fieldContext:o=void 0,parentComponentNames:s=[]}=Mz(),c=jz(a),l=s.at(-1),u=Y(t,`currentValue`,15),d=Y(t,`required`,3,!0),f=Y(t,`readonly`,3,!1),p=Y(t,`invalid`,3,!1),m=M(!1),h=M(!1),g=M(-1),_=M(!1),v=M(``),y=M(void 0),b=M(!1),x=M(void 0),S=M(na([])),C=M(void 0),w=M(void 0),T=j(()=>t.fieldConfig.widget),ee=j(()=>Nr(t.fieldConfig.max,1/0)),E=j(()=>t.fieldConfig.accept),te=j(()=>Nr(t.fieldConfig.choose_url,!0)),ne=j(()=>B(T)===`file`&&t.fieldConfig.select_folder===!0),re=j(()=>i.current?.originalEntry),ie=j(()=>i.current?.collectionName??``),ae=j(()=>i.current?.fileName),oe=j(()=>i.current?.isIndexFile??!1),se=j(()=>B(T)===`image`),ce=j(()=>B(se)?`image`:void 0),le=j(()=>w3({collectionName:B(ie),fileName:B(ae),isIndexFile:B(oe),componentName:l,typedKeyPath:t.typedKeyPath,fieldConfig:t.fieldConfig})),ue=j(()=>B(le).libraryConfig),de=j(()=>RV({accept:B(E),image:B(se),transformations:B(ue).transformations})),fe=j(()=>B(le).folderMap),pe=j(()=>B(le).folder),me=v3({getDraft:()=>i.current,getFolder:()=>B(pe),getLocale:()=>t.locale,getKind:()=>B(ce),getAccept:()=>B(de),getSlugificationEnabled:()=>B(ue).slugify_filename}),he=j(()=>sM(t.fieldConfig)),ge=j(()=>Array.isArray(u())?u().length:0),_e=j(()=>B(he)&&B(ge)>=B(ee)),ve=j(()=>B(ue).max_file_size),ye=j(()=>!d()&&(!o||![`rich-text-editor-component`,`single-subfield-list-field`].includes(o))),be=j(()=>({fieldConfig:t.fieldConfig,readonly:f(),invalid:p(),required:d(),collectionName:B(ie),fileName:B(ae),componentName:l,typedKeyPath:t.typedKeyPath,entry:B(re),locale:t.locale})),xe=j(()=>B(le).cloudServiceEntries),Se=j(()=>B(le).enabled&&!!B(pe)),Ce=j(()=>+!!B(Se)+B(xe).length),we=j(()=>B(Ce)===1&&!B(ne)),Te=()=>{B(y)?.reset(),B(he)||(u(``),Vi())},Ee=async()=>{Te(),await ao(),B(w)?.focus()},De=async e=>{let n=i.current;if(!n)return;let r=B(he)?void 0:u();Te(),N(b,!0);try{let o=await T3({draft:n,resources:e,folder:B(pe),libraryConfig:B(ue),accept:B(de),locale:t.locale});if(i.current!==n)return;let{values:s,value:l,credit:d,rejected:f}=hXe({resources:o,multiple:B(he),previousValue:r,inEditorComponent:c});B(he)?aQe({draft:n,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,newValues:s,replaceIndex:B(h)?B(g):void 0,max:B(ee)}):u(l),N(v,d,!0),d&&N(_,!0),B(x)?.report(f)}finally{N(b,!1)}},Oe=async({files:e})=>{if(e.length){if(N(h,!1),B(Se)){let t=await c3({files:e,listedAssets:me.listedAssets});if(t===void 0)return;De(e.map(e=>({file:e,folder:B(pe),replace:t})))}else N(S,e,!0),N(m,!0)}},ke=async e=>{let n=i.current;n&&(oQe({draft:n,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,index:e}),await ao(),a6({index:e,getTarget:e=>{let n=B(C)?.querySelectorAll(`button[aria-controls="${t.fieldId}-${e}-value"]`);return n?.[n.length-1]},fallback:()=>{B(w)?.focus()}}))},Ae=d6({getItemCount:()=>B(ge),getListElement:()=>B(C),onMove:(e,n)=>{let r=i.current;r&&iQe({draft:r,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,from:e,to:n})},settle:()=>Zc(50)});var je=uQe(),Me=F(je),Ne=e=>{{let t=j(()=>f()||Ae.dragIndex!==void 0||B(_e));ms(R$(e,{get multiple(){return B(he)},get disabled(){return B(t)},get accept(){return B(de)},filterDroppedFiles:!1,onDrop:Oe,children:(e,t)=>{r(e)},$$slots:{default:!0}}),e=>N(y,e,!0),()=>B(y))}},Pe=e=>{r(e)};K(Me,e=>{B(we)?e(Ne):e(Pe,-1)});var Fe=L(Me,2);{let e=j(()=>!B(h)&&B(he));S3(Fe,{get kind(){return B(ce)},get multiple(){return B(e)},get accept(){return B(de)},get canEnterURL(){return B(te)},get selectFolder(){return B(ne)},get draft(){return i.current},get locale(){return t.locale},get fieldConfig(){return t.fieldConfig},get assetLibraryFolderMap(){return B(fe)},get enabledCloudServiceEntries(){return B(xe)},onSelect:De,get open(){return B(m)},set open(e){N(m,e,!0)},get pendingFiles(){return B(S)},set pendingFiles(e){N(S,e,!0)}})}var Ie=L(Fe,2);C3(Ie,{});var Le=L(Ie,2);ms(V$(Le,{get maxSize(){return B(ve)},get accept(){return B(de)}}),e=>N(x,e,!0),()=>B(x));var Re=L(Le,2);{let e=j(()=>X(`assets_dialog.photo_credit.title`)),t=j(()=>X(`copy`));Il(Re,{get title(){return B(e)},get okLabel(){return B(t)},onOk:()=>{navigator.clipboard.writeText(B(v))},get open(){return B(_)},set open(e){N(_,e,!0)},children:(e,t)=>{var n=lQe(),r=F(n),i=I(r,!0),a=L(r,2);mO(P(a),{dir:`auto`,flex:!0,readonly:!0,get value(){return B(v)},onclick:e=>{e.target.focus(),e.target.select()}}),O(a),z(e=>G(i,e),[()=>X(`assets_dialog.photo_credit.description`)]),W(e,n)},$$slots:{default:!0}})}W(e,je),A()}var pQe=V(`<p class="svelte-28vcoi"><!></p>`),mQe=V(`<p class="svelte-28vcoi"> </p>`),hQe={hash:`svelte-28vcoi`,code:`
|
||
/* Remove the padding to make the image full-width on small screens */
|
||
@media (width < 768px) {[role='document'] section > p.svelte-28vcoi:has(img) {margin-inline:calc(var(--entry-preview-padding-inline) * -1);}
|
||
}`};function gQe(e,t){k(t,!0),q(e,hQe);let n=Ez(),r=Y(t,`typedKeyPath`,3,void 0),i=Y(t,`locale`,3,void 0),a=M(void 0),o=M(void 0),s=j(()=>t.fieldConfig.widget),c=j(()=>B(s)===`image`),l=j(()=>n.current?.originalEntry),u=j(()=>n.current?.collectionName??``),d=j(()=>n.current?.fileName);XO(()=>(t.value,co(async()=>t.value?VZe({value:t.value,kind:B(c)?`image`:void 0,entry:B(l),collectionName:B(u),fileName:B(d),fieldConfig:t.fieldConfig,typedKeyPath:r(),locale:i()}):{kind:void 0,src:void 0})),e=>{N(a,e.kind,!0),N(o,e.src,!0)});var f=U(),p=F(f),m=e=>{var t=pQe(),n=P(t);{let e=j(()=>[`audio`,`video`].includes(B(a)));O$(n,{get kind(){return B(a)},get src(){return B(o)},get controls(){return B(e)}})}O(t),W(e,t)},h=e=>{var n=mQe(),r=I(n,!0);z(()=>G(r,t.value)),W(e,n)},g=j(()=>typeof t.value==`string`&&t.value.trim()&&!t.value.startsWith(`blob:`));K(p,e=>{B(a)&&B(o)?e(m):B(g)&&e(h,1)}),W(e,f),A()}function _Qe(e,t){k(t,!0);var n=U(),r=F(n),i=e=>{var n=U(),r=F(n),i=e=>{var n=U();Ro(F(n),19,()=>t.currentValue,(e,t)=>`${e}-${t}`,(e,n)=>{gQe(e,{get value(){return B(n)},get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get locale(){return t.locale}})}),W(e,n)},a=j(()=>Array.isArray(t.currentValue));K(r,e=>{B(a)&&e(i)}),W(e,n)},a=j(()=>sM(t.fieldConfig)),o=e=>{gQe(e,{get value(){return t.currentValue},get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get locale(){return t.locale}})};K(r,e=>{B(a)?e(i):typeof t.currentValue==`string`&&t.currentValue&&e(o,1)}),W(e,n),A()}var vQe=V(`<div role="alert" class="validation svelte-6wra4i"><div role="none" class="svelte-6wra4i"><!> <!></div></div>`),yQe={hash:`svelte-6wra4i`,code:`.validation.svelte-6wra4i {color:var(--sui-error-foreground-color) !important;font-size:var(--sui-font-size-small);div:where(.svelte-6wra4i) {display:flex;align-items:center;gap:4px;margin:4px 0 0;.icon {flex:none;font-size:16px; /* !hardcoded */}}}`};function f6(e,t){q(e,yQe);let n=Y(t,`id`,3,void 0),r=Y(t,`live`,3,`polite`);var i=vQe(),a=P(i),o=P(a);Lc(o,{name:`error`}),Uo(L(o,2),()=>t.children),O(a),O(i),z(()=>{J(i,`id`,n()),J(i,`aria-live`,r())}),W(e,i)}var bQe=V(`<span role="none" class="type-label"> </span> <span role="none" class="type-description svelte-kkc51a"> </span>`,1),xQe={hash:`svelte-kkc51a`,code:`.sui.menuitem.variable-type-described {--sui-menuitem-height: auto;--sui-menuitem-padding: 8px 16px;.content {display:flex;flex-direction:column;gap:2px;}}.type-description.svelte-kkc51a {max-width:320px;white-space:normal;text-align:start;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}button:hover .type-description.svelte-kkc51a {color:inherit;}`};function p6(e,t){let n=Co();k(t,!0),q(e,xQe);let r=Y(t,`disabled`,3,!1),i=Y(t,`locale`,3,void 0),a=Y(t,`items`,19,()=>[]),o=Y(t,`addItem`,3,()=>void 0),s=j(()=>t.fieldConfig.types),c=j(()=>t.fieldConfig.widget===`object`?void 0:t.fieldConfig),l=j(()=>B(c)?TR({config:B(c),option:`label_singular`,locale:i()}):void 0),u=j(()=>B(c)?.max??1/0),d=j(()=>X(`add_x`,{values:{name:B(l)||ER({config:t.fieldConfig,locale:i()})}})),f=j(()=>a().length>=B(u));var p=U(),m=F(p),h=e=>{},g=e=>{kl(e,{variant:`tertiary`,size:`small`,get label(){return B(d)},get disabled(){return r()},startIcon:e=>{Lc(e,{name:`add`})},endIcon:e=>{},popup:e=>{{let t=j(()=>X(`select_list_type`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var r=U();Ro(F(r),19,()=>B(s),e=>e.name,(e,t,r)=>{let a=j(()=>B(t)),s=j(()=>ER({config:B(t),locale:i()}));var c=U(),l=F(c),u=e=>{let t=j(()=>`${n}-type-${B(r)}-description`);iu(e,{class:`variable-type-described`,get"aria-label"(){return B(s)},get"aria-describedby"(){return B(t)},onclick:()=>o()({type:B(a).name}),children:(e,n)=>{var r=bQe(),i=F(r),o=I(i,!0),c=L(i,2),l=I(c,!0);z(()=>{G(o,B(s)),J(c,`id`,B(t)),G(l,B(a).description)}),W(e,r)},$$slots:{default:!0}})},d=e=>{iu(e,{get label(){return B(s)},onclick:()=>o()({type:B(a).name})})};K(l,e=>{B(a).description?e(u):e(d,-1)}),W(e,c)}),W(e,r)},$$slots:{default:!0}})}},$$slots:{startIcon:!0,endIcon:!0,popup:!0}})},_=j(()=>Array.isArray(B(s))),v=e=>{ll(e,{variant:`tertiary`,size:`small`,get label(){return B(d)},get disabled(){return r()},onclick:()=>o()(),startIcon:e=>{Lc(e,{name:`add`})},$$slots:{startIcon:!0}})};K(m,e=>{B(f)?e(h):B(_)?e(g,1):e(v,-1)}),W(e,p),A()}var SQe=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,locale:r})=>ez(e[t][r]??{},n),CQe=({pairs:e,edited:t})=>e.map(([e],n,r)=>{if(!e.trim()&&t[n])return`empty`;if(e.trim()&&r.findIndex(t=>t[0]===e)!==n)return`duplicate`}),wQe=e=>e.filter(([e])=>e.trim()),TQe=({rows:e,storedPairs:t})=>!(0,Cr.default)(wQe(e),t),EQe=({storedPairs:e,storedValue:t})=>!e.length&&t!==null,DQe=({rows:e,validations:t,getStoredPairs:n})=>{if(t.some(Boolean))return;let r=wQe(e);return r.length?r.length===e.length?r:void 0:n().some(([e])=>e.trim())?r:void 0},OQe=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,locale:r,fieldConfig:i,pairs:a})=>{let{i18n:o}=i,s=e[t];e6({valueStore:s,locale:r,i18n:o,draft:e,keyPath:n},e=>{tz(e,n,a),a.length||(e[n]=null)}),o===`duplicate_keys`&&r===e.defaultLocale&&Z3({valueStore:s,defaultLocale:r,keyPath:n})},kQe=(e=[])=>{let t=0,n=()=>(t+=1,t-1),r=M(na(e)),i=M(na(e.map(n)));return{get values(){return B(r)},get ids(){return B(i)},insert:(e,t)=>{B(r).splice(e,0,t),B(i).splice(e,0,n())},remove:e=>{B(r).splice(e,1),B(i).splice(e,1)},move:(e,t)=>{N(r,i6(B(r),e,t),!0),N(i,i6(B(i),e,t),!0)},replace:(e,{keepIds:t=!1}={})=>{let a=B(i);N(r,e,!0),N(i,e.map((e,r)=>t&&r<a.length?a[r]:n()),!0)}}},AQe=V(`<th scope="col" class="reorder svelte-u0prcz"></th>`),jQe=V(`<th scope="col" class="action svelte-u0prcz"></th>`),MQe=V(`<td class="reorder svelte-u0prcz"><div role="none" class="svelte-u0prcz"><!></div></td>`),NQe=V(`<td class="action svelte-u0prcz"><!></td>`),PQe=V(`<tr><!><td class="key svelte-u0prcz"><!></td><td class="value svelte-u0prcz"><!></td><!></tr>`),FQe=V(`<table class="svelte-u0prcz"><thead><tr class="svelte-u0prcz"><!><th scope="col" class="key svelte-u0prcz"> </th><th scope="col" class="value svelte-u0prcz"> </th><!></tr></thead><tbody></tbody></table>`),IQe=V(`<!> <!>`,1),LQe=V(`<div role="none" class="toolbar svelte-u0prcz"><!></div>`),RQe=V(`<!> <!> <!>`,1),zQe={hash:`svelte-u0prcz`,code:`.toolbar.svelte-u0prcz {display:flex;align-items:center;margin-block-start:8px;&:first-child {margin-block-start:0;}}table.svelte-u0prcz {
|
||
/* Space the cells like the items of a List field. The outer spacing is cancelled out by the
|
||
negative margins, which the stretched width makes up for */margin:-4px;border-collapse:separate;border-spacing:4px;width:-moz-available;width:-webkit-fill-available;width:stretch;}th.svelte-u0prcz,
|
||
td.svelte-u0prcz {border-width:0;}th.svelte-u0prcz {padding-block:4px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal);text-align:start;&.key,
|
||
&.value {width:50%;}}td.svelte-u0prcz {padding:0;vertical-align:middle;&.reorder div:where(.svelte-u0prcz) {display:flex;align-items:center;}}tr.svelte-u0prcz {
|
||
/* The dragged row is left as a faint placeholder marking the gap it would drop into, like the
|
||
items of a List field */&.dragging {opacity:0.25;}}`};function BQe(e,t){k(t,!0),q(e,zQe);let n=Ez(),{valueStoreKey:r=`currentValues`}=Mz(),i=Y(t,`readonly`,3,!1),a=j(()=>Nr(t.fieldConfig.i18n,!1)),o=j(()=>t.fieldConfig.key_label),s=j(()=>t.fieldConfig.value_label),c=j(()=>Nr(t.fieldConfig.max,1/0)),l=j(()=>B(o)||X(`key_value.key`)),u=j(()=>B(s)||X(`key_value.value`)),d=j(()=>n.current?.defaultLocale),f=j(()=>i()||B(a)===`duplicate_keys`&&t.locale!==B(d)),p=kQe([]),m=na([]),h=M(void 0),g=M(na([])),_=M(na([])),v=j(()=>p.values.length===1&&!p.values[0][0]&&!p.values[0][1]),y=()=>{!p.values.length&&!B(f)&&(p.insert(p.values.length,[``,``]),B(g).push(!1))},b=()=>{let e=n.current;if(!e)return;let i=SQe({draft:e,valueStoreKey:r,keyPath:t.keyPath,locale:t.locale}),a=e[r][t.locale];if(TQe({rows:p.values,storedPairs:i})&&(p.replace([...i],{keepIds:!0}),N(g,i.map(()=>!1),!0)),y(),EQe({storedPairs:i,storedValue:a[t.keyPath]})){let e=t.keyPath;kz(()=>{a[e]=null})}},x=()=>{p.insert(p.values.length,[``,``]),B(g).push(!1),window.requestAnimationFrame(()=>{m[p.values.length-1].querySelector(`input`).focus()})},S=async e=>{p.remove(e),B(g).splice(e,1),y(),await ao();let{rows:t}=B(h);a6({index:e,getTarget:e=>{let n=t[e];return n&&(n.querySelector(`td.action button:enabled`)??n.querySelector(`td.key input`))}})},C=d6({getItemCount:()=>p.values.length,getListElement:()=>B(h),onMove:(e,t)=>{p.move(e,t),N(g,i6(B(g),e,t),!0)},getItemData:e=>p.values[e][0]}),w=()=>{let e=n.current;if(N(_,CQe({pairs:p.values,edited:B(g)}),!0),!e)return;let i=DQe({rows:p.values,validations:B(_),getStoredPairs:()=>SQe({draft:e,valueStoreKey:r,keyPath:t.keyPath,locale:t.locale})});if(!i)return;let a={draft:e,valueStoreKey:r,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,pairs:ai(i)};kz(()=>{OQe(a)})},T=qO(()=>{let e=bz(n.current,t.locale,t.keyPath,r);return[ez(e,t.keyPath,{live:!1}),e[t.keyPath]]});YO(()=>[T.current],()=>{b()}),YO(()=>ai(p.values),()=>{w()});var ee=RQe(),E=F(ee),te=e=>{var n=FQe(),r=P(n),a=P(r),o=P(a),s=e=>{var t=AQe();z(e=>J(t,`aria-label`,e),[()=>X(`reorder`)]),W(e,t)};K(o,e=>{B(f)||e(s)});var d=L(o),y=I(d,!0),b=L(d),w=I(b,!0),T=L(b),ee=e=>{var t=jQe();z(e=>J(t,`aria-label`,e),[()=>X(`key_value.action`)]),W(e,t)};K(T,e=>{B(f)||e(ee)}),O(a),O(r);var E=L(r);us(E,()=>({...C.listProps}),void 0,void 0,void 0,`svelte-u0prcz`),Ro(E,29,()=>C.displayOrder,e=>p.ids[e],(e,n)=>{var r=PQe();us(r,e=>({...e,[cs]:{dragging:C.dragIndex===B(n)}}),[()=>C.itemProps(B(n))],void 0,void 0,`svelte-u0prcz`);var a=P(r),o=e=>{var t=MQe(),r=P(t),i=P(r);{let e=j(()=>p.values.length<2),t=j(()=>C.reorderControlProps(B(n)));c6(i,_s({get index(){return B(n)},get itemCount(){return p.values.length},get disabled(){return B(e)}},()=>B(t)))}O(r),O(t),W(e,t)};K(a,e=>{B(f)||e(o)});var s=L(a),d=P(s);{let e=j(()=>!!B(_)[B(n)]),r=j(()=>B(_)[B(n)]?`${t.fieldId}-kv-error`:void 0);Gl(d,{dir:`ltr`,get readonly(){return B(f)},flex:!0,get invalid(){return B(e)},get ariaLabel(){return B(l)},get"aria-errormessage"(){return B(r)},oninput:()=>{B(g)[B(n)]=!0},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&m[B(n)].querySelector(`td.value input`).focus()},get value(){return p.values[B(n)][0]},set value(e){p.values[B(n)][0]=e}})}O(s);var h=L(s),y=P(h);{let e=j(()=>OA(t.locale));Gl(y,{get dir(){return B(e)},get readonly(){return i()},flex:!0,get ariaLabel(){return B(u)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(B(n)<p.values.length-1?m[B(n)+1].querySelector(B(f)?`td.value input`:`td.key input`).focus():!B(f)&&p.values.length<B(c)&&x())},get value(){return p.values[B(n)][1]},set value(e){p.values[B(n)][1]=e}})}O(h);var b=L(h),w=e=>{var t=NQe();P$(P(t),{variant:`ghost`,get disabled(){return B(v)},onclick:()=>{S(B(n))}}),O(t),W(e,t)};K(b,e=>{B(f)||e(w)}),O(r),ms(r,(e,t)=>m[t]=e,e=>m?.[e],()=>[B(n)]),Xo(r,()=>_u,()=>({duration:200})),W(e,r)}),O(E),ms(E,e=>N(h,e),()=>B(h)),O(n),z(()=>{G(y,B(l)),G(w,B(u))}),W(e,n)};K(E,e=>{p.values.length&&e(te)});var ne=L(E,2),re=e=>{f6(e,{get id(){return`${t.fieldId??``}-kv-error`},children:(e,t)=>{var n=IQe(),r=F(n),i=e=>{var t=H();z(e=>G(t,e),[()=>X(`key_value.empty_key`)]),W(e,t)},a=j(()=>B(_).includes(`empty`));K(r,e=>{B(a)&&e(i)});var o=L(r,2),s=e=>{var t=H();z(e=>G(t,e),[()=>X(`key_value.duplicate_key`)]),W(e,t)},c=j(()=>B(_).includes(`duplicate`));K(o,e=>{B(c)&&e(s)}),W(e,n)},$$slots:{default:!0}})},ie=j(()=>B(_).some(Boolean));K(ne,e=>{B(ie)&&e(re)});var ae=L(ne,2),oe=e=>{var n=LQe();p6(P(n),{get disabled(){return B(f)},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return p.values},addItem:()=>{x()}}),O(n),W(e,n)};K(ae,e=>{p.values.length<B(c)&&e(oe)}),W(e,ee),A()}var VQe=V(`<tr><td class="svelte-11sa460"> </td><td class="svelte-11sa460"> </td></tr>`),HQe=V(`<table class="svelte-11sa460"><thead><tr><th scope="col" class="svelte-11sa460"> </th><th scope="col" class="svelte-11sa460"> </th></tr></thead><tbody></tbody></table>`),UQe={hash:`svelte-11sa460`,code:`table.svelte-11sa460 {width:-moz-available;width:-webkit-fill-available;width:stretch;}th.svelte-11sa460 {padding-block:4px;width:50%;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal);text-align:start;}td.svelte-11sa460 {&:empty::after {content:'\\00a0'; /* nbsp */}}`};function WQe(e,t){k(t,!0),q(e,UQe);let n=Ez(),r=j(()=>t.fieldConfig.key_label),i=j(()=>t.fieldConfig.value_label),a=j(()=>B(r)||X(`key_value.key`)),o=j(()=>B(i)||X(`key_value.value`)),s=j(()=>ez(bz(n.current,t.locale,t.keyPath),t.keyPath,{live:!1}));var c=U(),l=F(c),u=e=>{var t=HQe(),n=P(t),r=P(n),i=P(r),c=I(i,!0),l=I(L(i),!0);O(r),O(n);var u=L(n);Ro(u,23,()=>B(s),([e,t],n)=>`${e}-${n}`,(e,t)=>{var n=j(()=>Pr(B(t),2));let r=()=>B(n)[0],i=()=>B(n)[1];var a=VQe(),o=P(a),s=I(o,!0),c=I(L(o),!0);O(a),z(()=>{G(s,r()),G(c,i())}),W(e,a)}),O(u),O(t),z(()=>{G(c,B(a)),G(l,B(o))}),W(e,t)};K(l,e=>{B(s).length&&e(u)}),W(e,c),A()}var GQe=V(`<!> <!> <!> <!>`,1),m6=V(`<!> <!>`,1),KQe=V(`<!> <!> <!> <!> <!>`,1);function qQe(e,t){k(t,!0);let n=(e,n=jr,i=jr)=>{var a=U(),o=F(a),s=e=>{{let a=e=>{var i=U();Ro(F(i),17,r,e=>e.name,(e,r)=>{{let i=j(()=>ER({config:B(r),locale:t.locale}));iu(e,{get label(){return B(i)},onclick:()=>t.addItem({index:n(),type:B(r).name})})}}),W(e,i)},o=j(()=>X(`add_item_${i()}`));iu(e,{get label(){return B(o)},get disabled(){return t.isAddDisabled},items:a,$$slots:{items:!0}})}},c=e=>{{let r=j(()=>X(`add_item_${i()}`));iu(e,{get label(){return B(r)},get disabled(){return t.isAddDisabled},onclick:()=>t.addItem({index:n()})})}};K(o,e=>{r()?e(s):e(c,-1)}),W(e,a)},r=Y(t,`variableTypes`,3,void 0),i=j(()=>t.canReorder&&SZe(t.itemCount)),a=M(!1);var o=m6(),s=F(o);{let e=e=>{{let r=j(()=>X(`list_item_options`));ru(e,{get ariaLabel(){return B(r)},children:(e,r)=>{var o=KQe(),s=F(o),c=e=>{var r=GQe(),i=F(r),a=e=>{{let n=j(()=>X(`duplicate`)),r=j(()=>t.isAddDisabled||t.unknownType);iu(e,{get label(){return B(n)},get disabled(){return B(r)},onclick:()=>t.addItem({index:t.index+1,dupIndex:t.index})})}};K(i,e=>{t.allowDuplicate&&e(a)});var o=L(i,2);n(o,()=>t.index,()=>`above`);var s=L(o,2);n(s,()=>t.index+1,()=>`below`),ql(L(s,2),{}),W(e,r)};K(s,e=>{t.allowAdd&&!t.hasMaxItems&&e(c)});var l=L(s,2);{let e=j(()=>X(`copy`));iu(l,{get label(){return B(e)},get disabled(){return t.unknownType},onclick:()=>t.copyItem(t.index)})}var u=L(l,2),d=e=>{{let n=j(()=>X(`paste_item_to_replace`));iu(e,{get label(){return B(n)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index,{replace:!0})})}};K(u,e=>{t.allowAdd&&t.allowRemove&&e(d)});var f=L(u,2),p=e=>{var n=m6(),r=F(n);{let e=j(()=>X(`paste_item_above`));iu(r,{get label(){return B(e)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index)})}var i=L(r,2);{let e=j(()=>X(`paste_item_below`));iu(i,{get label(){return B(e)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index+1)})}W(e,n)};K(f,e=>{t.allowAdd&&!t.hasMaxItems&&e(p)});var m=L(f,2),h=e=>{var n=m6(),r=F(n);ql(r,{}),LZe(L(r,2),{get index(){return t.index},get itemCount(){return t.itemCount},get onMove(){return t.moveItem},onMoveTo:()=>{N(a,!0)}}),W(e,n)};K(m,e=>{B(i)&&e(h)}),W(e,o)},$$slots:{default:!0}})}},r=j(()=>X(`list_item_options`));kl(s,{variant:`ghost`,size:`small`,iconic:!0,popupPosition:`bottom-right`,"data-action":`move-options`,get"aria-label"(){return B(r)},popup:e,$$slots:{popup:!0}})}var c=L(s,2),l=e=>{FZe(e,{get index(){return t.index},get itemCount(){return t.itemCount},onMove:e=>t.moveItem(e,`move-options`),get open(){return B(a)},set open(e){N(a,e,!0)}})};K(c,e=>{B(i)&&e(l)}),W(e,o),A()}function JQe(e,t){k(t,!0);let n=Y(t,`expanded`,3,!1);{let t=j(()=>n()?`expand_more`:Pc()?`chevron_left`:`chevron_right`);Lc(e,{get name(){return B(t)}})}A()}var YQe=V(`<div role="none" class="label svelte-1qyhxjh"><!> <div role="none" class="summary"> </div></div>`),XQe=V(`<!> <!>`,1),ZQe=V(`<div role="none"><!> <div role="none" class="actions svelte-1qyhxjh"><!> <!></div></div>`),QQe=V(`<div role="none" class="toolbar bottom add svelte-1qyhxjh"><!> <!> <!></div>`),$Qe={hash:`svelte-1qyhxjh`,code:`.toolbar.svelte-1qyhxjh {display:flex;align-items:center;flex-wrap:wrap;gap:0 8px;position:sticky;z-index:10;background-color:var(--sui-primary-background-color);min-height:var(--sui-secondary-toolbar-size);&.top {
|
||
/* Below the sticky toolbars of the rich text editors the field is in, if any */top:var(--sui-text-editor-inner-toolbar-top, 0);}&.bottom {bottom:0;}& > div:where(.svelte-1qyhxjh) {display:flex;align-items:center;&.actions {flex-wrap:wrap;margin-block:8px;margin-inline-start:auto;}}&.single > div.actions:where(.svelte-1qyhxjh) {
|
||
/* With no item count on the left, the Add button goes where the item would be */margin-inline-start:0;}}`};function e$e(e,t){k(t,!0),q(e,$Qe);let n=e=>{var n=U(),r=F(n),i=e=>{{let n=e=>{Lc(e,{name:`content_paste`})},r=j(()=>X(`paste_item`));ll(e,{variant:`tertiary`,size:`small`,iconic:!0,get"aria-label"(){return B(r)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.addToTop?0:t.items.length),startIcon:n,$$slots:{startIcon:!0}})}};K(r,e=>{t.hasMaxItems||e(i)}),W(e,n)},r=Y(t,`element`,15),i=Y(t,`summaryId`,3,void 0);var a=U(),o=F(a),s=e=>{var a=ZQe();let o;var s=P(a),c=e=>{var n=YQe(),r=P(n);{let e=e=>{JQe(e,{get expanded(){return t.parentExpanded}})},n=j(()=>!t.items.length),i=j(()=>t.parentExpanded?X(`collapse`):X(`expand`));ll(r,{iconic:!0,get disabled(){return B(n)},get"aria-label"(){return B(i)},get"aria-expanded"(){return t.parentExpanded},get"aria-controls"(){return`list-${t.fieldId??``}-item-list`},onclick:()=>{t.updateExpanderStates({[t.parentExpandedKeyPath]:!t.parentExpanded})},startIcon:e,$$slots:{startIcon:!0}})}var a=L(r,2),o=I(a);O(n),z(()=>{J(a,`id`,i()),G(o,`${t.items.length??``}
|
||
${((t.items.length===1?t.labelSingular:void 0)||t.label||t.fieldName)??``}`)}),W(e,n)};K(s,e=>{t.singleItem||e(c)});var l=L(s,2),u=P(l),d=e=>{var r=XQe(),i=F(r);p6(i,{get disabled(){return t.isAddDisabled},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return t.items},get addItem(){return t.addItem}});var a=L(i,2);n(a),W(e,r)};K(u,e=>{t.allowAdd&&(t.addToTop||!t.items.length||!t.parentExpanded)&&e(d)});var f=L(u,2),p=e=>{var n=U();Ro(F(n),16,()=>[!0,!1],e=>e,(e,n)=>{{let r=j(()=>X(n?`expand_all`:`collapse_all`)),i=j(()=>t.itemExpanderStates.every(([,e])=>e===n));ll(e,{variant:`tertiary`,size:`small`,get label(){return B(r)},get disabled(){return B(i)},onclick:()=>{t.updateExpanderStates(Object.fromEntries(t.itemExpanderStates.map(([e])=>[e,n])))}})}}),W(e,n)};K(f,e=>{t.parentExpanded&&t.items.length>1&&e(p)}),O(l),O(a),ms(a,e=>r(e),()=>r()),z(()=>o=rs(a,1,`toolbar top svelte-1qyhxjh`,null,o,{single:t.singleItem})),W(e,a)},c=e=>{var r=QQe(),i=P(r);Ml(i,{flex:!0});var a=L(i,2);p6(a,{get disabled(){return t.isAddDisabled},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return t.items},get addItem(){return t.addItem}});var o=L(a,2);n(o),O(r),W(e,r)};K(o,e=>{t.position===`top`?e(s):e(c,-1)}),W(e,a),A()}var t$e=e=>{if(e instanceof Error)return e.message;try{return String(e??``)}catch{return``}},n$e=V(`<span role="alert"> </span> <div role="none" class="buttons svelte-tpixvt"><!> <!></div>`,1),r$e=V(`<div role="none" class="field-error svelte-tpixvt"><!> <!></div>`),i$e={hash:`svelte-tpixvt`,code:`.buttons.svelte-tpixvt {display:flex;flex-wrap:wrap;justify-content:center;gap:8px;}.field-error.svelte-tpixvt {display:flex;flex-direction:column;align-items:flex-start;gap:8px;}`};function h6(e,t){k(t,!0),q(e,i$e);let n=Y(t,`scope`,3,`field`),r=()=>{window.location.reload()};var i=U();wo(F(i),{onerror:e=>{console.error(e)},failed:(e,t=jr,i=jr)=>{let a=j(()=>X(`${n()}_crashed`,{values:{message:t$e(t())}}));var o=U(),s=F(o),c=e=>{DO(e,{children:(e,t)=>{var n=n$e(),o=F(n),s=I(o,!0),c=L(o,2),l=P(c);{let e=j(()=>X(`try_again`));ll(l,{variant:`secondary`,get label(){return B(e)},get onclick(){return i()}})}var u=L(l,2);{let e=j(()=>X(`reload_cms`));ll(u,{variant:`primary`,get label(){return B(e)},onclick:r})}O(c),z(()=>G(s,B(a))),W(e,n)},$$slots:{default:!0}})},l=e=>{var t=r$e(),n=P(t);Vc(n,{status:`error`,children:(e,t)=>{$r();var n=H();z(()=>G(n,B(a))),W(e,n)},$$slots:{default:!0}});var r=L(n,2);{let e=j(()=>X(`try_again`));ll(r,{variant:`tertiary`,size:`small`,get label(){return B(e)},get onclick(){return i()}})}O(t),_o(`click`,t,e=>e.stopPropagation()),_o(`keydown`,t,e=>{e.key===`Enter`&&e.stopPropagation()}),W(e,t)};K(s,e=>{n()===`page`?e(c):e(l,-1)}),W(e,o)}},e=>{var n=U();Uo(F(n),()=>t.children),W(e,n)}),W(e,i),A()}vo([`click`,`keydown`]);var g6=e=>Error(`The response from the ${e} API was cut off at the token limit.`),a$e=(e,t)=>({"Content-Type":`application/json`,Authorization:`Bearer ${e}`,...t}),_6=async({endpoint:e,headers:t,body:n,apiLabel:r})=>{let i=await fetch(e,{method:`POST`,headers:t,body:JSON.stringify(n)});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.error?.message||e.message||``;throw Error(`${r} API error: ${i.status} ${i.statusText}${t?` - ${t}`:``}`)}return i.json()},o$e=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,temperature:o=.3,maxTokens:s=16e3,reasoning:c=`high`,extraBody:l={}})=>{let u=await _6({endpoint:e,headers:a$e(n,t),apiLabel:`Chat Completions`,body:{model:r,messages:[{role:`system`,content:i},{role:`user`,content:a}],temperature:o,max_tokens:s,stream:!1,reasoning_effort:c,...l}});if(u.choices?.[0]?.finish_reason===`length`)throw g6(`Chat Completions`);if(!u.choices||!Array.isArray(u.choices)||!u.choices[0]?.message?.content)throw Error(`Invalid response format from Chat Completions API.`);return u.choices[0].message.content.trim()},s$e=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,maxTokens:o=16e3,reasoning:s,extraBody:c={}})=>{let l=await _6({endpoint:e,headers:a$e(n,t),apiLabel:`Responses`,body:{model:r,instructions:i,input:a,store:!1,max_output_tokens:o,...s?{reasoning:{effort:s}}:{},...c}});if(l.status===`incomplete`&&l.incomplete_details?.reason===`max_output_tokens`)throw g6(`Responses`);if(typeof l.output_text==`string`)return l.output_text.trim();let u=(Array.isArray(l.output)?l.output:[]).find(e=>D(e)&&`type`in e&&e.type===`message`&&`content`in e&&Array.isArray(e.content));if(!D(u)||!(`content`in u)||!Array.isArray(u.content))throw Error(`Invalid response format from Responses API.`);let{content:d}=u,f=d.find(e=>D(e)&&`type`in e&&e.type===`output_text`&&`text`in e&&typeof e.text==`string`);if(D(f)&&`text`in f&&typeof f.text==`string`)return f.text.trim();throw Error(`Invalid response format from Responses API.`)},c$e=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,maxTokens:o=16e3,reasoning:s,extraBody:c={}})=>{let l={"Content-Type":`application/json`,...t};!t.Authorization&&!t[`x-api-key`]&&(l[`x-api-key`]=n);let u=await _6({endpoint:e,headers:l,apiLabel:`Messages`,body:{model:r,max_tokens:o,system:i,messages:[{role:`user`,content:a}],...s===`none`?{thinking:{type:`disabled`}}:{},...c}});if(u.stop_reason===`refusal`)throw Error(`The request was declined by the Messages API.`);if(u.stop_reason===`max_tokens`)throw g6(`Messages`);let d=Array.isArray(u.content)?u.content.filter(e=>D(e)&&e.type===`text`&&typeof e.text==`string`).map(({text:e})=>e):[];if(!d.length)throw Error(`Invalid response format from Messages API.`);return d.join(``).trim()},l$e=c({apiKeyPattern:()=>f$e,apiKeyURL:()=>`https://platform.claude.com/settings/keys`,apiLabel:()=>`Anthropic API`,complete:()=>p$e,developerURL:()=>`https://docs.claude.com/en/api/overview`,serviceId:()=>`anthropic`,serviceLabel:()=>`Anthropic Claude`}),u$e=`https://api.anthropic.com/v1/messages`,d$e={"anthropic-version":`2023-06-01`,"anthropic-dangerous-direct-browser-access":`true`},f$e=/^sk-ant-[a-z]+\d*-[a-zA-Z0-9-_]{40,}$/,p$e=async e=>c$e({...e,endpoint:u$e,headers:d$e}),m$e=c({apiKeyPattern:()=>g$e,apiKeyURL:()=>`https://platform.deepseek.com/api_keys`,apiLabel:()=>`DeepSeek API`,complete:()=>_$e,developerURL:()=>`https://api-docs.deepseek.com/`,serviceId:()=>`deepseek`,serviceLabel:()=>`DeepSeek`}),h$e=`https://api.deepseek.com/chat/completions`,g$e=/^sk-[a-zA-Z0-9]{32,}$/,_$e=async e=>o$e({...e,endpoint:h$e,extraBody:{thinking:{type:e.reasoning===`none`?`disabled`:`enabled`}}}),v$e=c({apiKeyPattern:()=>y$e,apiKeyURL:()=>`https://aistudio.google.com/api-keys`,apiLabel:()=>`Gemini API`,complete:()=>b$e,developerURL:()=>`https://ai.google.dev/gemini-api/docs`,serviceId:()=>`google-ai`,serviceLabel:()=>`Google Gemini`}),y$e=/^(?:AIza[a-zA-Z0-9_-]{35}|AQ\.[a-zA-Z0-9._-]{20,})$/,b$e=async({apiKey:e,model:t,systemPrompt:n,userMessage:r,temperature:i=.3,maxTokens:a=16e3,responseFormat:o})=>{let s=await _6({endpoint:`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent`,headers:{"Content-Type":`application/json`,"x-goog-api-key":e},apiLabel:`Gemini`,body:{system_instruction:{parts:[{text:n}]},contents:[{parts:[{text:r}]}],generationConfig:{temperature:i,maxOutputTokens:a,...o?{responseMimeType:o}:{}}}}),c=Array.isArray(s.candidates)?s.candidates[0]:void 0;if(c?.finishReason===`MAX_TOKENS`)throw g6(`Gemini`);let l=Array.isArray(c?.content?.parts)?c.content.parts.filter(e=>D(e)&&!e.thought&&typeof e.text==`string`).map(({text:e})=>e):[];if(!l.length)throw Error(`Invalid response format from Gemini API.`);return l.join(``).trim()},x$e=c({apiKeyPattern:()=>C$e,apiKeyURL:()=>`https://console.mistral.ai/home?profile_dialog=api-keys`,apiLabel:()=>`Mistral AI API`,complete:()=>w$e,developerURL:()=>`https://docs.mistral.ai/`,serviceId:()=>`mistral`,serviceLabel:()=>`Mistral`}),S$e=`https://api.mistral.ai/v1/chat/completions`,C$e=/^(?!AIza)[a-zA-Z0-9]{32,}$/,w$e=async e=>o$e({...e,endpoint:S$e}),T$e=c({apiKeyPattern:()=>D$e,apiKeyURL:()=>`https://platform.openai.com/api-keys`,apiLabel:()=>`OpenAI API`,complete:()=>O$e,developerURL:()=>`https://platform.openai.com/docs/overview`,serviceId:()=>`openai`,serviceLabel:()=>`OpenAI GPT`}),E$e=`https://api.openai.com/v1/responses`,D$e=/^sk-(?!ant-)[a-zA-Z0-9-_]{40,}$/,O$e=async e=>s$e({...e,endpoint:E$e}),k$e=Object.fromEntries([l$e,m$e,v$e,x$e,T$e].map(e=>[e.serviceId,e])),v6=e=>kA(e,{displayLocale:`en`}),A$e=(e,t)=>{let n=[`- CRITICAL: Leave content EXACTLY unchanged within HTML elements that have translate="no"`,`- CRITICAL: Leave content EXACTLY unchanged within HTML elements that have class="notranslate"`,`- CRITICAL: Leave content EXACTLY unchanged between "notranslate" and "/notranslate" comments`,`- Preserve all markdown formatting (headers, links, bold, italic, code blocks, lists, etc.)`,`- Preserve all HTML tags and attributes exactly as they are`,`- Maintain the original structure and formatting`,`- Do not translate code content within code blocks or inline code`,`- Do not translate URLs, email addresses, or technical identifiers`,`- If you see translate="no", class="notranslate", or notranslate comments, copy that content verbatim without any changes`],r=[`- Do not split translations into separate paragraphs or add extra line breaks`,`- Keep each translation as a single continuous text string in the array`],i=[`- Return your response as a valid JSON array containing the translated texts`,`- The array should contain the translated texts in the same order as provided`,`- VALIDATION: Before responding, double-check that any translate="no", class="notranslate", or notranslate comment content remains EXACTLY the same`];return`You are a professional translator. Translate the given texts from ${e} to ${t}. Your response must be valid JSON that can be parsed directly.
|
||
|
||
IMPORTANT INSTRUCTIONS:\n${[...n,...r,...i].join(`
|
||
`)}\n\nOUTPUT FORMAT:
|
||
- Output ONLY valid JSON, nothing else
|
||
- Do NOT use markdown code blocks or formatting
|
||
- Do NOT add any explanation or commentary
|
||
- Your entire response should be parseable by JSON.parse()
|
||
- Start your response with [ and end with ]
|
||
|
||
Required JSON structure:
|
||
["translation 1", "translation 2", ...]`},j$e=e=>`Translate these texts and return ONLY valid JSON (no markdown, no code blocks):
|
||
${JSON.stringify(e)}\n\nRespond with JSON only:`,M$e=(e,t,n)=>{let r;try{r=JSON.parse(e)}catch{throw Error(`Failed to parse JSON response from ${n}.`)}if(!Array.isArray(r))throw Error(`Invalid JSON structure in ${n} response.`);if(r.length!==t)throw Error(`Translation count mismatch: expected ${t}, got ${r.length}`);return r},N$e=async({sourceLanguage:e,targetLanguage:t})=>!!v6(e)&&!!v6(t),P$e=(e,t)=>{let n=v6(e),r=v6(t);if(!n)throw Error(`Source locale is not supported.`);if(!r)throw Error(`Target locale is not supported.`);return[n,r]},F$e=(e,t,n,r={})=>async(i,{sourceLanguage:a,targetLanguage:o,apiKey:s})=>{let[c,l]=P$e(a,o);return M$e(await e({apiKey:s,model:t,systemPrompt:A$e(c,l),userMessage:j$e(i),...r}),i.length,n)},y6=({ai:{serviceId:e,serviceLabel:t,apiLabel:n,developerURL:r,apiKeyURL:i,apiKeyPattern:a,complete:o},model:s,extraOptions:c})=>({serviceId:e,serviceLabel:t,apiLabel:n,developerURL:r,apiKeyURL:i,apiKeyPattern:a,markdownSupported:!0,availability:N$e,translate:F$e(o,s,n,c)}),I$e=y6({ai:l$e,model:`claude-haiku-5-5`,extraOptions:{reasoning:`none`}}),L$e=y6({ai:m$e,model:`deepseek-flash`,extraOptions:{reasoning:`none`}}),R$e=`google`,z$e=`Google Cloud Translation`,B$e=`Cloud Translation API`,V$e=`https://console.cloud.google.com/apis/library/translate.googleapis.com`,H$e=`https://console.cloud.google.com/apis/api/translate.googleapis.com/credentials`,U$e=/^AIza[0-9A-Za-z-_]{35}$/,W$e=`ab,ace,ach,af,ak,alz,am,ar,as,awa,ay,az,ba,ban,bbc,be,bem,bew,bg,bho,bik,bm,bn,br,bs,bts,btx,bua,ca,ceb,cgg,chm,ckb,cnh,co,crh,crs,cs,cv,cy,da,de,din,doi,dov,dv,dz,ee,el,en,eo,es,et,eu,fa,ff,fi,fil,fj,fr,fr-CA,fr-FR,fy,ga,gaa,gd,gl,gn,gom,gu,ha,haw,he,hi,hil,hmn,hr,hrx,ht,hu,hy,id,ig,ilo,is,it,iw,ja,jv,jw,ka,kk,km,kn,ko,kri,ktu,ku,ky,la,lb,lg,li,lij,lmo,ln,lo,lt,ltg,luo,lus,lv,mai,mak,mg,mi,min,mk,ml,mn,mni-Mtei,mr,ms,ms-Arab,mt,my,ne,new,nl,no,nr,nso,nus,ny,oc,om,or,pa,pa-Arab,pag,pam,pap,pl,ps,pt,pt-BR,pt-PT,qu,rn,ro,rom,ru,rw,sa,scn,sd,sg,shn,si,sk,sl,sm,sn,so,sq,sr,ss,st,su,sv,sw,szl,ta,te,tet,tg,th,ti,tk,tl,tn,tr,ts,tt,ug,uk,ur,uz,vi,xh,yi,yo,yua,yue,zh,zh-CN,zh-TW,zu`.split(`,`),G$e={nb:`no`},K$e=e=>{try{return new Intl.Locale(e).maximize().script}catch{return}},b6=e=>{let[t,...n]=e.split(/[-_]/),r=t.toLowerCase(),i=n.find(e=>/^[a-z]{4}$/i.test(e)),a=n.find(e=>/^(?:[a-z]{2}|\d{3})$/i.test(e))?.toUpperCase(),o=i?`${i[0].toUpperCase()}${i.slice(1).toLowerCase()}`:a&&K$e(`${r}-${a}`);if(r===`zh`){if(o===`Hant`)return`zh-TW`;if(o===`Hans`)return`zh-CN`}if(!o||W$e.includes(`${r}-${o}`)||o===K$e(r))return[o?`${r}-${o}`:void 0,a?`${r}-${a}`:void 0,G$e[r]??r].find(e=>!!e&&W$e.includes(e))},q$e=async({sourceLanguage:e,targetLanguage:t})=>!!b6(e)&&!!b6(t),J$e=128,Y$e=9e4,X$e=e=>{let t=new TextEncoder,n=[],r=[],i=0;return e.forEach(e=>{let a=t.encode(e).length;r.length&&(r.length>=J$e||i+a>Y$e)&&(n.push(r),r=[],i=0),r.push(e),i+=a}),r.length&&n.push(r),n},Z$e={serviceId:R$e,serviceLabel:z$e,apiLabel:B$e,developerURL:V$e,apiKeyURL:H$e,apiKeyPattern:U$e,markdownSupported:!1,availability:q$e,translate:async(e,{sourceLanguage:t,targetLanguage:n,apiKey:r})=>{if(t=b6(t)??``,n=b6(n)??``,!t)throw Error(`Source locale is not supported.`);if(!n)throw Error(`Target locale is not supported.`);let i=[];for(let a of X$e(e)){let{data:e}=await _6({endpoint:`https://translation.googleapis.com/language/translate/v2`,headers:{"Content-Type":`application/json`,"X-goog-api-key":r},apiLabel:`Google Translate`,body:{q:a,source:t,target:n,format:`html`}});i.push(...e.translations.map(e=>e.translatedText.replace(/'/g,`'`)))}return i}},x6={anthropic:I$e,deepseek:L$e,google:Z$e,"google-ai":y6({ai:v$e,model:`gemini-3.5-flash-lite`,extraOptions:{responseFormat:`application/json`}}),mistral:y6({ai:x$e,model:`mistral-small-latest`,extraOptions:{reasoning:`none`}}),openai:y6({ai:T$e,model:`gpt-6-luna`,extraOptions:{reasoning:`low`}})},Q$e=Object.fromEntries(Object.entries(x6).filter(([e])=>!(e in k$e))),S6=KO(()=>{let{defaultTranslationService:e=`google`}=CW;return x6[e]??Z$e}),C6=new jO,$$e=({draft:e,targetLanguage:t,keyPath:n=``})=>[...C6].some(r=>r.draft===e&&r.targetLanguage===t&&r.keyPath===n),e1e=O0({loader:async()=>{let{default:e}=await dN(`turndown`,`lib/turndown.browser.es.js`),t=new e({headingStyle:`atx`,bulletListMarker:`-`,codeBlockStyle:`fenced`});return t.keep([`span`,`div`]),t},notLoadedMessage:"Turndown is not loaded yet. Call `getTurndownService()` first."}).load,t1e={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`},n1e=e=>e.replace(/&(?:#(\d+)|#x([\da-f]+)|(amp|lt|gt|quot|apos));/gi,(e,t,n,r)=>{if(r)return t1e[r.toLowerCase()];let i=t?Number(t):Number.parseInt(n,16);return i<=1114111?String.fromCodePoint(i):e}),r1e=/^(.+)\.\d+$/,i1e=({field:e,getFieldArgs:t})=>{let{keyPath:n}=t;if(e)return{keyPath:n,field:e};let[,r]=n.match(r1e)??[],i=r?_M({...t,keyPath:r}):void 0;return i?.widget===`list`&&!KR(i).hasSubFields?{keyPath:r,field:i}:void 0},a1e=({owner:{keyPath:e,field:t},getFieldArgs:n,content:r})=>L3({fieldConfig:t,getFieldArgs:{...n,keyPath:e}})(r),o1e=({draft:e,options:t})=>{let{currentValues:n}=e,{sourceLanguage:r,targetLanguage:i,keyPath:a=``,translate:o=!1}=t,s=n[r],c=gM(e,{valueMap:s});return Object.fromEntries(Object.entries(s).map(([e,t])=>{if(a&&!dj(e,a))return null;let r=n[i][e],s=_M({...c,keyPath:e}),l=s?.widget??`string`,u=i1e({field:s,getFieldArgs:{...c,keyPath:e}});return!rR(u?.field.i18n)||typeof t!=`string`||!t||![...gk,`list`].includes(l)||l===`list`&&KR(s).hasSubFields||!o&&t===r||!a&&o&&r&&!(s&&WR(s)&&t===r)||!a1e({owner:u,getFieldArgs:c,content:n[i]})?null:[e,{value:t,format:hk.includes(l)?kZ(s):`plain`}]}).filter(e=>!!e))},w6=(e,t,{count:n,sourceLanguage:r})=>{r$.current={id:Date.now(),show:!0,status:e,message:t,count:n,sourceLanguage:r}},s1e=async({currentValues:e,options:t,copingFieldMap:n,isDraftClosed:r=()=>!1})=>{let{serviceId:i}=S6.current,{sourceLanguage:a,targetLanguage:o,keyPath:s}=t,c=Object.keys(n).length,l=Object.fromEntries(Object.keys(n).map(t=>[t,e[o][t]])),u=CW.apiKeys?.[i];if(!u){let{promise:e,resolve:t}=Promise.withResolvers();n$.current={show:!0,multiple:c>1,resolve:t},u=await e}if(!u)return;let{markdownSupported:d,translate:f}=S6.current;w6(`info`,`translation.started`,{count:c,sourceLanguage:a});try{let t=await f(Object.entries(n).map(([,{value:e,format:t}])=>d||t===`html`?e:t===`markdown`?yr(e):Zk(e)),{apiKey:u,sourceLanguage:a,targetLanguage:o}),i=!d&&Object.values(n).some(({format:e})=>e===`markdown`)?await e1e():void 0;if(r())return;let c=0;Object.entries(n).forEach(([n,{format:r}],a)=>{let u=t[a];(s||e[o][n]===l[n])&&(c+=1,e[o][n]=d||r===`html`?u:r===`markdown`?i.turndown(u):n1e(u))}),w6(`success`,`translation.complete`,{count:c,sourceLanguage:a})}catch(e){r()||w6(`error`,`translation.error`,{count:c,sourceLanguage:a}),console.error(e)}},c1e=({currentValues:e,options:t,copingFieldMap:n})=>{let{sourceLanguage:r,targetLanguage:i}=t,a=Object.keys(n).length;Object.entries(n).forEach(([t,{value:n}])=>{e[i][t]=n}),w6(`success`,`copy.complete`,{count:a,sourceLanguage:r})},l1e=async({draft:e,options:t,entryDraft:n})=>{let{sourceLanguage:r,targetLanguage:i,keyPath:a=``,translate:o=!1}=t;if(o&&$$e({draft:e,targetLanguage:i,keyPath:a}))return;let{currentValues:s}=e,c=o1e({draft:e,options:t}),l=Object.keys(c).length;if(!l)w6(`info`,`${o?`translation`:`copy`}.none`,{count:l,sourceLanguage:r});else if(o){let r={draft:e,targetLanguage:i,keyPath:a},o=()=>!!n&&n.current!==e;C6.add(r);try{await s1e({currentValues:s,options:t,copingFieldMap:c,isDraftClosed:o})}finally{C6.delete(r)}}else c1e({currentValues:s,options:t,copingFieldMap:c})};function T6(e,t){k(t,!0);let n=e=>{var n=U();Ro(F(n),16,()=>t.otherLocales,e=>e,(e,n)=>{let r=j(()=>kA(n)??n),i=j(()=>({sourceLanguage:n,targetLanguage:t.locale}));var o=U();Mo(F(o),()=>c(B(i)),null,(e,t)=>{{let n=j(()=>B(s)?B(r):X(a()?`translate_from_x`:`copy_from_x`,{values:{locale:B(r)}}));iu(e,{get label(){return B(n)},get disabled(){return B(t)},onclick:()=>{l(B(i))}})}}),W(e,o)}),W(e,n)},r=Ez(),i=Y(t,`keyPath`,3,``),a=Y(t,`translate`,3,!1),o=Y(t,`submenu`,3,!1),s=j(()=>o()&&t.otherLocales.length>1),c=async({sourceLanguage:e,targetLanguage:t})=>!r.current?.currentLocales[t]||!r.current.currentLocales[e]||!!i()&&!Object.keys(o1e({draft:r.current,options:{sourceLanguage:e,targetLanguage:t,keyPath:i(),translate:a()}})).length||a()&&!await S6.current?.availability({sourceLanguage:e,targetLanguage:t}),l=e=>{r.current&&l1e({draft:r.current,options:{...e,keyPath:i(),translate:a()},entryDraft:r})};var u=U(),d=F(u),f=e=>{{let t=e=>{n(e)},r=j(()=>X(a()?`translate_from`:`copy_from`));iu(e,{get label(){return B(r)},items:t,$$slots:{items:!0}})}},p=e=>{n(e)};K(d,e=>{B(s)?e(f):e(p,-1)}),W(e,u),A()}var u1e=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),d1e=V(`<section><!></section>`),f1e={hash:`svelte-wzztxu`,code:`section.svelte-wzztxu {position:relative;padding:var(--field-editor-padding);&:not(:last-child)::after {position:absolute;inset:auto var(--field-editor-padding) 0 var(--field-editor-padding);overflow:hidden;height:1px;background-color:var(--sui-tertiary-background-color);content:'';}& > * {margin-inline:auto !important;max-width:768px;}& > header {display:flex;align-items:center;margin:0 -8px 8px;height:var(--sui-button-small-height);h4 {margin-inline:var(--sui-focus-ring-width) 0;font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}.required {margin-block:2px 0;margin-inline:2px 0;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-large);}}
|
||
|
||
/* The buttons are shown on hover, and kept visible while a keyboard user is in the field, so
|
||
the focused one isn’t invisible */
|
||
@media (hover: hover) {&:not(:hover, :focus-within) > header button {opacity:0;}
|
||
}}`};function E6(e,t){k(t,!0),q(e,f1e);let n=Y(t,`children`,3,void 0),r=gs(t,u1e),i=M(void 0);vs(()=>()=>{B(i)?.dispatchEvent(new CustomEvent(`Unmount`))});var a=d1e();us(a,()=>({role:`group`,class:`field`,...r}),void 0,void 0,void 0,`svelte-wzztxu`),Uo(P(a),()=>n()??jr),O(a),ms(a,e=>N(i,e),()=>B(i)),W(e,a),A()}var p1e=[`revert`,`restore`,`clear`],m1e={field:{revert:`revert_changes`,restore:`restore_default`,clear:`clear`},locale:{revert:`revert_changes`,restore:`restore_default`,clear:`clear_all`},entry:{revert:`revert_all_changes`,restore:`restore_default`,clear:`clear_all`}},h1e={revert:`confirm_reverting_changes`,restore:`confirm_restoring_defaults`,clear:`confirm_clearing_fields`},g1e=(e,t)=>X(m1e[t][e]),_1e=(e,t)=>t&&t!==`_default`?X(`${h1e[e]}_x_locale`,{values:{locale:kA(t)??t}}):X(h1e[e]),v1e=V(`<!> <!>`,1);function D6(e,t){k(t,!0);let n=Y(t,`separator`,3,!0);var r=v1e(),i=F(r),a=e=>{ql(e,{})};K(i,e=>{n()&&e(a)}),Ro(L(i,2),16,()=>p1e.filter(e=>e in t.available),e=>e,(e,n)=>{{let r=j(()=>g1e(n,t.scope)),i=j(()=>!t.available[n]);iu(e,{get label(){return B(r)},get disabled(){return B(i)},onclick:()=>{t.onSelect(n)}})}}),W(e,r),A()}function y1e(e,t){k(t,!0);let n=Ez(),r=Y(t,`size`,3,`medium`),i=Y(t,`keyPath`,3,``),a=j(()=>!n.current?.currentLocales[t.locale]||EY(n.current?.originalEntry)),o=j(()=>$$e({draft:n.current,targetLanguage:t.locale,keyPath:i()})),s=async({sourceLanguage:e,targetLanguage:t})=>B(a)||!n.current?.currentLocales[e]||!await S6.current?.availability({sourceLanguage:e,targetLanguage:t}),c=e=>{n.current&&l1e({draft:n.current,options:{...e,keyPath:i(),translate:!0},entryDraft:n})};var l=U(),u=F(l),d=e=>{let n=j(()=>{let[e]=t.otherLocales;return{otherLocale:e}}),i=j(()=>X(`translate_from_x`,{values:{locale:kA(B(n).otherLocale)??B(n).otherLocale}})),a=j(()=>({sourceLanguage:B(n).otherLocale,targetLanguage:t.locale}));var l=U();Mo(F(l),()=>s(B(a)),null,(e,t)=>{{let n=e=>{Lc(e,{name:`translate`})},s=j(()=>B(t)||B(o));ll(e,{variant:`ghost`,get size(){return r()},iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return B(i)},get title(){return B(i)},get disabled(){return B(s)},onclick:()=>{c(B(a))},startIcon:n,$$slots:{startIcon:!0}})}}),W(e,l)},f=e=>{{let n=e=>{Lc(e,{name:`translate`})},o=e=>{{let n=j(()=>X(`translation_options`));ru(e,{get ariaLabel(){return B(n)},children:(e,n)=>{T6(e,{get locale(){return t.locale},get otherLocales(){return t.otherLocales},get keyPath(){return i()},translate:!0})},$$slots:{default:!0}})}},s=j(()=>X(`translate`));kl(e,{variant:`ghost`,get size(){return r()},iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return B(s)},get disabled(){return B(a)},endIcon:n,popup:o,$$slots:{endIcon:!0,popup:!0}})}};K(u,e=>{t.otherLocales.length===1?e(d):e(f,-1)}),W(e,l),A()}var b1e=[`compute`,`hidden`,`uuid`],O6=e=>{let{content:t,fieldConfig:n,keyPath:r,locale:i,defaultLocale:a,inheritedI18n:o}=e,{mirror:s=!1,syncOnly:c=!1,restore:l=!1}=e,{widget:u=`string`,i18n:d}=n,f=d??o;if(!(b1e.includes(u)||n.readonly)){if(u===`list`&&KR(n).hasSubFields){let{allow_add:e=!0,allow_remove:t=!0}=n;if(!t||l&&!e)return}if(u===`object`){if(t[r]===null)return;let{fields:o}=n,{types:s,typeKey:c=`type`}=n,{default:u}=Qke({fieldConfig:{...n,i18n:f},locale:i,defaultLocale:a}),d=t[`${r}.${c}`];(o??s?.find(({name:e})=>e===d)?.fields??[]).forEach(t=>{let n=l&&D(u)&&Object.hasOwn(u,t.name)?{...t,default:u[t.name],default_localized:void 0}:t;O6({...e,fieldConfig:n,keyPath:`${r}.${t.name}`,inheritedI18n:f})})}else if(s?c?f===`sync`:iR(f)||qR(n):i===a||rR(d)||f===`sync`){if(Rj(t,r),!l){if(u===`keyvalue`){t[r]=null;return}if(u===`list`){t[r]=[];return}}Y3({content:t,keyPath:r,fieldConfig:{...n,i18n:f,...l?{}:{default:void 0,default_localized:void 0}},locale:i,defaultLocale:a,dynamicValues:{}})}}},x1e=({valueStore:e,locale:t,...n})=>{let r=t!==n.defaultLocale;O6({...n,content:e[t],locale:t}),Object.entries(e).forEach(([e,i])=>{e!==t&&O6({...n,content:i,locale:e,mirror:!0,syncOnly:r})})},S1e=({valueMap:e,restore:t=!1,...n})=>{let r=cz(e,n.keyPath),i={...r};return O6({...n,content:i,restore:t}),!(0,Cr.default)(r,i)},C1e=({draft:e,fieldConfig:t,keyPath:n,locale:r,restore:i=!1})=>{let{currentValues:a,defaultLocale:o}=e,s=gM(e);iz(()=>{x1e({valueStore:a,fieldConfig:t,keyPath:n,locale:r,defaultLocale:o,restore:i,inheritedI18n:sR({fieldConfig:t,getFieldArgs:{...s,keyPath:n,valueMap:a[r]}})}),r===o&&Q3({valueStore:a,defaultLocale:o,getFieldArgs:s})})},w1e=({currentValues:e,currentLocales:t},n)=>n?[n]:Object.keys(e).filter(e=>t[e]),T1e=({valueStore:e,fields:t,locales:n,defaultLocale:r,restore:i})=>{n.forEach(n=>{t.forEach(t=>{x1e({valueStore:e,fieldConfig:t,keyPath:t.name,locale:n,defaultLocale:r,restore:i})})})},k6=({draft:e,locale:t,restore:n=!1})=>{let{fields:r,currentValues:i,defaultLocale:a}=e,o=()=>Object.fromEntries(Object.entries(i).map(([e,t])=>[e,oz(t)])),s=o(),c=o();return T1e({valueStore:c,fields:r,locales:w1e(e,t),defaultLocale:a,restore:n}),!(0,Cr.default)(s,c)},E1e=({draft:e,locale:t,restore:n=!1})=>{let{fields:r,currentValues:i,defaultLocale:a}=e,o=w1e(e,t);iz(()=>{T1e({valueStore:i,fields:r,locales:o,defaultLocale:a,restore:n}),o.includes(a)&&Q3({valueStore:i,defaultLocale:a,getFieldArgs:gM(e)})})},D1e=(e,t)=>{let n=t.split(`.`),r=[...n],i=0;if(n.forEach((t,a)=>{if(a>=1&&cM(t)){let t=e[`${n.slice(0,a+1).join(`.`)}.__sc_item_original_key_path`];t!==void 0&&(r[a]=t.split(`.`).at(-1),i=a)}}),i)return{originalKeyPath:r.join(`.`),currentPrefix:n.slice(0,i+1).join(`.`),originalPrefix:r.slice(0,i+1).join(`.`)}},O1e=(e,t)=>cz(e,t,{relative:!0,dropEmptyPlaceholders:!0}),k1e=({currentValueMap:e,originalValueMap:t,keyPath:n})=>{let r=D1e(e,n)?.originalKeyPath??n;return!(0,Cr.default)(O1e(e,n),O1e(t,r))},A1e=({locale:e,isDefaultLocale:t,keyPath:n,getFieldArgs:r,currentValues:i,reset:a=!1,remapPrefix:o})=>{let{valueMap:s={}}=r;Object.entries(s).forEach(([s,c])=>{if(!n||dj(s,n)){let n=_M({...r,keyPath:s}),l=n?{keyPath:s,fieldConfig:n}:ZR({...r,keyPath:s}),u=l?.fieldConfig.i18n;if(t||rR(u)||u===`duplicate_keys`||l&&lR({fieldConfig:l.fieldConfig,getFieldArgs:{...r,keyPath:l.keyPath}})){if(a)delete i[e][s];else{let t=o?`${o.to}${s.slice(o.from.length)}`:s;i[e][t]=c}}}})},A6=({draft:e,keyPath:t,locale:n,revertAll:r=!1})=>{let{currentValues:i,originalValues:a}=e,{defaultLocale:o}=BA(e),s=r||n===o,c=gM(e,{keyPath:``}),l=t?D1e(i[n],t):void 0,u=l?.originalKeyPath??t,d=l?{from:l.originalPrefix,to:l.currentPrefix}:void 0;A1e({locale:n,isDefaultLocale:s,keyPath:t,getFieldArgs:{...c,valueMap:i[n]},currentValues:i,reset:!0}),A1e({locale:n,isDefaultLocale:s,keyPath:u,getFieldArgs:{...c,valueMap:a[n]},currentValues:i,remapPrefix:d})},j1e=({draft:e,keyPath:t})=>{if(!t)return JR(e.fields);let{currentValues:n}=e,{defaultLocale:r}=BA(e),i=_M(gM(e,{keyPath:t,valueMap:n[r]}));return i?JR([i],t.split(`.`).slice(0,-1).join(`.`)):[]},M1e=({draft:e,locale:t=``,keyPath:n=``})=>{let{currentValues:r,originalLocales:i,originalPath:a,originalSlugs:o}=e,{allLocales:s,defaultLocale:c}=BA(e),l=!t&&!n;t?A6({draft:e,keyPath:n,locale:t}):iz(()=>{s.forEach(t=>{A6({draft:e,keyPath:n,locale:t,revertAll:!0})})}),t===c&&iz(()=>{j1e({draft:e,keyPath:n}).forEach(t=>{s.forEach(n=>{n!==c&&r[n]&&A6({draft:e,keyPath:t,locale:n,revertAll:!0})})})}),Q3({valueStore:r,defaultLocale:c,getFieldArgs:gM(e)}),l&&(e.currentLocales={...i},e.currentPath=a,e.currentSlugs={...o})},N1e=[`richtext`,`markdown`,`string`,`text`,`list`,`object`],P1e=e=>{let{widget:t=`string`}=e,n=t===`string`,r=[`boolean`,`number`,`string`].includes(t),{prefix:i,suffix:a}=n?e:{},{before_input:o,after_input:s}=r?e:{};return{prefix:i,suffix:a,beforeInputLabel:o,afterInputLabel:s,hasExtraLabels:!!(i||a||o||s)}},F1e=({fieldConfig:e,autoSet:t,locked:n,isDuplicated:r,isNew:i,parentReadonly:a=!1})=>{let{widget:o=`string`}=e,{readonly:s}=e,c=o===`compute`,l=s===!0||a;return{hidden:c||t&&i,readonly:(s??(o===`uuid`&&e.read_only!==!1))||l||t||n||r||c,subfieldsReadonly:l}},I1e=({fieldConfig:e,inline:t})=>{let{widget:n=`string`}=e;return t&&[`select`,`relation`].includes(n)?{...e,dropdown_threshold:0}:e},L1e=({draft:e,fieldConfig:t,keyPath:n,locale:r,valueMap:i,inEditorComponent:a=!1})=>{let{i18n:o=!1}=t,{i18nEnabled:s,defaultLocale:c}=BA(e),l=s&&r!==c,u=s&&rR(o),d=e,f=l?a?o:sR({fieldConfig:t,getFieldArgs:{collectionName:d.collectionName,fileName:d.fileName,isIndexFile:d.isIndexFile,keyPath:n,valueMap:i}}):void 0,p=f===`duplicate`,m=!a&&f===`sync`,h=l&&o===`duplicate_keys`;return{canTranslate:u,isDuplicated:p,isSynced:m,areKeysDuplicated:h,isShown:a||r===c||u||p||m||h}},j6=e=>{let t=M(na({restore:!1,clear:!1})),n=M(`revert`),r=M(!1);return{get availability(){return B(t)},get action(){return B(n)},get dialogOpen(){return B(r)},set dialogOpen(e){N(r,e,!0)},update:()=>{N(t,e()??B(t),!0)},select:e=>{N(n,e,!0),N(r,!0)}}},R1e=V(`<div role="none" class="before-input svelte-dkfcyc"></div>`),z1e=V(`<div role="none" class="prefix svelte-dkfcyc"> </div>`),M6=V(`<!> <!>`,1),B1e=V(`<div role="none" class="suffix svelte-dkfcyc"> </div>`),V1e=V(`<div role="none" class="after-input svelte-dkfcyc"></div>`),H1e=V(`<span role="none" class="field inline"><span hidden=""> </span> <!></span>`),U1e=V(`<span class="required" aria-hidden="true">*</span>`),W1e=V(`<!> <!> <!>`,1),G1e=V(`<p class="hint svelte-dkfcyc"></p>`),K1e=V(`<div role="none" class="footer svelte-dkfcyc"><!> <!></div>`),q1e=V(`<header role="none"><h4 role="none"> </h4> <!> <!> <!> <!></header> <!> <div role="none"><!></div> <!>`,1),J1e={hash:`svelte-dkfcyc`,code:`.field-wrapper.svelte-dkfcyc {&.has-extra-labels {display:flex;align-items:center;justify-content:flex-start;gap:4px;}:is(input[type='text'], textarea) {width:100%;}
|
||
|
||
/* A native color, date or time input is still styled for a custom field type that renders
|
||
one. The built-in editors use Sveltia UI components instead, which have the \`sui\` class and
|
||
styles of their own, so they’re left out */input:is([type='color']:not(.sui), [type='number']) {border-width:1px;border-color:var(--sui-primary-border-color);border-radius:var(--sui-control-medium-border-radius);height:var(--sui-button-medium-height);color:inherit;background-color:var(--sui-textbox-background-color);}input:is([type='file'], [type='checkbox']) {color:inherit;}& > div {color:inherit;}input:is([type='date'], [type='datetime-local'], [type='time']):not(.sui) {margin:var(--sui-focus-ring-width);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-primary-border-color);border-radius:var(--sui-control-medium-border-radius);padding:var(--sui-textbox-singleline-padding);width:auto;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);text-transform:uppercase;&:disabled {opacity:0.4;}}input[aria-invalid='true']:is(
|
||
[type='color'],
|
||
[type='date'],
|
||
[type='datetime-local'],
|
||
[type='time']
|
||
):not(.sui) {border-color:var(--sui-error-border-color);}input:read-only {
|
||
/* Make readonly inputs selectable */-webkit-user-select:text;user-select:text;pointer-events:auto;}}.before-input.svelte-dkfcyc,
|
||
.after-input.svelte-dkfcyc,
|
||
.prefix.svelte-dkfcyc,
|
||
.suffix.svelte-dkfcyc {color:var(--sui-secondary-foreground-color);white-space:nowrap;}.hint.svelte-dkfcyc {flex:auto;margin-inline:var(--sui-focus-ring-width) !important;margin-block:var(--sui-focus-ring-width) 0 !important;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}.footer.svelte-dkfcyc {display:flex;gap:16px;justify-content:flex-end;margin-top:4px;}`};function N6(e,t){let n=Co();k(t,!0),q(e,J1e);let r=e=>{var t=M6(),n=F(t),r=e=>{var t=R1e();Ho(t,()=>tA(B(b)),!0),O(t),W(e,t)};K(n,e=>{B(b)&&e(r)});var i=L(n,2),a=e=>{var t=z1e(),n=I(t,!0);z(()=>G(n,B(v))),W(e,t)};K(i,e=>{B(v)&&e(a)}),W(e,t)},i=e=>{var t=M6(),n=F(t),r=e=>{var t=B1e(),n=I(t,!0);z(()=>G(n,B(y))),W(e,t)};K(n,e=>{B(y)&&e(r)});var i=L(n,2),a=e=>{var t=V1e();Ho(t,()=>tA(B(x)),!0),O(t),W(e,t)};K(i,e=>{B(x)&&e(a)}),W(e,t)},a=Mz(),o=Ez(),s=Y(t,`context`,19,()=>a.fieldContext??void 0),c=Y(t,`valueStoreKey`,19,()=>a.valueStoreKey??`currentValues`),l=Y(t,`inline`,3,!1),u=e=>{if(typeof e==`object`&&e)return;let n=o.current,r=c(),i=t.locale,a=t.keyPath;kz(()=>{n&&(n[r][i][a]=e)})},d=WO(),f=j(()=>jz(c())),p=j(()=>Nr(t.fieldConfig.widget,`string`)),m=j(()=>TR({config:t.fieldConfig,option:`hint`,locale:t.locale})??``),h=j(()=>bM({fieldConfig:t.fieldConfig,locale:t.locale})),g=j(()=>mM(t.fieldConfig)),_=j(()=>P1e(t.fieldConfig)),v=j(()=>B(_).prefix),y=j(()=>B(_).suffix),b=j(()=>B(_).beforeInputLabel),x=j(()=>B(_).afterInputLabel),S=j(()=>B(_).hasExtraLabels),C=j(()=>B(p)===`list`||B(g)),w=j(()=>o.current?.originalValues),T=j(()=>BA(o.current)),ee=j(()=>B(T).allLocales),E=j(()=>B(T).defaultLocale),te=j(()=>B(ee).filter(e=>e!==t.locale)),ne=j(()=>bz(o.current,t.locale,t.keyPath,c())),re=j(()=>L1e({draft:o.current,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,valueMap:B(ne),inEditorComponent:B(f)})),ie=j(()=>B(re).canTranslate),ae=j(()=>B(re).isDuplicated),oe=j(()=>B(re).areKeysDuplicated),se=j(()=>B(re).isShown),ce=j(()=>!B(f)&&B(ie)&&B(te).length),le=j(()=>!B(f)&&!B(ae)),ue=j(()=>FO.get(B(p))),de=j(()=>xM({valueMap:B(ne),keyPath:t.keyPath,isList:B(C),isCustomFieldType:!!B(ue)})),fe=j(()=>!k1e({currentValueMap:B(ne),originalValueMap:B(w)?.[t.locale]??{},keyPath:t.keyPath})),pe=j(()=>o.current?.validities[t.locale][t.keyPath]),me=j(()=>ER({config:t.fieldConfig,locale:t.locale})),he=j(()=>EY(o.current?.originalEntry)),ge=j(()=>zY(o.current)),_e=j(()=>B(he)||B(ge)),ve=j(()=>!B(f)&&P2(t.fieldConfig)),ye=j(()=>!!o.current&&L2({fieldConfig:t.fieldConfig,collection:o.current.collection,isIndexFile:o.current.isIndexFile,keyPath:t.keyPath,inEditorComponent:B(f)})),be=j(()=>B(ve)||B(ye)),xe=j(()=>F1e({fieldConfig:t.fieldConfig,autoSet:B(be),locked:B(_e),isDuplicated:B(ae),isNew:!!o.current?.isNew,parentReadonly:!!a.readonly})),Se=j(()=>B(xe).hidden),Ce=j(()=>B(xe).readonly),we=j(()=>B(xe).subfieldsReadonly);Nz({fieldContext:s(),parentComponentNames:[...a.parentComponentNames??[],t.componentName].filter(Boolean),extraHint:d,valueStoreKey:c(),get readonly(){return B(we)}});let Te=j(()=>!B(f)&&!B(Ce)&&!B(oe)),Ee=j6(()=>{let e={valueMap:B(ne),fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,defaultLocale:B(E)};return{restore:S1e({...e,restore:!0}),clear:S1e(e)}}),De=j(()=>B(pe)?.valid===!1),Oe=j(()=>I1e({fieldConfig:t.fieldConfig,inline:l()})),ke=j(()=>({locale:t.locale,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,fieldId:n,fieldLabel:B(me),fieldConfig:B(Oe),readonly:B(Ce),required:B(h),invalid:B(De)}));var Ae=U(),je=F(Ae),Me=e=>{let r=j(()=>k8[B(p)]);var i=H1e(),a=P(i),o=I(a,!0);h6(L(a,2),{children:(e,t)=>{var n=U(),i=F(n),a=()=>B(de),o=e=>u(e);Wo(i,()=>B(r),(e,t)=>{t(e,_s(()=>B(ke),{get currentValue(){return a()},set currentValue(e){o(e)}}))}),W(e,n)},$$slots:{default:!0}}),O(i),z(()=>{J(i,`data-field-type`,B(p)),J(i,`data-key-path`,t.keyPath),J(i,`data-typed-key-path`,t.typedKeyPath),J(a,`id`,`${n}-label`),G(o,B(me))}),W(e,i)},Ne=e=>{{let a=j(()=>X(`x_field`,{values:{field:B(me)}}));E6(e,{get"aria-label"(){return B(a)},get"data-field-type"(){return B(p)},get"data-key-path"(){return t.keyPath},get"data-typed-key-path"(){return t.typedKeyPath},get hidden(){return B(Se)},children:(e,a)=>{var s=q1e(),c=F(s),l=P(c),f=I(l,!0),g=L(l,2),_=e=>{W(e,U1e())};K(g,e=>{!B(Ce)&&B(h)&&e(_)});var v=L(g,2);Ml(v,{flex:!0});var y=L(v,2),b=e=>{y1e(e,{size:`small`,get locale(){return t.locale},get otherLocales(){return B(te)},get keyPath(){return t.keyPath}})},x=j(()=>B(ce)&&!B(ge)&&N1e.includes(B(p)));K(y,e=>{B(x)&&e(b)});var C=L(y,2),w=e=>{{let n=e=>{{let n=j(()=>X(`field_options`));ru(e,{get ariaLabel(){return B(n)},children:(e,n)=>{var r=M6(),i=F(r),a=e=>{T6(e,{get locale(){return t.locale},get otherLocales(){return B(te)},get keyPath(){return t.keyPath},submenu:!0})};K(i,e=>{B(ce)&&e(a)});var s=L(i,2);{let e=j(()=>!!B(ce)),n=j(()=>({revert:!B(fe),...B(Te)?Ee.availability:{}}));D6(s,{scope:`field`,get separator(){return B(e)},get available(){return B(n)},onSelect:e=>{let n=o.current;e===`revert`?M1e({draft:n,locale:t.locale,keyPath:t.keyPath}):C1e({draft:n,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,restore:e===`restore`})}})}W(e,r)},$$slots:{default:!0}})}},r=j(()=>X(`show_field_options`));kl(e,{variant:`ghost`,size:`small`,iconic:!0,get disabled(){return B(he)},popupPosition:`bottom-right`,get"aria-label"(){return B(r)},get onclick(){return Ee.update},get onkeydown(){return Ee.update},popup:n,$$slots:{popup:!0}})}};K(C,e=>{!B(ge)&&(B(ce)||B(le)||B(Te))&&e(w)}),O(c);var T=L(c,2),ee=e=>{f6(e,{get id(){return`${n}-error`},children:(e,n)=>{$r();var r=H();z(e=>G(r,e),[()=>o.current?.validationMessages[t.locale][t.keyPath]?.join(` `)]),W(e,r)},$$slots:{default:!0}})};K(T,e=>{B(pe)?.valid===!1&&e(ee)});var E=L(T,2);let ne;h6(P(E),{children:(e,n)=>{var a=U(),o=F(a),s=e=>{var n=W1e(),a=F(n);r(a);var o=L(a,2);{let e=j(()=>({...B(ke),fieldConfig:t.fieldConfig}));QXe(o,_s(()=>B(e),{get control(){return B(ue).control},get currentValue(){return B(de)}}))}var s=L(o,2);i(s),W(e,n)},c=e=>{Vc(e,{status:`warning`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`unsupported_field_type_x`,{values:{name:B(p)}})]),W(e,n)},$$slots:{default:!0}})},l=j(()=>yM(t.fieldConfig)===`unknown`),d=e=>{let t=j(()=>k8[B(p)]);var n=W1e(),a=F(n);r(a);var o=L(a,2),s=()=>B(de),c=e=>u(e);Wo(o,()=>B(t),(e,t)=>{t(e,_s(()=>B(ke),{get currentValue(){return s()},set currentValue(e){c(e)}}))});var l=L(o,2);i(l),W(e,n)};K(o,e=>{B(ue)?e(s):B(l)?e(c,1):e(d,-1)}),W(e,a)},$$slots:{default:!0}}),O(E);var re=L(E,2),ie=e=>{let n=j(()=>d.current);var r=K1e(),i=P(r),a=e=>{var t=G1e();Ho(t,()=>tA(B(m)),!0),O(t),W(e,t)};K(i,e=>{B(m)&&e(a)}),Wo(L(i,2),()=>B(n),(e,n)=>{n(e,{get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get currentValue(){return B(de)}})}),O(r),W(e,r)};K(re,e=>{!B(Ce)&&(B(m)||d.current)&&e(ie)}),z(()=>{J(l,`id`,`${n}-label`),G(f,B(me)),ne=rs(E,1,`field-wrapper svelte-dkfcyc`,null,ne,{"has-extra-labels":B(S)})}),W(e,s)},$$slots:{default:!0}})}};K(je,e=>{o.current&&B(se)&&B(p)!==`hidden`&&l()?e(Me):o.current&&B(se)&&B(p)!==`hidden`&&e(Ne,1)}),W(e,Ae),A()}var Y1e=V(`<p class="type-hint svelte-1rz7ywc"></p>`),X1e=V(`<!> <!>`,1),Z1e=V(`<div role="none" class="summary svelte-1rz7ywc"><!> <!></div>`),Q1e={hash:`svelte-1rz7ywc`,code:`.type-hint.svelte-1rz7ywc {margin:0 !important;padding:12px var(--field-editor-padding) 0;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}.summary.svelte-1rz7ywc {display:flex;align-items:center;gap:8px;padding:8px;}`};function $1e(e,t){k(t,!0),q(e,Q1e);let n=Y(t,`summaryContent`,3,void 0),r=Y(t,`summaryId`,3,void 0),i=Y(t,`hint`,3,void 0);var a=U(),o=F(a),s=e=>{Vc(e,{status:`warning`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`unknown_variable_type`)]),W(e,n)},$$slots:{default:!0}})},c=e=>{var n=X1e(),r=F(n),a=e=>{var t=Y1e();Ho(t,()=>tA(i()),!0),O(t),W(e,t)};K(r,e=>{i()&&e(a)}),Ro(L(r,2),17,()=>t.subFields,e=>e.name,(e,n)=>{kO(e,{children:(e,r)=>{{let r=j(()=>t.getSubFieldProps(B(n)));N6(e,_s(()=>B(r),{get locale(){return t.locale},get fieldConfig(){return B(n)}}))}},$$slots:{default:!0}})}),W(e,n)},l=e=>{let i=j(()=>n()?``:t.getSummary()),a=j(()=>t.getThumbnail());var o=U(),s=F(o),c=e=>{var t=Z1e(),o=P(t),s=e=>{N$(e,{get asset(){return B(a).asset},get src(){return B(a).url},variant:`icon`,cover:!0})};K(o,e=>{B(a)&&e(s)});var c=L(o,2),l=e=>{var t=U();Uo(F(t),n),W(e,t)},u=e=>{{let t=j(()=>sW.isSmallScreen?2:1);Xc(e,{get lines(){return B(t)},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(i))),W(e,n)},$$slots:{default:!0}})}};K(c,e=>{n()?e(l):e(u,-1)}),O(t),z(()=>J(t,`id`,r())),W(e,t)};K(s,e=>{(n()||B(i)||B(a))&&e(c)}),W(e,o)};K(o,e=>{t.unknownType?e(s):t.expanded?e(c,1):e(l,-1)}),W(e,a),A()}var e0e=V(`<span role="none" class="position svelte-57h597"> </span>`),t0e=V(`<span role="none" class="type svelte-57h597"> </span>`),n0e=V(`<!> <!>`,1),r0e=V(`<span role="none" class="label svelte-57h597"><!></span>`),i0e=V(`<div role="none" class="header svelte-57h597"><div role="none" class="start svelte-57h597"><!></div> <div role="none" class="center svelte-57h597"><!></div> <div role="none" class="end svelte-57h597"><!></div></div>`),a0e={hash:`svelte-57h597`,code:`.header.svelte-57h597 {display:flex;align-items:center;gap:8px;height:28px;background-color:var(--sui-secondary-border-color);& > div:where(.svelte-57h597) {display:flex;align-items:center;}.start:where(.svelte-57h597) {justify-content:flex-start;width:40%;}.center:where(.svelte-57h597) {justify-content:center;width:20%;}.end:where(.svelte-57h597) {justify-content:flex-end;width:40%;}
|
||
|
||
/* Make the expander button full-width when there is no other content */&:has(.center:where(.svelte-57h597):empty):has(.end:where(.svelte-57h597):empty) {.start:where(.svelte-57h597) {width:100%;button {justify-content:flex-start;padding:var(--sui-button-small-padding);width:-moz-available;width:-webkit-fill-available;width:stretch;aspect-ratio:auto;}}.center:where(.svelte-57h597),
|
||
.end:where(.svelte-57h597) {display:none;}}.label:where(.svelte-57h597) {display:flex;align-items:center;gap:8px;padding:var(--sui-button-small-padding);}.position:where(.svelte-57h597) {min-width:1.5em;font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);font-variant-numeric:tabular-nums;color:var(--sui-secondary-foreground-color);text-align:center;}.type:where(.svelte-57h597) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}}`};function P6(e,t){k(t,!0),q(e,a0e);let n=e=>{var t=n0e(),n=F(t),a=e=>{var t=e0e(),n=I(t,!0);z(()=>G(n,i())),W(e,t)};K(n,e=>{i()!==void 0&&e(a)});var o=L(n,2),s=e=>{var t=t0e(),n=I(t,!0);z(()=>G(n,r())),W(e,t)};K(o,e=>{r()&&e(s)}),W(e,t)},r=Y(t,`label`,3,``),i=Y(t,`position`,3,void 0),a=Y(t,`expanded`,15),o=Y(t,`expandable`,3,!0),s=Y(t,`centerContent`,3,void 0),c=Y(t,`endContent`,3,void 0);var l=i0e(),u=P(l),d=P(u),f=e=>{{let o=e=>{JQe(e,{get expanded(){return a()}})},s=j(()=>!r()&&i()===void 0),c=j(()=>a()?X(`collapse`):X(`expand`));ll(e,{size:`small`,get iconic(){return B(s)},get"aria-label"(){return B(c)},get"aria-expanded"(){return a()},get"aria-controls"(){return t.controlId},onclick:()=>{a(!a()),t.toggleExpanded?.()},startIcon:o,children:(e,t)=>{n(e)},$$slots:{startIcon:!0,default:!0}})}},p=e=>{var t=r0e(),r=P(t);n(r),O(t),W(e,t)};K(d,e=>{o()?e(f):e(p,-1)}),O(u);var m=L(u,2);Uo(P(m),()=>s()??jr),O(m);var h=L(m,2);Uo(P(h),()=>c()??jr),O(h),O(l),W(e,l),A()}var o0e=V(`<span role="none"> </span> <!> <!>`,1);function s0e(e,t){k(t,!0);let n=Y(t,`disabled`,3,!1);Vc(e,{status:`info`,children:(e,r)=>{var i=o0e(),a=F(i),o=I(a,!0),s=L(a,2);Ml(s,{flex:!0});var c=L(s,2);{let e=j(()=>X(`restore`));ll(c,{get id(){return t.id},variant:`secondary`,size:`small`,get label(){return B(e)},get disabled(){return n()},get onclick(){return t.onRestore}})}z(e=>G(o,e),[()=>X(`item_removed`)]),W(e,i)},$$slots:{default:!0}}),A()}var F6=new WeakMap,c0e=e=>{let t=F6.get(e);F6.delete(e),Object.entries(t).forEach(([t,n])=>{e.expanderStates._[t]=n})},l0e=({draft:e,key:t,locale:n,collapsed:r=!1})=>{let i=F6.get(e)?.[t]??e.expanderStates?._[t];if(i!==void 0)return i;if(r===`auto`){let r=vz(e,n),i=`${t.replace(/#$/,``)}.`;return!pj(r,i).some(e=>!e.slice(i.length).includes(`.`)&&!!r[e])}return!r},I6=(e,t)=>e?.expanderStates?._[t]??!0,L6=({draft:e,stateMap:t})=>{let n=e.expanderStates?._;if(!n)return;let r=F6.get(e),i=Object.entries(t).filter(([e,t])=>(r?.[e]??n[e])!==t);i.length&&(r||(r={},F6.set(e,r),queueMicrotask(()=>c0e(e))),Object.assign(r,Object.fromEntries(i)))},u0e=({collectionName:e,fileName:t,valueMap:n,keyPath:r,isIndexFile:i=!1})=>{let a=new Set,o={collectionName:e,fileName:t,valueMap:n,isIndexFile:i};return r.split(`.`).forEach((e,t,n)=>{let r=n.slice(0,t+1).join(`.`),i=_M({...o,keyPath:r}),s=mj.test(r);if(i?.widget===`object`)s&&a.add(r),a.add(`${r}#`);else if(i?.widget===`list`)a.add(s?r:`${r}#`);else if(t>0){let e=n.slice(0,t).join(`.`),i=_M({...o,keyPath:e});i?.widget===`object`&&`fields`in i&&a.add(`${e}.${i.name}#`),i?.widget===`list`&&(`field`in i||`types`in i)&&a.add(r)}}),[...a]},d0e=({draft:e})=>{let{collectionName:t,fileName:n,currentValues:r,validities:i,isIndexFile:a}=e,o={};Object.entries(i??{}).forEach(([e,i])=>{Object.entries(i).forEach(([i,{valid:s}])=>{s||u0e({collectionName:t,fileName:n,valueMap:r[e],keyPath:i,isIndexFile:a}).forEach(e=>{o[e]=!0})})}),L6({draft:e,stateMap:o})},R6=({locale:e,keyPath:t})=>{window.postMessage({type:`highlight-editor-field`,payload:{locale:e,keyPath:t}},window.location.origin)},f0e=(e,t)=>{let n=t.split(`.`);for(let t=n.length-1;t>=0;--t){let r=n.slice(0,t).join(`.`),i=e.querySelectorAll(r?`.field[data-key-path^="${CSS.escape(`${r}.`)}"]`:`.field[data-key-path]`);if(i.length)return i[i.length-1];let a=r?e.querySelector(`.field[data-key-path="${CSS.escape(r)}"]`):null;if(a)return a}},p0e=async({locale:e,keyPath:t,maxAttempts:n=20,interval:r=100})=>{let i=CSS.escape(t),a=`.field:is([data-key-path="${i}"], [data-validation-key="${i}"])`;await new Promise(e=>{window.requestAnimationFrame(e)});let o=document.querySelector(`.content-editor .pane[data-mode="edit"][data-locale="${CSS.escape(e)}"]`);if(!o)return null;let s;for(let e=0;e<n;e+=1){let e=o.querySelector(a);if(e||!o.isConnected)return e;let n=f0e(o,t);if(!n||n===s)return null;s=n,n.scrollIntoView({block:`center`}),await Zc(r)}return o.querySelector(a)},m0e=async({draft:e,locale:t,keyPath:n,isOutdated:r=()=>!1})=>{let{collectionName:i,fileName:a,currentValues:o,isIndexFile:s}=e,c=u0e({collectionName:i,fileName:a,valueMap:o[t]??{},keyPath:n,isIndexFile:s});L6({draft:e,stateMap:Object.fromEntries(c.map(e=>[e,!0]))});let l=await p0e({locale:t,keyPath:n});if(!l||r())return;typeof l.scrollIntoViewIfNeeded==`function`?l.scrollIntoViewIfNeeded():l.scrollIntoView();let u=l.querySelector(`.field-wrapper`);(u?.querySelector(`[contenteditable="true"], [tabindex="0"]`)??u?.querySelector(`input, textarea, button`))?.focus()},h0e=({event:e,locale:t})=>{let n=e.type===`keydown`;if(e.defaultPrevented||n&&e.key!==`Enter`)return;let{target:r}=e,i=(n?r:r.closest?.(`[data-key-path]`))?.getAttribute(`data-key-path`);i&&R6({locale:t,keyPath:i})},g0e=({scrollTop:e,scrollHeight:t,clientHeight:n,targetScrollHeight:r,targetClientHeight:i})=>{let a=t-n;return a<=0?0:Math.max(0,r-i)*(e/a)},_0e=({y:e,top:t,height:n,targetTop:r,targetHeight:i})=>{let a=(e-t)/n;if(!(a<0||a>1))return r+i*a},v0e=(e,t)=>{let n=t.split(`.`);for(let t=n.length;t>0;--t){let r=CSS.escape(n.slice(0,t).join(`.`)),i=e.querySelector(`[data-key-path="${r}"]`);if(i?.getClientRects().length)return i;let a=[...e.querySelectorAll(`[data-lazy-key-path="${r}"]`)].findLast(e=>e.childElementCount&&e.getClientRects().length&&!(i&&e.contains(i)));if(a)return a}},y0e=async({container:e,keyPath:t,scrollTo:n,isOutdated:r=()=>!1,maxAttempts:i=20,interval:a=100})=>{let o;for(let s=0;s<i;s+=1){let i=v0e(e,t);if(i?.dataset.lazyKeyPath===void 0||!n(i)&&i===o)return i;if(o=i,await Zc(a),r())return}return v0e(e,t)},b0e=({viewTop:e,viewHeight:t,scrollTop:n,top:r,height:i,always:a=!1})=>{let o=r-e,s=e+t,c=r+i;if(i>t)return!a&&c>e&&r<s?void 0:Math.max(0,n+o);if(!(!a&&r>=e&&c<=s))return Math.max(0,n+o-(t-i)/2)},x0e=e=>e?Number.parseFloat(getComputedStyle(e).top)+e.getBoundingClientRect().height:0,S0e=async({item:e,list:t,isOutdated:n=()=>!1,maxAttempts:r=5,interval:i=100})=>{let a=e.firstElementChild,o=()=>e.getBoundingClientRect().top-t.getBoundingClientRect().top;for(let t=0;t<r;t+=1){e.scrollIntoView();let t=o();if(await Zc(i),n()||o()===t||a.getBoundingClientRect().bottom<=window.innerHeight)return}},C0e=async e=>{let t=await CX(e);return new File([t],e.name,{type:t.type})},w0e=({files:e,findExisting:t})=>{let n=new Map;return(r,i,a)=>{let o=n.get(r);return o||(o=(async()=>{let n=await i();if(!n)return;let r=await t?.(n,a);if(r)return r;let o=await _X(n);return e[o]={file:n,folder:a,replace:!1},o})(),n.set(r,o)),o}},T0e=(e,t)=>t?JZ(e,t):[e],E0e=async({value:e,format:t,rewrite:n})=>{let r=new Map(await Promise.all(T0e(e,t).map(async e=>[e,await n(e)])));return t?pWe(e,r,t):r.get(e)},D0e=(e,t,n)=>{let{fields:r}=e,{types:i,typeKey:a=`type`}=e,o=i?t[a]:void 0;return{fields:kM({value:t,fields:r,types:i,typeKey:a}),typedKeyPath:VR(n,o)}},O0e=({container:e,key:t,fieldConfig:n,typedKeyPath:r,callback:i})=>{let a=e[t],{widget:o=`string`}=n,s=hk.includes(o);if(s||mk.includes(o))(Array.isArray(a)&&!s?a.map((e,t)=>[a,t]):[[e,t]]).forEach(([e,t])=>{let a=e[t];typeof a==`string`&&a&&i({value:a,format:s?kZ(n):void 0,typedKeyPath:r,set:n=>{e[t]=n}})});else if(o===`object`&&D(a))z6({obj:a,...D0e(n,a,r),callback:i});else if(o===`list`&&Array.isArray(a)){let{field:e}=n;a.forEach((t,o)=>{e?O0e({container:a,key:o,fieldConfig:e,typedKeyPath:`${r}.*.${e.name}`,callback:i}):D(t)&&z6({obj:t,...D0e(n,t,`${r}.*`),callback:i})})}},z6=({obj:e,fields:t,typedKeyPath:n,callback:r})=>{t.forEach(t=>{let{name:i}=t;i in e&&O0e({container:e,key:i,fieldConfig:t,typedKeyPath:`${n}.${i}`,callback:r})})},k0e=e=>rX(e)&&!/^[a-z][a-z\d+.-]*:/i.test(e),A0e=(e,t)=>{let{field:n}=e,{fields:r}=e,{types:i}=e;return i?OM(i,t):r??[n]},j0e=1,B6=e=>(Array.isArray(e)?e.forEach(B6):D(e)&&Object.keys(e).forEach(t=>{Vj(t)?delete e[t]:B6(e[t])}),e),M0e=({draft:e,valueStoreKey:t=`currentValues`,fieldConfig:n,keyPath:r,typedKeyPath:i,index:a,locale:o,pairedItems:s=!1,componentName:c})=>{let{originalEntry:l,collectionName:u,fileName:d}=e,{hasSingleSubField:f}=KR(n),{field:p}=n,{typeKey:m=`type`}=n,h=s?Object.keys(e[t]):[o],g={format:`sveltia-cms/list-item`,version:j0e,id:crypto.randomUUID(),copiedAt:Date.now(),locale:o,values:{},assets:{}},_=new Map;return h.forEach(o=>{let[s]=eQe(e[t][o],r);if(!(a in s))return;let h=B6(structuredClone(s[a])),v=f?{[p.name]:h}:h,y={};!f&&`types`in n&&(g.type??=v[m],delete v[m]),z6({obj:v,fields:A0e(n,g.type)??[],typedKeyPath:VR(`${i}.*`,g.type),callback:({value:t,format:n,typedKeyPath:r})=>{T0e(t,n).forEach(t=>{if(t.startsWith(`blob:`)){let n=e.files[t]?.file;n&&_.set(t,n);return}if(!k0e(t)||t in y)return;let n=iX({value:t,entry:l,collectionName:u,fileName:d,componentName:c,typedKeyPath:r,locale:o});n&&(y[t]=n.path)})}}),g.values[o]=v,g.assets[o]=y}),{data:g,files:_}},N0e=e=>{let t;try{t=JSON.parse(e,(e,t)=>e===`__proto__`||Vj(e)?void 0:t)}catch{return}if(!(!D(t)||t.format!==`sveltia-cms/list-item`||t.version!==j0e||typeof t.locale!=`string`||t.copiedAt!==void 0&&typeof t.copiedAt!=`number`||t.type!==void 0&&typeof t.type!=`string`||!D(t.values)||!D(t.values[t.locale])||!Object.values(t.values).every(D)||t.assets!==void 0&&!(D(t.assets)&&Object.values(t.assets).every(D))))return{assets:{},...t}},P0e=e=>typeof e==`string`||typeof e==`number`,F0e=(e,t)=>{let n=YN(e);return Number.isNaN(n)?void 0:QN({inputValue:n,fieldConfig:t})},I0e=(e,t)=>{let{widget:n=`string`}=t;if(e===null)return null;if(n===`boolean`)return typeof e==`boolean`?e:void 0;if(n===`code`)return typeof e==`string`||D(e)?e:void 0;if(n===`keyvalue`)return D(e)?e:void 0;if(!fk.includes(n)&&!_k.includes(n))return e;if(P0e(e))return n===`number`?F0e(e,t):pk.includes(n)||mk.includes(n)?String(e):e},L0e=(e,t,n)=>{let{widget:r=`string`}=t;if(r===`object`)return D(e)?R0e(e,t,n):void 0;if(r===`list`)return Array.isArray(e)?z0e(e,t,n):void 0;if(mM(t)&&e!==null){let n=(Array.isArray(e)?e:[e]).map(e=>I0e(e,t));return n.includes(void 0)?void 0:n}return I0e(_k.includes(r)&&Array.isArray(e)&&e.length===1?e[0]:e,t)},V6=(e,t,n)=>{let{locale:r,defaultLocale:i,stats:a}=n,o={},s=0;return t.forEach(t=>{let{name:a}=t;if(a in e){let r=L0e(e[a],t,n);if(r!==void 0){o[a]=r,s+=1;return}}let c=jj(X3({fields:[t],locale:r,defaultLocale:i}));a in c&&(o[a]=c[a])}),a.dropped+=Object.keys(e).length-s,{value:o,matched:s}},R0e=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=t;if(!i)return V6(e,r??[],n).value;let{[a]:o,...s}=e,c=OM(i,o);if(c)return{...V6(s,c,n).value,[a]:o}},z0e=(e,t,n)=>{let{field:r,fields:i,types:a}=t;return r?e.flatMap(e=>{let t=L0e(e,r,n);return t===void 0?(n.stats.dropped+=1,[]):[t]}):i||a?e.flatMap(e=>{let r=D(e)?R0e(e,t,n):void 0;return r===void 0?(n.stats.dropped+=1,[]):[r]}):e.flatMap(e=>P0e(e)?[String(e)]:(n.stats.dropped+=1,[]))},B0e=async({draft:e,valueStoreKey:t=`currentValues`,copied:{data:n,files:r},fieldConfig:i,typedKeyPath:a,componentName:o,inEditorComponent:s=!1})=>{let{originalEntry:c,collectionName:l,fileName:u,isIndexFile:d}=e,{hasSingleSubField:f,hasVariableTypes:p}=KR(i),{field:m}=i,h=p?n.type:void 0,g=A0e(i,h);if(!g)return;let _={dropped:0},v=new Set,y={},b=[],x=w0e({files:e.files,findExisting:(t,n)=>p3({draft:e,file:t,folder:n})}),S=(e,t,n)=>x(e,t,n).catch(()=>void 0),C=async({src:t,assetPaths:n,fieldTypedKeyPath:i,locale:a})=>{let s=t.startsWith(`blob:`),f=n[t];if(s&&t in e.files||!s&&!f)return;let p=()=>d3({collectionName:l,fileName:u,componentName:o,typedKeyPath:i,isIndexFile:d});if(s){let e=r.get(t),n=e?p():void 0,i=e&&n?await S(t,async()=>e,n):void 0;return i||v.add(t),i}let m=XY(f);if(!m){v.add(f);return}let h=LX(m,{pathOnly:!0,allowSpecial:!0,entry:c,locale:a});if(h!==void 0)return h===t?void 0:h;let g=p(),_=g?await S(f,()=>C0e(m),g):void 0;return _||v.add(f),_},w=[];if(Object.keys(e[t]).every((t,r)=>{let i=t in n.values?t:n.locale,a=structuredClone(n.values[i]),o={locale:t,defaultLocale:s?t:e.defaultLocale,stats:r?{dropped:0}:_};f&&!(m.name in a)&&Object.keys(a).length===1&&(a={[m.name]:Object.values(a)[0]});let{value:c,matched:l}=V6(a,g,o);return Object.keys(a).length&&!l?!1:(w.push({locale:t,value:c,assetPaths:n.assets[i]??{}}),!0)}))return w.forEach(({locale:t,value:n,assetPaths:r})=>{z6({obj:n,fields:g,typedKeyPath:VR(`${a}.*`,h),callback:({value:n,format:i,typedKeyPath:a,set:o})=>{b.push((async()=>{let s=await E0e({value:n,format:i,rewrite:e=>C({src:e,assetPaths:r,fieldTypedKeyPath:a,locale:t})});s===void 0?!i&&n.startsWith(`blob:`)&&!(n in e.files)&&o(``):o(s)})())}}),y[t]=f?n[m.name]:n}),await Promise.all(b),{type:h,items:y,droppedCount:_.dropped,missingFileCount:v.size}},H6,V0e=async e=>{H6=M0e(e);try{return await navigator.clipboard.writeText(JSON.stringify(H6.data)),!0}catch{return!1}},H0e=async()=>{let e;try{e=N0e(await navigator.clipboard.readText())}catch{}return e&&e.id!==H6?.data.id&&!(H6&&(e.copiedAt??0)<H6.data.copiedAt)?{data:e,files:new Map}:H6},U6=(e,t,n)=>{let{widget:r=`string`}=t;if(r===`uuid`)return typeof e==`string`&&e?mA(n,e,()=>$3(t)):e;if(r===`compute`)return nB(t.value)?``:e;if(r!==`object`&&r!==`list`)return e;let{field:i}=t,{fields:a}=t,{types:o,typeKey:s}=t,c=e=>{D(e)&&U0e(e,kM({value:e,fields:a,types:o,typeKey:s}),n)};return r===`object`?c(e):Array.isArray(e)&&(i?e.forEach((t,r)=>{e[r]=U6(t,i,n)}):e.forEach(c)),e},U0e=(e,t,n)=>{t.forEach(t=>{let{name:r}=t;r in e&&(e[r]=U6(e[r],t,n))})},W6=e=>{Array.isArray(e)?e.forEach(W6):D(e)&&(delete e.__sc_item_original_key_path,Object.values(e).forEach(W6))},W0e=({draft:e,keyPath:t,itemCount:n,locale:r,collapsed:i,minimizeCollapsed:a=!1})=>({[`${t}#`]:a===`auto`?!n:!a,...Object.fromEntries(Array.from({length:n},(n,a)=>{let o=`${t}.${a}`;return[o,l0e({draft:e,key:o,locale:r,collapsed:i})]}))}),G0e=({valueList:e,keyPath:t,dupIndex:n,sourceItem:r,subFields:i,hasSingleSubField:a,field:o,type:s,types:c,typeKey:l,renewedUuids:u=new Map,locale:d,defaultLocale:f})=>{let p=(()=>{let t=typeof n==`number`&&n in e;if(r!==void 0||t){let s=structuredClone(t?e[n]:r);return W6(s),a&&o?U6(s,o,u):(D(s)&&U0e(s,kM({value:s,fields:c?void 0:i,types:c,typeKey:l}),u),s)}let s=jj(X3({fields:i,locale:d,defaultLocale:f}));return a&&o?s[o.name]:s})();return s&&(p[l]=s),a||(p.__sc_item_id=crypto.randomUUID(),XR(e,t)),p},K0e=({valueList:e,expanderStateList:t},{index:n,item:r,replace:i=!1})=>{e.splice(n,+!!i,r),t.splice(n,+!!i,!0)},q0e=({valueList:e,expanderStateList:t},{index:n,keyPath:r,tagItems:i})=>{i&&XR(e,r,{assignIds:!0});let[a]=e.splice(n,1);return t.splice(n,1),a},J0e=({valueList:e,expanderStateList:t},{index:n,item:r,expanded:i,keyPath:a,tagItems:o})=>{o&&XR(e,a),e.splice(n,0,r),t.splice(n,0,i)},Y0e=({valueList:e,expanderStateList:t},{from:n,to:r,keyPath:i,tagItems:a})=>{a&&XR(e,i,{assignIds:!0}),e.splice(r,0,...e.splice(n,1)),t.splice(r,0,...t.splice(n,1))},G6=(e,t)=>{i$.current={id:i$.current.id+1,show:!0,status:e,message:t}},X0e=({droppedCount:e,missingFileCount:t})=>{if(t)return{status:`warning`,message:X(`list_item_pasted_without_files`,{values:{count:t}})};if(e)return{status:`info`,message:X(`list_item_pasted_without_values`,{values:{count:e}})}},Z0e=(e,t)=>{let{index:n}=t,r=e.findIndex(e=>e.index>n),i=e.map(e=>e.index>n?{...e,index:e.index-1}:e);return r===-1?[...i,t]:[...i.slice(0,r),t,...i.slice(r)]},Q0e=(e,t)=>e.map(e=>e.index>t?{...e,index:e.index+1}:e),$0e=(e,t)=>{let n=e.findIndex(e=>e.id===t);return e.filter((e,t)=>t!==n).map((e,t)=>n!==-1&&t>=n?{...e,index:e.index+1}:e)},e2e=(e,t,n)=>{let r=`${t}.${n}`;return Object.entries(e).filter(([e])=>e.startsWith(r)&&/^[.#]/.test(e.slice(r.length))).map(([e,t])=>[e.slice(r.length),t])},t2e=({getLocale:e,getItemKeys:t})=>{let n=M([]),r=M(void 0),i=j(()=>B(r)?.locale===e()&&(0,Cr.default)(B(r).keys,t())?B(n):[]),a=j(()=>Map.groupBy(B(i),({index:e})=>e));return{get shown(){return B(i)},get byIndex(){return B(a)},remember:(t,n)=>{let i=e();n===i&&N(r,{locale:i,keys:t.map((e,n)=>YR(t,n))})},add:e=>{N(n,Z0e(B(i),e))},drop:e=>{N(n,$0e(B(i),e))},shift:e=>{N(n,Q0e(B(i),e))}}},n2e=({thumbnailFieldName:e,keyPath:t,typedKeyPath:n,hasSingleSubField:r=!1,collectionName:i,fileName:a,componentName:o,valueMap:s,isIndexFile:c=!1,entry:l,files:u,locale:d})=>{if(!e)return;let[f,...p]=kk(e).split(`.`),m={collectionName:i,fileName:a,componentName:o,valueMap:s,isIndexFile:c};if(r&&_M({...m,keyPath:t})?.name!==f)return;let h=r?p:[f,...p],g=[t,...h].filter(Boolean).join(`.`),_=[n,...h].filter(Boolean).join(`.`),v=_M({...m,keyPath:g}),{widget:y=`string`}=v??{};if(!v||!mk.includes(y))return;let b=v,x=s[sM(b)?`${g}.0`:g];if(typeof x!=`string`||!x)return;let S=bZ({value:x,entry:l,collectionName:i,fileName:a,componentName:o,fieldConfig:b,typedKeyPath:_,locale:d});if(!S)return;let{asset:C,url:w}=S;return C?BU(C)?S:void 0:(w.startsWith(`blob:`)?WU(u?.[w]?.file.type??``):GU(w))===`image`?S:void 0},r2e=({draft:e,typedKeyPath:t,type:n,...r})=>n2e({...r,typedKeyPath:VR(t,n),collectionName:e?.collectionName??``,fileName:e?.fileName,isIndexFile:!!e?.isIndexFile,entry:e?.originalEntry,files:e?.files}),i2e=V(`<div role="none" hidden=""> </div>`),a2e=V(`<!> <!> <!>`,1),o2e=V(`<div><!> <div role="none" class="item-body"><!></div></div>`),s2e=V(`<div role="none" class="item-wrapper svelte-n5zzp2"><!> <!></div>`),c2e=V(`<div role="none" class="removed-item-list svelte-n5zzp2"><!></div>`),l2e=V(`<!> <!> <div></div> <!> <!>`,1),u2e={hash:`svelte-n5zzp2`,code:`.item-list.svelte-n5zzp2 {display:flex;flex-direction:column;gap:16px;&.collapsed {display:none;}}.item-wrapper.svelte-n5zzp2,
|
||
.removed-item-list.svelte-n5zzp2 {display:flex;flex-direction:column;gap:16px;}.removed-item-list.svelte-n5zzp2 {margin-block-start:16px;}.item.svelte-n5zzp2 {flex:none;position:relative;border-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-primary-background-color); /* for dragging opacity */&.unknown-type {overflow:hidden;.alert {border-width:0;border-radius:0;}}
|
||
|
||
/* The dragged item is left as a faint placeholder marking the gap it would drop into. The
|
||
pointer already carries the browser’s own drag image of it, so showing it twice at full
|
||
strength would just be confusing. */&.dragging {opacity:0.25;}
|
||
|
||
/* Like the field menus, the buttons at the end of the header (Move Up/Down, options and
|
||
remove) are shown on hover, and kept visible while a keyboard user is in the item, so the
|
||
focused one isn’t invisible, or while the options menu is open */
|
||
@media (hover: hover) {&:not(:hover, :focus-within) > .header > .end button:not([aria-expanded='true']) {opacity:0;}
|
||
}}`};function d2e(e,t){let n=Co();k(t,!0),q(e,u2e);let r=(e,t=jr)=>{var r=U();Ro(F(r),17,()=>je.byIndex.get(t())??[],e=>e.id,(e,t)=>{{let r=j(()=>B(me)||B(Te));s0e(e,{get id(){return`list-${n}-restore-${B(t).id??``}`},get disabled(){return B(r)},onRestore:()=>We(B(t))})}}),W(e,r)},i=Ez(),{valueStoreKey:a=`currentValues`,parentComponentNames:o=[]}=Mz(),s=o.at(-1),c=Y(t,`required`,3,!0),l=Y(t,`readonly`,3,!1),u=j(()=>t.fieldConfig.name),d=j(()=>t.fieldConfig.i18n),f=j(()=>Nr(t.fieldConfig.allow_add,!0)),p=j(()=>Nr(t.fieldConfig.allow_remove,!0)),m=j(()=>Nr(t.fieldConfig.allow_duplicate,!0)),h=j(()=>Nr(t.fieldConfig.allow_reorder,!0)),g=j(()=>t.fieldConfig.collapsed),_=j(()=>t.fieldConfig.summary),v=j(()=>t.fieldConfig.thumbnail),y=j(()=>Nr(t.fieldConfig.minimize_collapsed,!1)),b=j(()=>Nr(t.fieldConfig.max,1/0)),x=j(()=>Nr(t.fieldConfig.add_to_top,!1)),S=j(()=>TR({config:t.fieldConfig,option:`label`,locale:t.locale})),C=j(()=>TR({config:t.fieldConfig,option:`label_singular`,locale:t.locale})),w=j(()=>t.fieldConfig.field),T=j(()=>t.fieldConfig.fields),ee=j(()=>t.fieldConfig.types),E=j(()=>Nr(t.fieldConfig.typeKey,`type`)),te=j(()=>KR(t.fieldConfig)),ne=j(()=>B(te).hasSingleSubField),re=j(()=>B(te).hasVariableTypes),ie=j(()=>B(ee)??[]),ae=j(()=>B(T)??(B(w)?[B(w)]:[])),oe=j(()=>B(ne)?$Xe(B(w)):void 0),se=e=>BR({types:B(re)?B(ie):void 0,fields:B(ae),summary:B(_),type:e}),ce=j(()=>!!i.current?.isIndexFile),le=j(()=>i.current?.collectionName??``),ue=j(()=>i.current?.fileName),de=j(()=>i.current?.defaultLocale),fe=jz(a),pe=j(()=>!fe&&qR(t.fieldConfig)),me=j(()=>l()||t.locale!==B(de)&&(B(d)===`duplicate`||B(pe))),he=j(()=>bz(i.current,t.locale,t.keyPath,a)),ge=j(()=>!fe&&t.locale!==B(de)&&lR({fieldConfig:t.fieldConfig,getFieldArgs:{collectionName:B(le),fileName:B(ue),isIndexFile:B(ce),keyPath:t.keyPath,valueMap:B(he)}})),_e=j(()=>`${t.keyPath}#`),ve={},ye=j(()=>Lj(ve,B(he),t.keyPath)??[]),be=j(()=>lje({fieldConfig:t.fieldConfig,itemCount:B(ye).length})),xe=j(()=>B(p)&&!(B(be)&&c()&&!B(re))),Se=j(()=>B(be)||I6(i.current,B(_e))),Ce=j(()=>B(ye).map((e,n)=>{let r=`${t.keyPath}.${n}`;return[r,I6(i.current,r)]})),we=qO(()=>B(ye).map((e,t)=>YR(B(ye),t))),Te=j(()=>B(ye).length>=B(b)),Ee=j(()=>B(re)?B(ie).flatMap(({fields:e=[]})=>e):B(ae)),De=j(()=>t.locale===B(de)||fe||B(ge)||B(Ee).some(({i18n:e})=>rR(e))),Oe=j(()=>B(me)||!B(De)),ke=j(()=>B(h)&&!B(be)),Ae=j(()=>B(me)||B(ye).length<2),je=t2e({getLocale:()=>t.locale,getItemKeys:()=>we.current}),Me=M(void 0),Ne=M(void 0),Pe=M(void 0),Fe,Ie=e=>{i.current&&L6({draft:i.current,stateMap:e})},Le=()=>{let e=i.current;e&&Ie(W0e({draft:e,keyPath:t.keyPath,itemCount:B(ye).length,locale:t.locale,collapsed:B(g),minimizeCollapsed:B(y)}))},Re=e=>{let n=i.current;n&&u6({draft:n,locale:t.locale,i18n:B(d),pairedItems:B(pe),valueStoreKey:a,keyPath:t.keyPath,manipulate:e})},ze=e=>B(Me)?.children[e]?.querySelector(`.item`),Be=async({index:e=B(x)?0:B(ye).length,dupIndex:n,type:r,sourceItems:a,replace:o=!1}={})=>{let s=i.current;if(!s)return;let c=new Map;N(Pe,e,!0),o||je.shift(e),Re(({valueList:i,expanderStateList:l,locale:u})=>{let{subFields:d}=se(r),f=G0e({valueList:i,keyPath:t.keyPath,dupIndex:n,sourceItem:a?.[u],subFields:d,hasSingleSubField:B(ne),field:B(w),type:r,types:B(ee),typeKey:B(E),renewedUuids:c,locale:u,defaultLocale:fe?u:s.defaultLocale});K0e({valueList:i,expanderStateList:l},{index:e,item:f,replace:o}),je.remember(i,u)}),Ie({[B(_e)]:!0}),await Zc(50),N(Pe,void 0);let l=ze(e);if(!l)return;let u=x0e(B(Ne));Fe=l,l.style.scrollMarginTop=`${u}px`,l.querySelector(`button`)?.focus({preventScroll:!0}),await S0e({item:l,list:B(Me),isOutdated:()=>l!==Fe})},Ve=async e=>{let n=i.current;n&&(await V0e({draft:n,valueStoreKey:a,fieldConfig:t.fieldConfig,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,index:e,locale:t.locale,pairedItems:B(pe),componentName:s}),G6(`success`,X(`list_item_copied`)))},He=async(e,{replace:n=!1}={})=>{let r=i.current;if(!r)return;let o=await H0e();if(!o){G6(`info`,X(`no_list_item_to_paste`));return}let c=await B0e({draft:r,valueStoreKey:a,copied:o,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:s,inEditorComponent:fe});if(i.current!==r)return;if(!c){G6(`error`,X(`list_item_not_compatible`));return}let{type:l,items:u,droppedCount:d,missingFileCount:f}=c;await Be({index:e,type:l,sourceItems:u,replace:n});let p=X0e({droppedCount:d,missingFileCount:f});p&&G6(p.status,p.message)},Ue=async e=>{let r=i.current;if(!r)return;let a=crypto.randomUUID(),o={},s={id:a,index:e,values:o,expanded:I6(r,`${t.keyPath}.${e}`),nestedExpanderStates:e2e(r.expanderStates._,t.keyPath,e)};je.add(s),Re(({valueList:n,expanderStateList:r,locale:i})=>{let a=q0e({valueList:n,expanderStateList:r},{index:e,keyPath:t.keyPath,tagItems:!B(ne)});a!==void 0&&(o[i]=a),je.remember(n,i)}),await Zc(50),document.getElementById(`list-${n}-restore-${a}`)?.focus()},We=async({id:e,index:n,values:r,expanded:i,nestedExpanderStates:a})=>{je.drop(e),Re(({valueList:e,expanderStateList:a,locale:o})=>{o in r&&(J0e({valueList:e,expanderStateList:a},{index:n,item:r[o],expanded:i,keyPath:t.keyPath,tagItems:!B(ne)}),je.remember(e,o))}),Ie(Object.fromEntries(a.map(([e,r])=>[`${t.keyPath}.${n}${e}`,r]))),await Zc(50),ze(n)?.querySelector(`button`)?.focus()},Ge=(e,n)=>{Re(({valueList:r,expanderStateList:i,locale:a})=>{Y0e({valueList:r,expanderStateList:i},{from:e,to:n,keyPath:t.keyPath,tagItems:!B(ne)}),je.remember(r,a)})},Ke=e=>bz(i.current,t.locale,`${t.keyPath}.${e}`,a),qe=(e,n,r=B(he))=>uje({collectionName:B(le),fileName:B(ue),keyPath:t.keyPath,valueMap:r,locale:t.locale,summaryTemplate:n,hasSingleSubField:B(ne),index:e,isIndexFile:B(ce)}),Je=d6({getItemCount:()=>B(ye).length,getListElement:()=>B(Me),onMove:Ge,getItemData:e=>qe(e,se(B(re)?B(ye)[e][B(E)]:void 0).summaryTemplate),settle:()=>Zc(50),getItemRect:e=>e.lastElementChild.getBoundingClientRect()}),Ye=(e,n)=>r2e({draft:i.current,thumbnailFieldName:B(v),keyPath:`${t.keyPath}.${e}`,typedKeyPath:`${t.typedKeyPath}.*`,type:n,hasSingleSubField:B(ne),componentName:s,valueMap:Ke(e),locale:t.locale}),Xe=()=>{B(re)&&B(ye).forEach((e,n)=>{let r=e?.[B(E)];se(r).unknownType&&zAe({fieldType:`list`,keyPath:`${t.keyPath}.${n}`,type:r,typeKey:B(E),types:B(ee)})})},Ze=j(()=>({fieldId:n,summaryId:t.summaryId,fieldConfig:t.fieldConfig,locale:t.locale,items:B(ye),fieldName:B(u),label:B(S),labelSingular:B(C),singleItem:B(be),parentExpanded:B(Se),parentExpandedKeyPath:B(_e),itemExpanderStates:B(Ce),allowAdd:B(f),addToTop:B(x),isAddDisabled:B(Oe),hasMaxItems:B(Te),addItem:Be,pasteItem:He,updateExpanderStates:Ie}));vs(()=>{Le(),Xe()});var Qe=l2e(),$e=F(Qe),eee=e=>{var n=i2e(),r=I(n,!0);z(()=>{J(n,`id`,t.summaryId),G(r,B(C)||B(S)||B(u))}),W(e,n)};K($e,e=>{B(be)&&e(eee)});var et=L($e,2),tt=e=>{e$e(e,_s({position:`top`},()=>B(Ze),{get element(){return B(Ne)},set element(e){N(Ne,e,!0)}}))};K(et,e=>{B(be)&&B(ye).length||e(tt)});var nt=L(et,2);us(nt,()=>({role:`none`,id:`list-${n}-item-list`,class:`item-list`,...Je.listProps,[cs]:{collapsed:!B(Se)}}),void 0,void 0,void 0,`svelte-n5zzp2`),Ro(nt,31,()=>Je.displayOrder,e=>we.current[e],(e,a,o)=>{let s=j(()=>B(ye)[B(a)]);var c=s2e(),u=P(c);r(u,()=>B(o));var d=L(u,2);{let e=j(()=>B(a)===B(Pe));kO(d,{get eager(){return B(e)},children:(e,r)=>{let c=j(()=>`${t.keyPath}.${B(a)}`),u=j(()=>B(re)?B(s)[B(E)]:void 0),d=j(()=>se(B(u))),h=j(()=>I6(i.current,B(c))),g=j(()=>Je.reorderControlProps(B(a)));var _=o2e();us(_,(e,t)=>({role:`group`,"aria-label":e,class:`item`,...t,[cs]:{"unknown-type":B(d).unknownType,dragging:Je.dragIndex===B(a)}}),[()=>B(be)?void 0:X(`list_item_position`,{values:{position:B(o)+1,count:B(ye).length}}),()=>Je.itemProps(B(a),{ownEventsOnly:!0})],void 0,void 0,`svelte-n5zzp2`);var v=P(_);{let e=e=>{var t=U(),n=F(t),r=e=>{c6(e,_s({get index(){return B(a)},get itemCount(){return B(ye).length},get disabled(){return B(Ae)},icon:`drag_handle`,part:`handle`},()=>B(g)))};K(n,e=>{B(ke)&&e(r)}),W(e,t)},r=e=>{var n=a2e(),r=F(n),i=e=>{c6(e,{get index(){return B(a)},get itemCount(){return B(ye).length},get disabled(){return B(Ae)},part:`buttons`,menu:!1,get onMove(){return B(g).onMove}})};K(r,e=>{B(ke)&&e(i)});var o=L(r,2);{let e=j(()=>B(re)?B(ie):void 0),n=j(()=>B(ke)&&!B(me));qQe(o,{get index(){return B(a)},get locale(){return t.locale},get variableTypes(){return B(e)},get unknownType(){return B(d).unknownType},get allowAdd(){return B(f)},get allowRemove(){return B(p)},get allowDuplicate(){return B(m)},get hasMaxItems(){return B(Te)},get isAddDisabled(){return B(Oe)},get itemCount(){return B(ye).length},get canReorder(){return B(n)},get moveItem(){return B(g).onMove},copyItem:Ve,pasteItem:He,addItem:Be})}var s=L(o,2),c=e=>{P$(e,{variant:`ghost`,get disabled(){return B(me)},onclick:()=>Ue(B(a))})};K(s,e=>{B(xe)&&e(c)}),W(e,n)},i=j(()=>B(re)&&B(d).typeConfig?ER({config:B(d).typeConfig,locale:t.locale}):``),s=j(()=>B(be)?void 0:B(o)+1),l=j(()=>B(d).subFields.length>0);P6(v,{get label(){return B(i)},get position(){return B(s)},get controlId(){return`list-${n}-item-${B(a)??``}-body`},get expanded(){return B(h)},get expandable(){return B(l)},toggleExpanded:()=>Ie({[B(c)]:!B(h)}),centerContent:e,endContent:r,$$slots:{centerContent:!0,endContent:!0}})}var y=L(v,2);{let e=e=>{rZe(e,_s({get locale(){return t.locale},get keyPath(){return B(n)},get typedKeyPath(){return`${t.typedKeyPath??``}.*`},get currentValue(){return B(s)}},()=>({fieldConfig:B(w),preview:B(oe)})))},n=j(()=>`${t.keyPath}.${B(a)}`),r=j(()=>B(re)?B(s)[B(E)]:void 0),o=j(()=>se(B(r))),c=j(()=>I6(i.current,B(n)));var b=P(y);{let i=j(()=>l()||!B(o).typeConfig?void 0:TR({config:B(o).typeConfig,option:`hint`,locale:t.locale})),s=j(()=>B(oe)?e:void 0);$1e(b,{get locale(){return t.locale},get subFields(){return B(o).subFields},getSubFieldProps:e=>({keyPath:B(ne)?B(n):`${B(n)}.${e.name}`,typedKeyPath:HR({typedKeyPath:`${t.typedKeyPath}.*`,type:B(r),subFieldName:e.name}),context:B(ne)?`single-subfield-list-field`:void 0}),get expanded(){return B(c)},get unknownType(){return B(o).unknownType},get hint(){return B(i)},getSummary:()=>qe(B(a),B(o).summaryTemplate,Ke(B(a))),getThumbnail:()=>Ye(B(a),B(r)),get summaryContent(){return B(s)}})}O(y)}O(_),z(()=>J(y,`id`,`list-${n}-item-${B(a)??``}-body`)),W(e,_)},$$slots:{default:!0}})}O(c),Xo(c,()=>_u,()=>({duration:200})),W(e,c)}),O(nt),ms(nt,e=>N(Me,e),()=>B(Me));var rt=L(nt,2),it=e=>{var t=c2e(),n=P(t);r(n,()=>B(ye).length),O(t),W(e,t)},at=j(()=>je.byIndex.has(B(ye).length)&&(B(Se)||!B(ye).length));K(rt,e=>{B(at)&&e(it)});var ot=L(rt,2),st=e=>{e$e(e,_s({position:`bottom`},()=>B(Ze)))};K(ot,e=>{B(f)&&!B(x)&&B(ye).length&&B(Se)&&!B(Te)&&e(st)}),W(e,Qe),A()}var f2e=V(`<div><!> <!> <!></div>`),p2e=V(`<div role="none" class="toolbar svelte-60yaxc"><!></div>`),m2e=V(`<div></div> <!>`,1),h2e={hash:`svelte-60yaxc`,code:`.item-list.svelte-60yaxc {display:flex;flex-direction:column;gap:4px;}.toolbar.svelte-60yaxc {display:flex;align-items:center;margin-block-start:8px;}.item.svelte-60yaxc {display:flex;align-items:center;gap:4px;
|
||
|
||
/* The dragged row is left as a faint placeholder marking the gap it would drop into. The
|
||
pointer already carries the browser’s own drag image of it, so showing it twice at full
|
||
strength would just be confusing. */&.dragging {opacity:0.25;}}`};function g2e(e,t){k(t,!0),q(e,h2e);let{valueStoreKey:n=`currentValues`}=Mz(),r=Ez(),i=Y(t,`required`,3,!0),a=Y(t,`readonly`,3,!1),o=Y(t,`invalid`,3,!1),s=kQe([``]),c=M(void 0),l=j(()=>t.fieldConfig.i18n),u=j(()=>Nr(t.fieldConfig.max,1/0)),d=j(()=>!a()),f=j(()=>s.values.length>1),p=j(()=>lje({fieldConfig:t.fieldConfig,itemCount:s.values.length})),m=()=>s.values.map(e=>e.trim()).filter(Boolean),h=()=>{let e=t.currentValue??[];(0,Cr.default)(m(),e)||s.replace(e.length?[...e]:[``])},g=()=>{let e=r.current,i=m();e&&((0,Cr.default)(i,t.currentValue??[])||GXe({draft:e,valueStoreKey:n,locale:t.locale,keyPath:t.keyPath,i18n:B(l),value:i}))},_=e=>B(c)?.children[e]?.querySelector(`input`),v=async e=>{s.insert(e,``),await ao(),_(e)?.focus()},y=async e=>{s.remove(e),await ao(),a6({index:e,getTarget:_})},b=d6({getItemCount:()=>s.values.length,getListElement:()=>B(c),onMove:(e,t)=>{s.move(e,t)},getItemData:e=>s.values[e]});YO(()=>t.currentValue,()=>{h()}),YO(()=>ai(s.values),()=>{g()});var x=m2e(),S=F(x);us(S,()=>({role:`none`,class:`item-list`,...b.listProps}),void 0,void 0,void 0,`svelte-60yaxc`),Ro(S,29,()=>b.displayOrder,e=>s.ids[e],(e,n)=>{var r=f2e();us(r,e=>({role:`none`,class:`item`,...e,[cs]:{dragging:b.dragIndex===B(n)}}),[()=>b.itemProps(B(n))],void 0,void 0,`svelte-60yaxc`);var c=P(r),l=e=>{{let t=j(()=>!B(f)),r=j(()=>b.reorderControlProps(B(n)));c6(e,_s({get index(){return B(n)},get itemCount(){return s.values.length},get disabled(){return B(t)}},()=>B(r)))}};K(c,e=>{B(d)&&!B(p)&&e(l)});var m=L(c,2);{let e=j(()=>OA(t.locale)),r=j(()=>i()&&s.values.length===1),c=j(()=>X(`list_item_value`));Gl(m,{get dir(){return B(e)},flex:!0,get readonly(){return a()},get invalid(){return o()},get required(){return B(r)},get ariaLabel(){return B(c)},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onkeydown:e=>{e.key!==`Enter`||e.isComposing||!B(d)||s.values.length>=B(u)||(e.preventDefault(),v(B(n)+1))},get value(){return s.values[B(n)]},set value(e){s.values[B(n)]=e}})}var h=L(m,2),g=e=>{{let t=j(()=>!B(f));P$(e,{variant:`ghost`,get disabled(){return B(t)},onclick:()=>{y(B(n))}})}};K(h,e=>{B(d)&&!B(p)&&e(g)}),O(r),Xo(r,()=>_u,()=>({duration:200})),W(e,r)}),O(S),ms(S,e=>N(c,e),()=>B(c));var C=L(S,2),w=e=>{var n=p2e();p6(P(n),{get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return s.values},addItem:()=>v(s.values.length)}),O(n),W(e,n)};K(C,e=>{B(d)&&s.values.length<B(u)&&e(w)}),W(e,x),A()}var _2e=new Set([`$$slots`,`$$events`,`$$legacy`,`fieldConfig`]);function v2e(e,t){let n=Co();k(t,!0);let r=gs(t,_2e),i=`list-${n}-summary`,a=j(()=>KR(t.fieldConfig)),o=j(()=>B(a).hasSubFields);{let n=j(()=>B(o)?i:void 0);OO(e,{get"aria-labelledby"(){return B(n)},children:(e,n)=>{var a=U(),s=F(a),c=e=>{{let n=j(()=>({...r,fieldConfig:t.fieldConfig,summaryId:i}));d2e(e,_s(()=>B(n)))}},l=e=>{{let n=j(()=>({...r,fieldConfig:t.fieldConfig}));g2e(e,_s(()=>B(n)))}};K(s,e=>{B(o)?e(c):e(l,-1)}),W(e,a)},$$slots:{default:!0}})}A()}var y2e=V(`<div role="none" class="header svelte-ygwzbn"> </div>`),b2e=V(`<div role="group" class="subsection svelte-ygwzbn"><!> <div role="none" class="items svelte-ygwzbn"><!></div></div>`),x2e={hash:`svelte-ygwzbn`,code:`.subsection.svelte-ygwzbn {margin:16px auto;border:2px solid var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);.title {font-size:inherit;font-weight:var(--sui-font-weight-normal);}}.header.svelte-ygwzbn {display:flex;align-items:center;height:24px;padding-inline:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-border-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);}.items.svelte-ygwzbn {padding:8px 16px;
|
||
|
||
/* Hide when no subfield is shown, leaving only the empty wrappers marking the subfields */&:not(:has(> :not(:empty))) {display:none;}}`};function S2e(e,t){let n=Co();q(e,x2e);let r=`${n}-header`;var i=b2e(),a=P(i),o=e=>{var n=y2e(),i=I(n,!0);z(()=>{J(n,`id`,r),G(i,t.label)}),W(e,n)};K(a,e=>{t.label&&e(o)});var s=L(a,2);Uo(P(s),()=>t.children??jr),O(s),O(i),z(()=>J(i,`aria-labelledby`,t.label?r:void 0)),W(e,i)}var C2e=V(`<h4 class="svelte-s650n2"> </h4>`),w2e=V(`<section role="group" tabindex="0" class="svelte-s650n2"><!> <!></section>`),T2e={hash:`svelte-s650n2`,code:`[role='document'] section.svelte-s650n2 {overflow:hidden;
|
||
/* Don’t set margin here because it makes scroll sync bumpy */padding:12px 0;h4:where(.svelte-s650n2) {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);&:not(:last-child) {margin-bottom:8px;}}& > * {margin-inline:auto;max-width:768px;}p {margin:8px auto 0;-webkit-user-select:text;user-select:text;}img {max-height:800px !important;}.sui.alert {margin-block:16px;}}
|
||
|
||
@media (width < 768px) {
|
||
/* A top-level field, which is wrapped for the Edit Pane to find it before it’s rendered */[role='document'] > [data-lazy-key-path] {& > section.svelte-s650n2:is([data-field-type='file']:where(.svelte-s650n2), [data-field-type='image']:where(.svelte-s650n2)):has(img),
|
||
& > section.svelte-s650n2:is([data-field-type='string']:where(.svelte-s650n2)):has(iframe) {overflow:visible;}& > section.svelte-s650n2:is([data-field-type='file']:where(.svelte-s650n2), [data-field-type='image']:where(.svelte-s650n2)) img {width:100%;max-height:none !important;}}
|
||
}`};function K6(e,t){k(t,!0),q(e,T2e);let n=Ez(),r=Y(t,`showLabel`,3,!0),i=j(()=>Nr(t.fieldConfig.widget,`string`)),a=j(()=>Nr(t.fieldConfig.preview,!0)),o=j(()=>ER({config:t.fieldConfig,locale:t.locale})),s=j(()=>mM(t.fieldConfig)),c=j(()=>B(i)===`list`||B(s)),l=j(()=>bz(n.current,t.locale,t.keyPath)),u=j(()=>L1e({draft:n.current,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,valueMap:B(l)})),d=j(()=>B(u).isShown),f=j(()=>FO.get(B(i))),p=j(()=>xM({valueMap:B(l),keyPath:t.keyPath,isList:B(c),isCustomFieldType:!!B(f)})),m=j(()=>({locale:t.locale,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,fieldConfig:t.fieldConfig,currentValue:B(p)}));var h=U(),g=F(h),_=e=>{var n=w2e(),a=P(n),s=e=>{var t=C2e(),n=I(t,!0);z(()=>G(n,B(o))),W(e,t)};K(a,e=>{r()&&e(s)}),h6(L(a,2),{children:(e,n)=>{var r=U(),a=F(r),o=e=>{{let n=j(()=>({...B(m),fieldConfig:t.fieldConfig}));rZe(e,_s(()=>B(n),{get preview(){return B(f).preview}}))}},s=e=>{let t=j(()=>A8[B(i)]);var n=U();Wo(F(n),()=>B(t),(e,t)=>{t(e,_s(()=>B(m)))}),W(e,n)};K(a,e=>{B(f)?.preview?e(o):B(i)in A8&&e(s,1)}),W(e,r)},$$slots:{default:!0}}),O(n),z(()=>{J(n,`data-field-type`,B(i)),J(n,`data-key-path`,t.keyPath),J(n,`data-typed-key-path`,t.typedKeyPath)}),_o(`keydown`,n,e=>{e.key===`Enter`&&(e.stopPropagation(),R6({locale:t.locale,keyPath:t.keyPath}))}),_o(`click`,n,e=>{e.stopPropagation(),R6({locale:t.locale,keyPath:t.keyPath})}),W(e,n)};K(g,e=>{t.fieldConfig&&B(i)!==`hidden`&&B(a)&&B(d)&&e(_)}),W(e,h),A()}vo([`keydown`,`click`]);var E2e=V(`<div role="none"><!></div>`);function D2e(e,t){k(t,!0);let n=Ez(),r=j(()=>t.fieldConfig.field),i=j(()=>t.fieldConfig.fields),a=j(()=>t.fieldConfig.types),o=j(()=>Nr(t.fieldConfig.typeKey,`type`)),s=j(()=>KR(t.fieldConfig)),c=j(()=>B(s).hasSingleSubField),l=j(()=>B(s).hasVariableTypes),u=j(()=>B(i)??(B(r)?[B(r)]:[])),d={},f=j(()=>Lj(d,bz(n.current,t.locale,t.keyPath),t.keyPath)??[]),p=j(()=>B(f).map(e=>B(l)?e[B(o)]:void 0));var m=U();Ro(F(m),19,()=>B(p),(e,t)=>YR(B(f),t),(e,n,r)=>{let i=j(()=>`${t.keyPath}.${B(r)}`);var o=E2e();kO(P(o),{children:(e,r)=>{let o=j(()=>BR({types:B(l)?B(a):void 0,fields:B(u),type:B(n)}));var s=U(),d=F(s),f=e=>{},p=e=>{let r=j(()=>B(o).typeConfig?ER({config:B(o).typeConfig,locale:t.locale}):void 0);S2e(e,{get label(){return B(r)},children:(e,r)=>{var a=U();Ro(F(a),17,()=>B(o).subFields,e=>e.name,(e,r)=>{let a=j(()=>B(c)?B(i):`${B(i)}.${B(r).name}`);var o=E2e();kO(P(o),{children:(e,i)=>{{let i=j(()=>HR({typedKeyPath:`${t.typedKeyPath}.*`,type:B(n),subFieldName:B(r).name}));K6(e,{get keyPath(){return B(a)},get typedKeyPath(){return B(i)},get locale(){return t.locale},get fieldConfig(){return B(r)}})}},$$slots:{default:!0}}),O(o),z(()=>J(o,`data-lazy-key-path`,B(a))),W(e,o)}),W(e,a)},$$slots:{default:!0}})};K(d,e=>{B(o).unknownType?e(f):e(p,-1)}),W(e,s)},$$slots:{default:!0}}),O(o),z(()=>J(o,`data-lazy-key-path`,B(i))),W(e,o)}),W(e,m),A()}var O2e=V(`<li> </li>`),k2e=V(`<ul></ul>`);function A2e(e,t){k(t,!0);var n=U(),r=F(n),i=e=>{var n=k2e();Ro(n,23,()=>t.currentValue,(e,t)=>`${e}-${t}`,(e,t)=>{var n=O2e(),r=I(n,!0);z(()=>G(r,B(t))),W(e,n)}),O(n),z((e,t)=>{J(n,`lang`,e),J(n,`dir`,t),n.dir=n.dir},[()=>DA(t.locale),()=>OA(t.locale)]),W(e,n)},a=j(()=>Array.isArray(t.currentValue)&&t.currentValue.length);K(r,e=>{B(a)&&e(i)}),W(e,n),A()}var j2e=new Set([`$$slots`,`$$events`,`$$legacy`,`fieldConfig`]);function M2e(e,t){k(t,!0);let n=gs(t,j2e);var r=U(),i=F(r),a=e=>{{let r=j(()=>({...n,fieldConfig:t.fieldConfig}));D2e(e,_s(()=>B(r)))}},o=j(()=>KR(t.fieldConfig).hasSubFields),s=e=>{{let r=j(()=>({...n,fieldConfig:t.fieldConfig}));A2e(e,_s(()=>B(r)))}};K(i,e=>{B(o)?e(a):e(s,-1)}),W(e,r),A()}var N2e=new Set([`$$slots`,`$$events`,`$$legacy`,`coordinates`,`class`,`mapElement`,`onReady`]),P2e=V(`<div></div>`),F2e={hash:`svelte-1c5gj1k`,code:`
|
||
/* Leaflet default styles copied from \`node_modules/leaflet/dist/leaflet.css\`. Somehow we can’t */
|
||
/* import it directly here; Vite emits it as a separate CSS file, which we want to avoid. */
|
||
/* Rules for the features we don’t use — popups, tooltips, the Layers and Scale controls, */
|
||
/* image/video overlays, div icons, marker shadows, the Canvas renderer and the legacy IE/VML */
|
||
/* hacks — have been dropped. */.leaflet-pane,
|
||
.leaflet-tile,
|
||
.leaflet-marker-icon,
|
||
.leaflet-tile-container,
|
||
.leaflet-pane > svg,
|
||
.leaflet-zoom-box,
|
||
.leaflet-layer {position:absolute;left:0;top:0;}.leaflet-container {overflow:hidden;-webkit-tap-highlight-color:transparent;background:#ddd;outline-offset:1px;font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5;}.leaflet-tile,
|
||
.leaflet-marker-icon {-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none;}.leaflet-tile::selection {background:transparent;}.leaflet-safari .leaflet-tile {image-rendering:-webkit-optimize-contrast;}.leaflet-safari .leaflet-tile-container {width:1600px;height:1600px;-webkit-transform-origin:0 0;transform-origin:0 0;}.leaflet-marker-icon {display:block;}.leaflet-container .leaflet-overlay-pane svg {max-width:none !important;max-height:none !important;}.leaflet-container .leaflet-marker-pane img,
|
||
.leaflet-container .leaflet-tile-pane img,
|
||
.leaflet-container .leaflet-tile {max-width:none !important;max-height:none !important;width:auto;padding:0;}.leaflet-container img.leaflet-tile {mix-blend-mode:plus-lighter;}.leaflet-container.leaflet-touch-zoom {-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y;}.leaflet-container.leaflet-touch-drag {-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom;}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {-ms-touch-action:none;touch-action:none;}.leaflet-container a {-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4);color:#0078a8;}.leaflet-tile {filter:inherit;visibility:hidden;}.leaflet-tile-loaded {visibility:inherit;}.leaflet-zoom-box {width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800;border:2px dotted #38f;background:rgba(255, 255, 255, 0.5);}.leaflet-overlay-pane svg {-moz-user-select:none;user-select:none;}.leaflet-pane {z-index:400;}.leaflet-tile-pane {z-index:200;}.leaflet-overlay-pane {z-index:400;}.leaflet-marker-pane {z-index:600;}.leaflet-map-pane svg {z-index:200;}.leaflet-control {position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto;float:left;clear:both;cursor:auto;}.leaflet-top,
|
||
.leaflet-bottom {position:absolute;z-index:1000;pointer-events:none;}.leaflet-top {top:0;}.leaflet-right {right:0;}.leaflet-bottom {bottom:0;}.leaflet-left {left:0;}.leaflet-right .leaflet-control {float:right;margin-right:10px;}.leaflet-top .leaflet-control {margin-top:10px;}.leaflet-bottom .leaflet-control {margin-bottom:10px;}.leaflet-left .leaflet-control {margin-left:10px;}.leaflet-zoom-animated {-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;}svg.leaflet-zoom-animated {will-change:transform;}.leaflet-zoom-anim .leaflet-zoom-animated {-webkit-transition:-webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1);-moz-transition:-moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1);transition:transform 0.25s cubic-bezier(0, 0, 0.25, 1);}.leaflet-zoom-anim .leaflet-tile,
|
||
.leaflet-pan-anim .leaflet-tile {-webkit-transition:none;-moz-transition:none;transition:none;}.leaflet-zoom-anim .leaflet-zoom-hide {visibility:hidden;}.leaflet-interactive {cursor:pointer;}.leaflet-grab {
|
||
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-webkit-grab;
|
||
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-moz-grab;cursor:grab;}.leaflet-crosshair,
|
||
.leaflet-crosshair .leaflet-interactive {cursor:crosshair;}.leaflet-dragging .leaflet-grab,
|
||
.leaflet-dragging .leaflet-grab .leaflet-interactive {cursor:move;
|
||
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-webkit-grabbing;
|
||
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-moz-grabbing;cursor:grabbing;}.leaflet-marker-icon,
|
||
.leaflet-pane > svg path,
|
||
.leaflet-tile-container {pointer-events:none;}.leaflet-marker-icon.leaflet-interactive,
|
||
.leaflet-pane > svg path.leaflet-interactive {pointer-events:visiblePainted;pointer-events:auto;}.leaflet-bar {box-shadow:0 1px 5px rgba(0, 0, 0, 0.65);border-radius:4px;}.leaflet-bar a {background-color:#fff;background-position:50% 50%;background-repeat:no-repeat;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black;}.leaflet-bar a:hover,
|
||
.leaflet-bar a:focus {background-color:#f4f4f4;}.leaflet-bar a:first-child {border-top-left-radius:4px;border-top-right-radius:4px;}.leaflet-bar a:last-child {border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none;}.leaflet-bar a.leaflet-disabled {cursor:default;background-color:#f4f4f4;color:#bbb;}.leaflet-touch .leaflet-bar a {width:30px;height:30px;line-height:30px;}.leaflet-touch .leaflet-bar a:first-child {border-top-left-radius:2px;border-top-right-radius:2px;}.leaflet-touch .leaflet-bar a:last-child {border-bottom-left-radius:2px;border-bottom-right-radius:2px;}.leaflet-control-zoom-in,
|
||
.leaflet-control-zoom-out {font:bold 18px 'Lucida Console',
|
||
Monaco,
|
||
monospace;text-indent:1px;}.leaflet-touch .leaflet-control-zoom-in,
|
||
.leaflet-touch .leaflet-control-zoom-out {font-size:22px;}.leaflet-container .leaflet-control-attribution {background:#fff;background:rgba(255, 255, 255, 0.8);margin:0;}.leaflet-control-attribution {padding:0 5px;color:#333;line-height:1.4;}.leaflet-control-attribution a {text-decoration:none;}.leaflet-control-attribution a:hover,
|
||
.leaflet-control-attribution a:focus {text-decoration:underline;}.leaflet-attribution-flag {display:inline !important;vertical-align:baseline !important;width:1em;height:0.6669em;}.leaflet-touch .leaflet-control-attribution,
|
||
.leaflet-touch .leaflet-bar {box-shadow:none;}.leaflet-touch .leaflet-bar {border:2px solid rgba(0, 0, 0, 0.2);background-clip:padding-box;}.map.svelte-1c5gj1k {margin:var(--sui-focus-ring-width);border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);overflow:hidden;aspect-ratio:1 / 1;background-clip:text;}.leaflet-container {font-family:inherit !important;font-size:var(--sui-font-size-small) !important;}.leaflet-container a {color:var(--sui-primary-accent-color-text) !important;text-decoration:none !important;}.leaflet-bar a {border-color:var(--sui-button-border-color) !important;color:var(--sui-secondary-foreground-color) !important;background-color:var(--sui-button-background-color) !important;}.leaflet-control {color:var(--sui-secondary-foreground-color) !important;background-color:var(--sui-secondary-background-color-translucent) !important;}.leaflet-control-attribution {padding:4px 8px;}
|
||
|
||
/* Dark theme: https://stackoverflow.com/q/59819792 */:root[data-theme='dark'] .leaflet-layer {filter:invert(100%) hue-rotate(180deg);}`};function I2e(e,t){k(t,!0),q(e,F2e);let n=Y(t,`class`,3,``),r=Y(t,`mapElement`,15),i=Y(t,`onReady`,3,void 0),a=gs(t,N2e),o,s=!1,c=M(void 0),l,u,d=()=>{let{latitude:e,longitude:n}=t.coordinates??{};if(e===u?.latitude&&n===u?.longitude)return;let{leaflet:r,map:i,iconUrl:a}=B(c);if(u=t.coordinates,l?.remove(),l=void 0,t.coordinates){let e=r.icon({iconUrl:a,iconSize:[25,41]});l=r.marker([t.coordinates.latitude,t.coordinates.longitude],{icon:e}).addTo(i),i.setView([t.coordinates.latitude,t.coordinates.longitude],12)}},f=async()=>{if(!r())return;let e=await dN(`leaflet`,`dist/leaflet-src.esm.js`),t=await lwe();if(s)return;let n=e.map(r(),{center:[0,0],zoom:2});e.tileLayer(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors`,referrerPolicy:`strict-origin`}).addTo(n),N(c,{leaflet:e,map:n,iconUrl:t}),d(),r().querySelectorAll(`a[href^="https:"]`).forEach(e=>{e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)}),o=new ResizeObserver(()=>{n?.invalidateSize()}),o.observe(r()),i()?.({leaflet:e,map:n})};R(()=>{B(c),t.coordinates?.latitude,t.coordinates?.longitude,co(()=>{B(c)&&d()})}),vs(()=>(f(),()=>{s=!0,o?.disconnect(),B(c)&&(B(c).map._animatingZoom=!1,B(c).map.remove())}));var p=P2e();us(p,e=>({role:`application`,class:`map ${n()??``}`,"aria-label":e,...a}),[()=>t.coordinates?X(`map_lat_lng`,{values:t.coordinates}):void 0],void 0,void 0,`svelte-1c5gj1k`),ms(p,e=>r(e),()=>r()),W(e,p),A()}var L2e=e=>Array.isArray(e)&&e.length>=2&&e.every(e=>typeof e==`number`&&Number.isFinite(e)),R2e=e=>Array.isArray(e)&&e.every(L2e),z2e=(e,t)=>t===`Point`?L2e(e):t===`LineString`?R2e(e):Array.isArray(e)&&e.every(R2e),B2e=(e,t=`Point`)=>{try{let n=JSON.parse(e);return D(n)&&n.type===t&&z2e(n.coordinates,t)?n:void 0}catch{return}},V2e=(e,t)=>!!B2e(e,t),H2e=(e,t)=>e.map(e=>Array.isArray(e)?e.map(e=>Array.isArray(e)?e.map(e=>dM(e,t)):dM(e,t)):dM(e,t)),U2e=e=>{if(e.type===`Point`)return null;let t=e.type===`Polygon`?e.coordinates.flat(1):e.coordinates;if(!t.every(e=>Array.isArray(e)&&typeof e[0]==`number`&&typeof e[1]==`number`))return null;let n=t.map(e=>e[1]),r=t.map(e=>e[0]);return[[Math.min(...n),Math.min(...r)],[Math.max(...n),Math.max(...r)]]},W2e=({snapshot:e,changeType:t,geometryType:n=`Point`,decimals:r})=>{let i=e.at(-1);if(i&&t===(n===`Point`?`create`:`delete`))return{value:JSON.stringify({type:n,coordinates:H2e(i.geometry.coordinates,r)}),staleIds:e.filter(e=>e.id!==i.id).map(e=>e.id)}},G2e=(e,t)=>{if(t.type===`Point`){let[n,r]=t.coordinates;typeof n==`number`&&typeof r==`number`&&e.setView([r,n],15);return}let n=U2e(t);n&&e.fitBounds(n)},K2e=async({leaflet:e,map:t,geometryType:n=`Point`,decimals:r,onChange:i,isCancelled:a})=>{let{TerraDraw:o,TerraDrawLineStringMode:s,TerraDrawPointMode:c,TerraDrawPolygonMode:l}=await dN(`terra-draw`,`dist/terra-draw.module.js`),{TerraDrawLeafletAdapter:u}=await dN(`terra-draw-leaflet-adapter`,`dist/terra-draw-leaflet-adapter.module.js?module`);if(a())return;let d={Point:c,LineString:s,Polygon:l}[n],f=n.toLowerCase(),p=new o({adapter:new u({lib:e,map:t}),modes:[new d]});p.start(),p.setMode(f),p.on(`change`,(e,t,a)=>{if(a&&`origin`in a)return;let o=W2e({snapshot:p.getSnapshot(),changeType:t,geometryType:n,decimals:r});o&&(i(o.value),o.staleIds.length&&p.removeFeatures(o.staleIds))});let m=(e,t)=>{p.clear(),p.addFeatures([{type:`Feature`,geometry:e,properties:{mode:t}}])};return{showGeometry:e=>{e?(m(e,f),G2e(t,e)):p.clear()},showDefaultView:({center:e,zoom:n})=>{t.setView(e?[e[1],e[0]]:[0,0],n??2)},setLocation:({latitude:e,longitude:i})=>{if(e=dM(e,r),i=dM(i,r),t.setView([e,i],15),n!==`Point`)return;let a={type:`Point`,coordinates:[i,e]};return m(a,`point`),JSON.stringify(a)},stop:()=>{p.stop()}}},q2e=`https://nominatim.openstreetmap.org/search`,J2e=async e=>{let t=e.trim();if(!t)return[];let n=new URLSearchParams({q:t,format:`jsonv2`});try{return await aW(`${q2e}?${n}`)}catch{return[]}},Y2e=class extends Error{constructor(){super(`Geolocation is not supported`),this.name=`GeolocationUnsupportedError`}},X2e=()=>new Promise((e,t)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(({coords:{latitude:t,longitude:n}})=>{e({latitude:t,longitude:n})},t):t(new Y2e)}),Z2e=V(`<div role="alert" class="search-result searching svelte-ktr5k7"> </div>`),Q2e=V(`<div role="alert" class="search-result no-result svelte-ktr5k7"> </div>`),$2e=V(`<div role="none" class="toolbar svelte-ktr5k7"><!> <!> <!></div> <!> <div class="map-wrapper svelte-ktr5k7"><!></div> <!>`,1),e4e={hash:`svelte-ktr5k7`,code:`.toolbar.svelte-ktr5k7 {display:flex;align-items:center;margin-bottom:var(--sui-spacing-2x);}.search-result.svelte-ktr5k7 {padding:12px;color:var(--sui-secondary-foreground-color);}.map-wrapper.svelte-ktr5k7 {display:contents;.map {aspect-ratio:auto;height:400px;&.invalid {border-color:var(--sui-error-border-color);}}}`};function t4e(e,t){k(t,!0),q(e,e4e);let n=Y(t,`currentValue`,15),r=Y(t,`readonly`,3,!1),i=Y(t,`invalid`,3,!1),a=j(()=>Nr(t.fieldConfig.decimals,7)),o=j(()=>Nr(t.fieldConfig.type,`Point`)),s=j(()=>t.fieldConfig.center),c=j(()=>t.fieldConfig.zoom),l=M(void 0),u=M(void 0),d=M(void 0),f=M(``),p=M(``),m=M(void 0),h=M(!1),g=M(!1),_=M(``),v=!1,y=async({leaflet:e,map:t})=>{let r=await K2e({leaflet:e,map:t,geometryType:B(o),decimals:B(a),onChange:e=>{N(f,e,!0)},isCancelled:()=>v});r&&(N(d,r),n()&&V2e(n(),B(o))||r.showDefaultView({center:B(s),zoom:B(c)}))},b=()=>{if(!B(d))return;let e=B2e(n()??``,B(o)),t=e?n():``;B(f)!==t&&(N(f,t,!0),B(d).showGeometry(e))},x=()=>{if(!B(d))return;let e=B(f);n()!==e&&n(e)},S=e=>{if(!B(d))return;let t=B(d).setLocation(e);t!==void 0&&N(f,t,!0)},C=({lat:e,lon:t})=>{S({latitude:parseFloat(e),longitude:parseFloat(t)})},w=async()=>{let e;try{e=await X2e()}catch(e){N(g,!0),e instanceof Y2e?N(_,X(`geolocation_unsupported`),!0):(N(_,X(`geolocation_error_body`),!0),console.error(`Error getting current location:`,e));return}S(e)},T=async()=>{n(``),await ao(),B(u).querySelector(`input`).focus()};ys(()=>{v=!0,B(d)?.stop()}),YO(()=>[B(d),n()],()=>{b()}),YO(()=>B(f),()=>{x()}),XO(()=>{let e=B(p);if(!e.trim())N(h,!1);else return N(h,!0),co(()=>J2e(e))},e=>{N(m,e,!0),N(h,!1)});var ee=$2e(),E=F(ee),te=P(E);{let e=j(()=>X(`find_place`)),t=j(()=>X(`find_place`));vu(te,{debounce:!0,get readonly(){return r()},flex:!0,get placeholder(){return B(e)},get"aria-label"(){return B(t)},get value(){return B(p)},set value(e){N(p,e,!0)}})}var ne=L(te,2);{let e=e=>{Lc(e,{name:`near_me`})},t=j(()=>X(`use_your_location`)),n=j(()=>X(`use_your_location`));ll(ne,{variant:`tertiary`,iconic:!0,get title(){return B(t)},get"aria-label"(){return B(n)},get disabled(){return r()},onclick:()=>{w()},startIcon:e,$$slots:{startIcon:!0}})}var re=L(ne,2);{let e=j(()=>X(`clear`)),t=j(()=>r()||!n());ll(re,{variant:`tertiary`,get label(){return B(e)},get disabled(){return B(t)},onclick:()=>{T()}})}O(E),ms(E,e=>N(u,e),()=>B(u));var ie=L(E,2),ae=e=>{var t=Z2e(),n=I(t,!0);z(e=>G(n,e),[()=>X(`searching`)]),W(e,t)},oe=e=>{var t=U(),n=F(t),r=e=>{var t=U(),n=F(t),r=e=>{{let t=j(()=>X(`search_results`));eu(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>B(m),e=>e.place_id,(e,t)=>{nu(e,{get label(){return B(t).display_name},onSelect:()=>{C(B(t))}})}),W(e,n)},$$slots:{default:!0}})}},i=e=>{var t=Q2e(),n=I(t,!0);z(e=>G(n,e),[()=>X(`no_results`)]),W(e,t)};K(n,e=>{B(m).length?e(r):e(i,-1)}),W(e,t)};K(n,e=>{B(m)&&e(r)}),W(e,t)};K(ie,e=>{B(h)?e(ae):B(p)&&e(oe,1)});var se=L(ie,2),ce=P(se);{let e=j(()=>i()?`invalid`:void 0);I2e(ce,{get inert(){return r()},get class(){return B(e)},onReady:y,get mapElement(){return B(l)},set mapElement(e){N(l,e,!0)}})}O(se);var le=L(se,2);{let e=j(()=>X(`geolocation_error_title`));Fl(le,{get title(){return B(e)},get open(){return B(g)},set open(e){N(g,e,!0)},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(_))),W(e,n)},$$slots:{default:!0}})}W(e,ee),A()}var n4e=V(`<pre class="svelte-1ox6w30"> </pre>`),r4e={hash:`svelte-1ox6w30`,code:`pre.svelte-1ox6w30 {white-space:pre-wrap;}`};function i4e(e,t){q(e,r4e);var n=U(),r=F(n),i=e=>{var n=n4e(),r=I(n,!0);z(()=>G(r,t.currentValue)),W(e,n)};K(r,e=>{t.currentValue&&e(i)}),W(e,n)}function a4e(e,t){k(t,!0);let n=Y(t,`currentValue`,15),r=Y(t,`required`,3,!0),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1),o=M(void 0),s=M(``),c=j(()=>t.fieldConfig.min),l=j(()=>t.fieldConfig.max),u=j(()=>Nr(t.fieldConfig.step,1)),d=()=>B(o)===void 0&&B(s).trim()?B(s):B(o),{updateInput:f}=ZO(()=>n(),e=>{n(e)},d,e=>{N(o,e,!0)},e=>Kwe({currentValue:e,fieldConfig:t.fieldConfig,inputValue:d()}),e=>QN({inputValue:e,fieldConfig:t.fieldConfig}));{let n=j(()=>GN(t.fieldConfig));CO(e,{get min(){return B(c)},get max(){return B(l)},get step(){return B(u)},get fractional(){return B(n)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},oninput:e=>{N(s,e.target.value,!0)},onblur:()=>{f()},get value(){return B(o)},set value(e){N(o,e,!0)}})}A()}var o4e=V(`<p> </p>`);function s4e(e,t){k(t,!0);let n=j(()=>DA(t.locale)),r=j(()=>Number(t.currentValue)),i=j(()=>Number.isNaN(B(r))?t.currentValue:UN(B(n)).format(B(r)));var a=U(),o=F(a),s=e=>{var r=o4e(),a=I(r,!0);z(e=>{J(r,`lang`,B(n)),J(r,`dir`,e),G(a,B(i)),r.dir=r.dir},[()=>OA(t.locale)]),W(e,r)};K(o,e=>{t.currentValue!==void 0&&t.currentValue!==null&&t.currentValue!==``&&e(s)}),W(e,a),A()}var c4e=({draft:e,valueStoreKey:t=`currentValues`,locale:n,keyPath:r,fieldConfig:i,type:a})=>{let{i18n:o=!1}=i,{types:s,typeKey:c=`type`}=i,{fields:l}=i,u=e[t],d=(a?s?.find(({name:e})=>e===a)?.fields:l)??[],f=t===`extraValues`?n:e.defaultLocale;iz(()=>{a&&e6({valueStore:u,locale:n,i18n:o,draft:e,keyPath:r},e=>{e[`${r}.${c}`]=a});let t=Object.fromEntries(Object.entries(X3({fields:d,locale:n,defaultLocale:f})).map(([e,t])=>[`${r}.${e}`,t])),i=n===f?t:UXe({draft:e,content:t,targetLanguage:n,keyPathPrefix:r});e6({valueStore:u,locale:n,i18n:o,draft:e,keyPath:r},e=>{Object.assign(e,Sr({...i,...e})),delete e[r]})})},l4e=({draft:e,valueStoreKey:t=`currentValues`,locale:n,keyPath:r,fieldConfig:i})=>{let{i18n:a=!1}=i,o={};return e6({valueStore:e[t],locale:n,i18n:a,draft:e,keyPath:r},(e,t)=>{let n={};pj(e,`${r}.`,{live:!0}).forEach(t=>{n[t.slice(r.length)]=Sr(e[t]),e[t]=null,delete e[t]}),o[t]=n,e[r]=null}),o},u4e=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,removedValues:r})=>{iz(()=>{Object.entries(r).forEach(([r,i])=>{let a=e[t][r];a&&(Object.entries(i).forEach(([e,t])=>{a[`${n}${e}`]=t}),delete a[n])})})},d4e=V(`<div role="none" class="removed-item svelte-pauyt3"><!></div>`),f4e=V(`<div role="group"><!> <div role="none" class="item-list"><!></div></div>`),p4e=V(`<!> <!> <!> <!>`,1),m4e={hash:`svelte-pauyt3`,code:`.wrapper.svelte-pauyt3 {border-inline-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);&.expanded,
|
||
&:has(.summary) {border-bottom-width:2px;}&.unknown-type {overflow:hidden;.alert {border-width:0;border-radius:0;}}}.removed-item.svelte-pauyt3 {margin-top:8px;}.sui.checkbox + .wrapper.svelte-pauyt3 {& > .group {margin-top:8px;}}`};function h4e(e,t){let n=Co();k(t,!0),q(e,m4e);let r=Ez(),{fieldContext:i,valueStoreKey:a=`currentValues`,parentComponentNames:o=[]}=Mz(),s=o.at(-1),c=i===`single-subfield-list-field`,l=Y(t,`required`,3,!0),u=Y(t,`readonly`,3,!1),d=M(void 0),f=M(void 0),p=j(()=>t.fieldConfig.name),m=j(()=>t.fieldConfig.collapsed),h=j(()=>t.fieldConfig.summary),g=j(()=>t.fieldConfig.thumbnail),_=j(()=>t.fieldConfig.fields),v=j(()=>t.fieldConfig.types),y=j(()=>Nr(t.fieldConfig.typeKey,`type`)),b=j(()=>r.current?.isIndexFile??!1),x=j(()=>r.current?.collectionName??``),S=j(()=>r.current?.fileName),C=j(()=>bz(r.current,t.locale,t.keyPath,a)),w=j(()=>({collectionName:B(x),fileName:B(S),valueMap:B(C),isIndexFile:B(b)})),T=j(()=>pj(B(C),`${t.keyPath}.`).some(e=>B(C)[e]!==void 0)),ee=j(()=>`${t.keyPath}#`),E=j(()=>I6(r.current,B(ee))),te=j(()=>Array.isArray(B(v))),ne=j(()=>`${t.keyPath}.${B(y)}`),re=j(()=>!B(T)&&B(f)?.locale===t.locale),ie=j(()=>B(te)?B(C)[B(ne)]:void 0),ae=j(()=>BR({types:B(te)?B(v):void 0,fields:B(_),summary:B(h),type:B(ie)})),oe=j(()=>B(ae).typeConfig),se=j(()=>B(ae).unknownType),ce=j(()=>B(ae).subFields),le=j(()=>B(ae).summaryTemplate),ue=j(()=>B(oe)?ER({config:B(oe),locale:t.locale}):B(ie)),de=()=>{let e=r.current;if(c||!e)return;let n=B(ee);L6({draft:e,stateMap:{[n]:l0e({draft:e,key:n,locale:t.locale,collapsed:B(m)})}})},fe=({type:e}={})=>{let n=r.current;n&&(c4e({draft:n,valueStoreKey:a,locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig,type:e}),N(f,void 0))},pe=()=>{N(f,{locale:t.locale,values:l4e({draft:r.current,valueStoreKey:a,locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig})})},me=()=>{B(d).querySelector(`:scope > .header button`)?.focus()},he=async()=>{u4e({draft:r.current,valueStoreKey:a,keyPath:t.keyPath,removedValues:B(f).values}),N(f,void 0),await ao(),me()},ge=async({type:e})=>{fe({type:e}),await ao(),me()},_e=async()=>{pe(),await ao(),document.getElementById(`object-${n}-restore`)?.focus()},ve=()=>LAe({...B(w),keyPath:t.keyPath,locale:t.locale,summaryTemplate:B(le)}),ye=()=>r2e({draft:r.current,thumbnailFieldName:B(g),keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,type:B(ie),componentName:s,valueMap:B(C),locale:t.locale}),be=j(ve),xe=j(ye),Se=`object-${n}-summary`,Ce=j(()=>!B(E)&&!B(se)&&(B(be)||B(xe))?Se:void 0);vs(()=>{de(),B(T)&&B(se)&&zAe({fieldType:`object`,keyPath:t.keyPath,type:B(ie),typeKey:B(y),types:B(v)})});var we=p4e(),Te=F(we),Ee=e=>{{let n=j(()=>X(`add_x`,{values:{name:t.fieldLabel||B(p)}}));jl(e,{get label(){return B(n)},get checked(){return B(T)},get disabled(){return u()},onChange:({detail:{checked:e}})=>{e?fe():pe()}})}};K(Te,e=>{!B(te)&&!l()&&e(Ee)});var De=L(Te,2),Oe=e=>{p6(e,{get disabled(){return u()},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},addItem:e=>ge(e)})};K(De,e=>{B(te)&&!B(T)&&e(Oe)});var ke=L(De,2),Ae=e=>{var t=d4e();s0e(P(t),{get id(){return`object-${n}-restore`},get disabled(){return u()},onRestore:he}),O(t),W(e,t)};K(ke,e=>{B(re)&&e(Ae)});var je=L(ke,2),Me=e=>{var i=f4e();let a;var o=P(i),s=e=>{{let t=e=>{var t=U(),n=F(t),r=e=>{P$(e,{get disabled(){return u()},onclick:()=>{_e()}})};K(n,e=>{B(te)&&e(r)}),W(e,t)},i=j(()=>B(te)?B(ue):``),a=j(()=>B(ce).length>0);P6(e,{get label(){return B(i)},get controlId(){return`object-${n}-item-list`},get expanded(){return B(E)},get expandable(){return B(a)},toggleExpanded:()=>L6({draft:r.current,stateMap:{[B(ee)]:!B(E)}}),endContent:t,$$slots:{endContent:!0}})}};K(o,e=>{c||e(s)});var l=L(o,2),f=P(l);{let e=j(()=>u()||!B(oe)?void 0:TR({config:B(oe),option:`hint`,locale:t.locale}));$1e(f,{get locale(){return t.locale},get subFields(){return B(ce)},getSubFieldProps:e=>({keyPath:`${t.keyPath}.${e.name}`,typedKeyPath:HR({typedKeyPath:t.typedKeyPath,type:B(ie),subFieldName:e.name})}),get expanded(){return B(E)},get unknownType(){return B(se)},get hint(){return B(e)},getSummary:()=>B(be),getThumbnail:()=>B(xe),get summaryId(){return Se}})}O(l),O(i),ms(i,e=>N(d,e),()=>B(d)),z(()=>{a=rs(i,1,`wrapper svelte-pauyt3`,null,a,{"unknown-type":B(se),expanded:B(E)}),J(i,`aria-labelledby`,B(Ce)),J(l,`id`,`object-${n}-item-list`)}),W(e,i)};K(je,e=>{(l()&&!B(te)||B(T))&&e(Me)}),W(e,we),A()}var g4e=V(`<div role="none"><!></div>`);function _4e(e,t){k(t,!0);let n=Ez(),r=j(()=>t.fieldConfig.fields),i=j(()=>t.fieldConfig.types),a=j(()=>Nr(t.fieldConfig.typeKey,`type`)),o=j(()=>bz(n.current,t.locale,t.keyPath)),s=j(()=>pj(B(o),`${t.keyPath}.`).some(e=>!!B(o)[e])),c=j(()=>Array.isArray(B(i))),l=j(()=>`${t.keyPath}.${B(a)}`),u=j(()=>B(c)?B(o)[B(l)]:void 0),d=j(()=>BR({types:B(i),fields:B(r),type:B(u)})),f=j(()=>B(d).typeConfig),p=j(()=>B(d).unknownType),m=j(()=>B(d).subFields),h=j(()=>B(f)?ER({config:B(f),locale:t.locale}):void 0);var g=U(),_=F(g),v=e=>{var n=U(),r=F(n),i=e=>{},a=e=>{S2e(e,{get label(){return B(h)},children:(e,n)=>{var r=U();Ro(F(r),17,()=>B(m),e=>e.name,(e,n)=>{let r=j(()=>`${t.keyPath}.${B(n).name}`);var i=g4e();kO(P(i),{children:(e,i)=>{{let i=j(()=>HR({typedKeyPath:t.typedKeyPath,type:B(f)?.name,subFieldName:B(n).name}));K6(e,{get keyPath(){return B(r)},get typedKeyPath(){return B(i)},get locale(){return t.locale},get fieldConfig(){return B(n)}})}},$$slots:{default:!0}}),O(i),z(()=>J(i,`data-lazy-key-path`,B(r))),W(e,i)}),W(e,r)},$$slots:{default:!0}})};K(r,e=>{B(p)?e(i):e(a,-1)}),W(e,n)};K(_,e=>{B(s)&&e(v)}),W(e,g),A()}function v4e(e,t){k(t,!0);let n=e=>{var n=U();Ro(F(n),17,()=>B(a),e=>e.path,(e,n)=>{v4e(e,{get node(){return B(n)},get selectedPath(){return t.selectedPath},get onSelectPath(){return t.onSelectPath}})}),W(e,n)},r=j(()=>t.node.path),i=j(()=>t.node.label),a=j(()=>t.node.children),o=j(()=>t.selectedPath===B(r)),s=j(()=>!B(r)||B(o)||t.selectedPath.startsWith(`${B(r)}/`));{let c=e=>{{let t=j(()=>B(r)?`folder`:`bookmark_manager`);Lc(e,{get name(){return B(t)}})}},l=j(()=>B(a).length?n:void 0);TO(e,{get label(){return B(i)},get selected(){return B(o)},get expanded(){return B(s)},get items(){return B(l)},onSelect:()=>{t.onSelectPath(B(r))},startIcon:c,$$slots:{startIcon:!0}})}A()}var q6=e=>e?e.split(`/`).length:0,y4e=(e,t)=>t?e===t?2:0:nA.includes(e)?2:1,b4e=({entries:e,indexFileName:t,subfolders:n})=>{let r=new Map,i=new Map;return e.forEach(e=>{let a=dA(e.subPath);if(!a)return;if(n){let n=y4e(e.subPath.slice(a.length+1),t);n>(i.get(a)??0)?(i.set(a,n),r.set(a,e)):r.has(a)||r.set(a,void 0)}else r.has(a)||r.set(a,void 0);let o=dA(a);for(;o&&!r.has(o);)r.set(o,void 0),o=dA(o)}),r},x4e=({collection:e,path:t,indexEntry:n,summaryTemplate:r,locale:i})=>{let a=t.slice(t.lastIndexOf(`/`)+1);return n&&$L(e,n,{locale:i,useTemplate:!0,template:r})||a},S4e=({collection:e,entries:t,pruneLeaves:n,excludePath:r,maxDepth:i=1/0,locale:a})=>{let o=iA(e);if(!o)return[];let{summary:s,subfolders:c}=o,l=b4e({entries:t,indexFileName:cA(e),subfolders:c}),u=new Map;[...l.keys()].forEach(e=>{let t=dA(e);mA(u,t,()=>[]).push(e)});let d=t=>(u.get(t)??[]).filter(e=>(!n||!c||!!u.get(e)?.length)&&e!==r&&q6(e)<=i).map(t=>({path:t,label:x4e({collection:e,path:t,indexEntry:l.get(t),summaryTemplate:s,locale:a}),children:d(t)})).sort((e,t)=>$E(e.label,t.label));return d(``)},C4e=({collection:e,entries:t})=>S4e({collection:e,entries:t,pruneLeaves:!0}),w4e=({collection:e,entries:t,ownFolderPath:n})=>{let r=iA(e)?.depth??1/0;if(!cA(e))return r-1;if(!n)return r-2;let i=q6(dA(n));return r-Math.max(2,...t.filter(({subPath:e})=>e.startsWith(`${n}/`)).map(({subPath:e})=>q6(e)-i))},T4e=({collection:e,entries:t,excludePath:n,locale:r})=>S4e({collection:e,entries:t,pruneLeaves:!1,excludePath:n,maxDepth:w4e({collection:e,entries:t,ownFolderPath:n}),locale:r}),E4e=({nodes:e,path:t})=>{let n=t.split(`/`).filter(Boolean),r=(e,[t,...n],i)=>{let a=i?`${i}/${t}`:t,o=e.find(e=>e.path===a);if(o)return n.length?e.map(e=>e===o?{...e,children:r(e.children,n,a)}:e):e;let s={path:a,label:t,children:n.length?r([],n,a):[]};return[...e,s].sort((e,t)=>$E(e.label,t.label))};return n.length?r(e,n,``):e},D4e=(e,t)=>e.reduce((e,n)=>e??(n.path===t?n:D4e(n.children,t)),void 0),O4e=({collection:e,subPath:t,isNew:n=!1})=>{if(n||!t||!e||!cA(e))return;let r=dA(t);return r?r.slice(r.lastIndexOf(`/`)+1):void 0},k4e=({collection:e,label:t,entries:n,newFolderPaths:r,excludePath:i,locale:a})=>({path:``,label:t,children:r.reduce((e,t)=>E4e({nodes:e,path:t}),T4e({collection:e,entries:n,excludePath:i,locale:a}))}),A4e=e=>(e?.children??[]).map(({path:e})=>e.slice(e.lastIndexOf(`/`)+1)),j4e=V(`<span role="none" class="label"> </span>`),M4e=V(`<header role="none"><h4 role="none"> </h4></header> <!> <div role="none" class="field-wrapper svelte-1cngjyd"><!> <!> <!></div>`,1),N4e=V(`<div role="none" class="new-parent-folder svelte-1cngjyd"><div role="none"><!> <!></div> <p role="none" class="svelte-1cngjyd"> </p></div>`),P4e=V(`<!> <!>`,1),F4e={hash:`svelte-1cngjyd`,code:`.field-wrapper.svelte-1cngjyd {display:flex;align-items:center;
|
||
/* Look like the \`<Select>\` trigger, which is a styled div rather than a button */.parent-folder-button {justify-content:flex-start;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-inline:calc(var(--sui-textbox-height) / 4);flex:auto;min-width:0;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);font-weight:var(--sui-font-weight-normal, normal);line-height:var(--sui-control-line-height);&:is(:hover, :focus-visible, [aria-expanded='true']) {color:var(--sui-control-foreground-color);background-color:var(--sui-hover-background-color);}&[aria-invalid='true'] {border-color:var(--sui-error-border-color);}.icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.label {flex:auto;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;}}.parent-folder-tree {min-width:240px;max-height:50vh;}
|
||
|
||
/* Stand beside the picker without stretching, so the folder name gets the room */.new-parent-folder-button {flex:none;height:var(--sui-textbox-height);white-space:nowrap;}}.new-parent-folder.svelte-1cngjyd {display:flex;flex-direction:column;gap:8px;min-width:320px;p:where(.svelte-1cngjyd) {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}}`};function I4e(e,t){let n=Co();k(t,!0),q(e,F4e);let r=Ez(),i=j(()=>r.current?.collection),a=j(()=>B(i)?oA(B(i)):void 0),o=j(()=>r.current?.validities[t.locale]._path),s=j(()=>B(o)?.valid===!1),c=j(()=>t.locale===B(i)?._i18n.defaultLocale),l=j(()=>B(c)&&!zY(r.current)),u=j(()=>O4e({collection:B(i),subPath:r.current?.originalEntry?.subPath,isNew:r.current?.isNew})),d=j(()=>XE(r.current?.currentPath??``)),f=j(()=>B(u)?dA(B(d)):B(d)),p=j(()=>!!B(i)&&iA(B(i))?.subfolders===!1),m=j(()=>!!B(i)&&B(f).split(`/`).filter(Boolean).length<w4e({collection:B(i),entries:[]})),h=M(!1),g=M(``),_=M(!1),v=M(na([])),y=j(()=>B(i)?k4e({collection:B(i),label:XA(B(i)),entries:Y2(B(i)),newFolderPaths:B(v),excludePath:B(u)?dA(r.current?.originalEntry?.subPath):void 0,locale:t.locale}):{path:``,label:``,children:[]}),b=j(()=>!B(i)||B(c)?B(f):X2({collection:B(i),dirPath:B(f),locale:t.locale})),x=j(()=>D4e([B(y)],B(f))),S=j(()=>B(x)?.label??B(b)),C=M(void 0),w=M(!1),T=j(()=>A4e(B(x))),ee=j(()=>oN({takenNames:B(T),name:B(g)})),E=j(()=>B(_)&&!!B(ee)),te=j(()=>!!B(y).children.length),ne=e=>{r.current&&(r.current.currentPath=B(u)?pP([e,B(u)]):e),N(w,!1)};var re=U(),ie=F(re),ae=e=>{var t=P4e(),r=F(t);E6(r,{"data-validation-key":`_path`,children:(e,t)=>{var r=M4e(),i=F(r),a=P(i),c=I(a,!0);O(i);var u=L(i,2),d=e=>{f6(e,{get id(){return`${n}-error`},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>r2(B(o)).join(` `)]),W(e,n)},$$slots:{default:!0}})};K(u,e=>{B(s)&&e(d)});var v=L(u,2),x=P(v);{let e=e=>{{let t=j(()=>B(f)?`folder`:`bookmark_manager`);Lc(e,{get name(){return B(t)}})}},t=e=>{Lc(e,{name:`expand_more`})},r=j(()=>!B(te)||!B(l)),i=j(()=>B(b)||void 0);ll(x,{class:`parent-folder-button`,variant:`tertiary`,get disabled(){return B(r)},"aria-haspopup":`tree`,get"aria-invalid"(){return B(s)},get"aria-labelledby"(){return`${n}-label`},get"aria-errormessage"(){return`${n}-error`},get"aria-description"(){return B(i)},get element(){return B(C)},set element(e){N(C,e,!0)},startIcon:e,endIcon:t,children:(e,t)=>{var n=j4e(),r=I(n,!0);z(()=>G(r,B(S))),W(e,n)},$$slots:{startIcon:!0,endIcon:!0,default:!0}})}var T=L(x,2);cl(T,{get anchor(){return B(C)},position:`bottom-left`,get open(){return B(w)},set open(e){N(w,e,!0)},children:(e,t)=>{{let t=j(()=>X(`entry_parent_folder`));Bxe(e,{get ariaLabel(){return B(t)},class:`parent-folder-tree`,selectionFollowsFocus:!1,children:(e,t)=>{v4e(e,{get node(){return B(y)},get selectedPath(){return B(f)},onSelectPath:ne})},$$slots:{default:!0}})}},$$slots:{default:!0}});var ee=L(T,2),E=e=>{{let t=e=>{Lc(e,{name:`create_new_folder`})},n=j(()=>!B(l)||!B(m)),r=j(()=>X(`new_parent_folder`));ll(e,{variant:`ghost`,iconic:!0,class:`new-parent-folder-button`,get disabled(){return B(n)},get"aria-label"(){return B(r)},onclick:()=>{N(g,``),N(_,!1),N(h,!0)},startIcon:t,$$slots:{startIcon:!0}})}};K(ee,e=>{B(p)&&e(E)}),O(v),z(e=>{J(a,`id`,`${n}-label`),G(c,e)},[()=>X(`entry_parent_folder`)]),W(e,r)},$$slots:{default:!0}});var i=L(r,2);{let e=j(()=>X(`new_parent_folder`)),t=j(()=>X(`new_parent_folder_create`)),r=j(()=>!!B(ee));Pl(i,{get title(){return B(e)},get okLabel(){return B(t)},get okDisabled(){return B(r)},onOk:()=>{let e=pP([B(f),aN(B(g))]);N(v,[...B(v),e],!0),ne(e)},get open(){return B(h)},set open(e){N(h,e,!0)},children:(e,t)=>{var r=N4e(),i=P(r),a=P(i);{let e=j(()=>X(`new_parent_folder_name`));Gl(a,{dir:`auto`,flex:!0,get ariaLabel(){return B(e)},get"aria-errormessage"(){return`${n}-new-folder-error`},get invalid(){return B(E)},oninput:()=>{N(_,!0)},get value(){return B(g)},set value(e){N(g,e,!0)}})}var o=L(a,2),s=e=>{f6(e,{get id(){return`${n}-new-folder-error`},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`new_parent_folder_error.${B(ee)}`)]),W(e,n)},$$slots:{default:!0}})};K(o,e=>{B(E)&&e(s)}),O(i);var c=I(L(i,2),!0);O(r),z(e=>G(c,e),[()=>X(`new_parent_folder_description`,{values:{folder:B(S)}})]),W(e,r)},$$slots:{default:!0}})}W(e,t)};K(ie,e=>{r.current&&B(a)&&(B(te)||B(p))&&e(ae)}),W(e,re),A()}var L4e=V(`<!> <!>`,1);function R4e(e,t){k(t,!0);let n=Ez(),r=j(()=>n.current?.fields??[]),i=j(()=>n.current?.currentPath!==void 0&&!n.current?.isIndexFile);kO(e,{children:(e,n)=>{var a=L4e(),o=F(a),s=e=>{I4e(e,{get locale(){return t.locale}})};K(o,e=>{B(i)&&e(s)}),Ro(L(o,2),17,()=>B(r),e=>e.name,(e,n)=>{kO(e,{children:(e,r)=>{N6(e,{get keyPath(){return B(n).name},get typedKeyPath(){return B(n).name},get locale(){return t.locale},get fieldConfig(){return B(n)}})},$$slots:{default:!0}})}),W(e,a)},$$slots:{default:!0}}),A()}var z4e=0,J6=void 0,Y6=void 0,B4e={saved:!1,restored:!1,deleted:!1},X6=GO({show:!1}),Z6=GO({...B4e}),Q6=async(e,t=``)=>{await J6?.delete([e,t])},$6=async(e,t=``)=>{let n=await J6?.get([e,t]);return n?n.cmsConfigVersion===tk.current?n:(await Q6(e,t),null):null},e8=({collection:e,fileName:t,isIndexFile:n,originalEntry:r})=>t??r?.subPath??(n?Ik(e):``),V4e=async e=>{let t=await $6(e.collectionName,e8(e)),n=t?.baseEntry?.subPath;return n!==void 0&&n!==e.originalEntry?.subPath?null:t},H4e=({originalEntry:e})=>e?.arrayIndex!==void 0,U4e=async e=>{if(!(CW.useDraftBackup??!0)||!e.interacted||zY(e)||H4e(e))return;let{collectionName:t,isNew:n,originalEntry:r,pendingEntries:i=[]}=e,a=e8(e);if(dz(e)){let o={timestamp:new Date,cmsConfigVersion:tk.current,collectionName:t,slug:a,...fz(e),pendingEntries:UO(i),...!n&&r?{baseEntry:UO(r)}:{}};await J6?.put(o)}else await $6(t,a)&&await Q6(t,a)},W4e=async({currentValues:e,files:t})=>{let n=new Set;return Object.values(e).forEach(e=>{Object.values(e).forEach(e=>{typeof e==`string`&&[...e.matchAll(vk(`g`))].forEach(([e])=>{let r=t[e]?.file;r&&n.add(r)})})}),new Map(await Promise.all([...n].map(async e=>[e,await _X(e)])))},G4e=({baseEntry:e,draft:t})=>{let{originalEntry:n,originalLocales:r}=t;e&&n&&!(0,Cr.default)(e.locales,UO(n.locales))&&(t.originalEntry=e,t.originalLocales=Object.fromEntries(Object.keys(r).map(t=>[t,!!e.locales[t]?.content])))},K4e=async({backup:e,draft:t})=>{let{baseEntry:n,currentLocales:r,currentPath:i,currentSlugs:a,currentValues:o,files:s,pendingEntries:c=[]}=e,l=await W4e(e);iz(()=>{t.currentLocales=r,t.currentSlugs=a,i!==void 0&&(t.currentPath=i),t.pendingEntries=c;let e=HL(t.collection);Object.entries(o).forEach(([n,r])=>{if(e&&e in r){let i=t.originalEntry?.locales[n]?.content?.[e];i===void 0?delete r[e]:r[e]=i}Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&([...n.matchAll(vk(`g`))].forEach(([e])=>{let r=s[e],{file:i}=r??{};if(!r||!i)return;let a=l.get(i);t.files[a]??=r,n=n.replaceAll(e,a)}),r[e]=n)}),t.currentValues[n]?l6(t.currentValues[n],r):t.currentValues[n]=z3({draft:t,locale:n,target:structuredClone(r)});let i=t.currentValues[n],a=Object.keys(i),o=Hz(i);a.forEach(e=>{i[e]===null&&Uz(o,e)&&(i[e]={})}),t.originalValues[n]||(t.originalValues[n]={})}),G4e({baseEntry:n,draft:t})})},q4e=async({draft:e})=>{if(!(CW.useDraftBackup??!0)||zY(e)||H4e(e))return;let{collectionName:t}=e,n=e8(e),r=await V4e(e);if(!r)return;let{timestamp:i}=r,{promise:a,resolve:o}=Promise.withResolvers();X6.current={show:!0,timestamp:i,resolve:o};let s=await a;s!==void 0&&(s?(await K4e({backup:r,draft:e}),e.interacted=!0):await Q6(t,n),Z6.current={restored:s,deleted:!s,saved:!1})},J4e=async e=>{(CW.useDraftBackup??!0)&&e&&!Z6.current.saved&&await V4e(e)&&(Z6.current={restored:!1,deleted:!1,saved:!0})},Y4e=()=>{Z6.current={...B4e}};JO(()=>{let e=KJ(XJ.current);e?e!==Y6&&(Y6=e,J6=new tD(e,`draft-backups`,{keyPath:[`collectionName`,`slug`]})):(J6=null,Y6=void 0)});var t8=()=>{globalThis.clearTimeout(z4e)},X4e=e=>{t8(),e&&J6&&(z4e=globalThis.setTimeout(()=>{U4e(e)},500))},Z4e=[`code`,`hidden`,`keyvalue`],n8=(e,t)=>{Object.hasOwn(e,t)&&!Pj(e[t])&&delete e[t]},Q4e=({field:e,fieldType:t,keyPath:n,content:r,index:i})=>{if(Uz(i,n)){let[e]=Wz(i,n);if(e!==void 0){let t=r[`${n}.${e}`];Rj(r,n),r[n]=t}else return Rj(r,n),!1}let a=r[n];if(D(a)||Array.isArray(a))return Rj(r,n),!1;if(pk.includes(t))return typeof a!=`string`&&(r[n]=String(a??``)),!0;if(t===`boolean`){if(typeof a!=`boolean`){let e=typeof a==`string`?a.trim().toLowerCase():a;if(e!==`true`&&e!==`false`)return!1;r[n]=e===`true`}return!0}if(t===`number`){let{value_type:t=`int`}=e;if(t!==`int`&&t!==`float`||typeof a==`number`||a===null)return!0;let i=typeof a==`string`?Number(a.trim()):NaN;if(a===``||Number.isNaN(i))return!1;r[n]=i}return!0},$4e=({keyPath:e,content:t,index:n,hasSubFields:r})=>{if(Wz(n,e).length)return n8(t,e),!0;if(Uz(n,e))return Rj(t,e),!1;let i=t[e];return Array.isArray(i)?!0:!r&&i!=null&&!D(i)?(delete t[e],t[`${e}.0`]=i,!0):(Rj(t,e),!1)},e3e=[`number`,`boolean`,`bigint`],t3e=(e,t,n)=>{let r=Wz(n,t);(r.length?r:[0]).forEach(n=>{let r=`${t}.${n}`,i=e[r];Object.hasOwn(e,r)&&(i===null||e3e.includes(typeof i))&&(e[r]=String(i??``))})},n3e=({keyPath:e,content:t,index:n})=>Uz(n,e)?(n8(t,e),!0):t[e]===null||(Rj(t,e),!1),r3e=e=>{let{field:t,keyPath:n,content:r,index:i}=e,{widget:a=`string`}=t;if(Z4e.includes(a)||yM(t)!==`builtin`)return Uz(i,n)&&n8(r,n),!0;if(a===`object`)return n3e(e);if(a===`list`){let{hasSubFields:n}=KR(t);return $4e({...e,hasSubFields:n})}return mM(t)?$4e({...e,hasSubFields:!1}):Q4e({...e,fieldType:a})},i3e=({content:e,defaultLocaleContent:t,field:n,keyPath:r,locale:i,defaultLocale:a})=>{let o=Object.keys(t).filter(e=>dj(e,r));return o.forEach(r=>{e[r]=UR({fieldConfig:n,value:t[r],sourceLocale:a,targetLocale:i})}),!!o.length},a3e=({defaultLocaleContent:e,variableTypes:t})=>Object.entries(t).every(([t,n])=>e[t]===n),o3e=({field:e,content:t,keyPath:n,variableTypes:r})=>{let{fields:i}=e;if(i)return{fields:i,variableTypes:r};let{typeKey:a=`type`}=e,o=`${n}.${a}`,s=t[o],c=DM(e,t,n);return{fields:c,variableTypes:c?{...r,[o]:s}:r}},r8=e=>{let{field:t,keyPath:n,content:r,index:i,locale:a,defaultLocale:o,defaultLocaleContent:s}=e,{fillDefaults:c=!0,inheritedI18n:l,variableTypes:u={}}=e,d=t.i18n??l,f=a!==o&&s&&a3e({defaultLocaleContent:s,variableTypes:u})?s:void 0;if(t.widget===`keyvalue`&&t.i18n===`duplicate_keys`&&f){Z3({valueStore:{[o]:f,[a]:r},defaultLocale:o,keyPath:n});return}if(c&&f&&WR(t)&&aje({content:r,fieldConfig:t,keyPath:n})&&!aje({content:f,fieldConfig:t,keyPath:n})){i3e({content:r,defaultLocaleContent:f,field:t,keyPath:n,locale:a,defaultLocale:o});return}if(!(Object.hasOwn(r,n)||Uz(i,n))||!r3e(e)||t.widget===`list`&&q3({fieldConfig:t,locale:a})&&!Wz(i,n).length){if(!c||iR(d)&&f&&i3e({content:r,defaultLocaleContent:f,field:t,keyPath:n,locale:a,defaultLocale:o}))return;Y3({content:r,keyPath:n,fieldConfig:t,locale:a,defaultLocale:o,dynamicValues:{}});return}let{widget:p=`string`}=t;if(mk.includes(p)&&mM(t)){t3e(r,n,i);return}if(p===`keyvalue`){iR(d)&&f&&dje({content:r,referenceContent:f,keyPath:n});return}if(p===`object`){if(r[n]===null)return;let i=o3e({field:t,content:r,keyPath:n,variableTypes:u});i.fields?.forEach(t=>{r8({...e,field:t,keyPath:`${n}.${t.name}`,inheritedI18n:d,variableTypes:i.variableTypes})});return}if(p!==`list`)return;let{field:m}=t,{fields:h}=t,{types:g}=t;!m&&!h&&!g?t3e(r,n,i):Wz(i,n).forEach(i=>{let a=`${n}.${i}`;if(m){r8({...e,field:m,keyPath:a,inheritedI18n:d});return}n8(r,a);let o=o3e({field:t,content:r,keyPath:a,variableTypes:u});o.fields?.forEach(t=>{r8({...e,field:t,keyPath:`${a}.${t.name}`,inheritedI18n:d,variableTypes:o.variableTypes})})})},i8=({fields:e,content:t,locale:n,defaultLocale:r,defaultLocaleContent:i,fillDefaults:a=!0})=>{let o=Hz(t);return e.forEach(e=>{r8({field:e,keyPath:e.name,fillDefaults:a,content:t,index:o,locale:n,defaultLocale:r,defaultLocaleContent:i})}),t},s3e=({fields:e,contentMap:t,defaultLocale:n})=>{let r=t[n];return r&&i8({fields:e,content:r,locale:n,defaultLocale:n}),Object.entries(t).forEach(([t,i])=>{t!==n&&i8({fields:e,content:i,locale:t,defaultLocale:n,defaultLocaleContent:r})}),t},c3e=/^.*\.\d+(?=\.)/,l3e=({contentMap:e,defaultLocale:t,getFieldArgs:n})=>{let r=e[t],i=(e,t)=>{let r=_M({...n,keyPath:t,valueMap:e});return r?.widget===`uuid`?r:void 0};r&&Object.keys(r).forEach(e=>{let t=i(r,e);t&&!r[e]&&(r[e]=$3(t))}),Object.entries(e).forEach(([e,a])=>{e!==t&&(Object.keys(a).forEach(e=>{let t=i(a,e);t&&!a[e]&&rR(t.i18n)&&(a[e]=$3(t))}),r&&Object.entries(r).forEach(([e,t])=>{let o=i(r,e),s=e.match(c3e)?.[0];o&&!a[e]&&cR({fieldConfig:o,getFieldArgs:{...n,keyPath:e,valueMap:r}})&&(!s||Object.keys(a).some(e=>e.startsWith(`${s}.`)))&&(a[e]=t)}))})},u3e=({collection:e,collectionFile:t,originalSlugs:n,isIndexFile:r=!1})=>{let i=e._type===`entry`,{allLocales:a,defaultLocale:o}=(t??e)._i18n;if(!i||r)return Object.fromEntries(a.map(e=>[e,!1]));let{editable:{create:s}}=f2(e),c=S2(e);return Object.fromEntries(a.map(e=>!s||n._||n[e]?[e,!1]:[e,e===o||c||`readonly`]))},d3e=({slugEditor:e,locale:t,defaultLocale:n})=>Object.entries(e).filter(([e,r])=>e===t||t===n&&r===`readonly`).map(([e])=>e),f3e=({slugEditor:e,defaultLocale:t,initialSlug:n})=>!n?.trim()||e[t]!==!0?{}:Object.fromEntries(d3e({slugEditor:e,locale:t,defaultLocale:t}).map(e=>[e,n])),p3e=({collection:e,originalEntry:t,initialPath:n})=>{if(!oA(e))return;let{subPath:r}=t;return typeof r==`string`?dA(r):XE(n??rA.current)},m3e=({contentMap:e,defaultLocale:t,getFieldArgs:n})=>{let r=e[t];r&&Object.entries(r).forEach(([i,a])=>{let o={...n,keyPath:i,valueMap:r},s=_M(o);s?.widget===`hidden`&&cR({fieldConfig:s,getFieldArgs:o})&&Object.entries(e).forEach(([e,n])=>{e!==t&&i in n&&(n[i]=structuredClone(a))})})},a8=({collection:e,collectionFile:t,originalEntry:n={},dynamicValues:r,extraValues:i,expanderStates:a,initialPath:o,initialSlug:s,isIndexFile:c=zk(e,n)})=>{let l=e.name,u=t?.name,{id:d,locales:f}=n,p=d===void 0,{fields:m=[],_i18n:h}=t??e,g=c?Lk(e):void 0,_=g?.fields??m,v=g?.editor?.preview??t?.editor?.preview??e.editor?.preview??$O.current?.editor?.preview??!0,y=g?.editor?.second_pane??t?.editor?.second_pane??e.editor?.second_pane??$O.current?.editor?.second_pane??!0,{allLocales:b,initialLocales:x,defaultLocale:S,canonicalSlug:{key:C}}=h,w=p?x:b.filter(e=>!!f?.[e]?.content),T=Object.fromEntries(b.map(e=>[e,w.includes(e)])),ee=p3e({collection:e,originalEntry:n,initialPath:o}),E=p?{}:C in(f?.[S]?.content??{})?Object.fromEntries(b.map(e=>[e,f?.[e]?.slug])):{_:f?.[S]?.slug??n.slug},te=Object.fromEntries(w.map(e=>p?[e,X3({fields:_,locale:e,defaultLocale:S,dynamicValues:r})]:[e,structuredClone(f?.[e]?.content)]));if(p){let e={contentMap:te,defaultLocale:S,getFieldArgs:{collectionName:l,fileName:u,isIndexFile:c}};l3e(e),m3e(e)}else s3e({fields:_,contentMap:te,defaultLocale:S});let ne=u3e({collection:e,collectionFile:t,originalSlugs:E,isIndexFile:c}),re=HO({id:p?crypto.randomUUID():d,createdAt:Date.now(),isNew:p,isIndexFile:c,canPreview:v,canShowSecondPane:y,collectionName:l,collection:e,fileName:u,collectionFile:t,fields:_,originalEntry:p?void 0:n,defaultLocale:S,originalLocales:T,currentLocales:structuredClone(T),originalSlugs:E,currentSlugs:{...structuredClone(E),...f3e({slugEditor:ne,defaultLocale:S,initialSlug:s})},originalPath:ee,currentPath:ee,originalValues:te,currentValues:{},files:{},extraValues:Object.fromEntries(b.map(e=>[e,gz(i?.[e]?UO(i[e]):{})])),validities:Object.fromEntries(b.map(e=>[e,{}])),validationMessages:Object.fromEntries(b.map(e=>[e,{}])),expanderStates:a??{_:{}},slugEditor:ne,interacted:!1,pendingEntries:[]},mje);return w.forEach(e=>{re.currentValues[e]=z3({draft:re,locale:e,target:structuredClone(te[e])})}),re},o8=({entryDraft:e,...t})=>{let{originalEntry:n={}}=t;kqe(),az(e.current);let r=a8(t);return e.current=r,EY(n)||q4e({draft:r}),r},s8=e=>!!e&&e.collection._type===`entry`&&!e.isIndexFile,h3e=e=>{if(!e||e.isNew||!s8(e)||zY(e)||EY(wY(e)))return!1;let{collection:t}=e;return aA(t)&&!cA(t)?!1:f2(t).editable.update},g3e=e=>!!e?.isNew&&s8(e)&&Object.values(e.slugEditor).includes(!0)&&f2(e.collection).editorRequired,_3e=(e,{templateOnly:t=!1}={})=>{let{defaultLocaleSlug:n,localizedSlugs:r}=w2({draft:e,templateOnly:t});return r?Object.fromEntries(Object.entries(r).filter(([t])=>!!e.currentLocales[t])):{_:n}},v3e=({draft:e,slugs:t})=>{e.currentSlugs={...e.currentSlugs,...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,iN(t,{locale:e})]))}},y3e=e=>{let{collection:t,isNew:n,defaultLocale:r,currentPath:i,currentLocales:a,currentSlugs:o}=e;if(n||!cA(t))return;let s=XE(i??``);return S2(t)?{[r]:s,...Object.fromEntries(Object.entries(o).filter(([e,t])=>e!==r&&!!a[e]&&!!J2(t)).map(([e,t])=>[e,dA(t)]))}:{[r]:s}},b3e=({draft:e,ownFolderPaths:t})=>{let{defaultLocale:n,originalEntry:r}=e,i=T2(e).filter(e=>e.id!==r?.id);return Object.fromEntries(Object.entries(t).map(([e,t])=>{let r=dA(t);return[e,i.map(t=>e===n?t.subPath:t.locales[e]?.slug).filter(e=>typeof e==`string`).map(e=>dA(e)).filter(e=>dA(e)===r).map(e=>q2(e))]}))},x3e=({draft:e,ownFolderPaths:t,folderNames:n})=>{let{defaultLocale:r}=e,{currentPath:i,currentSlugs:a}=e;Object.entries(n).forEach(([e,n])=>{let o=pP([dA(t[e]),aN(n)]);e===r?i=o:a={...a,[e]:pP([o,bk(a[e]).basename])}}),e.currentPath=i,e.currentSlugs=a},S3e=V(`<span class="required" aria-hidden="true">*</span>`),C3e=V(`<header role="none"><h4 role="none"> </h4> <!></header>`),w3e=V(`<!> <!> <div role="none" class="field-wrapper"><!></div>`,1);function T3e(e,t){let n=Co();k(t,!0);let r=Ez(),i=Y(t,`ariaLabelledby`,3,void 0),a=j(()=>i()??`${n}-label`),o=j(()=>r.current?.slugEditor[t.locale]),s=j(()=>f2(r.current.collection)),c=j(()=>B(o)===!0&&B(s).editorRequired),l=j(()=>B(o)===`readonly`),u=j(()=>r.current?.validities[t.locale]._slug),d=j(()=>!B(l)&&B(u)?.valid===!1),f=j(()=>B(u).customErrorMessage),p=j(()=>r.current?.currentSlugs[t.locale]??``),m=j(()=>{if(B(s).editorRequired)return``;let e=_3e(r.current,{templateOnly:!0});return e[t.locale]??e._}),h=j(()=>B(p)||B(m)),g=M(!1),_=M(``),v=j(()=>E2(r.current,[t.locale])[t.locale]),y=j(()=>{if(B(g))return O2({slug:B(_),required:!1,pattern:B(s).pattern,takenSlugs:B(v),locale:t.locale})}),b=e=>{let n=r.current;n&&d3e({slugEditor:n.slugEditor,locale:t.locale,defaultLocale:n.defaultLocale}).forEach(t=>{n.currentSlugs[t]=e})},x=e=>!B(y)&&(e!==B(h)&&b(e.trim()),!0);YO(()=>B(p),()=>{B(c)&&B(_)!==B(p)&&N(_,B(p),!0)});var S=U(),C=F(S),w=e=>{E6(e,{children:(e,t)=>{var r=w3e(),o=F(r),u=e=>{var t=C3e(),r=P(t),i=I(r,!0),a=L(r,2),o=e=>{W(e,S3e())};K(a,e=>{B(c)&&e(o)}),O(t),z(e=>{J(r,`id`,`${n}-label`),G(i,e)},[()=>X(`slug`)]),W(e,t)};K(o,e=>{i()||e(u)});var p=L(o,2),v=e=>{f6(e,{get id(){return`${n}-error`},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>k2({error:B(y),pattern:B(s).pattern})]),W(e,n)},$$slots:{default:!0}})},S=e=>{f6(e,{get id(){return`${n}-error`},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(f))),W(e,n)},$$slots:{default:!0}})};K(p,e=>{B(y)?e(v):B(d)&&!B(g)&&e(S,1)});var C=L(p,2),w=P(C),T=e=>{Gl(e,{dir:`auto`,oninput:()=>{b(B(_))},flex:!0,get required(){return B(c)},get invalid(){return B(d)},get"aria-labelledby"(){return B(a)},get"aria-errormessage"(){return`${n}-error`},get value(){return B(_)},set value(e){N(_,e,!0)}})},ee=e=>{{let t=j(()=>!B(l)),r=j(()=>X(`edit_slug`)),i=j(()=>!!B(y)||B(d)&&!B(g)),o=j(()=>!!B(y));r6(e,{get id(){return`${n}-value`},get value(){return B(h)},get canEdit(){return B(t)},get editLabel(){return B(r)},get placeholder(){return B(m)},get invalid(){return B(i)},get applyDisabled(){return B(o)},get ariaLabelledby(){return B(a)},get ariaErrormessage(){return`${n}-error`},onApply:x,get editing(){return B(g)},set editing(e){N(g,e,!0)},get text(){return B(_)},set text(e){N(_,e,!0)}})}};K(w,e=>{B(c)?e(T):e(ee,-1)}),O(C),W(e,r)},$$slots:{default:!0}})};K(C,e=>{r.current&&e(w)}),W(e,S),A()}var E3e=V(` <!>`,1);function D3e(e,t){k(t,!0);let n=Y(t,`show`,15,!1),r=Y(t,`onShowErrors`,3,void 0);Pu(e,{get show(){return n()},set show(e){n(e)},children:(e,i)=>{Vc(e,{status:`error`,children:(e,i)=>{$r();var a=E3e(),o=F(a),s=L(o),c=e=>{{let t=j(()=>X(`show_errors`));ll(e,{variant:`secondary`,size:`small`,get label(){return B(t)},onclick:()=>{n(!1),r()()}})}};K(s,e=>{r()&&e(c)}),z(e=>G(o,`${e??``} `),[()=>X(`entry_validation_errors`,{values:{count:t.count}})]),W(e,a)},$$slots:{default:!0}})},$$slots:{default:!0}}),A()}var O3e=/(?:^|\/)(?:\.{1,2})(?:\/|$)/,k3e=e=>{let{id:t,collection:n,currentLocales:r}=e,{defaultLocale:i}=n._i18n,a=cA(n);if(!uA(e))return!1;let{defaultLocaleSlug:o,localizedSlugs:s}=w2({draft:e}),c=[...VL(n.name),...yY(n.name)].filter(e=>e.id!==t);return Object.entries(r).filter(([,e])=>e).some(([t])=>{let n=s?.[t]??o;if(Q2({draft:e,locale:t,slug:n}))return!1;let r=Z2({draft:e,slug:n,indexFileName:a,locale:t});return c.some(e=>t===i?e.subPath===r:e.locales[t]?.slug===r)})},A3e=e=>{let{collection:t,currentLocales:n,originalPath:r,currentPath:i}=e;if(!oA(t))return{valid:!0,validities:{}};let a=XE(i??``),o=O3e.test(a)||a.includes(`\\`),s=!o&&!!r&&a!==r&&!!iA(t)?.subfolders&&fA(r,a),c=!o&&!s&&k3e(e),l=o||s||c,u={};return Object.keys(n).forEach(e=>{u[e]={_path:{patternMismatch:o,customError:s,duplicateError:c,valid:!l}}}),{valid:!l,validities:u}},c8=({draft:e,enforceRequired:t=!0})=>{let{valid:n,validities:r,validationMessages:i}=K2(`currentValues`,{enforceRequired:t,draft:e}),{valid:a,validities:o,validationMessages:s}=K2(`extraValues`,{enforceRequired:t,draft:e}),{valid:c,validities:l}=cJe(e),{valid:u,validities:d}=A3e(e);return{valid:n&&a&&c&&u,validities:Object.fromEntries(Object.keys(r).map(e=>[e,{...r[e],...o[e],...l[e],...d[e]}])),validationMessages:Object.fromEntries(Object.keys(i).map(e=>[e,{...i[e],...s[e]}]))}},j3e=({draft:e,enforceRequired:t=!0})=>{let{valid:n,validities:r,validationMessages:i}=c8({draft:e,enforceRequired:t});return e.validities=r,e.validationMessages=i,n},M3e=({draft:e,enforceRequired:t=!0})=>j3e({draft:e,enforceRequired:t})?!0:(d0e({draft:e}),!1),l8=async({draft:e,enforceRequired:t=!0,awaitFieldUpdates:n=!0})=>(n&&await Iz(),await Mqe(),M3e({draft:e,enforceRequired:t})),N3e=e=>Object.values(e??{}).some(({valid:e})=>!e),P3e=e=>Object.values(e).flatMap(e=>Object.values(e).filter(({valid:e})=>!e)).length,u8=WO(),d8=(e,t=!1)=>{u8.current={...u8.current,[e]:!(u8.current?.[e]??t)}},f8={},F3e=async({repository:e})=>{f8.entryEditorSettings?.(),f8.selectAssetsView?.(),f8.entryEditorSettings=await bR(e,`entry-view`,u8,{defaults:{showSecondPane:!0,showPreview:!0,syncScrolling:!0,selectAssetsView:{type:`grid`}}}),s$.current=u8.current?.selectAssetsView,f8.selectAssetsView=JO(()=>{let e=s$.current;e&&Object.keys(e).length&&co(()=>{let t=u8.current,n=t?.selectAssetsView??{};(0,Cr.default)(e,n)||(u8.current={...t,selectAssetsView:e})})})};JO(()=>{let{current:e}=XJ;e&&!co(()=>u8.current)&&F3e(e)});var I3e=V(`<!> <!>`,1),L3e=V(`<div role="none" class="inner svelte-1ibgz0y"><!> <!></div>`),R3e=V(`<div role="none" class="wrapper svelte-1ibgz0y"><!></div>`),z3e={hash:`svelte-1ibgz0y`,code:`.wrapper.svelte-1ibgz0y {display:contents;.combobox {
|
||
@media (width < 1024px) {min-width:128px;--sui-textbox-height: 32px;--sui-button-medium-height: 32px;
|
||
}&.error [role='combobox'] {border-color:var(--sui-error-border-color);}}}.inner.svelte-1ibgz0y {display:contents;:is(.error, .error button[data-mode='edit']) {color:var(--sui-error-foreground-color) !important;}}`};function B3e(e,t){k(t,!0),q(e,z3e);let n=Ez(),r=Y(t,`thisPane`,7),i=Y(t,`thatPane`,23,()=>WO(null)),a=Y(t,`previewInThisPane`,3,!1),o=j(()=>BA(n.current)),s=j(()=>B(o).i18nEnabled),c=j(()=>B(o).allLocales),l=j(()=>B(s)&&B(c).length>1),u=j(()=>n.current?.validities??{}),d=j(()=>n.current?.canPreview??!0),f=j(()=>sW.isSmallScreen||sW.isMediumScreen?[...B(c)]:B(c).filter(e=>i().current?.mode!==`edit`||i().current.locale!==e)),p=j(()=>a()||i().current?.mode===`edit`&&B(d)&&!!u8.current?.showPreview),m=j(()=>Object.entries(B(u)).some(([e,t])=>B(f).includes(e)&&N3e(t))),h=j(()=>sW.isSmallScreen||sW.isMediumScreen||B(c).length>=5),g=j(()=>B(h)?yu:Dl),_=j(()=>B(h)?nu:Ol),v=j(()=>B(h)?void 0:`tertiary`),y=j(()=>B(h)?void 0:`small`),b=j(()=>r().current?.mode===`edit`?r().current.locale:r().current?.mode===`preview`?`preview`:void 0);var x=R3e(),S=P(x);{let e=j(()=>B(m)&&B(h)?`error`:void 0),a=j(()=>X(B(l)?`switch_locale`:`switch_view`)),o=j(()=>t.id.replace(`-header`,`-body`));Wo(S,()=>B(g),(t,s)=>{s(t,{get value(){return B(b)},get class(){return B(e)},get ariaLabel(){return B(a)},get"aria-controls"(){return B(o)},children:(e,t)=>{var a=L3e(),o=P(a);Ro(o,16,()=>B(f),e=>e,(e,t)=>{let a=j(()=>B(l)?kA(t)??t:X(`edit`)),o=j(()=>!n.current?.currentLocales[t]),s=j(()=>N3e(B(u)[t]));var c=U(),d=F(c);{let e=e=>{var t=U(),n=F(t),r=e=>{Lc(e,{name:`edit_off`})},i=e=>{Lc(e,{name:`error`})};K(n,e=>{B(o)?e(r):B(s)&&e(i,1)}),W(e,t)},n=j(()=>B(a)),c=j(()=>B(o)?X(`locale_content_disabled_short`):B(s)?X(`locale_content_error_short`):``),l=j(()=>r().current?.mode===`edit`&&r().current.locale===t),u=j(()=>B(s)?`error`:``);Wo(d,()=>B(_),(o,s)=>{s(o,{get variant(){return B(v)},get size(){return B(y)},get label(){return B(a)},get value(){return t},get"aria-label"(){return`${B(n)??``} ${B(c)??``}`},get selected(){return B(l)},get class(){return B(u)},"data-mode":`edit`,onSelect:()=>{Lz(()=>{r().current={mode:`edit`,locale:t},i().current?.mode===`preview`&&(i().current={mode:`preview`,locale:t})})},startIcon:e,$$slots:{startIcon:!0}})})}W(e,c)});var s=L(o,2),c=e=>{var t=I3e(),n=F(t),a=e=>{ql(e,{})};K(n,e=>{B(h)&&e(a)});var o=L(n,2);{let e=j(()=>X(`preview`)),t=j(()=>r().current?.mode===`preview`);Wo(o,()=>B(_),(n,a)=>{a(n,{get variant(){return B(v)},get size(){return B(y)},get label(){return B(e)},value:`preview`,get selected(){return B(t)},"data-mode":`preview`,onSelect:()=>{let{locale:e}=i().current??r().current;Lz(()=>{r().current={mode:`preview`,locale:e}})}})})}W(e,t)};K(s,e=>{B(p)&&e(c)}),O(a),W(e,a)},$$slots:{default:!0}})})}O(x),W(e,x),A()}var V3e=new WeakMap,H3e=e=>jM(e,({widget:e})=>e===`compute`,V3e),p8=e=>{let{field:t,keyPath:n,valueMap:r,getIndex:i,results:a}=e;if(!H3e(t))return;let{widget:o=`string`}=t;if(o===`compute`){a.push({keyPath:n,fieldConfig:t});return}if(o===`object`){if(r[n]===null)return;(DM(t,r,n)??[]).forEach(t=>{p8({...e,field:t,keyPath:`${n}.${t.name}`})});return}let s=t,{hasSingleSubField:c}=KR(s);Kz(i(),n).forEach(t=>{let i=`${n}.${t}`;c?p8({...e,field:s.field,keyPath:i}):(DM(s,r,i)??[]).forEach(t=>{p8({...e,field:t,keyPath:`${i}.${t.name}`})})})},U3e=({fields:e,valueMap:t,getIndex:n,keyPathPrefix:r=``})=>{let i=[];return e.forEach(e=>{p8({field:e,keyPath:`${r}${e.name}`,valueMap:t,getIndex:n,results:i})}),i},W3e=(e,t)=>{let n=[],r=new Set;return Object.keys(e).forEach(i=>{let[a]=i.match(wZ)??[];if(a===void 0||r.has(a))return;r.add(a);let{fields:o}=iM(e[`${a}__sc_component_name`])??{};o&&n.push(...U3e({fields:o,valueMap:e,getIndex:t,keyPathPrefix:a}))}),n},G3e=({fieldConfig:e,locale:t,defaultLocale:n,i18nEnabled:r})=>t===n||r&&aR(e.i18n)&&e.i18n!==`sync`,K3e=({draft:e,valueStoreKey:t,locale:n,valueMap:r,target:i})=>{let{collectionName:a,fileName:o,fields:s,isIndexFile:c}=e,{i18nEnabled:l,defaultLocale:u}=BA(e),d,f=()=>(d??=Gz(r),d),p=t===`extraValues`?W3e(r,f):U3e({fields:s,valueMap:r,getIndex:f});if(!p.length)return!1;let m=!1,h=Dke({getFieldArgs:{collectionName:a,fileName:o,isIndexFile:c},locale:n,defaultLocale:u,content:t===`extraValues`?vz(e,n):r,defaultContent:vz(e,u)}),g=t===`extraValues`?r:h;return p.forEach(({keyPath:e,fieldConfig:s})=>{if(t!==`extraValues`&&!G3e({fieldConfig:s,locale:n,defaultLocale:u,i18nEnabled:l}))return;let d=iMe({fieldConfig:s,keyPath:e,locale:n,valueMap:g,collectionName:a,fileName:o,isIndexFile:c,...t===`extraValues`?{keyPathPrefix:e.match(wZ)[0],entryValueMap:h}:{}});g[e]!==d&&(i[e]=d,g=g===r?{...r}:g,g[e]=d,m=!0)}),m},q3e=e=>{let{currentLocales:t,fields:n}=e,r=!1;return[`currentValues`,`extraValues`].forEach(i=>{(i!==`currentValues`||n.some(H3e))&&Object.entries(e[i]).forEach(([n,a])=>{let o=vz(e,n,i);t[n]&&Object.keys(o).length&&K3e({draft:e,valueStoreKey:i,locale:n,valueMap:o,target:a})&&(r=!0)})}),r},m8=new WeakSet,J3e=e=>{[e.currentValues,e.extraValues].forEach(e=>{Object.values(e).forEach(mz)}),ai(e.currentLocales),m8.has(e)||(m8.add(e),kz(()=>{m8.delete(e),q3e(e)}))},Y3e=(e,t)=>{R(()=>{let n=t();n&&Oz(n,e())}),R(()=>{let t=e().current;t&&J3e(t)})},h8=e=>wOe(e,[...NY(BL(e),lY.current.filter(({workflow:t})=>t.collectionName===e)),...gY(e)]),g8=(e,{entries:t=tj.current}={})=>{let n=t.find(({id:t})=>t===e.id),r=e.arrayIndex===void 0;if(!n)return{type:`deleted`,canOverwrite:r};if(!(0,Cr.default)(n.locales,e.locales))return{type:`modified`,entry:n,canOverwrite:r}},X3e=async e=>{let{isNew:t,originalEntry:n}=e;if(!t&&n){try{await U4()}catch(e){console.error(`Failed to check the repository for changes.`,e)}return g8(n)}},Z3e=({type:e,entry:t,canOverwrite:n},r)=>{if(e===`deleted`)return{description:X(`save_conflict.deleted`),warning:X(n?`save_conflict.recreate_warning`:`save_conflict.reload_warning`)};let{commitAuthor:i,commitDate:a}=t,o=XL(i);return{description:o&&a?X(`save_conflict.modified_by`,{values:{name:o,date:BN(a,r)}}):X(`save_conflict.modified`),warning:X(n?`save_conflict.overwrite_warning`:`save_conflict.reload_warning`)}},Q3e=(e,t)=>{e.isNew&&e.collection._type===`entry`&&pJe(e,t),hJe(e,t),F2(e)},$3e=(e,t)=>!ck(e)&&!zk(e,t)&&!S4(t),e6e={...jK,draft:`status.drafts`},t6e={info:`workflow.updating_status`,success:`workflow.status_updated`,error:`workflow.status_change_failed`},n6e={info:`workflow.refreshing`,success:`workflow.refreshed`,error:`workflow.refresh_failed`},r6e={info:`workflow.deleting_entry`,success:`workflow.entry_deleted`,error:`deleting_entry_failed`},i6e={info:`workflow.cancelling_deletion`,success:`workflow.deletion_cancelled`,error:`workflow.cancelling_deletion_failed`},a6e={info:`workflow.publishing_entry`,success:`workflow.entry_published`,error:`workflow.publishing_entry_failed`},o6e=e=>e?i6e:r6e,s6e=e=>e?r6e:a6e,c6e=(e,t)=>{let n=t=>e.find(e=>e.status===t)?.entries.length,r=n(`draft`),[i,a]=[n(`pending_review`),n(`pending_publish`)],o=t.length;return i===void 0?a===void 0?{key:`viewing_preview_workflow`,values:{draft:r,deletion:o}}:{key:`viewing_editorial_workflow_without_review`,values:{draft:r,ready:a,deletion:o}}:a===void 0?{key:`viewing_open_authoring_workflow`,values:{draft:r,review:i,deletion:o}}:{key:`viewing_editorial_workflow`,values:{draft:r,review:i,ready:a,deletion:o}}},l6e=(e,t,n=e=>e.workflow.status)=>{let r=new Map(t.map(e=>[e,n(e)])),i=new Set(r.values());return{columns:OK.filter(t=>e.includes(t)||i.has(t)).map(e=>({status:e,entries:t.filter(t=>r.get(t)===e)})),pendingDeletions:t.filter(e=>r.get(e)===`pending_deletion`)}},u6e=e=>{let{collectionName:t,fileName:n}=e.workflow,r=YA(t);if(!r)return e.slug;let i=n?ij(r,n):void 0;return i?oj(i):$L(r,e)},d6e=(e,t)=>{let{companions:n=[]}=e.workflow;if(!t)return[];let r=(e,n)=>{if(!e.length)return[];let r=e.map(({collectionName:e,entry:t})=>{let n=YA(e);return n?._type===`entry`?X(`workflow.companion_entry`,{values:{collection:XA(n,{useSingular:!0}),title:$L(n,t)}}):t.slug});return[X(n,{values:{entries:AA(t).format(r)}})]};return[...r(n.filter(({edited:e})=>!e),`workflow.companion_entries`),...r(n.filter(({edited:e})=>e),`workflow.edited_companion_entries`)]},_8=e=>e.quickAddHost??{collectionName:e.collectionName,workflow:TY(e),branch:wY(e)?.workflow.pullRequest.branch,entryIds:[e.id]},f6e=e=>{let t=_8(e);return{...t,entryIds:bO([...t.entryIds,e.id])}},v8=e=>{let{branch:t}=_8(e);return t?CY(t):void 0},p6e=(e,t)=>{let n=v8(e);return n?gY(t,[n]):[]},y8=(e,t=void 0)=>{if(!e)return;let n=t??e.pendingEntries,r=v8(e)?.workflow.companions??[];return r.length?[...r,...n]:n},m6e=(e,t)=>(v8(e)?.workflow.companions??[]).find(({entry:e})=>e.id===t)?.entry??tj.current.find(e=>e.id===t),h6e=(e,t)=>{let n=m6e(e,t.id);return g8(t,{entries:n?[n]:[]})},g6e=(e,t)=>e.workflow?t.name!==e.collectionName:!cY(t),_6e=({fieldConfig:{collection:e,file:t},draft:n})=>{if(t)return;let r=YA(e);if(!(r?._type!==`entry`||r.create===!1||RY({collection:r})))return g6e(_8(n),r)?r:void 0},v6e=({collection:e,draft:t})=>{let{name:n,limit:r=1/0}=e,i=new Set(gY(n).map(({id:e})=>e)),a=wM(t,n).filter(({entry:e})=>!i.has(e.id)).length;return h8(n)+a<r},y6e=({draft:e,fieldConfig:{collection:t},refEntries:n})=>{if(!e)return[];let r=new Set(n.map(({id:e})=>e));return[...CM(e,t).map(({entry:e})=>e),...p6e(e,t)].filter(({id:e})=>!r.has(e)&&(r.add(e),!0))},b6e=({draft:e,fieldConfig:t})=>{let n=TAe(t),r=e?v8(e):void 0,i=new Map([...(r?lHe(t.collection,[r]):[]).map(e=>[e.id,e]),...(e?CM(e,t.collection):[]).filter(({baseEntry:e})=>!!e).map(({entry:e})=>[e.id,e])]),a=i.size?n.map(e=>i.get(e.id)??e):n,o=y6e({draft:e,fieldConfig:t,refEntries:a});return o.length?[...a,...o]:a},x6e=({draft:e,pendingEntries:t})=>{let n=w2({draft:e,pendingEntries:t}),{defaultLocaleSlug:r,localizedSlugs:i}=n,a=[...t.filter(t=>t.collectionName===e.collectionName).map(({entry:e})=>e),...gY(e.collectionName)].map(({slug:e})=>e);if(uP(r,a)===r)return n;let o=uP(r,[...a,...BL(e.collectionName).map(({slug:e})=>e)],{hasExtension:!1}),s=i?{...i,[e.defaultLocale]:o}:void 0;return{defaultLocaleSlug:o,localizedSlugs:s,canonicalSlug:C2({draft:e,defaultLocaleSlug:o,localizedSlugs:s,fillSlugOptions:_2({draft:e})})}},S6e=async({draft:e,parentDraft:t,fieldConfig:n})=>{let{id:r,isNew:i,collectionName:a,originalEntry:o}=e,s=fz(e),c=t.pendingEntries.filter(({entry:e})=>e.id!==r),l=wM(t,a),u=l.findIndex(({entry:e})=>e.id===r);Q3e(e,u>-1?u:l.length);let d=await y4({draft:e,slugs:i?x6e({draft:e,pendingEntries:c}):w2({draft:e}),runPreSave:!1}),{changes:f,savingAssets:p}=d,m=_4(d.savingEntry);return{collectionName:a,entry:m,changes:f,savingAssets:p,values:bO(Object.keys(t.currentValues).flatMap(e=>FR({locale:e,fieldConfig:n,refEntry:m,pendingEntries:y8(t,c)}).map(({value:e})=>e))),...i||!o?{}:{baseEntry:UO(o)},source:s}},C6e=({parentDraft:e,entry:t})=>{if(!t)return{changedSince:!1};let n=e.pendingEntries.find(({entry:{id:e}})=>e===t.id);if(!n)return{baseEntry:t,changedSince:!1};let{baseEntry:r}=n;if(!r)return{pendingEntry:n,changedSince:!1};let i=m6e(e,r.id);return{pendingEntry:n,baseEntry:i??r,changedSince:!!i&&!!h6e(e,r)}},w6e=async({collection:e,parentDraft:t,entry:n})=>{let r=t.pendingEntries,{pendingEntry:i,baseEntry:a,changedSince:o}=C6e({parentDraft:t,entry:n}),s=a8(a?{collection:e,originalEntry:UO(a)}:{collection:e,initialPath:``});return i?.source&&(s.id=i.entry.id,await K4e({backup:UO(i.source),draft:s})),s.pendingEntries=[...r],s.quickAddHost=f6e(t),{draft:s,changedSince:o}},T6e=({baseEntry:e,changes:t})=>!!e&&t.some(({action:e})=>e===`move`),E6e=({draft:e,pendingEntry:{entry:t,source:n}})=>{Object.entries(n?.currentValues??{}).forEach(([n,r])=>{let i=t.locales[n]?.content??{},a=e.currentValues[n];Object.entries(r).forEach(([e,t])=>{a[e]!==t&&a[e]===i[e]&&(a[e]=t)})})},D6e=(e,t)=>{t.forEach(t=>{let n=e.pendingEntries.findIndex(({entry:e})=>e.id===t.entry.id);n>-1?e.pendingEntries[n]=t:e.pendingEntries.push(t)})},O6e=({draft:e,parentDraft:t})=>{let n=TM(e);return e.pendingEntries.filter(e=>n.has(e)&&!t.pendingEntries.includes(e)).map(e=>UO(e))},k6e=({draft:e,locale:t,keyPath:n,valueStoreKey:r,fieldConfig:i,pendingEntry:a})=>{let{i18n:o,multiple:s,max:c}=i,[l]=FR({locale:t,fieldConfig:i,refEntry:a.entry,pendingEntries:y8(e)}).map(e=>e.value);l!==void 0&&(s?u6({draft:e,locale:t,i18n:o,fieldConfig:i,valueStoreKey:r,keyPath:n,manipulate:({valueList:e})=>{!e.includes(l)&&(typeof c!=`number`||e.length<c)&&e.push(l)}}):e[r][t][n]=l)},A6e=({draft:e,parentDraft:t})=>!e.isNew&&!t.pendingEntries.some(({entry:t})=>t.id===e.id)&&!dz({...e,pendingEntries:[]})&&!O6e({draft:e,parentDraft:t}).length,j6e=({draft:e,keyPath:t,valueStoreKey:n,fieldConfig:r,previousEntry:i,entry:a})=>{let o=y8(e),{collectionName:s,fileName:c,isIndexFile:l}=e,u=r.collection,d=(e,t)=>{let n=n=>FR({locale:e,fieldConfig:t,refEntry:n,pendingEntries:o}).map(({value:e})=>e),r=n(i),s=n(a);return r.length===s.length?new Map(r.map((e,t)=>[e,s[t]]).filter(([e,t])=>e!==t)):new Map},f=(e,t,n)=>{t.forEach(t=>{n.has(e[t])&&(e[t]=n.get(e[t]))})};Object.entries(e.currentValues).forEach(([e,t])=>{let n=new Map;Object.keys(t).forEach(r=>{let i=_M({collectionName:s,fileName:c,isIndexFile:l,valueMap:t,keyPath:r});SM(i,u)&&(n.has(i)||n.set(i,d(e,i)),f(t,[r],n.get(i)))})}),n===`extraValues`&&Object.entries(e.extraValues).forEach(([e,n])=>{let i=r.multiple?_j(n,t,{live:!0}):[t];f(n,i,d(e,r))})},M6e=({fieldConfig:{collection:e,file:t},draft:n,entry:r})=>{let i=CM(n,e).find(e=>e.entry.id===r.id);if(i&&!i.source)return!1;if(i&&!i.baseEntry)return!0;let a=YA(e);if(t||a?._type!==`entry`||RY({collection:a})||!$3e(a,r)||EY(r))return!1;let o=_8(n);if(!g6e(o,a))return!1;let s=vY(r);if(bY({collectionName:e,subPath:r.subPath})||s&&s.workflow.pullRequest.branch!==o.branch)return!1;if(!s&&o.branch&&r.commitDate){let{pullRequest:e,companions:t=[]}=CY(o.branch)?.workflow??{};if(e&&r.commitDate>e.createdDate&&!t.some(e=>e.entry.id===r.id))return!1}return r.id!==n.id&&!o.entryIds.includes(r.id)},N6e=({draft:e,locale:t,fieldConfig:n,refEntries:r,currentValue:i})=>{let a=(Array.isArray(i)?i:[i]).filter(e=>e!=null&&e!==``);if(!a.length)return[];let o=y8(e),s=new Set(a),c=Map.groupBy(r.flatMap(e=>FR({locale:t,fieldConfig:n,refEntry:e,pendingEntries:o}).filter(({value:e})=>s.has(e)).map(({label:t,value:n})=>({value:n,label:t,entry:e}))),({value:e})=>e),l=new Set;return a.flatMap(t=>{let[r,...i]=c.get(t)??[];return!r||i.some(({entry:e})=>e.id!==r.entry.id)||l.has(r.entry.id)||!M6e({fieldConfig:n,draft:e,entry:r.entry})?[]:(l.add(r.entry.id),[r])})},P6e=e=>{if(!e||e.isNew||!e.originalEntry)return;let t=vY(e.originalEntry);return t?u6e(t):void 0},F6e=V(`<!> <!> <!>`,1),I6e=V(`<div role="none" class="fields svelte-197lmw7"><!> <!></div>`),L6e=V(`<div role="none" class="wrapper svelte-197lmw7"><p class="hint svelte-197lmw7"> </p> <!> <!></div>`),R6e=V(`<!> <!> <!> <!>`,1),z6e={hash:`svelte-197lmw7`,code:`.wrapper.svelte-197lmw7 {--field-editor-padding: 16px;display:flex;flex-direction:column;gap:16px;}.hint.svelte-197lmw7 {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.fields.svelte-197lmw7 {display:flex;flex-direction:column;}`};function B6e(e,t){let n=Co();k(t,!0),q(e,z6e);let r=Y(t,`open`,15,!1),i=Y(t,`entry`,3,void 0),a=Ez(),o=Tz(new wz),s=WO(null),c=M(void 0),l=M(!1),u=!1,d=M(!1),f=M(0),p=M(!1),m=M(!1),h=M(!1),g=M(void 0),_=0,v=j(()=>Fc.current?XA(t.collection,{useSingular:!0}):``),y=j(()=>t.collection._i18n),b=j(()=>B(y).i18nEnabled),x=j(()=>B(y).allLocales),S=j(()=>B(y).defaultLocale),C=j(()=>B(b)&&B(x).length>1),w=j(()=>!!B(g)),T=e=>{N(p,!0),console.error(e)},ee=async()=>{_+=1;let e=_,n=i();N(g,n),N(h,!1);let{draft:c,changedSince:l}=await w6e({collection:t.collection,parentDraft:a.current,entry:n});e!==_||!r()?az(c):(o.current=c,s.current={mode:`edit`,locale:B(S)},N(h,l,!0),u=!1)},E=()=>{u||az(o.current),_+=1,o.current=void 0,s.current=null,N(g,void 0)},te=async()=>{let e=o.current;if(e&&a.current){if(A6e({draft:e,parentDraft:a.current}))r(!1);else{N(l,!0);try{if(!await l8({draft:e,enforceRequired:!0})){N(f,P3e(e.validities),!0),N(d,!0);return}let n=await S6e({draft:e,parentDraft:a.current,fieldConfig:t.fieldConfig});if(!r()||o.current!==e)return;if(T6e(n)){E6e({draft:e,pendingEntry:n}),N(m,!0);return}D6e(a.current,[...O6e({draft:e,parentDraft:a.current}),n]),t.onAdd(n,B(g)),u=!0,r(!1)}catch(e){T(e)}finally{N(l,!1)}}}};R(()=>{r()&&co(()=>{ee().catch(T)})}),Y3e(()=>o,()=>B(c));var ne=R6e(),re=F(ne);{let e=e=>{var t=U(),r=F(t),i=e=>{B3e(e,{get id(){return`${n}-header`},get thisPane(){return s}})};K(r,e=>{B(C)&&o.current&&e(i)}),W(e,t)},t=e=>{var t=F6e(),n=F(t);Ml(n,{flex:!0});var i=L(n,2);{let e=j(()=>X(B(w)?`update`:`add`));ll(i,{variant:`primary`,get label(){return B(e)},get disabled(){return B(l)},onclick:()=>{te()}})}var a=L(i,2);{let e=j(()=>X(`cancel`));ll(a,{variant:`secondary`,get label(){return B(e)},get disabled(){return B(l)},onclick:()=>{r(!1)}})}W(e,t)},i=j(()=>X(B(w)?`relation_field.edit_entry_title`:`create_entry_title`,{values:{name:B(v)}}));Pl(re,{get title(){return B(i)},size:`large`,showOk:!1,showCancel:!1,onClose:()=>{E()},get open(){return r()},set open(e){r(e)},headerExtra:e,footer:t,children:(e,t)=>{var r=L6e(),i=P(r),a=I(i,!0),l=L(i,2),u=e=>{Vc(e,{status:`warning`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`relation_field.changed_since_edit`,{values:{name:B(v)}})]),W(e,n)},$$slots:{default:!0}})};K(l,e=>{B(h)&&e(u)});var d=L(l,2),f=e=>{let t=j(()=>s.current);var r=I6e(),i=P(r),a=e=>{var n=U();No(F(n),()=>B(t).locale,e=>{T3e(e,{get locale(){return B(t).locale}})}),W(e,n)},c=j(()=>g3e(o.current)&&o.current.slugEditor[B(t).locale]);K(i,e=>{B(c)&&e(a)}),R4e(L(i,2),{get locale(){return B(t).locale}}),O(r),z(()=>J(r,`id`,`${n}-body`)),W(e,r)};K(d,e=>{o.current&&s.current&&e(f)}),O(r),ms(r,e=>N(c,e),()=>B(c)),z(e=>G(a,e),[()=>X(B(w)?`relation_field.edit_together_hint`:`relation_field.save_together_hint`,{values:{name:B(v)}})]),W(e,r)},$$slots:{headerExtra:!0,footer:!0,default:!0}})}var ie=L(re,2);D3e(ie,{get count(){return B(f)},get show(){return B(d)},set show(e){N(d,e,!0)}});var ae=L(ie,2);Pu(ae,{get show(){return B(p)},set show(e){N(p,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(B(w)?`relation_field.edit_failed`:`relation_field.add_failed`,{values:{name:B(v)}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(ae,2),{get show(){return B(m)},set show(e){N(m,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`relation_field.move_unsupported`,{values:{name:B(v)}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,ne),A()}function V6e(e,t){k(t,!0);let n=Ez(),{valueStoreKey:r=`currentValues`}=Mz(),i=Y(t,`required`,3,!0),a=Y(t,`readonly`,3,!1),o=Y(t,`invalid`,3,!1),s=j(()=>t.fieldConfig.i18n),c=j(()=>t.fieldConfig.max),l=j(()=>Nr(t.fieldConfig.dropdown_threshold,5)),u=e=>{let i=n.current;i&&u6({draft:i,locale:t.locale,i18n:B(s),fieldConfig:t.fieldConfig,valueStoreKey:r,keyPath:t.keyPath,manipulate:e})},d=e=>{u(({valueList:t})=>{t.push(e)})},f=e=>{u(({valueList:t})=>{let n=t.indexOf(e);n>-1&&t.splice(n,1)})};var p=U(),m=F(p),h=e=>{pse(e,_s({get disabled(){return a()},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get options(){return t.options}},()=>({values:t.currentValue}),{get max(){return B(c)},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onAddValue:({detail:{value:e}})=>{d(e)},onRemoveValue:({detail:{value:e}})=>{f(e)},onReorder:({detail:{values:e}})=>{u(({valueList:t})=>{t.splice(0,t.length,...e)})}}))},g=e=>{Lie(e,{get"aria-labelledby"(){return`${t.fieldId??``}-label`},children:(e,n)=>{var r=U();Ro(F(r),19,()=>t.options,({label:e,value:t},n)=>`${n}-${t}`,(e,n)=>{let r=()=>B(n).label,s=()=>B(n).value;{let n=j(()=>t.currentValue?.includes(s())??!1);jl(e,{get label(){return r()},get value(){return s()},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get checked(){return B(n)},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onChange:({detail:{checked:e}})=>{e?d(s()):f(s())}})}}),W(e,r)},$$slots:{default:!0}})};K(m,e=>{t.options.length>B(l)?e(h):e(g,-1)}),W(e,p),A()}function H6e(e,t){k(t,!0);let n=Y(t,`currentValue`,15),r=Y(t,`required`,3,!0),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1),o=j(()=>Nr(t.fieldConfig.dropdown_threshold,5)),s=j(()=>t.options.some(({value:e})=>e===null||e===``)),c=j(()=>!r()&&!B(s)?[{label:X(`unselected_option`),value:LR(t.options[0]?.value),searchValue:``},...t.options]:t.options);var l=U(),u=F(l),d=e=>{yu(e,{get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return n()},set value(e){n(e)},children:(e,t)=>{var r=U();Ro(F(r),19,()=>B(c),({label:e,value:t,searchValue:n},r)=>`${r}-${t}`,(e,t)=>{let r=()=>B(t).label,i=()=>B(t).value,a=()=>B(t).searchValue;{let t=j(()=>PAe(i())),o=j(()=>i()===n());nu(e,{get label(){return r()},get value(){return i()},get valueType(){return B(t)},get searchValue(){return a()},get selected(){return B(o)},wrap:!0})}}),W(e,r)},$$slots:{default:!0}})},f=e=>{cu(e,{get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onChange:({detail:{value:e}})=>{n(e)},children:(e,t)=>{var r=U();Ro(F(r),19,()=>B(c),({label:e,value:t},n)=>`${n}-${t}`,(e,t)=>{let r=()=>B(t).label,i=()=>B(t).value;{let t=j(()=>PAe(i())),a=j(()=>i()===n());lu(e,{get label(){return r()},get value(){return i()},get valueType(){return B(t)},get checked(){return B(a)}})}}),W(e,r)},$$slots:{default:!0}})};K(u,e=>{B(c).length>B(o)?e(d):e(f,-1)}),W(e,l),A()}function U6e(e,t){k(t,!0);let n=Y(t,`currentValue`,15),r=Y(t,`required`,3,!0),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1),o=j(()=>t.fieldConfig.options),s=j(()=>t.fieldConfig.multiple),c=j(()=>B(s)?V6e:H6e),l=j(()=>B(o).map(e=>D(e)?e:{label:e,value:e}));var u=U();No(F(u),()=>JSON.stringify(B(l)),e=>{var o=U();Wo(F(o),()=>B(c),(e,o)=>{o(e,{get locale(){return t.locale},get keyPath(){return t.keyPath},get fieldId(){return t.fieldId},get fieldConfig(){return t.fieldConfig},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get options(){return B(l)},get currentValue(){return n()},set currentValue(e){n(e)}})}),W(e,o)}),W(e,u),A()}var W6e=V(`<div role="none" class="actions svelte-1hlgcqp"><!> <!></div>`),G6e=V(`<div role="none" class="wrapper svelte-1hlgcqp"><!> <!> <!></div>`),K6e={hash:`svelte-1hlgcqp`,code:`.wrapper.svelte-1hlgcqp {display:flex;flex-direction:column;gap:8px;}.actions.svelte-1hlgcqp {display:flex;}`};function q6e(e,t){k(t,!0),q(e,K6e);let n=Ez(),{valueStoreKey:r=`currentValues`}=Mz(),i=Y(t,`currentValue`,15),a=Y(t,`required`,3,!0),o=Y(t,`readonly`,3,!1),s=Y(t,`invalid`,3,!1),c=M(!1),l=M(void 0),u=M(!1),d=j(()=>b6e({draft:n.current,fieldConfig:t.fieldConfig})),f=j(()=>n.current?.[r]?.[t.locale]),p=j(()=>n.current?.currentSlugs[t.locale]??n.current?.currentSlugs._),m=j(()=>({...t.fieldConfig,widget:`select`,options:PR({locale:t.locale,fieldConfig:t.fieldConfig,refEntries:B(d),currentLocaleValues:B(f),currentSlug:B(p),sharedValues:r===`currentValues`?Oke(n.current,t.locale):void 0,pendingEntries:y8(n.current)})})),h=j(()=>o()||!n.current?void 0:_6e({fieldConfig:t.fieldConfig,draft:n.current})),g=j(()=>!!B(h)&&!!n.current&&v6e({collection:B(h),draft:n.current})),_=j(()=>o()||!n.current?[]:N6e({draft:n.current,locale:t.locale,fieldConfig:t.fieldConfig,refEntries:B(d),currentValue:i()})),v=j(()=>YA(t.fieldConfig.collection)),y=j(()=>!!B(h)||!!B(_).length),b=j(()=>Fc.current?XA(B(v),{useSingular:!0}):``),x=e=>{N(u,!0),N(l,e),N(c,!0)};var S=G6e(),C=P(S);U6e(C,{get locale(){return t.locale},get keyPath(){return t.keyPath},get typedKeyPath(){return t.typedKeyPath},get fieldId(){return t.fieldId},get fieldLabel(){return t.fieldLabel},get fieldConfig(){return B(m)},get readonly(){return o()},get required(){return a()},get invalid(){return s()},get currentValue(){return i()},set currentValue(e){i(e)}});var w=L(C,2),T=e=>{var n=W6e(),r=P(n),i=e=>{{let t=e=>{Lc(e,{name:`add`})},n=j(()=>X(`add_x`,{values:{name:B(b)}})),r=j(()=>!B(g));ll(e,{variant:`tertiary`,size:`small`,get label(){return B(n)},get disabled(){return B(r)},"aria-haspopup":`dialog`,onclick:()=>{x()},startIcon:t,$$slots:{startIcon:!0}})}};K(r,e=>{B(h)&&e(i)});var a=L(r,2),o=e=>{{let t=e=>{Lc(e,{name:`edit`})},n=e=>{},r=e=>{{let t=j(()=>X(`relation_field.select_entry_to_edit`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>B(_),({label:e,entry:t})=>t.id,(e,t)=>{let n=()=>B(t).label,r=()=>B(t).entry;iu(e,{get label(){return n()},"aria-haspopup":`dialog`,onclick:()=>{x(r())}})}),W(e,n)},$$slots:{default:!0}})}},i=j(()=>X(`edit_x`,{values:{name:B(b)}}));kl(e,{variant:`tertiary`,size:`small`,get label(){return B(i)},startIcon:t,endIcon:n,popup:r,$$slots:{startIcon:!0,endIcon:!0,popup:!0}})}},s=e=>{let t=j(()=>{let[{label:e,entry:t}]=B(_);return{label:e,entry:t}});{let n=e=>{Lc(e,{name:`edit`})},r=j(()=>X(`edit_x`,{values:{name:B(t).label}}));ll(e,{variant:`tertiary`,size:`small`,get label(){return B(r)},"aria-haspopup":`dialog`,onclick:()=>{x(B(t).entry)},startIcon:n,$$slots:{startIcon:!0}})}};K(a,e=>{t.fieldConfig.multiple&&B(_).length?e(o):B(_).length&&e(s,1)}),O(n),W(e,n)};K(w,e=>{B(y)&&e(T)});var ee=L(w,2),E=e=>{B6e(e,{get collection(){return B(v)},get fieldConfig(){return t.fieldConfig},get entry(){return B(l)},onAdd:(e,i)=>{if(!n.current)return;let a={draft:n.current,keyPath:t.keyPath,valueStoreKey:r,fieldConfig:t.fieldConfig};i?j6e({...a,previousEntry:i,entry:e.entry}):k6e({...a,locale:t.locale,pendingEntry:e})},get open(){return B(c)},set open(e){N(c,e,!0)}})};K(ee,e=>{(B(y)||B(u))&&e(E)}),O(S),W(e,S),A()}var J6e=[`slug`,`{{slug}}`,`{{fields.slug}}`],Y6e=({fieldConfig:e,currentValue:t,options:n})=>{let{multiple:r=!1,value_field:i=`{{slug}}`}=e;return(r?t??[]:[t]).filter(e=>e!=null&&e!==``).map(e=>String(e)).map(e=>{let t=n.find(t=>t.value===e)?.label;return!t||t===e?e:J6e.includes(i)?t:`${t} (${e})`})},X6e=V(`<p> </p>`);function Z6e(e,t){k(t,!0);let n=Ez(),r=j(()=>AA(t.locale)),i=j(()=>b6e({draft:n.current,fieldConfig:t.fieldConfig})),a=j(()=>PR({locale:t.locale,fieldConfig:t.fieldConfig,refEntries:B(i),pendingEntries:y8(n.current)})),o=j(()=>Y6e({fieldConfig:t.fieldConfig,currentValue:t.currentValue,options:B(a)}));var s=U(),c=F(s),l=e=>{var n=X6e(),i=I(n,!0);z((e,t,r)=>{J(n,`lang`,e),J(n,`dir`,t),G(i,r),n.dir=n.dir},[()=>DA(t.locale),()=>OA(t.locale),()=>B(r).format(B(o))]),W(e,n)};K(c,e=>{B(o).length&&e(l)}),W(e,s),A()}var Q6e=`https://sveltiacms.app/en/docs/troubleshooting#using-proper-naming-conventions`,b8=({type:e=`error`,strKey:t,values:n={},extraStrKey:r,context:i={},collectors:a})=>{let{collection:o,collectionFile:s,componentName:c,typedKeyPath:l}=i,{errors:u,warnings:d}=a,f=[];o&&f.push(X(`config.error_locator.collection`,{values:{collection:o.label_singular||o.label||o.name}})),s&&f.push(X(`config.error_locator.file`,{values:{file:s.label||s.name}})),c&&f.push(X(`config.error_locator.component`,{values:{component:c}})),l&&f.push(X(`config.error_locator.field`,{values:{field:l}}));let p=e===`error`?u:d,m=Fc.current,h=f.length?`${AA(m).format(f)}: `:``,g=X(`config.${e}.${t}`,{values:n});t===`invalid_field_name`&&(g=$k(g,Q6e));let _=r?X(`config.${r}`,{values:{link:r===`compatibility_link`?`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#compatibility`:void 0}}):``;p.add(`${h}${g}${_?` ${_}`:``}`)},x8=({UNSUPPORTED_OPTIONS:e,config:t,context:n,collectors:r})=>{e.forEach(({type:e=`error`,prop:i,newProp:a,value:o,strKey:s=`unsupported_deprecated_option`})=>{i in t&&(o===void 0||t[i]===o)&&b8({type:e,strKey:s,values:{prop:i,newProp:a},extraStrKey:`compatibility_link`,context:n,collectors:r})})},$6e=/^[^\s.*:<>]+$/,e8e=e=>$6e.test(e)&&e!==`__proto__`,S8=({name:e,index:t,nameCounts:n,strKeyBase:r,context:i,collectors:a,required:o=!1})=>{if(typeof e!=`string`||!e){if(e===``||o&&e===void 0){let e=String(t+1);b8({strKey:`missing_${r}`,context:i,values:{count:e},collectors:a})}return!1}if(!e8e(e))return b8({strKey:`invalid_${r}`,context:i,values:{name:e},collectors:a}),!1;let s=Object.hasOwn(n,e)?n[e]:0;return s===1?(b8({strKey:`duplicate_${r}`,context:i,values:{name:e},collectors:a}),!1):(n[e]=s+1,!0)},C8=({option:e,pattern:t,context:n,collectors:r})=>{typeof t==`string`&&IL(t)===void 0&&b8({strKey:`invalid_regex`,values:{option:e,pattern:t},context:n,collectors:r})},t8e=[`boolean`,`color`,`datetime`,`number`,`relation`,`select`,`string`],w8=e=>{if(e.length!==1)return!1;let[t]=e,n=t.widget??`string`;return t8e.includes(n)&&!t.multiple},n8e=({definition:e,componentName:t,cmsConfig:n,collectors:r})=>{let i={cmsConfig:n,componentName:t};if(zj(e)){Hj(e.pattern)&&b8({type:`warning`,strKey:`inline_component_multiline_pattern`,context:i,collectors:r});return}let{mode:a,fields:o}=e;a===`inline`&&!w8(o)&&b8({strKey:`invalid_inline_component_fields`,context:i,collectors:r})},r8e=({template:e,values:t,fields:n,locale:r})=>{if(!e)return null;let i=NM(e,()=>``);if(i===e)return e.trim()||null;if(!t)return null;let a=Aj(t),o=e=>{let{value:t,transformations:i}=IN(e),s=kk(t),c=a[s];if(c==null)return``;let l=RM(i,o);return l.length&&(c=LN({fieldConfig:n.find(e=>e.name===s),value:c,transformations:l,locale:r})),String(c)},s=NM(e,(e,t)=>o(t));return s!==i&&s.trim()?s.trim():null},i8e=({currentValues:e,values:t,fields:n})=>n.some(t=>e?.[t.name]!==void 0)?e:t,a8e=({template:e,currentValues:t,values:n,fields:r,locale:i,label:a,hasThumbnail:o=!1})=>{let s=i8e({currentValues:t,values:n,fields:r}),c=r8e({template:e,values:s,fields:r,locale:i});if(c)return c;let l=r.find(e=>e.widget===`string`||e.widget===`text`||!e.widget);if(l&&s){let e=s[l.name];if(typeof e==`string`&&e.trim())return e.trim()}return o?``:a},o8e=({thumbnailFieldName:e,values:t,...n})=>{if(e&&t)return n2e({...n,thumbnailFieldName:e,keyPath:``,typedKeyPath:``,valueMap:Aj(t)})},s8e=({draft:e,locale:t,keyPathPrefix:n})=>{let{validities:r,validationMessages:i}=K2(`extraValues`,{draft:e});return Object.keys(e.validities).forEach(t=>{Object.assign(e.validities[t],r[t]),Object.assign(e.validationMessages[t],i[t])}),!Object.entries(r[t]??{}).some(([e,t])=>e.startsWith(n)&&!t.valid)},T8=(e,t)=>{Object.keys(e??{}).forEach(n=>{n.startsWith(t)&&delete e[n]})},c8e=(e,t)=>{Object.keys(e).forEach(n=>{n.startsWith(t)&&!n.slice(t.length).includes(`:`)&&delete e[n]})},l8e=(e,t)=>Object.fromEntries(Object.entries(Aj(e)).map(([e,n])=>[`${t}${e}`,n])),u8e=(e,t)=>Mj(Object.fromEntries(pj(e,t).map(n=>[n.slice(t.length),e[n]]))),d8e=({values:e,fields:t,componentName:n,locale:r,defaultLocale:i})=>{let a=e??jj(X3({fields:t,locale:r,defaultLocale:r}));a.__sc_component_name=n;let o=jj(i8({fields:t,content:Aj(a),locale:r,defaultLocale:i,fillDefaults:!1}));return(0,Cr.default)(o,a)?a:o},f8e=V(`<span role="none"> </span>`),p8e=V(`<!> <!> <!> <!>`,1),m8e=V(`<div role="none" class="fields svelte-1l1n28m"><!></div>`),h8e=V(`<span contenteditable="false" tabindex="0"><!> <!></span> <!>`,1),g8e=V(`<span role="group" class="component inline-field svelte-1l1n28m" contenteditable="false" tabindex="0"><!></span>`),_8e=V(`<div role="none" class="item-list"><!></div>`),v8e=V(`<div role="group" contenteditable="false" tabindex="0"><!> <!></div>`),y8e={hash:`svelte-1l1n28m`,code:`.component.svelte-1l1n28m {&.block {display:block;&:not(:first-child) {margin-top:var(--sui-paragraph-margin);}&:not(:last-child) {margin-bottom:var(--sui-paragraph-margin);}}&.inline {display:inline-block;}}.wrapper.svelte-1l1n28m {border-inline-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);width:100%;color:var(--sui-secondary-foreground-color); /* Reset color within a link */background-color:var(--sui-primary-background-color);white-space:normal;-webkit-user-select:none;user-select:none;&.expanded {border-bottom-width:2px;}&:focus {outline-color:var(--sui-primary-accent-color-translucent);}
|
||
|
||
/* Make the input fields compact within the built-in image component */&:is([data-component-name='image']:where(.svelte-1l1n28m), [data-component-name='linked-image']:where(.svelte-1l1n28m)) {
|
||
@media (768px <= width) {
|
||
/* Hide the bottom border */[data-field-type]::after {display:none;}[data-field-type='string'] {display:flex;align-items:center;gap:8px;padding-block:0 16px;h4 {margin-bottom:0 !important;}.field-wrapper {flex:auto;}}
|
||
}button {margin:var(--sui-focus-ring-width);}}}.inline-field.svelte-1l1n28m {
|
||
/* Make the controls as compact as the text around them allows */--sui-textbox-singleline-min-width: 8em;--sui-combobox-min-width: 6em;display:inline-flex;align-items:center;vertical-align:middle;margin-inline:2px;border-radius:var(--sui-control-medium-border-radius);padding:2px;background-color:var(--sui-secondary-background-color);white-space:normal;-webkit-user-select:none;user-select:none;&:focus {outline:2px solid var(--sui-primary-accent-color-translucent);outline-offset:1px;}.field.inline {display:inline-flex;align-items:center;}
|
||
|
||
/* Only the control itself, not the text box within a number input */.field.inline > .sui:is(.text-input, .number-input, .combobox) {margin:0;width:auto;}}.placeholder.svelte-1l1n28m {--icon-size: 20px; /* Thumbnail size */align-items:center;gap:0.4em;border:dashed 1px currentColor;border-color:hsl(from currentColor h s l / 0.5);border-radius:2px;padding-inline:0.4em;cursor:pointer;-webkit-user-select:none;user-select:none;&:not(.static):hover {border-color:currentColor;}&:focus {outline:2px solid var(--sui-primary-accent-color-translucent);outline-offset:1px;}&.inline {display:inline-flex;}&.block {display:flex;width:fit-content;}
|
||
|
||
/* Center the thumbnail on the line rather than sitting it on the baseline */&:has(.preview) {vertical-align:middle;}&.thumbnail-only {padding:2px;}
|
||
|
||
/* A component without fields can’t be edited */&.static {cursor:default;}}.fields.svelte-1l1n28m {display:flex;flex-direction:column;gap:16px;}`};function b8e(e,t){let n=Co();k(t,!0),q(e,y8e);let r=(e,n)=>{let r=()=>(n?.()).typedPrefix,i=()=>(n?.()).observe,a=Ei(()=>Nr((n?.()).inline,!1));var o=U();Ro(F(o),17,()=>t.fields,e=>e.name,(e,n)=>{let o=e=>{N6(e,{get locale(){return B(p)},get keyPath(){return`${B(C)??``}${B(n).name??``}`},get typedKeyPath(){return`${r()??``}${B(n).name??``}`},get fieldConfig(){return B(n)},context:`rich-text-editor-component`,get componentName(){return t.componentName},valueStoreKey:E,get inline(){return B(a)}})};var s=U(),c=F(s),l=e=>{kO(e,{children:(e,t)=>{o(e)},$$slots:{default:!0}})},u=e=>{o(e)};K(c,e=>{i()?e(l):e(u,-1)}),W(e,s)}),W(e,o)},i=M(void 0);Tz({get current(){return B(i)?.current},set current(e){B(i)&&(B(i).current=e)},get modified(){return B(i)?.modified??!1}});let a=M([]),o=M(!1);Nz({get parentComponentNames(){return B(a)},get readonly(){return B(o)}});let s=Y(t,`mode`,3,`block`),c=Y(t,`inline`,3,!1),l=Y(t,`collapsed`,3,!1),u=Y(t,`values`,7),d=Y(t,`onChange`,3,()=>void 0),f=M(void 0),p=M(``),m=M(``),h=M(``),g=M(!l()),_=M(!1),v=M(void 0),y=M(!1),b=j(()=>t.fields.length>0),x=j(()=>s()===`inline`&&w8(t.fields)),S=j(()=>JSON.stringify([...B(a),t.componentName])),C=j(()=>B(m)?`${B(m)}:${n}:`:``),w=j(()=>B(h)?`${B(h)}:${n}:`:``),T=()=>B(f),ee=e=>{let{target:t}=e;t.closest(`[contenteditable]`)===B(f)&&(e.stopPropagation(),!t.matches(`button, input, textarea`)&&e.key!==`Tab`&&e.preventDefault(),t===B(f)&&e.key===`Backspace`&&!B(o)&&d()(new CustomEvent(`remove`)))},E=`extraValues`,te,ne=!1,re=!1,ie=j(()=>{if(B(i)?.current&&B(p)&&B(m))return u8e(vz(B(i).current,B(p),E),B(C))}),ae=e=>{B(i)&&Oz(e,B(i))},oe=e=>{(0,Cr.default)(e,u())||(ne=!0,u(e))},se=()=>{B(b)&&(N(v,B(ie)?{...B(ie)}:void 0,!0),N(_,!0))},ce=()=>{let e=B(i)?.current;e&&B(p)&&B(m)&&B(v)&&(T8(e[E][B(p)],B(C)),Object.assign(e[E][B(p)],l8e(B(v),B(C))))},le=()=>{N(_,!1),d()(new CustomEvent(`remove`))},ue=async()=>{await Iz();let e=B(i)?.current;e&&s8e({draft:e,locale:B(p),keyPathPrefix:B(C)})&&(N(y,!1),N(_,!1),d()(new CustomEvent(`update`,{detail:B(ie)})),N(v,void 0))},de=()=>{B(y)?(N(_,!1),d()(new CustomEvent(`remove`))):(ce(),N(_,!1),N(v,void 0))},fe=M(void 0),pe=j(()=>{let e=B(i)?.current;if(!e)return;let n=o8e({thumbnailFieldName:t.thumbnail,values:i8e({currentValues:B(ie),values:u(),fields:t.fields}),componentName:t.componentName,collectionName:e.collectionName,fileName:e.fileName,isIndexFile:e.isIndexFile,entry:e.originalEntry,files:e.files,locale:B(p)});return n&&(n.asset??n.url)!==B(fe)?n:void 0}),me=j(()=>a8e({template:t.summary,currentValues:B(ie),values:u(),fields:t.fields,locale:B(p),label:t.label,hasThumbnail:!!B(pe)}));vs(()=>{let e=qj(B(f),e=>{N(o,e,!0)});return window.requestAnimationFrame(()=>{if(re)return;N(i,Sje(B(f)),!0),N(a,bCe(B(f)));let e=B(f)?.closest(`[data-locale]`),t=B(f)?.closest(`[data-key-path]`);N(p,e?.dataset.locale,!0),N(m,t?.dataset.keyPath,!0),s()!==`dialog`&&N(h,t?.dataset.typedKeyPath,!0),N(y,!u()),s()===`dialog`&&B(y)&&se()}),()=>{let t=B(i)?.current;re=!0,e(),t&&(T8(t[E][B(p)],B(C)),T8(t.validities[B(p)],B(C)))}}),YO(()=>[u(),B(p),B(m)],()=>{if(B(i)?.current&&B(p)&&B(m)){let e=ne;ne=!1;let n=d8e({values:u(),fields:t.fields,componentName:t.componentName,locale:B(p),defaultLocale:B(i).current.defaultLocale});if(n!==u()&&u(n),e&&(te=u()),!(0,Cr.default)(u(),B(ie))){let t=B(i),n=l8e(u(),B(C));kz(()=>{let r=t.current;r&&(re||(e&&c8e(r[E][B(p)],B(C)),Object.assign(r[E][B(p)],n)))})}s()===`dialog`&&!B(b)&&B(y)&&(N(y,!1),d()(new CustomEvent(`update`,{detail:u()})))}}),YO(()=>[s(),B(ie)],()=>{s()!==`dialog`&&!(0,Cr.default)(te,B(ie))&&(d()(new CustomEvent(`update`,{detail:B(ie)})),te=B(ie))});var he={getElement:T,setValues:oe},ge=U(),_e=F(ge),ve=e=>{var n=h8e(),i=F(n);let a;var s=P(i),l=e=>{N$(e,{get asset(){return B(pe).asset},get src(){return B(pe).url},variant:`icon`,cover:!0,onError:()=>{let{asset:e,url:t}=B(pe);N(fe,e??t)}})};K(s,e=>{B(pe)&&e(l)});var u=L(s,2),h=e=>{var t=f8e(),n=I(t,!0);z(()=>G(n,B(me))),W(e,t)};K(u,e=>{B(me)&&e(h)}),O(i),ms(i,e=>N(f,e),()=>B(f));var g=L(i,2),v=e=>{Pl(e,{get title(){return t.label},size:`large`,showOk:!1,showCancel:!1,onCancel:()=>{de()},get open(){return B(_)},set open(e){N(_,e,!0)},footer:e=>{var t=p8e(),n=F(t),r=e=>{{let t=j(()=>X(`remove`));ll(e,{variant:`secondary`,get label(){return B(t)},onclick:()=>{le()}})}};K(n,e=>{B(o)||e(r)});var i=L(n,2);Ml(i,{flex:!0});var a=L(i,2),s=e=>{{let t=j(()=>X(B(y)?`insert`:`update`));ll(e,{variant:`primary`,get label(){return B(t)},onclick:()=>{ue()}})}};K(a,e=>{B(o)||e(s)});var c=L(a,2);{let e=j(()=>X(`cancel`));ll(c,{variant:`secondary`,get label(){return B(e)},onclick:()=>{de()}})}W(e,t)},children:(e,t)=>{var n=m8e(),i=P(n),a=e=>{r(e,()=>({typedPrefix:B(C),observe:!1}))};K(i,e=>{B(p)&&B(m)&&e(a)}),O(n),$o(n,()=>ae),z(()=>{J(n,`data-locale`,B(p)),J(n,`data-component-path`,B(S))}),W(e,n)},$$slots:{footer:!0,default:!0}})};K(g,e=>{B(b)&&e(v)}),z(()=>{J(i,`role`,B(b)?`button`:`img`),a=rs(i,1,`component ${c()?`inline`:`block`} placeholder`,`svelte-1l1n28m`,a,{static:!B(b),"thumbnail-only":!!B(pe)&&!B(me)}),J(i,`aria-label`,t.label),J(i,`title`,t.label),J(i,`data-key-path-prefix`,B(C)),J(i,`data-component-name`,t.componentName)}),_o(`click`,i,()=>{se()}),_o(`keydown`,i,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),se()),e.key===`Backspace`&&(e.preventDefault(),B(o)||d()(new CustomEvent(`remove`)))}),W(e,n)},ye=e=>{var n=g8e(),i=P(n),a=e=>{r(e,()=>({typedPrefix:B(w),observe:!1,inline:!0}))};K(i,e=>{B(p)&&B(m)&&e(a)}),O(n),ms(n,e=>N(f,e),()=>B(f)),$o(n,()=>e=>ho(e,`keydown`,ee)),z(()=>{J(n,`aria-label`,t.label),J(n,`title`,t.label),J(n,`data-key-path-prefix`,B(C)),J(n,`data-component-name`,t.componentName),J(n,`data-component-path`,B(S))}),W(e,n)},be=e=>{var i=v8e();let a;var s=P(i);P6(s,{get label(){return t.label},get controlId(){return`object-${n}-item-list`},get expandable(){return B(b)},get expanded(){return B(g)},set expanded(e){N(g,e,!0)},endContent:e=>{var t=U(),n=F(t),r=e=>{P$(e,{onclick:()=>{d()(new CustomEvent(`remove`))}})};K(n,e=>{B(o)||e(r)}),W(e,t)},$$slots:{endContent:!0}});var l=L(s,2),u=e=>{var t=_8e(),i=P(t),a=e=>{r(e,()=>({typedPrefix:B(w),observe:!0}))};K(i,e=>{B(p)&&B(m)&&B(g)&&e(a)}),O(t),z(()=>J(t,`id`,`object-${n}-item-list`)),W(e,t)};K(l,e=>{B(b)&&e(u)}),O(i),ms(i,e=>N(f,e),()=>B(f)),$o(i,()=>e=>ho(e,`keydown`,ee)),z(()=>{a=rs(i,1,`component ${c()?`inline`:`block`} wrapper`,`svelte-1l1n28m`,a,{expanded:B(b)&&B(g)}),J(i,`aria-label`,t.label),J(i,`data-key-path-prefix`,B(C)),J(i,`data-component-name`,t.componentName),J(i,`data-component-path`,B(S))}),W(e,i)};return K(_e,e=>{s()===`dialog`?e(ve):B(x)?e(ye,1):e(be,-1)}),W(e,ge),A(he)}vo([`click`,`keydown`]);var x8e=/^([ \t]*)(`{3,}|~{3,})(.*)$/,S8e=/`+/g,C8e=/\n[ \t]*\n/,w8e=RegExp(`^ {0,3}</?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:[ \\t]|/?>|$)`,`i`),T8e=/^ {0,3}(?:<(?!(?:pre|script|style|textarea)[\s/>])[a-z][a-z\d-]*(?:[ \t]+[a-z_:][\w.:-]*(?:[ \t]*=[ \t]*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*[ \t]*\/?>|<\/[a-z][a-z\d-]*[ \t]*>)[ \t]*$/i,E8e=(e,t,n)=>{let r=0;for(;t-r>n&&e[t-r-1]===`\\`;)r+=1;return r%2==1},D8e=e=>{let[,t=``,n=``,r=``]=e.match(x8e)??[];if(!(!n||n[0]==="`"&&r.includes("`")))return{indent:t,char:n[0],length:n.length,info:r}},O8e=(e,{char:t,length:n})=>{let r=e.trim();return r.length>=n&&r===t.repeat(r.length)},k8e=e=>{let t=[],n,r=0,i=0,a=(n,r)=>{let i=e.slice(n,r),a=[...i.matchAll(S8e)],o=0;a.forEach(({0:e,index:r},s)=>{if(r<o||E8e(i,r,o))return;let c=a.find((t,n)=>n>s&&t[0].length===e.length);c&&!C8e.test(i.slice(r,c.index))&&(o=c.index+e.length,t.push([n+r,n+o]))})};return e.split(`
|
||
`).forEach(e=>{let o=i+e.length;if(n)O8e(e,n)&&(t.push([n.start,o]),n=void 0,r=o);else{let t=D8e(e);t&&(a(r,i),n={start:i+t.indent.length,char:t.char,length:t.length})}i=o+1}),n?t.push([n.start,e.length]):a(r,e.length),t.sort(([e],[t])=>e-t)},A8e=(e,t)=>t.some(([t,n])=>e>t&&e<n),j8e=(e,{afterParagraph:t=!1}={})=>w8e.test(e)||!t&&T8e.test(e),M8e=(e,t)=>{let n=e.slice(0,Math.max(0,t-1)).split(`
|
||
`),r=n.findLastIndex(e=>!e.trim())+1;return n.slice(r).some((e,t)=>j8e(e,{afterParagraph:t>0}))},E8=()=>void 0,N8e=new WeakMap,P8e=({fields:e})=>A0.current?mA(N8e,e,()=>N0().fromJS(e)):void 0,F8e=e=>Array.from(e).reduce((e,t)=>((e^t.charCodeAt(0))>>>0)*16777619>>>0,2166136261).toString(16),I8e=(...e)=>{let{alt:t,src:n,title:r,singleQuotedTitle:i,alt2:a,src2:o,title2:s,singleQuotedTitle2:c,link:l}=e.at(-1);if(o!==void 0){let e=/["']/.test(l)?l:l.replaceAll(` `,`%20`);return`[${I8e({alt:a,src:o,title:s,singleQuotedTitle:c})}](${e})`}let u=n.replaceAll(` `,`%20`);return r?``:i?``:``},L8e=new RegExp($j,`g`),R8e=[`image`,`linked-image`],z8e=new Map,B8e=10,V8e=e=>typeof e==`string`?[e]:e&&typeof e==`object`?Object.values(e).flatMap(V8e):[],H8e=e=>mA(z8e,`${e.source}|${e.flags}`,()=>e.global?e:new RegExp(e.source,`${e.flags}g`)),U8e=({match:e,index:t,end:n},r)=>r.some(r=>t>=r.start&&n<=r.end&&r.values.some(t=>t.includes(e[0]))),W8e=(e,t,n)=>{let r=[],i=k8e(e);t.forEach((t,a)=>{(t.inlinePattern?Bj(e,t.pattern,t.inlinePattern):e.matchAll(H8e(t.pattern))).forEach(e=>{let o={def:t,match:e,index:e.index,end:e.index+e[0].length,order:a};e[0]&&!A8e(e.index,i)&&(!n||U8e(o,n))&&r.push(o)})}),r.sort((e,t)=>e.index-t.index||t.end-e.end||e.order-t.order);let a=0;return r.filter(e=>e.index<a?!1:(a=e.end,!0))},G8e=(e,t)=>({seenHashes:new Map,previewMap:new Map,previousPreviewMap:e,getAsset:t,assetMap:new Map}),K8e=(e,{def:t,fieldProps:n,source:r})=>{let{seenHashes:i,previewMap:a,previousPreviewMap:o,getAsset:s,assetMap:c}=e,{toPreview:l}=t,u=F8e(r),d=i.get(u)??0,f=d===0?u:`${u}-${d}`,p=o?.get(f);if(p==null&&l){let e=[];p=l(n,(t,n)=>{let r=s(t,n);return r&&e.push(r),r},P8e(t)),e.length&&c.set(f,e)}return i.set(u,d+1),a.set(f,p),{key:f,preview:p}},q8e=(e,t)=>{let n=e.indexOf(`
|
||
`,t);return n>=0&&e.slice(n+1).split(`
|
||
`,1)[0].trim()?n:void 0},J8e=(e,{preview:t,index:n,end:r})=>{let i=e.lastIndexOf(`
|
||
`,n-1)+1,a=e.slice(i,n);if(!/^ {0,3}$/.test(a)||t.includes(`
|
||
|
||
`))return;let[o]=t.split(`
|
||
`),s=q8e(e,r),c=a+o+(o===t?e.slice(r,s??e.indexOf(`
|
||
`,r)):``),l=i?e.slice(e.lastIndexOf(`
|
||
`,i-2)+1,i-1):``;return s!==void 0&&j8e(c,{afterParagraph:!!l.trim()})&&!M8e(e,i)?s:void 0},Y8e=(e,{string:t,matches:n})=>{let r=[],i=[],a=0,o=0,s,c=e=>{let n=t.slice(a,e);s!==void 0&&s<e&&(n=`${t.slice(a,s)}\n${t.slice(s,e)}`,s=void 0),r.push(n),o+=n.length};return n.forEach(({def:n,match:l,index:u,end:d})=>{let f=n.fromBlock?.(l)??l.groups??{},{key:p,preview:m}=K8e(e,{def:n,fieldProps:f,source:l[0]});if(c(u),typeof m==`string`)i.push({start:o,end:o+m.length,values:V8e(f)}),r.push(m),o+=m.length,s=J8e(t,{preview:m,index:u,end:d})??s;else{let e=`<span data-component-key="${p}"></span>`;r.push(e),o+=e.length}s!==void 0&&s<d&&(s=q8e(t,d)),a=d}),c(t.length),{string:r.join(``),regions:i}},X8e=(e,t,n,r=E8)=>{let i=t.filter(e=>Gj(e)&&!!e.toPreview),a=G8e(n,r),{previewMap:o,assetMap:s}=a;if(!i.length)return{markdown:e,previewMap:o,assetMap:s};let c=document.createElement(`template`);c.innerHTML=e;let l=e=>{[...e.children].forEach(e=>{let t,n=i.find(n=>(t=e.matches(n.htmlSelector)?n.fromBlockHTML(e):void 0,!!t));if(!n){l(e);return}let{key:r,preview:o}=K8e(a,{def:n,fieldProps:t,source:e.outerHTML});if(typeof o==`string`){let t=document.createElement(`template`);t.innerHTML=o,e.replaceWith(t.content)}else{let t=document.createElement(`span`);t.dataset.componentKey=r,e.replaceWith(t)}})};return l(c.content),{markdown:c.innerHTML,previewMap:o,assetMap:s}},Z8e=(e,t,n,r=E8,i=`markdown`)=>{if(i===`html`)return X8e(e??``,t,n,r);let a=G8e(n,r),{previewMap:o,assetMap:s}=a,c=e??``,l=k8e(c),u=t.filter(({id:e})=>!R8e.includes(e)),d=c.replace(L8e,(...e)=>A8e(e.at(-3),l)?e[0]:I8e(...e)),f;for(let e=0;e<B8e&&u.length;e+=1){let e=W8e(d,u,f);if(!e.length)break;let t=Y8e(a,{string:d,matches:e});if(d=t.string,f=t.regions,!f.length)break}return{markdown:d,previewMap:o,assetMap:s}},Q8e={ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i,ADD_TAGS:[`iframe`],ADD_ATTR:[`allow`,`allowfullscreen`,`referrerpolicy`,`sandbox`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`textarea`,`select`,`option`]},$8e=[`color`,`background-color`,`font-style`,`font-weight`,`text-decoration`,`text-decoration-line`,`text-decoration-style`,`text-decoration-color`,`text-decoration-thickness`,`text-align`,`width`,`height`,`max-width`,`max-height`],e5e=e=>{let{style:t}=e;Array.from(t).filter(e=>!$8e.includes(e)).forEach(e=>{t.removeProperty(e)}),t.length||e.removeAttribute(`style`)},t5e=[`allow-forms`,`allow-orientation-lock`,`allow-pointer-lock`,`allow-popups`,`allow-presentation`,`allow-same-origin`,`allow-scripts`,`allow-storage-access-by-user-activation`],n5e=[`accelerometer`,`autoplay`,`clipboard-write`,`encrypted-media`,`fullscreen`,`gyroscope`,`picture-in-picture`,`web-share`],r5e=e=>{let t=e.getAttribute(`allow`);if(t===null)return;let n=t.split(`;`).map(e=>e.trim()).filter(e=>n5e.includes(e.split(/\s+/)[0].toLowerCase()));n.length?e.setAttribute(`allow`,n.join(`; `)):e.removeAttribute(`allow`)},i5e=e=>{let t=e.getAttribute(`src`)?.trim()||``;if(!t.startsWith(`https://`))return!1;try{let e=new URL(t),n=typeof window<`u`&&window.location?window.location.origin:``;if(n&&e.origin===n)return!1}catch{return!1}let n=e.getAttribute(`sandbox`)||``,r=new Set(n.toLowerCase().split(/\s+/).filter(e=>t5e.includes(e)));return r.add(`allow-scripts`),r.add(`allow-same-origin`),e.setAttribute(`sandbox`,Array.from(r).join(` `)),r5e(e),!0},D8=(e,t={})=>{let n=_t(e,{...Q8e,...t,RETURN_DOM:!0});return Array.from(n.querySelectorAll(`iframe`)).forEach(e=>{i5e(e)||e.remove()}),n.querySelectorAll(`[style]`).forEach(e=>{e5e(e)}),n.innerHTML},a5e=({toPreview:e,toInline:t},n)=>{let r,i=``;try{r=e?.(n,E8,void 0)}catch{r=void 0}if(typeof r==`string`||r instanceof HTMLElement||(0,br.isValidElement)(r))return{preview:r,text:i};try{i=String(t(n)??``)}catch{}return{text:i}},o5e=(e,{preview:t,text:n})=>typeof t==`string`?(e.innerHTML=D8(vr(t)),()=>e.replaceChildren()):t instanceof HTMLElement?(e.replaceChildren(t),()=>{e.replaceChildren(),t.dispatchEvent(new CustomEvent(`Unmount`))}):t?F3(e,t):(e.textContent=n,()=>e.replaceChildren()),s5e=V(`<span contenteditable="false" tabindex="0"><span role="none" class="preview"></span></span>`),c5e={hash:`svelte-dyy7pv`,code:`.inline-pattern.svelte-dyy7pv {display:inline-flex;align-items:baseline;vertical-align:baseline;border-radius:var(--sui-control-medium-border-radius);padding-inline:2px;cursor:default;-webkit-user-select:none;user-select:none;&.editable {cursor:pointer;&:hover {background-color:var(--sui-hover-background-color);}}&:focus {outline:2px solid var(--sui-primary-accent-color-translucent);outline-offset:1px;}}`};function l5e(e,t){k(t,!0),q(e,c5e);let n=Y(t,`onChange`,3,()=>void 0),r=M(void 0),i=M(t.values??{}),a=M(!1),o=!1,s=j(()=>a5e({toPreview:t.toPreview,toInline:t.toInline},B(i))),c=()=>B(r),l=e=>{N(i,e)},u=async()=>{if(!(!t.onEdit||B(a)||o)){o=!0;try{let e=await t.onEdit({data:B(i)});e&&typeof e==`object`&&(N(i,e),n()(new CustomEvent(`update`,{detail:e})))}catch(e){console.error(e)}finally{o=!1}}};vs(()=>qj(B(r),e=>{N(a,e,!0)}));var d={getElement:c,setValues:l},f=s5e();let p;return $o(P(f),()=>e=>o5e(e,B(s))),O(f),ms(f,e=>N(r,e),()=>B(r)),z(()=>{J(f,`role`,t.onEdit?`button`:`group`),p=rs(f,1,`component inline-pattern svelte-dyy7pv`,null,p,{editable:!!t.onEdit&&!B(a)}),J(f,`aria-label`,t.onEdit?void 0:t.label),J(f,`title`,t.label),J(f,`data-component-name`,t.componentName)}),_o(`click`,f,e=>{e.preventDefault(),u()}),_o(`keydown`,f,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u()),(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),B(a)||n()(new CustomEvent(`remove`)))}),W(e,f),A(d)}vo([`click`,`keydown`]);var u5e=/^<(?<tagName>[a-z]+)/i,d5e=new WeakMap,f5e=(e,t)=>{if(e&&typeof e==`object`&&`localName`in e)return e.localName;if(typeof e==`string`)return e.trim().match(u5e)?.groups?.tagName??(typeof t==`string`?t.trim().match(u5e)?.groups?.tagName:void 0)},p5e=(e,t=[])=>{try{return e?.({},...t)}catch{return}},m5e=e=>{let{id:t,label:n,collapsed:r,mode:i,summary:a,thumbnail:o,fields:s,toBlock:c,toPreview:l,htmlSelector:u,fromBlockHTML:d,toBlockHTML:f,inlinePattern:p}=e,m=Uj(e),h=Gj(e),g=!h&&!p,_=h?Wj(u):[],v=g?p5e(l,[E8,P8e(e)]):void 0,y=g?p5e(c):void 0,b=g?f5e(v,y):void 0,x=e=>e.matches(u)?d(e):void 0;class S extends xm{__props;__selectedText;constructor(e,t){super(t),this.__props=e}static getType(){return t}isInline(){return m}static clone(e){return new S(e.__props,e.__key)}static importJSON(e){return new S(e.props).updateFromJSON(e)}exportJSON(){return{props:Kj(this.__props??{}),type:t,version:1}}createDOM(e,u){let d=!!u&&!ng(`sui-import`)&&!ng(`history-merge`),{__selectedText:f}=this,h,g=null,_,v=!1,y=()=>{v||(v=!0,Oo(_))},b=async({type:e,detail:t})=>{await ao(),g??=dh(h);let{activeElement:n}=document,r=n,i=r?.matches(`[contenteditable="true"]`)?window.getSelection():null,a=i&&i.rangeCount>0?i.getRangeAt(0).cloneRange():null;g?.update(()=>{if(e===`update`)try{this.getWritable().__props=t}catch{}e===`remove`&&(y(),this.remove())},{discrete:!0,tag:e===`update`?`skip-dom-selection`:void 0,onUpdate:()=>{r&&document.body.contains(r)&&(r.focus({preventScroll:!0}),a&&i&&(i.removeAllRanges(),i.addRange(a)))}})},x=async e=>{let t;try{let{onInsert:n}=p;t=await n({selectedText:e})}catch(e){console.error(e)}g??=dh(h),g?.update(()=>{let n=wh(this.getKey());if(n){if(t&&typeof t==`object`)n.getWritable().__props=t,n.selectNext(0,0);else if(e){let t=Pm(e);n.replace(t),t.select(0,e.length)}else n.selectPrevious(),n.remove()}},{discrete:!0,tag:`history-merge`}),g?.focus()};return _=p?To(l5e,{target:document.createElement(`div`),props:{componentName:t,label:n,toPreview:l,toInline:c,onEdit:p.onEdit,values:this.__props,onChange:b}}):To(b8e,{target:document.createElement(`div`),props:{componentName:t,label:n,collapsed:r,mode:i,inline:m,summary:a,thumbnail:o,fields:s,values:this.__props,onChange:b}}),Vi(),h=_.getElement(),d5e.set(h,_),window.requestAnimationFrame(()=>{let e=h.isConnected?h.closest(`[data-lexical-editor]`):null;if(!e){y();return}p?d&&f!==void 0&&x(f):d&&h.closest(`[role="textbox"][aria-readonly="false"]`)&&h.focus(),h.closest(`.field`)?.addEventListener(`Unmount`,y,{once:!0});let t=new MutationObserver(()=>{h.isConnected||(y(),t.disconnect())});t.observe(e,{childList:!0,subtree:!0})}),h}exportDOM(){if(!f)return{element:this.createDOM()};let e=f(Kj(this.__props??{}));if(e&&typeof e==`object`)return{element:e};let t=document.createElement(`template`);return t.innerHTML=typeof e==`string`?e:``,{element:t.content}}static importDOM(){let e={};return h?(_.forEach(t=>{e[t]=e=>{let t=x(e);return t?{conversion:()=>({node:new S(t),after:()=>[]}),priority:4}:null}}),e):(b&&(e[b]=()=>({conversion:e=>({node:new S(Object.fromEntries(s.map(({name:t})=>[t,e[t]??``])))}),priority:3})),e)}updateDOM(e,t){return e.__props!==this.__props&&d5e.get(t)?.setValues(this.__props??{}),!1}}return S},h5e=({componentDef:e,CustomNode:t})=>{let{id:n,pattern:r,fromBlock:i,toBlock:a,inlinePattern:o}=e,s=new RegExp(r.source,r.flags.replace(`g`,``)),c=e=>i?.(e)??e.groups??{},l=e=>e instanceof t&&e.getType()===n,u=e=>l(e)?a(Kj(e.__props??{})):null;return Uj(e)?{type:`text-match`,dependencies:[t],importRegExp:o?_Ce(s,o):s,regExp:s,replace:(e,n)=>{e.replace(new t(c(n)))},export:u}:{type:`multiline-element`,dependencies:[t],regExpStart:/^./,regExpEnd:{optional:!0,regExp:/.$/},handleImportAfterStartMatch:({lines:e,rootNode:n,startLineIndex:r})=>{let i=e.slice(r).join(`
|
||
`),[a]=i.match(s)??[];if(!a||!i.startsWith(a))return null;let o=a.match(s),l=a.replace(/\n$/,``).split(`
|
||
`),u=r+l.length-1;return e[u].slice(l.at(-1).length).trim()?null:o?(n.append(new t(c(o))),[!0,u]):[!1,u]},replace:()=>void 0,export:u}},g5e=new Map,_5e=e=>{let t=m5e(e);return{node:t,createNode:n=>{let r=new t(n);return!n&&e.inlinePattern?.onInsert&&(r.__selectedText=$()?.getTextContent()??``),r},transformer:h5e({componentDef:e,CustomNode:t})}},v5e=class{constructor(e){let t=mA(g5e,e.id,()=>_5e(e));Object.assign(this,{...e,...t})}},y5e=/^data:(?<type>image\/.+?);base64,.+/,b5e=`image.png`,x5e=e=>pV.test(e)||BMe.test(e),S5e=(e,t=``)=>{let{year:n,month:r,day:i,hour:a,minute:o,second:s}=JL();return`${n}${r}${i}-${a}${o}${s}${t}.${e}`},C5e=(e,t)=>{let n=rP(new URL(e).pathname.split(`/`).pop());if(!x5e(n))return;let{filename:r,extension:i}=bk(n),a=lV.getExtension(t);return fP(i,a)?n:`${r}.${a}`},w5e=e=>new DOMParser().parseFromString(e,`text/html`).querySelector(`img`),T5e=async e=>{let{clipboardData:t}=e,n=t?.items;if(!n)return[];let r=[],i=[...n].findIndex(({kind:e,type:t})=>e===`file`&&hV.includes(t)),a=[...n].findIndex(({kind:e,type:t})=>e===`string`&&t===`text/html`);if(i>-1&&a>-1){let t=n[i].getAsFile();if(!t)return[];n.clear(),e.stopPropagation();let o=``,s=t.name,c=await new Promise(e=>{n[a].getAsString(t=>{e(w5e(t))})});c&&(o=c.alt,/^https?:/.test(c.src)&&(s=C5e(c.src,t.type)??s)),r=[{file:new File([t],s,{type:t.type}),alt:o}]}else r=[...t.files].filter(({type:e})=>hV.includes(e)).map(e=>({file:e}));return r.map(({file:e,alt:t},n)=>{if(e?.name===b5e){let t=r.length>1?`-${n+1}`:``;e=new File([e],S5e(`png`,t),{type:e.type})}return{file:e,alt:t}})},E5e=async e=>{let{dataTransfer:t}=e,n=t?.files;if(n?.length)return[...n].filter(({type:e})=>hV.includes(e)).map(e=>({file:e}));let r=t?.getData(`text/html`),i=r?w5e(r):null;if(!i)return[];let{src:a,alt:o}=i,s=a.match(y5e)?.groups?.type??``,c;if(hV.includes(s))try{let e=await(await fetch(a)).blob(),t=s.split(`/`)[1].replace(/\+.*$/,``);c=new File([e],S5e(t),{type:s})}catch{return[]}return[{file:c,src:a,alt:o}]},D5e=V(`<div role="none" class="wrapper svelte-duifo7"><!></div>`),O5e={hash:`svelte-duifo7`,code:`.wrapper.svelte-duifo7 {--sui-paragraph-margin: 20px;display:contents;
|
||
@media (width < 768px) {.sui.text-editor {
|
||
/* Remove the section padding */margin:0 calc(var(--field-editor-padding) * -1) calc(var(--field-editor-padding) * -1);width:100dvw;}:is(.sui.toolbar, .lexical-root, textarea) {border:0;border-radius:0;}
|
||
}}`};function k5e(e,t){k(t,!0),q(e,O5e);let n=Ez(),r=$O.current?.field_defaults?.richtext??{},{parentComponentNames:i,valueStoreKey:a}=Mz(),o=jz(a),s=i.at(-1),c=Y(t,`currentValue`,15),l=Y(t,`required`,3,!0),u=Y(t,`readonly`,3,!1),d=Y(t,`invalid`,3,!1),f=M(void 0),p=M(``),m=0,h=M(!1),g=j(()=>Nr(t.fieldConfig.modes,()=>r.modes??[...qUe],!0)),_=j(()=>Nr(t.fieldConfig.buttons,()=>r.buttons??[...DZ],!0)),v=j(()=>Nr(t.fieldConfig.use_emoji_autocomplete,()=>r.use_emoji_autocomplete??!0,!0)),y=j(()=>Nr(t.fieldConfig.use_markdown_shortcuts,()=>r.use_markdown_shortcuts??!0,!0)),b=j(()=>Nr(t.fieldConfig.minimal,()=>r.minimal??!1,!0)),x=j(()=>Nr(t.fieldConfig.multiline,()=>r.multiline??!0,!0)),S=j(()=>kZ(t.fieldConfig)),C=j(()=>B(g).map(e=>JUe[e]).filter(Boolean)),w=j(()=>n.current?.isIndexFile??!1),T=j(()=>n.current?.collectionName??``),ee=j(()=>n.current?.fileName),E=j(()=>bz(n.current,t.locale,t.keyPath,a)),te=j(()=>AZ(t.fieldConfig)),ne=j(()=>ZUe(B(_),B(te))),re=j(()=>QUe(o?_M({collectionName:B(T),fileName:B(ee),isIndexFile:B(w),valueMap:B(E),keyPath:$Ue(t.keyPath)}):t.fieldConfig)),ie=j(()=>eWe({fieldConfig:t.fieldConfig,format:B(S),allowNestedComponents:B(re),inEditorComponent:o,parentComponentNames:i}).map(e=>new v5e(e))),ae=j(()=>B(ie).find(({id:e})=>e===`image`||e===`linked-image`)),oe=j(()=>u3(l3({collectionName:B(T),fileName:B(ee),componentName:s,typedKeyPath:t.typedKeyPath,isIndexFile:B(w)}))),se=async({target:e,images:r})=>{let i=e?.closest(`div`),a=dh(i);if(!n.current||!B(ae)||!i?.matches(`.lexical-root`)||!a)return;let o=B(ae).fields?.find(({name:e})=>e===`src`),{config:s}=FV({fieldConfig:o}),c=n.current,l=B(oe);for(let{file:e,src:n,alt:i=``}of r){let r=n;if(e){let{value:n}=await _3({draft:c,resource:{file:e,folder:l},libraryConfig:s,locale:t.locale});r=n}if(!r)continue;let o=r;a.update(()=>{let e=B(ae).createNode({src:o,alt:i});Py(B(x)?[e,Qm()]:[e])})}},ce=async e=>{if(u())return;let{target:t}=e,n=await T5e(e);n.length&&await se({target:t,images:n})},le=async e=>{if(u())return;let{target:t}=e,n=await E5e(e);n.length&&await se({target:t,images:n})},ue=()=>{let e=n.current;e&&!o&&(window.clearTimeout(m),m=window.setTimeout(()=>{tWe(e.extraValues[t.locale],t.keyPath,e=>!!B(f)?.querySelector(`[data-key-path-prefix="${e}"]`)).forEach(n=>{delete e.extraValues[t.locale][n]})},500))};ZO(()=>c(),e=>{c(e)},()=>B(p),e=>{N(p,e,!0)},e=>typeof e==`string`?e:``),YO(()=>c(),()=>{ue()}),R(()=>()=>{window.clearTimeout(m)}),Rz(()=>B(h));var de=D5e();Mo(P(de),Zc,null,e=>{var n=U();No(F(n),()=>JSON.stringify(t.fieldConfig),e=>{{let n=j(()=>DA(t.locale)),r=j(()=>OA(t.locale));mxe(e,{get lang(){return B(n)},get dir(){return B(r)},get format(){return B(S)},get modes(){return B(C)},get buttons(){return B(ne)},get components(){return B(ie)},get useEmojiAutocomplete(){return B(v)},get useMarkdownShortcuts(){return B(y)},get minimal(){return B(b)},get multiline(){return B(x)},flex:!0,get readonly(){return u()},get required(){return l()},get invalid(){return d()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},autoResize:!0,onpastecapture:e=>{ce(e)},ondrop:e=>{le(e)},get value(){return B(p)},set value(e){N(p,e,!0)},get pending(){return B(h)},set pending(e){N(h,e,!0)}})}}),W(e,n)}),O(de),ms(de,e=>N(f,e),()=>B(f)),W(e,de),A()}function A5e(){return{useNewRenderer:!0,renderer:{heading(...e){return gr.Renderer.prototype.heading.call(this,...e).replace(/^<(h\d)/,`<$1 dir="auto"`)},list(...e){return gr.Renderer.prototype.list.call(this,...e).replace(/^<(ol|ul)/,`<$1 dir="auto"`)},paragraph(...e){return gr.Renderer.prototype.paragraph.call(this,...e).replace(/^<p/,`<p dir="auto"`)}}}}var j5e=!1,M5e=({text:e,lang:t})=>(t?Vge(e,t):void 0)??!1,N5e=()=>{j5e||(j5e=!0,_r(A5e(),{renderer:{code:M5e}}))},P5e=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),F5e=e=>{let t=D8e(e);return t&&/^ {0,3}$/.test(t.indent)?t:void 0},I5e=/^<([a-zA-Z][a-zA-Z0-9]*)(?:[\s>])/,L5e=[{start:/^ {0,3}<(?:pre|script|style|textarea)(?:[\s>]|$)/i,end:/<\/(?:pre|script|style|textarea)>/i},{start:/^ {0,3}<!--/,end:/-->/},{start:/^ {0,3}<\?/,end:/\?>/},{start:/^ {0,3}<![a-z]/i,end:/>/},{start:/^ {0,3}<!\[CDATA\[/,end:/\]\]>/}],R5e=/^ {0,3}(?:[-+*]|\d{1,9}[.)])(?:[ \t]|$)/,z5e=new Map,B5e=e=>{let t=document.createElement(`template`);return t.innerHTML=e,[...t.content.childNodes].map(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.nodeType===Node.TEXT_NODE?Zk(e.data):``).filter(Boolean)},V5e=e=>{let t=L5e.find(({start:t})=>t.test(e));return t&&!t.end.test(e.replace(t.start,``))?t.end:void 0},H5e=e=>{if(!e)return[];let t=e.split(`
|
||
`),n=[],r=[],i=null,a=null,o,s=!1,c=e=>{let n=t.find((t,n)=>n>e&&t.trim())??``;return/^[ \t]/.test(n)||R5e.test(n)};return t.forEach((e,t)=>{if(i)r.push(e),e.length-e.trimStart().length<=3&&O8e(e,i)&&(i=null);else if(o)r.push(e),o.test(e)&&(o=void 0);else if(a){r.push(e);let{openRe:t,closeRe:n}=a;a.depth+=[...e.matchAll(t)].length-[...e.matchAll(n)].length,a.depth<=0&&(a=null)}else{let l=F5e(e);if(o=l?void 0:V5e(e),l)r.push(e),i={char:l.char,length:l.length};else if(o)r.push(e);else{let i=I5e.exec(e);if(i){let t=i[1].toLowerCase();if(r.push(e),!P5e.has(t)){let{openRe:n,closeRe:r}=mA(z5e,t,()=>({openRe:RegExp(`<${t}(?:[\\s>])`,`gi`),closeRe:RegExp(`<\\/${t}>`,`gi`)})),i=[...e.matchAll(n)].length-[...e.matchAll(r)].length;i>0&&(a={tag:t,depth:i,openRe:n,closeRe:r})}}else e===``?s&&c(t)?r.push(e):r.length&&(n.push(r.splice(0).join(`
|
||
`)),s=!1):(r.push(e),s||=R5e.test(e))}}}),r.length&&n.push(r.join(`
|
||
`)),n},U5e=e=>{let t=[],n=e=>{e.forEach(e=>{e.type===`def`?t.push(e.raw.trim()):e.type===`list`?e.items.forEach(e=>{n(e.tokens)}):e.type===`blockquote`&&n(e.tokens)})};return e.filter(e=>e.includes(`]:`)).forEach(e=>n(see(e))),t.join(`
|
||
`)},W5e=e=>{let t=U5e(e);return t?e.map(e=>`${t}\n\n${e}`):e},G5e=(e,{isHTML:t})=>t?B5e(e):W5e(H5e(e)),K5e=(e,t)=>{let n=new Map,r=new Map;return{list:e.map(e=>{let i=n.get(e)??0,a=`${i}\n${e}`,o=t.get(a)??{key:a,block:e};return n.set(e,i+1),r.set(a,o),o}),items:r}},q5e=e=>e.split(`
|
||
`).map(e=>/^[ \t]*([^\s`]+)/.exec(F5e(e)?.info??``)?.[1]).filter(e=>e!==void 0).filter((e,t,n)=>n.indexOf(e)===t).sort(),J5e=[`href`,`src`,`action`,`formaction`,`data`,`from`,`to`,`values`],Y5e=RegExp(`(?:${J5e.join(`|`)})\\s*=`,`i`),X5e=/^[\u0000-\u0020]+|[\t\n\r]/g,Z5e=e=>/^javascript:/i.test(e.replaceAll(X5e,``)),Q5e=e=>{if(!Y5e.test(e))return e;let t=document.createElement(`template`),n=!1;return t.innerHTML=e,t.content.querySelectorAll(`*`).forEach(e=>{[...e.attributes].forEach(({localName:t,name:r,value:i})=>{J5e.includes(t)&&i.split(`;`).some(Z5e)&&(e.removeAttribute(r),n=!0)})}),n?t.innerHTML:e};N5e();var $5e=V(`<div role="none" data-rich-text-preview="" class="svelte-14tuh7g"><!></div>`),e7e={hash:`svelte-14tuh7g`,code:`[role='document'] div.svelte-14tuh7g {:is(h1, h2, h3, h4, h5, h6, p, ul, ol) {margin:1em 0 0;}:is(video, img) {max-width:100%;max-height:100%;}:is(a:has(img)) {display:inline-block;img {pointer-events:none;}}pre.shiki {background-color:var(--sui-code-background-color) !important;}}div.svelte-14tuh7g {
|
||
/* Make the preview the containing block of any positioned element in the content, so an element
|
||
with \`position: fixed\` from an inline style can’t cover the rest of the app */translate:0;[data-component-key] {display:contents;}}`};function O8(e,t){k(t,!0),q(e,e7e);let n=Ez(),r=$O.current?.field_defaults?.richtext??{},i=new MO,a=new jO,o=new Map,s=new Map,c=new Map,l=M(void 0),u=M(!1),d=M(0),f=M(0),p=``,m=j(()=>n?.current?.originalEntry),h=j(()=>n?.current?.collectionName??``),g=j(()=>n?.current?.fileName),_=j(()=>Nr(t.fieldConfig.sanitize_preview,()=>r.sanitize_preview??!0,!0)),v=j(()=>kZ(t.fieldConfig)),y=j(()=>B(v)===`html`),b=j(()=>jZ(t.fieldConfig)),x=j(()=>B(b).map(({id:e})=>e)),S=j(()=>R0({entry:B(m),collectionName:B(h),fileName:B(g),files:n?.current?.files,typedKeyPath:t.typedKeyPath,componentNames:B(x),locale:t.locale})),C=j(()=>{if(typeof t.currentValue!=`string`||!t.currentValue.trim())return``;B(f);let{markdown:e,previewMap:n,assetMap:r}=Z8e(t.currentValue,B(b),o,B(S),B(v));return o=n,s=r,e}),w=j(()=>{let{list:e,items:t}=K5e(G5e(B(C),{isHTML:B(y)}),c);return c=t,e}),T=async e=>{let t=q5e(e).join(`,`);t&&t!==p&&(p=t,await Promise.all(t.split(`,`).map(e=>uO(e))),N(d,B(d)+1))},ee=e=>e.closest(`[data-rich-text-preview]`)===B(l),E=(e,t)=>{let n=P3(e);i.set(e,n),n.render(t)},te=e=>{console.error(e)},ne=e=>{if(!ee(e))return;let t=e.dataset.componentKey,n=t?o.get(t):void 0;n instanceof Element?(e.replaceChildren(n),a.add(n)):(0,br.isValidElement)(n)?j3.current?E(e,n):M3().then(()=>{e.isConnected&&!i.has(e)&&E(e,n)}).catch(te):e.remove()},re=e=>{[e,...e.querySelectorAll(`span[data-component-key]`)].forEach(e=>{let t=i.get(e);t&&(t.unmount(),i.delete(e))})},ie=(e=!1)=>{a.forEach(t=>{(e||!B(l)?.contains(t))&&(a.delete(t),t.dispatchEvent(new CustomEvent(`Unmount`)))})},ae=e=>{e.forEach((e,t)=>{let n=o.get(t);Promise.all(e.map(bqe)).then(async e=>{e.includes(!0)&&o.get(t)===n&&(o.delete(t),N(f,B(f)+1),await ao(),B(l)?.querySelectorAll(`[data-component-key="${t}"]`).forEach(e=>{i.get(e)?.unmount(),i.delete(e),ne(e)}),ie())})})},oe=async e=>{ee(e)&&(e.dataset.processed=`true`,await cWe(e,e=>KUe({value:e,entry:B(m),collectionName:B(h),fileName:B(g),typedKeyPath:t.typedKeyPath,componentNames:B(x),locale:t.locale})))},se=e=>{let t=[];e.forEach(({removedNodes:e,addedNodes:n})=>{e.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&t.push(e)}),n.forEach(e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;let t=e;t.matches(`span[data-component-key]`)?ne(t):t.querySelectorAll(`span[data-component-key]`).forEach(e=>{ne(e)}),t.matches(BZ)&&oe(t),t.querySelectorAll(BZ).forEach(e=>{oe(e)})})}),t.forEach(e=>{re(e)}),ie()},ce=e=>{B(d);let t=B(y)?e:yr(e,{breaks:!0});return oWe(B(_)?D8(t):Q5e(t))};R(()=>{B(C)&&!B(y)&&T(B(C))}),R(()=>{B(C),ae(s)}),vs(()=>{let e=new MutationObserver(se);return e.observe(B(l),{childList:!0,subtree:!0}),N(u,!0),()=>{e.disconnect(),i.forEach(e=>e.unmount()),i.clear(),ie(!0)}});var le=$5e(),ue=P(le),de=e=>{var t=U();Ro(F(t),17,()=>B(w),({key:e,block:t})=>e,(e,t)=>{let n=()=>B(t).block;var r=U();Ho(F(r),()=>ce(n())),W(e,r)}),W(e,t)};K(ue,e=>{B(u)&&B(C)&&e(de)}),O(le),ms(le,e=>N(l,e),()=>B(l)),W(e,le),A()}var t7e=V(`<p> </p>`);function n7e(e,t){k(t,!0);let n=j(()=>AA(t.locale)),r=j(()=>NAe({fieldConfig:t.fieldConfig,currentValue:t.currentValue}));var i=U(),a=F(i),o=e=>{var i=t7e(),a=I(i,!0);z((e,t,n)=>{J(i,`lang`,e),J(i,`dir`,t),G(a,n),i.dir=i.dir},[()=>DA(t.locale),()=>OA(t.locale),()=>B(n).format(B(r))]),W(e,i)};K(a,e=>{B(r).length&&e(o)}),W(e,i),A()}var r7e=V(`<div class="wrapper svelte-19vklom"><!> <span role="none"> </span> <!></div>`),i7e={hash:`svelte-19vklom`,code:`.wrapper.svelte-19vklom {flex:none;color:var(--sui-tertiary-foreground-color) !important;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);text-align:end;}.count.svelte-19vklom {&.invalid {color:var(--sui-error-foreground-color);}&:not(.invalid) {color:var(--sui-success-foreground-color);}}`};function a7e(e,t){k(t,!0),q(e,i7e);let n=j(()=>t.fieldConfig.minlength),r=j(()=>t.fieldConfig.maxlength),i=j(()=>i2({fieldConfig:t.fieldConfig,locale:t.locale,value:t.currentValue}).detail),a=j(()=>B(i).count),o=j(()=>B(i).hasMin),s=j(()=>B(i).hasMax),c=j(()=>B(i).invalid);var l=U(),u=F(l),d=e=>{var t=r7e(),i=P(t),l=e=>{var t=H();z(()=>G(t,`${B(n)??``} / `)),W(e,t)};K(i,e=>{B(o)&&e(l)});var u=L(i,2);let d;var f=I(u,!0),p=L(u,2),m=e=>{var t=H();z(()=>G(t,` /
|
||
${B(r)??``}`)),W(e,t)};K(p,e=>{B(s)&&e(m)}),O(t),z(e=>{J(t,`aria-label`,e),d=rs(u,1,`count svelte-19vklom`,null,d,{invalid:B(c)}),G(f,B(a))},[()=>X(B(o)&&B(s)?`character_counter.min_max`:B(o)?`character_counter.min`:`character_counter.max`,{values:{count:B(a),min:B(n),max:B(r)}})]),W(e,t)};K(u,e=>{(B(o)||B(s))&&e(d)}),W(e,l),A()}var o7e=e=>{let{extraHint:t}=Mz();R(()=>{t&&(t.current=e)})},s7e=({currentValue:e,fieldConfig:t})=>{let{prefix:n=``,suffix:r=``}=t,i=typeof e==`string`?e:String(e??``);return n&&i.startsWith(n)&&(i=i.slice(n.length)),r&&i.endsWith(r)&&(i=i.slice(0,-r.length)),i},c7e=({inputValue:e,fieldConfig:t})=>{let{prefix:n=``,suffix:r=``}=t;return e.trim()&&(n||r)?`${n}${e}${r}`:e};function l7e(e,t){k(t,!0);let n=Y(t,`currentValue`,15),r=Y(t,`required`,3,!0),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1),o=M(``),s=j(()=>Nr(t.fieldConfig.type,`text`)),c=j(()=>Nr(t.fieldConfig.use_emoji_autocomplete,B(s)===`text`));ZO(()=>n(),e=>{n(e)},()=>B(o),e=>{N(o,e,!0)},e=>s7e({currentValue:e,fieldConfig:t.fieldConfig}),e=>c7e({inputValue:e,fieldConfig:t.fieldConfig})),o7e(a7e);{let n=j(()=>DA(t.locale)),l=j(()=>OA(t.locale));Gl(e,{get lang(){return B(n)},get dir(){return B(l)},get type(){return B(s)},get inputmode(){return B(s)},flex:!0,get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get useEmojiAutocomplete(){return B(c)},get value(){return B(o)},set value(e){N(o,e,!0)}})}A()}var u7e=e=>{if(!QE(e))return!1;let{origin:t,pathname:n,searchParams:r}=new URL(e);return!!((t===`https://www.youtube.com`||t===`https://www.youtube-nocookie.com`)&&(n===`/watch`&&r.has(`v`)||n===`/playlist`&&r.has(`list`)||n.startsWith(`/embed/`))||t===`https://youtu.be`&&n)},d7e=e=>{let t=`https://www.youtube-nocookie.com`,{pathname:n,search:r,searchParams:i}=new URL(e);if(n===`/watch`){let e=new URLSearchParams(i),n=`${t}/embed/${e.get(`v`)}`;return e.get(`list`)&&(e.delete(`v`),e.set(`listType`,`playlist`),n+=`?${e}`),n}return n===`/playlist`?`${t}/embed/videoseries${r}`:n.startsWith(`/embed/`)?`${t}${n}${r}`:`${t}/embed${n}${r}`},f7e=V(`<iframe frameborder="0" allow="autoplay; encrypted-media; picture-in-picture; clipboard-write" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups" class="svelte-spbxln"></iframe>`),p7e=V(`<a> </a>`),m7e=V(`<div role="none"><!></div>`),h7e={hash:`svelte-spbxln`,code:`iframe.svelte-spbxln {display:block;margin:0 auto;width:100%;height:auto;aspect-ratio:16 / 9;}`};function g7e(e,t){k(t,!0),q(e,h7e);let n=M(!0),r=j(()=>d7e(t.url)),i=({blockedURI:e,violatedDirective:t})=>{e===new URL(B(r)).origin&&t===`frame-src`&&(N(n,!1),window.removeEventListener(`securitypolicyviolation`,i))};vs(()=>(window.addEventListener(`securitypolicyviolation`,i),()=>{window.removeEventListener(`securitypolicyviolation`,i)}));var a=m7e(),o=P(a),s=e=>{kO(e,{children:(e,t)=>{var n=f7e();z((e,t)=>{J(n,`src`,e),J(n,`title`,t)},[()=>iP(B(r)),()=>X(`youtube_video_player`)]),W(e,n)},$$slots:{default:!0}})},c=e=>{var n=p7e(),r=I(n,!0);z(e=>{J(n,`href`,e),G(r,t.url)},[()=>iP(t.url)]),W(e,n)};K(o,e=>{B(n)?e(s):e(c,-1)}),O(a),W(e,a),A()}var _7e=/^(?:https|mailto|tel):/,v7e=({fieldConfig:e,value:t})=>{let{type:n=`text`}=e;return n===`url`||QE(t)?u7e(t)?`youtube`:_7e.test(t)?`link`:`text`:n===`email`?`email`:`text`},y7e=V(`<a> </a>`),b7e=V(`<p><!></p>`),x7e={hash:`svelte-euqs6c`,code:`.title.svelte-euqs6c {font-size:var(--sui-font-size-xxx-large);font-weight:var(--sui-font-weight-bold);}
|
||
|
||
/* Remove the padding to make the iframe full-width on small screens */
|
||
@media (width < 768px) {[role='document'] section > p.svelte-euqs6c:has(iframe) {margin-inline:calc(var(--entry-preview-padding-inline) * -1);}
|
||
}`};function S7e(e,t){k(t,!0),q(e,x7e);let n=j(()=>t.fieldConfig.name),r=j(()=>typeof t.currentValue==`string`&&t.currentValue.trim()?t.currentValue:``),i=j(()=>B(r)?v7e({fieldConfig:t.fieldConfig,value:B(r)}):`text`);var a=U(),o=F(a),s=e=>{var a=b7e();let o;var s=P(a),c=e=>{g7e(e,{get url(){return B(r)}})},l=e=>{var t=y7e(),n=I(t,!0);z(e=>{J(t,`href`,e),G(n,B(r))},[()=>iP(B(r))]),W(e,t)},u=e=>{var t=y7e(),n=I(t,!0);z(e=>{J(t,`href`,e),G(n,B(r))},[()=>iP(`mailto:${B(r)}`)]),W(e,t)},d=e=>{var t=H();z(()=>G(t,B(r))),W(e,t)};K(s,e=>{B(i)===`youtube`?e(c):B(i)===`link`?e(l,1):B(i)===`email`?e(u,2):e(d,-1)}),O(a),z((e,t)=>{J(a,`lang`,e),J(a,`dir`,t),o=rs(a,1,`svelte-euqs6c`,null,o,{title:B(n)===`title`}),a.dir=a.dir},[()=>DA(t.locale),()=>OA(t.locale)]),W(e,a)};K(o,e=>{B(r)&&e(s)}),W(e,a),A()}function C7e(e,t){k(t,!0);let n=Y(t,`currentValue`,15),r=Y(t,`required`,3,!0),i=Y(t,`readonly`,3,!1),a=Y(t,`invalid`,3,!1),o=M(``),s=j(()=>Nr(t.fieldConfig.use_emoji_autocomplete,!0));ZO(()=>n(),e=>{n(e)},()=>B(o),e=>{N(o,e,!0)},e=>typeof e==`string`?e:``),o7e(a7e);{let n=j(()=>DA(t.locale)),c=j(()=>OA(t.locale));mO(e,{get lang(){return B(n)},get dir(){return B(c)},flex:!0,get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},autoResize:!0,get useEmojiAutocomplete(){return B(s)},get value(){return B(o)},set value(e){N(o,e,!0)}})}A()}var w7e=V(`<p class="svelte-q17c48"> </p>`),T7e={hash:`svelte-q17c48`,code:`p.svelte-q17c48 {white-space:pre-wrap;}`};function E7e(e,t){k(t,!0),q(e,T7e);var n=U(),r=F(n),i=e=>{var n=w7e(),r=I(n,!0);z((e,i)=>{J(n,`lang`,e),J(n,`dir`,i),G(r,t.currentValue),n.dir=n.dir},[()=>DA(t.locale),()=>OA(t.locale)]),W(e,n)},a=j(()=>typeof t.currentValue==`string`&&t.currentValue.trim());K(r,e=>{B(a)&&e(i)}),W(e,n),A()}function D7e(e,t){k(t,!0);let n=Ez(),{valueStoreKey:r=`currentValues`}=Mz(),i=jz(r),a=Y(t,`currentValue`,15),o=Y(t,`required`,3,!0),s=Y(t,`readonly`,3,!0),c=Y(t,`invalid`,3,!1),l=j(()=>n.current?.defaultLocale);YO(()=>t.locale,()=>{!a()&&(t.locale===B(l)||i||rR(t.fieldConfig?.i18n))&&a($3(t.fieldConfig))}),Gl(e,{dir:`ltr`,flex:!0,get readonly(){return s()},get required(){return o()},get invalid(){return c()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return a()},set value(e){a(e)}}),A()}var O7e=V(`<p class="svelte-1phz9g8"> </p>`),k7e={hash:`svelte-1phz9g8`,code:`p.svelte-1phz9g8 {font-family:var(--sui-font-family-monospace);}`};function A7e(e,t){k(t,!0),q(e,k7e);var n=U(),r=F(n),i=e=>{var n=O7e(),r=I(n,!0);z(()=>G(r,t.currentValue)),W(e,n)},a=j(()=>typeof t.currentValue==`string`&&t.currentValue.trim());K(r,e=>{B(a)&&e(i)}),W(e,n),A()}var k8={boolean:aSe,code:wje,color:Fje,compute:zje,datetime:uZe,file:fQe,image:fQe,keyvalue:BQe,list:v2e,map:t4e,markdown:k5e,number:a4e,object:h4e,relation:q6e,richtext:k5e,select:U6e,string:l7e,text:C7e,uuid:D7e},A8={boolean:sSe,code:Eje,color:Rje,compute:oMe,datetime:aZe,file:_Qe,image:_Qe,keyvalue:WQe,list:M2e,map:i4e,markdown:O8,number:s4e,object:_4e,relation:Z6e,richtext:O8,select:n7e,string:S7e,text:E7e,uuid:A7e},j7e=({initialProps:e,transforms:t={},onValueChange:n})=>{let r=na({...e}),i={};return Object.keys(e).forEach(e=>{let a=t[e];Object.defineProperty(i,e,{enumerable:!0,get:a?()=>a(r[e]):()=>r[e],set:e===`currentValue`?n:void 0})}),{values:r,props:i}},M7e=(e,t)=>{Object.entries(t).forEach(([t,n])=>{(0,Cr.default)(e[t],n)||(e[t]=n)})},N7e=[`boolean`,`color`,`datetime`,`map`,`number`,`select`,`string`,`text`,`uuid`],P7e=new Map,F7e=new WeakMap,I7e=e=>typeof e.toJS==`function`?e.toJS():typeof e.get==`function`?new Proxy({},{get:(t,n)=>typeof n==`string`?e.get(n):void 0,has:(t,n)=>typeof n==`string`&&e.get(n)!==void 0}):D(e)?e:{},j8=e=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return{};let t=F7e.get(e);if(t)return t;let n=I7e(e);return F7e.set(e,n),n},L7e=(e,t)=>{let{value:n,field:r,forID:i,locale:a,keyPath:o,required:s,readonly:c,invalid:l}=e,u=j8(r),{name:d,required:f}=u,p=a??t.locale??``;return{locale:p,keyPath:o??t.keyPath??d??``,typedKeyPath:``,fieldId:i??``,fieldLabel:ER({config:u,locale:p}),fieldConfig:r,currentValue:n,required:s??t.required??f,readonly:c??t.readonly,invalid:l??t.invalid}},R7e=({value:e,field:t,locale:n,keyPath:r},i)=>({locale:n??i.locale??``,keyPath:r??i.keyPath??j8(t).name??``,typedKeyPath:``,fieldConfig:t,currentValue:e}),z7e=({SvelteComponent:e,buildProps:t})=>n=>{let r=(0,br.useContext)(k3),i=(0,br.useRef)(n),a=(0,br.useRef)(void 0);i.current=n,a.current?M7e(a.current.values,t(n,r)):a.current=j7e({initialProps:t(n,r),transforms:{fieldConfig:j8},onValueChange:e=>{let{values:t}=a.current;(0,Cr.default)(t.currentValue,e)||(t.currentValue=e,i.current.onChange?.(e))}});let o=(0,br.useCallback)(t=>{if(!t)return;let{props:n}=a.current,r=To(e,{target:t,props:n});return()=>{Oo(r)}},[]);return(0,br.createElement)(`div`,{ref:o})},B7e=e=>({control:z7e({SvelteComponent:k8[e],buildProps:L7e}),preview:z7e({SvelteComponent:A8[e],buildProps:R7e})}),V7e=e=>{if(!N7e.includes(e)){dk.includes(e)&&console.warn(`The built-in "${e}" field type cannot be reused in a custom field type, because its editor works only within the entry editor. Reusable field types are: ${N7e.join(`, `)}.`);return}let t=P7e.get(e);if(t)return t;let n=B7e(e);return P7e.set(e,n),n},H7e=(e,t=new Set)=>{let n=FO.get(e);if(!n)return V7e(e);let{control:r,preview:i,summary:a,schema:o}=n;return typeof r==`string`?(t.add(e),{control:t.has(r)?void 0:H7e(r,t)?.control,preview:i,summary:a,schema:o}):{control:r,preview:i,summary:a,schema:o}},M8=(e,t)=>{if(!e)throw TypeError(t)},N8=(e,t,n,r)=>{M8(e,`The \`${n}\` option for \`CMS.${t}()\` must be ${r}`)},P8=(e,t,n)=>{M8(e,`The \`definition.${t}\` must be ${n}`)},U7e=({name:e,reserved:t,subject:n,builtin:r,custom:i})=>{if(t.includes(e))throw Error(`The ${n} name "${e}" is reserved for a ${r}. Choose a different name for your ${i}.`)},W7e=e=>URL.parse(e,window.location.href),F8=e=>(N8(Jk(e),`getFieldType`,`name`,`a non-empty string`),H7e(e)),G7e=(e,t)=>Object.values(e.locales).map(({content:e})=>e[t]).find(e=>typeof e==`string`)??e.subPath,K7e=({entry:e,previousPaths:t,collectionName:n,fileName:r})=>{let i=nj(new Set([...CP(e),...t]));if(i)return i;if(r)return cj(n,r);let a=YA(n);if(!a||!HA(a._i18n.structureMap))return;let o=a._i18n.canonicalSlug.key,s=G7e(e,o);return BL(n).find(e=>G7e(e,o)===s)},q7e=({entry:e,previousPaths:t,deletedPaths:n,collectionName:r,fileName:i,publishedEntry:a=K7e({entry:e,previousPaths:t,collectionName:r,fileName:i})})=>{if(!a)return e;let o=!!t.length&&!!e.slug;return{...a,...e,locales:{...Object.fromEntries(Object.entries(a.locales).filter(([,{path:e}])=>!n.has(e))),...e.locales},slug:o?e.slug:a.slug,subPath:o?e.subPath:a.subPath}},J7e=async(e,t,n)=>{let r=e=>YA(e),i=e=>r(e).create!==!1,a=e.filter(({folder:e,text:n})=>{let r=YA(e.collectionName);return e.collectionName!==t&&e.fileName===void 0&&n!==void 0&&r?._type===`entry`&&!RY({collection:r})});return(await Promise.all([...Map.groupBy(a,({folder:e})=>e.collectionName)].map(async([e,t])=>(await FL(t)).entries.flatMap(t=>{let a=K7e({entry:t,previousPaths:[],collectionName:e});return a?$3e(r(e),a)?[{collectionName:e,entry:{...q7e({entry:t,previousPaths:[],deletedPaths:n,collectionName:e,publishedEntry:a}),id:a.id},edited:!0}]:[]:i(e)?[{collectionName:e,entry:t}]:[]})))).flat()},Y7e=async e=>{let t=oq(e.branch);if(!t||t.legacy&&e.files.some(({path:e,previousPath:t})=>!SH(e)||t!==void 0&&!SH(t)))return{entries:[],assets:[]};let{collectionName:n}=t,{entryFiles:r,assetFiles:i}=ZU(e.files.filter(({deleted:e})=>!e).map(({path:e,sha:t,size:n,text:r})=>UG(e,{sha:t,size:n,text:r}))),a=e.files.flatMap(({path:e,deleted:t,previousPath:n})=>n?[n]:t?[e]:[]),o=a.length?ZU(a.map(e=>UG(e))).entryFiles.filter(({folder:e})=>e.collectionName===n):[],s=o.map(({path:e})=>e),c=new Set(e.files.filter(({deleted:e})=>e).map(({path:e})=>e)),l=i.map(t=>({...HG(t),workflow:{branch:e.branch}})),u=r.filter(({folder:e,text:t})=>e.collectionName===n&&t!==void 0);if(!u.length){let t=new Set(s);return{entries:(s.length?tj.current.filter(e=>Object.values(e.locales).some(({path:e})=>t.has(e))):[]).map(t=>{let r=Object.entries(t.locales).filter(([,{path:e}])=>!c.has(e));return r.length?{...t,locales:Object.fromEntries(r),workflow:{pullRequest:e,status:e.status,collectionName:n,fileName:o[0].folder.fileName,previousPaths:s}}:{...t,workflow:{pullRequest:e,status:`pending_deletion`,collectionName:n,fileName:void 0,previousPaths:s}}}),assets:l}}let{entries:d}=await FL(u),{fileName:f}=u[0].folder,p=await J7e(r,n,c);return{entries:d.map(t=>({...q7e({entry:t,previousPaths:s,deletedPaths:c,collectionName:n,fileName:f}),workflow:{pullRequest:e,status:e.status,collectionName:n,fileName:f,previousPaths:s,...p.length?{companions:p}:{}}})),assets:l}},X7e=async e=>{let t=await Promise.all(e.map(Y7e));return{entries:t.flatMap(({entries:e})=>e),assets:t.flatMap(({assets:e})=>e)}},I8={time:0,head:``},L8,Z7e=e=>{I8={time:Date.now(),head:e}},Q7e=()=>{let{backend:e}=$O.current??{};return!(e&&`open_authoring`in e&&e.open_authoring)||PB.current},$7e=()=>{let e=XJ.current?.workflow;return sY.current&&e&&Q7e()?e:void 0},e9e=()=>{let e=$7e();if(!e)return;uY.current=!0;let t=e.fetchPullRequests();return t.catch(()=>{}),t},t9e=async(e=e9e())=>{if(!e)return;let t=EG.current,n=OG();try{let{entries:r,assets:i}=await X7e(await e);n()||(lY.current=r,o4(i),Z7e(t))}catch(e){console.error(e)}finally{n()||(uY.current=!1,dY.current=!0)}},R8=e=>Map.groupBy(e,({workflow:e})=>e.pullRequest.branch),n9e=(e=[],t=[])=>e.length===t.length&&e.every((e,n)=>e===t[n]),r9e=(e,t=[])=>{let n=new Map(t.flatMap(({entry:e})=>CP(e).map(t=>[t,e.id])));return e?.map(e=>{let t=CP(e.entry).map(e=>n.get(e)).find(Boolean);return t?{...e,entry:{...e.entry,id:t}}:e})},i9e=(e,t)=>{let n=e.map((e,n)=>{let r=t[n];if(!r)return e;let{workflow:i}=e,a={...e,id:r.id,...i.companions?{workflow:{...i,companions:r9e(i.companions,r.workflow.companions)}}:{}};return(0,Cr.default)(a,r)?r:a});return n9e(n,t)?t:n},z8=e=>e?.[0]?.workflow.pullRequest.headSHA,a9e=async(e,t,n,r)=>{let i=new Set;return await lU([...t.keys()].filter(e=>{let i=z8(t.get(e));return r.has(e)&&!!i&&i!==z8(n.get(e))}),async n=>{try{await e.fetchBranchHead(n)===z8(t.get(n))&&i.add(n)}catch(e){console.error(`Failed to check the workflow branch for changes.`,e)}}),i},o9e=async e=>{let t=OG(),n=EG.current,r=R8(lY.current),i=await e.fetchPullRequests();if(t())return!1;let a=new Set(i.map(({branch:e})=>e));if([...r.keys()].some(e=>!a.has(e))){try{await U4()}catch(e){console.error(`Failed to check the repository for changes.`,e)}if(t())return!1}let{entries:o,assets:s}=await X7e(i);if(t())return!1;let c=R8(o),l=await a9e(e,r,c,a);if(t())return!1;let u=R8(lY.current),d=new Set(fY.current),f=new Set,p=e=>{let t=u.get(e)??[];if(d.has(e)||l.has(e)||!n9e(t,r.get(e)))return t;let n=i9e(c.get(e)??[],t);return n!==t&&f.add(e),n},m=[...new Set([...u.keys(),...c.keys()])].flatMap(p);return Z7e(n),f.size?(lY.current=m,f.forEach(s4),o4(s.filter(({workflow:e})=>f.has(e?.branch))),!0):!1},B8=async({fresh:e=!1}={})=>{let t=$7e();return!t||!dY.current?!1:(e&&L8&&await L8.catch(()=>void 0),L8||=o9e(t).finally(()=>{L8=void 0}),L8)},s9e=async({maxAge:e=3e5}={})=>!L8&&EG.current===I8.head&&Date.now()-I8.time<e?!1:B8(),V8=0,c9e=0,l9e=()=>document.visibilityState===`visible`,u9e=async({maxAge:e=0,workflowMaxAge:t=3e5}={})=>{try{await U4({maxAge:e})}catch(e){console.error(`Failed to check the repository for changes.`,e)}try{await s9e({maxAge:t})}catch(e){console.error(`Failed to check the unpublished entries for changes.`,e)}},d9e=()=>{l9e()&&u9e()},H8=()=>{l9e()&&Date.now()-c9e>=1e4&&u9e({maxAge:1e4,workflowMaxAge:3e4})},f9e=()=>{V8||(c9e=Date.now(),V8=window.setInterval(d9e,6e4),document.addEventListener(`visibilitychange`,H8),window.addEventListener(`focus`,H8))},p9e=()=>{V8&&=(window.clearInterval(V8),document.removeEventListener(`visibilitychange`,H8),window.removeEventListener(`focus`,H8),0)},U8=WO({}),m9e=100,W8=new Map,h9e=()=>{if(W8.size<=m9e)return;let e=Date.now()-3e4,t=new Set([...W8.entries()].filter(([,{time:t}])=>t<e).map(([e])=>e));[...W8.keys()].forEach(e=>{W8.size-t.size>m9e&&t.add(e)}),t.forEach(e=>W8.delete(e)),U8.current=Object.fromEntries(Object.entries(U8.current).filter(([e])=>!t.has(e)))},g9e=async e=>{let t;try{t=await aW(e,{method:`GET`},{responseType:`raw`})}catch{return`unknown`}return t.ok?`ready`:t.status===404?`pending`:`unknown`},_9e=async(e,{recheckPending:t=!1}={})=>{let n=W8.get(e),r=t&&U8.current[e]===`pending`;if(n&&!r&&Date.now()-n.time<3e4)return n.promise;let i=!1;try{i=new URL(e).origin===window.location.origin}catch{i=!1}let a=i?g9e(e):Promise.resolve(`unknown`);W8.delete(e),W8.set(e,{time:Date.now(),promise:a}),h9e();let o=await a;return U8.current=U8.current[e]===o?U8.current:{...U8.current,[e]:o},o},v9e=()=>{W8.clear(),U8.current={}},y9e=()=>{let{current:e}=$O,{current:t}=XJ;if(!e||!t?.isGit)return{};let{skip_ci:n,automatic_deployments:r}=e.backend;return{skipCI:n,autoDeploy:r}},G8=KO(()=>{let{skipCI:e,autoDeploy:t}=y9e();return typeof e==`boolean`||typeof t==`boolean`}),K8=KO(()=>{let{skipCI:e,autoDeploy:t}=y9e();return e===!0||t===!1}),q8=(e,t)=>{CW.devModeEnabled&&console.info(`deployPreview: ${e}`,(typeof t==`function`?t():t)??``)},J8=0,Y8=0,b9e=()=>{J8+=1},X8=()=>{let e=XJ.current?.repository?.branch??``,t=[],n=new Set,r=$G.current;return r&&(t.push({sha:r,branch:e,kind:`production`}),n.add(r)),lY.current.forEach(({workflow:{pullRequest:e}})=>{let{number:r,headSHA:i,branch:a}=e;r!==void 0&&i&&!n.has(i)&&(t.push({sha:i,branch:a,kind:`preview`}),n.add(i))}),t},Z8=KO(()=>X8()),Q8=()=>{let{show_preview_links:e=!0}=$O.current??{};return(e||G8.current)&&!!XJ.current?.fetchDeployments},x9e=e=>!!e&&e.state!==`checking`&&Date.now()-e.checkedTime<3e4,S9e=e=>{let t=QG.current,n=Object.fromEntries(e.filter(({sha:e})=>!t[e]).map(({sha:e})=>[e,{state:`checking`,checkedTime:0}]));Object.keys(n).length&&(QG.current={...t,...n})},C9e=()=>{S9e(X8())},$8=async({force:e=!1,pendingOnly:t=!1}={})=>{if(!Q8()){q8(`not looking anything up: the backend can’t report deployments, or preview links are off`);return}let n=XJ.current?.fetchDeployments,r=QG.current,i=X8().filter(({sha:n})=>{if(e)return!0;let i=r[n]?.state;return t?i!==`ready`&&i!==`error`:!x9e(r[n])});if(!i.length){q8(`nothing to look up`,()=>({tracked:X8(),known:r}));return}q8(`looking up`,i);let a=J8;Y8+=1;let o=Y8;S9e(i);let s;try{s=await n(i)}catch(e){console.error(`Failed to fetch the deployment info.`,e),s=Object.fromEntries(i.map(({sha:e})=>[e,{state:`unknown`,checkedTime:Date.now()}]))}a===J8?o===Y8?(q8(`resolved`,s),QG.current={...QG.current,...s}):q8(`discarding a result that a later lookup has superseded`,s):q8(`discarding a result that arrived after the lookup was cancelled`,s)},w9e=async()=>{let e=XJ.current?.fetchBranchHeadSHA;if(e)try{let t=await e()??``;q8(`tracking the branch head`,t),$G.current=t}catch(e){console.error(`Failed to fetch the branch head commit.`,e)}},T9e=async({head:e}={})=>{try{e&&XJ.current?.fetchBranchHeadSHA?(q8(`tracking the branch head`,e),$G.current=e):await w9e(),await $8()}catch(e){console.error(`Failed to look up the deployment info.`,e)}},E9e=e=>new TextEncoder().encode(JSON.stringify(e)).toBase64({alphabet:`base64url`,omitPadding:!0}),D9e=e=>{let t=Uint8Array.fromBase64(e.replaceAll(`+`,`-`).replaceAll(`/`,`_`),{alphabet:`base64url`}),n;try{n=new TextDecoder(`utf-8`,{fatal:!0}).decode(t)}catch{n=Array.from(t,e=>String.fromCharCode(e)).join(``)}return JSON.parse(n)},e5=WO([]),O9e=e=>{let t=e?QG.current[e]?.state:void 0;return t===`ready`||t===`unknown`},k9e=KO(()=>O9e($G.current)),A9e=KO(()=>{if(k9e.current)return[];let e=e5.current,t=e.findLastIndex(({sha:e})=>O9e(e));return t===-1?e:e.slice(t+1)}),j9e=e=>{let t=$G.current;if(!Q8()||!t)return;let{workflow:n}=e,{branch:r}=n.pullRequest;e5.current=[...A9e.current.filter(e=>e.entry.workflow.pullRequest.branch!==r),{entry:{...e,workflow:{...n,pullRequest:{...n.pullRequest,updatedDate:new Date}}},sha:t}]},M9e=()=>{e5.current=[]};JO(()=>{tK.current&&M9e()});var N9e=/^\/signin\/(?<encodedData>.+)/,t5=na({signInError:{message:``,context:`authentication`},unauthenticated:!0,signingIn:!1,magicLinkConfirmation:void 0}),P9e=()=>{CW.apiKeys={},delete CW.logins,delete CW.deployHookURL,delete CW.deployHookAuthHeader,delete CW.magicLinkAccount},n5=e=>{let{magicLinkAccount:t}=CW;t&&(t.backendName!==e?.backendName||t.id!==e?.id||t.login!==e?.login)&&P9e()},F9e=async()=>{n5(),await Promise.all([rD.set(`sveltia-cms.user`,{}),..._U.map(e=>rD.delete(e))]),vU.account=void 0,t5.unauthenticated=!0},I9e=async e=>{(typeof e?.cause?.status==`number`||e?.message===`Not a collaborator of the repository`)&&await F9e()},L9e=()=>{t5.signInError={message:``,context:`authentication`}},r5=(e,t=`authentication`)=>{let n=e.cause?.message||X(`unexpected_error`);e.name===`NotFoundError`&&(n=X(`sign_in_error.not_project_root`)),e.name===`AbortError`&&(n=X(YJ.current===`local`?`sign_in_error.picker_dismissed`:`sign_in_error.authentication_aborted`)),t5.signInError={message:n,context:t},console.error(e.name,e.message,e.cause)},R9e=()=>{let{path:e}=p$(),{encodedData:t}=e.match(N9e)?.groups??{};if(!t)return{_user:void 0,copiedPrefs:void 0};b$(``,{replaceState:!0});let n,r;try{let e=D9e(t);D(e)&&typeof e.token==`string`&&(n={token:e.token},D(e.prefs)&&(r=e.prefs))}catch{}return{_user:n,copiedPrefs:r}},z9e=async()=>{let e=e=>D(e)&&typeof e.backendName==`string`;return[`sveltia-cms.user`,..._U].reduce(async(t,n)=>{let r=await t;if(r)return r;let i=await rD.get(n);return e(i)?i:void 0},Promise.resolve(void 0))},B9e=e=>ZJ(e?.backendName===`local`||e?.backendName===`proxy`?`local`:$O.current.backend.name),V9e=async e=>{let t=B9e(void 0);if(!t)return;let n;t5.signingIn=!0;try{n=await t.signIn({token:e,auto:!0})}catch{}if(t5.signingIn=!1,!n)return;let r=n,i=await new Promise(e=>{t5.magicLinkConfirmation={account:r,resolve:e}});return t5.magicLinkConfirmation=void 0,i?n:void 0},H9e=(e,t)=>{n5(),`deployHookURL`in e&&delete CW.deployHookAuthHeader,Object.assign(CW,e,{magicLinkAccount:{backendName:t.backendName,id:t.id,login:t.login}})},U9e=async e=>{let t=OG(),n=!e.repository||e.repository.branch?e9e():void 0;await e.fetchFiles(),t()||(await t9e(n),t()||(T9e({head:EG.current}),f9e()))},W9e=async()=>{L9e();let{_user:e,copiedPrefs:t}=R9e(),n=e?await V9e(e.token):void 0,r=!!n;n??=await z9e();let i=B9e(n);if(n){if(!r&&i){vU.account=n;let{token:e,refreshToken:t}=n;t5.signingIn=!0;try{n=await i.signIn({token:e,refreshToken:t,auto:!0})}catch{n=void 0,vU.account=void 0}}if(t5.signingIn=!1,t5.unauthenticated=!n,n&&i){vU.account=n,r&&t?H9e(t,vU.account):n5(vU.account);try{await U9e(i)}catch(e){[401,403,404].includes(e.cause?.status)?t5.unauthenticated=!0:r5(e,`dataFetch`),await I9e(e)}}}},i5=async(e,t)=>{L9e();let n=ZJ(e);if(!n)return;let r;vU.account=void 0,t5.signingIn=!0;try{r=await n.signIn({token:t,auto:!1})}catch(e){t5.signingIn=!1,t5.unauthenticated=!0,t&&e.cause?.status===401?r5(Error(`Invalid token`,{cause:{message:X(`sign_in_error.invalid_token`)}})):r5(e);return}if(t5.signingIn=!1,t5.unauthenticated=!r,r){n5(r),vU.account=r;try{await U9e(n)}catch(e){r5(e,`dataFetch`),await I9e(e)}}},G9e=async()=>{p9e(),DG.current+=1;try{await XJ.current?.signOut()}catch(e){console.error(e)}await F9e(),P9e(),ZJ(void 0),QA.current=!1,NL.clear(),EG.current=``,kB.current=void 0,AB.current=void 0,lY.current=[],dY.current=!1,fY.current=[],LB.current?.respond(!1),MB.current=void 0,PB.current=!1,M9e(),JIe(),v9e();let e=$O.current?.logout_redirect_url;e&&(window.location.href=e)},K9e=(e,t)=>{let{name:n}=e,r=n===`test-repo`,{auth_methods:i}=e,a=e,o=UW(n);return{serviceLabel:o&&jG(a)===`https://codeberg.org`?`Codeberg`:t,tokenOptionHidden:!r&&i?.includes(`token`)===!1,oauthOptionHidden:!r&&i?.includes(`oauth`)===!1,oauthOptionDisabled:o&&!a.app_id}},q9e=V(`<div role="alert" class="message svelte-1ff54ya"> </div> <!>`,1),J9e=V(`<div role="alert" class="svelte-1ff54ya"><!></div>`),Y9e=V(`<div role="none"><!></div>`),X9e=V(`<!> <!> <!>`,1),Z9e=V(`<div role="alert" class="svelte-1ff54ya"> </div>`),Q9e=V(`<!> <!>`,1),$9e=V(`<div role="alert" class="error iconic svelte-1ff54ya"><!> </div>`),eet=V(` <!> <!>`,1),tet=V(`<div role="none" class="buttons svelte-1ff54ya"><!> <!></div> <!> <!>`,1),net={hash:`svelte-1ff54ya`,code:`.buttons.svelte-1ff54ya {display:flex;flex-direction:column;align-items:center;gap:12px;.button {width:320px;}}[role='alert'].svelte-1ff54ya {&.iconic {display:flex;align-items:center;gap:8px;}&.error {color:var(--sui-error-foreground-color);}}`};function ret(e,t){k(t,!0),q(e,net);let n=M(!1),r=M(``),i=j(()=>$O.current?.backend),a=j(()=>B(i).name),o=j(()=>JJ[B(a)]),s=j(()=>B(a)===`test-repo`),c=j(()=>GJ(B(a))),l=j(()=>B(s)&&!sW.isTestBackendSupported),u=j(()=>B(i).repo?.split(`/`).pop()),d=j(()=>sW.isLocalHost&&!B(s)),f=j(()=>B(r).trim()),p=j(()=>B(a)===`github`&&gq($O.current)),m=j(()=>K9e(B(i),B(o)?.label)),h=j(()=>B(m).serviceLabel),g=j(()=>B(m).tokenOptionHidden),_=j(()=>B(m).oauthOptionHidden),v=j(()=>B(m).oauthOptionDisabled),y=j(()=>{let{login:e,name:t}=t5.magicLinkConfirmation?.account??{};return e||t||``});vs(()=>{!t5.signInError.message&&!t5.signingIn&&W9e()});var b=tet(),x=F(b),S=P(x),C=e=>{var t=q9e(),n=F(t),r=I(n,!0),i=L(n,2),a=e=>{{let t=j(()=>X(`cancel`));ll(e,{variant:`secondary`,get label(){return B(t)},get onclick(){return GW.current}})}};K(i,e=>{GW.current&&e(a)}),z(e=>G(r,e),[()=>X(`signing_in`)]),W(e,t)},w=e=>{var t=X9e(),r=F(t),i=e=>{var t=X9e(),n=F(t);{let e=j(()=>X(`work_with_local_repo`)),t=j(()=>!sW.isLocalBackendSupported);ll(n,{variant:`primary`,get label(){return B(e)},get disabled(){return B(t)},onclick:async()=>{await i5(`local`)}})}var r=L(n,2),i=e=>{var t=J9e(),n=P(t),r=e=>{var t=U();Ho(F(t),()=>$k(X(`local_workflow.disabled`),`https://sveltiacms.app/en/docs/workflows/local#enabling-file-system-access-api-in-brave`)),W(e,t)},i=e=>{var t=H();z(e=>G(t,e),[()=>X(`local_workflow.unsupported_browser`)]),W(e,t)};K(n,e=>{sW.isBrave?e(r):e(i,-1)}),O(t),W(e,t)},a=e=>{var t=Y9e(),n=P(t),r=e=>{var t=H();z(e=>G(t,e),[()=>X(`work_with_local_repo_description`,{values:{repo:B(u)}})]),W(e,t)},i=e=>{var t=H();z(e=>G(t,e),[()=>X(`work_with_local_repo_description_no_repo`)]),W(e,t)};K(n,e=>{B(u)?e(r):e(i,-1)}),O(t),W(e,t)};K(r,e=>{sW.isLocalBackendSupported?t5.signInError.message||e(a,1):e(i)}),Ml(L(r,2),{}),W(e,t)};K(r,e=>{B(d)&&e(i)});var o=L(r,2),f=e=>{var t=Q9e(),n=F(t);{let e=j(()=>B(d)?`secondary`:`primary`),t=j(()=>B(c)?X(`start_demo`):B(s)?X(`work_with_test_repo`):X(`sign_in_with_x`,{values:{service:B(h)}})),r=j(()=>B(v)||B(l));ll(n,{get variant(){return B(e)},get label(){return B(t)},get disabled(){return B(r)},onclick:async()=>{await i5(B(a))}})}var r=L(n,2),i=e=>{var t=Z9e(),n=I(t,!0);z(e=>G(n,e),[()=>X(`test_repo_unsupported_browser`)]),W(e,t)};K(r,e=>{B(l)&&e(i)}),W(e,t)};K(o,e=>{B(_)||e(f)});var p=L(o,2),m=e=>{{let t=j(()=>X(`sign_in_using_access_token`,{values:{service:B(h)}}));ll(e,{variant:`secondary`,get label(){return B(t)},onclick:()=>{N(n,!0)}})}};K(p,e=>{!B(s)&&!B(g)&&e(m)}),W(e,t)};K(S,e=>{t5.signingIn?e(C):B(o)&&e(w,1)});var T=L(S,2),ee=e=>{var t=$9e(),n=P(t);Lc(n,{name:`error`});var r=L(n);O(t),z(()=>G(r,` ${t5.signInError.message??``}`)),W(e,t)};K(T,e=>{t5.signInError.message&&t5.signInError.context===`authentication`&&e(ee)}),O(x);var E=L(x,2);{let e=j(()=>X(`sign_in_using_access_token`)),t=j(()=>({spellcheck:!1,ariaLabel:X(`personal_access_token`)})),i=j(()=>X(`sign_in`)),s=j(()=>!B(f));Kl(E,{get title(){return B(e)},get textboxAttrs(){return B(t)},get okLabel(){return B(i)},get okDisabled(){return B(s)},onOk:()=>{i5(B(a),B(f))},onkeydown:e=>{!e.isComposing&&e.key===`Enter`&&B(f)&&(e.preventDefault(),N(n,!1),i5(B(a),B(f)))},get open(){return B(n)},set open(e){N(n,e,!0)},get value(){return B(r)},set value(e){N(r,e,!0)},children:(e,t)=>{$r();var n=eet(),r=F(n),i=L(r),a=e=>{var t=H();z(e=>G(t,e),[()=>X(`sign_in_using_access_token_workflow_note`)]),W(e,t)};K(i,e=>{B(p)&&e(a)});var s=L(i,2),c=e=>{var t=U();Ho(F(t),()=>$k(X(`sign_in_using_access_token_link`,{values:{service:B(h)}}),B(o).repository.tokenPageURL)),W(e,t)};K(s,e=>{B(o)?.repository?.tokenPageURL&&e(c)}),z(e=>G(r,`${e??``} `),[()=>X(`sign_in_using_access_token_description`)]),W(e,n)},$$slots:{default:!0}})}var te=L(E,2);{let e=j(()=>!!t5.magicLinkConfirmation),t=j(()=>X(`sign_in_with_link`)),n=j(()=>X(`sign_in`));Il(te,{get open(){return B(e)},get title(){return B(t)},get okLabel(){return B(n)},onOk:()=>{t5.magicLinkConfirmation?.resolve(!0)},onClose:()=>{t5.magicLinkConfirmation?.resolve(!1)},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`sign_in_with_link_confirmation`,{values:{account:B(y),service:B(h)}})]),W(e,n)},$$slots:{default:!0}})}W(e,b),A()}var iet=/^data:(image\/[a-zA-Z0-9.+-]+);base64,/,aet=`data:image/svg+xml;base64,${btoa(`<svg viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="400" x2="400" y1="0" y2="800"><stop offset="0" stop-color="#f0980b"/><stop offset="1" stop-color="#ff1d00"/></linearGradient><clipPath id="b"><rect height="800" rx="80" width="800"/></clipPath><rect fill="url(#a)" height="800" rx="80" width="800"/><g style="clip-path:url(#b);fill:none;stroke:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-width:180"><path d="m320-80-200 320 200 320-200 320"/><path d="m400 240 200 320 200-320"/></g></svg>`)}`,a5=KO(()=>$O.current?.app_title||`Sveltia CMS`),o5=KO(()=>$O.current?.logo?.src||$O.current?.logo_url||aet),oet=KO(()=>{let e=o5.current,t=e.match(iet);return t?t[1]:lV.getType(e)??void 0}),set=async(e,t)=>{let n=await NV(e,t),r=await Sk(n);return`data:${n.type};base64,${r}`},s5=WO();JO(()=>{let e=!1,t=o5.current;return(async()=>{let n;try{let e=await fetch(t);if(!e.ok)throw Error(`Failed to fetch logo`);let r=await e.blob(),[i,a]=await Promise.all([set(r,{...MV,width:192,height:192}),set(r,MV)]);n={small:i,large:a}}catch{n=void 0}e||(s5.current=n)})(),()=>{e=!0}});var cet=KO(()=>{let e=a5.current,t=s5.current;if(!t)return;let{origin:n,pathname:r}=window.location,i=t.small.match(iet)[1],a={name:e,short_name:e,start_url:`${n}${r}`,display:`standalone`,icons:[{src:t.small,sizes:`192x192`,type:i},{src:t.large,sizes:`512x512`,type:i}]},o=new Blob([JSON.stringify(a)],{type:`application/manifest+json`});return URL.createObjectURL(o)}),c5=WO([{name:`Uint8Array Base64/hex conversion`,test:()=>typeof Uint8Array.fromBase64==`function`&&typeof Uint8Array.prototype.toHex==`function`},{name:`Iterator helpers`,test:()=>typeof globalThis.Iterator==`function`&&typeof globalThis.Iterator.prototype.map==`function`}].filter(({test:e})=>!e()).map(({name:e})=>e)),uet=(e,t=jr)=>{var n=U();Ho(F(n),()=>eA(t(),{allowedTags:[`a`,`code`]})),W(e,n)},det=V(`<img alt="" class="logo svelte-7ua6x9"/> <h1 class="svelte-7ua6x9"> </h1>`,1),l5=V(`<div role="alert" class="message"> </div>`),fet=V(`<li><!></li>`),pet=V(`<div role="alert" class="message"><div role="none"> </div> <ul class="error svelte-7ua6x9"></ul></div>`),met=V(`<div role="alert"><div role="none" class="message"> </div> <div role="none" class="error svelte-7ua6x9"><!></div></div>`),het=V(`<!> <!>`,1),get=V(`<div role="alert" class="message"> </div> <!>`,1),_et=V(`<div role="none" class="powered-by svelte-7ua6x9"> </div>`),vet=V(`<div role="none" class="container svelte-7ua6x9"><div role="none" class="inner svelte-7ua6x9"><!> <!></div></div> <!>`,1),yet={hash:`svelte-7ua6x9`,code:`.container.svelte-7ua6x9 {position:absolute;inset:0;z-index:101;flex:auto;display:flex;justify-content:center;align-items:center;gap:16px;padding:32px;.inner:where(.svelte-7ua6x9) {display:flex;flex-direction:column;align-items:center;gap:32px;min-width:240px;max-width:800px;min-height:240px;}.logo:where(.svelte-7ua6x9) {width:auto;height:160px;
|
||
|
||
@media (width < 768px) {height:120px;
|
||
}}h1:where(.svelte-7ua6x9) {font-size:48px;}.logo:where(.svelte-7ua6x9) ~ h1:where(.svelte-7ua6x9) {font-size:var(--sui-font-size-xxx-large);}.error:where(.svelte-7ua6x9) {border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);text-align:center;-webkit-user-select:text;user-select:text;cursor:text;}
|
||
/* \`<SignIn>\` also has \`.message\` */.message {margin:0 0 16px;font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-normal);text-align:center;ul {margin:12px 0 0;padding:0;max-height:160px;overflow-y:auto;list-style:none;}li {margin:12px;padding:0;}}}.powered-by.svelte-7ua6x9 {position:absolute;inset:auto 24px 24px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);text-align:center;}`};function bet(e,t){k(t,!0),q(e,yet);let n=j(()=>!!c5.current.length),r=j(()=>!!t5.signInError.message&&t5.signInError.context===`dataFetch`);R(()=>{rk.current&&(u$.current=X(`welcome_message`,{values:{name:a5.current}}))});var i=vet(),a=F(i),o=P(a),s=P(o),c=e=>{var t=det(),n=F(t),r=I(L(n,2),!0);z(()=>{J(n,`src`,o5.current),G(r,a5.current)}),W(e,t)};K(s,e=>{(rk.current||B(n))&&e(c)});var l=L(s,2),u=e=>{var t=l5(),n=I(t,!0);z(e=>G(n,e),[()=>X(`unsupported_browser_error`)]),W(e,t)},d=e=>{var t=pet(),n=P(t),r=I(n,!0),i=L(n,2);Ro(i,20,()=>nk.current,e=>e,(e,t)=>{var n=fet();uet(P(n),()=>t),O(n),W(e,n)}),O(i),O(t),z(e=>G(r,e),[()=>X(`config.errors`,{values:{count:nk.current.length}})]),W(e,t)},f=e=>{var t=l5(),n=I(t,!0);z(e=>G(n,e),[()=>X(`prefs.error.${SW.current.type}`)]),W(e,t)},p=e=>{var t=l5(),n=I(t,!0);z(e=>G(n,e),[()=>X(`loading_cms_config`)]),W(e,t)},m=j(()=>!$O.current||!Object.keys(CW).length),h=e=>{var t=het(),n=F(t),i=e=>{var t=met(),n=P(t),r=I(n,!0),i=L(n,2);uet(P(i),()=>t5.signInError.message),O(i),O(t),z(e=>G(r,e),[()=>X(`loading_site_data_error`)]),W(e,t)};K(n,e=>{B(r)&&e(i)}),ret(L(n,2),{}),W(e,t)},g=e=>{var t=l5(),n=I(t,!0);z(e=>G(n,e),[()=>X(`authorizing`)]),W(e,t)},_=e=>{var t=get(),n=F(t),r=I(n,!0),i=L(n,2),a=e=>{Soe(e,{get now(){return $A.current}})};K(i,e=>{$A.current!==void 0&&e(a)}),z(e=>G(r,e),[()=>X(`loading_site_data`)]),W(e,t)};K(l,e=>{B(n)?e(u):nk.current.length?e(d,1):SW.current?e(f,2):B(m)?e(p,3):B(r)||!WW.current&&(!vU.account||t5.unauthenticated)?e(h,4):WW.current?e(g,5):QA.current||e(_,6)}),O(o),O(a);var v=L(a,2),y=e=>{var t=_et(),n=I(t,!0);z(e=>G(n,e),[()=>X(`powered_by`,{values:{name:`Sveltia CMS`}})]),W(e,t)};K(v,e=>{rk.current&&a5.current!==`Sveltia CMS`&&e(y)}),W(e,i),A()}var xet=V(`<div role="none" class="preview svelte-di72gm"> </div>`),Cet=V(`<!> <!>`,1),wet={hash:`svelte-di72gm`,code:`.preview.svelte-di72gm {margin:8px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);overflow-wrap:anywhere;}`};function Tet(e,t){let n=Co();k(t,!0),q(e,wet);let r=j(()=>M4.current),i=j(()=>!!B(r)),a=!1,o=j(()=>B(r).mode),s=j(()=>B(r).defaultMessage),c=j(()=>B(r).initialValue),l=j(()=>{let e=B(c).trim();return e?B(o)===`prefix`?`${e} ${B(s)}`:`${B(s)} ${e}`:B(s)});{let t=e=>{var t=Cet(),r=F(t);{let e=j(()=>X(B(o)===!0?`commit_message.message`:`commit_message.addition`)),t=j(()=>B(o)===!0?void 0:`${n}-preview`);Gl(r,{dir:`auto`,flex:!0,autofocus:!0,get ariaLabel(){return B(e)},get"aria-describedby"(){return B(t)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(e.preventDefault(),a=!0,N(i,!1))},get value(){return B(c)},set value(e){N(c,e)}})}var s=L(r,2),u=e=>{var t=xet(),r=I(t,!0);z(e=>{J(t,`id`,`${n}-preview`),G(r,e)},[()=>X(`commit_message.preview`,{values:{message:B(l)}})]),W(e,t)};K(s,e=>{B(o)!==!0&&e(u)}),W(e,t)},s=j(()=>X(`commit_message.title`));Kl(e,{get title(){return B(s)},onOk:()=>{B(r)?.respond(B(c))},onClose:()=>{B(r)?.respond(a?B(c):null),a=!1},get open(){return B(i)},set open(e){N(i,e)},input:t,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(B(o)===!0?`commit_message.description_replace`:`commit_message.description_addition`)]),W(e,n)},$$slots:{input:!0,default:!0}})}A()}var Eet=V(` <!>`,1),Det=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Oet(e,t){k(t,!0);let n=0,r=M(`none`),i=async()=>{XJ.current?.checkStatus&&N(r,await XJ.current.checkStatus(),!0)},a=()=>{window.clearInterval(n),i(),n=window.setInterval(()=>{i()},3e5)},o=()=>{window.clearInterval(n),N(r,`none`)},s=()=>{XJ.current?.checkStatus&&!XJ.current.repository?.isSelfHosted?a():o()};vs(()=>()=>{o()}),R(()=>{XJ.current,$O.current,s()});var c=U(),l=F(c),u=e=>{var t=Det(),n=F(t);{let e=j(()=>B(r)===`major`?`error`:`warning`);Po(n,()=>({"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{get status(){return B(e)},children:(e,t)=>{$r();var n=Eet(),i=F(n),a=L(i);{let e=j(()=>X(`details`));ll(a,{variant:`link`,get label(){return B(e)},onclick:()=>{hB(XJ.current?.statusDashboardURL)}})}z(e=>G(i,`${e??``} `),[()=>X(`backend_status.${B(r)}_incident`,{values:{service:XJ.current?.label}})]),W(e,n)},$$slots:{default:!0}}),O(n)}W(e,t)},d=j(()=>[`minor`,`major`].includes(B(r)));K(l,e=>{B(d)&&e(u)}),W(e,c),A()}var ket=`https://unpkg.com/@sveltia/cms/package.json`,Aet=`https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js`,jet=async()=>{try{let e=await fetch(ket);if(!e.ok)return;let{version:t}=await e.json();return typeof t==`string`&&t?t:void 0}catch{return}},Met=e=>{let t=e.split(`.`).map(Number),n=xr.split(`.`).map(Number),r=t.findIndex((e,t)=>e!==(n[t]??0));return r>-1&&t[r]>(n[r]??0)},Net=async()=>{let e=await jet();return!e||!Met(e)?!1:document.querySelector(`script[src="${Aet}"]`)?!0:(console.warn(`[Sveltia CMS] A new version (${e}) is available. You are using version ${xr}. Update the pinned version in your script tag or package.json to upgrade.`),!1)},Pet=V(` <!>`,1),Fet=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Iet(e,t){k(t,!0);let n=0,r=0,i=M(!1),a=async()=>{await Net()&&(r=window.setTimeout(()=>{N(i,!0)},6e5))},o=()=>{window.location.reload()};vs(()=>(a(),n=window.setInterval(()=>{a()},36e5),()=>{window.clearInterval(n),window.clearTimeout(r)}));var s=U(),c=F(s),l=e=>{var t=Fet(),n=F(t);Po(n,()=>({"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{children:(e,t)=>{$r();var n=Pet(),r=F(n),i=L(r);{let e=j(()=>X(`update_now`));ll(i,{variant:`link`,get label(){return B(e)},onclick:o})}z(e=>G(r,`${e??``} `),[()=>X(`update_available`)]),W(e,n)},$$slots:{default:!0}}),O(n),W(e,t)};K(c,e=>{B(i)&&e(l)}),W(e,s),A()}var Let={create:`New`,select:`Select`,select_all:`Select All`,select_item:`Select {$name}`,upload:`Upload`,copy:`Copy`,download:`Download`,duplicate:`Duplicate`,delete:`Delete`,reorder:`Reorder`,cancel:`Cancel`,done:`Done`,save:`Save`,saving:`Saving…`,publish:`Publish`,publishing:`Publishing…`,rename:`Rename`,update:`Update`,replace:`Replace`,add:`Add`,remove:`Remove`,clear:`Clear`,expand:`Expand`,expand_all:`Expand All`,collapse:`Collapse`,collapse_all:`Collapse All`,insert:`Insert`,restore:`Restore`,discard:`Discard`,searching:`Searching…`,no_results:`No results found.`,global:`Global`,primary:`Primary`,secondary:`Secondary`,collection:`Collection`,folder:`Folder`,folders:`Folders`,more_folders:`More Folders`,api_key:`API Key`,details:`Details`,back:`Back`,automatic:`Automatic`,loading:`Loading…`,later:`Later`,slug:`Slug`,singleton:`Singleton`,singletons:`Singletons`,clipboard_error:`Couldn’t copy to clipboard.`,welcome_message:`Welcome to {$name}`,powered_by:`Powered by {$name}`,unsupported_browser_error:`Your browser is not supported. Please update it to the latest version or use another browser.`,loading_cms_config:`Loading CMS Configuration…`,loading_site_data:`Loading Site Data…`,loading_site_data_error:`There was an error while loading site data.`,sign_in_with_x:`Sign In with {$service}`,sign_in_using_access_token:`Sign In Using Access Token`,sign_in_using_access_token_description:`Enter your token below. It must have read/write access to the repository content.`,sign_in_using_access_token_workflow_note:`Since Editorial Workflow is enabled, it must also have read/write access to pull requests.`,sign_in_using_access_token_link:`You can generate a token on the <a>{$service} user settings page</a>.`,personal_access_token:`Personal Access Token`,authorizing:`Authorizing…`,signing_in:`Signing in…`,work_with_local_repo:`Work with Local Repository`,work_with_local_repo_description:`Once prompted, select the root directory of the “{$repo}” repository.`,work_with_local_repo_description_no_repo:`Once prompted, select the root directory of your Git repository.`,work_with_test_repo:`Work with Test Repository`,start_demo:`Start Demo`,test_repo_unsupported_browser:`Your browser can’t save the files of the test repository. Please update it to the latest version or use another browser.`,sign_in_error:{not_project_root:`The selected folder is not a repository root directory. Please try again.`,picker_dismissed:`A repository root directory could not be selected. Please try again.`,authentication_aborted:`Authentication aborted. Please try again.`,invalid_token:`The provided token is invalid. Please check and try again.`,UNSUPPORTED_BACKEND:`Your Git backend is not supported by the authenticator.`,UNSUPPORTED_DOMAIN:`Your domain is not allowed to use the authenticator.`,MISCONFIGURED_CLIENT:`OAuth app client ID or secret is not configured.`,AUTH_CODE_REQUEST_FAILED:`Failed to receive an authorization code. Please try again later.`,CSRF_DETECTED:`Potential CSRF attack detected. Authentication flow aborted.`,TOKEN_REQUEST_FAILED:`Failed to request an access token. Please try again later.`,TOKEN_REFRESH_FAILED:`Failed to refresh the access token. Please try again later.`,MALFORMED_RESPONSE:`Server responded with malformed data. Please try again later.`},backend_unsupported_version:`The {$name} backend requires {$name} {$version} or later.`,repository_no_access:`You don’t have access to the “{$repo}” repository.`,repository_no_write_access:`You don’t have write access to the “{$repo}” repository.`,repository_not_found:`The “{$repo}” repository doesn’t exist.`,repository_empty:`The “{$repo}” repository has no branches.`,branch_not_found:`The “{$repo}” repository doesn’t have the “{$branch}” branch.`,root_dir_not_found:`The root directory “{$dir}” doesn’t exist in the “{$repo}” repository.`,unexpected_error:`Unexpected Error`,page_crashed:`Something went wrong, and this page can’t be displayed. {$message}`,field_crashed:`Something went wrong, and this field can’t be displayed. {$message}`,try_again:`Try Again`,reload_cms:`Reload CMS`,entry_parse_errors:`.input {$count :integer} .match $count one {{There was an error while parsing an entry file. Check the browser console for details.}} * {{There were errors while parsing entry files. Check the browser console for details.}}`,username:`Username`,password:`Password`,sign_in:`Sign In`,sign_in_with_mobile:`Sign In with Mobile`,sign_in_with_mobile_instruction:`Scan the QR code below with your phone or tablet for passwordless sign-in. Your settings will be automatically copied.`,sign_in_with_link:`Sign In with Link`,sign_in_with_link_confirmation:`This link signs you in as {$account} on {$service} and copies the settings from the device it was created on. Continue only if you created the link yourself.`,signed_in_as_x:`Signed In as {$name}`,working_with_local_repo:`Working with Local Repository`,working_with_test_repo:`Working with Test Repository`,working_in_demo_mode:`Demo Mode`,demo_welcome:{title:`Welcome to Sveltia CMS Demo`,description:`Feel free to explore the CMS and edit the sample content. Your changes are only saved in this browser. Nothing is published online, and no one else can see them.`,reset_hint:`To start over with the original content, select Erase All Data under Settings > Data Management.`,button_label:`Get Started`},sign_out:`Sign Out`,install_as_app:`Install as App`,contents:`Contents`,assets:`Assets`,editorial_workflow:`Editorial Workflow`,drafts:`Drafts`,cms_config:`CMS Configuration`,menu:`Menu`,custom_pages:`Pages`,mobile_promo_title:`Sveltia CMS is now available on mobile!`,mobile_promo_button:`Give it a try`,new_language_available:`Sveltia CMS is now available in {$locale}!`,change_language:`Change Language`,live_reload_warning:`Your development server reloads this page whenever a file changes, which can interrupt saving and leave your files broken. Serve the CMS from a static HTML file instead. <a>Learn more</a>`,switching_language:`Switching to {$locale}…`,locale_load_failed:`Couldn’t load the {$locale} translation. Please try again later.`,local_git_not_committed:`Your changes have been saved but not committed to Git. {$reason} To only save the files, turn off Git commits under Settings > Developer.`,local_git_skip_reasons:{unsupported_repository:`Your repository uses a Git feature the CMS doesn’t support, such as a linked worktree, SHA-256 object names, the reftable format, a sparse index, or an index in version 3 or 4, which the feature.manyFiles option and git add -N use.`,missing_identity:`Your name and email address aren’t set in the repository’s Git configuration, and the CMS can’t read your global one. Set them in the repository with git config --local user.name "Your Name" and git config --local user.email "you@example.com".`,locked:`Another Git process is using the repository. If none is running, delete the .git/index.lock file.`,operation_in_progress:{merge:`A merge is in progress. Finish it with git commit, or cancel it with git merge --abort.`,rebase:`A rebase is in progress. Finish it with git rebase --continue, or cancel it with git rebase --abort. If you’ve moved on, git rebase --quit drops it without changing your files.`,cherry_pick:`A cherry-pick is in progress. Finish it with git cherry-pick --continue, or cancel it with git cherry-pick --abort.`,revert:`A revert is in progress. Finish it with git revert --continue, or cancel it with git revert --abort.`,am:`Applying patches with git am is in progress. Finish it with git am --continue, or cancel it with git am --abort.`,conflict:`Some files have conflicts. Resolve them and stage the results first.`},detached_head:`No branch is checked out.`,staged_changes:`You have other changes staged for commit. Commit or unstage them first.`,lfs:`{$path} is tracked with Git LFS, which the CMS can’t commit to.`,error:`An unexpected error occurred. {$message}`},visit_live_site:`Visit Live Site`,switch_page:`Switch Page`,search_placeholder_contents:`Search for contents…`,search_placeholder_assets:`Search for assets…`,search_placeholder_all:`Search for contents and assets…`,create_entry_or_assets:`Create Entry or Assets`,publish_changes:`Publish Changes`,publishing_changes:`Publishing Changes…`,publishing_changes_failed:`Couldn’t publish changes. Please try again.`,show_notifications:`Show Notifications`,notifications:`Notifications`,show_account_menu:`Show Account Menu`,account:`Account`,live_site:`Live Site`,git_repository:`Git Repository`,settings:`Settings`,show_help_menu:`Show Help Menu`,help:`Help`,keyboard_shortcuts:`Keyboard Shortcuts`,documentation:`Documentation`,release_notes:`Release Notes`,announcements:`Announcements`,version_x:`Version {$version}`,report_issue:`Report Issue`,share_feedback:`Share Feedback`,get_help:`Get Help`,donate:`Donate`,join_discord:`Join Us on Discord`,bluesky:`Follow Us on Bluesky`,update_available:`The latest version of Sveltia CMS is available.`,update_now:`Update Now`,backend_status:{minor_incident:`{$service} is experiencing a minor incident. Your workflow may be affected.`,major_incident:`{$service} is experiencing a major incident. You may want to wait until the situation has improved.`},content_library:`Content Library`,asset_library:`Asset Library`,collections:`Collections`,entries:`Entries`,files:`Files`,asset_location:{repository:`Your Site`,external:`External Locations`,stock_photos:`Stock Photos`},collection_assets:`Collection Assets`,entry_list:`Entry List`,file_list:`File List`,asset_list:`Asset List`,x_collection:`{$collection} Collection`,x_asset_folder:`{$folder} Asset Folder`,viewing_collection_list:`You’re now viewing the collection list.`,viewing_asset_folder_list:`You’re now viewing the asset folder list.`,viewing_x_collection:`.input {$count :integer} .match $count 0 {{You’re now viewing the “{$collection}” collection, which has no entries yet.}} one {{You’re now viewing the “{$collection}” collection, which has one entry.}} * {{You’re now viewing the “{$collection}” collection, which has {$count} entries.}}`,viewing_x_asset_folder:`.input {$count :integer} .match $count 0 {{You’re now viewing the “{$folder}” asset folder, which has no assets yet.}} one {{You’re now viewing the “{$folder}” asset folder, which has one asset.}} * {{You’re now viewing the “{$folder}” asset folder, which has {$count} assets.}}`,viewing_x_external_location:`You’re now viewing the assets on {$service}.`,singleton_selected_announcement:`Press Enter to edit the “{$file}” file.`,page_not_found:`Page not found.`,collection_not_found:`Collection not found.`,asset_folder_not_found:`Asset folder not found.`,file_not_found:`File not found.`,x_of_x_selected:`{$selected} of {$total} selected`,switch_view:`Switch View`,table_view:`Table View`,list_view:`List View`,grid_view:`Grid View`,switch_to_list_view:`Switch to List View`,switch_to_grid_view:`Switch to Grid View`,sort:`Sort`,sorting_options:`Sorting Options`,table_column_keys:{dirname:`Folder`,filename:`File Name`,extension:`Extension`,locales:`Languages`},sort_keys:{none:`None`,name:`Name`,slug:`Slug`,commit_author:`Updated by`,commit_date:`Updated on`,last_modified:`Modified on`,size:`Size`,_summary:`Summary`,_manual:`Manual`},ascending:`{$label}, A to Z`,ascending_date:`{$label}, old to new`,descending:`{$label}, Z to A`,descending_date:`{$label}, new to old`,ascending_number:`{$label}, small to large`,descending_number:`{$label}, large to small`,filter:`Filter`,filtering_options:`Filtering Options`,group:`Group`,grouping_options:`Grouping Options`,type:`Type`,all:`All`,domain:`Domain`,image:`Image`,video:`Video`,audio:`Audio`,document:`Document`,other:`Other`,show_assets:`Show Assets`,hide_assets:`Hide Assets`,show_info:`Show Info`,hide_info:`Hide Info`,all_assets:`All Assets`,global_assets:`Global Assets`,linked_files:`Linked Files`,file_unavailable:`Unavailable`,file_unavailable_description:`This file couldn’t be loaded. It may have been moved or deleted.`,loading_entries:`.input {$count :integer} .match $count one {{Loading entry…}} * {{Loading entries…}}`,entry_not_found:`Entry not found.`,creating_entries_disabled_by_admin:`Creating new entries in this collection is disabled by the administrator.`,creating_entries_disabled_by_quota:`.input {$quota :integer} .match $quota one {{You cannot add new entries to this collection because it has reached its limit of {$quota} entry.}} * {{You cannot add new entries to this collection because it has reached its limit of {$quota} entries.}}`,creating_entries_nearing_quota:`.input {$quota :integer} .input {$remaining :integer} .match $quota $remaining one one {{This collection is nearing its limit of {$quota} entry. You can only create {$remaining} more entry.}} one * {{This collection is nearing its limit of {$quota} entry. You can only create {$remaining} more entries.}} * one {{This collection is nearing its limit of {$quota} entries. You can only create {$remaining} more entry.}} * * {{This collection is nearing its limit of {$quota} entries. You can only create {$remaining} more entries.}}`,readonly_cms:`The CMS is in read-only mode. You can view content and assets but cannot make any changes.`,readonly_collection:`This collection is read-only. You can view its content but cannot make any changes.`,readonly_entry:`This entry is read-only. You can view it but cannot make any changes.`,readonly_asset_folder:`This folder is read-only. You can view its assets but cannot make any changes.`,readonly_branch:`You don’t have permission to push to the “{$branch}” branch. You can view this content but cannot make any changes.`,readonly_reference:`The entry is read-only, so the reference can’t be removed.`,cannot_rename_referenced_entry:`This entry can’t be renamed, because the following read-only entries refer to it by its current name: {$entries}.`,cannot_move_referenced_asset:`This asset can’t be moved or renamed, because the following read-only entries use it: {$entries}.`,back_to_collection:`Back to Collection`,collection_list:`Collection List`,back_to_collection_list:`Back to Collection List`,asset_folder_list:`Asset Folder List`,back_to_asset_folder_list:`Back to Asset Folder List`,back_to_parent_folder:`Back to Parent Folder`,search_results:`Search Results`,search_results_for_x:`Search Results for “{$terms}”`,viewing_entry_search_results:`.input {$count :integer} .match $count 0 {{You’re now viewing search results for “{$terms}”. We couldn’t find any entries.}} one {{You’re now viewing search results for “{$terms}”. We’ve found one entry.}} * {{You’re now viewing search results for “{$terms}”. We’ve found {$count} entries.}}`,viewing_asset_search_results:`.input {$count :integer} .match $count 0 {{You’re now viewing search results for “{$terms}”. We couldn’t find any assets.}} one {{You’re now viewing search results for “{$terms}”. We’ve found one asset.}} * {{You’re now viewing search results for “{$terms}”. We’ve found {$count} assets.}}`,x_entries:`.input {$count :integer} .match $count 0 {{No entries}} one {{{$count} entry}} * {{{$count} entries}}`,x_assets:`.input {$count :integer} .match $count 0 {{No assets}} one {{{$count} asset}} * {{{$count} assets}}`,no_files_found:`No files found.`,no_entries_found:`No entries found.`,upload_assets:`Upload New Assets`,new_folder:`New Folder`,new_folder_name:`Folder Name`,new_folder_create:`Create`,new_folder_description:`The new folder will be created in “{$folder}”.`,new_folder_error:{empty:`The folder name cannot be empty.`,invalid:`The folder name cannot contain slashes or start with a dot.`,reserved:`The files in a folder with this name are read-only, as the CMS itself is usually served from it.`,duplicate:`A folder or file with this name already exists here.`},creating_folder:`Creating the folder…`,creating_folder_failed:`Couldn’t create the folder.`,folder_options:`Folder Options`,show_folder_options:`Show Folder Options`,rename_folder:`Rename Folder`,delete_folder:`Delete Folder`,enter_new_name_for_folder:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. The asset in the folder will be moved along, and any entry using it will be updated.}} * {{Enter a new name below. The {$count} assets in the folder will be moved along, and any entries using them will be updated.}}`,enter_new_name_for_external_folder:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. The file in the folder will be moved along, and its URL will change, so update any entry using it.}} * {{Enter a new name below. The {$count} files in the folder will be moved along, and their URLs will change, so update any entries using them.}}`,renaming_external_folder_breaks_links:`.input {$count :integer} .match $count one {{An entry links to a file in this folder. The entry won’t be updated, so the link will break once the folder is renamed.}} * {{{$count} entries link to files in this folder. The entries won’t be updated, so the links will break once the folder is renamed.}}`,confirm_deleting_folder:`.input {$count :integer} .match $count 0 {{Are you sure you want to delete the empty “{$name}” folder?}} one {{Are you sure you want to delete the “{$name}” folder and the asset in it?}} * {{Are you sure you want to delete the “{$name}” folder and the {$count} assets in it?}}`,renaming_folder:`Renaming the folder…`,renaming_folder_failed:`Couldn’t rename the folder.`,deleting_folder:`Deleting the folder…`,deleting_folder_failed:`Couldn’t delete the folder.`,external_assets_truncated:`There are too many files on the service to list them all, so some of them are left out.`,edit_options:`Edit Options`,show_edit_options:`Show Edit Options`,copy_options:`Copy Options`,edit_asset:`Edit Asset`,edit_x:`Edit {$name}`,wrap_long_lines:`Wrap Long Lines`,rename_asset:`Rename Asset`,rename_x:`Rename {$name}`,enter_new_name_for_asset:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. An entry using the asset will also be updated.}} * {{Enter a new name below. {$count} entries using the asset will also be updated.}}`,renaming_external_asset_breaks_links:`.input {$count :integer} .match $count one {{An entry links to this file. The entry won’t be updated, so the link will break once the file is renamed.}} * {{{$count} entries link to this file. The entries won’t be updated, so the links will break once the file is renamed.}}`,enter_new_name_for_asset_error:{empty:`File name cannot be empty.`,character:`File name cannot contain special characters.`,duplicate:`This file name is used for another asset.`,leading_dot:`File name cannot start with a dot.`,file_duplicate:`Another file with this name already exists here.`,folder_duplicate:`A folder with this name already exists here.`},file_will_be_saved_as:`The file will be saved as “{$name}”.`,change_file_extension:`Change File Extension`,confirm_file_extension_change:{change:`Are you sure you want to change the extension from “.{$oldExtension}” to “.{$newExtension}”?`,add:`Are you sure you want to add the extension “.{$newExtension}”?`,remove:`Are you sure you want to remove the extension “.{$oldExtension}”?`},file_extension_change_warning:`The file may not be displayed or handled correctly if the extension doesn’t match the actual file format.`,replace_asset:`Replace Asset`,replace_x:`Replace {$name}`,replace_file:`Replace File`,replace_image:`Replace Image`,remove_file:`Remove File`,remove_image:`Remove Image`,click_to_browse:`Click to browse…`,tap_to_browse:`Tap to browse…`,drop_files_or_click_to_browse:`.input {$count :integer} .match $count one {{Drop a file here or click to browse…}} * {{Drop files here or click to browse…}}`,drop_files_or:`.input {$count :integer} .match $count one {{Drop a file here or}} * {{Drop files here or}}`,drop_image_files_or:`.input {$count :integer} .match $count one {{Drop an image file here or}} * {{Drop image files here or}}`,browse:`Browse`,paste:`Paste`,paste_image:`Paste Image`,no_image_in_clipboard:`No image found in clipboard.`,clipboard_access_denied:`Clipboard access denied.`,drop_files_here:`.input {$count :integer} .match $count one {{Drop a file here}} * {{Drop files here}}`,unsupported_file_type:`Unsupported File Type`,dropped_file_type_mismatch:`The dropped file is not one of the following types: {$types}. Please try again.`,dropped_image_type_mismatch:`The dropped file is not supported. Only an image of the following types is accepted: {$types}. Please try again.`,choose_files:`.input {$count :integer} .match $count one {{Choose File}} * {{Choose Files}}`,delete_assets:`.input {$count :integer} .match $count one {{Delete Asset}} * {{Delete Assets}}`,delete_selected_assets:`.input {$count :integer} .match $count one {{Delete Selected Asset}} * {{Delete Selected Assets}}`,confirm_deleting_this_asset:`Are you sure you want to delete this asset?`,confirm_deleting_selected_assets:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected asset?}} * {{Are you sure you want to delete the selected {$count} assets?}}`,confirm_deleting_all_assets:`Are you sure you want to delete all the assets?`,deleting_referenced_assets_note:`.input {$count :integer} .match $count one {{The reference to it in an entry will be removed as well.}} * {{The references to it in {$count} entries will be removed as well.}}`,cannot_delete_referenced_assets:`.input {$count :integer} .match $count one {{This asset can’t be deleted, because the following fields in the entries using it would no longer be valid without it. Update those entries first.}} * {{These assets can’t be deleted, because the following fields in the entries using them would no longer be valid without them. Update those entries first.}}`,checking_asset_references_failed:`.input {$count :integer} .match $count one {{Couldn’t check which entries use this asset. Close this dialog and try again.}} * {{Couldn’t check which entries use these assets. Close this dialog and try again.}}`,delete_entries:`.input {$count :integer} .match $count one {{Delete Entry}} * {{Delete Entries}}`,delete_selected_entries:`.input {$count :integer} .match $count one {{Delete Selected Entry}} * {{Delete Selected Entries}}`,confirm_deleting_this_entry:`Are you sure you want to delete this entry?`,confirm_deleting_this_entry_with_assets:`Are you sure you want to delete this entry and associated assets?`,deleting_entry_failed:`Couldn’t delete the entry. Please try again.`,confirm_deleting_selected_entries:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected entry?}} * {{Are you sure you want to delete the selected {$count} entries?}}`,confirm_deleting_selected_entries_with_assets:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected entry and associated assets?}} * {{Are you sure you want to delete the selected {$count} entries and associated assets?}}`,confirm_deleting_all_entries:`Are you sure you want to delete all the entries?`,confirm_deleting_all_entries_with_assets:`Are you sure you want to delete all the entries and associated assets?`,deleting_referenced_entries_note:`.input {$count :integer} .match $count one {{The reference to it in another entry will be removed as well.}} * {{The references to it in {$count} other entries will be removed as well.}}`,cannot_delete_referenced_entries:`.input {$count :integer} .match $count one {{This entry can’t be deleted, because the following fields in other entries would no longer be valid without it. Update those entries first.}} * {{These entries can’t be deleted, because the following fields in other entries would no longer be valid without them. Update those entries first.}}`,reorder_entries:`Reorder Entries`,done_reordering_entries:`Done Reordering Entries`,cancel_reordering_entries:`Cancel Reordering Entries`,saving_reorder_failed:`Failed to save new entry order. Please try again.`,bulk_edit_entries:`Edit Entries in Bulk`,save_bulk_edits:`Save Bulk Edits`,cancel_bulk_edits:`Cancel Bulk Edits`,bulk_edit_entry:`Entry`,bulk_edit_table:`Bulk Editor`,bulk_edit_cell:`{$field} of {$entry}`,bulk_edit_count:`.input {$count :integer} .match $count 0 {{No changes}} one {{1 change}} * {{{$count} changes}}`,bulk_edit_invalid:`Some of the values aren’t valid. Fix the highlighted fields and try again.`,saving_bulk_edits_failed:`Failed to save the changes. Please try again.`,discard_bulk_edits_confirm:`Discard the changes made to the entries?`,processing_files:`.input {$count :integer} .match $count one {{Processing a file. This may take a while.}} * {{Processing files. This may take a while.}}`,uploading_files:`Uploading Files`,confirm_replacing_file:`“{$name}” will be replaced with this file:`,confirm_uploading_files:`.input {$count :integer} .match $count one {{This file will be saved to the “{$folder}” folder:}} * {{These {$count} files will be saved to the “{$folder}” folder:}}`,oversized_files:`Oversized Files`,warning_oversized_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it exceeds the maximum size of {$size}. Please reduce the size or select a different file.}} * {{These files cannot be uploaded because they exceed the maximum size of {$size}. Please reduce the sizes or select different files.}}`,invalid_files:`Invalid Files`,warning_invalid_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it’s damaged, or its content doesn’t match its file extension. This often happens when a photo is renamed rather than converted, such as a HEIC image saved as a JPEG file. Please convert the file and try again.}} * {{These files cannot be uploaded because they’re damaged, or their content doesn’t match their file extensions. This often happens when photos are renamed rather than converted, such as HEIC images saved as JPEG files. Please convert the files and try again.}}`,warning_unsupported_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it’s not one of the following types: {$types}.}} * {{These files cannot be uploaded because they’re not one of the following types: {$types}.}}`,warning_unsupported_image_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because only an image of the following types is accepted: {$types}.}} * {{These files cannot be uploaded because only images of the following types are accepted: {$types}.}}`,mismatched_files:`Mismatched Files`,warning_mismatched_files:`.input {$count :integer} .match $count one {{This file cannot replace “{$name}” because it’s in a different format. Please convert the file to the same format and try again.}} * {{These files cannot replace “{$name}” because they’re in a different format. Please convert the files to the same format and try again.}}`,file_name_conflict_confirmation:`.input {$count :integer} .match $count one {{A file with the same name already exists in this folder. Do you want to replace it?}} * {{{$count} files with the same names already exist in this folder. Do you want to replace them?}}`,file_name_conflict_confirmation_with_name:`.input {$count :integer} .input {$name :string} .match $count one {{A file named “{$name}” already exists in this folder. Do you want to replace it?}} * {{{$count} files with the same names already exist in this folder. Do you want to replace them?}}`,file_name_conflict_resolution:`File Name Conflict Resolution`,keep_both:`Keep Both`,uploading_files_progress:`Uploading…`,uploading_files_failed:`Upload failed.`,deleting_assets_failed:`Delete failed.`,renaming_asset_failed:`Rename failed.`,saving_asset_failed:`Save failed.`,file_meta_converted_from_x:`(converted from {$type})`,no_entries_created:`This collection has no entries yet.`,create_new_entry:`Create New Entry`,entry:`Entry`,index_file:`Index File`,no_files_in_collection:`No files available in this collection.`,duplicate_entry:`Duplicate Entry`,entry_duplicated:`Entry duplicated as a new draft.`,entry_validation_errors:`.input {$count :integer} .match $count one {{One field has an error. Please correct it to save the entry.}} * {{{$count} fields have errors. Please correct them to save the entry.}}`,show_errors:`Show Errors`,entry_saved:`.input {$count :integer} .match $count one {{Entry saved.}} * {{{$count} entries saved.}}`,entry_saved_and_published:`.input {$count :integer} .match $count one {{Entry saved and published.}} * {{{$count} entries saved and published.}}`,entries_deleted:`.input {$count :integer} .match $count one {{Entry deleted.}} * {{{$count} entries deleted.}}`,assets_saved:`.input {$count :integer} .match $count one {{Asset saved.}} * {{{$count} assets saved.}}`,assets_saved_and_published:`.input {$count :integer} .match $count one {{Asset saved and published.}} * {{{$count} assets saved and published.}}`,asset_urls_copied:`.input {$count :integer} .match $count one {{URL copied to clipboard.}} * {{{$count} URLs copied to clipboard.}}`,asset_paths_copied:`.input {$count :integer} .match $count one {{File path copied to clipboard.}} * {{{$count} file paths copied to clipboard.}}`,asset_ids_copied:`.input {$count :integer} .match $count one {{File ID copied to clipboard.}} * {{{$count} file IDs copied to clipboard.}}`,asset_data_copied:`.input {$count :integer} .match $count one {{File data copied to clipboard.}} * {{{$count} files’ data copied to clipboard.}}`,assets_downloaded:`.input {$count :integer} .match $count one {{Asset downloaded.}} * {{{$count} assets downloaded.}}`,assets_moved:`.input {$count :integer} .match $count one {{Asset moved.}} * {{{$count} assets moved.}}`,assets_renamed:`.input {$count :integer} .match $count one {{Asset renamed.}} * {{{$count} assets renamed.}}`,assets_deleted:`.input {$count :integer} .match $count one {{Asset deleted.}} * {{{$count} assets deleted.}}`,folder_created:`Folder created.`,folder_path:`Folder Path`,folder_contents:`Contents`,x_folders:`.input {$count :integer} .match $count 0 {{No folders}} one {{{$count} folder}} * {{{$count} folders}}`,folder_renamed:`Folder renamed.`,folder_deleted:`Folder deleted.`,content_editor:`Content Editor`,restore_backup_title:`Restore Draft`,restore_backup_description:`This entry has a backup from {$datetime}. Do you want to restore the edited draft?`,draft_backup_saved:`Draft backup saved.`,draft_backup_restored:`Draft backup restored.`,draft_backup_deleted:`Draft backup deleted.`,cancel_editing:`Cancel Editing`,create_entry_title:`Creating {$name}`,create_entry_announcement:`You’re now creating a new entry in the “{$collection}” collection.`,edit_entry_announcement:`You’re now editing the “{$entry}” entry in the “{$collection}” collection.`,edit_file_announcement:`You’re now editing the “{$file}” file in the “{$collection}” collection.`,edit_singleton_announcement:`You’re now editing the “{$file}” file.`,save_and_publish:`Save and Publish`,save_without_publishing:`Save without Publishing`,save_and_publish_needs_review:`Save and Publish (Related Entries Need Review)`,show_editor_options:`Show Editor Options`,editor_options:`Editor Options`,show_second_pane:`Show Second Pane`,show_preview:`Show Preview`,sync_scrolling:`Sync Scrolling`,switch_locale:`Switch Locale`,locale_content_disabled_short:`(disabled)`,locale_content_error_short:`(error)`,edit:`Edit`,preview:`Preview`,swap_panes:`Swap Panes`,edit_x_locale:`Edit {$locale} Content`,preview_x_locale:`Preview {$locale} Content`,edit_content:`Edit Content`,preview_content:`Preview Content`,content_preview:`Content Preview`,show_content_options_x_locale:`Show {$locale} Content Options`,content_options_x_locale:`{$locale} Content Options`,show_content_options:`Show Content Options`,content_options:`Content Options`,x_field:`“{$field}” Field`,show_field_options:`Show Field Options`,field_options:`Field Options`,unsupported_field_type_x:`Unsupported field type: {$name}`,enable_x_locale:`Enable {$locale}`,reenable_x_locale:`Reenable {$locale}`,disable_x_locale:`Disable {$locale}`,locale_x_has_been_disabled:`The {$locale} content has been disabled.`,locale_x_now_disabled:`The {$locale} content is now disabled. It will be deleted when you save the entry.`,view_in_repository:`View in Repository`,view_on_x:`View on {$service}`,view_on_live_site:`View on Live Site`,deploy_preview:{view:`View Preview`,building:`The preview is still being built.`,failed:`The preview couldn’t be built.`,checking:`Checking for a preview…`,check_again:`Check for Preview`,awaiting:`Checking for Preview`,short:{building:`Building…`,failed:`Build Failed`}},copy_from:`Copy from…`,copy_from_x:`Copy from {$locale}`,translation_options:`Translation Options`,translate:`Translate`,translate_fields:`.input {$count :integer} .match $count one {{Translate Field}} * {{Translate Fields}}`,translate_from:`Translate from…`,translate_from_x:`Translate from {$locale}`,revert_changes:`Revert Changes`,revert_all_changes:`Revert All Changes`,restore_default:`Restore Default`,clear_all:`Clear All`,confirm_reverting_changes:`Are you sure you want to revert all the changes made to this entry?`,confirm_reverting_changes_x_locale:`Are you sure you want to revert all the changes made to the {$locale} content?`,confirm_restoring_defaults:`Are you sure you want to restore the default values of all the fields in this entry? Your changes will be lost.`,confirm_restoring_defaults_x_locale:`Are you sure you want to restore the default values of all the fields in the {$locale} content? Your changes will be lost.`,confirm_clearing_fields:`Are you sure you want to clear all the fields in this entry? Your changes will be lost.`,confirm_clearing_fields_x_locale:`Are you sure you want to clear all the fields in the {$locale} content? Your changes will be lost.`,edit_slug:`Edit Slug`,edit_slug_error:{empty:`The slug cannot be empty.`,invalid:`The slug cannot contain special characters, including slashes and spaces.`,duplicate:`This slug is used for another entry.`},entry_parent_folder:`Parent Folder`,new_parent_folder:`New Folder`,new_parent_folder_create:`Create`,new_parent_folder_name:`Folder Name`,new_parent_folder_description:`The new folder will be created in “{$folder}”.`,new_parent_folder_error:{empty:`The folder name cannot be empty.`,invalid:`The folder name cannot contain slashes or start with a dot, and must include letters or numbers.`,duplicate:`A folder with this name already exists here.`},edit_path_error:{invalid:`The path cannot contain relative segments such as “..”.`,recursive:`The entry cannot be moved into one of its own subfolders.`,duplicate:`This path is used for another entry.`},required:`Required`,editor:{translation:{none:`Nothing to translate.`,started:`Translating…`,error:`Translation failed.`,complete:`.input {$count :integer} .match $count 0 {{No fields translated from {$source}.}} one {{Field translated from {$source}.}} * {{{$count} fields translated from {$source}.}}`},copy:{none:`Nothing to copy.`,complete:`.input {$count :integer} .match $count 0 {{No fields copied from {$source}.}} one {{Field copied from {$source}.}} * {{{$count} fields copied from {$source}.}}`}},validation:{value_missing:`This field is required.`,range_underflow:{"datetime-local":`The date/time must be at or after {$min}.`,date:`The date must be on or after {$min}.`,time:`The time must be at or after {$min}.`,number:`The value must be greater than or equal to {$min}.`,select:`.input {$min :integer} .match $min one {{You must select at least {$min} option.}} * {{You must select at least {$min} options.}}`,add:`.input {$min :integer} .match $min one {{You must add at least {$min} item.}} * {{You must add at least {$min} items.}}`},range_overflow:{"datetime-local":`The date/time must be at or before {$max}.`,date:`The date must be on or before {$max}.`,time:`The time must be at or before {$max}.`,number:`The value must be less than or equal to {$max}.`,select:`.input {$max :integer} .match $max one {{You cannot select more than {$max} option.}} * {{You cannot select more than {$max} options.}}`,add:`.input {$max :integer} .match $max one {{You cannot add more than {$max} item.}} * {{You cannot add more than {$max} items.}}`},too_short:`.input {$min :integer} .match $min one {{You must enter at least {$min} character.}} * {{You must enter at least {$min} characters.}}`,too_long:`.input {$max :integer} .match $max one {{You cannot enter more than {$max} character.}} * {{You cannot enter more than {$max} characters.}}`,type_mismatch:{number:`Please enter a number.`,email:`Please enter a valid email.`,url:`Please enter a valid URL.`},value_not_unique:`This value is used for another entry.`,key_not_unique:`This key is used for another item.`,key_numeric:`The key can’t be a whole number, as the items would lose their order.`,invalid_value:`Invalid value.`,unexpected_error:`Unexpected error occurred.`},entry_sidebar:{sidebar_panels:`Sidebar Panels`,validation:{title:`Validation`,placeholder:`Validation results will be shown here.`,no_errors_found:`No errors found.`,validate:`Validate`},slug:{title:`Slug`,generated_on_save:`The slug is generated from the entry’s content when it’s saved. Any date and time in it will be those of the save.`,unavailable:`This entry doesn’t have a slug.`},history:{title:`History`,fetch_failed:`Failed to load history.`,no_history:`No history found.`},backlinks:{title:`Backlinks`,no_entries:`No entries are referencing this entry.`}},save_progress:{preparing:`Preparing files: {$done} of {$total}`,committing:`Saving to GitHub: {$done} of about {$total} commits`},saving_entry:{error:{title:`Error`,description:`There was an error while saving the entry. Please try again later.`}},save_conflict:{title:`Entry Changed by Someone Else`,modified_by:`{$name} changed this entry on {$date}, after you opened it.`,modified:`This entry has been changed in the repository after you opened it.`,deleted:`This entry has been deleted from the repository after you opened it.`,overwrite_warning:`If you save now, their changes will be lost.`,recreate_warning:`If you save now, the entry will be created again.`,reload_warning:`As the entry is stored in the same file as other entries, it can’t be saved over the change. Cancel editing, then open the entry again from the list and make your edits.`,save_anyway:`Save Anyway`,branch_moved:`The repository has been updated by someone else while saving. Please try again.`,array_item_changed:`An entry stored in the same file has been changed by someone else. Please try again.`,array_file_invalid:`The {$path} file can’t be updated, as it doesn’t contain a valid list of entries.`},remote_change:{reload_entry:`Reload Entry`,confirm_reloading_entry:`Are you sure you want to reload the entry? Your unsaved changes will be lost.`},viewing_x_asset_details:`You’re viewing the details of the “{$name}” asset.`,asset_editor:`Asset Editor`,previous_asset:`Previous Asset`,next_asset:`Next Asset`,preview_unavailable:`Preview Unavailable.`,public_urls:`.input {$count :integer} .match $count one {{Public URL}} * {{Public URLs}}`,file_paths:`.input {$count :integer} .match $count one {{File Path}} * {{File Paths}}`,file_ids:`.input {$count :integer} .match $count one {{File ID}} * {{File IDs}}`,file_data:`File Data`,asset_info:`Asset Info`,select_asset_show_info:`Select an asset to show its info.`,kind:`Kind`,size:`Size`,dimensions:`Dimensions`,duration:`Duration`,used_in:`Used in`,created_date:`Created Date`,location:`Location`,map_lat_lng:`Map showing latitude {$latitude}, longitude {$longitude}`,remove_this_item:`Remove This Item`,move_up:`Move Up`,move_down:`Move Down`,reorder_options:`Reorder Options`,move_to_top:`Move to Top`,move_to_bottom:`Move to Bottom`,move_to:`Move to…`,move_to_description:`Enter a position from 1 to {$count}.`,move_to_position:`Position`,reorder_item:`Reorder Item`,list_item_value:`Item Value`,list_item_position:`Item {$position} of {$count}`,item_removed:`Item removed.`,add_x:`Add {$name}`,list_item_options:`List Item Options`,add_item_above:`Add Item Above`,add_item_below:`Add Item Below`,paste_item_above:`Paste Item Above`,paste_item_below:`Paste Item Below`,paste_item_to_replace:`Paste to Replace`,paste_item:`Paste Item`,list_item_copied:`Item copied.`,no_list_item_to_paste:`There’s no copied item to paste. To copy one, open an item’s ⋮ (List Item Options) menu and select Copy.`,list_item_not_compatible:`The copied item doesn’t fit in this list.`,list_item_pasted_without_values:`.input {$count :integer} .match $count one {{Item pasted. A value this list doesn’t take was left out.}} * {{Item pasted. {$count} values this list doesn’t take were left out.}}`,list_item_pasted_without_files:`.input {$count :integer} .match $count one {{Item pasted, but a file it uses couldn’t be found. Check the file fields in the item.}} * {{Item pasted, but {$count} files it uses couldn’t be found. Check the file fields in the item.}}`,select_list_type:`Select List Type`,unknown_variable_type:`This item can’t be displayed due to an unknown type. Check the browser console for details.`,opacity:`Opacity`,unselected_option:`(None)`,relation_field:{save_together_hint:`The new {$name} will be saved along with the entry you’re editing.`,add_failed:`The {$name} couldn’t be added. Check the browser console for details.`,edit_entry_title:`Editing {$name}`,edit_together_hint:`Your changes to the {$name} will be saved along with the entry you’re editing.`,edit_failed:`The changes to the {$name} couldn’t be applied. Check the browser console for details.`,move_unsupported:`These changes would move the {$name} to another location, which can only be done by editing it on its own.`,edit_conflict:`“{$name}” has been changed by someone else since you edited it. Open it again from the field to review your changes against the latest version.`,edit_deleted:`“{$name}” has been deleted by someone else since you edited it. Remove it from the field to save the entry.`,select_entry_to_edit:`Select an Entry to Edit`,edited_with_entry:`Changes to this entry are waiting to be published along with “{$name}”. If you save it now, the two sets of changes will be combined when that entry is published, which may fail if they overlap.`,changed_since_edit:`This {$name} has been changed by someone else since you edited it. Your changes are shown on top of the latest version. Review them before updating.`},assets_dialog:{title:{file:`Select File`,image:`Select Image`,folder:`Select Folder`},search_for_file:`Search for Files`,search_for_image:`Search for Images`,locations:`Locations`,selected_folder:`Selected folder: {$path}`,selected_folders:`.input {$count :integer} .match $count one {{{$count} folder selected}} * {{{$count} folders selected}}`,no_subfolders:`This folder has no subfolders.`,folder:{field:`Field Assets`,entry:`Entry Assets`,file:`File Assets`,collection:`Collection Assets`,global:`Global Assets`},error:{invalid_key:`Your API key is invalid or expired. Please double-check and try again.`,search_fetch_failed:`There was an error while searching assets. Please try again later.`,image_fetch_failed:`There was an error while downloading the selected asset. Please try again later.`},available_images:`Available Images`,available_files:`Available Files`,enter_url:`Enter URL`,enter_file_url:`Enter URL of the file:`,enter_image_url:`Enter URL of the image:`,large_file:{title:`Large File`},invalid_file:{title:`Invalid File`},rejected_files:{title:`Files Cannot Be Uploaded`},photo_credit:{title:`Photo Credit`,description:`Use the following credit if possible:`},unsaved:`Unsaved`},character_counter:{min_max:`.input {$count :integer} .match $count 0 {{No character entered. Minimum: {$min}. Maximum: {$max}.}} one {{{$count} character entered. Minimum: {$min}. Maximum: {$max}.}} * {{{$count} characters entered. Minimum: {$min}. Maximum: {$max}.}}`,min:`.input {$count :integer} .match $count 0 {{No character entered. Minimum: {$min}.}} one {{{$count} character entered. Minimum: {$min}.}} * {{{$count} characters entered. Minimum: {$min}.}}`,max:`.input {$count :integer} .match $count 0 {{No character entered. Maximum: {$max}.}} one {{{$count} character entered. Maximum: {$max}.}} * {{{$count} characters entered. Maximum: {$max}.}}`},youtube_video_player:`YouTube video player`,today:`Today`,now:`Now`,editor_components:{image:`Image`,src:`Source`,alt:`Alt Text`,title:`Title`,link:`Link`},key_value:{key:`Key`,value:`Value`,action:`Action`,empty_key:`Key is required.`,duplicate_key:`Key must be unique.`},find_place:`Find a Place`,use_your_location:`Use Your Location`,geolocation_error_title:`Geolocation Error`,geolocation_error_body:`There was an error while retrieving your location.`,geolocation_unsupported:`Geolocation API is not supported by this browser.`,boolean:{true:`Yes`,false:`No`},cloud_storage:{invalid:`The service is not configured properly.`,auth:{api_key:{key_label:`API Key`,initial:`Enter your {$key} for {$service}.`,requested:`Validating…`,error:`The provided {$key} is invalid. Please double-check and try again.`},password:{initial:`Enter your password for {$service}.`,requested:`Signing in…`,error:`Username or password is incorrect. Please double-check and try again.`}},s3:{auth_key_label:`Secret Access Key`},cloudinary:{iframe_title:`Cloudinary media library`,activate:{button_label:`Activate Cloudinary`,description:`After signing in, click the Sign In button again to continue.`},auth_key_label:`API Secret`,open_library:`Open Cloudinary`},uploadcare:{auth_key_label:`API Secret Key`},azure_blob_storage:{auth_key_label:`SAS Token`},backblaze_b2:{auth_key_label:`Application Key`},bunny_storage:{auth_key_label:`Storage Zone Password`}},config:{errors:`.input {$count :integer} .match $count one {{There is an error in the CMS configuration. Please solve the issue and try again.}} * {{There are errors in the CMS configuration. Please solve the issues and try again.}}`,error_locator:{collection:`{$collection} collection`,file:`{$file} file`,component:`{$component} component`,field:"`{$field}` field"},error:{no_secure_context:`Sveltia CMS only works with HTTPS or localhost URLs.`,insecure_urls:`.input {$count :integer} .match $count one {{The configuration file URL must use HTTPS protocol or a localhost address.}} * {{The configuration file URLs must use HTTPS protocol or localhost addresses.}}`,fetch_failed:`The configuration file could not be retrieved.`,fetch_failed_not_ok:`HTTP response returned with status {$status}.`,fetch_failed_with_manual_init:"The configuration file could not be retrieved. To prevent the `config.yml` file from loading, add <a>`load_config_file: false`</a> to the configuration object passed to `CMS.init()`.",parse_failed:`The configuration file could not be parsed.`,parse_failed_invalid_object:`The configuration file is not a valid JavaScript object.`,parse_failed_unsupported_type:`The configuration file is not a valid file type. Only YAML, TOML and JSON are supported.`,no_collection:`Collections are not defined.`,no_visible_collection:"At least one collection must be visible. Check the `hide` option.",missing_backend:`The backend is not defined.`,missing_backend_name:`The backend name is not defined.`,unsupported_known_backend:`The {$name} backend is <a>not supported</a> in Sveltia CMS.`,unsupported_deprecated_backend:`The deprecated {$name} backend is <a>not supported</a> in Sveltia CMS.`,unsupported_custom_backend:`Custom backends are <a>not supported</a> in Sveltia CMS.`,unsupported_backend_suggestion:`Use one of the <a>supported backends</a> instead.`,missing_repository:`The repository is not defined.`,invalid_repository:`The configured repository is invalid. It must be in “owner/repo” format.`,missing_api_root:"The `api_root` option is not defined. It’s required for the Forgejo backend.",invalid_root_dir:`The root directory is invalid. It must be a path within the repository, without “..”.`,invalid_root_dir_branch:"The root directory can’t be used in the branch names of the `editorial_workflow` and `preview` publish modes. No part of its path can start with a dot, end with “.lock” or contain a space or a special character such as a colon or an asterisk.",path_outside_root_dir:`The path “{$path}” leads outside the root directory, where the CMS can’t list files.`,oauth_implicit_flow:`The configured authentication method (implicit flow) is not supported in Sveltia CMS. Use a different <a>authentication method</a> instead.`,github_pkce_unsupported:`PKCE authorization is not yet supported due to GitHub’s limitations. Use a different <a>authentication method</a> instead.`,oauth_no_app_id:`OAuth application ID is not defined.`,open_authoring_no_workflow:"The `open_authoring` option requires the `editorial_workflow` or `preview` publish mode. See the <a>documentation</a> for details.",no_auth_methods:"The `auth_methods` option must contain at least one method.",auth_scope_no_repo:"The `auth_scope` option must include `repo` or `public_repo`.",missing_media_folder:`The media folder is not defined.`,public_folder_relative_path:`The configured public folder is invalid. It must be an absolute path starting with “/”.`,public_folder_absolute_url:`An absolute URL for the public folder option is not supported in Sveltia CMS.`,unsupported_folder_template_tag:"The `{$option}` option contains the `{$tag}` template tag, which isn’t supported there. Only the slug template tags, such as `\\{\\{slug\\}\\}` and `\\{\\{year\\}\\}`, and the `\\{\\{dirname\\}\\}`, `\\{\\{filename\\}\\}`, `\\{\\{extension\\}\\}`, `\\{\\{media_folder\\}\\}` and `\\{\\{public_folder\\}\\}` tags can be used.",global_folder_template_tag:"The `{$option}` option contains the `{$tag}` template tag, which can only be used in the option of a collection, a collection file or a field, where there is an entry to fill it in with.",invalid_sanitize_replacement:"The `sanitize_replacement` option is set to `{$replacement}`, but it contains a character that can’t be used in a slug, so it can’t stand in for one.",invalid_url_option:"The `{$option}` option is set to `{$url}`, but it must be an absolute URL starting with `https://` or `http://`.",invalid_publish_mode_stages:"The `stages` option of `publish_mode` must start with `draft` and list the stages in the order `draft`, `pending_review`, `pending_publish`, without repeating any.",i18n_no_locales:"The `i18n.locales` option must list at least one locale.",i18n_invalid_default_locale:"The `default_locale` option is set to `{$locale}`, but it’s not one of the `locales`.",i18n_invalid_initial_locale:"The `initial_locales` option contains `{$locale}`, but it’s not one of the `locales`.",i18n_no_collections:"The `i18n` option is configured at the top level, but none of the collections or singletons have the `i18n` option, so no content can be translated. Add `i18n: true` to the collections and singletons to translate.",invalid_transformation_key:"The `transformations` option contains an unsupported `{$key}` key. It must be `raster_image`, `svg` or a supported raster image format.",invalid_transformation_quality:"The `quality` option for the `{$key}` transformation is invalid. It must be an integer between 0 and 100.",invalid_transformation_size:"The `{$prop}` option for the `{$key}` transformation is invalid. It must be a positive integer.",missing_asset_collection_name:"The asset collection {$count} must have the `name` option defined as a non-empty string.",invalid_asset_collection_name:"The asset collection name `{$name}` is invalid. It must not contain special characters.",duplicate_asset_collection_name:"Asset collection names must be unique, but `{$name}` is used more than once.",invalid_collection_no_options:"The collection must have either the `folder`, `file`, `files` or `divider` option defined.",invalid_collection_multiple_options:"The collection cannot have more than one of the `folder`, `file`, `files` and `divider` options.",file_format_mismatch:"The `{$extension}` extension doesn’t match the `{$format}` format.",front_matter_body_field_not_text:"The `{$name}` field is saved as the body below the front matter, which can only hold text, not a number, a boolean, a list or an object as a `{$widget}` field does. Use a field type holding text, or rename the field.",invalid_collection_data_file:"The `file` option `{$file}` is invalid. It must be the path to a JSON file, without the `\\{\\{locale\\}\\}` placeholder.",unsupported_collection_data_file_option:"The `{$prop}` option is not supported in a collection with the `file` option.",collection_data_file_workflow:"Editorial Workflow and Preview Workflow, including Open Authoring, are not supported in a collection with the `file` option. Set the collection’s `publish_mode` option to `simple`.",collection_data_file_slug_tag:"The `{$prop}` option can’t contain the `\\{\\{slug\\}\\}` tag in a collection with the `file` option, as an entry’s slug is its position, which changes when the entries are reordered or deleted. Use a field with a unique value instead.",invalid_slug_slash:"The slug template `{$slug}` is invalid as it cannot contain slashes. To organize entries in subfolders, use the `path` option instead of `slug`.",invalid_identifier_field:"The `identifier_field` option refers to `{$name}`, but no such field is defined in the collection.",invalid_filter_field:"The `filter` option refers to `{$name}`, but no such field is defined in the collection.",invalid_filter_no_condition:"The `filter` option must have either the `value` or `pattern` option to match entries against.",option_field_not_found:"The `{$option}` option refers to `{$name}`, but no such field is defined.",thumbnail_field_not_media:"The `thumbnail` option refers to `{$name}`, but it must be an Image or File field, not a `{$widget}` field.",invalid_inline_component_fields:"The `inline` mode requires a single Boolean, Color, DateTime, Number, Relation, Select or String field. A Relation or Select field can’t have the `multiple` option enabled.",invalid_regex:"The `{$option}` option contains an invalid regular expression `{$pattern}`, which is ignored.",invalid_reorder_group:"The `reorder` option refers to a view group named `{$name}`, but no such group is defined in the `view_groups` option.",invalid_bulk_edit_field:"The `fields` list of the `bulk_edit` option refers to a field named `{$name}`, but no such top-level field is defined in the collection.",unsupported_bulk_edit_field:"The `{$name}` field in the `fields` list of the `bulk_edit` option can’t be edited in bulk. Only a Boolean, Color, DateTime, Number, Relation, Select or String field that isn’t read-only, doesn’t have the `multiple` option enabled and isn’t set automatically on save is supported.",invalid_sortable_field:"The `sortable_fields` option refers to a field named `{$name}`, but no such field is defined in the collection.",multiple_sortable_field_defaults:"Only one item in the `sortable_fields` option can have the `default_sort` option.",invalid_table_column_field:"The `{$option}` option refers to a field named `{$name}`, but no such field is defined in the collection.",invalid_view_group_field:"The `view_groups` option refers to a field named `{$name}`, but no such field is defined in the collection.",invalid_view_filter_field:"The `view_filters` option refers to a field named `{$name}`, but no such field is defined in the collection.",missing_view_group_name:"The view group {$count} must have the `name` option defined as a non-empty string.",invalid_view_group_name:"The view group name `{$name}` is invalid. It must not contain special characters.",duplicate_view_group_name:"View group names must be unique, but `{$name}` is used more than once.",missing_view_filter_name:"The view filter {$count} must have the `name` option defined as a non-empty string.",invalid_view_filter_no_condition:"The view filter {$count} must have the `pattern` option or a comparison option such as `eq` or `gte` to match entries against.",invalid_view_filter_name:"The view filter name `{$name}` is invalid. It must not contain special characters.",duplicate_view_filter_name:"View filter names must be unique, but `{$name}` is used more than once.",invalid_view_group_default:"The `default` option of `view_groups` is set to `{$name}`, but no view group has that name.",invalid_view_filter_default:"The `default` option of `view_filters` is set to `{$name}`, but no view filter has that name.",missing_collection_name:"The collection {$count} must have the `name` option defined as a non-empty string.",invalid_collection_name:"The collection name `{$name}` is invalid. It must not contain special characters.",duplicate_collection_name:"Collection names must be unique, but `{$name}` is used more than once.",missing_collection_file_name:"The collection file {$count} must have the `name` option defined as a non-empty string.",invalid_collection_file_name:"The collection file name `{$name}` is invalid. It must not contain special characters.",duplicate_collection_file_name:"Collection file names must be unique, but `{$name}` is used more than once.",collection_no_fields:"The collection must have the `fields` option defined with at least one field.",collection_file_no_fields:"The collection file must have the `fields` option defined with at least one field.",collection_folder_i18n_required:"The collection must have the `i18n` option defined if the `locale` placeholder is used in the `folder` path.",invalid_collection_folder_locale:"The `folder` path `{$folder}` is invalid. The `locale` placeholder must be used only once as a whole folder name, like `content/\\{\\{locale\\}\\}/posts`.",collection_file_i18n_required:"The collection file must have the `i18n` option defined if the `locale` placeholder is used in the `file` path.",collection_i18n_no_fields:"The collection has the `i18n` option, but none of its fields have the `i18n` option, so no field can be translated. Add `i18n: true` or `i18n: duplicate` to the fields to translate.",collection_i18n_no_files:"The collection has the `i18n` option, but none of its files have the `i18n` option, so no file can be translated. Add `i18n: true` to the files to translate.",collection_file_i18n_no_fields:"The collection file has the `i18n` option, but none of its fields have the `i18n` option, so no field can be translated. Add `i18n: true` or `i18n: duplicate` to the fields to translate.",missing_field_name:"The field {$count} must have the `name` option defined as a non-empty string.",invalid_field_name:"The field name `{$name}` is invalid. It must not contain special characters. If you want to nest fields, <a>use Object fields instead of dot notation</a>.",duplicate_field_name:"Field names must be unique, but `{$name}` is used more than once.",missing_variable_type:"The variable type {$count} must have the `name` option defined as a non-empty string.",invalid_variable_type:"The variable type name `{$name}` is invalid. It must not contain special characters.",duplicate_variable_type:"Variable type names must be unique, but `{$name}` is used more than once.",date_field_type:"The deprecated Date field type is not supported in Sveltia CMS. Use the DateTime field type with the `type: date` option instead.",hidden_field_locale_without_i18n:"The `default` option of a Hidden field uses the `\\{\\{locale\\}\\}` placeholder, but i18n isn’t enabled for the collection, so the content has no locale to fill it with.",invalid_timezone:"Invalid timezone: {$timeZone}. Must be a valid IANA timezone identifier like `America/New_York` or `Asia/Tokyo`.",unsupported_deprecated_option:"The deprecated `{$prop}` option is not supported in Sveltia CMS. Use the `{$newProp}` option instead.",allow_multiple:"The `allow_multiple` option is not supported in Sveltia CMS. Use the `multiple` option instead, which defaults to `false`.",invalid_list_field:"The List field cannot have the `field`, `fields` and `types` options together.",invalid_list_variable_type:"The List field’s variable type is invalid. The `widget` option is set to `{$widget}` but it must be `object`.",invalid_object_field:"The Object field cannot have the `fields` and `types` options together.",invalid_range_options:"The `{$min}` option must not be greater than the `{$max}` option.",invalid_step:"The `step` option is set to `{$step}`, but it must be greater than zero, or `-1` to turn stepping off.",select_field_no_options:"The Select field must have at least one item in the `options` option.",select_field_duplicate_option:"The Select field’s `options` must be unique, but `{$value}` is used more than once.",select_field_invalid_default:"The Select field’s `default` option is set to `{$value}`, but it’s not one of the `options`.",list_field_no_subfields:"The List field’s `fields` or `types` option must have at least one item. Omit the option for a list of plain values.",list_field_invalid_default_object:"The List field’s `default` option contains an object, but each item must be a plain value because the field has no `fields` or `types`.",list_field_invalid_default_item:"The List field’s `default` option contains `{$value}`, but each item must be an object because the field has `fields` or `types`.",list_field_invalid_default_key:"The List field’s `default` option contains an item with the `{$key}` property, but no subfield has that name.",list_field_default_missing_type:"The List field’s `default` option contains an item without the `{$typeKey}` property, which identifies one of the `types`.",list_field_invalid_default_type:"The List field’s `default` option contains an item whose `{$typeKey}` property is `{$value}`, but it’s not one of the `types`.",list_field_map_key_no_subfields:"The List field’s `map_key_field` option requires the `fields` or `types` option, as each key is taken from a subfield.",list_field_map_key_not_found:"The List field’s `map_key_field` option refers to `{$name}`, but no subfield has that name.",list_field_map_key_missing_in_type:"The List field’s `map_key_field` option refers to `{$name}`, but the `{$type}` type has no subfield with that name.",list_field_map_key_invalid_type:"The List field’s `map_key_field` option refers to `{$name}`, but it must be a String, Relation or Select field, not a `{$widget}` field.",list_field_map_key_multiple:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t take multiple values, as each item needs a single key. Remove its `multiple` option.",list_field_map_key_option_not_string:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield’s options must have string values, as each key is stored as a string.",list_field_map_key_not_required:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t be optional, as each item needs a key. Remove its `required` option.",list_field_map_key_not_localized:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t have `i18n: false`, as the items need a key in every locale. Use `i18n: duplicate` or remove the option.",duplicate_if_empty_multiple:"The `i18n: duplicate_if_empty` option is not supported for a field with the `multiple` option, so the field works like one with `i18n: true`.",invalid_default_multiple:"The `default` option must be an array because the `multiple` option is `true`.",invalid_default_single:"The `default` option must be a single value, not an array, because the `multiple` option is not `true`.",object_field_invalid_default_key:"The Object field’s `default` option has the `{$key}` property, but no subfield has that name.",object_field_default_missing_type:"The Object field’s `default` option doesn’t have the `{$typeKey}` property, which identifies one of the `types`.",object_field_invalid_default_type:"The `{$typeKey}` property of the Object field’s `default` option is `{$value}`, but it’s not one of the `types`.",code_field_invalid_default_object:"The Code field’s `default` option must be a string because the `output_code_only` option is `true`.",code_field_invalid_default_key:"The Code field’s `default` option has the `{$key}` property, but the `keys` option only allows `{$code}` and `{$lang}`.",compute_field_invalid_expression:"The Compute field’s `value` option must be a valid arithmetic expression, like `\\{\\{fields.price\\}\\} * \\{\\{fields.quantity\\}\\}`, because the `value_type` option is `{$valueType}`.",compute_field_uuid_in_expression:"The Compute field’s `value` option can’t use a UUID tag like `\\{\\{uuid\\}\\}` because the `value_type` option is `{$valueType}`, which makes it an arithmetic expression.",number_field_default_not_integer:"The Number field’s `default` option is set to `{$value}`, but it must be an integer because the `value_type` option is `{$valueType}`.",number_field_default_not_number:"The Number field’s `default` option is set to `{$value}`, but it must be a number because the `value_type` option is `{$valueType}`.",object_field_no_subfields:"The Object field’s `fields` or `types` option must have at least one item.",relation_field_invalid_collection:"The referenced `{$collection}` collection is invalid or not defined.",relation_field_invalid_collection_file:"The referenced `{$file}` file is invalid or not defined.",relation_field_missing_file_name:"The `file` option must be defined for a relation to a file collection.",relation_field_invalid_value_field:"The referenced value field `{$field}` is invalid or not defined.",relation_field_array_file_slug:"The relation to the `{$collection}` collection can’t store the `\\{\\{slug\\}\\}` value, as an entry’s slug in a collection with the `file` option is its position, which changes when the entries are reordered or deleted. Set the `value_field` option to a field with a unique value instead.",relation_field_array_file_workflow:"A collection with the `file` option can’t have a relation to the `{$collection}` collection, which uses Editorial Workflow or Preview Workflow, as the references to an entry renamed or deleted there can’t be updated in the file.",relation_field_invalid_display_field:"The referenced display field `{$field}` is invalid or not defined.",relation_field_invalid_search_field:"The referenced search field `{$field}` is invalid or not defined.",relation_field_invalid_filter_field:"The referenced filter field `{$field}` is invalid or not defined.",relation_field_invalid_sort_field:"The referenced sort field `{$field}` is invalid or not defined.",relation_field_sort_by_file_ignored:"The `sort_by` option doesn’t apply to a relation to a file, whose options follow the order of the list items. It will be ignored.",unexpected:`Unexpected error`,schema_invalid_type:"The `{$option}` option must be {$type}.",schema_invalid_enum:"The `{$option}` option must be one of these values: {$values}.",schema_invalid_const:"The `{$option}` option must be `{$value}`.",schema_invalid_empty_value:"The `{$option}` option must be an empty string.",schema_invalid_item_count:"The `{$option}` option must be an array of {$count} items.",schema_invalid_value:"The `{$option}` option has an invalid value.",schema_missing_option:"The `{$option}` option is required.",schema_missing_one_of:`One of these options is required: {$options}.`,schema_value_type:{string:`a string`,number:`a number`,integer:`an integer`,boolean:`a boolean`,array:`an array`,object:`an object`,null:`empty`}},warning:{oauth_no_app_id:`OAuth application ID is not defined. Users are required to provide an access token to sign in.`,unsupported_ignored_option:"The `{$prop}` option is not supported in Sveltia CMS. It will be ignored.",publish_mode_stages_ignored:"The `stages` option of `publish_mode` only applies to the `editorial_workflow` publish mode, so it’s ignored with `{$type}`.",inline_component_multiline_pattern:"The `pattern` of this inline component has the `m` or `s` flag or matches line breaks, but an inline component is only matched within a paragraph.",single_line_block_item:"The `{$name}` item of the `{$option}` option is ignored, as a field with `multiline: false` can only hold inline content.",conflicting_timezone_options:"Both `picker_utc` and newer timezone options (`input_timezone` or `output_utc`) are set. The new options take precedence. Consider removing `picker_utc` from your configuration.",localize_format_without_format:"The `localize_format` option has no effect, because the field has no `format` option and its value is stored in the ISO 8601 format.",compute_field_wildcard_without_item:"The Compute field’s `value` option refers to `{$name}`, but the field isn’t in an item of the list that `*` stands for, so it resolves to nothing. Only an aggregate function like `sum()` can use every item of a list.",compute_field_self_reference:"The Compute field’s `value` option refers to the field itself as `{$name}`, so its value changes every time it’s computed and never settles.",compute_field_reference_cycle:"The Compute field’s `value` option refers to `{$name}`, another Compute field that refers back to this field, directly or through other fields, so their values never settle.",localize_format_without_i18n:"The `localize_format` option is `true`, but i18n isn’t enabled for the collection, so the value is written in English. Set the option to a locale code like `de` instead.",localize_format_unsupported_locale:"The `localize_format` option is set to `{$locale}`, which isn’t a supported locale, so the value is written in English.",preview_path_no_date_field:"The `preview_path` option uses date and time tags, but the collection has no DateTime field to read them from, so the preview link won’t be shown.",preview_path_date_field_not_found:"The `preview_path_date_field` option refers to a field named `{$name}`, but no DateTime field with that name is defined, so the preview link won’t be shown.",preview_path_field_not_found:"The `preview_path` option refers to `{$name}`, but no such field is defined in the collection, so the preview link won’t be shown.",missing_identifier_field:"The collection has no `{$name}` field to name new entries with, so each new entry gets a random slug. Add a `{$name}` field, or set the `identifier_field` or `slug` option.",slug_i18n_ineffective:"The `i18n` option of `slug` has no effect, because the collection doesn’t use the `multiple_files`, `multiple_folders` or `multiple_root_folders` i18n structure, where each locale has a file of its own.",slug_template_ignored:"The `template` option of `slug` is ignored, because the `auto_increment` option numbers the slugs instead.",locale_not_omitted_from_file_path:"The `locale` placeholder can’t be removed from the `file` path `{$file}`, so the default locale is kept in it despite the `omit_default_locale_from_file_path` i18n option. To leave the locale out, use the placeholder as a whole folder name, like `\\{\\{locale\\}\\}/about.md`, or between the file name and the extension, like `about.\\{\\{locale\\}\\}.md`. To keep it, set the option to `false` in the file’s `i18n` option.",i18n_not_configured:"The `i18n` option is enabled, but i18n is not configured at the top level of the configuration or in the collection, so the option has no effect.",empty_public_folder:"The `public_folder` option is an empty string, so the `media_folder` path is used for the asset paths saved in entries instead. Remove the option, or set it to the path you want to use, such as `/images`.",schema_unknown_option:"The `{$option}` option is not defined in the Sveltia CMS configuration schema. It will be ignored. Check for a typo or a syntax mistake.",default_localized_without_i18n:"The `default_localized` option has no effect, because i18n isn’t enabled for the collection. Use the `default` option instead.",default_localized_unknown_locale:"The `default_localized` option has a value for `{$locale}`, which isn’t one of the collection’s locales, so the value is never used."},compatibility_link:`See the compatibility notes for details: {$link}`,schema_tip:`For a better developer experience, you can validate your configuration file against the JSON schema of Sveltia CMS. See {$link} for details.`},local_workflow:{indicator:`Local`,unsupported_browser:`Local Workflow is not supported in your browser. Please use Chrome or Edge instead.`,disabled:`Local Workflow is disabled in your browser. <a>Here’s how to enable it</a>.`},viewing_editorial_workflow:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. In Review: {$review}. Ready: {$ready}. Pending Deletion: {$deletion}.`,viewing_open_authoring_workflow:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. In Review: {$review}. Pending Deletion: {$deletion}.`,viewing_editorial_workflow_without_review:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. Ready: {$ready}. Pending Deletion: {$deletion}.`,viewing_preview_workflow:`You’re now viewing the Drafts page. Drafts: {$draft}. Pending Deletion: {$deletion}.`,status:{draft:`Draft`,drafts:`Drafts`,in_review:`In Review`,ready:`Ready`,pending_deletion:`Pending Deletion`,deploying:`Deploying`},workflow:{cancel_deletion:`Cancel Deletion`,confirm_cancelling_deletion:`Are you sure you want to cancel this deletion? The entry will remain published.`,confirm_completing_deletion:`Are you sure you want to delete this entry? It will be removed right away.`,deletion_pending:`.input {$count :integer} .match $count one {{Entry marked for deletion.}} * {{{$count} entries marked for deletion.}}`,changes_discarded:`.input {$count :integer} .match $count one {{Changes discarded.}} * {{Changes to {$count} entries discarded.}}`,cancelling_deletion:`Cancelling Deletion…`,deletion_cancelled:`Deletion cancelled.`,cancelling_deletion_failed:`Couldn’t cancel the deletion. Please try again.`,unpublished_entries:`Unpublished Entries`,published_entries:`Published Entries`,entry_status_value:`Status: {$status}`,change_entry_status:`Change Entry Status`,changing_status:`Changing Status…`,updating_status:`Updating Status…`,status_updated:`Status updated.`,status_change_failed:`Couldn’t change the status. Please try again.`,refresh:`Refresh`,refreshing:`Refreshing…`,refreshed:`The board is up to date.`,refresh_failed:`Couldn’t refresh the board. Please try again.`,status_change_blocked:`The entry has errors. Please correct them before changing the status.`,publish_blocked:`The entry has errors. Please correct them before publishing it.`,send_for_review:`Send for Review`,confirm_sending_for_review:`Your changes have been saved as a draft. Send the entry for review so someone can look at it and publish it?`,mark_as_ready:`Mark as Ready`,confirm_marking_as_ready:`Your changes have been saved as a draft. Mark the entry as ready so it can be published?`,publish_entry:`Publish Entry`,discard_changes:`Discard Changes`,confirm_deleting_published_entry:`Are you sure you want to delete this entry? It won’t be removed until the deletion is published. Until then you’ll still find it in the entry list, marked Pending Deletion.`,confirm_deleting_unpublished_entry:`This entry hasn’t been published yet, so deleting it will discard it completely.`,confirm_discarding_entry_changes:`This entry has unpublished changes. Discarding them will restore the published version. The entry itself won’t be deleted.`,deleting_unpublished_note_all:`.input {$count :integer} .match $count one {{It hasn’t been published yet, so your unpublished changes will be discarded. Any published version will remain published.}} * {{They haven’t been published yet, so your unpublished changes will be discarded. Any published versions will remain published.}}`,deleting_unpublished_note_some:`.input {$count :integer} .match $count one {{One of them hasn’t been published yet, so your unpublished changes will be discarded. Any published version will remain published.}} * {{{$count} of them haven’t been published yet, so your unpublished changes will be discarded. Any published versions will remain published.}}`,confirm_publishing_entry_after_build:`Are you sure you want to publish this entry? Your changes will go live once your site has been rebuilt.`,publishing_entry:`Publishing Entry…`,entry_published:`Entry published.`,deleting_entry:`Deleting Entry…`,discarding_changes:`Discarding Changes…`,entry_deleted:`Entry deleted.`,publishing_entry_failed:`Couldn’t publish the entry. Please try again.`,publish_refused_other_changes:`This entry can’t be published here, because it comes with other changes the CMS can’t show you. Ask a developer to review it.`,publish_refused_entry_changed:`The entry has been changed since you opened it. Reload the page to review the latest version before publishing it.`,branch_in_use:`Another request ({$number}) is already open for this entry outside the CMS. Ask a developer to close it first.`,no_entries:`No entries.`,drag_entry:`Drag to change the status`,deploying_deletion:`Deletion`,companion_entries:`Also adds {$entries}`,edited_companion_entries:`Also changes {$entries}`,companion_entry:`{$collection}: {$title}`},commit_message:{title:`Commit Message`,description_replace:`Describe your changes. The message is recorded in the history along with them.`,description_addition:`Add a note to the message recorded in the history along with your changes, such as an issue number. It can be left empty.`,message:`Commit message`,addition:`Note`,preview:`Message: {$message}`},open_authoring:{fork_repository:`Fork Repository`,fork:`Fork`,confirm_forking_repository:`To suggest changes to “{$repo}”, a fork of the repository has to be created on your account. Your changes are saved to that fork, and a maintainer reviews them before they go live.`,fork_declined:`You need a fork of the repository on your account to suggest changes.`,fork_failed:`Couldn’t create a fork of the “{$repo}” repository on your account.`,fork_branch_missing:`Your “{$fork}” fork doesn’t have the “{$branch}” branch. Update the fork from the “{$repo}” repository, then sign in again.`,permission_check_failed:`Couldn’t check your access to the “{$repo}” repository. Please try again in a moment.`,forking_disabled:`The “{$repo}” repository doesn’t allow forks. Ask a maintainer to enable forking for it.`,invitation_pending:`You have a pending invitation to the “{$repo}” repository. Accept it on GitHub, then sign in again.`,private_repo_scope_required:`Your sign-in doesn’t include access to private repositories, so the “{$repo}” repository can’t be read. Ask a maintainer to check the CMS authentication settings.`,publish_unsupported:`Only a maintainer can publish changes to this site. Mark your entry as In Review instead, and someone will take a look.`,entry_already_published:`A maintainer has already published this entry, so there’s nothing left to review.`,direct_commit_unsupported:`This change can’t be made directly. Only edits to entries can be suggested for review.`,contributing_via_fork:`Your changes are saved to your fork of this repository at “{$repo}” and reviewed before they go live.`,view_fork:`View Fork`},categories:`Categories`,site_configuration_editor:`Site Configuration Editor`,prefs:{changes:{api_key_saved:`API key saved.`,api_key_removed:`API key removed.`,api_key_invalid:`The provided API key is invalid. Please double-check and try again.`},error:{permission_denied:`Cookie storage access has been denied. Please check your browser permissions and try again.`},appearance:{title:`Appearance`,theme:`Theme`,select_theme:`Select Theme`},theme:{dark:`Dark`,light:`Light`},language:{title:`Language`,ui_language:{title:`User Interface Language`,select_language:`Select Language`}},contents:{title:`Contents`,editor:{title:`Editor`,use_draft_backup:{switch_label:`Automatically back up entry drafts`},close_on_save:{switch_label:`Close the editor after saving a draft`},close_with_escape:{switch_label:`Close the editor with the Escape key`}}},i18n:{title:`Internationalization`,translators:{default:{title:`Default Translation Service`,select_service:`Select Service`},api_keys:{title:`Translation Service API Keys`,description:`Manage API keys for <a>translation services</a>. API keys for generic AI services can be managed in the AI settings.`},field_label:`{$service} Key`,description:`Sign up for <a {$homeHref}>{$service}</a> and enter <a {$apiKeyHref}>your API Key</a> here to enable quick translation of text entry fields.`}},media:{title:`Media`,stock_photos:{api_keys:{title:`Stock Photo Service API Keys`,description:`Manage API keys for <a>stock photo services</a>.`},field_label:`{$service} API Key`,description:`Sign up for <a {$homeHref}>{$service} API</a> and enter <a {$apiKeyHref}>your API Key</a> here to insert free stock photos to image entry fields.`,credit:`Photos provided by {$service}`,no_services:`No <a>stock photo services</a> are configured.`},cloud_storage:{api_keys:{title:`Cloud Storage Service API Keys`,description:`Manage API keys for <a>cloud storage services</a>.`},field_label:`{$service} API Key`,no_services:`No <a>cloud storage services</a> are configured.`}},ai:{title:`AI`,api_keys:{title:`AI Service API Keys`,description:`Manage API keys for AI services.`},field_label:`{$service} API Key`},accessibility:{title:`Accessibility`,underline_links:{title:`Underline Links`,description:`Show underline for links in the entry preview and user interface labels.`,switch_label:`Always Underline Links`}},data:{title:`Data Management`,clear_data:{title:`Clear Data`,file_cache:{description:`Delete the locally cached file contents and image thumbnails to free up storage space or resolve issues caused by stale data.`,button_label:`Clear File Cache`,confirmation:`The locally cached file contents and image thumbnails will be deleted. Your unsaved drafts and settings will be kept, and any deleted data will be downloaded or generated again as needed. The CMS will be reloaded once done.`},all_data:{description:`Delete everything the CMS keeps in this browser, including the cached files, unsaved drafts and settings. Anything already saved to your repository won’t be affected.`,button_label:`Erase All Data`,confirmation:`All the data stored in this browser will be deleted, including the cached file contents, image thumbnails, unsaved drafts, settings and sign-in state. Your repository won’t be affected, but any change you haven’t saved will be lost, and you’ll have to sign in again. The CMS will be reloaded once done.`}}},developer:{title:`Developer`,developer_mode:{title:`Developer Mode`,description:`Enable some developer-oriented features, including detailed console logs and native context menus.`,switch_label:`Enable Developer Mode`},local_git:{title:`Git Commits`,description:`Commit your changes to the current branch of your local repository whenever you save them, as the CMS does when you work with a remote repository. You can then review and push the commits with your usual Git tools.`,switch_label:`Commit Changes to Git`,checking:`Checking the repository…`,ready:`Changes will be committed to the {$branch} branch as {$name} ({$email}).`,not_ready:`Changes can’t be committed right now. {$reason}`},deploy_hook:{title:`Deploy Hook`,description:`Enter a webhook URL to be called when you manually trigger a deployment by selecting Publish Changes. This can be left blank if you’re using GitHub Actions or GitLab CI/CD.`,url:{field_label:`Hook URL`,saved:`Hook URL saved.`,removed:`Hook URL removed.`},auth:{field_label:`Authorization header (e.g., Bearer <token>) (optional)`,saved:`Authorization header saved.`,removed:`Authorization header removed.`}}}},keyboard_shortcuts_:{view_content_library:`View Content Library`,view_asset_library:`View Asset Library`,search:`Search for entries and assets`,create_entry:`Create a new entry`,save_entry:`Save an entry`,cancel_editing:`Cancel entry editing`},file_type_labels:{avif:`AVIF image`,bmp:`Bitmap image`,gif:`GIF image`,heic:`HEIC image`,heif:`HEIF image`,ico:`Icon`,jpeg:`JPEG image`,jpg:`JPEG image`,png:`PNG image`,svg:`SVG image`,tif:`TIFF image`,tiff:`TIFF image`,webp:`WebP image`,avi:`AVI video`,m4v:`MP4 video`,mov:`QuickTime video`,mp4:`MP4 video`,mpeg:`MPEG video`,mpg:`MPEG video`,ogg:`Ogg video`,ogv:`Ogg video`,ts:`MPEG video`,webm:`WebM video`,"3gp":`3GPP video`,"3g2":`3GPP2 video`,aac:`AAC audio`,mid:`MIDI`,midi:`MIDI`,m4a:`MP4 audio`,mp3:`MP3 audio`,oga:`Ogg audio`,opus:`OPUS audio`,wav:`WAV audio`,weba:`WebM audio`,csv:`CSV spreadsheet`,doc:`Word document`,docx:`Word document`,odp:`OpenDocument presentation`,ods:`OpenDocument spreadsheet`,odt:`OpenDocument text`,pdf:`PDF document`,ppt:`PowerPoint presentation`,pptx:`PowerPoint presentation`,rtf:`Rich text document`,xls:`Excel spreadsheet`,xlsx:`Excel spreadsheet`,html:`HTML text`,js:`JavaScript`,json:`JSON text`,md:`Markdown text`,toml:`TOML text`,yaml:`YAML text`,yml:`YAML text`},file_size_units:{b:`{$size} bytes`,kb:`{$size} KB`,mb:`{$size} MB`,gb:`{$size} GB`,tb:`{$size} TB`}},u5=`en-US`,d5=`ar,bg,ca,cs,da,de,el,en-CA,en-GB,en-US,en-ZA,es-CO,fa,fi,fr,he,hr,it,ja,ko,nl,pl,pt-BR,pt-PT,ru,sk,sv,tr,uk,vi,zh-CN,zh-TW`.split(`,`),Ret=()=>{let e=Yne();return e&&d5.includes(e)?e:u5},zet=`https://unpkg.com/@sveltia/cms@${xr}/locales`,Bet=5e3,f5=`sveltia-cms.locale`,p5=new Map,m5=WO(),h5=WO(),g5=KO(()=>Intl.NumberFormat(Fc.current)),Vet=()=>!0,Het=async e=>{if(Vet())try{let{_locale:t,_version:n,...r}=await rD.get(f5)??{};if(t===e&&n===xr&&Object.keys(r).length)return r}catch{}},Uet=async(e,t)=>{if(Vet())try{await rD.set(f5,{_locale:e,_version:xr,...t})}catch{}},Wet=async()=>{try{await rD.delete(f5)}catch{}},Get=async e=>{let t=await fetch(`${zet}/${e}.json`,{signal:AbortSignal.timeout(Bet)});if(!t.ok)throw Error(`Failed to load the ${e} locale strings`,{cause:t});return t.json()},Ket=async e=>{let t=await Het(e);if(t)return p5.set(e,t),t;m5.current=e;try{let t=await Get(e);return p5.set(e,t),await Uet(e,t),t}catch(t){throw h5.current={locale:e},t}finally{m5.current===e&&(m5.current=void 0)}},qet=async e=>{let t=p5.get(e);t?await Het(e)||await Uet(e,t):e===u5&&p5.size&&await Wet()},Jet=()=>{try{let{locale:e}=JSON.parse(globalThis.localStorage.getItem(`sveltia-cms.prefs`)||`{}`)??{};return d5.includes(e)?e:void 0}catch{return}},Yet=()=>{Ac(u5,{...Let,_sui:iSe}),d5.filter(e=>e!==u5).forEach(e=>{Jne(e,()=>Ket(e))}),EW.current=Ret(),window.addEventListener(`languagechange`,()=>{EW.current=Ret()}),Xne({fallbackLocale:u5,initialLocale:Jet()??EW.current}),JO(()=>{qet(Fc.current)})};function Xet(e,t){k(t,!0);let n=M(!1);R(()=>{h5.current&&N(n,!0)});var r=U(),i=F(r),a=e=>{let t=j(()=>h5.current);Pu(e,{get show(){return B(n)},set show(e){N(n,e,!0)},children:(e,n)=>{Vc(e,{status:`error`,children:(e,n)=>{$r();var r=H();z(e=>G(r,e),[()=>X(`locale_load_failed`,{values:{locale:kA(B(t).locale)??B(t).locale}})]),W(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(i,e=>{h5.current&&e(a)}),W(e,r),A()}var Zet=V(`<div role="figure" class="markdown svelte-1rq7jer"></div>`),Qet=V(`<pre role="figure" class="svelte-1rq7jer"> </pre>`),$et={hash:`svelte-1rq7jer`,code:`.markdown.svelte-1rq7jer {
|
||
/* Make the preview the containing block of any positioned element in the content, so an element
|
||
with \`position: fixed\` from an inline style can’t cover the rest of the app */translate:0;}pre.svelte-1rq7jer,
|
||
.markdown.svelte-1rq7jer {display:block;margin:0;padding:16px;width:100%;height:100%;overflow:auto;}pre.svelte-1rq7jer {white-space:pre-wrap;}`};function ett(e,t){k(t,!0),q(e,$et);var n=U(),r=F(n),i=e=>{var n=U();Mo(F(n),()=>yr(t.text,{breaks:!0,async:!0}),null,(e,t)=>{var n=Zet();Ho(n,()=>D8(B(t),{ADD_TAGS:[]}),!0),O(n),W(e,n)},e=>{var n=Qet(),r=I(n,!0);z(()=>G(r,t.text)),W(e,n)}),W(e,n)},a=j(()=>t.name.endsWith(`.md`)),o=e=>{var n=Qet(),r=I(n,!0);z(()=>G(r,t.text)),W(e,n)};K(r,e=>{B(a)?e(i):e(o,-1)}),W(e,n),A()}var _5=V(`<span role="alert"> </span>`),ttt=V(`<iframe sandbox="allow-scripts"></iframe>`);function ntt(e,t){k(t,!0);let n=Y(t,`asset`,3,void 0),r=Y(t,`pending`,3,!1),i=j(()=>n()?void 0:t.src);var a=U(),o=F(a),s=e=>{{let r=j(()=>[`image`,`video`].includes(t.kind)),a=j(()=>t.kind===`image`),o=j(()=>t.kind===`image`?t.name:void 0),s=j(()=>[`audio`,`video`].includes(t.kind));O$(e,{get kind(){return t.kind},get asset(){return n()},get src(){return B(i)},get blurBackground(){return B(r)},get checkerboard(){return B(a)},get alt(){return B(o)},get controls(){return B(s)},loading:`eager`,dissolve:!1,holdTransition:!0})}},c=j(()=>t.kind&&VU(t.kind)),l=e=>{DO(e,{children:(e,t)=>{var n=_5(),r=I(n,!0);z(e=>G(r,e),[()=>X(`loading`)]),W(e,n)},$$slots:{default:!0}})},u=e=>{var n=ttt();z(()=>{J(n,`src`,t.src),J(n,`title`,t.name)}),W(e,n)},d=e=>{var n=U();Mo(F(n),()=>t.getText(),e=>{DO(e,{children:(e,t)=>{var n=_5(),r=I(n,!0);z(e=>G(r,e),[()=>X(`loading`)]),W(e,n)},$$slots:{default:!0}})},(e,n)=>{ett(e,{get text(){return B(n)},get name(){return t.name}})},e=>{DO(e,{children:(e,t)=>{var n=_5(),r=I(n,!0);z(e=>G(r,e),[()=>X(`preview_unavailable`)]),W(e,n)},$$slots:{default:!0}})}),W(e,n)},f=j(()=>t.type&&yk(t.type)),p=e=>{DO(e,{children:(e,t)=>{var n=_5(),r=I(n,!0);z(e=>G(r,e),[()=>X(`preview_unavailable`)]),W(e,n)},$$slots:{default:!0}})};K(o,e=>{B(c)?e(s):r()?e(l,1):t.type===`application/pdf`?e(u,2):B(f)?e(d,3):e(p,-1)}),W(e,a),A()}var rtt=V(`<li class="svelte-4yt8tl"><span class="entry svelte-4yt8tl"><bdi> </bdi></span> <span class="field svelte-4yt8tl"><bdi> </bdi> </span></li>`),itt=V(`<div role="alert" class="svelte-4yt8tl"> </div> <ul class="blockers svelte-4yt8tl"></ul>`,1),att=V(`<div class="svelte-4yt8tl"> </div>`),ott={hash:`svelte-4yt8tl`,code:`div.svelte-4yt8tl {margin-top:8px;}.blockers.svelte-4yt8tl {margin:8px 0 0;border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);list-style:none;li:where(.svelte-4yt8tl) {margin:0;padding:0;&:not(:first-child) {margin-top:8px;}}span:where(.svelte-4yt8tl) {display:block;}.field:where(.svelte-4yt8tl) {color:var(--sui-secondary-foreground-color);}}`};function v5(e,t){k(t,!0),q(e,ott);let n=Y(t,`kind`,3,`entry`);var r=U(),i=F(r),a=e=>{var r=itt(),i=F(r),a=I(i,!0),o=L(i,2);Ro(o,21,()=>t.plan.blockers,e=>`${e.entry.id}:${e.keyPath}`,(e,t)=>{var n=rtt(),r=P(n),i=I(P(r));O(r);var a=L(r,2),o=P(a),s=I(o,!0),c=L(o);O(a),O(n),z(e=>{G(i,`${B(t).collectionLabel??``} › ${B(t).summary??``}`),G(s,B(t).fieldLabel),G(c,`: ${e??``}`)},[()=>B(t).messages.join(` `)]),W(e,n)}),O(o),z(e=>G(a,e),[()=>X(n()===`asset`?`cannot_delete_referenced_assets`:`cannot_delete_referenced_entries`,{values:{count:t.count}})]),W(e,r)},o=e=>{var r=att(),i=I(r,!0);z(e=>G(i,e),[()=>X(n()===`asset`?`deleting_referenced_assets_note`:`deleting_referenced_entries_note`,{values:{count:t.plan.targets.length}})]),W(e,r)};K(i,e=>{t.plan.blockers.length?e(a):t.plan.targets.length&&e(o,1)}),W(e,r),A()}var stt=V(`<div role="alert"> </div>`),ctt=V(`<!> <!>`,1);function y5(e,t){k(t,!0);let n=Y(t,`assets`,19,()=>[]),r=Y(t,`disabled`,3,!1),i=Y(t,`planDeletion`,3,void 0),a=Y(t,`buttonDescription`,3,``),o=Y(t,`dialogDescription`,3,``),s=Y(t,`onDelete`,3,void 0),c=Y(t,`useButton`,3,!0),l=M(!1),u=M(void 0),d=M(!1),f=M(void 0),p=j(()=>r()||!n().length),m=j(()=>!!B(u)?.blockers.length);R(()=>{if(!B(l)||!i())return;let e=n();N(u,void 0),N(d,!1),i()(e).then(t=>{B(l)&&n()===e&&N(u,t,!0)},t=>{console.error(t),B(l)&&n()===e&&N(d,!0)})}),ba(()=>{B(p)&&document.activeElement===B(f)&&ao().then(()=>uH())});var h=ctt(),g=F(h),_=e=>{{let t=j(()=>X(`delete`));ll(e,{variant:`ghost`,get disabled(){return B(p)},get label(){return B(t)},get"aria-label"(){return a()},onclick:()=>{N(l,!0)},get element(){return B(f)},set element(e){N(f,e,!0)}})}},v=e=>{{let t=j(()=>X(`delete`));iu(e,{variant:`ghost`,get disabled(){return B(p)},get label(){return B(t)},get"aria-label"(){return a()},onclick:()=>{N(l,!0)}})}};K(g,e=>{c()?e(_):e(v,-1)});var y=L(g,2);{let e=j(()=>X(`delete_assets`,{values:{count:n().length}})),r=j(()=>X(`delete`)),a=j(()=>!!i()&&(!B(u)||B(m)));Il(y,{get title(){return B(e)},get okLabel(){return B(r)},get okDisabled(){return B(a)},onOk:async()=>{await t.deleteAssets(n())!==!1&&s()?.()},get open(){return B(l)},set open(e){N(l,e,!0)},children:(e,t)=>{var r=ctt(),i=F(r),a=e=>{var t=stt(),r=I(t,!0);z(e=>G(r,e),[()=>X(`checking_asset_references_failed`,{values:{count:n().length}})]),W(e,t)},s=e=>{var t=H();z(()=>G(t,o())),W(e,t)};K(i,e=>{B(d)?e(a):B(m)||e(s,1)});var c=L(i,2),l=e=>{v5(e,{get plan(){return B(u)},kind:`asset`,get count(){return n().length}})};K(c,e=>{B(u)&&e(l)}),W(e,r)},$$slots:{default:!0}})}W(e,h),A()}function b5(e,t){k(t,!0);let n=Y(t,`useShortcut`,3,!1),r=Y(t,`onclick`,3,void 0);{let i=e=>{{let t=j(()=>Pc()?`arrow_forward`:`arrow_back`);Lc(e,{get name(){return B(t)}})}},a=j(()=>t[`aria-label`]??X(`back`)),o=j(()=>n()?`Escape`:void 0);ll(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return B(a)},get keyShortcuts(){return B(o)},class:`back`,get onclick(){return r()},startIcon:i,$$slots:{startIcon:!0}})}A()}var ltt=`input, textarea, select, audio, video, [role="grid"], [role="listbox"], [role="menu"], [role="menubar"], [role="radiogroup"], [role="slider"], [role="tablist"]`,utt=(e,{container:t,rtl:n})=>{let{key:r,ctrlKey:i,metaKey:a,altKey:o,shiftKey:s,target:c}=e;if(!(![`ArrowLeft`,`ArrowRight`].includes(r)||i||a||o||s)&&c instanceof HTMLElement&&(c===document.body||t?.contains(c))&&!c.isContentEditable&&!c.closest(ltt))return r===(n?`ArrowRight`:`ArrowLeft`)?`previous`:`next`},dtt=e=>!(e instanceof Element&&e.closest(`audio, video, input, [role="slider"]`)),ftt=({start:e,end:t,rtl:n})=>{let r=t.x-e.x,i=t.y-e.y;if(!(Math.abs(r)<50||Math.abs(r)<Math.abs(i)))return(n?r<0:r>0)?`previous`:`next`},ptt=V(`<bdi> </bdi>`),mtt=V(`<!> <h2 role="none"><!></h2> <!> <!>`,1),htt=V(`<div role="none" class="preview svelte-1g7r4za"><!></div>`),gtt=V(`<div role="group" class="wrapper svelte-1g7r4za"><!> <div role="none" class="row svelte-1g7r4za"><div role="none" class="main svelte-1g7r4za"><!> <!> <!></div> <!></div></div>`),_tt={hash:`svelte-1g7r4za`,code:`
|
||
@keyframes svelte-1g7r4za-slide-out-to-left {
|
||
to {
|
||
transform: translateX(-100%);
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-1g7r4za-slide-out-to-right {
|
||
to {
|
||
transform: translateX(100%);
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-1g7r4za-slide-in-from-left {
|
||
from {
|
||
transform: translateX(-100%);
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-1g7r4za-slide-in-from-right {
|
||
from {
|
||
transform: translateX(100%);
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Slide the preview sideways when moving between the listed assets, as if they were laid out in
|
||
* a row: the next asset comes in from the end of the line, the previous one from the start. The
|
||
* toolbar, navigation buttons and info panel aren’t part of the transition, so they stay put and
|
||
* the info panel simply dissolves.
|
||
*/html:active-view-transition-type(next),
|
||
html:active-view-transition-type(previous) {
|
||
/* Keep the sliding snapshots within the preview area, off the info panel and the buttons */&::view-transition-image-pair(asset-details) {overflow:clip;}&::view-transition-old(asset-details),
|
||
&::view-transition-new(asset-details) {animation-duration:200ms;animation-timing-function:ease-out;animation-fill-mode:both;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}}html:active-view-transition-type(next) {&::view-transition-old(asset-details) {
|
||
animation-name: svelte-1g7r4za-slide-out-to-left;}&::view-transition-new(asset-details) {
|
||
animation-name: svelte-1g7r4za-slide-in-from-right;}&:dir(rtl) {&::view-transition-old(asset-details) {
|
||
animation-name: svelte-1g7r4za-slide-out-to-right;}&::view-transition-new(asset-details) {
|
||
animation-name: svelte-1g7r4za-slide-in-from-left;}}}html:active-view-transition-type(previous) {&::view-transition-old(asset-details) {
|
||
animation-name: svelte-1g7r4za-slide-out-to-right;}&::view-transition-new(asset-details) {
|
||
animation-name: svelte-1g7r4za-slide-in-from-left;}&:dir(rtl) {&::view-transition-old(asset-details) {
|
||
animation-name: svelte-1g7r4za-slide-out-to-left;}&::view-transition-new(asset-details) {
|
||
animation-name: svelte-1g7r4za-slide-in-from-right;}}}
|
||
|
||
/*
|
||
* The preview and the navigation buttons are named only for the previous/next transition: the
|
||
* buttons to be layered above the sliding preview, and the preview to slide on its own. During
|
||
* the page transitions, e.g. when the overlay is opened or closed on a small screen, they must
|
||
* stay unnamed to move along with the rest of the page.
|
||
*/html:is(:active-view-transition-type(next), :active-view-transition-type(previous)) {.preview.svelte-1g7r4za {view-transition-name:asset-details;}.row.svelte-1g7r4za .nav-button.previous {view-transition-name:asset-nav-previous;}.row.svelte-1g7r4za .nav-button.next {view-transition-name:asset-nav-next;}}.wrapper.svelte-1g7r4za {position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;background-color:var(--sui-secondary-background-color);.row:where(.svelte-1g7r4za) {flex:auto;display:flex;overflow:hidden;
|
||
|
||
@media (width < 768px) {flex-direction:column;.main:where(.svelte-1g7r4za) {flex:none;aspect-ratio:1 / 1;}.detail {flex:auto;border-block-start:var(--area-border);width:auto;}
|
||
}
|
||
|
||
@media (768px <= width) {.detail {border-inline-start:var(--area-border);}
|
||
}.main:where(.svelte-1g7r4za) {position:relative;flex:auto;display:flex;overflow:hidden;}.preview:where(.svelte-1g7r4za) {flex:auto;overflow:hidden;iframe {display:block;width:100%;height:100%;}}.nav-button {position:absolute;top:50%;translate:0 -50%;margin:0;border-radius:50%;opacity:0.5;&:hover,
|
||
&:focus-visible {opacity:1;}&.previous {inset-inline-start:16px;}&.next {inset-inline-end:16px;}}.detail {background-color:var(--sui-primary-background-color);}}}`};function vtt(e,t){k(t,!0),q(e,_tt);let n=e=>{var n=U(),r=F(n),i=e=>{var n=U();Uo(F(n),()=>t.actions,()=>!1),W(e,n)};K(r,e=>{sW.isSmallScreen&&e(i)}),W(e,n)},r=Y(t,`title`,3,void 0),i=Y(t,`contentKey`,3,void 0),a=Y(t,`onPrevious`,3,void 0),o=Y(t,`onNext`,3,void 0),s=Y(t,`info`,3,void 0),c=M(void 0),l;R(()=>{HQ.current&&dH(()=>B(c))}),vs(lH);let u=e=>e===`previous`?a():e===`next`?o():void 0,d=e=>{let t=u(utt(e,{container:B(c),rtl:Pc()}));t&&(e.preventDefault(),t())},f=({touches:e,target:t})=>{let{clientX:n,clientY:r}=e[0];l=dtt(t)?{x:n,y:r}:void 0},p=({changedTouches:e})=>{if(!l)return;let{clientX:t,clientY:n}=e[0],r=ftt({start:l,end:{x:t,y:n},rtl:Pc()});l=void 0,u(r)?.()};var m=gtt();go(`keydown`,ra,d);var h=P(m);No(h,i,e=>{{let i=j(()=>X(`primary`));pO(e,{variant:`primary`,get ariaLabel(){return B(i)},children:(e,i)=>{var a=mtt(),o=F(a);{let e=j(()=>X(`cancel_editing`));b5(o,{get"aria-label"(){return B(e)},useShortcut:!0,get onclick(){return t.onBack}})}var s=L(o,2);Xc(P(s),{children:(e,t)=>{var n=ptt(),i=I(n,!0);z(()=>G(i,r())),W(e,n)},$$slots:{default:!0}}),O(s);var c=L(s,2),l=e=>{var n=U();Uo(F(n),()=>t.actions,()=>!0),W(e,n)};K(c,e=>{sW.isSmallScreen||e(l)}),Uo(L(c,2),()=>t.editOptions,()=>n),W(e,a)},$$slots:{default:!0}})}});var g=L(h,2),_=P(g),v=P(_);No(v,i,e=>{var n=htt();Uo(P(n),()=>t.preview),O(n),W(e,n)});var y=L(v,2);{let e=e=>{{let t=j(()=>Pc()?`arrow_forward`:`arrow_back`);Lc(e,{get name(){return B(t)}})}},t=j(()=>X(`previous_asset`)),n=j(()=>!a());ll(y,{variant:`tertiary`,iconic:!0,class:`nav-button previous`,get"aria-label"(){return B(t)},get disabled(){return B(n)},onclick:()=>a()?.(),startIcon:e,$$slots:{startIcon:!0}})}var b=L(y,2);{let e=e=>{{let t=j(()=>Pc()?`arrow_back`:`arrow_forward`);Lc(e,{get name(){return B(t)}})}},t=j(()=>X(`next_asset`)),n=j(()=>!o());ll(b,{variant:`tertiary`,iconic:!0,class:`nav-button next`,get"aria-label"(){return B(t)},get disabled(){return B(n)},onclick:()=>o()?.(),startIcon:e,$$slots:{startIcon:!0}})}O(_),No(L(_,2),i,e=>{var t=U();Uo(F(t),()=>s()??jr),W(e,t)}),O(g),O(m),ms(m,e=>N(c,e),()=>B(c)),z(e=>J(m,`aria-label`,e),[()=>X(`asset_editor`)]),_o(`touchstart`,g,f,void 0,!0),_o(`touchend`,g,p),W(e,m),A()}vo([`touchstart`,`touchend`]);var ytt=V(`<!> <!>`,1);function x5(e,t){k(t,!0);let n=Y(t,`assets`,19,()=>[]),r=Y(t,`useButton`,3,!0),i=na({show:!1,status:`success`}),a=j(()=>r()?ll:iu),o=async()=>{try{for(let e of n())CSe(await t.getBlob(e),t.getName(e)),await Zc(300);i.status=`success`}catch(e){i.status=`error`,console.error(e)}finally{i.show=!0}};var s=ytt(),c=F(s);{let e=j(()=>!n().length),t=j(()=>X(`download`));Wo(c,()=>B(a),(n,r)=>{r(n,{variant:`ghost`,get disabled(){return B(e)},get label(){return B(t)},onclick:()=>{o()}})})}Pu(L(c,2),{get show(){return i.show},set show(e){i.show=e},children:(e,t)=>{Vc(e,{get status(){return i.status},children:(e,t)=>{var r=U(),a=F(r),o=e=>{var t=H();z(e=>G(t,e),[()=>X(`assets_downloaded`,{values:{count:n().length}})]),W(e,t)},s=e=>{var t=H();z(e=>G(t,e),[()=>X(`assets_dialog.error.image_fetch_failed`)]),W(e,t)};K(a,e=>{i.status===`success`?e(o):e(s,-1)}),W(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,s),A()}var btt=V(`<!> <!>`,1);function xtt(e,t){k(t,!0);let n=e=>{var n=U();Ro(F(n),17,()=>t.items,e=>e.label,(e,t)=>{iu(e,{get label(){return B(t).label},get disabled(){return B(t).disabled},onclick:()=>{a(B(t))}})}),W(e,n)},r=Y(t,`useButton`,3,!0),i=na({show:!1,text:``,status:`success`}),a=async({copy:e,toastKey:n})=>{try{await e(),i.status=`success`,i.text=X(n,{values:{count:t.count}})}catch(e){i.status=`error`,i.text=X(`clipboard_error`),console.error(e)}finally{i.show=!0}};var o=btt(),s=F(o),c=e=>{{let r=e=>{{let t=j(()=>X(`copy_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}},i=j(()=>!t.count),a=j(()=>X(`copy`));kl(e,{variant:`ghost`,get disabled(){return B(i)},get label(){return B(a)},popupPosition:`bottom-right`,popup:r,$$slots:{popup:!0}})}},l=e=>{{let r=e=>{n(e)},i=j(()=>!t.count),a=j(()=>X(`copy`));iu(e,{get disabled(){return B(i)},get label(){return B(a)},popupPosition:`left-top`,items:r,$$slots:{items:!0}})}};K(s,e=>{r()?e(c):e(l,-1)}),Pu(L(s,2),{get show(){return i.show},set show(e){i.show=e},children:(e,t)=>{Vc(e,{get status(){return i.status},children:(e,t)=>{$r();var n=H();z(()=>G(n,i.text)),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,o),A()}var Stt=e=>yk(e)?!0:hV.includes(e)?typeof navigator.clipboard.write==`function`:!1,Ctt=(e,{isImage:t=!1}={})=>{let n=lV.getType(e);return n?Stt(n):t},wtt=async e=>{let{type:t}=e;if(yk(t))await navigator.clipboard.writeText(await e.text());else{if(!hV.includes(t))throw Error(`Unsupported type`);await navigator.clipboard.write([new ClipboardItem({"image/png":t===`image/png`?e:await NV(e)})])}};function Ttt(e,t){k(t,!0);let n=Y(t,`assets`,19,()=>[]),r=Y(t,`useButton`,3,!0),i=j(()=>n().length===1&&Ctt(n()[0].fileName,{isImage:n()[0].kind===`image`})),a=async()=>{await navigator.clipboard.writeText(n().map(e=>e.downloadURL).join(`
|
||
`))},o=async()=>{await navigator.clipboard.writeText(n().map(e=>e.description).join(`
|
||
`))},s=async()=>{await navigator.clipboard.writeText(n().map(e=>e.id).join(`
|
||
`))},c=j(()=>n().some(e=>e.description!==e.downloadURL)),l=j(()=>n().some(e=>e.id!==e.downloadURL)),u=j(()=>[{label:X(`public_urls`,{values:{count:n().length}}),copy:a,toastKey:`asset_urls_copied`},B(c)&&{label:X(`file_paths`,{values:{count:n().length}}),copy:o,toastKey:`asset_paths_copied`},B(l)&&{label:X(`file_ids`,{values:{count:n().length}}),copy:s,toastKey:`asset_ids_copied`},{label:X(`file_data`),disabled:!B(i),copy:async()=>{await wtt(await A1(n()[0]))},toastKey:`asset_data_copied`}].filter(e=>!!e));xtt(e,{get items(){return B(u)},get count(){return n().length},get useButton(){return r()}}),A()}var Ett=V(`<!> <!>`,1),Dtt=V(`<!> <!> <!> <!> <!>`,1);function Ott(e,t){k(t,!0);let n=Y(t,`readOnly`,3,!1),r=Y(t,`canEdit`,3,!1),i=Y(t,`canRename`,3,!1),a=Y(t,`canReplace`,3,!1),o=Y(t,`onEdit`,3,void 0),s=Y(t,`onRename`,3,void 0),c=Y(t,`onReplace`,3,void 0),l=Y(t,`extraItems`,3,void 0),u=Y(t,`moreItems`,3,void 0);{let t=e=>{{let t=j(()=>X(`edit_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var d=Dtt(),f=F(d);Uo(f,()=>l()??jr);var p=L(f,2),m=e=>{{let t=j(()=>X(`edit`)),i=j(()=>X(`edit_asset`)),a=j(()=>n()||!r());iu(e,{variant:`ghost`,get label(){return B(t)},get"aria-label"(){return B(i)},get disabled(){return B(a)},get onclick(){return o()}})}};K(p,e=>{o()&&e(m)});var h=L(p,2),g=e=>{{let t=j(()=>X(`rename`)),r=j(()=>X(`rename_asset`)),a=j(()=>n()||!i());iu(e,{variant:`ghost`,get label(){return B(t)},get"aria-label"(){return B(r)},get disabled(){return B(a)},get onclick(){return s()}})}};K(h,e=>{s()&&e(g)});var _=L(h,2),v=e=>{{let t=j(()=>X(`replace`)),r=j(()=>X(`replace_asset`)),i=j(()=>n()||!a());iu(e,{variant:`ghost`,get label(){return B(t)},get"aria-label"(){return B(r)},get disabled(){return B(i)},get onclick(){return c()}})}};K(_,e=>{c()&&e(v)});var y=L(_,2),b=e=>{var t=Ett(),n=F(t);ql(n,{}),Uo(L(n,2),u),W(e,t)};K(y,e=>{u()&&e(b)}),W(e,d)},$$slots:{default:!0}})}},d=j(()=>X(`show_edit_options`));kl(e,{variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return B(d)},popup:t,$$slots:{popup:!0}})}A()}var ktt=V(`<!> <!>`,1);function Att(e,t){k(t,!0);let n=Y(t,`extraItems`,3,void 0),r=M(void 0),i=j(()=>vQ.current),a=e=>{t.asset&&(x1.current={files:[e],originalAsset:t.asset})};var o=ktt(),s=F(o);{let e=j(()=>!!t.asset),a=j(()=>!!t.asset),o=j(()=>B(i)?.rename?()=>{PQ.current=t.asset}:void 0),c=j(()=>B(i)?.replace?()=>{B(r)?.open()}:void 0);Ott(s,{get canRename(){return B(e)},get canReplace(){return B(a)},get onRename(){return B(o)},get onReplace(){return B(c)},get extraItems(){return n()}})}ms(Jl(L(s,2),{onSelect:({file:e})=>{a(e)}}),e=>N(r,e,!0),()=>B(r)),W(e,o),A()}var jtt=e=>Number.isFinite(e)?new Date(e*1e3).toISOString().substr(11,8):`–`,Mtt=V(`<section><h4> </h4> <p><!></p></section>`),Ntt=V(`<section><h4> </h4> <p> </p></section>`),Ptt=V(`<section><h4> </h4> <p> </p></section> <!> <!> <!>`,1);function Ftt(e,t){k(t,!0);let n=Y(t,`size`,3,void 0),r=Y(t,`hasDimensions`,3,!1),i=Y(t,`dimensions`,3,void 0),a=Y(t,`duration`,3,void 0),o=j(()=>bk(t.fileName)),s=j(()=>Nr(B(o).extension,``));var c=Ptt(),l=F(c),u=P(l),d=I(u,!0),f=I(L(u,2),!0);O(l);var p=L(l,2),m=e=>{var t=Mtt(),r=P(t),i=I(r,!0),a=L(r,2);No(P(a),()=>Fc.current,e=>{var t=H();z(e=>G(t,e),[()=>F$(n())]),W(e,t)}),O(a),O(t),z(e=>G(i,e),[()=>X(`size`)]),W(e,t)};K(p,e=>{n()&&e(m)});var h=L(p,2),g=e=>{var t=Ntt(),n=P(t),r=I(n,!0),a=I(L(n,2),!0);O(t),z(e=>{G(r,e),G(a,i()?`${i().width}×${i().height}`:`–`)},[()=>X(`dimensions`)]),W(e,t)};K(h,e=>{r()&&e(g)});var _=L(h,2),v=e=>{var t=Ntt(),n=P(t),r=I(n,!0),i=I(L(n,2),!0);O(t),z((e,t)=>{G(r,e),G(i,t)},[()=>X(`duration`),()=>a()?jtt(a()):`–`]),W(e,t)},y=j(()=>[`audio`,`video`].includes(t.kind));K(_,e=>{B(y)&&e(v)}),z((e,t)=>{G(d,e),G(f,t)},[()=>X(`kind`),()=>I$(t.fileName,{fallback:lV.getType(t.fileName)??(B(s)?B(s).toUpperCase():X(t.kind))})]),W(e,c),A()}var Itt=V(`<div role="none" class="preview svelte-173w06p"><!></div>`),Ltt=V(`<div role="none" class="detail svelte-173w06p"><!> <!></div>`),Rtt={hash:`svelte-173w06p`,code:`.detail.svelte-173w06p {flex:none;overflow-x:hidden;overflow-y:auto;padding:16px;width:320px;.preview:where(.svelte-173w06p) {overflow:hidden;margin:0 0 16px;border-radius:var(--sui-control-large-border-radius);background-color:var(--sui-content-background-color);aspect-ratio:1 / 1;}section {&:not(:last-child) {margin:0 0 16px;}& > * {margin:0 0 4px;word-break:break-all;}}h4 {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}}`};function S5(e,t){q(e,Rtt);let n=Y(t,`preview`,3,void 0);var r=Ltt(),i=P(r),a=e=>{var t=Itt();Uo(P(t),n),O(t),W(e,t)};K(i,e=>{n()&&e(a)}),Uo(L(i,2),()=>t.children),O(r),W(e,r)}var ztt=(e,t)=>{let n=()=>(t?.()).link,r=()=>(t?.()).collectionLabel,i=()=>(t?.()).entryLabel;var a=Vtt();ll(P(a),{role:`link`,variant:`link`,onclick:()=>b$(n(),{transitionType:`forwards`}),children:(e,t)=>{var n=Btt(),a=I(n);z(()=>G(a,`${r()??``} › ${i()??``}`)),W(e,n)},$$slots:{default:!0}}),O(a),W(e,a)},Btt=V(`<span role="none"> </span>`),Vtt=V(`<p><!></p>`),Htt=V(`<p> </p>`),Utt=V(`<section><h4> </h4> <!></section>`);function Wtt(e,t){k(t,!0);let n=j(()=>t.entries?.map(e=>({entry:e,collections:RL(e)})).filter(({collections:e})=>e.length));var r=Utt(),i=P(r),a=I(i,!0),o=L(i,2),s=e=>{var t=Htt(),n=I(t,!0);z(e=>G(n,e),[()=>X(`loading`)]),W(e,t)},c=e=>{var t=U();Ro(F(t),17,()=>B(n),({entry:e,collections:t})=>e.id,(e,t)=>{let n=()=>B(t).entry,r=()=>B(t).collections;var i=U();Ro(F(i),17,r,e=>e.name,(e,t)=>{var r=U();No(F(r),()=>Fc.current,e=>{let r=j(()=>XA(B(t)));var i=U();Ro(F(i),17,()=>sj(B(t),n()),e=>e.name,(e,n)=>{{let i=j(()=>({link:oP(`/collections/${B(t).name}/entries/${B(n).name}`),collectionLabel:B(r),entryLabel:oj(B(n))}));ztt(e,()=>B(i))}},e=>{{let i=j(()=>({link:oP(`/collections/${B(t).name}/entries/${n().subPath}`),collectionLabel:B(r),entryLabel:$L(B(t),n(),{useTemplate:!0})}));ztt(e,()=>B(i))}}),W(e,i)}),W(e,r)}),W(e,i)},e=>{var t=Htt(),n=I(t,!0);z(e=>G(n,e),[()=>X(`sort_keys.none`)]),W(e,t)}),W(e,t)};K(o,e=>{B(n)?e(c,-1):e(s)}),O(r),z(e=>G(a,e),[()=>X(`used_in`)]),W(e,r),A()}var Gtt=V(`<div role="none" class="unavailable svelte-3zctzm"><!></div>`),Ktt=V(`<section><h4> </h4> <p><bdi dir="ltr"> </bdi></p></section>`),qtt=V(`<section><h4> </h4> <p> </p></section>`),Jtt=V(`<!> <!> <section><h4> </h4> <p><a dir="ltr" target="_blank" rel="noopener noreferrer"> </a></p></section> <!> <!> <!>`,1),Ytt={hash:`svelte-3zctzm`,code:`.unavailable.svelte-3zctzm {margin:0 0 16px;}`};function Xtt(e,t){k(t,!0),q(e,Ytt);let n=e=>{{let t=j(()=>B(l)===`image`?B(s):B(c)),n=j(()=>B(l)===`image`),r=j(()=>[`audio`,`video`].includes(B(l)));O$(e,{get kind(){return B(l)},get src(){return B(t)},get alt(){return B(a)},variant:`tile`,get checkerboard(){return B(n)},get controls(){return B(r)}})}},r=M(na({})),i=M(void 0),a=j(()=>t.asset.fileName),o=j(()=>t.asset.description),s=j(()=>t.asset.previewURL),c=j(()=>t.asset.downloadURL),l=j(()=>t.asset.kind),u=j(()=>t.asset.size),d=j(()=>t.asset.lastModified),f=j(()=>B(r).dimensions),p=j(()=>B(r).duration),m=j(()=>VU(B(l))),h=j(()=>cQ.current[t.asset.id]===!1),g=AL(),_=async e=>{let t=g.next();N(r,{},!0),N(i,void 0);try{let n=await oQ(e);if(!t())return;N(r,n,!0)}catch{}try{let n=await sQ(e);t()&&N(i,n,!0)}catch(e){console.error(e),t()&&N(i,[],!0)}};R(()=>{_(t.asset)});{let t=j(()=>B(m)?n:void 0);S5(e,{get preview(){return B(t)},children:(e,t)=>{var n=Jtt(),r=F(n),s=e=>{var t=Gtt();Vc(P(t),{status:`error`,ariaLive:`off`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`file_unavailable_description`)]),W(e,n)},$$slots:{default:!0}}),O(t),W(e,t)};K(r,e=>{B(h)&&e(s)});var g=L(r,2);Ftt(g,{get fileName(){return B(a)},get kind(){return B(l)},get size(){return B(u)},get hasDimensions(){return B(m)},get dimensions(){return B(f)},get duration(){return B(p)}});var _=L(g,2),v=P(_),y=I(v,!0),b=L(v,2),x=P(b),S=I(x,!0);O(b),O(_);var C=L(_,2),w=e=>{var t=Ktt(),n=P(t),r=I(n,!0),i=L(n,2),a=P(i),s=I(a,!0);O(i),O(t),z(e=>{G(r,e),G(s,B(o)),a.dir=a.dir},[()=>X(`file_paths`,{values:{count:1}})]),W(e,t)};K(C,e=>{B(o)&&B(o)!==B(a)&&B(o)!==B(c)&&e(w)});var T=L(C,2);Wtt(T,{get entries(){return B(i)}});var ee=L(T,2),E=e=>{var t=qtt(),n=P(t),r=I(n,!0),i=I(L(n,2),!0);O(t),z((e,t)=>{G(r,e),G(i,t)},[()=>X(`sort_keys.last_modified`),()=>BN(B(d),Fc.current)]),W(e,t)};K(ee,e=>{B(d)&&e(E)}),z(e=>{G(y,e),J(x,`href`,B(c)),G(S,B(c)),x.dir=x.dir},[()=>X(`public_urls`,{values:{count:1}})]),W(e,n)},$$slots:{default:!0}})}A()}var Ztt=V(`<span role="none"> </span> <!>`,1);function C5(e,t){k(t,!0);let n=Y(t,`backPath`,3,`/collections`),r=()=>!0;DO(e,{children:(e,i)=>{var a=Ztt(),o=F(a),s=I(o,!0);ll(L(o,2),{variant:`primary`,onclick:()=>{x$(n(),{returnTo:r})},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`back`)]),W(e,n)},$$slots:{default:!0}}),z(()=>G(s,t.message)),W(e,a)},$$slots:{default:!0}}),A()}var Qtt=V(`<!> <!> <!>`,1),$tt=V(`<span role="alert"> </span>`);function ent(e,t){k(t,!0);let n=j(()=>vQ.current),r=j(()=>!!yQ.current),i=j(()=>yQ.current?.find(({id:e})=>e===NQ.current)),a=j(()=>B(i)?.kind),o=j(()=>B(i)?.fileName??``),s=j(()=>B(i)?.downloadURL??``),c=j(()=>lV.getType(B(o))),l=j(()=>B(i)?[B(i)]:[]),u=j(()=>mQ(B(n))),d=j(()=>YQ(J1.current,({id:e})=>e===B(i)?.id)),f=j(()=>B(d).previous),p=j(()=>B(d).next),m=(e,t)=>{b$(hQ(B(n),e),{replaceState:!0,transitionType:t})};{let t=(e,t=jr)=>{var r=Qtt(),i=F(r);Ttt(i,{get assets(){return B(l)},get useButton(){return t()}});var a=L(i,2);x5(a,{get assets(){return B(l)},getName:e=>e.fileName,get getBlob(){return A1},get useButton(){return t()}});var o=L(a,2),s=e=>{{let n=j(()=>X(`delete_assets`,{values:{count:1}})),r=j(()=>X(`confirm_deleting_this_asset`));y5(e,{get assets(){return B(l)},get deleteAssets(){return N1},get buttonDescription(){return B(n)},get dialogDescription(){return B(r)},onDelete:()=>{x$(B(u))},get useButton(){return t()}})}};K(o,e=>{B(n).delete&&e(s)}),W(e,r)},d=(e,t=jr)=>{var r=U(),a=F(r),o=e=>{Att(e,{get asset(){return B(i)},get extraItems(){return t()}})};K(a,e=>{(B(n).rename||B(n).replace||sW.isSmallScreen)&&e(o)}),W(e,r)},h=e=>{var t=U(),n=F(t),l=e=>{DO(e,{children:(e,t)=>{var n=$tt(),r=I(n,!0);z(e=>G(r,e),[()=>X(`loading`)]),W(e,n)},$$slots:{default:!0}})},d=e=>{{let t=j(()=>X(`file_not_found`));C5(e,{get message(){return B(t)},get backPath(){return B(u)}})}},f=e=>{ntt(e,{get kind(){return B(a)},get name(){return B(o)},get type(){return B(c)},get src(){return B(s)},getText:()=>A1(B(i)).then(e=>e.text())})};K(n,e=>{B(r)?!B(i)||!B(a)?e(d,1):e(f,-1):e(l)}),W(e,t)},g=e=>{var t=U(),n=F(t),r=e=>{Xtt(e,{get asset(){return B(i)}})};K(n,e=>{B(i)&&e(r)}),W(e,t)},_=j(()=>B(i)?.id),v=j(()=>B(f)?()=>m(B(f),`previous`):void 0),y=j(()=>B(p)?()=>m(B(p),`next`):void 0);vtt(e,{get title(){return B(o)},get contentKey(){return B(_)},onBack:()=>{x$(B(u))},get onPrevious(){return B(v)},get onNext(){return B(y)},actions:t,editOptions:d,preview:h,info:g,$$slots:{actions:!0,editOptions:!0,preview:!0,info:!0}})}A()}var tnt=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),nnt=V(`<div><!></div>`),rnt={hash:`svelte-1sdsl2g`,code:`.list-container.svelte-1sdsl2g {--icon-size: 36px;flex:auto;position:relative;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;}`};function w5(e,t){q(e,rnt);let n=Y(t,`children`,3,void 0),r=gs(t,tnt);var i=nnt();us(i,()=>({role:`group`,class:`list-container`,...r}),void 0,void 0,void 0,`svelte-1sdsl2g`),Uo(P(i),()=>n()??jr),O(i),W(e,i)}var int=new Set([`$$slots`,`$$events`,`$$legacy`,`viewType`,`aria-label`,`scrollKey`,`children`]),ant=V(`<div role="none"><!></div>`),ont={hash:`svelte-1sfbolp`,code:`:is(.grid-view.svelte-1sfbolp, .list-view.svelte-1sfbolp, .table-view.svelte-1sfbolp) {display:block;padding:0 16px 16px;height:100%;overflow-y:auto;}.grid-view.svelte-1sfbolp {
|
||
@media (width < 768px) {padding:4px;
|
||
}.row-group-caption {display:block;grid-column:1 / -1; /* span the entire row */th {display:block;}}.row-group:not(:first-child) .row-group-caption {margin-top:16px;}.grid-body {display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--grid-size, 200px), 1fr));gap:16px;border-width:0;
|
||
|
||
@media (width < 768px) {grid-template-columns:repeat(auto-fill, minmax(var(--grid-size, 160px), 1fr));gap:8px;
|
||
}}.grid-row {display:block;position:relative;overflow:hidden;height:auto;text-align:start;.grid-cell {display:block;&.image:empty {aspect-ratio:1 / 1;}}.checkbox {position:absolute;inset-block-start:4px;inset-inline-start:4px;z-index:2;}.title {.label {overflow:hidden;margin:12px;height:calc(var(--sui-line-height-compact) * 2);line-height:var(--sui-line-height-compact);}}
|
||
|
||
/* Editorial Workflow status, shown below the title on a tile */.status {margin:-4px 12px 12px;}&[tabindex] {border-radius:var(--sui-control-large-border-radius);background-color:var(--sui-secondary-background-color);cursor:pointer;transition:background-color 200ms;&:is(:hover, :focus, :active) {background-color:var(--sui-hover-background-color);}}}}:is(.list-view.svelte-1sfbolp, .table-view.svelte-1sfbolp) {
|
||
@media (width < 768px) {padding:0;
|
||
}[role='grid'] {
|
||
@media (width < 768px) {width:100%;--sui-focus-ring-width: 0;
|
||
}.row-group {.row-group-caption + .grid-row {.grid-cell {border-top-width:0 !important;}}.row-group-caption ~ .grid-row:last-child {.grid-cell {border-bottom-width:0 !important;}}}.grid-row {transition-property:background-color, outline-color;transition-duration:200ms;&[tabindex] {cursor:pointer;}&:hover {background-color:var(--sui-hover-background-color);}&:last-child .grid-cell {border-width:1px 0;}}.grid-cell {overflow:hidden;border-width:1px 0 0;border-color:var(--sui-secondary-border-color);padding:0 16px 0 0;height:40px;max-width:100%;color:var(--sui-secondary-foreground-color);white-space:nowrap;vertical-align:middle;
|
||
|
||
@media (width < 768px) {border-width:0 !important;height:64px;
|
||
}&.checkbox {padding-inline-start:8px !important;width:44px;}&.title {width:100%; /* flex: auto */color:var(--sui-primary-foreground-color);}
|
||
|
||
/*
|
||
* The column is as wide as the widest Editorial Workflow status badge, so align the
|
||
* badges to the end of the row rather than letting the narrower ones float mid-column
|
||
*/&.status {text-align:end;}&:first-child {padding-inline-start:16px;}.label {overflow:hidden;
|
||
|
||
@media (width < 768px) {white-space:normal;line-height:var(--sui-line-height-compact);
|
||
}}&.image {width:48px;&:empty::before {display:block;border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size);height:var(--icon-size);background-color:var(--sui-secondary-background-color);content:'';}}}}}
|
||
|
||
/* The table view is a list view with more columns, only shown on a large screen */.table-view.svelte-1sfbolp {[role='grid'] {
|
||
/* The header row can be focused, but it doesn’t open anything */.grid-head .grid-row {cursor:default;&:hover {background-color:transparent;}}.grid-col-header {position:sticky;inset-block-start:0;z-index:1;border-bottom:1px solid var(--sui-secondary-border-color);padding:0 16px 0 0;height:40px;background-color:var(--sui-primary-background-color);color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);text-align:start;white-space:nowrap;vertical-align:middle;&:first-child {padding-inline-start:16px;}}
|
||
|
||
/* Each column is as wide as its content, up to a limit; the text is truncated beyond */.grid-cell.title {width:auto;.label {width:max-content;min-width:160px;max-width:400px;}}.grid-cell.column .label {width:max-content;max-width:320px;}
|
||
|
||
/* The last column takes up the rest of the width, so the others are as wide as their
|
||
content */:is(.grid-cell, .grid-col-header).status {width:100%;}}}`};function T5(e,t){k(t,!0),q(e,ont);let n=Y(t,`aria-label`,3,void 0),r=Y(t,`scrollKey`,3,void 0),i=Y(t,`children`,3,void 0),a=gs(t,int),o;R(()=>{r(),o&&(o.scrollTop=0)});var s=ant();Mo(P(s),Zc,null,e=>{Zae(e,_s({multiple:!0,clickToSelect:!1,get ariaLabel(){return n()}},()=>a,{children:(e,t)=>{var n=U();Uo(F(n),()=>i()??jr),W(e,n)},$$slots:{default:!0}}))}),O(s),$o(s,()=>e=>{o=e}),z(()=>rs(s,1,`${t.viewType??``}-view`,`svelte-1sfbolp`)),W(e,s),A()}var snt=V(`<!> <!>`,1),cnt=V(`<span role="none"> </span> <!>`,1),lnt={hash:`svelte-1lyfhki`,code:`
|
||
/* Keep the compact folder tiles apart from the asset tiles below them */.grid-view .grid-body.subfolders:not(:last-child) {margin-bottom:16px;}`};function unt(e,t){k(t,!0),q(e,lnt);let n=Y(t,`onBlankClick`,3,void 0),r=Y(t,`subfolders`,3,void 0),i=Y(t,`hasSubfolders`,3,!1),a=Y(t,`emptyAction`,3,void 0),o=j(()=>Object.values(t.groups).some(e=>e.length));{let s=j(()=>X(`asset_list`));w5(e,{get"aria-label"(){return B(s)},onclick:e=>{e.target.closest(`[role="row"], button, [role="menu"]`)||n()?.()},children:(e,n)=>{R$(e,{get disabled(){return t.uploadDisabled},multiple:!0,onDrop:({files:e})=>{t.onDrop(e)},children:(e,n)=>{var s=U(),c=F(s),l=e=>{{let n=j(()=>X(`assets`));T5(e,{id:`asset-list`,get viewType(){return t.viewType},get"aria-label"(){return B(n)},get"aria-rowcount"(){return t.totalCount},children:(e,n)=>{var a=snt(),o=F(a),s=e=>{Yl(e,{class:`subfolders`,children:(e,t)=>{var n=U();Uo(F(n),()=>r()??jr),W(e,n)},$$slots:{default:!0}})};K(o,e=>{i()&&e(s)}),Ro(L(o,2),17,()=>Object.entries(t.groups),([e,t])=>e,(e,n)=>{var r=j(()=>Pr(B(n),2));let i=()=>B(r)[0],a=()=>B(r)[1];var o=U();Mo(F(o),Zc,null,e=>{{let n=j(()=>i()===`*`?void 0:gR(i())),r=j(()=>i()!==`*`),o=j(()=>!yR(BQ.current,i()));Yl(e,{get label(){return B(n)},get collapsible(){return B(r)},get expanded(){return B(o)},onChange:({detail:{expanded:e}})=>{BQ.current=Bke(BQ.current,i(),!e)},children:(e,n)=>{gu(e,{get items(){return a()},get itemKey(){return t.itemKey},get renderItem(){return t.renderItem}})},$$slots:{default:!0}})}}),W(e,o)}),W(e,a)},$$slots:{default:!0}})}},u=e=>{DO(e,{children:(e,n)=>{var r=cnt(),i=F(r),o=I(i,!0),s=L(i,2),c=e=>{var t=U();Uo(F(t),()=>a()??jr),W(e,t)};K(s,e=>{t.uploadDisabled||e(c)}),z(e=>G(o,e),[()=>X(`no_files_found`)]),W(e,r)},$$slots:{default:!0}})};K(c,e=>{B(o)||i()?e(l):e(u,-1)}),W(e,s)},$$slots:{default:!0}})},$$slots:{default:!0}})}A()}var dnt=V(`<bdi> </bdi>`),fnt=V(`<div role="none" class="label svelte-17zk54k"><!></div>`),pnt=V(`<!> <!>`,1),mnt=V(`<!> <!> <!>`,1),hnt={hash:`svelte-17zk54k`,code:`.label.svelte-17zk54k {word-break:break-all;}`};function gnt(e,t){k(t,!0),q(e,hnt);let n=Y(t,`asset`,3,void 0),r=Y(t,`src`,3,void 0),i=Y(t,`status`,3,void 0),a=()=>{t.canPreview&&t.onPreview()};{let o=j(()=>t.rowIndex>=0?t.rowIndex+1:void 0);$l(e,{get"aria-rowindex"(){return B(o)},get"aria-label"(){return t.name},onChange:e=>{t.onSelectionChange(e.detail.selected)},get onfocus(){return t.onFocus},onclick:e=>{cW(e)&&a()},ondblclick:a,children:(e,a)=>{var o=mnt(),s=F(o),c=e=>{Zl(e,{class:`checkbox`,children:(e,n)=>{{let n=j(()=>X(`select_item`,{values:{name:t.name}}));jl(e,{tabindex:`-1`,get ariaLabel(){return B(n)},get checked(){return t.selected},onChange:({detail:{checked:e}})=>{t.onSelectionChange(e)}})}},$$slots:{default:!0}})};K(s,e=>{sW.isSmallScreen||sW.isMediumScreen||e(c)});var l=L(s,2);Zl(l,{class:`image`,children:(e,i)=>{{let i=j(()=>r()?t.name:``),a=j(()=>t.viewType===`list`?`icon`:`tile`),o=j(()=>t.kind===`image`);O$(e,{get kind(){return t.kind},get asset(){return n()},get src(){return r()},get alt(){return B(i)},get variant(){return B(a)},get cover(){return sW.isSmallScreen},get checkerboard(){return B(o)}})}},$$slots:{default:!0}});var u=L(l,2),d=e=>{var n=pnt(),r=F(n);Zl(r,{class:`title`,children:(e,n)=>{var r=fnt();Xc(P(r),{lines:2,children:(e,n)=>{var r=dnt(),i=I(r,!0);z(()=>G(i,t.name)),W(e,r)},$$slots:{default:!0}}),O(r),W(e,r)},$$slots:{default:!0}});var a=L(r,2),o=e=>{Zl(e,{class:`status`,children:(e,t)=>{var n=U();Uo(F(n),i),W(e,n)},$$slots:{default:!0}})};K(a,e=>{i()&&e(o)}),W(e,n)};K(u,e=>{sW.isSmallScreen&&t.viewType!==`list`||e(d)}),W(e,o)},$$slots:{default:!0}})}A()}var _nt=V(`<span role="none" class="badge svelte-57ciq1"> </span>`),vnt={hash:`svelte-57ciq1`,code:`
|
||
/*
|
||
* Filled pill following the same background/foreground/border recipe as the Alert and Infobar
|
||
* components, so the colors adapt to both the light and dark themes.
|
||
*/.badge.svelte-57ciq1 {display:inline-block;border-width:1px;border-style:solid;border-radius:12px;border-color:var(--sui-error-border-color);padding:1px 6px;background-color:var(--sui-error-background-color);color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-x-small);line-height:var(--sui-line-height-compact);white-space:nowrap;}`};function ynt(e,t){k(t,!0),q(e,vnt);var n=_nt(),r=I(n,!0);z(e=>G(r,e),[()=>X(`file_unavailable`)]),W(e,n),A()}function bnt(e,t){k(t,!0);let n=e=>{var t=U(),n=F(t),r=e=>{ynt(e,{})};K(n,e=>{B(a)&&e(r)}),W(e,t)},r=j(()=>PWe.current.has(t.asset.id)),i=j(()=>vQ.current?.serviceId===`linked`),a=j(()=>cQ.current[t.asset.id]===!1),o=j(()=>bQ(vQ.current)&&!K1.current?t.asset.description:t.asset.fileName),s=()=>{let e=vQ.current;e&&b$(hQ(e,t.asset),{transitionType:`forwards`})},c=e=>{AQ.current=Eq(AQ.current,t.asset,e,(e,t)=>e.id===t.id)};{let a=j(()=>NKe.current.get(t.asset.id)??-1),l=j(()=>gQ(t.asset)),u=j(()=>B(i)?n:void 0);gnt(e,{get name(){return B(o)},get kind(){return t.asset.kind},get src(){return t.asset.previewURL},get rowIndex(){return B(a)},get viewType(){return t.viewType},get selected(){return B(r)},get canPreview(){return B(l)},onSelectionChange:c,onFocus:()=>{jQ.current=t.asset,CQ.current=void 0},onPreview:()=>{s()},get status(){return B(u)}})}A()}var xnt=V(`<div role="none" class="preview svelte-g07uie"><!></div>`),Snt=V(`<bdi> </bdi>`),Cnt=V(`<!> <!>`,1),wnt=V(`<div role="none" class="menu svelte-g07uie"><!></div>`),Tnt=V(`<div role="none" class="title-inner svelte-g07uie"><div role="none" class="label svelte-g07uie"><!></div> <!></div>`),Ent=V(`<!> <!> <!>`,1),Dnt={hash:`svelte-g07uie`,code:`.preview.svelte-g07uie {display:inline-flex;align-items:center;justify-content:center;color:var(--sui-secondary-foreground-color);.sui.icon {font-size:24px;}}.title-inner.svelte-g07uie {display:flex;align-items:center;gap:8px;}.label.svelte-g07uie {flex:auto;min-width:0;word-break:break-all;}.menu.svelte-g07uie {flex:none;}
|
||
/* A folder is a compact tile in the grid view, with the icon, the name and the menu in a row,
|
||
unlike an asset, which needs the room for its thumbnail. The selectors are specific enough to
|
||
win over the tile styles of the listing grid */.grid-view .grid-body .grid-row.subfolder {display:flex;align-items:center;gap:12px;padding:8px 8px 8px 16px;.grid-cell.image {flex:none;display:flex;aspect-ratio:auto;}.grid-cell.title {flex:auto;min-width:0;.label {margin:0;height:auto;}}}.list-view .grid-body .grid-row.subfolder {
|
||
/* The icon sits in a box the size of an asset thumbnail, so the two line up */.preview {width:var(--icon-size);height:var(--icon-size);}.grid-cell.title {padding-inline-end:8px;}}`};function Ont(e,t){k(t,!0),q(e,Dnt);let n=Y(t,`hasCheckboxColumn`,3,!1),r=Y(t,`onFocus`,3,void 0),i=Y(t,`onRename`,3,void 0),a=Y(t,`onDelete`,3,void 0),o=Y(t,`actionsDisabled`,3,!1),s=e=>{e.stopPropagation()};{let c=j(()=>t.rowIndex+1),l=j(()=>X(`folder`));$l(e,{class:`subfolder`,get"aria-rowindex"(){return B(c)},get"aria-label"(){return t.subfolder.name},get"aria-description"(){return B(l)},onfocus:()=>{r()?.()},onclick:e=>{cW(e)&&t.onOpen()},get ondblclick(){return t.onOpen},children:(e,r)=>{var c=Ent(),l=F(c),u=e=>{Zl(e,{class:`checkbox`})};K(l,e=>{t.viewType===`list`&&n()&&e(u)});var d=L(l,2);Zl(d,{class:`image`,children:(e,t)=>{var n=xnt();Lc(P(n),{name:`folder`}),O(n),W(e,n)},$$slots:{default:!0}}),Zl(L(d,2),{class:`title`,children:(e,n)=>{var r=Tnt(),c=P(r),l=P(c);{let e=j(()=>t.viewType===`list`?1:2);Xc(l,{get lines(){return B(e)},children:(e,n)=>{var r=Snt(),i=I(r,!0);z(()=>G(i,t.subfolder.name)),W(e,r)},$$slots:{default:!0}})}O(c);var u=L(c,2),d=e=>{var t=wnt(),n=P(t);{let e=e=>{{let t=j(()=>X(`folder_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=Cnt(),r=F(n),s=e=>{{let t=j(()=>X(`rename`)),n=j(()=>X(`rename_folder`));iu(e,{variant:`ghost`,get label(){return B(t)},get"aria-label"(){return B(n)},get disabled(){return o()},get onclick(){return i()}})}};K(r,e=>{i()&&e(s)});var c=L(r,2),l=e=>{{let t=j(()=>X(`delete`)),n=j(()=>X(`delete_folder`));iu(e,{variant:`ghost`,get label(){return B(t)},get"aria-label"(){return B(n)},get disabled(){return o()},get onclick(){return a()}})}};K(c,e=>{a()&&e(l)}),W(e,n)},$$slots:{default:!0}})}},t=j(()=>X(`show_folder_options`));kl(n,{variant:`ghost`,iconic:!0,size:`small`,popupPosition:`bottom-right`,get"aria-label"(){return B(t)},popup:e,$$slots:{popup:!0}})}O(t),_o(`click`,t,s),_o(`dblclick`,t,s),W(e,t)};K(u,e=>{(i()||a())&&e(d)}),O(r),W(e,r)},$$slots:{default:!0}}),W(e,c)},$$slots:{default:!0}})}A()}vo([`click`,`dblclick`]);function knt(e,t){k(t,!0);let n=j(()=>vQ.current),r=j(()=>!!B(n).move&&!!B(n).createFolder&&!!B(n).deleteFolder),i=j(()=>!!B(n).delete&&!!B(n).deleteFolder);{let n=j(()=>!(sW.isSmallScreen||sW.isMediumScreen)),a=j(()=>B(r)?()=>{TQ.current=t.subfolder}:void 0),o=j(()=>B(i)?()=>{EQ.current=t.subfolder}:void 0);Ont(e,{get subfolder(){return t.subfolder},get rowIndex(){return t.rowIndex},get viewType(){return t.viewType},get hasCheckboxColumn(){return B(n)},onOpen:()=>{RQ(t.subfolder.path)},onFocus:()=>{CQ.current=t.subfolder,jQ.current=void 0},get onRename(){return B(a)},get onDelete(){return B(o)}})}A()}function Ant(e,t){k(t,!0);let n=Y(t,`label`,3,void 0),r=Y(t,`disabled`,3,!1);{let i=e=>{Lc(e,{name:`cloud_upload`})},a=j(()=>!n()),o=j(()=>X(`upload_assets`));ll(e,{variant:`primary`,get iconic(){return B(a)},get disabled(){return r()},get label(){return n()},get"aria-label"(){return B(o)},get onclick(){return t.onclick},startIcon:i,$$slots:{startIcon:!0}})}A()}var jnt=V(`<!> <!>`,1);function Mnt(e,t){k(t,!0);let n=Y(t,`label`,3,void 0),r=M(void 0),i=j(()=>vQ.current),a=j(()=>!B(i)?.upload||!LQ(B(i)));var o=jnt(),s=F(o);Ant(s,{get label(){return n()},get disabled(){return B(a)},onclick:()=>{B(r)?.open()}}),ms(Jl(L(s,2),{multiple:!0,onSelect:({files:e})=>{x1.current={files:e}}}),e=>N(r,e,!0),()=>B(r)),W(e,o),A()}var Nnt=V(`<span role="alert"> </span>`);function Pnt(e,t){k(t,!0);let n=j(()=>vQ.current),r=j(()=>BQ.current.type),i=j(()=>!B(n).upload),a=j(()=>q1.current.length);var o=U(),s=F(o),c=e=>{{let t=j(()=>X(`asset_list`));w5(e,{get"aria-label"(){return B(t)},children:(e,t)=>{var r=U(),i=F(r),a=e=>{gB(e,{onSelect:()=>void 0})};K(i,e=>{B(n).serviceId===`cloudinary`&&e(a)}),W(e,r)},$$slots:{default:!0}})}},l=e=>{{let t=j(()=>X(`asset_list`));w5(e,{get"aria-label"(){return B(t)},children:(e,t)=>{{let t=j(()=>OQ.current?X(`assets_dialog.error.${OQ.current}`):void 0);M$(e,{get serviceProps(){return B(n)},get error(){return B(t)}})}},$$slots:{default:!0}})}},u=j(()=>!LQ(B(n))||OQ.current),d=e=>{{let t=j(()=>X(`asset_list`));w5(e,{get"aria-label"(){return B(t)},children:(e,t)=>{DO(e,{children:(e,t)=>{var n=Nnt(),r=I(n,!0);z(e=>G(r,e),[()=>X(`loading`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})}},f=e=>{{let t=e=>{var t=U();Ro(F(t),19,()=>q1.current,e=>e.path,(e,t,n)=>{knt(e,{get subfolder(){return B(t)},get rowIndex(){return B(n)},get viewType(){return B(r)}})}),W(e,t)},n=(e,t=jr)=>{bnt(e,{get asset(){return t()},get viewType(){return B(r)}})},o=e=>{{let t=j(()=>X(`upload_assets`));Mnt(e,{get label(){return B(t)}})}},s=j(()=>B(a)+J1.current.length),c=j(()=>!!B(a));unt(e,{get groups(){return Y1.current},itemKey:`id`,get totalCount(){return B(s)},get hasSubfolders(){return B(c)},get viewType(){return B(r)},get uploadDisabled(){return B(i)},onDrop:e=>{x1.current={files:e}},onBlankClick:()=>{jQ.current=void 0,CQ.current=void 0},subfolders:t,renderItem:n,emptyAction:o,$$slots:{subfolders:!0,renderItem:!0,emptyAction:!0}})}};K(s,e=>{B(n).authType===`widget`?e(c):B(u)?e(l,1):yQ.current?e(f,-1):e(d,2)}),W(e,o),A()}function Fnt(e,t){k(t,!0);let n=j(()=>EQ.current),r=j(()=>!!B(n)),i=j(()=>B(n)?.name??``),a=j(()=>B(n)?P1(B(n).path).length:0);{let t=j(()=>X(`delete_folder`)),o=j(()=>X(`delete`));Il(e,{get title(){return B(t)},get okLabel(){return B(o)},onOk:()=>{B(n)&&mKe(B(n))},onClose:()=>{EQ.current=void 0},get open(){return B(r)},set open(e){N(r,e)},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`confirm_deleting_folder`,{values:{name:B(i),count:B(a)}})]),W(e,n)},$$slots:{default:!0}})}A()}var Int=e=>{var t=Lnt();Lc(P(t),{name:`folder`}),O(t),W(e,t)},Lnt=V(`<div role="none" class="folder-preview svelte-mzxrkp"><!></div>`),Rnt=V(`<section><h4> </h4> <p><bdi dir="ltr"> </bdi></p></section>`),znt=V(`<p> </p>`),Bnt=V(`<section><h4> </h4> <p><bdi> </bdi></p></section> <!> <section><h4> </h4> <!> <p> </p></section>`,1),Vnt={hash:`svelte-mzxrkp`,code:`.folder-preview.svelte-mzxrkp {display:flex;align-items:center;justify-content:center;height:100%;color:var(--sui-secondary-foreground-color);.sui.icon {font-size:96px;}}`};function Hnt(e,t){k(t,!0),q(e,Vnt);let n=Y(t,`path`,3,void 0),r=Y(t,`folderCount`,3,void 0);S5(e,{get preview(){return Int},children:(e,i)=>{var a=Bnt(),o=F(a),s=P(o),c=I(s,!0),l=L(s,2),u=I(P(l),!0);O(l),O(o);var d=L(o,2),f=e=>{var t=Rnt(),r=P(t),i=I(r,!0),a=L(r,2),o=P(a),s=I(o,!0);O(a),O(t),z(e=>{G(i,e),G(s,`/${n()}`),o.dir=o.dir},[()=>X(`folder_path`)]),W(e,t)};K(d,e=>{n()!==void 0&&e(f)});var p=L(d,2),m=P(p),h=I(m,!0),g=L(m,2),_=e=>{var t=znt(),n=I(t,!0);z(e=>G(n,e),[()=>X(`x_folders`,{values:{count:r()}})]),W(e,t)};K(g,e=>{r()!==void 0&&e(_)});var v=I(L(g,2),!0);O(p),z((e,n,r)=>{G(c,e),G(u,t.name),G(h,n),G(v,r)},[()=>X(`folder`),()=>X(`folder_contents`),()=>X(`x_assets`,{values:{count:t.assetCount}})]),W(e,a)},$$slots:{default:!0}}),A()}function Unt(e,t){k(t,!0);let n=j(()=>MKe.current);Hnt(e,{get name(){return B(n).name},get path(){return B(n).path},get folderCount(){return B(n).folderCount},get assetCount(){return B(n).assetCount}}),A()}function Wnt(e,t){k(t,!0);let n=j(()=>vQ.current),r=j(()=>ZV({subfolders:q1.current,fileNames:J1.current.map(({fileName:e})=>e)})),i=j(()=>G1({dirPath:SQ.current,serviceLabel:B(n).serviceLabel}));{let t=j(()=>X(`new_folder`)),n=j(()=>X(`new_folder_create`)),a=j(()=>X(`new_folder_description`,{values:{folder:B(i)}}));pH(e,{get title(){return B(t)},get okLabel(){return B(n)},get description(){return B(a)},get takenNames(){return B(r)},onSubmit:e=>{fKe(e)},get open(){return wQ.current},set open(e){wQ.current=e}})}A()}function Gnt(e,t){k(t,!0);let n=Y(t,`disabled`,3,!1);{let r=e=>{Lc(e,{name:`create_new_folder`})},i=j(()=>sW.isSmallScreen?`secondary`:`ghost`),a=j(()=>X(`new_folder`));ll(e,{get variant(){return B(i)},iconic:!0,get disabled(){return n()},get"aria-label"(){return B(a)},get onclick(){return t.onclick},startIcon:r,$$slots:{startIcon:!0}})}A()}function Knt(e,t){k(t,!0);var n=U(),r=F(n),i=e=>{Gnt(e,{onclick:()=>{wQ.current=!0}})};K(r,e=>{K1.current&&vQ.current?.createFolder&&e(i)}),W(e,n),A()}function qnt(e,t){k(t,!0);let n=Y(t,`path`,3,void 0),r=Y(t,`disabled`,3,!1),i=Y(t,`state`,3,void 0);{let t=j(()=>r()||!n()),a=j(()=>X(`preview`)),o=j(()=>X(`show_preview`));ll(e,{variant:`ghost`,get disabled(){return B(t)},get label(){return B(a)},get"aria-label"(){return B(o)},onclick:()=>{b$(n(),{transitionType:`forwards`,state:i()})}})}A()}var Jnt=V(`<bdi class="svelte-1okrlal"> </bdi>`),Ynt=V(`<!> <h2 role="none" class="svelte-1okrlal"><!></h2> <!> <!>`,1),Xnt={hash:`svelte-1okrlal`,code:`
|
||
/* Two floating buttons — New Folder and Upload — sit side by side on a small screen */.asset-library-toolbar .floating-action-button-wrapper {
|
||
@media (width < 768px) {display:flex;gap:12px;
|
||
}}h2.svelte-1okrlal {
|
||
/* A long name is cut short rather than wrapped, so the toolbar stays one line tall */& > bdi:where(.svelte-1okrlal) {overflow:hidden;min-width:0;white-space:nowrap;text-overflow:ellipsis;}
|
||
/* An ancestor folder in the breadcrumb reads as part of the heading, only dimmed to tell it
|
||
from the current folder. The class is repeated to make the selectors specific enough to exempt
|
||
the labels and the separators from the small type the toolbar gives any \`<span>\` in the
|
||
heading, which is a rule with a scoping class of its own */.breadcrumb.breadcrumb.breadcrumb {
|
||
/* Take the whole heading, so the trail is measured against the room it can actually use */flex:auto;font-size:inherit;.sui.button.crumb .label,
|
||
.sui.icon.separator,
|
||
span.current {font-size:inherit;opacity:1;}.sui.button.crumb .label {font-weight:var(--sui-font-weight-normal, normal);}span.current {font-weight:inherit;}}}`};function Znt(e,t){k(t,!0),q(e,Xnt);let n=Y(t,`subfolderNames`,19,()=>[]),r=Y(t,`actions`,3,void 0),i=Y(t,`fab`,3,void 0),a=j(()=>n().at(-1)??t.rootLabel),o=j(()=>eH({rootLabel:t.rootLabel,subfolderNames:n(),onBrowse:({depth:e})=>{t.onBrowse(e,!1)}}));{let s=j(()=>X(`folder`));pO(e,{variant:`primary`,class:`asset-library-toolbar`,get ariaLabel(){return B(s)},children:(e,s)=>{var c=Ynt(),l=F(c),u=e=>{{let r=j(()=>X(n().length?`back_to_parent_folder`:`back_to_asset_folder_list`));b5(e,{get"aria-label"(){return B(r)},onclick:()=>{n().length?t.onBrowse(n().length-1,!0):x$(`/assets`)}})}};K(l,e=>{sW.isSmallScreen&&e(u)});var d=L(l,2),f=P(d),p=e=>{bB(e,{get items(){return B(o)}})},m=e=>{var t=Jnt(),n=I(t,!0);z(()=>G(n,B(a))),W(e,t)};K(f,e=>{!sW.isSmallScreen&&B(o).length?e(p):e(m,-1)}),O(d);var h=L(d,2),g=e=>{var t=U();Uo(F(t),()=>r()??jr),W(e,t)};K(h,e=>{sW.isSmallScreen||sW.isMediumScreen||e(g)}),dl(L(h,2),{children:(e,t)=>{var n=U();Uo(F(n),()=>i()??jr),W(e,n)},$$slots:{default:!0}}),W(e,c)},$$slots:{default:!0}})}A()}var Qnt=V(`<!> <!> <!> <!> <!>`,1),$nt=V(`<!> <!>`,1);function ert(e,t){k(t,!0);let n=j(()=>vQ.current),r=j(()=>jQ.current),i=j(()=>K1.current&&SQ.current?SQ.current.split(`/`):[]),a=j(()=>FWe.current);Znt(e,{get rootLabel(){return B(n).serviceLabel},get subfolderNames(){return B(i)},onBrowse:e=>{RQ(B(i).slice(0,e).join(`/`))},actions:e=>{var t=Qnt(),i=F(t);{let e=j(()=>B(r)?hQ(B(n),B(r)):void 0),t=j(()=>!B(r)||!gQ(B(r)));qnt(i,{get path(){return B(e)},get disabled(){return B(t)}})}var o=L(i,2);{let e=j(()=>B(r)?[B(r)]:[]);Ttt(o,{get assets(){return B(e)}})}var s=L(o,2);x5(s,{get assets(){return B(a)},getName:e=>e.fileName,get getBlob(){return A1}});var c=L(s,2),l=e=>{{let t=j(()=>X(`delete_selected_assets`,{values:{count:B(a).length}})),n=j(()=>X(B(a).length>1&&B(a).length===J1.current.length?`confirm_deleting_all_assets`:`confirm_deleting_selected_assets`,{values:{count:B(a).length}}));y5(e,{get assets(){return B(a)},get deleteAssets(){return N1},get buttonDescription(){return B(t)},get dialogDescription(){return B(n)}})}};K(c,e=>{B(n).delete&&e(l)});var u=L(c,2),d=e=>{Att(e,{get asset(){return B(r)}})};K(u,e=>{(B(n).rename||B(n).replace)&&e(d)}),W(e,t)},fab:e=>{var t=$nt(),r=F(t);Knt(r,{});var i=L(r,2),a=e=>{{let t=j(()=>sW.isSmallScreen?void 0:X(`upload`));Mnt(e,{get label(){return B(t)}})}};K(i,e=>{B(n).upload&&(!sW.isSmallScreen||yQ.current?.length)&&e(a)}),W(e,t)},$$slots:{actions:!0,fab:!0}}),A()}var trt=V(`<p role="alert" class="svelte-1v918mk"> </p>`),nrt=V(`<p role="alert" class="warning svelte-1v918mk"> </p>`),rrt=V(`<p class="svelte-1v918mk"> </p> <!>`,1),irt=V(`<div role="status" class="note svelte-1v918mk"> </div>`),art=V(`<!> <div role="none" class="svelte-1v918mk"><!></div> <!> <div role="none" class="error svelte-1v918mk"><!></div>`,1),ort=V(`<!> <!>`,1),srt={hash:`svelte-1v918mk`,code:`p.svelte-1v918mk {margin:0 0 8px;}div.svelte-1v918mk {display:flex;align-items:center;gap:4px;}.warning.svelte-1v918mk {color:var(--sui-warning-foreground-color);}.note.svelte-1v918mk {margin:4px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.error.svelte-1v918mk {margin:0;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function crt(e,t){let n=Co();k(t,!0),q(e,srt);let r=Y(t,`open`,15,!1),i=Y(t,`folderNames`,19,()=>[]),a=Y(t,`fileNames`,19,()=>[]),o=Y(t,`usedEntryCount`,3,0),s=Y(t,`warning`,3,void 0),c=Y(t,`blockedMessage`,3,void 0),l=Y(t,`slugificationEnabled`,3,!1),u=Y(t,`onClose`,3,void 0),d=M(!1),f=M(void 0),p=!1,m=M(``),h=j(()=>bk(t.name)),g=j(()=>B(h).extension),_=j(()=>B(m).trim()),v=j(()=>B(_)?UX(B(_),{slugificationEnabled:l()}):``),y=j(()=>bk(B(v)).extension),b=j(()=>!fP(B(g),B(y))),x=j(()=>JHe({name:B(_),fileName:B(v),otherNames:t.otherNames,folderNames:i(),fileNames:a()})),S=j(()=>!!B(x)),C=async()=>{await ao(),B(f)&&(B(f).focus(),B(f).setSelectionRange(0,bk(B(f).value).filename.length))};R(()=>{r()&&(p||N(m,t.name,!0),p=!1)}),R(()=>{HQ.current||(r(!1),N(d,!1),u()?.())});var w=ort(),T=F(w);{let e=j(()=>X(`rename_x`,{values:{name:t.name}})),i=j(()=>X(`rename`)),a=j(()=>!!c()||B(v)===t.name||B(S));Pl(T,{get title(){return B(e)},get okLabel(){return B(i)},get okDisabled(){return B(a)},onOk:()=>{B(b)?N(d,!0):t.onRename(B(v))},onClose:()=>{B(d)||u()?.()},onOpen:()=>{C()},get open(){return r()},set open(e){r(e)},children:(e,t)=>{var r=art(),i=F(r),a=e=>{var t=trt(),n=I(t,!0);z(()=>G(n,c())),W(e,t)},l=e=>{var t=rrt(),n=F(t),r=I(n,!0),i=L(n,2),a=e=>{var t=nrt(),n=I(t,!0);z(()=>G(n,s())),W(e,t)};K(i,e=>{s()&&e(a)}),z(e=>G(r,e),[()=>X(`enter_new_name_for_asset`,{values:{count:o()}})]),W(e,t)};K(i,e=>{c()?e(a):e(l,-1)});var u=L(i,2),d=P(u);{let e=j(()=>!!c());Gl(d,{dir:`auto`,flex:!0,get disabled(){return B(e)},get invalid(){return B(S)},get"aria-errormessage"(){return`${n}-error`},get value(){return B(m)},set value(e){N(m,e,!0)},get element(){return B(f)},set element(e){N(f,e,!0)}})}O(u);var p=L(u,2),h=e=>{var t=irt(),n=I(t,!0);z(e=>G(n,e),[()=>X(`file_will_be_saved_as`,{values:{name:B(v)}})]),W(e,t)};K(p,e=>{!B(S)&&B(v)!==B(_)&&e(h)});var g=L(p,2),y=P(g),b=e=>{var t=H();z(e=>G(t,e),[()=>X(`enter_new_name_for_asset_error.${B(x)}`)]),W(e,t)};K(y,e=>{B(S)&&e(b)}),O(g),z(()=>J(g,`id`,`${n}-error`)),W(e,r)},$$slots:{default:!0}})}var ee=L(T,2);{let e=j(()=>X(`rename`));mZe(ee,{get oldExtension(){return B(g)},get newExtension(){return B(y)},get okLabel(){return B(e)},onOk:()=>{t.onRename(B(v)),u()?.()},onCancel:()=>{p=!0,r(!0)},get open(){return B(d)},set open(e){N(d,e,!0)}})}W(e,w),A()}function lrt(e,t){k(t,!0);let n=j(()=>PQ.current),r=j(()=>!!B(n)),i=j(()=>bk(B(n)?.id??``)),a=j(()=>B(i).dirname),o=j(()=>yQ.current??[]),s=j(()=>B(o).filter(e=>e.id!==B(n)?.id&&bk(e.id).dirname===B(a)).map(e=>e.fileName)),c=M(0),l=async e=>{if(N(c,0),!e)return;let t=await sQ(e);B(n)===e&&N(c,t.length,!0)};R(()=>{l(B(n))});let u=async e=>{let t=vQ.current;if(!B(n)||!t)return;let r=B(n).id,i=await uKe(B(n),e);i&&NQ.current===r&&(NQ.current=i.id,await b$(hQ(t,i),{replaceState:!0,notifyChange:!1}))};{let t=j(()=>B(n)?.fileName??``),i=j(()=>B(c)?X(`renaming_external_asset_breaks_links`,{values:{count:B(c)}}):void 0);crt(e,{get name(){return B(t)},get otherNames(){return B(s)},get warning(){return B(i)},onRename:u,onClose:()=>{PQ.current=void 0},get open(){return B(r)},set open(e){N(r,e)}})}A()}function urt(e,t){k(t,!0);let n=j(()=>TQ.current),r=j(()=>!!B(n)),i=j(()=>B(n)?.name??``),a=j(()=>B(n)?P1(B(n).path):[]),o=M(0),s=async e=>{N(o,0);let t=await CWe(e);B(a)===e&&N(o,t.length,!0)};R(()=>{s(B(a))});let c=j(()=>ZV({subfolders:q1.current,fileNames:J1.current.map(({fileName:e})=>e),exclude:B(i)}));{let t=j(()=>X(`rename_x`,{values:{name:B(i)}})),s=j(()=>X(`rename`)),l=j(()=>X(`enter_new_name_for_external_folder`,{values:{count:B(a).length}})),u=j(()=>B(o)?X(`renaming_external_folder_breaks_links`,{values:{count:B(o)}}):void 0);pH(e,{get title(){return B(t)},get okLabel(){return B(s)},get description(){return B(l)},get warning(){return B(u)},get name(){return B(i)},get takenNames(){return B(c)},onSubmit:e=>{B(n)&&pKe(B(n),e)},onClose:()=>{TQ.current=void 0},get open(){return B(r)},set open(e){N(r,e)}})}A()}var drt=V(`<span role="none"> </span>`);function frt(e,t){k(t,!0);let n=Y(t,`fallback`,3,void 0);var r=U(),i=F(r),a=e=>{{let r=j(()=>X(`asset_info`));OO(e,{id:`asset-info`,class:`secondary-sidebar`,get ariaLabel(){return B(r)},children:(e,r)=>{var i=U(),a=F(i),o=e=>{var n=U();Uo(F(n),()=>t.children,()=>t.asset),W(e,n)},s=e=>{var t=U();Uo(F(t),n),W(e,t)},c=e=>{DO(e,{children:(e,t)=>{var n=drt(),r=I(n,!0);z(e=>G(r,e),[()=>X(`select_asset_show_info`)]),W(e,n)},$$slots:{default:!0}})};K(a,e=>{t.asset?e(o):n()?e(s,1):e(c,-1)}),W(e,i)},$$slots:{default:!0}})}};K(i,e=>{sW.isLargeScreen&&BQ.current.showInfo&&e(a)}),W(e,r),A()}var prt=V(`<!> <!>`,1);function mrt(e,t){k(t,!0);let n=Y(t,`currentView`,7),r=Y(t,`label`,3,``),i=Y(t,`disabled`,3,!1),a=Y(t,`multiple`,3,!1),o=Y(t,`noneLabel`,3,``),s=Y(t,`filters`,19,()=>[]);{let c=e=>{{let r=j(()=>X(`filtering_options`));ru(e,{get ariaLabel(){return B(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=U(),i=F(r),c=e=>{var t=U();Ro(F(t),17,s,e=>hR(mR(e)),(e,t)=>{let r=j(()=>{let{label:e}=B(t);return{_label:e}}),i=j(()=>mR(B(t))),a=j(()=>hR(B(i))),o=j(()=>(n().current.filters||[]).findIndex(e=>hR(e)===B(a)));{let t=j(()=>B(o)>-1);ou(e,{get label(){return B(r)._label},get checked(){return B(t)},onChange:()=>{let e=n().current,t=e.filters?[...e.filters]:[];B(o)>-1?t.splice(B(o),1):t.push(B(i)),n().current={...e,filters:t}}})}}),W(e,t)},l=e=>{var t=prt(),r=F(t);{let e=j(()=>o()||X(`sort_keys.none`)),t=j(()=>!n().current.filter);su(r,{get label(){return B(e)},get checked(){return B(t)},onSelect:()=>{n().current={...n().current,filter:void 0}}})}Ro(L(r,2),17,s,e=>hR(mR(e)),(e,t)=>{let r=j(()=>{let{label:e}=B(t);return{_label:e}}),i=j(()=>mR(B(t))),a=j(()=>hR(B(i)));{let t=j(()=>!!n().current.filter&&hR(n().current.filter)===B(a));su(e,{get label(){return B(r)._label},get checked(){return B(t)},onSelect:()=>{n().current={...n().current,filter:B(i)}}})}}),W(e,t)};K(i,e=>{a()?e(c):e(l,-1)}),W(e,r)},$$slots:{default:!0}})}},l=j(()=>r()||X(`filter`));kl(e,{variant:`ghost`,get label(){return B(l)},get disabled(){return i()},popupPosition:`bottom-right`,popup:c,$$slots:{popup:!0}})}A()}var hrt=V(`<!> <!> <!> <!> <!>`,1);function grt(e,t){k(t,!0);let n=Y(t,`currentView`,7),r=Y(t,`label`,3,``),i=Y(t,`disabled`,3,!1),a=Y(t,`noneLabel`,3,``),o=Y(t,`groups`,19,()=>[]),s=Y(t,`groupNames`,19,()=>[]),c=j(()=>Rke(s())),l=j(()=>B(c).some(e=>yR(n().current,e))),u=j(()=>B(c).some(e=>!yR(n().current,e)));{let s=e=>{{let r=j(()=>X(`grouping_options`));ru(e,{get ariaLabel(){return B(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=hrt(),i=F(r);{let e=j(()=>a()||X(`sort_keys.none`)),t=j(()=>!n().current.group);su(i,{get label(){return B(e)},get checked(){return B(t)},onSelect:()=>{n().current={...n().current,group:null}}})}var s=L(i,2);Ro(s,17,o,e=>hR(mR(e)),(e,t)=>{let r=j(()=>{let{label:e}=B(t);return{_label:e}}),i=j(()=>mR(B(t))),a=j(()=>hR(B(i)));{let t=j(()=>!!n().current.group&&hR(n().current.group)===B(a));su(e,{get label(){return B(r)._label},get checked(){return B(t)},onSelect:()=>{n().current={...n().current,group:B(i)}}})}});var d=L(s,2);ql(d,{});var f=L(d,2);{let e=j(()=>X(`expand_all`)),t=j(()=>!B(l));iu(f,{get label(){return B(e)},get disabled(){return B(t)},onclick:()=>{n().current=Vke(n().current,B(c),!1)}})}var p=L(f,2);{let e=j(()=>X(`collapse_all`)),t=j(()=>!B(u));iu(p,{get label(){return B(e)},get disabled(){return B(t)},onclick:()=>{n().current=Vke(n().current,B(c),!0)}})}W(e,r)},$$slots:{default:!0}})}},d=j(()=>r()||X(`group`));kl(e,{variant:`ghost`,get label(){return B(d)},get disabled(){return i()},popupPosition:`bottom-right`,popup:s,$$slots:{popup:!0}})}A()}var _rt=V(`<span role="none" class="svelte-1sd2xgz"> </span>`),vrt=V(`<div role="none" class="wrapper svelte-1sd2xgz"><!> <!></div>`),yrt={hash:`svelte-1sd2xgz`,code:`.wrapper.svelte-1sd2xgz {display:flex;align-items:center;gap:4px;margin-inline:20px;}span.svelte-1sd2xgz {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}`};function brt(e,t){k(t,!0),q(e,yrt);let n=Y(t,`selectedItems`,7),r=j(()=>t.allItems.length),i=j(()=>n().current.length),a=j(()=>!!B(i)),o=j(()=>B(a)&&B(i)===B(r));var s=vrt(),c=P(s);{let e=j(()=>!B(r)),i=j(()=>X(`select_all`)),s=j(()=>B(a)&&!B(o)?`mixed`:B(a));jl(c,{get disabled(){return B(e)},get ariaLabel(){return B(i)},get checked(){return B(s)},onChange:()=>{n().current=B(o)?[]:[...t.allItems]}})}var l=L(c,2),u=e=>{var t=_rt(),n=I(t,!0);z(e=>G(n,e),[()=>X(`x_of_x_selected`,{values:{total:B(r),selected:B(i)}})]),W(e,t)};K(l,e=>{B(a)&&e(u)}),O(s),W(e,s),A()}var xrt=V(`<!> <!>`,1);function Srt(e,t){k(t,!0);let n=Y(t,`currentView`,7),r=Y(t,`label`,3,``),i=Y(t,`disabled`,3,!1),a=Y(t,`sortKeys`,19,()=>[]),o=Y(t,`collectionName`,3,void 0),s=({key:e,label:t,type:n},r)=>X(`${r}${n===`date`||tAe.includes(e)||o()&&_M({collectionName:o(),keyPath:e})?.widget===`datetime`?`_date`:n===`number`?`_number`:``}`,{values:{label:t}});{let o=e=>{{let r=j(()=>X(`sorting_options`));ru(e,{get ariaLabel(){return B(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=U();Ro(F(r),17,a,e=>e.key,(e,t)=>{let r=j(()=>B(t));var i=xrt(),o=F(i);Ro(o,16,()=>eAe,e=>e,(e,i)=>{{let a=j(()=>s(B(t),i)),o=j(()=>n().current.sort?.key===B(r).key&&n().current.sort.order===i);su(e,{get label(){return B(a)},get checked(){return B(o)},onSelect:()=>{n().current={...n().current,sort:{key:B(r).key,order:i}}}})}});var c=L(o,2),l=e=>{ql(e,{})};K(c,e=>{B(r).key===`_summary`&&a().length>1&&e(l)}),W(e,i)}),W(e,r)},$$slots:{default:!0}})}},c=j(()=>r()||X(`sort`));kl(e,{variant:`ghost`,get label(){return B(c)},get disabled(){return i()},popupPosition:`bottom-right`,popup:o,$$slots:{popup:!0}})}A()}var Crt=V(`<!> <!>`,1),wrt=V(`<!> <!> <!> <!> <!> <!> <!> <!>`,1);function Trt(e,t){k(t,!0);let n=Y(t,`groups`,19,()=>[]),r=Y(t,`groupNames`,19,()=>[]),i=Y(t,`searchTerms`,7,void 0),a=j(()=>!!t.totalCount),o=j(()=>t.totalCount>1);{let s=j(()=>X(`asset_list`));pO(e,{variant:`secondary`,get ariaLabel(){return B(s)},children:(e,s)=>{var c=wrt(),l=F(c),u=e=>{brt(e,{get allItems(){return t.allItems},get selectedItems(){return t.selectedItems}})};K(l,e=>{sW.isSmallScreen||sW.isMediumScreen||e(u)});var d=L(l,2);Ml(d,{flex:!0});var f=L(d,2),p=e=>{{let t=j(()=>X(`assets_dialog.search_for_file`));vu(e,{dir:`auto`,get flex(){return sW.isSmallScreen},get ariaLabel(){return B(t)},"aria-controls":`asset-list`,get value(){return i().current},set value(e){i().current=e}})}};K(f,e=>{i()&&e(p)});var m=L(f,2);{let e=j(()=>!B(o));Srt(m,{get disabled(){return B(e)},get currentView(){return BQ},get sortKeys(){return t.sortKeys},"aria-controls":`asset-list`})}var h=L(m,2);{let e=j(()=>X(`type`)),t=j(()=>!B(o)),n=j(()=>X(`all`)),r=j(()=>LPe.map(e=>({label:X(e),field:`fileType`,pattern:e})));mrt(h,{get label(){return B(e)},get disabled(){return B(t)},get currentView(){return BQ},get noneLabel(){return B(n)},get filters(){return B(r)},"aria-controls":`asset-list`})}var g=L(h,2),_=e=>{{let t=j(()=>!B(o));grt(e,{get disabled(){return B(t)},get currentView(){return BQ},get groups(){return n()},get groupNames(){return r()},"aria-controls":`asset-list`})}};K(g,e=>{n().length&&e(_)});var v=L(g,2);{let e=j(()=>!B(a));a3(v,{get disabled(){return B(e)},get currentView(){return BQ},"aria-controls":`asset-list`})}var y=L(v,2),b=e=>{var t=Crt(),n=F(t);ql(n,{orientation:`vertical`});var r=L(n,2);{let e=e=>{Lc(e,{name:`info`})},t=j(()=>!B(a)),n=j(()=>!!BQ.current.showInfo),i=j(()=>!!BQ.current.showInfo),o=j(()=>X(BQ.current.showInfo?`hide_info`:`show_info`));ll(r,{variant:`ghost`,iconic:!0,get disabled(){return B(t)},get pressed(){return B(n)},"aria-controls":`asset-info`,get"aria-expanded"(){return B(i)},get"aria-label"(){return B(o)},onclick:()=>{BQ.current={...BQ.current,showInfo:!BQ.current.showInfo}},startIcon:e,$$slots:{startIcon:!0}})}W(e,t)};K(y,e=>{sW.isSmallScreen||sW.isMediumScreen||e(b)}),W(e,c)},$$slots:{default:!0}})}A()}var Ert,Drt=new Set([`$$slots`,`$$events`,`$$legacy`,`primaryToolbar`,`secondaryToolbar`,`mainContent`,`secondarySidebar`]),Ort=V(`<main><!> <div role="none" class="main-inner svelte-1x2ldab"><div role="none" class="main-inner-main svelte-1x2ldab"><!> <!></div> <!></div></main>`),krt={hash:`svelte-1x2ldab`,code:`.wrapper.svelte-1x2ldab {flex:auto;display:flex;flex-direction:column;overflow:hidden;height:100%;background-color:var(--sui-primary-background-color);
|
||
|
||
@media (768px <= width) {view-transition-name:page-main;
|
||
}.sui.toolbar.primary {justify-content:center;
|
||
|
||
@media (width < 768px) {border-block-end:var(--area-border);background-color:var(--sui-secondary-background-color);
|
||
}}}
|
||
|
||
/* The area sits next to the primary sidebar and below the global toolbar */.resizable-pane > .wrapper.svelte-1x2ldab {border-block-start:var(--area-border);border-inline-start:var(--area-border);border-start-start-radius:16px;}.main-inner.svelte-1x2ldab {flex:auto;display:flex;overflow:hidden;.main-inner-main:where(.svelte-1x2ldab) {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.secondary-sidebar {flex:none;overflow:auto;box-sizing:content-box;width:320px;background-color:var(--sui-secondary-background-color);
|
||
|
||
@media (768px <= width) {border-block-start:var(--area-border);border-inline-start:var(--area-border);border-start-start-radius:16px;
|
||
}[role='listbox'] {padding:12px;}}}`};function E5(e,t){k(t,!0),q(e,krt);let n=Y(t,`primaryToolbar`,3,void 0),r=Y(t,`secondaryToolbar`,3,void 0),i=Y(t,`mainContent`,3,void 0),a=Y(t,`secondarySidebar`,3,void 0),o=gs(t,Drt),s={};R(()=>(Ert=s,d$.current=o[`aria-label`]??``,()=>{Ert===s&&(d$.current=``)}));var c=Ort();us(c,()=>({class:`wrapper`,...o}),void 0,void 0,void 0,`svelte-1x2ldab`);var l=P(c);Uo(l,()=>n()??jr);var u=L(l,2),d=P(u),f=P(d);Uo(f,()=>r()??jr),Uo(L(f,2),()=>i()??jr),O(d),Uo(L(d,2),()=>a()??jr),O(u),O(c),W(e,c),A()}var Art=e=>{Unt(e,{})},jrt=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),Mrt=V(`<!> <!>`,1),Nrt=V(`<!> <!> <!>`,1),Prt=V(`<!> <!> <!> <!> <!>`,1);function Frt(e,t){k(t,!0);let n=j(()=>vQ.current),r=j(()=>S1().max_file_size??1/0),i=M(void 0);R(()=>{let{files:e,originalAsset:t}=x1.current;e.length&&co(async()=>{x1.current={files:[]},B(i)?.report(await lKe(e,{originalAsset:t}))})});var a=Prt(),o=F(a);{let e=e=>{ert(e,{})},t=e=>{var t=U(),n=F(t),r=e=>{{let t=j(()=>Object.keys(Y1.current));Trt(e,{get allItems(){return J1.current},get selectedItems(){return AQ},get totalCount(){return yQ.current.length},get sortKeys(){return xKe.current},get groups(){return DKe.current},get groupNames(){return B(t)},get searchTerms(){return FQ}})}};K(n,e=>{yQ.current?.length&&e(r)}),W(e,t)},r=e=>{var t=Mrt(),n=F(t),r=e=>{var t=jrt(),n=F(t);Po(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{status:`warning`,dismissible:!1,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`external_assets_truncated`)]),W(e,n)},$$slots:{default:!0}}),O(n),W(e,t)};K(n,e=>{kQ.current&&e(r)}),Pnt(L(n,2),{}),W(e,t)},i=e=>{{let t=(e,t=jr)=>{Xtt(e,{get asset(){return t()}})},r=j(()=>bQ(B(n))&&yQ.current?Art:void 0);frt(e,{get asset(){return jQ.current},get fallback(){return B(r)},children:t,$$slots:{default:!0}})}},a=j(()=>X(`x_asset_folder`,{values:{folder:B(n).serviceLabel}}));E5(o,{id:`assets-container`,get"aria-label"(){return B(a)},primaryToolbar:e,secondaryToolbar:t,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}var s=L(o,2);lrt(s,{});var c=L(s,2),l=e=>{var t=Nrt(),n=F(t);Wnt(n,{});var r=L(n,2);urt(r,{}),Fnt(L(r,2),{}),W(e,t)},u=j(()=>bQ(B(n)));K(c,e=>{B(u)&&e(l)});var d=L(c,2);Pu(d,{get show(){return b1.current.show},set show(e){b1.current.show=e},children:(e,t)=>{Vc(e,{get status(){return b1.current.status},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(b1.current.message)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),ms(V$(L(d,2),{get maxSize(){return B(r)}}),e=>N(i,e,!0),()=>B(i)),W(e,a),A()}var D5=WO(null),O5=WO(``),Irt=/^\/search\/(?<terms>.+)$/,k5=e=>Irt.test(e),Lrt=e=>{let{groups:t}=e.match(Irt)??{};if(!t)return!1;let{terms:n}=t;return n&&n!==O5.current&&(O5.current=n),D5.current||=`contents`,!0},Rrt=/^\/assets(?:\/(?<folderPath>.+?)(?:\/(?<fileName>[^/]+\.[A-Za-z0-9]+))?)?$/,zrt=e=>RB.current.some(({internalPath:t})=>t===e)||[...qB.current,...nV.current].some(t=>t.path.startsWith(`${e}/`)),A5=0,Brt=()=>Fc.current&&BB.current?GQ(BB.current):``,j5=()=>({folder:BB.current}),Vrt=({path:e},{transitionType:t=`forwards`,replaceState:n=!1}={})=>{b$(oP(`/assets/${e}`),{transitionType:t,replaceState:n,state:j5()})},Hrt=()=>{A5+=1},Urt=(e,t,n)=>{let r=NWe(t);return BB.current=void 0,r?(vQ.current!==r&&(IWe(),vQ.current=r),n?(NQ.current=n,HQ.current=!0,u$.current=X(`viewing_x_asset_details`,{values:{name:n.split(`/`).pop()}})):(NQ.current=void 0,HQ.current=!1,u$.current=X(`viewing_x_external_location`,{values:{service:r.serviceLabel}})),e):(vQ.current=void 0,HQ.current=!1,u$.current=X(`asset_folder_not_found`),{...e,notFound:!0})},Wrt=e=>sW.isSmallScreen?(BB.current=void 0,HQ.current=!1,u$.current=X(`viewing_asset_folder_list`),{...e,isIndexPage:!0}):(RB.current.length?(BB.current=qV(`-/all`).folder,BV.current=``,b$(`/assets/-/all`,{replaceState:!0})):b$(mQ(pQ.current[0]??fQ),{replaceState:!0}),e),Grt=async e=>{await Zc(100),e===A5&&(HQ.current=!1,u$.current=X(`viewing_x_asset_folder`,{values:{folder:Brt(),count:qQ.current.length}}))},Krt=()=>{let{path:e}=p$(),t=e.match(Rrt),n={isIndexPage:!1,isSearchPage:!1,notFound:!1};A5+=1;let r=A5;if(!t?.groups)return HQ.current=!1,{...n,isSearchPage:Lrt(e)};let{folderPath:i,fileName:a}=t.groups;if(i?.startsWith(`-/`)&&i!==`-/all`){let[e,...t]=i.slice(2).split(`/`);return Urt(n,e,[...t,...a?[a]:[]].join(`/`))}if(vQ.current=void 0,!i)return Wrt(n);if(!a&&i.includes(`/`)&&qB.current.some(e=>e.path===i)){let e=i.lastIndexOf(`/`);a=i.slice(e+1),i=i.slice(0,e)}if(a){let e=`${i}/${a}`;!qB.current.some(t=>t.path===e)&&zrt(e)&&(i=e,a=void 0)}let{folder:o,subfolderPath:s=``}=qV(i,window.history.state?.folder)??{};return!o&&!a?(BB.current=void 0,BV.current=``,HQ.current=!1,u$.current=X(`asset_folder_not_found`),{...n,notFound:!0}):(o?((0,Cr.default)(BB.current,o)||(BB.current=o),BV.current=s):(BB.current=void 0,BV.current=``),a?(ZB.current=qB.current.find(e=>e.path===`${i}/${a}`),u$.current=ZB.current?X(`viewing_x_asset_details`,{values:{name:ZB.current.name}}):X(`file_not_found`),HQ.current=!0,n):(Grt(r),n))};function qrt(e,t){k(t,!0);let n=e=>{YB.current=Eq(YB.current,t.asset,e)};{let r=j(()=>qWe.current.get(t.asset.path)??-1),i=j(()=>FMe.current.has(t.asset.path)),a=j(()=>UU(t.asset));gnt(e,{get name(){return t.asset.name},get kind(){return t.asset.kind},get asset(){return t.asset},get rowIndex(){return B(r)},get viewType(){return t.viewType},get selected(){return B(i)},get canPreview(){return B(a)},onSelectionChange:n,onFocus:()=>{XB.current=t.asset,VV.current=void 0},onPreview:()=>{Vrt(t.asset)}})}A()}function Jrt(e,t){k(t,!0);let n=()=>{b$(oP(`/assets/${t.subfolder.path}`),{transitionType:`forwards`,state:{folder:BB.current}})};{let r=j(()=>!(sW.isSmallScreen||sW.isMediumScreen)),i=j(()=>GB.current||!!BB.current?.readonly||EB(t.subfolder.path));Ont(e,{get subfolder(){return t.subfolder},get rowIndex(){return t.rowIndex},get viewType(){return t.viewType},get hasCheckboxColumn(){return B(r)},onOpen:n,onFocus:()=>{VV.current=t.subfolder,XB.current=void 0},onRename:()=>{HV.current=t.subfolder},onDelete:()=>{UV.current=t.subfolder},get actionsDisabled(){return B(i)}})}A()}function Yrt(e,t){k(t,!0);let n=Y(t,`label`,3,void 0),r=j(()=>GB.current||!WB(VB.current)||YV.current);Ant(e,{get label(){return n()},get disabled(){return B(r)},onclick:()=>{UQ.current=!0}}),A()}function Xrt(e,t){k(t,!0);let n=j(()=>BQ.current.type),r=j(()=>VB.current),i=j(()=>JQ.current.length),a=j(()=>GB.current||!WB(B(r))||YV.current);{let t=e=>{var t=U();Ro(F(t),19,()=>JQ.current,e=>e.path,(e,t,r)=>{Jrt(e,{get subfolder(){return B(t)},get rowIndex(){return B(r)},get viewType(){return B(n)}})}),W(e,t)},o=(e,t=jr)=>{var r=U();No(F(r),()=>t().sha,e=>{qrt(e,{get asset(){return t()},get viewType(){return B(n)}})}),W(e,r)},s=e=>{{let t=j(()=>X(`upload_assets`));Yrt(e,{get label(){return B(t)}})}},c=j(()=>B(i)+qQ.current.length),l=j(()=>!!B(i));unt(e,{get groups(){return QQ.current},itemKey:`path`,get totalCount(){return B(c)},get viewType(){return B(n)},get uploadDisabled(){return B(a)},get hasSubfolders(){return B(l)},onDrop:e=>{QB.current={folder:B(r),subfolderPath:BV.current,files:e}},onBlankClick:()=>{XB.current=void 0,VV.current=void 0},subfolders:t,renderItem:o,emptyAction:s,$$slots:{subfolders:!0,renderItem:!0,emptyAction:!0}})}A()}var Zrt=V(`<!> <!>`,1);function Qrt(e,t){k(t,!0);let n=M(!1),r=M(!1),i=M(void 0),a=j(()=>UV.current),o=j(()=>B(a)?.name??``),s=j(()=>B(a)?Y4(B(a).path):[]),c=j(()=>!!B(i)?.blockers.length),l=async()=>{if(!B(a))return;let{ok:e,cancelled:t}=await F4(()=>IYe(B(a).path));!e&&!t&&N(r,!0)};R(()=>{if(!B(a))return;let e=B(s);N(i,void 0),N(n,!0),A4(e).then(e=>{UV.current===B(a)&&N(i,e,!0)})});var u=Zrt(),d=F(u);{let e=j(()=>X(`delete_folder`)),t=j(()=>X(`delete`)),r=j(()=>!B(i)||B(c));Il(d,{get title(){return B(e)},get okLabel(){return B(t)},get okDisabled(){return B(r)},onOk:()=>{l()},onClose:()=>{UV.current=void 0},get open(){return B(n)},set open(e){N(n,e,!0)},children:(e,t)=>{var n=Zrt(),r=F(n),a=e=>{var t=H();z(e=>G(t,e),[()=>X(`confirm_deleting_folder`,{values:{name:B(o),count:B(s).length}})]),W(e,t)};K(r,e=>{B(c)||e(a)});var l=L(r,2),u=e=>{v5(e,{get plan(){return B(i)},kind:`asset`,get count(){return B(s).length}})};K(l,e=>{B(i)&&e(u)}),W(e,n)},$$slots:{default:!0}})}Pu(L(d,2),{get show(){return B(r)},set show(e){N(r,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`deleting_folder_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,u),A()}var $rt=new Map,M5={publicURL:void 0,repoBlobURL:void 0,dimensions:void 0,duration:void 0,usedEntries:[]},eit=async e=>{let{kind:t}=e;if(!VU(t))return{};let n=await wX(e);return n?xWe(e,n,t):{}},tit=e=>{let{sha:t}=e;return t?bA($rt,t,()=>eit(e)):eit(e)},N5=async e=>{let{path:t}=e,{blobBaseURL:n}=XJ.current?.repository??{};return{...await tit(e),publicURL:LX(e),repoBlobURL:n?`${n}/${oP(t)}`:void 0}},nit=async e=>{let{url:t}=e0(e);if(t)return tQ(t);let[n]=await rQ([{asset:e}]);return n};function rit(e,t){k(t,!0);let n=Y(t,`assets`,19,()=>[]),r=Y(t,`useButton`,3,!0),i=M(na([])),a=M(!1),o=j(()=>B(i).filter(({publicURL:e})=>!!e).map(({publicURL:e})=>e)),s,c=j(()=>[{label:X(`public_urls`,{values:{count:n().length}}),disabled:!B(o).length,copy:async()=>{await navigator.clipboard.writeText(B(o).join(`
|
||
`))},toastKey:`asset_urls_copied`},{label:X(`file_paths`,{values:{count:n().length}}),copy:async()=>{await navigator.clipboard.writeText(n().map(({path:e})=>`/${e}`).join(`
|
||
`))},toastKey:`asset_paths_copied`},{label:X(`file_data`),disabled:!B(a),copy:async()=>{await wtt(s)},toastKey:`asset_data_copied`}]);XO(()=>{let e=n();return N(i,[],!0),s=void 0,N(a,!1),Promise.all([Promise.all(e.map(N5)),e.length===1?CX(e[0]).catch(()=>void 0):void 0])},([e,t])=>{N(i,e,!0),s=t,N(a,!!t&&Stt(t.type),!0)},e=>{console.error(e)}),xtt(e,{get items(){return B(c)},get count(){return n().length},get useButton(){return r()}}),A()}var iit=V(`<!> <!>`,1);function ait(e,t){k(t,!0);let n=Y(t,`extraItems`,3,void 0),r=M(na({...M5})),i=j(()=>B(r).publicURL),a=j(()=>B(r).repoBlobURL);XO(()=>{let e=t.asset;return N(r,{...M5},!0),e?N5(e):Promise.resolve({...M5})},e=>{N(r,e,!0)},e=>{console.error(e)});{let r=e=>{var t=iit(),n=F(t);{let e=j(()=>X(`view_on_live_site`)),t=j(()=>!B(i));iu(n,{get label(){return B(e)},get disabled(){return B(t)},onclick:()=>{hB(B(i))}})}var r=L(n,2),o=e=>{{let t=j(()=>!XJ.current?.repository||!B(a)),n=j(()=>XJ.current?.repository?.label?X(`view_on_x`,{values:{service:XJ.current.repository.label}}):X(`view_in_repository`));iu(e,{get disabled(){return B(t)},get label(){return B(n)},onclick:()=>{hB(`${B(a)}?plain=1`)}})}};K(r,e=>{CW.devModeEnabled&&e(o)}),W(e,t)},o=j(()=>GB.current||!!t.asset&&KB([t.asset])),s=j(()=>!!t.asset&&VPe(t.asset)),c=j(()=>!!t.asset),l=j(()=>!!t.asset);Ott(e,{get readOnly(){return B(o)},get canEdit(){return B(s)},get canRename(){return B(c)},get canReplace(){return B(l)},onEdit:()=>{$B.current=t.asset},onRename:()=>{eV.current=t.asset},onReplace:()=>{QB.current={folder:void 0,files:[],originalAssets:[t.asset]},UQ.current=!0},get extraItems(){return n()},moreItems:r,$$slots:{moreItems:!0}})}A()}var oit=V(`<a dir="ltr" target="_blank" rel="noopener noreferrer"> </a>`),sit=V(`<a dir="ltr"> </a>`),cit=V(`<bdi dir="ltr"> </bdi>`),P5=V(`<section><h4> </h4> <p> </p></section>`),lit=V(`<section><h4> </h4> <!></section>`),uit=V(`<!> <section><h4> </h4> <p><!></p></section> <section><h4> </h4> <p><!></p></section> <!> <!> <!> <!> <!>`,1);function dit(e,t){k(t,!0);let n=e=>{{let n=j(()=>B(s)===`image`),r=j(()=>[`audio`,`video`].includes(B(s)));O$(e,{get kind(){return B(s)},get asset(){return t.asset},variant:`tile`,get checkerboard(){return B(n)},get controls(){return B(r)}})}},r=Y(t,`showPreview`,3,!1),i=M(na({...M5})),a=j(()=>t.asset.path),o=j(()=>t.asset.size),s=j(()=>t.asset.kind),c=j(()=>t.asset.commitAuthor),l=j(()=>t.asset.commitDate),u=j(()=>B(i).publicURL),d=j(()=>B(i).repoBlobURL),f=j(()=>B(i).dimensions),p=j(()=>B(i).duration),m=j(()=>B(i).createdDate),h=j(()=>B(i).coordinates),g=j(()=>B(i).usedEntries),_=j(()=>VU(B(s))||zU(B(a))),v=AL(),y=async()=>{let e=t.asset,n=v.next();N(i,{...M5,usedEntries:void 0},!0);try{let t=await N5(e);if(!n())return;N(i,t,!0),B(i).usedEntries=await nit(e)}catch(e){console.error(e),n()&&(B(i).usedEntries=[])}};R(()=>{t.asset,y()});{let t=j(()=>r()&&B(_)?n:void 0);S5(e,{get preview(){return B(t)},children:(e,t)=>{var n=uit(),r=F(n);Ftt(r,{get fileName(){return B(a)},get kind(){return B(s)},get size(){return B(o)},get hasDimensions(){return B(_)},get dimensions(){return B(f)},get duration(){return B(p)}});var i=L(r,2),v=P(i),y=I(v,!0),b=L(v,2),x=P(b),S=e=>{var t=oit(),n=I(t,!0);z(()=>{J(t,`href`,B(u)),G(n,B(u)),t.dir=t.dir}),W(e,t)},C=e=>{W(e,H(`–`))};K(x,e=>{B(u)?e(S):e(C,-1)}),O(b),O(i);var w=L(i,2),T=P(w),ee=I(T,!0),E=L(T,2),te=P(E),ne=e=>{var t=sit(),n=I(t);z(()=>{J(t,`href`,B(d)),G(n,`/${B(a)??``}`),t.dir=t.dir}),W(e,t)},re=e=>{var t=cit(),n=I(t);z(()=>{G(n,`/${B(a)??``}`),t.dir=t.dir}),W(e,t)};K(te,e=>{B(d)?e(ne):e(re,-1)}),O(E),O(w);var ie=L(w,2);Wtt(ie,{get entries(){return B(g)}});var ae=L(ie,2),oe=e=>{var t=P5(),n=P(t),r=I(n,!0),i=I(L(n,2),!0);O(t),z((e,t)=>{G(r,e),G(i,t)},[()=>X(`sort_keys.commit_author`),()=>XL(B(c))]),W(e,t)};K(ae,e=>{B(c)&&e(oe)});var se=L(ae,2),ce=e=>{var t=P5(),n=P(t),r=I(n,!0),i=I(L(n,2),!0);O(t),z((e,t)=>{G(r,e),G(i,t)},[()=>X(`sort_keys.commit_date`),()=>BN(B(l),Fc.current)]),W(e,t)};K(se,e=>{B(l)&&e(ce)});var le=L(se,2),ue=e=>{var t=P5(),n=P(t),r=I(n,!0),i=I(L(n,2),!0);O(t),z((e,t)=>{G(r,e),G(i,t)},[()=>X(`created_date`),()=>BN(B(m),Fc.current)]),W(e,t)};K(le,e=>{B(m)&&e(ue)});var de=L(le,2),fe=e=>{var t=lit(),n=P(t),r=I(n,!0);I2e(L(n,2),{get coordinates(){return B(h)}}),O(t),z(e=>G(r,e),[()=>X(`location`)]),W(e,t)};K(de,e=>{B(h)&&e(fe)}),z((e,t)=>{G(y,e),G(ee,t)},[()=>X(`public_urls`,{values:{count:1}}),()=>X(`file_paths`,{values:{count:1}})]),W(e,n)},$$slots:{default:!0}})}A()}var fit=async e=>{let{ok:t,cancelled:n}=await F4(()=>K4(e));return{ok:t,failed:!t&&!n}},pit=V(`<!> <!> <!>`,1),mit=V(`<!> <!>`,1);function hit(e,t){k(t,!0);let n=M(void 0),r=M(!1),i=j(()=>ZB.current),a=j(()=>B(n)?.asset!==B(i)),o=j(()=>B(a)?void 0:B(n)?.blob),s=j(()=>B(i)?.kind),c=j(()=>B(i)?.blobURL),l=j(()=>B(i)?.name??``),u=j(()=>B(i)?[B(i)]:[]),d=j(()=>oP(`/assets/${JV.current??BB.current?.internalPath??`-/all`}`)),f=j(()=>YQ(Object.values(QQ.current).flat(1).filter(e=>e.path===B(i)?.path||UU(e)),e=>e.path===B(i)?.path)),p=j(()=>B(f).previous),m=j(()=>B(f).next),h=(e,t)=>{Vrt(e,{replaceState:!0,transitionType:t})};R(()=>{let e=[B(p),B(m)].filter(e=>e?.kind===`image`),t=B(i)?[B(i)]:[];co(()=>RX(e,{keep:t}))}),ys(()=>{RX([])}),R(()=>{let e=B(i);e&&(async()=>{let t;try{t=await CX(e)}catch(e){console.error(e)}ZB.current===e&&N(n,{asset:e,blob:t})})()});var g=mit(),_=F(g);{let e=(e,t=jr)=>{var n=pit(),i=F(n);rit(i,{get assets(){return B(u)},get useButton(){return t()}});var a=L(i,2);x5(a,{get assets(){return B(u)},getName:e=>e.name,get getBlob(){return CX},get useButton(){return t()}});var o=L(a,2);{let e=j(()=>GB.current||KB(B(u))),n=j(()=>X(`delete_assets`,{values:{count:1}})),i=j(()=>X(`confirm_deleting_this_asset`));y5(o,{get assets(){return B(u)},get disabled(){return B(e)},deleteAssets:async e=>{let{ok:t,failed:n}=await fit(e);return n&&N(r,!0),t},get planDeletion(){return A4},get buttonDescription(){return B(n)},get dialogDescription(){return B(i)},onDelete:()=>{x$(B(d),{returnTo:k5,state:j5()})},get useButton(){return t()}})}W(e,n)},t=(e,t=jr)=>{ait(e,{get asset(){return B(i)},get extraItems(){return t()}})},n=e=>{var t=U(),n=F(t),r=e=>{{let t=j(()=>X(`file_not_found`));C5(e,{get message(){return B(t)},get backPath(){return B(d)}})}},u=e=>{{let t=j(()=>B(o)?.type);ntt(e,{get kind(){return B(s)},get name(){return B(l)},get type(){return B(t)},get asset(){return B(i)},get src(){return B(c)},get pending(){return B(a)},getText:()=>B(i).text??B(o).text()})}};K(n,e=>{B(i)?e(u,-1):e(r)}),W(e,t)},f=e=>{var t=U(),n=F(t),r=e=>{dit(e,{get asset(){return B(i)}})};K(n,e=>{B(i)&&e(r)}),W(e,t)},g=j(()=>B(i)?.sha),v=j(()=>B(p)?()=>h(B(p),`previous`):void 0),y=j(()=>B(m)?()=>h(B(m),`next`):void 0);vtt(_,{get title(){return B(l)},get contentKey(){return B(g)},onBack:()=>{x$(B(d),{returnTo:k5,state:j5()})},get onPrevious(){return B(v)},get onNext(){return B(y)},actions:e,editOptions:t,preview:n,info:f,$$slots:{actions:!0,editOptions:!0,preview:!0,info:!0}})}Pu(L(_,2),{get show(){return B(r)},set show(e){N(r,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`deleting_assets_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,g),A()}var git=e=>{let{files:t,originalAssets:n,replaceDuplicates:r=!1}=e,{slugify_filename:i=!1}=FV().config,a=iH(e),o=a===void 0?[]:sX(a),s=a===void 0?[]:cX(a),c=[];return t.map((e,t)=>{let l=n?.[t]??(r?o.find(t=>{let n=t.name.normalize().toLowerCase();return n===e.name.normalize().toLowerCase()&&!c.some(e=>e.toLowerCase()===n)}):void 0),u=l?.name??UX(e.name,{slugificationEnabled:i,assetNamesInSameFolder:s});return s.includes(u)||s.push(u),c.push(u.normalize()),{action:l?`update`:`create`,name:u,path:l?.path??pP([a,u]),file:e}})},_it=({count:e})=>{f1(e=>e.path),d1.current={...l1,saved:!0,published:G8.current&&!K8.current,count:e}},vit=async(e,t)=>{let{files:n,folder:r}=e,i=git(e);OB(i.map(({path:e})=>e));let a=i.map(({name:e,path:t,file:n})=>({name:e,path:t,size:n.size,kind:KU(e),folder:r}));await G4({changes:i.map(({action:e,path:t,file:n})=>({action:e,path:t,data:n})),savingAssets:a,options:t}),_it({count:n.length})},yit=V(`<div role="none"><!></div>`),bit=V(`<!> <!>`,1),xit={hash:`svelte-1olui47`,code:`.wrapper.svelte-1olui47 {display:contents;textarea {min-height:40dvh;max-height:80dvh;font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);text-wrap:nowrap;resize:vertical;}&.wrap textarea {text-wrap:wrap;}}`};function Sit(e,t){k(t,!0),q(e,xit);let n=j(()=>$B.current),r=M(!1),i=M(void 0),a=M(void 0),o=M(void 0),s=M(!1),c=!1,l=M(!1),u=async()=>{N(i,await CX(B(n)),!0),N(a,await B(i).text(),!0),N(o,B(a),!0),N(r,!0)},d=()=>{$B.current=void 0,N(i,void 0),N(a,void 0),N(o,void 0)},f=async()=>{if(!B(n)||!B(i)||typeof B(o)!=`string`)return;c=!0;let{folder:e,name:t}=B(n),a=B(o),{type:s}=B(i),{ok:u,cancelled:f}=await F4(()=>vit({folder:e,files:[new File([a],t,{type:s})],originalAssets:[B(n)]},{commitType:`uploadMedia`}));c=!1,!u&&(f||N(l,!0),HQ.current)?N(r,!0):d()},p=j(()=>X(`edit_x`,{values:{name:B(n)?.name??``}}));R(()=>{B(n)&&B(i)===void 0&&u()}),R(()=>{HQ.current||N(r,!1)});var m=bit(),h=F(m);{let e=e=>{{let t=j(()=>X(`wrap_long_lines`));Tu(e,{get label(){return B(t)},get checked(){return B(s)},set checked(e){N(s,e,!0)}})}},t=j(()=>X(`save`)),n=j(()=>B(o)===B(a));Pl(h,{size:`x-large`,get title(){return B(p)},get okLabel(){return B(t)},get okDisabled(){return B(n)},okShortcuts:`Accel+S`,onOk:()=>{f()},onClose:()=>{c||d()},get open(){return B(r)},set open(e){N(r,e,!0)},footerExtra:e,children:(e,t)=>{var n=yit();let r;mO(P(n),{dir:`auto`,flex:!0,get value(){return B(o)},set value(e){N(o,e,!0)}}),O(n),z(()=>r=rs(n,1,`wrapper svelte-1olui47`,null,r,{wrap:B(s)})),W(e,n)},$$slots:{footerExtra:!0,default:!0}})}Pu(L(h,2),{get show(){return B(l)},set show(e){N(l,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`saving_asset_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,m),A()}function Cit(e,t){k(t,!0);let n=j(()=>HWe.current);Hnt(e,{get name(){return B(n).name},get path(){return B(n).path},get folderCount(){return B(n).folderCount},get assetCount(){return B(n).assetCount}}),A()}function wit(e,t){k(t,!0);let n=j(()=>ZV({subfolders:JQ.current,fileNames:qQ.current.map(({name:e})=>e),dirPath:JV.current}));{let t=j(()=>JV.current??``);Z4(e,{get dirPath(){return B(t)},get takenNames(){return B(n)},get open(){return WQ.current},set open(e){WQ.current=e}})}A()}function Tit(e,t){k(t,!0);let n=j(()=>BB.current),r=j(()=>GB.current||!WB(B(n))||YV.current);var i=U(),a=F(i),o=e=>{Gnt(e,{get disabled(){return B(r)},onclick:()=>{WQ.current=!0}})},s=j(()=>WV(B(n)));K(a,e=>{B(s)&&e(o)}),W(e,i),A()}var Eit=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),Dit=V(`<!> <!> <!> <!> <!>`,1),Oit=V(`<!> <!>`,1),kit=V(`<!> <!> <!>`,1);function Ait(e,t){k(t,!0);let n=M(!1),r=j(()=>BB.current),i=j(()=>Fc.current&&B(r)?GQ(B(r)):``),a=j(()=>BV.current?BV.current.split(`/`):[]),o=j(()=>XB.current),s=j(()=>IMe.current),c=j(()=>!!B(r)?.readonly||!!kB.current),l=j(()=>GB.current||!WB(VB.current)||YV.current),u=(e,t)=>{let n=oP(`/assets/${pP([B(r)?.internalPath,...B(a).slice(0,e)])}`),i={transitionType:`backwards`,state:{folder:B(r)}};t?x$(n,i):b$(n,i)};var d=kit(),f=F(d),p=e=>{var t=Eit(),n=F(t);Po(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{dismissible:!1,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>BY(`asset_folder`,{folder:B(r)})]),W(e,n)},$$slots:{default:!0}}),O(n),W(e,t)};K(f,e=>{B(c)&&e(p)});var m=L(f,2);Znt(m,{get rootLabel(){return B(i)},get subfolderNames(){return B(a)},onBrowse:u,actions:e=>{var t=Dit(),r=F(t);{let e=j(()=>B(o)?oP(`/assets/${B(o).path}`):void 0),t=j(()=>!B(o)||!UU(B(o))),n=j(j5);qnt(r,{get path(){return B(e)},get disabled(){return B(t)},get state(){return B(n)}})}var i=L(r,2);{let e=j(()=>B(o)?[B(o)]:[]);rit(i,{get assets(){return B(e)}})}var a=L(i,2);x5(a,{get assets(){return B(s)},getName:e=>e.name,get getBlob(){return CX}});var c=L(a,2);{let e=j(()=>GB.current||KB(B(s))),t=j(()=>X(`delete_selected_assets`,{values:{count:B(s).length}})),r=j(()=>X(B(s).length>1&&B(s).length===qQ.current.length?`confirm_deleting_all_assets`:`confirm_deleting_selected_assets`,{values:{count:B(s).length}}));y5(c,{get assets(){return B(s)},get disabled(){return B(e)},deleteAssets:async e=>{let{ok:t,failed:r}=await fit(e);return r&&N(n,!0),t},get planDeletion(){return A4},get buttonDescription(){return B(t)},get dialogDescription(){return B(r)}})}ait(L(c,2),{get asset(){return B(o)}}),W(e,t)},fab:e=>{var t=Oit(),n=F(t);Tit(n,{});var r=L(n,2),i=e=>{{let t=j(()=>sW.isSmallScreen?void 0:X(`upload`));Yrt(e,{get label(){return B(t)}})}};K(r,e=>{(!sW.isSmallScreen||qQ.current.length&&!B(l))&&e(i)}),W(e,t)},$$slots:{actions:!0,fab:!0}}),Pu(L(m,2),{get show(){return B(n)},set show(e){N(n,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`deleting_assets_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,d),A()}var jit=V(`<!> <!>`,1);function Mit(e,t){k(t,!0);let n=M(!1),r=M(!1),i=M(na([])),a=j(()=>eV.current),o=j(()=>B(i).filter(e=>S4(e))),s=j(()=>B(o).length?X(`cannot_move_referenced_asset`,{values:{entries:B(o).map(e=>C4(e)).join(`, `)}}):void 0),c=j(()=>bk(B(a)?.path??``)),l=j(()=>Nr(B(c).dirname,``)),u=j(()=>Nr(B(c).basename,``)),d=j(()=>B(a)?{otherNames:sX(B(l)).map(e=>e.name).filter(e=>e!==B(a).name),fileNames:$V(B(l)),folderNames:QV(B(l))}:{otherNames:[],fileNames:[],folderNames:[]}),f=j(()=>B(d).otherNames),p=j(()=>B(d).fileNames),m=j(()=>B(d).folderNames),h=async e=>{if(!B(a))return;let t=B(a).path,n=pP([B(l),e]),{ok:i,cancelled:o}=await F4(()=>q4(`rename`,[{asset:B(a),path:n}]));i?p$().path===`/assets/${t}`&&await b$(oP(`/assets/${n}`),{replaceState:!0,notifyChange:!1,state:j5()}):o||N(r,!0)};XO(()=>B(a)?nit(B(a)):void 0,e=>{N(i,e,!0),N(n,!0)});var g=jit(),_=F(g);{let e=j(()=>FV().config.slugify_filename);crt(_,{get name(){return B(u)},get otherNames(){return B(f)},get fileNames(){return B(p)},get folderNames(){return B(m)},get usedEntryCount(){return B(i).length},get blockedMessage(){return B(s)},get slugificationEnabled(){return B(e)},onRename:h,onClose:()=>{eV.current=void 0},get open(){return B(n)},set open(e){N(n,e,!0)}})}Pu(L(_,2),{get show(){return B(r)},set show(e){N(r,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`renaming_asset_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,g),A()}var Nit=V(`<!> <!> <!>`,1);function Pit(e,t){k(t,!0);let n=M(!1),r=M(!1),i=j(()=>HV.current),a=j(()=>!!B(i)),o=j(()=>B(i)?.name??``),s=j(()=>B(i)?Y4(B(i).path).length:0),c=j(()=>ZV({subfolders:JQ.current,fileNames:qQ.current.map(({name:e})=>e),exclude:B(o),dirPath:JV.current})),l=async e=>{if(!B(i))return;let{path:t}=B(i);N(n,!0);let{ok:a,cancelled:o}=await F4(()=>FYe({dirPath:t,newDirPath:pP([mP(t),e])}));N(n,!1),!a&&!o&&N(r,!0)};var u=Nit(),d=F(u);{let e=j(()=>X(`rename_x`,{values:{name:B(o)}})),t=j(()=>X(`rename`)),n=j(()=>X(`enter_new_name_for_folder`,{values:{count:B(s)}}));pH(d,{get title(){return B(e)},get okLabel(){return B(t)},get description(){return B(n)},get name(){return B(o)},get takenNames(){return B(c)},onSubmit:e=>{l(e)},onClose:()=>{HV.current=void 0},get open(){return B(a)},set open(e){N(a,e)}})}var f=L(d,2);Pu(f,{get show(){return B(n)},duration:0,children:(e,t)=>{Vc(e,{status:`info`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`renaming_folder`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(f,2),{get show(){return B(r)},set show(e){N(r,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`renaming_folder_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,u),A()}var F5=void 0,Fit=e=>{let t=!!O5.current,{path:n}=p$(),r=k5(n);O5.current=e,e?(r||(F5=n),b$(`/search/${encodeURIComponent(e)}`,{replaceState:r})):t&&r&&(x$(F5??(D5.current===`assets`?`/assets`:`/collections`)),F5=void 0)},Iit=()=>{if(k5(p$().path))return;let e=window.history.state?.from;e&&k5(p$(e).path)||(F5=void 0,O5.current&&=``)},Lit=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),Rit=V(`<div role="none" class="wrapper svelte-lav5fn"><!></div>`),zit={hash:`svelte-lav5fn`,code:`.wrapper.svelte-lav5fn {display:contents;--sui-textbox-border-width: 0;}`};function I5(e,t){k(t,!0),q(e,zit);let n=Y(t,`onclick`,3,void 0),r=M(``);R(()=>{let e=O5.current;co(()=>{e!==B(r).trim()&&N(r,e,!0)})});var i=Rit();go(`hashchange`,ra,()=>{Iit()});var a=P(i),o=e=>{var t=Lit(),i=F(t);{let e=j(()=>X(`search_placeholder_${D5.current}`)),t=j(()=>X(`search_placeholder_${D5.current}`));Po(i,()=>({"--sui-textbox-placeholder-text-align":`center`})),vu(i.lastChild,{debounce:!0,keyShortcuts:`Accel+F`,get placeholder(){return B(e)},get"aria-label"(){return B(t)},get onclick(){return n()},oninput:({target:e})=>{Fit(e.value.trim())},onClear:()=>{Fit(``)},get value(){return B(r)},set value(e){N(r,e,!0)}}),O(i)}W(e,t)};K(a,e=>{D5.current&&e(o)}),O(i),W(e,i),A()}var Bit=V(`<header><h2> </h2></header> <!>`,1),L5=V(`<span class="count"> </span>`),Vit=V(`<!> <!>`,1),Hit=V(`<!> <!>`,1),Uit=V(`<nav class="primary-sidebar"><!> <!></nav>`);function Wit(e,t){k(t,!0);let n=Y(t,`isSearchPage`,3,!1),r=e=>Fc.current?GQ(e):``,i=j(()=>[...RB.current.filter(({typedKeyPath:e,isAssetCollection:t})=>!t&&e===void 0).sort((e,t)=>lj(e.collectionName,e.fileName)-lj(t.collectionName,t.fileName)).sort((e,t)=>ZA(e.collectionName)-ZA(t.collectionName)),...RB.current.filter(({isAssetCollection:e})=>e)]),a=e=>B(i)[e].collectionName===void 0&&B(i)[e+1]?.collectionName!==void 0||!B(i)[e].isAssetCollection&&!!B(i)[e+1]?.isAssetCollection;var o=Uit(),s=P(o),c=e=>{var t=Bit(),n=F(t),r=I(P(n),!0);O(n),I5(L(n,2),{onclick:e=>{e.preventDefault(),b$(`/search`)}}),z(e=>G(r,e),[()=>X(`assets`)]),W(e,t)};K(s,e=>{sW.isSmallScreen&&e(c)});var l=L(s,2);{let e=j(()=>X(`asset_folder_list`));eu(l,{get ariaLabel(){return B(e)},"aria-controls":`assets-container`,children:(e,t)=>{var o=Vit(),s=F(o),c=e=>{{let t=j(()=>X(`asset_location.repository`));tu(e,{get label(){return B(t)},children:(e,t)=>{var o=U();Ro(F(o),19,()=>B(i),e=>NMe(e),(e,t,i)=>{var o=Vit(),s=F(o);Mo(s,Zc,null,e=>{let i=j(()=>B(t)),a=j(()=>B(i).collectionName?YA(B(i).collectionName):void 0),o=j(()=>B(a)&&B(i).fileName?ij(B(a),B(i).fileName):void 0),s=j(()=>!WB(B(t))),c=j(()=>(0,Cr.default)(BB.current,B(t)));{let l=e=>{{let n=j(()=>B(t).icon||B(o)?.icon||B(a)?.icon||`folder`);Lc(e,{get name(){return B(n)}})}},u=e=>{var n=U();No(F(n),()=>qB.current,e=>{var n=U();Mo(F(n),Zc,null,e=>{let n=j(()=>B(i).internalPath===void 0?qB.current.length:DHe(B(t)));var r=L5(),a=I(r,!0);z((e,t)=>{J(r,`aria-label`,`(${e??``})`),G(a,t)},[()=>X(`x_assets`,{values:{count:B(n)}}),()=>g5.current.format(B(n))]),W(e,r)}),W(e,n)}),W(e,n)},d=j(()=>sW.isSmallScreen||n()?!1:B(c)),f=j(()=>r(B(t)));nu(e,{get selected(){return B(d)},get label(){return B(f)},onSelect:()=>{b$(oP(`/assets/${B(i).internalPath??`-/all`}`),{transitionType:`forwards`,state:{folder:B(t)}})},onclick:()=>{B(c)&&BV.current&&b$(oP(`/assets/${B(i).internalPath}`),{transitionType:`backwards`,state:{folder:B(t)}})},ondragover:e=>{e.preventDefault(),B(s)||(B(i).internalPath===void 0||B(c)?e.dataTransfer.dropEffect=`none`:(e.dataTransfer.dropEffect=`move`,e.target.classList.add(`dragover`)))},ondragleave:e=>{e.preventDefault(),B(s)||e.target.classList.remove(`dragover`)},ondragend:e=>{e.preventDefault(),B(s)||e.target.classList.remove(`dragover`)},ondrop:e=>{e.preventDefault(),B(s)||e.target.classList.remove(`dragover`)},startIcon:l,endIcon:u,$$slots:{startIcon:!0,endIcon:!0}})}});var c=L(s,2),l=e=>{ql(e,{})},u=j(()=>a(B(i)));K(c,e=>{B(u)&&e(l)}),W(e,o)}),W(e,o)},$$slots:{default:!0}})}};K(s,e=>{B(i).length&&e(c)});var l=L(s,2),u=e=>{{let t=j(()=>X(`asset_location.external`));tu(e,{get label(){return B(t)},children:(e,t)=>{let r=j(()=>dQ.current.length);var i=Hit(),a=F(i);Ro(a,17,()=>pQ.current,e=>e.serviceId,(e,t)=>{let r=j(()=>B(t)),i=j(()=>DQ.current[B(r).serviceId]);{let a=e=>{Lc(e,{name:`cloud`})},o=e=>{var t=U(),n=F(t),r=e=>{var t=L5(),n=I(t,!0);z((e,r)=>{J(t,`aria-label`,`(${e??``})`),G(n,r)},[()=>X(`x_assets`,{values:{count:B(i)}}),()=>g5.current.format(B(i))]),W(e,t)};K(n,e=>{B(i)!==void 0&&e(r)}),W(e,t)},s=j(()=>sW.isSmallScreen||n()?!1:vQ.current?.serviceId===B(r).serviceId);nu(e,{get selected(){return B(s)},get label(){return B(r).serviceLabel},onSelect:()=>{b$(mQ(B(t)),{transitionType:`forwards`})},startIcon:a,endIcon:o,$$slots:{startIcon:!0,endIcon:!0}})}});var o=L(a,2);{let e=e=>{Lc(e,{name:`link_2`})},t=e=>{var t=L5(),n=I(t,!0);z((e,r)=>{J(t,`aria-label`,`(${e??``})`),G(n,r)},[()=>X(`x_assets`,{values:{count:B(r)}}),()=>g5.current.format(B(r))]),W(e,t)},i=j(()=>sW.isSmallScreen||n()?!1:vQ.current?.serviceId===fQ.serviceId);nu(o,{get selected(){return B(i)},get label(){return fQ.serviceLabel},onSelect:()=>{b$(mQ(fQ),{transitionType:`forwards`})},startIcon:e,endIcon:t,$$slots:{startIcon:!0,endIcon:!0}})}W(e,i)},$$slots:{default:!0}})}};K(l,e=>{(pQ.current.length||dQ.current.length)&&e(u)}),W(e,o)},$$slots:{default:!0}})}O(o),z(e=>J(o,`aria-label`,e),[()=>X(`assets`)]),W(e,o),A()}var R5,z5=()=>{let e=XJ.current?.repository,t=e?.databaseName;if(!t)R5=void 0;else return R5?.databaseName!==t&&(R5={databaseName:t,db:fR(e,`ui-settings`)}),R5.db},Git=async e=>{try{let t=(await z5()?.get(e))?.sidebarWidth;if(typeof t==`number`&&Number.isFinite(t))return t}catch{}return 240},Kit=async(e,t)=>{let n=z5();if(n)try{await n.set(e,{...await n.get(e),sidebarWidth:t})}catch{}},qit=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`uiSettingsKey`,`primarySidebar`,`main`]),Jit=V(`<!> <!>`,1),Yit=V(`<!> <!> <!>`,1),Xit=V(`<div><!></div>`),Zit={hash:`svelte-1kkfo1f`,code:`.outer.svelte-1kkfo1f {flex:auto;display:flex;overflow:hidden;&[inert] {display:none;}.primary-sidebar {display:flex;flex-direction:column;flex:none;overflow-y:auto;height:100%;
|
||
|
||
@media (width < 768px) {flex:auto;width:auto;background-color:var(--sui-primary-background-color);
|
||
}
|
||
|
||
/* Mobile header */header {display:flex;align-items:center;justify-content:space-between;padding:0 10px;height:var(--sui-primary-toolbar-size);h2 {padding:0 10px;font-size:var(--sui-font-size-x-large);}}.sui.search-bar {margin-inline:12px;--sui-textbox-background-color: var(--sui-tertiary-background-color);}[role='radiogroup'] {width:100%;}[role='listbox'] {margin:8px;border-width:0;background-color:transparent;button {display:flex;justify-content:flex-start;border-radius:var(--sui-control-medium-border-radius);width:100%;text-align:start;
|
||
|
||
@media (pointer: coarse) {height:48px;
|
||
}&:not(:first-child) {margin-top:4px;}&:not(:focus) {border-color:transparent;}span {flex:none;}.label {flex:auto;overflow:hidden;}.icon {transition:color 200ms;}.icon.check {display:none;}.count {padding:2px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);transition:color 200ms;}}[role='option'][aria-selected='true'] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);.count {color:var(--sui-highlighted-foreground-color);}}[role='option'].dragover {color:var(--sui-primary-accent-color-inverted) !important;background-color:var(--sui-primary-accent-color) !important;}}
|
||
|
||
/* Styled like the listbox above, so the two sidebars look alike */[role='tree'] {margin:8px;border-width:0;background-color:transparent;
|
||
|
||
/* No item can expand, so the space kept for the chevrons is dropped */&.flat .chevron.placeholder {display:none;}[role='treeitem'] {> .row {border-radius:var(--sui-control-medium-border-radius);
|
||
|
||
@media (pointer: coarse) {min-height:48px;
|
||
}.icon {flex:none;transition:color 200ms;}.count {flex:none;padding:2px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);transition:color 200ms;}}&[aria-selected='true'] > .row .count {color:var(--sui-highlighted-foreground-color);}&.dragover > .row {color:var(--sui-primary-accent-color-inverted) !important;background-color:var(--sui-primary-accent-color) !important;}}}.sui.divider {margin:8px 0;}}}`};function B5(e,t){k(t,!0),q(e,Zit);let n=Y(t,`class`,3,``),r=Y(t,`uiSettingsKey`,3,void 0),i=Y(t,`primarySidebar`,3,void 0),a=Y(t,`main`,3,void 0),o=gs(t,qit),s=M(void 0),c=M(void 0),l=async()=>{r()&&N(c,await Git(r()),!0)},u=async e=>{let{clientWidth:t}=B(s);await Kit(r(),Math.round(e/100*t))};ba(()=>{c$.current,window.requestAnimationFrame(()=>{c$.current||l()})});var d=Xit();us(d,()=>({role:`group`,id:`page-container`,class:`outer ${n()??``}`,inert:c$.current,...o}),void 0,void 0,void 0,`svelte-1kkfo1f`);var f=P(d),p=e=>{var t=Jit(),n=F(t);Uo(n,()=>i()??jr),Uo(L(n,2),()=>a()??jr),W(e,t)},m=e=>{mu(e,{onResize:({sizes:e})=>{u(e[0])},children:(e,t)=>{var n=Yit(),r=F(n);hu(r,{get defaultSize(){return`${B(c)??``}px`},minSize:`160px`,maxSize:`480px`,children:(e,t)=>{var n=U();Uo(F(n),i),W(e,n)},$$slots:{default:!0}});var o=L(r,2);pu(o,{}),hu(L(o,2),{children:(e,t)=>{var n=U();Uo(F(n),a),W(e,n)},$$slots:{default:!0}}),W(e,n)},$$slots:{default:!0}})};K(f,e=>{sW.isSmallScreen||!i()||!a()?e(p):B(c)!==void 0&&e(m,1)}),O(d),ms(d,e=>N(s,e),()=>B(s)),W(e,d),A()}var Qit=V(`<bdi> </bdi>`),$it=V(`<div role="none" class="label"><!></div>`),eat=V(`<!> <!> <!>`,1);function tat(e,t){k(t,!0);let n=j(()=>t.asset.path),r=j(()=>t.asset.name),i=j(()=>t.asset.folder),a=j(()=>t.asset.kind);$l(e,{onclick:()=>{b$(oP(`/assets/${B(n)}`),{transitionType:`forwards`})},children:(e,n)=>{var o=eat(),s=F(o);Zl(s,{class:`image`,children:(e,n)=>{O$(e,{get kind(){return B(a)},get asset(){return t.asset},variant:`icon`,cover:!0})},$$slots:{default:!0}});var c=L(s,2);Zl(c,{class:`collection`,children:(e,t)=>{var n=U();No(F(n),()=>Fc.current,e=>{var t=Qit(),n=I(t,!0);z(e=>G(n,e),[()=>GQ(B(i))]),W(e,t)}),W(e,n)},$$slots:{default:!0}}),Zl(L(c,2),{class:`title`,children:(e,t)=>{var n=$it();Xc(P(n),{lines:2,children:(e,t)=>{var n=Qit(),i=I(n,!0);z(()=>G(i,B(r))),W(e,n)},$$slots:{default:!0}}),O(n),W(e,n)},$$slots:{default:!0}}),W(e,o)},$$slots:{default:!0}}),A()}var nat=V(`<span role="none" hidden=""></span> <!>`,1);function V5(e,t){k(t,!0);let n=M(void 0),r=M(void 0),i=j(()=>B(r)?.entry===t.entry?B(r).src:void 0);R(()=>{let e=B(n)?.parentElement;if(!e)return;let i=t.collection,a=t.entry,o,s=D$(e,()=>{o=IJe(i,a,e=>{N(r,{entry:a,src:e})})});return()=>{s(),o?.()}});var a=nat(),o=F(a);ms(o,e=>N(n,e),()=>B(n));var s=L(o,2),c=e=>{N$(e,{get src(){return B(i)},get variant(){return t.variant},cover:!0,loading:`eager`})};K(s,e=>{B(i)&&e(c)}),W(e,a),A()}var rat=V(`<bdi> </bdi>`),iat=V(`<bdi><!></bdi>`),aat=V(`<div role="none" class="label"><!></div>`),oat=V(`<!> <!> <!>`,1);function sat(e,t){k(t,!0);let n=(e,t)=>{let n=()=>(t?.()).collection,s=()=>(t?.()).collectionFile;$l(e,{onclick:()=>{b$(oP(`/collections/${n().name}/entries/${s()?.name||B(o)}`),{state:{highlight:{locale:B(i),keyPath:B(a)}},transitionType:`forwards`})},children:(e,t)=>{var i=oat(),a=F(i);Zl(a,{class:`image`,children:(e,t)=>{var i=U(),a=F(i),o=e=>{V5(e,{get collection(){return n()},get entry(){return B(r)},variant:`icon`})};K(a,e=>{n()._type===`entry`&&e(o)}),W(e,i)},$$slots:{default:!0}});var o=L(a,2);Zl(o,{class:`collection`,children:(e,t)=>{var r=U();No(F(r),()=>Fc.current,e=>{var t=rat(),r=I(t,!0);z(e=>G(r,e),[()=>XA(n())]),W(e,t)}),W(e,r)},$$slots:{default:!0}}),Zl(L(o,2),{class:`title`,children:(e,t)=>{var i=aat();Xc(P(i),{lines:2,children:(e,t)=>{var i=iat(),a=P(i),o=e=>{var t=H();z(e=>G(t,e),[()=>oj(s())]),W(e,t)},c=e=>{var t=U();No(F(t),()=>Fc.current,e=>{var t=U();Ho(F(t),()=>$L(n(),B(r),{useTemplate:!0,allowMarkdown:!0})),W(e,t)}),W(e,t)};K(a,e=>{s()?e(o):e(c,-1)}),O(i),W(e,i)},$$slots:{default:!0}}),O(i),W(e,i)},$$slots:{default:!0}}),W(e,i)},$$slots:{default:!0}})},r=j(()=>t.result.entry),i=j(()=>t.result.locale),a=j(()=>t.result.keyPath),o=j(()=>B(r).subPath);var s=U();Ro(F(s),17,()=>RL(B(r)),e=>e.name,(e,t)=>{var i=U();Mo(F(i),Zc,null,e=>{var i=U();Ro(F(i),17,()=>sj(B(t),B(r)),e=>e.name,(e,r)=>{var i=U();Mo(F(i),Zc,null,e=>{n(e,()=>({collection:B(t),collectionFile:B(r)}))}),W(e,i)},e=>{n(e,()=>({collection:B(t)}))}),W(e,i)}),W(e,i)}),W(e,s),A()}var cat=V(`<span role="none"> </span>`),lat=V(`<div role="none"><!></div>`);function uat(e,t){k(t,!0),R(()=>{u$.current=X(t.statusMessageKey,{values:{terms:O5.current,count:t.items.length}})}),OO(e,{get ariaLabel(){return t.label},children:(e,n)=>{var r=lat(),i=P(r),a=e=>{T5(e,{viewType:`list`,get"aria-label"(){return t.label},get"aria-rowcount"(){return t.items.length},children:(e,n)=>{var r=U();No(F(r),()=>O5.current,e=>{gu(e,{get items(){return t.items},get itemKey(){return t.itemKey},get renderItem(){return t.renderItem}})}),W(e,r)},$$slots:{default:!0}})},o=e=>{DO(e,{children:(e,n)=>{var r=cat(),i=I(r,!0);z(()=>G(i,t.emptyMessage)),W(e,r)},$$slots:{default:!0}})};K(i,e=>{t.items.length?e(a):O5.current&&e(o,1)}),O(r),W(e,r)},$$slots:{default:!0}}),A()}var dat=({assets:e,terms:t})=>{let n=B1(t);return!e.length||!n.length?[]:e.filter(e=>V1({value:e.name,tokens:n,normalizedValueCache:I1(e)}))},fat=KO(()=>dat({assets:JB.current,terms:O5.current})),pat=({entry:e,terms:t,normalizedValueCache:n=void 0})=>{let r=0,i,a,o=RL(e);if(!o.length)return{id:e.id,entry:e,points:0,locale:i,keyPath:a};o.forEach(i=>{z1({value:i.label||i.name,terms:t,normalizedValueCache:n})&&(r+=10),r+=sj(i,e).filter(e=>z1({value:e.label||e.name,terms:t,normalizedValueCache:n})).length});let s=$L(o[0],e,{useTemplate:!0}),c=I1(e);return z1({value:s,terms:t,normalizedValueCache:c})&&(r+=10),Object.entries(e.locales).forEach(([e,{content:n}])=>{r+=Object.entries(n).filter(([n,r])=>{let o=typeof r==`string`&&!!r&&z1({value:r,terms:t,normalizedValueCache:c})||typeof r==`number`&&z1({value:String(r),terms:t,normalizedValueCache:c});return o&&!i&&!a&&(i=e,a=n),o}).length}),{id:e.id,entry:e,points:r,locale:i,keyPath:a}},mat=({entries:e,terms:t})=>{if(t=L1(t),!e.length||!t)return[];let n=new Map;return e.map(e=>pat({entry:e,terms:t,normalizedValueCache:n})).filter(({points:e})=>e>0).sort((e,t)=>t.points-e.points)},hat=KO(()=>mat({entries:NY(tj.current,lY.current),terms:O5.current})),gat=V(`<h2 role="none"> </h2>`),_at=V(`<div role="none" class="wrapper svelte-1p7vfqa"><!> <div role="none" class="results svelte-1p7vfqa"><!> <!></div></div>`),vat={hash:`svelte-1p7vfqa`,code:`.wrapper.svelte-1p7vfqa {flex:auto;display:flex;flex-direction:column;overflow:hidden;width:100%;background-color:var(--sui-primary-background-color);}.results.svelte-1p7vfqa {flex:auto;overflow:auto;& > .sui.group {display:contents;& > .inner > div {display:contents;}}h3 {flex:none;margin:16px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-large);& + div {overflow:auto;flex:auto;}
|
||
|
||
@media (width < 768px) {display:none;
|
||
}}}`};function yat(e,t){k(t,!0),q(e,vat);var n=_at(),r=P(n),i=e=>{pO(e,{variant:`primary`,children:(e,t)=>{var n=gat(),r=I(n,!0);z(e=>G(r,e),[()=>X(`search_results`)]),W(e,n)},$$slots:{default:!0}})};K(r,e=>{sW.isSmallScreen||e(i)});var a=L(r,2),o=P(a),s=e=>{{let t=(e,t=jr)=>{sat(e,{get result(){return t()}})},n=j(()=>X(`entries`)),r=j(()=>X(`no_entries_found`));uat(e,{get items(){return hat.current},itemKey:`id`,get label(){return B(n)},get emptyMessage(){return B(r)},statusMessageKey:`viewing_entry_search_results`,renderItem:t,$$slots:{renderItem:!0}})}};K(o,e=>{D5.current===`contents`&&e(s)});var c=L(o,2),l=e=>{{let t=(e,t=jr)=>{tat(e,{get asset(){return t()}})},n=j(()=>X(`assets`)),r=j(()=>X(`no_files_found`));uat(e,{get items(){return fat.current},itemKey:`path`,get label(){return B(n)},get emptyMessage(){return B(r)},statusMessageKey:`viewing_asset_search_results`,renderItem:t,$$slots:{renderItem:!0}})}};K(c,e=>{D5.current===`assets`&&e(l)}),O(a),O(n),W(e,n),A()}var bat=V(`<!> <div role="search" class="svelte-1476at1"><!></div>`,1),xat={hash:`svelte-1476at1`,code:`[role='search'].svelte-1476at1 {display:contents;.sui.search-bar {flex:auto;}}`};function H5(e,t){k(t,!0),q(e,xat),E5(e,{primaryToolbar:e=>{var t=U(),n=F(t),r=e=>{pO(e,{variant:`primary`,children:(e,t)=>{var n=bat(),r=F(n);{let e=j(()=>X(D5.current===`assets`?`back_to_asset_folder_list`:`back_to_collection_list`));b5(r,{get"aria-label"(){return B(e)},onclick:()=>{O5.current=``,b$(D5.current===`assets`?`/assets`:`/collections`,{transitionType:`backwards`})}})}var i=L(r,2);I5(P(i),{}),O(i),W(e,n)},$$slots:{default:!0}})};K(n,e=>{sW.isSmallScreen&&e(r)}),W(e,t)},mainContent:e=>{yat(e,{})},$$slots:{primaryToolbar:!0,mainContent:!0}}),A()}var Sat=KO(()=>{let{current:e}=qB,t=[`name`];return e.every(e=>!!e.commitAuthor)&&t.push(`commit_author`),e.every(e=>!!e.commitDate)&&t.push(`commit_date`),t.map(e=>({key:e,label:X(`sort_keys.${e}`)}))}),Cat=V(`<!> <!> <!> <!> <!> <!> <!>`,1);function wat(e,t){k(t,!0);let n=M(!1),r=M(!1),i=M(!1),a=j(Brt),o=()=>{(e=>{N(n,e.isIndexPage,!0),N(r,e.isSearchPage,!0),N(i,e.notFound,!0)})(Krt())};R(()=>{let e=vQ.current;e&&e.authType!==`widget`&&LQ(e)&&(e.serviceId===`linked`&&dQ.current,co(()=>{j1(e)}))}),vs(()=>(o(),()=>{Hrt(),HQ.current=!1}));var s=Cat();go(`hashchange`,ra,e=>{y$(e,o,Rrt)});var c=F(s);{let e=e=>{var t=U(),i=F(t),a=e=>{Wit(e,{get isSearchPage(){return B(r)}})};K(i,e=>{(!sW.isSmallScreen||B(n))&&e(a)}),W(e,t)},t=e=>{var t=U(),o=F(t),s=e=>{H5(e,{})},c=e=>{{let t=e=>{{let t=j(()=>X(`asset_folder_not_found`));C5(e,{get message(){return B(t)},backPath:`/assets`})}},n=j(()=>X(`asset_library`));E5(e,{get"aria-label"(){return B(n)},mainContent:t,$$slots:{mainContent:!0}})}},l=e=>{Frt(e,{})},u=e=>{{let t=e=>{Ait(e,{})},n=e=>{var t=U(),n=F(t),r=e=>{{let t=j(()=>Object.values(QQ.current).flat(1));Trt(e,{get allItems(){return B(t)},get selectedItems(){return YB},get totalCount(){return qQ.current.length},get sortKeys(){return Sat.current}})}};K(n,e=>{qQ.current.length&&e(r)}),W(e,t)},r=e=>{Xrt(e,{})},i=e=>{frt(e,{get asset(){return XB.current},children:(e,t=jr)=>{dit(e,{get asset(){return t()},showPreview:!0})},fallback:e=>{Cit(e,{})},$$slots:{default:!0,fallback:!0}})},o=j(()=>X(`x_asset_folder`,{values:{folder:B(a)}}));E5(e,{id:`assets-container`,get"aria-label"(){return B(o)},primaryToolbar:t,secondaryToolbar:n,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}};K(o,e=>{B(r)?e(s):B(i)?e(c,1):vQ.current?e(l,2):sW.isSmallScreen&&B(n)||e(u,3)}),W(e,t)},o=j(()=>X(`asset_library`));B5(c,{uiSettingsKey:`assets-page`,get"aria-label"(){return B(o)},primarySidebar:e,main:t,$$slots:{primarySidebar:!0,main:!0}})}var l=L(c,2),u=e=>{var t=U(),n=F(t),r=e=>{ent(e,{})},i=e=>{hit(e,{})};K(n,e=>{vQ.current?e(r):e(i,-1)}),W(e,t)};K(l,e=>{HQ.current&&e(u)});var d=L(l,2);Sit(d,{});var f=L(d,2);Mit(f,{});var p=L(f,2);wit(p,{});var m=L(p,2);Pit(m,{}),Qrt(L(m,2),{}),W(e,s),A()}var Tat=V(`<iframe id="cloudinary-iframe" allow="camera; storage-access" sandbox="allow-same-origin allow-scripts allow-popups allow-forms
|
||
allow-storage-access-by-user-activation" class="svelte-1y1y5aq"></iframe>`),Eat={hash:`svelte-1y1y5aq`,code:`iframe.svelte-1y1y5aq {display:block;width:calc(100% - 32px);height:calc(100% - 32px);border:none;}
|
||
|
||
/* Avoid scrolling issue https://github.com/sveltia/sveltia-cms/issues/824 */dialog[inert] > iframe.svelte-1y1y5aq {display:none;}`};function Dat(e,t){k(t,!0),q(e,Eat);let n=M(``),r=M(``),i=e=>{mB(e)?.type===`consoleLoaded`&&(cB.current=!0)};vs(()=>{cB.current=!1;let e=lMe();if(!e)return;let{cloud_name:t,api_key:i}=e.config??{};if(!t||!i)return;N(r,window.crypto.randomUUID(),!0);let a=new URLSearchParams({...Object.fromEntries(Object.entries(e.config).filter(([e])=>sMe.includes(e))),ml_id:B(r),pmHost:window.location.origin,new_cms:`true`});N(n,`https://console.cloudinary.com/console/media_library/cms?${a}`)});var a=U();go(`message`,ra,i);var o=F(a),s=e=>{sl(e,{keepContent:!0,get open(){return lB.current},set open(e){lB.current=e},children:(e,t)=>{var i=Tat();z(e=>{J(i,`src`,B(n)),J(i,`title`,e),J(i,`data-ml-id`,B(r))},[()=>X(`cloud_storage.cloudinary.iframe_title`)]),W(e,i)},$$slots:{default:!0}})};K(o,e=>{B(n)&&e(s)}),W(e,a),A()}var Oat=V(`<!> <!> <!> <!> <!> <!> <!>`,1);function kat(e,t){k(t,!0);var n=Oat(),r=F(n);Pu(r,{get show(){return d1.current.saved},set show(e){d1.current.saved=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(d1.current.published?`assets_saved_and_published`:`assets_saved`,{values:{count:d1.current.count}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var i=L(r,2);Pu(i,{get show(){return d1.current.moved},set show(e){d1.current.moved=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`assets_moved`,{values:{count:d1.current.count}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var a=L(i,2);Pu(a,{get show(){return d1.current.renamed},set show(e){d1.current.renamed=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`assets_renamed`,{values:{count:d1.current.count}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var o=L(a,2);Pu(o,{get show(){return d1.current.folderCreated},set show(e){d1.current.folderCreated=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`folder_created`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var s=L(o,2);Pu(s,{get show(){return d1.current.folderRenamed},set show(e){d1.current.folderRenamed=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`folder_renamed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var c=L(s,2);Pu(c,{get show(){return d1.current.folderDeleted},set show(e){d1.current.folderDeleted=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`folder_deleted`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(c,2),{get show(){return d1.current.deleted},set show(e){d1.current.deleted=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`assets_deleted`,{values:{count:d1.current.count}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,n),A()}var Aat=V(`<div role="status"> </div>`),jat=V(`<div role="group" class="section uploading svelte-96nj3d"><div role="none"><!></div> <!></div>`),Mat=V(`<div role="group" class="section oversized svelte-96nj3d"><!> <!></div>`),Nat=V(`<div role="group" class="section invalid svelte-96nj3d"><!> <!></div>`),Pat=V(`<div role="group" class="section mismatched svelte-96nj3d"><!> <!></div>`),Fat=V(`<!> <!>`,1),Iat=V(`<div role="group" class="section svelte-96nj3d"> <!></div>`),Lat=V(`<!> <!> <!> <!> <!> <!>`,1),Rat=V(`<!> <!> <!>`,1),zat={hash:`svelte-96nj3d`,code:`.section.svelte-96nj3d {display:flex;flex-direction:column;gap:12px;&:not(:first-child) {margin-top:16px;}& > * {flex:none;}&.oversized .files,
|
||
&.invalid .files,
|
||
&.mismatched .files {opacity:0.5;}}`};function Bat(e,t){k(t,!0),q(e,zat);let n=M(!1),r=M(!1),i=j(()=>QB.current),a=j(()=>B(i).files),o=j(()=>B(i).folder),s=j(()=>B(i).subfolderPath),c=j(()=>B(i).originalAssets),l=j(()=>B(c)?.[0]),u=j(()=>y1.current),d=j(()=>B(u).processing),f=j(()=>B(u).validFiles),p=j(()=>B(u).oversizedFiles),m=j(()=>B(u).invalidFiles),h=j(()=>B(u).transformedFileMap),g=j(()=>FV().config),_=j(()=>B(g).max_file_size),v=j(()=>iH(QB.current)),y=j(()=>B(l)||B(v)===void 0?[]:sX(B(v))),b=j(()=>B(l)?B(f).filter(e=>!fP(bk(e.name).extension,bk(B(l).name).extension)):[]),x=j(()=>B(f).filter(e=>!B(b).includes(e))),S=j(()=>B(x)),C=j(()=>(B(x),!0)),w=j(()=>lX(B(S),B(y))),T=j(()=>B(w).length);R(()=>{HQ.current||(QB.current={folder:void 0,files:[]})});var ee=Rat(),E=F(ee);{let e=j(()=>X(B(l)?`replace_asset`:`upload_assets`)),t=j(()=>X(B(l)?`replace`:`upload`)),i=j(()=>!B(S).length);Il(E,{get open(){return VWe.current},get title(){return B(e)},get okLabel(){return B(t)},get okDisabled(){return B(i)},onOk:async()=>{let e=B(l)?{files:B(S),folder:B(o),originalAssets:B(c)}:{files:B(S),folder:B(o),subfolderPath:B(s),replaceDuplicates:B(C)};QB.current={folder:void 0,files:[]},N(n,!0);let{ok:t,cancelled:i}=await F4(()=>vit(e,{commitType:`uploadMedia`}));N(n,!1),!t&&!i&&N(r,!0)},onCancel:()=>{QB.current={folder:void 0,files:[]}},children:(e,t)=>{var n=Lat(),r=F(n),i=e=>{var t=Aat(),n=I(t,!0);z(e=>G(n,e),[()=>X(`processing_files`,{values:{count:B(a).length}})]),W(e,t)};K(r,e=>{B(d)&&e(i)});var o=L(r,2),s=e=>{var t=jat(),n=P(t),r=P(n),i=e=>{var t=H();z(e=>G(t,e),[()=>X(`confirm_replacing_file`,{values:{name:B(l).name}})]),W(e,t)},a=e=>{var t=H();z(e=>G(t,e),[()=>X(`confirm_uploading_files`,{values:{count:B(S).length,folder:`/${B(v)}`}})]),W(e,t)};K(r,e=>{B(l)?e(i):e(a,-1)}),O(n),L$(L(n,2),{get transformedFileMap(){return B(h)},get files(){return B(S)},set files(e){N(S,e)}}),O(t),z(e=>J(t,`aria-label`,e),[()=>X(`uploading_files`)]),W(e,t)};K(o,e=>{B(S).length&&e(s)});var c=L(o,2),u=e=>{var t=Mat(),n=P(t);Vc(n,{status:`warning`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`warning_oversized_files`,{values:{count:B(p).length,size:F$(B(_))}})]),W(e,n)},$$slots:{default:!0}}),L$(L(n,2),{get files(){return B(p)},get transformedFileMap(){return B(h)},removable:!1}),O(t),z(e=>J(t,`aria-label`,e),[()=>X(`oversized_files`)]),W(e,t)};K(c,e=>{B(p).length&&e(u)});var f=L(c,2),g=e=>{var t=Nat(),n=P(t);Vc(n,{status:`warning`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`warning_invalid_files`,{values:{count:B(m).length}})]),W(e,n)},$$slots:{default:!0}}),L$(L(n,2),{get files(){return B(m)},removable:!1,showThumbnail:!1}),O(t),z(e=>J(t,`aria-label`,e),[()=>X(`invalid_files`)]),W(e,t)};K(f,e=>{B(m).length&&e(g)});var y=L(f,2),x=e=>{var t=Pat(),n=P(t);Vc(n,{status:`warning`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`warning_mismatched_files`,{values:{count:B(b).length,name:B(l)?.name}})]),W(e,n)},$$slots:{default:!0}}),L$(L(n,2),{get files(){return B(b)},get transformedFileMap(){return B(h)},removable:!1}),O(t),z(e=>J(t,`aria-label`,e),[()=>X(`mismatched_files`)]),W(e,t)};K(y,e=>{B(b).length&&e(x)});var w=L(y,2),ee=e=>{var t=Iat(),n=P(t),r=L(n);{let e=j(()=>X(`file_name_conflict_resolution`));cu(r,{get ariaLabel(){return B(e)},onChange:({detail:e})=>{N(C,e.value===`replace`)},children:(e,t)=>{var n=Fat(),r=F(n);lu(r,{value:`replace`,get checked(){return B(C)},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`replace`)]),W(e,n)},$$slots:{default:!0}});var i=L(r,2);{let e=j(()=>!B(C));lu(i,{value:`keep`,get checked(){return B(e)},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`keep_both`)]),W(e,n)},$$slots:{default:!0}})}W(e,n)},$$slots:{default:!0}})}O(t),z(e=>G(n,`${e??``} `),[()=>X(`file_name_conflict_confirmation`,{values:{count:B(T)}})]),W(e,t)};K(w,e=>{B(T)&&e(ee)}),W(e,n)},$$slots:{default:!0}})}var te=L(E,2);Pu(te,{get show(){return B(n)},duration:0,children:(e,t)=>{Vc(e,{status:`info`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`uploading_files_progress`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(te,2),{get show(){return B(r)},set show(e){N(r,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`uploading_files_failed`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,ee),A()}function Vat(e,t){k(t,!0);let n=M(void 0),r=j(()=>QB.current),i=j(()=>B(r).originalAssets),a=j(()=>B(i)?.[0]),o=j(()=>!B(a)),s=j(()=>B(a)?lV.getType(B(a).name)??void 0:void 0),c=e=>{e.length&&(QB.current=B(a)?{folder:B(a).folder,files:e,originalAssets:B(i)}:{folder:VB.current,subfolderPath:BV.current,files:e},UQ.current=!1)};R(()=>{!sW.hasMouse&&UQ.current&&B(n)?.open()}),R(()=>{HQ.current||(UQ.current=!1)}),R(()=>{UQ.current||co(()=>{!QB.current.files.length&&QB.current.originalAssets&&(QB.current={folder:void 0,files:[]})})});var l=U(),u=F(l),d=e=>{{let t=j(()=>B(a)?X(`replace_x`,{values:{name:B(a).name}}):X(`upload_assets`));Pl(e,{get title(){return B(t)},showOk:!1,get open(){return UQ.current},set open(e){UQ.current=e},children:(e,t)=>{R$(e,{showUploadButton:!0,get accept(){return B(s)},get multiple(){return B(o)},filterDroppedFiles:!1,onDrop:({files:e})=>{c(e)}})},$$slots:{default:!0}})}},f=e=>{ms(Jl(e,{get accept(){return B(s)},get multiple(){return B(o)},onSelect:({files:e})=>{c(e)},onCancel:()=>{UQ.current=!1}}),e=>N(n,e,!0),()=>B(n))};K(u,e=>{sW.hasMouse?e(d):e(f,-1)}),W(e,l),A()}var Hat=V(`<div role="blockquote" class="svelte-2picl5"><pre class="svelte-2picl5"> </pre></div>`),Uat={hash:`svelte-2picl5`,code:`div.svelte-2picl5 {flex:auto;overflow:auto;}pre.svelte-2picl5 {margin:0;padding:16px;width:100%;min-width:fit-content;min-height:-moz-available;min-height:-webkit-fill-available;min-height:stretch;background-color:var(--sui-primary-background-color);}`};function Wat(e,t){k(t,!0),q(e,Uat);{let t=e=>{var t=Hat(),n=I(P(t),!0);O(t),z((e,r)=>{J(t,`aria-label`,e),G(n,r)},[()=>X(`cms_config`),()=>OEe(ek)]),W(e,t)},n=j(()=>X(`site_configuration_editor`));B5(e,{get"aria-label"(){return B(n)},main:t,$$slots:{main:!0}})}A()}var Gat=V(`<!> <!> <!> <!>`,1);function Kat(e,t){k(t,!0);let n=j(()=>new Date),r=j(()=>X6.current),i=j(()=>B(r).resolve),a=j(()=>B(r).timestamp),o=j(()=>B(n).getUTCFullYear()===B(a)?.getUTCFullYear()),s=j(()=>B(o)&&B(n).getUTCMonth()===B(a)?.getUTCMonth()),c=j(()=>B(s)&&B(n).getUTCDate()===B(a)?.getUTCDate()),l=j(()=>B(a)?.toLocaleString(Fc.current,{year:B(o)?void 0:`numeric`,month:B(c)?void 0:`short`,day:B(c)?void 0:`numeric`,hour:`numeric`,minute:`numeric`}));R(()=>{!$Q.current&&X6.current.show&&(X6.current.show=!1,B(i)?.())});var u=Gat(),d=F(u);{let e=j(()=>X(`restore_backup_title`)),t=j(()=>X(`restore`)),n=j(()=>X(`discard`));Il(d,{get title(){return B(e)},get okLabel(){return B(t)},get cancelLabel(){return B(n)},onOk:()=>{B(i)?.(!0)},onCancel:()=>{B(i)?.(!1)},get open(){return X6.current.show},set open(e){X6.current.show=e},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`restore_backup_description`,{values:{datetime:B(l)}})]),W(e,n)},$$slots:{default:!0}})}var f=L(d,2);Pu(f,{get show(){return Z6.current.saved},set show(e){Z6.current.saved=e},children:(e,t)=>{Vc(e,{status:`info`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`draft_backup_saved`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var p=L(f,2);Pu(p,{get show(){return Z6.current.restored},set show(e){Z6.current.restored=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`draft_backup_restored`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(p,2),{get show(){return Z6.current.deleted},set show(e){Z6.current.deleted=e},children:(e,t)=>{Vc(e,{status:`info`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`draft_backup_deleted`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,u),A()}var qat=({collectionName:e,fileName:t})=>RO.get(t??e),Jat=({lang:e,dir:t,styleURLs:n,origin:r})=>`
|
||
<!DOCTYPE html>
|
||
<html${e?` lang="${Xk(e)}"`:``}${t?` dir="${t}"`:``}>
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<base href="${Xk(r)}" target="_blank">
|
||
${n.map(e=>`<link rel="stylesheet" href="${Xk(e)}">`).join(`
|
||
`)}
|
||
</head>
|
||
<body></body>
|
||
</html>
|
||
`,Yat=V(`<iframe class="preview svelte-1k58u5t" sandbox="allow-same-origin allow-scripts allow-popups allow-forms"></iframe>`),Xat={hash:`svelte-1k58u5t`,code:`iframe.svelte-1k58u5t {display:block;border:none;width:100%;height:100%;}`};function Zat(e,t){k(t,!0),q(e,Xat);let n=Ez(),r=M(!1),i=M(void 0),a=M(void 0),o,s=j(()=>DA(t.locale)),c=j(()=>t.locale===`_default`?void 0:OA(t.locale)),l=()=>{let e=B(i)?.contentDocument?.body;e&&(o=To(qre,{target:e,context:Dz(n),props:{children:t.children}}))},u=()=>{let{contentDocument:e,contentWindow:n}=B(i);if(!B(a)||!t.reactComponent||!t.reactProps||!e||!n)return;let r={...t.reactProps,document:e,window:n};B(a).render((0,br.createElement)(t.reactComponent,r))},d=async()=>{if(!t.reactComponent)return;let{createRoot:e}=await M3(),n=B(i)?.contentDocument,r=n?.body;if(!n||!r)return;let o=e=>{h0e({event:e,locale:t.locale})};n.addEventListener(`click`,o),n.addEventListener(`keydown`,o),N(a,e(r),!0)},f=e=>{console.error(e)},p=()=>{if(!B(i)||B(r))return;let e=t.reactComponent?d:l,n=Jat({lang:B(s),dir:B(c),styleURLs:t.styleURLs,origin:window.location.origin}),a=URL.createObjectURL(new Blob([n],{type:`text/html`}));B(i).addEventListener(`load`,async()=>{try{await e()}catch(e){f(e)}URL.revokeObjectURL(a),N(r,!0),t.onLoad?.(B(i))},{once:!0}),B(i).src=a};R(()=>{B(i)&&!B(r)&&p()}),R(()=>{let e=B(r)?B(i)?.contentDocument?.documentElement:void 0;e&&(B(s)?e.lang=B(s):e.removeAttribute(`lang`),B(c)?e.dir=B(c):e.removeAttribute(`dir`))}),R(()=>{P0.current,B(r)&&B(a)&&t.reactComponent&&t.reactProps&&u()}),R(()=>()=>{B(a)?.unmount(),o&&Oo(o)});var m=Yat();ms(m,e=>N(i,e),()=>B(i)),z(e=>J(m,`title`,e),[()=>X(`content_preview`)]),W(e,m),A()}var Qat=({collectionName:e,fileName:t})=>[...new Set([...LO].filter(({collection:n,file:r})=>(n===void 0||n===e)&&(r===void 0||r===t)).map(({url:e})=>e))],$at=({target:e,entryDraft:t,locale:n,keyPath:r,fieldConfig:i})=>To(K6,{target:e,context:Dz(t),props:{keyPath:r,typedKeyPath:``,locale:n,fieldConfig:i,showLabel:!1}}),eot=({entryDraft:e,locale:t,keyPath:n,fieldConfig:r})=>{let i=(0,br.useRef)(null);return(0,br.useLayoutEffect)(()=>{let a=$at({target:i.current,entryDraft:e,locale:t,keyPath:n,fieldConfig:r});return()=>{Oo(a)}},[e,t,n,r]),(0,br.createElement)(`div`,{ref:i})},tot=({entryDraft:e,locale:t,getFieldArgs:n})=>r=>{let i=_M({...n,keyPath:r});return i?(0,br.createElement)(eot,{entryDraft:e,locale:t,keyPath:r,fieldConfig:i}):null},not=(e,t,n)=>N0().Map(Object.fromEntries(Object.keys(e).map(e=>[e,n(`${t}.${e}`)]).filter(([,e])=>e!==null))),rot=(e,t)=>n=>{let r=e[n];if(r==null)return r;let{fromJS:i,Map:a}=N0();return Array.isArray(r)?r.map((e,r)=>{let o=typeof e==`object`&&!!e;return a({data:i(e),widgets:o?not(e,`${n}.${r}`,t):a({})})}):typeof r==`object`?a({data:i(r),widgets:not(r,n,t)}):r},iot=async(e,t)=>{let n=YA(e);if(!n)throw Error(`Collection "${e}" not found`);let{defaultLocale:r}=n._i18n,i=BL(e),a={locale:r,collectionName:e,associatedAssets:B0({collectionName:e})},o=e=>L0({...a,entry:e});return t?o(i.find(e=>e.slug===t)):i.map(o)},aot=({entryDraft:e,draft:t,locale:n})=>{let{entryMap:r,valueMap:i,getFieldArgs:a,fieldsMetaData:o,getAsset:s}=V0({draft:t,locale:n}),c=tot({entryDraft:e,locale:n,getFieldArgs:a});return{entry:r,widgetFor:c,widgetsFor:rot(Mj(i),c),getAsset:s,getCollection:iot,fieldsMetaData:o}},oot=V(`<div role="none"><!></div>`),sot=V(`<div role="document" class="svelte-17akd4q"><!></div>`),cot={hash:`svelte-17akd4q`,code:`[role='document'].svelte-17akd4q {--entry-preview-padding-block: 8px;--entry-preview-padding-inline: 16px;padding-block:var(--entry-preview-padding-block);padding-inline:var(--entry-preview-padding-inline);
|
||
/* Keep the content written by other users within the preview, even if it’s positioned */contain:paint;}`};function lot(e,t){k(t,!0),q(e,cot);let n=e=>{var n=U();Ro(F(n),17,()=>B(s),e=>e.name,(e,n)=>{var r=oot();kO(P(r),{children:(e,r)=>{K6(e,{get keyPath(){return B(n).name},get typedKeyPath(){return B(n).name},get locale(){return t.locale},get fieldConfig(){return B(n)}})},$$slots:{default:!0}}),O(r),z(()=>J(r,`data-lazy-key-path`,B(n).name)),W(e,r)}),W(e,n)},r=Ez(),i=j(()=>r.current??{}),a=j(()=>B(i).collectionName),o=j(()=>B(i).fileName),s=j(()=>Nr(B(i).fields,()=>[],!0)),c=j(()=>Qat({collectionName:B(a),fileName:B(o)})),l=j(()=>qat({collectionName:B(a),fileName:B(o)})),u=j(()=>r.current&&B(l)&&A0.current?aot({entryDraft:r,draft:{...r.current,currentValues:yz(r.current)},locale:t.locale}):void 0);R(()=>{B(l)&&j0().catch(e=>{console.error(e)})}),kO(e,{children:(e,r)=>{var i=U(),a=F(i),o=e=>{Zat(e,{get locale(){return t.locale},get styleURLs(){return B(c)},get reactComponent(){return B(l)},get reactProps(){return B(u)},get onLoad(){return t.onFrameLoad}})},s=e=>{Zat(e,{get locale(){return t.locale},get styleURLs(){return B(c)},get children(){return n},get onLoad(){return t.onFrameLoad}})},d=e=>{var t=sot(),r=P(t);n(r),O(t),z(e=>J(t,`aria-label`,e),[()=>X(`content_preview`)]),W(e,t)};K(a,e=>{B(l)&&B(u)?e(o):B(c).length?e(s,1):e(d,-1)}),W(e,i)},$$slots:{default:!0}}),A()}var U5,uot=AL(),W5={capture:!0,passive:!0},dot={passive:!0},fot=e=>{if(e===e.ownerDocument.documentElement)return{x:0,y:0};let{left:t,top:n}=e.getBoundingClientRect();return{x:t,y:n}},pot=e=>fot(e).y,mot=(e,t)=>t.getBoundingClientRect().top-pot(e)+e.scrollTop,hot=(e,t,n=!1)=>{let{top:r,height:i}=t.getBoundingClientRect(),{scrollTop:a,clientHeight:o}=e;return b0e({viewTop:pot(e),viewHeight:o,scrollTop:a,top:r,height:i,always:n})},got=e=>{let t,n,r=()=>{window.requestAnimationFrame(()=>{let{contentArea:t}=e,{thisPaneContentArea:n}=e,{thatPaneContentArea:r}=e;if(!e.syncScrolling||!t||!n||!r)return;let{x:i,y:a}=fot(n),{ownerDocument:o,scrollTop:s,scrollHeight:c,clientHeight:l}=n;if(s<=0){r.scrollTop=0;return}let u=o.elementsFromPoint(i+80,a).findLast(e=>e.matches(`[data-key-path]`));if(!u){r.scrollTop=g0e({scrollTop:s,scrollHeight:c,clientHeight:l,targetScrollHeight:r.scrollHeight,targetClientHeight:r.clientHeight});return}let{keyPath:d}=u.dataset,{top:f,height:p}=u.getBoundingClientRect(),m=r.querySelector(`[data-key-path="${CSS.escape(d)}"]`),h=m?_0e({y:a,top:f,height:p,targetTop:mot(r,m),targetHeight:m.getBoundingClientRect().height}):void 0;h!==void 0&&(r.scrollTop=h)})},i=()=>{U5=e.thisPaneContentArea,uot.next()},a=()=>{U5===e.thisPaneContentArea&&r()},o=async t=>{let{thisPaneContentArea:n}=e,{thatPaneContentArea:r}=e;if(!e.syncScrolling||!n||!r||!t.isConnected)return;let i=uot.next(),a=r,{scrollTop:o}=a,{keyPath:s}=t.dataset,c=await y0e({container:a,keyPath:s,scrollTo:e=>{let{scrollTop:t}=a;return U5=n,a.scrollTo({top:hot(a,e,!0),behavior:`instant`}),Math.abs(a.scrollTop-t)>=1},isOutdated:()=>!i()||!e.syncScrolling});if(!c){i()&&e.syncScrolling&&a.scrollTop!==o&&(U5=n,a.scrollTo({top:o,behavior:`instant`}));return}let l=hot(a,c);l!==void 0&&(U5=n,a.scrollTo({top:l,behavior:`smooth`}))};return{initialize:()=>{let{contentArea:r}=e;if(!r)return;let o=e.thisPaneContentArea;o&&(o.removeEventListener(`wheel`,i,W5),o.removeEventListener(`touchstart`,i,W5),t?.removeEventListener(`scroll`,a,dot)),n&&!r.contains(n)&&(n=void 0);let s=n?.contentDocument?.documentElement??void 0,c=s??r;e.thisPaneContentArea=c,t=s?s.ownerDocument:r,c.scrollTop=0,c.addEventListener(`wheel`,i,W5),c.addEventListener(`touchstart`,i,W5),t.addEventListener(`scroll`,a,dot)},setPreviewFrame:e=>{n=e},onFocusIn:t=>{let n=t.target.closest(`.field[data-key-path]`);e.mode===`edit`&&n&&window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{o(n)})})},destroy:()=>{U5===e.thisPaneContentArea&&(U5=void 0)}}},_ot=V(`<div role="none" class="content svelte-1vy4qxn"><!></div>`),vot=V(`<span role="alert"> </span> <!>`,1),yot=V(`<div role="none" class="wrapper svelte-1vy4qxn"><!></div>`),bot={hash:`svelte-1vy4qxn`,code:`.wrapper.svelte-1vy4qxn {display:contents;}.content.svelte-1vy4qxn {--field-editor-padding: 16px;flex:auto;overflow-y:auto;scroll-behavior:auto; /* Don’t use smooth scroll for syncing */overscroll-behavior-y:contain;
|
||
|
||
@media (width < 768px) {--field-editor-padding: 12px;
|
||
}}`};function xot(e,t){k(t,!0),q(e,bot);let n=Ez(),r=Y(t,`thisPaneContentArea`,15),i=Y(t,`thatPaneContentArea`,3,void 0),a=j(()=>u8.current??{}),o=j(()=>B(a).syncScrolling),s=j(()=>t.thisPane.current?.locale),c=j(()=>t.thisPane.current?.mode),l=j(()=>!!B(s)&&!!n.current?.currentValues[B(s)]),u=j(()=>zY(n.current)||EY(n.current?.originalEntry)),d=j(()=>({values:{locale:B(s)?kA(B(s))??B(s):``}})),f=M(void 0),p=got({get syncScrolling(){return B(o)},get mode(){return B(c)},get contentArea(){return B(f)},get thisPaneContentArea(){return r()},set thisPaneContentArea(e){r(e)},get thatPaneContentArea(){return i()}});R(()=>{t.thisPane.current?.mode,B(f),co(()=>p.initialize())}),R(()=>()=>{p.destroy()});var m=yot(),h=P(m),g=e=>{var t=_ot(),n=P(t),r=e=>{lot(e,{get locale(){return B(s)},onFrameLoad:e=>{p.setPreviewFrame(e),p.initialize()}})},i=e=>{R4e(e,{get locale(){return B(s)}})};K(n,e=>{B(c)===`preview`?e(r):e(i,-1)}),O(t),ms(t,e=>N(f,e),()=>B(f)),_o(`focusin`,t,function(...e){p.onFocusIn?.apply(this,e)}),W(e,t)},_=e=>{DO(e,{children:(e,t)=>{var r=vot(),i=F(r),a=I(i,!0),o=L(i,2),c=e=>{{let t=j(()=>X(B(l)?`reenable_x_locale`:`enable_x_locale`,B(d)));ll(e,{variant:`tertiary`,get label(){return B(t)},onclick:()=>{B(s)&&n.current&&WXe({draft:n.current,locale:B(s)})}})}};K(o,e=>{B(u)||e(c)}),z(e=>G(a,e),[()=>X(B(l)?`locale_x_now_disabled`:`locale_x_has_been_disabled`,B(d))]),W(e,r)},$$slots:{default:!0}})};K(h,e=>{B(s)&&n.current?.currentLocales[B(s)]?e(g):B(c)===`edit`&&e(_,1)}),O(m),z(()=>J(m,`id`,t.id)),W(e,m),A()}vo([`focusin`]);function Sot(e,t){k(t,!0);let n=Ez(),r=Y(t,`open`,15,!1),i=Y(t,`locale`,3,void 0),a=Y(t,`onClose`,3,void 0),o=j(()=>g1e(t.action,i()?`locale`:`entry`));Il(e,{get title(){return B(o)},get okLabel(){return B(o)},onOk:()=>{let e=n.current;e&&(t.action===`revert`?M1e({draft:e,locale:i()}):E1e({draft:e,locale:i(),restore:t.action===`restore`}))},onClose:()=>{a()?.()},get open(){return r()},set open(e){r(e)},children:(e,n)=>{$r();var r=H();z(e=>G(r,e),[()=>_1e(t.action,i())]),W(e,r)},$$slots:{default:!0}}),A()}function Cot(e,t){k(t,!0);let n=Y(t,`thisPane`,7);{let t=e=>{Lc(e,{name:`visibility`})},r=j(()=>X(`preview`)),i=j(()=>n().current?.mode===`preview`);ll(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return B(r)},get pressed(){return B(i)},onclick:()=>{Lz(()=>{n().current={mode:n().current?.mode===`preview`?`edit`:`preview`,locale:n().current?.locale??``}})},startIcon:t,$$slots:{startIcon:!0}})}A()}var wot=(e,t)=>e===`error`||!t||t===`unknown`?e:t===`ready`?`ready`:e===`ready`?`pending`:e,Tot=({entry:e,locale:t,collection:n,collectionFile:r,pullRequest:i,deployments:a,productionSHA:o,pollTimedOut:s=!1})=>{let c=(i,a=!1)=>XKe(e,t,n,r,{baseURL:i,fallbackToRoot:a});if(i){let e=i.headSHA?a[i.headSHA]:void 0,t=e?.url?c(e.url,!0):void 0;if(e&&t)return{url:t,state:e.state,isDeployPreview:!0,awaitingPreview:!1,pingable:!0};let n=c();if(!n)return;let r=e?.state??`unknown`;return{url:n,state:r,isDeployPreview:!1,awaitingPreview:!s&&(r===`checking`||r===`pending`),pingable:!1}}let l=o?a[o]:void 0,u=c()??c(l?.url);if(u)return{url:u,state:l?.state??`unknown`,isDeployPreview:!1,awaitingPreview:!1,pingable:!0}},Eot=V(`<div role="none" class="icon-wrapper svelte-13aw5dy"><!></div>`),Dot={hash:`svelte-13aw5dy`,code:`.icon-wrapper.svelte-13aw5dy {display:contents;& .spinning {
|
||
animation: svelte-13aw5dy-spin 1.6s linear infinite;}
|
||
|
||
@media (prefers-reduced-motion: reduce) {& .spinning {
|
||
animation: none;}
|
||
}}
|
||
|
||
@keyframes svelte-13aw5dy-spin {
|
||
to {
|
||
transform: rotate(360deg);
|
||
}
|
||
}`};function G5(e,t){k(t,!0),q(e,Dot);let n=Y(t,`as`,3,`button`),r=Y(t,`variant`,3,`ghost`),i=Y(t,`size`,3,`medium`),a=Y(t,`iconic`,3,!1),o=j(()=>Tot({entry:t.entry,locale:t.locale,collection:t.collection,collectionFile:t.collectionFile,pullRequest:t.pullRequest,deployments:QG.current,productionSHA:$G.current,pollTimedOut:tK.current})),s=j(()=>B(o)?.url),c=j(()=>B(o)?wot(B(o).state,B(s)?U8.current[B(s)]:void 0):void 0),l=j(()=>B(o)?.isDeployPreview??!1),u=j(()=>B(o)?.pingable??!1),d=j(()=>B(o)?.awaitingPreview??!1),f=j(()=>B(d)||!B(s)||B(l)&&B(c)===`error`),p=j(()=>B(d)?X(`deploy_preview.awaiting`):B(l)?X(`deploy_preview.view`):X(`view_on_live_site`)),m=j(()=>B(c)===`error`?X(`deploy_preview.failed`):B(c)===`checking`?X(`deploy_preview.checking`):B(c)===`pending`?X(`deploy_preview.building`):void 0),h=()=>{B(s)&&hB(B(s))};R(()=>{let e=B(u),t=B(s),n=B(o)?.state===`ready`;e&&t&&_9e(t,{recheckPending:n})});var g=U(),_=F(g),v=e=>{var t=U(),o=F(t),s=e=>{iu(e,{get label(){return B(p)},get disabled(){return B(f)},get"aria-description"(){return B(m)},onclick:h})},c=e=>{{let t=e=>{var t=Eot(),n=P(t);{let e=j(()=>B(d)?`spinning`:void 0),t=j(()=>B(d)?`progress_activity`:`open_in_new`);Lc(n,{get class(){return B(e)},get name(){return B(t)}})}O(t),W(e,t)},n=j(()=>a()?void 0:B(p)),o=j(()=>a()?B(p):void 0);ll(e,{get variant(){return r()},get size(){return i()},get iconic(){return a()},get label(){return B(n)},get"aria-label"(){return B(o)},get disabled(){return B(f)},get"aria-description"(){return B(m)},onclick:h,endIcon:t,$$slots:{endIcon:!0}})}};K(o,e=>{n()===`menuitem`?e(s):e(c,-1)}),W(e,t)};K(_,e=>{B(o)&&e(v)}),W(e,g),A()}var Oot={edit_x_locale:`edit_content`,preview_x_locale:`preview_content`,show_content_options_x_locale:`show_content_options`,content_options_x_locale:`content_options`},K5=(e,t)=>t===`_default`?X(Oot[e]):X(e,{values:{locale:kA(t)??t}}),kot=({collection:e,collectionFile:t})=>t?.name?[e?.name,t.name].join(`|`):e?.name,Aot=({firstPane:e,secondPane:t})=>!e&&!t?[0,0,0]:!e||!t?[e?100:0,t?100:0,0]:typeof e.width==`number`&&typeof t.width==`number`&&e.width>=30&&t.width>=30&&e.width+t.width===100?[e.width,t.width,30]:[50,50,30],jot=({savedPanes:e=[null,null],editorLocale:t,allLocales:n,defaultLocale:r,canPreview:i,showPreview:a,showSecondPane:o})=>{let[s,c]=t?[{mode:`edit`,locale:t},{mode:`preview`,locale:t}]:e;if(s&&c&&(!s.locale||n.includes(s.locale))&&(!c.locale||n.includes(c.locale))&&o&&(a&&i||s.mode!==`preview`&&c.mode!==`preview`)&&(t||n.length!==2||s.locale===r))return[s,c]},Mot=({editorLocale:e,currentLocale:t,defaultLocale:n,allLocales:r,i18nEnabled:i,canPreview:a,showPreview:o,showSecondPane:s,singlePane:c})=>{let l=(e&&r.includes(e)?e:void 0)??t??n,u={mode:`edit`,locale:l};if(c||!s)return[u,null];if(!o||!a){let e=i?r.find(e=>e!==l):void 0;return[u,e?{mode:`edit`,locale:e}:null]}return[u,{mode:`preview`,locale:l}]},Not=({firstPane:e,secondPane:t,locale:n})=>{let r={mode:`edit`,locale:n};if(!(e?.mode===`edit`&&e.locale===n||t?.mode===`edit`&&t.locale===n))return t?.mode===`preview`?[e,r]:e?.mode===`preview`?[r,t]:t?[e,r]:[r,t]},Pot=(e,t)=>{let n=co(()=>u8.current);u8.current={...n,paneStates:{...n?.paneStates,[e]:t}}},q5=0,J5=0,Y5=0,X5=0,Z5=void 0,Q5=``,$5=0,Fot=()=>{let e=QG.current;return Z8.current.every(({sha:t})=>{let n=e[t]?.state;return n===`ready`||n===`error`||n===`unknown`})},Iot=(e,t)=>{if(!e.length)return;CW.devModeEnabled&&console.info(`deployPreview: ${t}`,{shas:e,remaining:6e4-(Date.now()-Y5)});let n=QG.current;QG.current={...n,...Object.fromEntries(e.map(e=>[e,{...n[e],state:`checking`}]))}},Lot=e=>{if(Date.now()-Y5>=6e4)return;let t=QG.current;Iot(Z8.current.map(({sha:e})=>e).filter(n=>{if(t[n]?.state!==`unknown`)return!1;let r=e[n];return!r||r.state===`checking`||r.state===`unknown`&&r.checkedTime>=Y5}),`nothing reported yet, still waiting`)},Rot=()=>{let e=QG.current,t=Date.now();Iot(Z8.current.map(({sha:e})=>e).filter(n=>{let r=e[n];return r?.state===`unknown`&&t-r.checkedTime<6e4}),`concluded only moments ago, waiting a little longer`)},zot=()=>Z8.current.map(({sha:e})=>e).join(`,`),e7=()=>{globalThis.clearTimeout(q5),q5=0,$5+=1},t7=()=>{e7(),b9e()},Bot=()=>{if(!J5||!Q8()||Fot()){CW.devModeEnabled&&console.info(`deployPreview: not re-checking`,{watchers:J5,canResolve:Q8(),settled:Fot(),attempts:X5}),t7();return}if(Date.now()-Y5>6e5){tK.current=!0,t7();return}let e=$5;q5=globalThis.setTimeout(async()=>{q5=0,X5+=1;let t=QG.current;await $8({pendingOnly:!0}),Lot(t),e===$5&&Bot()},5e3)},n7=()=>{e7(),X5=0,Y5=Date.now(),tK.current=!1,Q8()&&(C9e(),Rot()),Bot()},Vot=()=>{J5+=1,J5===1&&(Q5=zot(),Z5=JO(()=>{let e=zot();e!==Q5&&(Q5=e,co(n7))}),n7());let e=!1;return()=>{e||(e=!0,--J5,J5||(Z5?.(),Z5=void 0,t7()))}},Hot=()=>co(Vot),Uot=async()=>{e7(),tK.current=!1,await $8({force:!0}),n7()},r7=V(`<!> <!>`,1),Wot=V(`<h3 role="none"> </h3>`),Got=V(`<!> <!> <!>`,1),Kot=V(`<!> <!> <!> <!>`,1),qot=V(`<div role="none" class="header svelte-uj56is"><!></div> <!>`,1),Jot={hash:`svelte-uj56is`,code:`.header.svelte-uj56is {flex:none !important;& > .sui.toolbar {margin-inline:auto;max-width:800px;
|
||
|
||
@media (width < 768px) {padding:0;
|
||
}h3 {margin:0 8px;font-size:var(--sui-font-size-default);}}}`};function Yot(e,t){k(t,!0),q(e,Jot);let n=Ez(),r=Y(t,`thatPane`,19,()=>WO(null)),i=j(()=>n.current?.collection),a=j(()=>n.current?.collectionFile),o=j(()=>n.current?.originalEntry),s=j(()=>n.current?.originalValues??{}),c=j(()=>BA(n.current)),l=j(()=>B(c).i18nEnabled),u=j(()=>B(c).saveAllLocales),d=j(()=>B(c).allLocales),f=j(()=>B(c).defaultLocale),p=j(()=>n.current?.currentLocales[t.thisPane.current?.locale??``]),m=j(()=>Object.values(n.current?.currentLocales??{}).filter(e=>e).length===1),h=j(()=>B(l)?B(d).filter(e=>e!==t.thisPane.current?.locale):[]),g=j(()=>!!B(h).length),_=j(()=>EY(n.current?.originalEntry)),v=j(()=>zY(n.current)),y=j(()=>!!t.thisPane.current?.locale&&lz(B(s)[t.thisPane.current.locale]??{},vz(n.current,t.thisPane.current.locale))),b=j6(()=>{let e=n.current,r=t.thisPane.current?.locale;if(e&&r)return{restore:k6({draft:e,locale:r,restore:!0}),clear:k6({draft:e,locale:r})}}),x=M(void 0),S=j(()=>n.current?.canPreview??!0),C=j(()=>!(sW.isSmallScreen||sW.isMediumScreen)&&!r().current&&B(S)&&!!u8.current?.showPreview),w=j(()=>sY.current&&n.current?wY(n.current)?.workflow.pullRequest:void 0),T=j(()=>B(o)&&B(i)&&t.thisPane.current?Tot({entry:B(o),locale:t.thisPane.current.locale,collection:B(i),collectionFile:B(a),pullRequest:B(w),deployments:QG.current,productionSHA:$G.current,pollTimedOut:tK.current}):void 0),ee=j(()=>!!B(o)&&!!B(i)&&!!(B(T)||tK.current||CW.devModeEnabled));var E=qot(),te=F(E),ne=P(te);{let e=j(()=>X(`secondary`));pO(ne,{variant:`secondary`,get ariaLabel(){return B(e)},children:(e,s)=>{var c=Got(),T=F(c),E=e=>{var n=r7(),i=F(n);B3e(i,{get id(){return t.id},get thisPane(){return t.thisPane},get thatPane(){return r()},get previewInThisPane(){return B(C)}});var a=L(i,2),o=e=>{Cot(e,{get thisPane(){return t.thisPane}})};K(a,e=>{(sW.isSmallScreen||sW.isMediumScreen)&&B(S)&&e(o)}),W(e,n)},te=e=>{var n=Wot(),r=I(n,!0);z(e=>G(r,e),[()=>t.thisPane.current?.mode===`preview`?X(`preview`):X(`edit`)]),W(e,n)},ne=e=>{Cot(e,{get thisPane(){return t.thisPane}})};K(T,e=>{B(l)&&B(d).length>1||B(C)?e(E):sW.isSmallScreen||sW.isMediumScreen?B(S)&&e(ne,2):e(te,1)});var re=L(T,2);Ml(re,{flex:!0});var ie=L(re,2),ae=e=>{let r=j(()=>t.thisPane.current.locale),s=j(()=>kA(B(r))??B(r));var c=r7(),l=F(c),d=e=>{y1e(e,{get locale(){return t.thisPane.current.locale},get otherLocales(){return B(h)}})};K(l,e=>{B(g)&&!B(v)&&e(d)});var S=L(l,2),C=e=>{{let c=e=>{{let c=j(()=>K5(`content_options_x_locale`,B(r)));ru(e,{get ariaLabel(){return B(c)},children:(e,r)=>{var c=r7(),l=F(c),d=e=>{var r=Got(),i=F(r),a=e=>{T6(e,{get locale(){return t.thisPane.current.locale},get otherLocales(){return B(h)},submenu:!0})};K(i,e=>{B(g)&&t.thisPane.current?.locale&&e(a)});var o=L(i,2);{let e=j(()=>({revert:!!B(y),...b.availability}));D6(o,{scope:`locale`,get separator(){return B(g)},get available(){return B(e)},get onSelect(){return b.select}})}var c=L(o,2),l=e=>{var r=r7(),i=F(r);ql(i,{});var a=L(i,2);{let e=j(()=>X(B(p)?`disable_x_locale`:n.current?.currentValues[t.thisPane.current.locale]?`reenable_x_locale`:`enable_x_locale`,{values:{locale:B(s)}})),r=j(()=>t.thisPane.current.locale===B(f)||B(p)&&B(m));iu(a,{get label(){return B(e)},get disabled(){return B(r)},onclick:()=>{n.current&&WXe({draft:n.current,locale:t.thisPane.current?.locale??``})}})}W(e,r)};K(c,e=>{!B(u)&&t.thisPane.current?.locale&&e(l)}),W(e,r)};K(l,e=>{B(v)||e(d)});var _=L(l,2),x=e=>{var n=Kot(),r=F(n),s=e=>{ql(e,{})};K(r,e=>{!B(v)&&B(ee)&&e(s)});var c=L(r,2);G5(c,{as:`menuitem`,get entry(){return B(o)},get locale(){return t.thisPane.current.locale},get collection(){return B(i)},get collectionFile(){return B(a)},get pullRequest(){return B(w)}});var l=L(c,2),u=e=>{{let t=j(()=>X(`deploy_preview.check_again`));iu(e,{get label(){return B(t)},onclick:()=>{Uot()}})}};K(l,e=>{tK.current&&e(u)});var d=L(l,2),f=e=>{{let n=j(()=>!XJ.current?.repository?.blobBaseURL),r=j(()=>XJ.current?.repository?.label?X(`view_on_x`,{values:{service:XJ.current.repository.label}}):X(`view_in_repository`));iu(e,{get disabled(){return B(n)},get label(){return B(r)},onclick:()=>{B(o)&&t.thisPane.current&&hB(ZKe(B(o),t.thisPane.current.locale))}})}};K(d,e=>{CW.devModeEnabled&&e(f)}),W(e,n)};K(_,e=>{B(o)&&B(i)&&t.thisPane.current&&e(x)}),W(e,c)},$$slots:{default:!0}})}},l=j(()=>K5(`show_content_options_x_locale`,B(r)));ms(kl(e,{variant:`ghost`,iconic:!0,get disabled(){return B(_)},popupPosition:`bottom-right`,get"aria-label"(){return B(l)},get onclick(){return b.update},get onkeydown(){return b.update},popup:c,$$slots:{popup:!0}}),e=>N(x,e,!0),()=>B(x))}};K(S,e=>{(!B(v)||B(ee))&&e(C)}),W(e,c)};K(ie,e=>{t.thisPane.current?.mode===`edit`&&e(ae)}),W(e,c)},$$slots:{default:!0}})}O(te);var re=L(te,2);{let e=j(()=>t.thisPane.current?.locale);Sot(re,{get action(){return b.action},get locale(){return B(e)},onClose:()=>{B(x)?.focus()},get open(){return b.dialogOpen},set open(e){b.dialogOpen=e}})}z(()=>J(te,`id`,t.id)),W(e,E),A()}var Xot=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Zot(e,t){k(t,!0);let n=Ez(),r=j(()=>P6e(n.current));var i=U(),a=F(i),o=e=>{var t=Xot(),n=F(t);Po(n,()=>({"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{status:`warning`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`relation_field.edited_with_entry`,{values:{name:B(r)}})]),W(e,n)},$$slots:{default:!0}}),O(n),W(e,t)};K(a,e=>{B(r)!==void 0&&e(o)}),W(e,i),A()}var Qot=async({entryDraft:e,entry:t})=>{let n=e.current,{collectionName:r,collection:i,collectionFile:a,expanderStates:o}=n;return t8(),await Q6(r,e8(n)),o8({entryDraft:e,collection:i,collectionFile:a,originalEntry:t,expanderStates:o})},$ot=(e,t)=>e.current===t&&!t.interacted&&!dz(t),est=async e=>{let t=e.current;if(!t||t.isNew||!t.originalEntry||TY(t))return;try{await U4({maxAge:1e4})}catch(e){console.error(`Failed to check the repository for changes.`,e);return}if(!$ot(e,t))return;let n=g8(t.originalEntry);if(n?.type!==`modified`||!n.canOverwrite)return;let{collectionName:r,collection:i,collectionFile:a,expanderStates:o}=t;await $6(r,e8(t))||$ot(e,t)&&o8({entryDraft:e,collection:i,collectionFile:a,originalEntry:n.entry,expanderStates:o})},tst=V(` <!>`,1),nst=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),rst=V(`<!> <!>`,1);function ist(e,t){k(t,!0);let n=Ez(),r=j(()=>n.current),i=j(()=>B(r)&&!B(r).isNew&&!TY(B(r))?B(r).originalEntry:void 0),a=j(()=>B(i)?g8(B(i)):void 0),o=M(void 0),s=M(!1),c=j(()=>!!B(a)&&B(o)!==(B(a).entry??`deleted`)),l=async()=>{B(a)?.entry&&await Qot({entryDraft:n,entry:B(a).entry})};var u=rst(),d=F(u),f=e=>{let t=j(()=>Z3e(B(a),Fc.current));var n=nst(),i=F(n);Po(i,()=>({"--sui-infobar-message-justify-content":`center`})),ul(i.lastChild,{status:`warning`,onDismiss:()=>{N(o,B(a).entry??`deleted`)},children:(e,n)=>{$r();var i=tst(),o=F(i),c=L(o),u=e=>{{let t=j(()=>X(`remote_change.reload_entry`));ll(e,{variant:`link`,get label(){return B(t)},onclick:()=>{dz(B(r))?N(s,!0):l()}})}};K(c,e=>{B(a).type===`modified`&&B(a).canOverwrite&&e(u)}),z(()=>G(o,`${B(t).description??``}
|
||
${B(t).warning??``} `)),W(e,i)},$$slots:{default:!0}}),O(i),W(e,n)};K(d,e=>{B(a)&&B(c)&&e(f)});var p=L(d,2);{let e=j(()=>X(`remote_change.reload_entry`)),t=j(()=>X(`remote_change.reload_entry`));Il(p,{get title(){return B(e)},get okLabel(){return B(t)},onOk:async()=>{await l()},get open(){return B(s)},set open(e){N(s,e,!0)},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`remote_change.confirm_reloading_entry`)]),W(e,n)},$$slots:{default:!0}})}W(e,u),A()}var ast=V(`<section role="group" class="panel svelte-1bq1or9"><header class="svelte-1bq1or9"><h3 class="svelte-1bq1or9"> </h3> <!></header> <div class="svelte-1bq1or9"><!></div></section>`),ost={hash:`svelte-1bq1or9`,code:`section.svelte-1bq1or9 {overflow:hidden;height:100%;display:flex;flex-direction:column;}header.svelte-1bq1or9 {flex:none;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--sui-secondary-border-color);padding:0 16px;height:var(--sui-primary-toolbar-size);}h3.svelte-1bq1or9 {flex:auto;font-size:var(--sui-font-size-x-large);}div.svelte-1bq1or9 {flex:auto;overflow:auto;h4 {display:flex;align-items:center;padding:12px 12px 8px;font-size:var(--sui-font-size-large);}& > .empty {padding:16px;}.empty {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.sui.button.ref {display:flex;justify-content:flex-start;gap:8px;padding:8px;width:-moz-available;width:-webkit-fill-available;width:stretch;height:auto;}}`};function i7(e,t){let n=Co();q(e,ost);let r=Y(t,`actions`,3,void 0),i=Y(t,`children`,3,void 0);var a=ast(),o=P(a),s=P(o),c=I(s,!0);Uo(L(s,2),()=>r()??jr),O(o);var l=L(o,2);Uo(P(l),()=>i()??jr),O(l),O(a),z(()=>{J(a,`aria-labelledby`,`panel-${n}-label`),J(s,`id`,`panel-${n}-label`),G(c,t.title)}),W(e,a)}var a7=e=>e==null,sst=({collection:e,collectionFile:t,componentName:n,isIndexFile:r,typedKeyPath:i=``})=>{let a=i.split(`.`);if(!a.includes(`*`))return i;let o={collectionName:e?.name,fileName:t?.name,componentName:n,isIndexFile:r},s=[];for(let e=0;e<a.length;e+=1){let t=a[e];if(t===`*`&&s.length){let n=_M({...o,keyPath:s.join(`.`)}),{field:r}=n??{};s.push(t),n?.widget===`list`&&r?.name===a[e+1]&&(e+=1)}else s.push(t)}return s.join(`.`)},cst=({fieldConfig:e,context:t})=>{let n=sst(t).replace(/<[^>]+>/g,``)||e.name;if(!n.includes(`*`))return{keyPath:n,valuePattern:void 0};let r=e.multiple?`\\.\\d+`:``;return{keyPath:n,valuePattern:RegExp(`^${uj(n)}${r}$`)}},o7=({content:e,keyPath:t,valuePattern:n,multiple:r=!1})=>n?Object.keys(e).filter(t=>n.test(t)&&!a7(e[t])):r?_j(e,t).filter(t=>!a7(e[t])):a7(e[t])?[]:[t],lst=e=>o7(e).map(t=>e.content[t]),s7=({fieldConfig:e,entry:t,locale:n})=>FR({locale:n,fieldConfig:e,refEntry:t}).map(({value:e})=>e),c7=({collectionName:e,fileName:t})=>[...ik.relationFields].filter(({fieldConfig:n})=>n.collection===e&&!(t&&n.file&&n.file!==t)).map(e=>{let{fieldConfig:t,context:n}=e,r=n.collection?.name,i=r?YA(r):void 0;if(!i)return;let a=n.collectionFile?.name;return{fieldConfig:t,sourceCollection:i,sourceCollectionFile:a?ij(i,a):void 0,...cst(e),multiple:!!t.multiple}}).filter(e=>!!e),ust=({collectionName:e,fileName:t,entry:n})=>{let r=new Set,i=c7({collectionName:e,fileName:t}).flatMap(({fieldConfig:e,sourceCollection:t,sourceCollectionFile:i,keyPath:a,valuePattern:o,multiple:s})=>{let c=(i??t)._i18n.defaultLocale,l=new Set(s7({fieldConfig:e,entry:n,locale:c}));if(!l.size)return[];let u=t.name,d=i?.name;return BL(u).filter(e=>e.id!==n.id&&!r.has(e.id)&&(!d||e.slug===d)).map(n=>{let i=xP(n,{locale:c})?.content;if(i&&lst({content:i,keyPath:a,valuePattern:o,multiple:s}).some(e=>l.has(e)))return r.add(n.id),{collectionName:u,collectionLabel:t.label||u,fileName:d,fieldLabel:ER({config:e}),entry:n,summary:$L(t,n,{fileName:d})}}).filter(e=>!!e)}),a=[...new Set(i.map(e=>e.collectionName))];return i.sort((e,t)=>a.indexOf(e.collectionName)-a.indexOf(t.collectionName)||$E(e.summary,t.summary))},dst=V(`<span class="summary"><bdi> </bdi></span>`),fst=V(`<section class="collection svelte-1lhuwki" role="group"><h4> </h4> <!></section>`),pst=V(`<div class="empty"> </div>`),mst={hash:`svelte-1lhuwki`,code:`.collection.svelte-1lhuwki {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}}`};function hst(e,t){let n=Co();k(t,!0),q(e,mst);let r=Ez(),i=j(()=>{let e=r.current;return e?.originalEntry?ust({collectionName:e.collectionName,fileName:e.fileName,entry:e.originalEntry}):[]}),a=j(()=>{let e=[];return B(i).forEach(t=>{let n=e.find(e=>e.collectionLabel===t.collectionLabel);n?n.items.push(t):e.push({collectionLabel:t.collectionLabel,items:[t]})}),e});{let t=j(()=>X(`entry_sidebar.backlinks.title`));i7(e,{get title(){return B(t)},children:(e,t)=>{var r=U(),o=F(r),s=e=>{var t=U();Ro(F(t),19,()=>B(a),({collectionLabel:e,items:t})=>e,(e,t,r)=>{let i=()=>B(t).collectionLabel,a=()=>B(t).items;var o=fst(),s=P(o),c=I(s,!0);Ro(L(s,2),17,a,e=>e.entry.id,(e,t)=>{ll(e,{class:`ref`,variant:`ghost`,onclick:()=>{b$(oP(`/collections/${B(t).collectionName}/entries/${B(t).fileName??B(t).entry.subPath}`),{transitionType:`forwards`})},children:(e,n)=>{var r=dst(),i=I(P(r),!0);O(r),z(()=>G(i,B(t).summary)),W(e,r)},$$slots:{default:!0}})}),O(o),z(()=>{J(o,`aria-labelledby`,`${n}-${B(r)??``}-label`),J(s,`id`,`${n}-${B(r)??``}-label`),G(c,i())}),W(e,o)}),W(e,t)},c=e=>{var t=pst(),n=I(t,!0);z(e=>G(n,e),[()=>X(`entry_sidebar.backlinks.no_entries`)]),W(e,t)};K(o,e=>{B(i).length>0?e(s):e(c,-1)}),W(e,r)},$$slots:{default:!0}})}A()}var l7=new Map,gst=async e=>{let{id:t}=e,n=l7.get(t);if(n)return n;let r=XJ.current;if(!r?.fetchFileCommits)return{commits:[],loading:!1,error:!1};let i=CP(e);try{let e={commits:await r.fetchFileCommits(i),loading:!1,error:!1};return l7.set(t,e),e}catch{let e={commits:[],loading:!1,error:!0};return l7.set(t,e),e}},_st=e=>{l7.delete(e)},u7=V(`<div class="empty"> </div>`),vst=V(`<img class="avatar svelte-14rpg2i" alt="" width="24" height="24" loading="lazy"/>`),yst=V(`<span class="avatar placeholder svelte-14rpg2i" aria-hidden="true"></span>`),bst=V(`<span class="message svelte-14rpg2i"><bdi> </bdi></span>`),xst=V(`<!> <span class="details svelte-14rpg2i"><!> <span><span class="author svelte-14rpg2i"><bdi> </bdi></span> <span class="date svelte-14rpg2i"> </span></span></span>`,1),Sst=V(`<div role="listitem"><!></div>`),Cst=V(`<div role="list" class="commits svelte-14rpg2i"></div>`),wst={hash:`svelte-14rpg2i`,code:`.commits.svelte-14rpg2i {padding:4px;}.avatar.svelte-14rpg2i {flex:none;width:24px;height:24px;border-radius:50%;background-color:var(--sui-secondary-background-color);}.details.svelte-14rpg2i {display:flex;flex-direction:column;gap:2px;overflow:hidden;font-size:var(--sui-font-size-small);}.message.svelte-14rpg2i,
|
||
.author.svelte-14rpg2i {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.meta.svelte-14rpg2i {display:flex;flex-direction:column;gap:2px;overflow:hidden;&.secondary {flex-direction:row;gap:8px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-x-small);}}.date.svelte-14rpg2i {flex:none;color:var(--sui-tertiary-foreground-color);}`};function Tst(e,t){k(t,!0),q(e,wst);let n=Ez(),r=M(na([])),i=M(!1),a=M(!1),o=j(()=>!!I4()),s=async()=>{let e=n.current?.originalEntry;e&&(N(i,!0),await(async e=>{N(r,e.commits,!0),N(a,e.error,!0)})(await gst(e)),N(i,!1))};vs(()=>{s()});{let t=j(()=>X(`entry_sidebar.history.title`));i7(e,{get title(){return B(t)},children:(e,t)=>{var n=U(),s=F(n),c=e=>{var t=u7(),n=I(t,!0);z(e=>G(n,e),[()=>X(`loading`)]),W(e,t)},l=e=>{var t=u7(),n=I(t,!0);z(e=>G(n,e),[()=>X(`entry_sidebar.history.fetch_failed`)]),W(e,t)},u=e=>{var t=Cst();Ro(t,21,()=>B(r),e=>e.sha,(e,t)=>{let n=j(()=>XJ.current?.repository?.commitBaseURL?`${XJ.current.repository.commitBaseURL}/${B(t).sha}`:void 0),r=j(()=>B(o)?B(t).message:``);var i=Sst(),a=P(i);{let e=j(()=>!B(n));ll(a,{class:`ref`,variant:`ghost`,role:`link`,get disabled(){return B(e)},onclick:()=>{hB(B(n))},children:(e,n)=>{var i=xst(),a=F(i),o=e=>{var n=vst();z(()=>J(n,`src`,B(t).authorAvatarURL)),W(e,n)},s=e=>{W(e,yst())};K(a,e=>{B(t).authorAvatarURL?e(o):e(s,-1)});var c=L(a,2),l=P(c),u=e=>{var t=bst(),n=I(P(t),!0);O(t),z(()=>{J(t,`title`,B(r)),G(n,B(r))}),W(e,t)};K(l,e=>{B(r)&&e(u)});var d=L(l,2);let f;var p=P(d),m=I(P(p),!0);O(p);var h=I(L(p,2),!0);O(d),O(c),z(e=>{f=rs(d,1,`meta svelte-14rpg2i`,null,f,{secondary:!!B(r)}),G(m,B(t).authorName),G(h,e)},[()=>BN(B(t).date,Fc.current)]),W(e,i)},$$slots:{default:!0}})}O(i),W(e,i)}),O(t),W(e,t)},d=e=>{var t=u7(),n=I(t,!0);z(e=>G(n,e),[()=>X(`entry_sidebar.history.no_history`)]),W(e,t)};K(s,e=>{B(i)?e(c):B(a)?e(l,1):B(r).length>0?e(u,2):e(d,-1)}),W(e,n)},$$slots:{default:!0}})}A()}var Est=V(`<h4 class="svelte-1twofal"> </h4>`),Dst=V(`<span hidden=""> </span>`),Ost=V(`<section class="section svelte-1twofal"><!> <div role="none" class="content svelte-1twofal"><!></div></section>`),kst={hash:`svelte-1twofal`,code:`.section.svelte-1twofal {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}}h4.svelte-1twofal {margin:0 !important;padding:12px;}.content.svelte-1twofal {padding:4px 8px 8px;}`};function d7(e,t){let n=Co();q(e,kst);let r=Y(t,`showLabel`,3,!0),i=`${n}-label`;var a=Ost(),o=P(a),s=e=>{var n=Est(),r=I(n,!0);z(()=>{J(n,`id`,i),G(r,t.label)}),W(e,n)},c=e=>{var n=Dst(),r=I(n,!0);z(()=>{J(n,`id`,i),G(r,t.label)}),W(e,n)};K(o,e=>{r()?e(s):e(c,-1)});var l=L(o,2);Uo(P(l),()=>t.children,()=>i),O(l),O(a),z(()=>{J(a,`role`,r()?`group`:`none`),J(a,`aria-labelledby`,r()?i:void 0)}),W(e,a)}var Ast=({draft:e,ownFolderPaths:t})=>{let n=S2(e.collection),r=e=>(t?!n:[`_`,`_default`].includes(e))?{label:X(t?`folder`:`slug`),showLabel:!1}:{label:kA(e)??e,showLabel:!0};return t?Object.entries(t).map(([e,t])=>({locale:e,...r(e),value:q2(t)})):Object.entries(e.currentSlugs).filter(([,e])=>e!==void 0).map(([e,t])=>({locale:e,...r(e),value:t}))},jst=({draft:e,ownFolderPaths:t,takenFolderNames:n,takenSlugs:r,locale:i,text:a})=>{if(t){let e=oN({takenNames:n[i],name:a});return e?X(`new_parent_folder_error.${e}`):void 0}let{pattern:o}=f2(e.collection),s=O2({slug:a,pattern:o,takenSlugs:r[i],locale:i});return s?k2({error:s,pattern:o}):void 0},Mst=V(`<!> <p class="error svelte-1woercx"><!></p>`,1),Nst={hash:`svelte-1woercx`,code:`p.error.svelte-1woercx:empty {display:none;}p.error.svelte-1woercx {margin:0;padding:0 4px;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function Pst(e,t){k(t,!0),q(e,Nst);let n=Ez(),r=j(()=>n.current),i=j(()=>y3e(B(r))),a=j(()=>E2(B(r))),o=j(()=>B(i)?b3e({draft:B(r),ownFolderPaths:B(i)}):{}),s=j(()=>Ast({draft:B(r),ownFolderPaths:B(i)})),c=na({}),l=na({}),u=e=>{if(c[e])return jst({draft:B(r),ownFolderPaths:B(i),takenFolderNames:B(o),takenSlugs:B(a),locale:e,text:l[e]})},d=({locale:e,value:t},n)=>!u(e)&&(n!==t&&(B(i)?x3e({draft:B(r),ownFolderPaths:B(i),folderNames:{[e]:n}}):v3e({draft:B(r),slugs:{[e]:n}})),!0);var f=U();Ro(F(f),17,()=>B(s),e=>e.locale,(e,t)=>{let n=j(()=>B(t)),r=j(()=>u(B(n).locale));d7(e,{get label(){return B(n).label},get showLabel(){return B(n).showLabel},children:(e,a=jr)=>{var o=Mst(),s=F(o);{let e=j(()=>B(i)?X(`rename_folder`):X(`edit_slug`)),o=j(()=>!!B(r)),u=j(()=>!!B(r));r6(s,{get id(){return`${a()??``}-value`},get value(){return B(n).value},get editLabel(){return B(e)},get invalid(){return B(o)},get applyDisabled(){return B(u)},get ariaLabelledby(){return a()},get ariaErrormessage(){return`${a()??``}-error`},onApply:e=>d(B(t),e),get editing(){return c[B(n).locale]},set editing(e){c[B(n).locale]=e},get text(){return l[B(n).locale]},set text(e){l[B(n).locale]=e}})}var u=L(s,2),f=P(u),p=e=>{var t=H();z(()=>G(t,B(r))),W(e,t)};K(f,e=>{B(r)&&e(p)}),O(u),z(()=>J(u,`id`,`${a()??``}-error`)),W(e,o)},$$slots:{default:!0}})}),W(e,f),A()}var Fst=V(`<div class="empty svelte-ka7cth"> </div>`),Ist=V(`<p class="hint svelte-ka7cth"> </p>`),Lst=V(`<div role="none" class="editor svelte-ka7cth"><!></div>`),Rst=V(`<p class="note svelte-ka7cth"> </p>`),zst=V(`<!> <!>`,1),Bst={hash:`svelte-ka7cth`,code:`.editor.svelte-ka7cth {
|
||
/* The section has padding of its own */--field-editor-padding: 0;}.hint.svelte-ka7cth,
|
||
.empty.svelte-ka7cth {margin:0;padding:12px 16px;}.hint.svelte-ka7cth {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.note.svelte-ka7cth {margin:0;padding:0 16px 16px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}`};function Vst(e,t){k(t,!0),q(e,Bst);let n=Ez(),r=j(()=>n.current),i=j(()=>s8(B(r))),a=j(()=>h3e(B(r))),o=j(()=>B(i)&&B(r)?f2(B(r).collection).hint:void 0),s=j(()=>B(i)&&!!B(r)&&S2(B(r).collection)),c=j(()=>Object.entries(B(r)?.slugEditor??{}).filter(([e,t])=>t===!0&&!!B(r)?.currentLocales[e]).map(([e])=>e)),l=j(()=>Object.entries(B(r)?.isNew?_3e(B(r)):B(r)?.currentSlugs??{}).filter(([e,t])=>t!==void 0&&(e===`_`||!!B(r)?.currentLocales[e]))),u=e=>B(s)&&![`_`,`_default`].includes(e)?{label:kA(e)??e,showLabel:!0}:{label:X(`slug`),showLabel:!1};{let t=j(()=>X(`entry_sidebar.slug.title`));i7(e,{get title(){return B(t)},children:(e,t)=>{var n=U(),s=F(n),d=e=>{var t=Fst(),n=I(t,!0);z(e=>G(n,e),[()=>X(`entry_sidebar.slug.unavailable`)]),W(e,t)},f=e=>{var t=zst(),n=F(t),i=e=>{var t=Ist(),n=I(t,!0);z(()=>G(n,B(o))),W(e,t)};K(n,e=>{B(o)&&e(i)});var s=L(n,2),d=e=>{var t=U();Ro(F(t),16,()=>B(c),e=>e,(e,t)=>{{let n=(e,n=jr)=>{var r=Lst();T3e(P(r),{get locale(){return t},get ariaLabelledby(){return n()}}),O(r),W(e,r)},r=j(()=>u(t));d7(e,_s(()=>B(r),{children:n,$$slots:{default:!0}}))}}),W(e,t)},f=e=>{Pst(e,{})},p=e=>{var t=zst(),n=F(t);Ro(n,17,()=>B(l),([e,t])=>e,(e,t)=>{var n=j(()=>Pr(B(t),2));let r=()=>B(n)[0],i=()=>B(n)[1];{let t=(e,t=jr)=>{r6(e,{get id(){return`${t()??``}-value`},get value(){return i()},canEdit:!1,get ariaLabelledby(){return t()}})},n=j(()=>u(r()));d7(e,_s(()=>B(n),{children:t,$$slots:{default:!0}}))}});var i=L(n,2),a=e=>{var t=Rst(),n=I(t,!0);z(e=>G(n,e),[()=>X(`entry_sidebar.slug.generated_on_save`)]),W(e,t)};K(i,e=>{B(r)?.isNew&&e(a)}),W(e,t)};K(s,e=>{B(r)?.isNew&&B(c).length?e(d):B(a)?e(f,1):e(p,-1)}),W(e,t)};K(s,e=>{B(i)?e(f,-1):e(d)}),W(e,n)},$$slots:{default:!0}})}A()}var f7=WO(null),Hst=e=>{let{collectionName:t,fileName:n,isNew:r=!0}=e??{};return[{key:`slug`,icon:`anchor`,disabled:!s8(e)},{key:`validation`,icon:`check_circle`,disabled:!1},{key:`history`,icon:`history`,disabled:!XJ.current?.isGit||r},{key:`backlinks`,icon:`article_shortcut`,disabled:!t||!c7({collectionName:t,fileName:n}).length}]},p7=e=>{sW.isSmallScreen?f7.current=e:u8.current={...u8.current,sidebarPanel:e}},Ust=V(`<h4 class="svelte-mwf2jd"> </h4>`),m7=V(`<span class="summary svelte-mwf2jd"> </span> <!>`,1),Wst=V(`<!> <!> <!>`,1),Gst=V(`<div class="empty svelte-mwf2jd"> </div>`),Kst=V(`<section class="locale svelte-mwf2jd" role="group"><!> <!></section>`),qst=V(`<div class="empty"> </div>`),Jst={hash:`svelte-mwf2jd`,code:`.locale.svelte-mwf2jd {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}h4:where(.svelte-mwf2jd),
|
||
.empty:where(.svelte-mwf2jd) {margin:0 !important;padding:12px;}.summary:where(.svelte-mwf2jd) {display:block;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-heading-font-weight);}.sui.button.ref {flex-direction:column;align-items:flex-start;gap:4px;}}`};function Yst(e,t){k(t,!0),q(e,Jst);let n=Y(t,`onSelectField`,3,R6),r=Ez(),i=j(()=>r.current??{}),a=j(()=>B(i).validationMessages),o=j(()=>B(i).validities),s=j(()=>Object.values(B(o)??{}).some(e=>!!Object.keys(e).length)),c=M(!1),l=e=>{let t=r.current,{_slug:n,_path:i}=t.validities[e];return{slugValidity:n?.valid===!1?n:void 0,pathMessages:r2(e===t.defaultLocale?i:void 0),invalidFields:Lqe({draft:t,locale:e})}},u=async()=>{let e=r.current;e&&!B(c)&&(N(c,!0),await l8({draft:e,awaitFieldUpdates:!1}),N(c,!1))};{let t=e=>{{let t=j(()=>X(`entry_sidebar.validation.validate`)),n=j(()=>!r.current||B(c));ll(e,{variant:`tertiary`,size:`small`,get label(){return B(t)},get disabled(){return B(n)},onclick:()=>{u()}})}},i=j(()=>X(`entry_sidebar.validation.title`));i7(e,{get title(){return B(i)},actions:t,children:(e,t)=>{var r=U(),i=F(r),o=e=>{var t=U();Ro(F(t),16,()=>Object.keys(B(a)),e=>e,(e,t)=>{let r=j(()=>kA(t)),i=j(()=>l(t));var a=Kst(),o=P(a),s=e=>{var t=Ust(),n=I(t,!0);z(()=>G(n,B(r))),W(e,t)};K(o,e=>{B(r)&&e(s)});var c=L(o,2),u=e=>{var r=Wst(),a=F(r),o=e=>{ll(e,{class:`ref`,variant:`ghost`,onclick:()=>{p7(`slug`)},children:(e,t)=>{var n=m7(),r=F(n),a=I(r,!0);f6(L(r,2),{live:`off`,children:(e,t)=>{$r();var n=H();z(()=>G(n,B(i).slugValidity.customErrorMessage)),W(e,n)},$$slots:{default:!0}}),z(e=>G(a,e),[()=>X(`slug`)]),W(e,n)},$$slots:{default:!0}})};K(a,e=>{B(i).slugValidity&&e(o)});var s=L(a,2),c=e=>{ll(e,{class:`ref`,variant:`ghost`,onclick:()=>{n()({locale:t,keyPath:`_path`})},children:(e,t)=>{var n=m7(),r=F(n),a=I(r,!0);Ro(L(r,2),17,()=>B(i).pathMessages,Fo,(e,t)=>{f6(e,{live:`off`,children:(e,n)=>{$r();var r=H();z(()=>G(r,B(t))),W(e,r)},$$slots:{default:!0}})}),z(e=>G(a,e),[()=>X(`entry_parent_folder`)]),W(e,n)},$$slots:{default:!0}})};K(s,e=>{B(i).pathMessages.length&&e(c)}),Ro(L(s,2),17,()=>B(i).invalidFields,({keyPath:e,label:t,messages:n})=>e,(e,r)=>{let i=()=>B(r).keyPath,a=()=>B(r).label,o=()=>B(r).messages;ll(e,{class:`ref`,variant:`ghost`,onclick:()=>{n()({locale:t,keyPath:i()})},children:(e,t)=>{var n=m7(),r=F(n),i=I(r,!0);Ro(L(r,2),17,o,Fo,(e,t)=>{f6(e,{live:`off`,children:(e,n)=>{$r();var r=H();z(()=>G(r,B(t))),W(e,r)},$$slots:{default:!0}})}),z(()=>G(i,a())),W(e,n)},$$slots:{default:!0}})}),W(e,r)},d=e=>{var t=Gst(),n=I(t,!0);z(e=>G(n,e),[()=>X(`entry_sidebar.validation.no_errors_found`)]),W(e,t)};K(c,e=>{B(i).slugValidity||B(i).pathMessages.length||B(i).invalidFields.length?e(u):e(d,-1)}),O(a),W(e,a)}),W(e,t)},c=e=>{var t=qst(),n=I(t,!0);z(e=>G(n,e),[()=>X(`entry_sidebar.validation.placeholder`)]),W(e,t)};K(i,e=>{B(s)?e(o):e(c,-1)}),W(e,r)},$$slots:{actions:!0,default:!0}})}A()}function Xst(e,t){let n=Y(t,`onSelectField`,3,void 0);var r=U(),i=F(r),a=e=>{Vst(e,{})},o=e=>{Tst(e,{})},s=e=>{hst(e,{})},c=e=>{Yst(e,{get onSelectField(){return n()}})};K(i,e=>{t.key===`slug`?e(a):t.key===`history`?e(o,1):t.key===`backlinks`?e(s,2):e(c,-1)}),W(e,r)}var Zst={hash:`svelte-1n87oxn`,code:`.entry-sidebar-sheet {--sui-drawer-bottom-content-border-start-start-radius: 16px;--sui-drawer-bottom-content-border-start-end-radius: 16px;
|
||
/* The panel scrolls its own content below the header */--sui-drawer-main-padding: 0;}`};function Qst(e,t){k(t,!0),q(e,Zst);let n=M(null),r,i=j(()=>B(n)??f7.current),a=j(()=>!!f7.current&&!B(n)),o=()=>{N(n,f7.current,!0),f7.current=null};vs(()=>()=>{f7.current=null});var s=()=>B(a),c=o;{let t=e=>{},a=j(()=>B(i)?X(`entry_sidebar.${B(i)}.title`):``);Mae(e,{get open(){return s()},set open(e){c(e)},class:`entry-sidebar-sheet`,position:`bottom`,size:`medium`,swipeDismiss:!0,get title(){return B(a)},onClose:()=>{N(n,null),r&&!f7.current&&R6(r),r=void 0},header:t,children:(e,t)=>{var n=U(),a=F(n),s=e=>{Xst(e,{get key(){return B(i)},onSelectField:e=>{r=e,o()}})};K(a,e=>{B(i)&&e(s)}),W(e,n)},$$slots:{header:!0,default:!0}})}A()}var $st=V(`<div role="none" class="content svelte-19e8zut" id="entry-sidebar-content"><!></div>`),ect=V(`<div role="none" class="sidebar svelte-19e8zut"><!> <!></div>`),tct={hash:`svelte-19e8zut`,code:`.sidebar.svelte-19e8zut {flex:none;display:flex;flex-direction:row-reverse;.tabs {flex:none;display:flex;flex-direction:column;align-items:center;gap:8px;margin:0;padding:8px 0;width:48px;button {border-radius:4px !important;}}}.content.svelte-19e8zut {flex:none;width:320px;margin-inline-start:8px;border:var(--area-border);border-block-end:0;border-radius:16px 16px 0 0;background-color:var(--sui-primary-background-color);}`};function nct(e,t){k(t,!0),q(e,tct);let n=Ez(),r=j(()=>Hst(n.current)),i=j(()=>u8.current?.sidebarPanel??null),a=M(null),o,s=j(()=>B(a)??(B(i)?B(r).find(e=>e.key===B(i))?.key??`validation`:null));YO(()=>[n.current?.id,B(i)],()=>{let e=n.current;e?.id===o?N(a,null):(o=e?.id,N(a,g3e(e)?`slug`:null,!0))});var c=ect(),l=P(c);{let e=j(()=>X(`entry_sidebar.sidebar_panels`)),t=j(()=>B(s)?`entry-sidebar-content`:void 0);Dl(l,{class:`tabs`,get ariaLabel(){return B(e)},get"aria-controls"(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>B(r),({key:e,icon:t,disabled:n})=>e,(e,t)=>{let n=()=>B(t).key,r=()=>B(t).icon,i=()=>B(t).disabled;{let t=j(()=>X(`entry_sidebar.${n()}.title`)),o=j(()=>B(s)===n());Ol(e,{iconic:!0,get"aria-label"(){return B(t)},get selected(){return B(o)},get disabled(){return i()},onclick:()=>{let e=B(s)===n()?null:n();N(a,null),u8.current={...u8.current,sidebarPanel:e}},children:(e,t)=>{Lc(e,{get name(){return r()}})},$$slots:{default:!0}})}}),W(e,n)},$$slots:{default:!0}})}var u=L(l,2),d=e=>{var t=$st();Xst(P(t),{get key(){return B(s)}}),O(t),W(e,t)};K(u,e=>{B(s)&&e(d)}),O(c),W(e,c),A()}var rct=V(`<!> <!> <!> <!>`,1);function ict(e,t){k(t,!0);let n=Ez(),r=j(()=>BA(n.current)),i=j(()=>B(r).i18nEnabled),a=j(()=>B(r).allLocales),o=j(()=>n.current?.canPreview??!0),s=j(()=>n.current?.canShowSecondPane??!0),c=j(()=>B(s)&&(u8.current?.showSecondPane??!0)),l=j(()=>B(s)&&(B(i)&&B(a).length>1||B(o))),u=j(()=>B(o)&&!!u8.current?.showPreview),d=j(()=>Object.keys(n.current?.currentValues??{}).length===1);var f=rct(),p=F(f);ql(p,{});var m=L(p,2);{let e=j(()=>X(`show_second_pane`)),t=j(()=>!B(l));ou(m,{get label(){return B(e)},get checked(){return B(c)},get disabled(){return B(t)},onChange:()=>{d8(`showSecondPane`,!0)}})}var h=L(m,2);{let e=j(()=>X(`show_preview`)),t=j(()=>u8.current?.showPreview),n=j(()=>!B(o));ou(h,{get label(){return B(e)},get checked(){return B(t)},get disabled(){return B(n)},onChange:()=>{d8(`showPreview`)}})}var g=L(h,2);{let e=j(()=>X(`sync_scrolling`)),t=j(()=>u8.current?.syncScrolling),n=j(()=>!B(c)||!B(u)&&B(d));ou(g,{get label(){return B(e)},get checked(){return B(t)},get disabled(){return B(n)},onChange:()=>{d8(`syncScrolling`)}})}W(e,f),A()}var act=({relation:e,excludeIds:t})=>{let{sourceCollection:n,sourceCollectionFile:r}=e,i=r?.name;return BL(n.name).filter(e=>!t.has(e.id)&&(!i||e.slug===i))},oct=({relation:e,excludeIds:t,targets:n,getLocaleValues:r,getContentUpdater:i})=>{let{sourceCollection:a,sourceCollectionFile:o}=e,{allLocales:s}=o?._i18n??a._i18n,c=new Map(s.map(e=>[e,r(e)]));[...c.values()].some(({size:e})=>e>0)&&act({relation:e,excludeIds:t}).forEach(e=>{let t=n.get(e.id)?.entry??e,s={},l=i(e);Object.entries(t.locales).forEach(([e,t])=>{let{content:n}=t;if(!n)return;let i=mA(c,e,()=>r(e));if(!i.size)return;let a=l({locale:e,content:n,values:i});a&&(s[e]={...t,content:a})}),Object.keys(s).length&&n.set(e.id,{entry:{...t,locales:{...t.locales,...s}},collection:a,collectionFile:o})})},sct=({fieldConfig:e,entries:t,locale:n})=>new Set(t.flatMap(t=>s7({fieldConfig:e,entry:t,locale:n}))),cct=({content:e,relation:t,values:n})=>{let{keyPath:r,valuePattern:i,multiple:a}=t,o=o7({content:e,keyPath:r,valuePattern:i,multiple:a}).filter(t=>n.has(e[t]));if(!o.length)return;let s={...e};if(!a)return o.forEach(t=>{s[t]=typeof e[t]==`number`?null:``}),{content:s,fieldKeyPaths:o};let c=bO(o.map(e=>e.replace(mj,``))),l=(e,t)=>n.has(t);return c.forEach(e=>{w4({content:s,listKeyPath:e,isStale:l})}),{content:s,fieldKeyPaths:c}},lct=({draft:e,entry:t,relation:n,locale:r,content:i,fieldKeyPaths:a})=>T4({draft:e,entry:t,collection:n.sourceCollection,collectionFile:n.sourceCollectionFile,locale:r,content:i,fields:new Map(a.map(e=>[e,n.fieldConfig]))}),uct=({relation:e,entries:t,deletedIds:n,targets:r,blockers:i})=>{let{fieldConfig:a,sourceCollection:o,sourceCollectionFile:s}=e;oct({relation:e,excludeIds:n,targets:r,getLocaleValues:e=>sct({fieldConfig:a,entries:t,locale:e}),getContentUpdater:t=>{let n=b4({collection:o,collectionFile:s,isIndexFile:zk(o,t)});return({locale:r,content:a,values:o})=>{let s=cct({content:a,relation:e,values:o});if(s)return i.push(...lct({draft:n,entry:t,relation:e,locale:r,content:s.content,fieldKeyPaths:s.fieldKeyPaths})),s.content}}})},dct=e=>{let t=e.flatMap(t=>{let n=PY(t);return n&&!e.includes(n)?[n]:[]});return t.length?[...e,...new Set(t)]:e},fct={targets:[],blockers:[]},h7=({collection:e,collectionFile:t,entries:n})=>{let r=new Map,i=[];if(n.length){let a=dct(n),o=new Set(a.map(({id:e})=>e));c7({collectionName:e.name,fileName:t?.name}).forEach(e=>{uct({relation:e,entries:a,deletedIds:o,targets:r,blockers:i})})}return{targets:[...r.values()],blockers:E4(i)}},g7=(e,t)=>{let{targets:n,blockers:r}=h7(e);if(r.length)throw Error(t,{cause:r});return n},pct=async({targets:e,cacheDB:t})=>D4({targets:e,cacheDB:t}),mct=V(`<!> <!>`,1);function hct(e,t){k(t,!0);let n=Ez(),r=Y(t,`open`,15,!1),i=j(()=>n.current?.collection),a=j(()=>n.current?.collectionFile),o=j(()=>n.current?.originalEntry),s=j(()=>r()&&B(i)&&B(o)&&!t.discardsDraft?h7({collection:B(i),collectionFile:B(a),entries:[B(o)]}):fct);{let n=j(()=>X(`delete_entries`,{values:{count:1}})),i=j(()=>X(`delete`)),a=j(()=>!!B(s).blockers.length);Il(e,{get title(){return B(n)},get okLabel(){return B(i)},get okDisabled(){return B(a)},get onOk(){return t.onOk},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,n)=>{var r=U(),i=F(r),a=e=>{v5(e,{get plan(){return B(s)},count:1})},o=e=>{var n=mct(),r=F(n),i=e=>{var t=H();z(e=>G(t,e),[()=>X(`workflow.confirm_deleting_unpublished_entry`)]),W(e,t)},a=e=>{var t=H();z(e=>G(t,e),[()=>X(`workflow.confirm_deleting_published_entry`)]),W(e,t)},o=e=>{var n=H();z(e=>G(n,e),[()=>X(t.withAssets?`confirm_deleting_this_entry_with_assets`:`confirm_deleting_this_entry`)]),W(e,n)};K(r,e=>{t.discardsDraft?e(i):t.useWorkflow?e(a,1):e(o,-1)}),v5(L(r,2),{get plan(){return B(s)},count:1}),W(e,n)};K(i,e=>{B(s).blockers.length?e(a):e(o,-1)}),W(e,r)},$$slots:{default:!0}})}A()}var gct=async({collection:e,changes:t,savingEntries:n})=>t.length?(await G4({changes:t,savingEntries:n,options:{commitType:`update`,collection:e}}),u1.current={...l1,saved:!0,count:n.length},n.length):0,_ct=(e,t,n)=>{let r=Object.fromEntries(Object.entries(e.locales).map(([e,r])=>[e,r.content?{...r,content:{...r.content,[t]:n}}:{...r}]));return{...e,locales:r}},vct=async(e,t,{cacheDB:n}={})=>{let r=HL(e);if(!r)return{changes:[],savingEntries:[]};let{_i18n:{defaultLocale:i}}=e,a=T0(n),o=[];for(let[e,n]of t.entries()){let t=e+1;Number(n.locales[i]?.content?.[r])!==t&&o.push(_ct(n,r,t))}let s=b4({collection:e});return{changes:(await Promise.all(o.map(t=>x4({collection:e,entry:t,draft:s,cacheDB:a})))).flat(),savingEntries:o}},yct=(e,t)=>{let n=t.map(({arrayIndex:e})=>e).sort((e,t)=>e-t),r=t.filter(({arrayIndex:e},t)=>e!==n[t]);return r.length?{changes:[{action:`update`,path:e._file.fullPath,arrayOrder:t.map(({arrayIndex:e,locales:t})=>({index:e,locales:t}))}],savingEntries:r}:{changes:[],savingEntries:[]}},bct=async(e,t)=>{if(LY({collection:e}))return 0;let{changes:n,savingEntries:r}=ck(e)?yct(e,t):await vct(e,t);return gct({collection:e,changes:n,savingEntries:r})},xct=(e,{excludeIds:t,updatedEntries:n}={})=>WL(BL(e.name).filter(n=>!zk(e,n)&&!(t&&t.has(n.id))).map(e=>n?.get(e.id)??e),e),Sct=async(e,{excludeIds:t,updatedEntries:n,cacheDB:r}={})=>!e||e._type!==`entry`||!HL(e)?{changes:[],savingEntries:[]}:vct(e,xct(e,{excludeIds:t,updatedEntries:n}),{cacheDB:r}),Cct=({ids:e,assetPaths:t})=>{let n=tj.current,r=new Set(e);if(tj.current=n.filter(e=>!r.has(e.id)),u1.current={...l1,deleted:!0,count:e.length},t.length){let e=new Set(t);qB.current=qB.current.filter(t=>!e.has(t.path))}},wct=async(e,t=[])=>{let n=WA.current,r=n?g7({collection:n,entries:e},`Cannot delete entries that other entries require`):[],i=T0(),a=[],o=`delete`,s=await Promise.all(e.map(async e=>{let{id:t,slug:n}=e,r=CP(e);return await Promise.all(r.map(async t=>{let r=await E0({cacheDB:i,previousPath:t});a.push({action:o,slug:n,path:t,previousSha:r,...v4(e)})})),t})),c=t.map(({path:e,sha:t})=>(a.push({action:o,path:e,previousSha:t}),e)),{changes:l,savingEntries:u}=await Sct(n,{excludeIds:new Set(s),updatedEntries:new Map(r.map(({entry:e})=>[e.id,e])),cacheDB:i}),d=new Set(u.map(({id:e})=>e)),{changes:f,savingEntries:p}=await pct({targets:r.filter(({entry:e})=>!d.has(e.id)),cacheDB:i});a.push(...l,...f),await G4({changes:a,savingEntries:[...u,...p],options:{commitType:`delete`,collection:WA.current}}),Cct({ids:s,assetPaths:c})},Tct=(e,{oldDir:t,newDir:n})=>{let r=e.slice(t.length+1);return n?`${n}/${r}`:r},Ect=({entry:e,dirMove:t,localeDirMoves:n})=>{let{subPath:r}=e,i=Tct(r,t),a=!1,o=Object.fromEntries(Object.entries(e.locales).map(([e,t])=>{let{slug:r,path:i}=t,o=n[e];if(!r||!fA(o.oldDir,r))return[e,t];let s=Tct(r,o);if(s===r)return[e,t];let c=i.lastIndexOf(r);return c===-1?[e,t]:(a=!0,[e,{...t,slug:s,path:`${i.slice(0,c)}${s}${i.slice(c+r.length)}`}])}));if(a)return{...e,slug:i,subPath:i,locales:o}},Dct=({collection:e,entry:t})=>{if(!S2(e))return t;let{_i18n:{defaultLocale:n,canonicalSlug:{key:r,value:i}}}=e,{subPath:a,locales:o}=t,s=i===`{{slug}}`?a:IY(i,{collection:e,locale:n,content:o[n]?.content??{},currentSlug:a});return o0(t,({localizedEntry:{content:e}})=>({...e,[r]:s}))},Oct=async({collection:e,originalEntry:t,movedEntry:n,draft:r,cacheDB:i})=>{let{defaultLocale:a}=e._i18n;return D0({draft:r,config:e,_file:IA({collection:e,isIndexFile:r.isIndexFile}),entry:n,cacheDB:i,planChange:e=>{if(e===void 0){let e=t.locales[a].path,{slug:r,path:i}=n.locales[a];return{action:`move`,slug:r,path:i,previousPath:e,currentPath:e}}let r=n.locales[e];if(!r?.content)return;let i=t.locales[e],{path:o}=i,s=o!==r.path;if(s||!(0,Cr.default)(r.content,i.content))return{action:s?`move`:`update`,slug:r.slug,path:r.path,previousPath:s?o:void 0,currentPath:o}}})},kct=async({collection:e,originalEntry:t,savingEntry:n,cacheDB:r})=>{let i={changes:[],savingEntries:[]},a=cA(e);if(!t||!a||t.subPath.slice(t.subPath.lastIndexOf(`/`)+1)!==a)return i;let o=dA(t.subPath),s=dA(n.subPath);if(!o||fA(o,s))return i;let c=BL(e.name).filter(e=>e.id!==t.id&&fA(o,e.subPath));if(!c.length)return i;let{_i18n:{allLocales:l}}=e,u={oldDir:o,newDir:s},d=Object.fromEntries(l.map(e=>[e,{oldDir:dA(t.locales[e]?.slug??``)||o,newDir:dA(n.locales[e]?.slug??``)||s}])),f=c.flatMap(t=>{let n=Ect({entry:t,dirMove:u,localeDirMoves:d});return n?[{originalEntry:t,movedEntry:p0({collection:e,entry:Dct({collection:e,entry:n})})}]:[]});if(!f.length)return i;let p=T0(r),m=b4({collection:e});return{changes:(await Promise.all(f.map(({originalEntry:t,movedEntry:n})=>Oct({collection:e,originalEntry:t,movedEntry:n,draft:m,cacheDB:p})))).flat(),savingEntries:f.map(({movedEntry:e})=>e)}},Act=({collection:e,originalEntry:t,savingEntry:n})=>{let r=new Map;return Object.entries(n.locales).forEach(([n,{path:i}])=>{let a=t.locales[n]?.path;if(!a)return;let o=t4(e,a),s=t4(e,i);o&&s&&o!==s&&r.set(o,s)}),r},jct=async({collection:e,fileName:t,originalEntry:n,savingEntry:r,changes:i})=>{let a={changes:[],savingAssets:[]};if(!n||!HB({collectionName:e.name,fileName:t})?.entryRelative)return a;let o=Act({collection:e,originalEntry:n,savingEntry:r});if(!o.size)return a;let s=new Set(i.map(({path:e})=>e)),c=qB.current.map(e=>a4(e,n)).filter(Boolean),l=[],u=[];return await Promise.all([...o].map(async([e,t])=>Promise.all(c.filter(({path:t})=>t.startsWith(`${e}/`)).map(async n=>{let r=`${t}${n.path.slice(e.length)}`;if(s.has(r)){l.push({action:`delete`,path:n.path,previousSha:n.sha});return}let i=n.file??await CX(n);l.push({action:`move`,path:r,previousPath:n.path,previousSha:n.sha,data:new File([await i.arrayBuffer()],n.name,{type:i.type})}),u.push({...n,path:r})})))),{changes:l,savingAssets:u}},Mct=({originalEntry:e,savingEntry:t,canonicalSlugKey:n})=>({...e,slug:t.slug,locales:Object.fromEntries(Object.entries(e.locales).map(([e,r])=>{let{slug:i,content:a}=t.locales[e]??{},o=n?a?.[n]:void 0;return[e,{...r,slug:i??r.slug,content:n&&o!==void 0&&r.content?{...r.content,[n]:o}:r.content}]}))}),Nct=({fieldConfig:e,originalEntry:t,renamedEntry:n,locale:r})=>{let i={fieldConfig:e,locale:r},a=s7({...i,entry:t}),o=s7({...i,entry:n}),s=new Map;return a.length===o.length&&a.forEach((e,t)=>{e!==o[t]&&s.set(e,o[t])}),s},Pct=({content:e,relation:t,replacements:n})=>{let{keyPath:r,valuePattern:i,multiple:a}=t,o=o7({content:e,keyPath:r,valuePattern:i,multiple:a}).filter(t=>n.has(e[t]));if(!o.length)return;let s={...e};return o.forEach(t=>{s[t]=n.get(e[t])}),s},Fct=({collection:e,collectionFile:t,originalEntry:n,savingEntry:r})=>{if(!n||n.slug===r.slug)return[];let i=c7({collectionName:e.name,fileName:t?.name});if(!i.length)return[];let{_i18n:{canonicalSlug:{key:a}}}=t??e,o=Mct({originalEntry:n,savingEntry:r,canonicalSlugKey:a}),s=new Map;return i.forEach(e=>{let{fieldConfig:t}=e;oct({relation:e,excludeIds:new Set([n.id]),targets:s,getLocaleValues:e=>Nct({fieldConfig:t,originalEntry:n,renamedEntry:o,locale:e}),getContentUpdater:()=>({content:t,values:n})=>Pct({content:t,relation:e,replacements:n})})}),[...s.values()]},Ict=async({collection:e,collectionFile:t,originalEntry:n,savingEntry:r,cacheDB:i})=>{let a={changes:[],savingEntries:[]},o=Fct({collection:e,collectionFile:t,originalEntry:n,savingEntry:r});if(!o.length)return a;let s=o.filter(e=>LY({collection:e.collection,collectionFile:e.collectionFile})||S4(e.entry));if(s.length){let e=s.map(e=>C4(e.entry,e.collection)).join(`, `);throw Error(X(`cannot_rename_referenced_entry`,{values:{entries:e}}))}return D4({targets:o,cacheDB:i})},Lct=[`100644`,`100755`],Rct=e=>e.flatMap(({path:e,status:t,previousPath:n,mode:r})=>t===`renamed`?[...n?[{path:n,change:`removed`}]:[],{path:e,change:`added`,mode:r}]:[{path:e,change:t,mode:r}]),zct=e=>{let{entryFiles:t,assetFiles:n}=ZU([UG(e)]);if(t.length)return{type:`entry`,collectionName:t[0].folder.collectionName};if(n.length)return{type:`asset`}},Bct=e=>{let t=nj(CP(e));if(t)return t;let n=e=>e.subPath.split(`/`).length;return(e.workflow.previousPaths??[]).map(e=>nj([e])).filter(e=>!!e).reduce((e,t)=>!e||n(t)<n(e)?t:e,void 0)},Vct=({entry:e,collection:t,updatedEntry:n,deletion:r})=>{let{fileName:i}=e.workflow,a=i?ij(t,i):void 0;return r?h7({collection:t,collectionFile:a,entries:DY(e)}).targets:Fct({collection:t,collectionFile:a,originalEntry:n,savingEntry:e})},Hct=async({entry:e,collection:t,updatedEntry:n,deletion:r,moved:i})=>{let a=new Map;if(!t)return a;let[{changes:o},{changes:s}]=await Promise.all([D4({targets:Vct({entry:e,collection:t,updatedEntry:n,deletion:r})}),i?kct({collection:t,originalEntry:n,savingEntry:e}):{changes:[]}]);return[...o,...s].forEach(({path:e,previousPath:t,data:n})=>{t&&a.set(t,null),a.set(e,n)}),a},Uct=({entry:e,collection:t,updatedEntry:n})=>{let{fileName:r}=e.workflow,i=new Set,a=new Map;if(!t||!HB({collectionName:t.name,fileName:r})?.entryRelative)return{removedPaths:i,addedSHAs:a};let o=Act({collection:t,originalEntry:n,savingEntry:e}),s=qB.current.map(e=>a4(e,n)).filter(Boolean);return o.forEach((e,t)=>{s.filter(({path:e})=>e.startsWith(`${t}/`)).forEach(({path:n,sha:r})=>{i.add(n),a.set(`${e}${n.slice(t.length)}`,r)})}),{removedPaths:i,addedSHAs:a}},Wct=(e,t)=>{if(!t.length)return new Set;let n=nQ(t.map(e=>({asset:{path:e}})),{entries:[e,...(e.workflow.companions??[]).map(({entry:e})=>e)]});return new Set(t.filter((e,t)=>n[t].length))},Gct=async(e,t)=>{let{collectionName:n,fileName:r,pullRequest:i}=e.workflow,a=YA(n),o=Bct(e),s=e.workflow.status===`pending_deletion`,c=CP(e),l=o?CP(o):[],u=new Set([...c,...l]),d=new Map(i.files.map(e=>[e.path,e])),{companions:f=[]}=e.workflow,p=new Set(f.flatMap(({entry:e,edited:t})=>t?[]:CP(e))),{paths:m,publishedPaths:h}=_Y(f),g=new Set([...m,...h]),_=!s&&!!o&&o.subPath!==e.subPath,v=await Hct({entry:e,collection:a,updatedEntry:o,deletion:s,moved:_}),{removedPaths:y,addedSHAs:b}=_?Uct({entry:e,collection:a,updatedEntry:o}):{removedPaths:new Set,addedSHAs:new Map},x=new Set(s&&o?p4({entry:o,collectionName:n,fileName:r}).map(({path:e})=>e):[]),S=Rct(t).map(e=>({...e,kind:zct(e.path)})),C=s?new Set:Wct(e,S.filter(({change:e,kind:t})=>e!==`removed`&&t?.type===`asset`).map(({path:e})=>e)),w=({path:e,change:t,mode:n,kind:r})=>{if(t!==`removed`&&!Lct.includes(n))return!1;if(u.has(e))return!0;if(p.has(e))return t===`added`;if(g.has(e))return t!==`added`||!h.has(e);if(!r)return!1;if(r.type===`asset`){if(DB(e))return!1;if(t===`removed`)return x.has(e)||y.has(e);let n=b.get(e);return C.has(e)||n!==void 0&&d.get(e)?.sha===n}if(!v.has(e))return!1;let i=v.get(e);return t===`removed`?i===null:typeof i==`string`&&d.get(e)?.text===i};return[...new Set(S.filter(e=>!w(e)).map(({path:e})=>e))]},_7=e=>Error(`publish_refused`,{cause:e}),Kct=async(e,t,n)=>{let{headSHA:r}=e.workflow.pullRequest;if(!t.onConfiguredBranches||!t.complete)throw _7({reason:`other_changes`,paths:[]});if(!r||t.headSHA!==r)throw _7({reason:`entry_changed`,paths:[]});let i=await Gct(e,t.files);if(!i.length)return;let a=new Set(await n({headSHA:r,paths:i})),o=i.filter(e=>!a.has(e));if(o.length)throw _7({reason:`other_changes`,paths:o})},qct=(e,t)=>{if(e.workflow.pullRequest.headSHA!==t)throw _7({reason:`entry_changed`,paths:[]})},v7=(e,t)=>e?.message===`publish_refused`?X(e.cause.reason===`entry_changed`?`workflow.publish_refused_entry_changed`:`workflow.publish_refused_other_changes`):pU(e,t),y7=()=>{let e=XJ.current?.workflow;if(!e)throw Error(`Editorial Workflow is not supported by the current backend`);return e},Jct=e=>{let{collectionName:t,fileName:n}=e.workflow,r=YA(t);if(r)return{entry:e,collection:r,collectionFile:n?ij(r,n):void 0}},Yct=e=>(e.workflow.companions??[]).flatMap(({collectionName:e,entry:t})=>{let n=YA(e);return n?[{entry:t,collection:n}]:[]}),Xct=({collectionName:e,slug:t,entry:n})=>{let r=n?.workflow?.pullRequest.branch,i=(r?CY(r):void 0)??xY({collectionName:e,slug:t,entry:n});return{existingEntry:i,branch:i?.workflow.pullRequest.branch??jLe({collectionName:e,slug:t})}},Zct=(e,t)=>e?.workflow.previousPaths?.length?e.workflow.previousPaths:t,Qct=(e,t,n)=>{let r=new Map(e.map(e=>[e.path,e])),i=e=>{r.set(e,{path:e,sha:``,size:0,deleted:!0})};return t.forEach(({action:e,path:t,previousPath:a,data:o})=>{if(a&&i(a),e===`delete`){i(t);return}let s=typeof o==`string`?o:void 0;r.set(t,{path:t,sha:n.files[t]?.sha??``,size:typeof o==`string`?new Blob([o]).size:o?.size??0,text:s,deleted:!1})}),[...r.values()]},b7=e=>{let{branch:t}=e.workflow.pullRequest,n=lY.current,r=n.findIndex(e=>e.workflow.pullRequest.branch===t);lY.current=r===-1?[...n,e]:n.with(r,e)},$ct=e=>{lY.current=lY.current.filter(t=>t.workflow.pullRequest.branch!==e)},elt=(e,{pullRequest:t,collectionName:n,fileName:r,previousPaths:i,companions:a})=>{let o={...e,workflow:{pullRequest:t,status:t.status,collectionName:n,fileName:r,previousPaths:i,...a.length?{companions:a}:{}}};return b7(o),o},tlt=(e,t)=>{$ct(e.branch),t(e.branch),qIe([e.headSHA])},nlt=e=>{e.size&&(qB.current=qB.current.flatMap(t=>e.has(t.path)?t.workflow?[{...t,workflow:{branch:t.workflow.branch}}]:[]:[t]))},rlt=(e,{deletion:t=!1,cascadedEntries:n=new Map,removedPaths:r=new Set}={})=>{let{workflow:i,...a}=e,o=t?[]:(i.companions??[]).map(({entry:e})=>e),s=new Set([a,...o].flatMap(e=>CP(e,{includePrevious:!0}))),c=tj.current.filter(e=>!Object.values(e.locales).some(({path:e})=>s.has(e))).map(e=>n.get(e.id)??e);tj.current=t?c:[...c,a,...o],tlt(i.pullRequest,MJe),nlt(r)},ilt=(e,t)=>{let n=new Set(t.flatMap(({entry:e})=>CP(e)));return[...e.filter(({entry:e})=>!CP(e).some(e=>n.has(e))),...t]},alt=async({changes:e,savingEntry:t,savingAssets:n=[],options:r,collectionName:i,fileName:a,slug:o,originalEntry:s,companions:c=[]})=>{let l=y7(),u=await L4(e,r),{existingEntry:d,branch:f}=Xct({collectionName:i,slug:o,entry:s}),{commit:p,pullRequest:m}=await l.savePullRequest({changes:e,options:u,branch:f,title:wU(CH(e),u),status:`draft`,pullRequest:d?.workflow.pullRequest}),h=W4(),{date:g}=p,_=Zct(d,s?CP(s):[]),v=n.map(e=>({...e,sha:p.files[e.path]?.sha??e.sha,commitAuthor:h,commitDate:g,workflow:{branch:f}})),y=elt({...t,id:d?.id??t.id,commitAuthor:h,commitDate:g},{pullRequest:{...m,headSHA:p.sha,files:Qct(m.files,e,p)},collectionName:i,fileName:a,previousPaths:_,companions:ilt(d?.workflow.companions??[],c)});return o4(v),{commit:{...p,author:h},savedEntries:[y],savedAssets:v}},olt=async(e,t)=>{let{number:n,author:r}=e;if(NB.current||n===void 0||r?.login&&r.login===vU.account?.login)return;let i=y7();try{await(t?i.approve(e):i.withdrawApproval(e))}catch(e){console.warn(`Failed to ${t?`approve`:`withdraw the approval of`} the pull request.`,e)}},x7=async(e,t)=>{let n=y7(),{pullRequest:r}=e.workflow;b7({...e,workflow:{...e.workflow,status:t,pullRequest:{...r,status:t}}});let i;try{i=await n.updateStatus(r,t)}catch(t){throw FB(t)?rlt(e):b7(e),t}let a={...e,workflow:{...e.workflow,pullRequest:i,status:t}};b7(a);let{status:o}=e.workflow,s=[`draft`,`pending_review`];return t===`pending_publish`&&s.includes(o)?await olt(i,!0):o===`pending_publish`&&s.includes(t)&&await olt(i,!1),a},slt=new Map,clt=async e=>{let t=y7(),{status:n}=e.workflow,{pullRequest:r}=e.workflow,i=n===`pending_deletion`,a=Jct(e),o=i?[]:Yct(e),[s,c]=i?[`preUnpublish`,`postUnpublish`]:[`prePublish`,`postPublish`],l=await t.fetchMergeState(r);await Kct(e,l,t.fetchUnchangedPaths),a&&await h4({...a,type:s}),await Promise.all(o.map(e=>h4({...e,type:s}))),n===`draft`&&({pullRequest:r}=(await x7(e,`pending_publish`)).workflow),await t.publish(r),rlt(e,{deletion:i,cascadedEntries:new Map(i&&a?h7({collection:a.collection,collectionFile:a.collectionFile,entries:DY(e)}).targets.map(({entry:e})=>[e.id,e]):[]),removedPaths:new Set(l.files.flatMap(({status:e,path:t,previousPath:n})=>e===`removed`?[t]:e===`renamed`&&n?[n]:[]))}),await w9e(),j9e(e),a&&await h4({...a,type:c}),await Promise.all(o.map(e=>h4({...e,type:c})))},llt=async e=>{let{branch:t}=e.workflow.pullRequest;return yA(slt,t,()=>{let n=clt(e).finally(()=>{fY.current=fY.current.filter(e=>e!==t)});return fY.current=[...fY.current,t],n})},ult=async(e,t)=>(qct(e,t?.workflow?.pullRequest.headSHA),llt(e)),S7=async e=>{let t=y7(),{pullRequest:n}=e.workflow;await t.discard(n),tlt(n,s4)},dlt=e=>[{action:`delete`,slug:e.slug,path:CP(e)[0]}],flt=async(e,t)=>{let{companions:n=[],pullRequest:r}=e.workflow,i=new Set(r.files.map(({path:e})=>e)),{paths:a,publishedPaths:o}=_Y(n),s=T0();return Promise.all(bO([...a,...o]).filter(e=>i.has(e)).map(async e=>{if(!o.has(e))return{action:`delete`,slug:t,path:e};let n=(await s?.get(e))?.text;if(n===void 0)throw Error(`The published version of ${e} could not be found.`);return{action:a.includes(e)?`update`:`create`,slug:t,path:e,data:n}}))},plt=async(e,t,n,r=[],{targets:i=void 0,userMessage:a=void 0}={})=>{if(NB.current)throw fU(`Cannot delete a published entry as an Open Authoring contributor`,`open_authoring.direct_commit_unsupported`);i??=g7({collection:t,collectionFile:n,entries:[e]},`Cannot delete an entry that other entries require`);let o=y7(),s=t.name,{slug:c}=e,{existingEntry:l,branch:u}=Xct({collectionName:s,slug:c,entry:e}),d=CP(e),f=dlt(e),p=await L4(f,{commitType:`delete`,collection:t,userMessage:a}),m=bO(r.map(({path:e})=>e)),h=(l?.workflow.companions??[]).flatMap(({entry:e,edited:t})=>t?[]:CP(e)),g=l?await flt(l,c):[],{changes:_}=await pct({targets:i}),v=[...[...d,...m,...h].map(e=>({action:`delete`,slug:c,path:e})),...g.filter(({path:e})=>!_.some(t=>t.path===e)),..._],{commit:y,pullRequest:b}=await o.savePullRequest({changes:v,options:p,branch:u,title:wU(CH(f),p),status:`pending_deletion`,pullRequest:l?.workflow.pullRequest}),x=Qct(b.files,v,y),S=t=>elt(e,{pullRequest:{...t,headSHA:y.sha,files:x},collectionName:s,fileName:n?.name,previousPaths:Zct(l,d),companions:[]});return b.status===`pending_deletion`?S(b):(S(b),S(await o.updateStatus(b,`pending_deletion`)))},mlt=async e=>{await lU(e,S7)},hlt=async e=>{let t=({collection:e,collectionFile:t})=>`${e.name}\0${t?.name??``}`,n=Map.groupBy(e,t),r=new Map;n.forEach((e,t)=>{let[{collection:n,collectionFile:i}]=e;r.set(t,g7({collection:n,collectionFile:i,entries:e.map(({entry:e})=>e)},`Cannot delete entries that other entries require`))});let[{entry:i,collection:a}]=e,{userMessage:o}=await L4(dlt(i),{commitType:`delete`,collection:a});await lU(e,async e=>{let{entry:n,collection:i,collectionFile:a,assets:s}=e;await plt(n,i,a,s,{targets:r.get(t(e)),userMessage:o})})},C7=async({entries:e,collection:t,collectionFile:n})=>{t8(),t&&await Promise.all(e.map(async({subPath:e})=>{try{await Q6(t.name,n?.name??e)}catch(e){console.error(e)}}))},glt=async({drafts:e=[],items:t=[],collection:n=void 0,collectionFile:r=void 0,useWorkflow:i})=>{let a=async()=>{e.length&&(await mlt(e),await C7({entries:e,collection:n,collectionFile:r}))};if(t.length){let e=t.map(({entry:e})=>e);if(i&&n)return await hlt(t.map(({entry:e,assets:t})=>({entry:e,collection:n,collectionFile:r,assets:t}))),await C7({entries:e,collection:n,collectionFile:r}),await a(),{deleted:!0,deletionPending:!0,count:t.length};await wct(e,t.flatMap(({assets:e})=>e)),await C7({entries:e,collection:n,collectionFile:r}),await a()}else return await a(),e.length?{deleted:!0,count:e.length}:void 0},w7=({pendingDeletion:e,publishedVersionExists:t})=>e?{label:X(`workflow.cancel_deletion`),title:X(`workflow.cancel_deletion`),message:X(`workflow.confirm_cancelling_deletion`)}:t?{label:X(`discard`),title:X(`workflow.discard_changes`),message:X(`workflow.confirm_discarding_entry_changes`)}:{label:X(`delete`),title:X(`delete_entries`,{values:{count:1}}),message:X(`workflow.confirm_deleting_unpublished_entry`)},_lt=({deletion:e})=>e?{label:X(`delete`),title:X(`delete_entries`,{values:{count:1}}),message:X(`workflow.confirm_completing_deletion`)}:{label:X(`publish`),title:X(`workflow.publish_entry`),message:X(`workflow.confirm_publishing_entry_after_build`)},vlt=V(`<!> <!> <!> <!>`,1);function ylt(e,t){k(t,!0);let n=Ez(),r=Y(t,`deleting`,15,!1),i=M(!1),a=M(!1),o=M(!1),s=M(``),c=M(``),l=j(()=>w7({pendingDeletion:t.pendingDeletion,publishedVersionExists:!0})),u=()=>{N(i,!0)},d=()=>{N(a,!0)},f=async(e,i)=>{let a=n.current;N(c,i,!0),r(!0);let{ok:l,cancelled:u,result:d,error:f}=await F4(e);r(!1),l?(d&&(u1.current={...l1,count:1,...d}),n.current===a&&t.onDone()):u||(N(s,pU(f,`deleting_entry_failed`),!0),N(o,!0))},p=async()=>{await f(()=>glt({drafts:t.discardsDraft?[t.unpublishedEntry]:[],items:t.discardsDraft?[]:[{entry:t.originalEntry,assets:t.associatedAssets}],collection:t.collection,collectionFile:t.collectionFile,useWorkflow:t.useWorkflow}),`workflow.deleting_entry`)},m=async()=>{await f(async()=>(t.unpublishedEntry&&await S7(t.unpublishedEntry),t.pendingDeletion?{deletionCancelled:!0}:{discarded:!0}),t.pendingDeletion?`workflow.cancelling_deletion`:`workflow.discarding_changes`)};var h={confirmDelete:u,confirmDiscard:d},g=vlt(),_=F(g);{let e=j(()=>!!t.associatedAssets.length);hct(_,{get discardsDraft(){return t.discardsDraft},get useWorkflow(){return t.useWorkflow},get withAssets(){return B(e)},onOk:async()=>{await p()},get onClose(){return t.onClose},get open(){return B(i)},set open(e){N(i,e,!0)}})}var v=L(_,2);Il(v,{get title(){return B(l).title},get okLabel(){return B(l).label},onOk:async()=>{await m()},get onClose(){return t.onClose},get open(){return B(a)},set open(e){N(a,e,!0)},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(l).message)),W(e,n)},$$slots:{default:!0}});var y=L(v,2),b=e=>{Pu(e,{get id(){return B(c)},get show(){return r()},duration:0,children:(e,t)=>{Vc(e,{status:`info`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(B(c))]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};return K(y,e=>{B(c)&&e(b)}),Pu(L(y,2),{get show(){return B(o)},set show(e){N(o,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(()=>G(n,B(s))),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,g),A(h)}function blt(e,t){k(t,!0);let n=e=>{var n=U(),r=F(n),i=e=>{let n=j(()=>Z3e(t.conflict,Fc.current));var r=H();z(()=>G(r,`${B(n).description??``}
|
||
${B(n).warning??``}`)),W(e,r)};K(r,e=>{t.conflict&&e(i)}),W(e,n)},r=Y(t,`open`,15,!1);var i=U(),a=F(i),o=e=>{{let i=j(()=>X(`save_conflict.title`));Fl(e,{get title(){return B(i)},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}},s=e=>{{let i=j(()=>X(`save_conflict.title`)),a=j(()=>X(`save_conflict.save_anyway`));Il(e,{get title(){return B(i)},get okLabel(){return B(a)},get onOk(){return t.onOverwrite},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}};K(a,e=>{t.conflict?.canOverwrite===!1?e(o):e(s,-1)}),W(e,i),A()}var xlt=V(`<span role="none"> </span>`),Slt={hash:`svelte-1sst490`,code:`
|
||
/*
|
||
* Filled pill following the same background/foreground/border recipe as the Alert and Infobar
|
||
* components, so the colors adapt to both the light and dark themes. The border does most of the
|
||
* work in dark mode, where the alert background is nearly the same as the row background.
|
||
*/.status-pill.svelte-1sst490 {display:inline-block;border-width:1px;border-style:solid;border-radius:12px;padding:1px 6px;font-size:var(--sui-font-size-x-small);line-height:var(--sui-line-height-compact);white-space:nowrap;&.info {border-color:var(--sui-info-border-color);background-color:var(--sui-info-background-color);color:var(--sui-info-foreground-color);}&.warning {border-color:var(--sui-warning-border-color);background-color:var(--sui-warning-background-color);color:var(--sui-warning-foreground-color);}&.success {border-color:var(--sui-success-border-color);background-color:var(--sui-success-background-color);color:var(--sui-success-foreground-color);}&.error {border-color:var(--sui-error-border-color);background-color:var(--sui-error-background-color);color:var(--sui-error-foreground-color);}}`};function Clt(e,t){q(e,Slt);let n=Y(t,`class`,3,``);var r=xlt(),i=I(r,!0);z(()=>{rs(r,1,ts([`status-pill`,t.tone,n()]),`svelte-1sst490`),G(i,t.label)}),W(e,r)}function T7(e,t){k(t,!0);let n={draft:`info`,pending_review:`warning`,pending_publish:`success`,pending_deletion:`error`};{let r=j(()=>X(jK[t.status]));Clt(e,{get tone(){return n[t.status]},get label(){return B(r)},get class(){return`status-badge ${t.status??``}`}})}A()}var wlt=({entryDraft:e,branch:t,collectionName:n})=>{(e.current?.originalEntry)?.workflow?.pullRequest.branch===t&&(e.current=null,x$(`/collections/${n}`))},Tlt=(e,{entryDraft:t,branch:n,collectionName:r})=>FB(e)?(t.modified||wlt({entryDraft:t,branch:n,collectionName:r}),u1.current={...l1,alreadyPublished:!0},!0):!1,Elt=({entry:e,draft:t})=>{if(t?.originalEntry?.id===e.id)return M3e({draft:t});let{collectionName:n,fileName:r}=e.workflow,i=aj(n,r);if(!i)return!0;let{collection:a,collectionFile:o}=i;return c8({draft:a8({collection:a,collectionFile:o,originalEntry:e})}).valid},Dlt=({entry:e,status:t,draft:n})=>t===`draft`||Elt({entry:e,draft:n}),Olt=({entry:e,draft:t})=>e.workflow.status===`pending_deletion`||Elt({entry:e,draft:t}),klt=V(`<!> <!> <!>`,1);function Alt(e,t){k(t,!0);let n=Ez(),r=Y(t,`disabled`,3,!1),i=M(!1),a=M(!1),o=M(``),s=M(!1),c=M(0),l=j(()=>nY(t.entry)),u=j(()=>rY(t.entry)),d=j(()=>X(jK[B(u)])),f=j(()=>X(`workflow.entry_status_value`,{values:{status:B(d)}})),p=async e=>{if(e===B(u)||B(i))return;if(!Dlt({entry:t.entry,status:e,draft:n.current})){N(s,!0),N(c,B(c)+1);return}N(i,!0);let{collectionName:r,pullRequest:l}=t.entry.workflow;try{await x7(t.entry,e)}catch(e){Tlt(e,{entryDraft:n,branch:l.branch,collectionName:r})||(N(o,v7(e,`workflow.status_change_failed`),!0),N(a,!0),N(c,B(c)+1),console.error(e))}finally{N(i,!1)}};var m=klt(),h=F(m),g=e=>{T7(e,{get status(){return B(u)}})},_=e=>{{let t=e=>{{let t=j(()=>X(`workflow.change_entry_status`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();No(F(n),()=>B(c),e=>{var t=U();Ro(F(t),16,()=>B(l),e=>e,(e,t)=>{{let n=j(()=>X(jK[t])),r=j(()=>t===B(u));su(e,{get label(){return B(n)},get checked(){return B(r)},onChange:()=>{p(t)}})}}),W(e,t)}),W(e,n)},$$slots:{default:!0}})}},n=j(()=>B(i)?X(`workflow.changing_status`):sW.isLargeScreen?B(f):B(d)),a=j(()=>r()||B(i)),o=j(()=>B(i)?X(`workflow.changing_status`):B(f));kl(e,{variant:`ghost`,get label(){return B(n)},get disabled(){return B(a)},popupPosition:`bottom-right`,get"aria-label"(){return B(o)},popup:t,$$slots:{popup:!0}})}};K(h,e=>{B(l).length===1?e(g):e(_,-1)});var v=L(h,2);Pu(v,{get show(){return B(a)},set show(e){N(a,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(()=>G(n,B(o))),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(v,2),{get show(){return B(s)},set show(e){N(s,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`workflow.status_change_blocked`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,m),A()}var jlt=V(`<!> <!> <!> <!>`,1);function Mlt(e,t){k(t,!0);let n=Ez(),r=Y(t,`disabled`,3,!1),i=Y(t,`modified`,3,!1),a=M(!1),o=M(!1),s=M(``),c=M(!1),l=j(()=>t.entry.workflow.status===`pending_deletion`),u=j(()=>_lt({deletion:B(l)})),d=j(()=>fY.current.includes(t.entry.workflow.pullRequest.branch)),f=j(()=>jY(t.entry,YA(t.entry.workflow.collectionName))),p=async()=>{if(!Olt({entry:t.entry,draft:n.current})){N(c,!0);return}let{collectionName:e,pullRequest:r}=t.entry.workflow;try{await ult(t.entry,n.current?.originalEntry),wlt({entryDraft:n,branch:r.branch,collectionName:e})}catch(e){N(s,v7(e,`workflow.publishing_entry_failed`),!0),N(o,!0),console.error(e)}};var m=jlt(),h=F(m),g=e=>{{let t=j(()=>B(d)&&!B(l)?X(`publishing`):B(u).label),n=j(()=>r()||i()&&!B(l)||B(d));ll(e,{variant:`primary`,get label(){return B(t)},get"aria-label"(){return B(u).title},get disabled(){return B(n)},onclick:()=>{N(a,!0)}})}};K(h,e=>{B(f)&&e(g)});var _=L(h,2);Il(_,{get title(){return B(u).title},get okLabel(){return B(u).label},onOk:()=>{p()},get open(){return B(a)},set open(e){N(a,e,!0)},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(u).message)),W(e,n)},$$slots:{default:!0}});var v=L(_,2);Pu(v,{get show(){return B(o)},set show(e){N(o,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(()=>G(n,B(s))),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(v,2),{get show(){return B(c)},set show(e){N(c,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`workflow.publish_blocked`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,m),A()}var E7=(e,t)=>e.find(e=>e.name===t),Nlt=e=>w8([e])&&!e.readonly&&!(e.widget===`number`&&e.auto_increment)&&!P2(e),Plt=e=>e?._type===`entry`&&!!e.bulk_edit,Flt=e=>{if(!e||!Plt(e))return[];let{bulk_edit:t}=e,n=D(t)&&Array.isArray(t.fields)?t.fields:void 0;return(n?n.map(t=>E7(e.fields,t)):e.fields).filter(e=>!!e&&Nlt(e))},Ilt=/^\d{4}-\d{2}-\d{2}$/,D7=e=>Array.isArray(e)?e.some(D7):typeof e==`string`&&Ck.test(e),Llt=e=>!!e&&(D7(e.pattern)||pR.some(t=>D7(e[t]))),O7=(e,t=new Date)=>{if(typeof e!=`string`||!Ck.test(e))return e;if(e===`{{now}}`)return t;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=JL({date:t}),c=`${n}-${r}-${i}`,l={year:n,month:r,day:i,hour:a,minute:o,second:s};return e.replace(wk,(e,t)=>t===`now`?`${c}T${a}:${o}:${s}`:t===`today`?c:Tk.includes(t)?l[t]:e)},Rlt=e=>{let{format:t,dateOnly:n,timeOnly:r,utc:i}=lN(e);return!t&&!n&&!r&&!i},k7=(e,t,n)=>{if(e instanceof Date)return bN(e)?e:void 0;if(e==null||e===``)return;if(Ilt.test(String(e))&&(!t||Rlt(t))){let[t,n,r]=String(e).split(`-`).map(Number);return new Date(t,n-1,r)}if(t)return MN(String(e),t,n);let r=new Date(e);return bN(r)?r:void 0},zlt=e=>typeof e==`number`&&Number.isFinite(e)||typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e)),Blt=({value:e,target:t,dateFieldConfig:n,locale:r})=>{if(e==null||t==null)return;if(n||e instanceof Date||t instanceof Date){let i=k7(e,n,r),a=k7(t,n,r);return i&&a?i.getTime()-a.getTime():void 0}if(zlt(e)&&zlt(t))return Number(e)-Number(t);let i=String(e),a=String(t);return i<a?-1:+(i>a)},A7=(e,t)=>e===t||e!=null&&t!==void 0&&String(e)===String(t),Vlt=(e,{dateFieldConfig:t,now:n=new Date,locale:r=void 0}={})=>{let i=O7(e.pattern,n),a=pR.filter(t=>e[t]!==void 0).map(i=>{let a=e[i];if(i===`empty`)return{operator:i,target:a};if(i===`in`||i===`not_in`)return{operator:i,target:(Array.isArray(a)?a:[a]).map(e=>O7(e,n))};let o=O7(a,n);return t&&i!==`eq`&&i!==`ne`?{operator:i,target:k7(o,t,r)}:{operator:i,target:o}});return{pattern:i,regex:IL(i),comparisons:a,dateFieldConfig:t,locale:r}},Hlt=({rawValue:e,refValue:t,conditions:n})=>{let{pattern:r,regex:i,comparisons:a,dateFieldConfig:o,locale:s}=n,c=[e].flat().filter(e=>e!==void 0),l=[...new Set([...c,...[t].flat().filter(e=>e!==void 0)])];return r!==void 0&&!l.some(e=>Ike(e,r,i))?!1:a.every(({operator:t,target:n})=>{switch(t){case`eq`:return l.some(e=>A7(e,n));case`ne`:return!l.some(e=>A7(e,n));case`in`:return l.some(e=>n.some(t=>A7(e,t)));case`not_in`:return!l.some(e=>n.some(t=>A7(e,t)));case`empty`:return[e].flat().every(Nj)===n;default:return c.some(e=>{let r=Blt({value:e,target:n,dateFieldConfig:o,locale:s});return r===void 0?!1:t===`lt`?r<0:t===`lte`?r<=0:t===`gt`?r>0:r>=0})}})},j7=e=>xR(e,`filters`),Ult=(e,t,n,r=new Date)=>{let{name:i,view_filters:a=[],_i18n:{defaultLocale:o}}=t,{options:s}=j7(a),c=s.map(e=>hR(mR(e))),l=n.filter(e=>e.field!==void 0&&c.includes(hR(e))).map(e=>{let t=_M({collectionName:i,keyPath:e.field}),n=t?.widget===`datetime`?t:void 0;return{field:e.field,conditions:Vlt(e,{dateFieldConfig:n,now:r,locale:o})}});return e.filter(e=>l.every(({field:t,conditions:n})=>{let r={entry:e,locale:o,collectionName:i,key:t};return Hlt({rawValue:zR({...r,resolveRef:!1}),refValue:zR({...r}),conditions:n})}))},Wlt=KO(()=>{let e=WA.current;return e?._type===`entry`?j7(e.view_filters).options:[]}),M7=e=>xR(e,`groups`),Glt=e=>{if(e?._type!==`entry`)return;let t=OOe(e);if(!t)return;let n=M7(e.view_groups).options.find(e=>e.name===t);return n?mR(n):void 0},Klt=(e,t,n,r)=>{let{name:i,view_groups:a,_i18n:{defaultLocale:o}}=t,{field:s}=n,c=hR(n),l=_M({collectionName:i,keyPath:s}),u=Vlt(n,{dateFieldConfig:l?.widget===`datetime`?l:void 0,now:r,locale:o}),d=M7(a).options.find(e=>hR(mR(e))===c)?.label||s,f=[],p=[];return e.forEach(e=>{let t={entry:e,locale:o,collectionName:i,key:s};(Hlt({rawValue:zR({...t,resolveRef:!1}),refValue:zR({...t}),conditions:u})?f:p).push(e)}),[{name:d,entries:f},{name:`*other`,entries:p}].filter(e=>e.entries.length)},qlt=(e,t,n,r=new Date,i=void 0)=>{let{field:a,pattern:o}=n??{field:``,pattern:void 0};if(!a)return e.length?[{name:`*`,entries:e}]:[];if(Nke(n))return Klt(e,t,n,r);let{name:s,_i18n:{defaultLocale:c}}=t,l=Pke(e,o,e=>zR({entry:e,locale:c,collectionName:s,key:a})).map(([e,t])=>({name:e,entries:t}));return i?.key===a&&i.order===`descending`&&l.reverse(),l},Jlt=KO(()=>{let e=WA.current;return e?._type===`entry`?M7(e.view_groups).options:[]}),N7=WO(!1),P7=WO([]),F7=WO(!1),I7=WO(!1),L7=WO({}),R7=WO(!1),z7=WO([]),B7=WO({}),Ylt=()=>N7.current||I7.current,Xlt=6e4,V7=WO(new Date),Zlt=KO(()=>{let{filters:e=[],group:t}=t3.current;return e.some(Llt)||Llt(t)}),H7=qO(()=>t3.current.sort),U7=qO(()=>t3.current.filters),Qlt=qO(()=>t3.current.group),W7=KO(()=>{let{current:e}=tj,{current:t}=WA,{current:n}=rA;if(!e||!t)return[];let r=e=>pA({collection:t,entries:e,dirPath:n}),i=BL(t.name);return Ylt()?r(i):r(MY(i,lY.current.filter(({workflow:e})=>e.collectionName===t.name)))}),G7=KO(()=>{let{current:e}=WA;if(e?._type!==`entry`||Ylt())return[];let t=new Set(W7.current),n=pA({collection:e,entries:lY.current.filter(n=>n.workflow.collectionName===e.name&&!t.has(n)),dirPath:rA.current});if(!n.length)return[];let{current:r}=H7,{current:i}=U7;return r&&(n=pAe(n,e,r)),i&&(n=Ult(n,e,i,V7.current)),n}),$lt=5,K7=KO(()=>{let{current:e}=WA,t=!!e&&RY({collection:e});if(e?._type===`entry`){let n=(e.create??!0)&&e.limit!==0,r=!t&&(e.delete??!0),i=!t&&!NB.current&&!kB.current,a=i&&DOe(e),o=i&&!!Flt(e).length,s=e?.limit??1/0,c=h8(e.name),l=s<1/0?s-c:1/0;return{isEntryCollection:!0,readonly:t,canCreate:n,canDelete:r,canReorder:a,canBulkEdit:o,quota:s,remaining:l,nearingQuota:l>0&&l<=$lt,creationDisabled:!n||t||l<=0}}return{isEntryCollection:!1,readonly:t,canCreate:!1,canDelete:!1,canReorder:!1,canBulkEdit:!1,quota:1/0,remaining:1/0,nearingQuota:!1,creationDisabled:!1}}),eut=KO(()=>{let e=WA.current,{current:t}=W7,{current:n}=H7;return n?pAe(t,e,n):t}),tut=KO(()=>{let e=WA.current,{current:t}=eut,{current:n}=U7;return n?Ult(t,e,n,V7.current):t}),q7=KO(()=>{let e=WA.current,{current:t}=W7;if(!t.length||sj(e,t[0]).length)return[];let{current:n}=Qlt;return qlt(tut.current,e,n,V7.current,H7.current)}),J7=KO(()=>new Set([...G7.current,...q7.current.flatMap(({entries:e})=>e)])),nut=KO(()=>new Map([...J7.current].map((e,t)=>[e.id,t]))),rut=(e,t)=>{let{view_filters:n,view_groups:r}=e,i={...e3.current?.[e.name]},{default:a}=kR({collection:e,isCommitAuthorAvailable:t.some(e=>!!e.commitAuthor),isCommitDateAvailable:t.some(e=>!!e.commitDate)}),{keys:o}=kR({collection:e,isCommitAuthorAvailable:!0,isCommitDateAvailable:!0}),{default:s}=j7(n),{options:c,default:l}=M7(r);i.sort?.key!==void 0&&!o.includes(i.sort.key)&&delete i.sort,i.group&&!c.some(e=>hR(mR(e))===hR(i.group))&&delete i.group,i.sort===void 0&&a&&(i.sort=a),i.filters===void 0&&s&&(i.filters=[s]),i.group===void 0&&l&&(i.group=l),(0,Cr.default)(i,t3.current)||(t3.current=i)},Y7=e=>{if(!e){P7.current=[],F7.current=!1,i3.current&&=(t3.current=i3.current.view,void 0),N7.current=!1;return}let t=t3.current,n=Glt(WA.current);i3.current={collectionName:WA.current?.name,view:t};let r={};t.sort?.key!==`_manual`&&(r.sort={key:`_manual`,order:`ascending`}),t.filters?.length&&(r.filters=[]),n?vR(t.group)!==vR(n)&&(r.group=n):t.group&&(r.group=null),Object.keys(r).length&&(t3.current={...t,...r}),N7.current=!0},X7=e=>{L7.current={},B7.current={},z7.current=[],I7.current=e};JO(()=>{let e=WA.current,{current:t}=tj;e?._type===`entry`&&co(()=>{i3.current?.collectionName!==e.name&&rut(e,t)})}),JO(()=>{if(!Zlt.current)return;V7.current=new Date;let e=setInterval(()=>{V7.current=new Date},Xlt);return()=>{clearInterval(e)}}),JO(()=>{let{current:e}=XJ;e&&!co(()=>e3.current)&&JYe(e)}),JO(()=>{let e=W7.current;U7.current,LL.current=[],co(()=>CW.devModeEnabled)&&console.info(`listedEntries`,e)}),JO(()=>{let e=LL.current;if(!e.length)return;let{current:t}=J7;e.some(e=>!t.has(e))&&(LL.current=e.filter(e=>t.has(e)))}),JO(()=>{let e=WA.current;co(()=>{i3.current=void 0,N7.current&&Y7(!1),I7.current&&X7(!1)}),e&&co(()=>CW.devModeEnabled)&&console.info(`selectedCollection`,e)});var iut=[...mk,...hk],aut=async({draft:e,currentValues:t})=>{let{originalEntry:n,collection:r,collectionName:i,fileName:a,isIndexFile:o}=e,s={};if(!n)return s;let{defaultLocale:c}=e,l=xP(n,{defaultLocale:c})?.path,u=!!l&&!!t4(r,l),d=w0e({files:s}),f=async({value:e,folder:t,typedKeyPath:r,locale:o})=>{let s=a4(iX({value:e,entry:n,collectionName:i,fileName:a,typedKeyPath:r,locale:o}),n);if(s&&UB(s.path).some(e=>e.collectionName===i&&e.fileName===a&&e.entryRelative))return d(s.path,async()=>{try{return await C0e(s)}catch{return}},t)},p=async({valueMap:t,locale:n,keyPath:r})=>{let s=t[r];if(typeof s!=`string`||!s)return;let c=gM(e,{valueMap:t,keyPath:r}),l=_M(c),{widget:d=`string`}=l??{};if(!iut.includes(d))return;let p=vM(c),m=d3({collectionName:i,fileName:a,typedKeyPath:p,isIndexFile:o});if(!m.entryRelative||!(u||m.hasTemplateTags))return;let h=await E0e({value:s,format:mk.includes(d)?void 0:kZ(l),rewrite:e=>f({value:e,folder:m,typedKeyPath:p,locale:n})});h!==void 0&&(t[r]=h)};return await Promise.all(Object.entries(t).flatMap(([e,t])=>Object.keys(t).map(n=>p({valueMap:t,locale:e,keyPath:n})))),s},out=({keyPath:e,...t})=>{let n=e.split(`.`);for(let e=1;e<=n.length;e+=1){let r=n.slice(0,e).join(`.`),i=_M({...t,keyPath:r});if(i?.widget===`hidden`)return{fieldConfig:i,keyPath:r}}},sut=({getFieldArgs:e,locale:t,defaultLocale:n,valueMap:r,canonicalSlugKey:i,aliasesKey:a,orderFieldKey:o})=>{let s=new Set,c=new Map;delete r[i],a0(r,a),o&&delete r[o];let l={...e,valueMap:r},u=new Map;return Object.keys(r).forEach(e=>{let i=_M({...l,keyPath:e});i?.widget===`uuid`&&(t===n||rR(i.i18n)?r[e]=$3(i):cR({fieldConfig:i,getFieldArgs:{...l,keyPath:e}})&&(r[e]=``,c.set(e,i))),i?.widget===`compute`&&nB(i.value)&&(t===n||rR(i.i18n))&&(r[e]=``);let a=out({...l,keyPath:e});a&&(t===n||rR(a.fieldConfig.i18n)?(delete r[e],u.set(a.keyPath,a.fieldConfig)):cR({fieldConfig:a.fieldConfig,getFieldArgs:{...l,keyPath:a.keyPath}})&&(delete r[e],s.add(a.keyPath)))}),u.forEach((e,i)=>{Object.assign(r,H3({fieldConfig:e,keyPath:i,locale:t,defaultLocale:n}))}),{duplicatedHiddenKeyPaths:s,clearedUuidFields:c}},cut=({currentValues:e,defaultLocale:t,getFieldArgs:n,duplicatedHiddenFieldMap:r,clearedUuidFieldMap:i})=>{let a=e[t];r.forEach((t,n)=>{t.forEach(t=>{t in a&&(e[n][t]=structuredClone(a[t]))})}),l3e({contentMap:e,defaultLocale:t,getFieldArgs:n}),i.forEach((t,n)=>{t.forEach((t,r)=>{e[n][r]||(e[n][r]=$3(t))})})},lut=({draft:e,currentValues:t,files:n})=>{let{collection:r,collectionFile:i,currentPath:a}=e,o=a!==void 0&&cA(r)?dA(a):a,s=HO({...e,id:crypto.randomUUID(),createdAt:Date.now(),isNew:!0,originalEntry:void 0,originalSlugs:{},currentSlugs:{},originalPath:o,currentPath:o,originalLocales:UO(e.currentLocales),currentLocales:UO(e.currentLocales),originalValues:structuredClone(t),currentValues:{},files:n,validities:Object.fromEntries(Object.keys(e.validities).map(e=>[e,{}])),slugEditor:u3e({collection:r,collectionFile:i,originalSlugs:{}}),interacted:!1},mje);return Object.entries(t).forEach(([e,t])=>{s.currentValues[e]=z3({draft:s,locale:e,target:t})}),s},uut=async e=>{let t=e.current,{collection:n,fields:r}=t,{defaultLocale:i,canonicalSlug:{key:a}}=BA(t),o=gM(t),s=HL(n),c=r0({collection:n,fields:r}),l=Object.fromEntries(Object.entries(t.currentValues).map(([e,t])=>[e,UO(t)])),u=new Map,d=new Map;Object.entries(l).forEach(([e,t])=>{let{duplicatedHiddenKeyPaths:n,clearedUuidFields:r}=sut({getFieldArgs:o,locale:e,defaultLocale:i,valueMap:t,canonicalSlugKey:a,aliasesKey:c,orderFieldKey:s});u.set(e,n),d.set(e,r)}),cut({currentValues:l,defaultLocale:i,getFieldArgs:o,duplicatedHiddenFieldMap:u,clearedUuidFieldMap:d});let f={...t.files,...await aut({draft:t,currentValues:l})};if(e.current!==t)return;let p=lut({draft:t,currentValues:l,files:f});return e.current=p,e$.current=!0,p},dut=async e=>{let{isNew:t,originalEntry:n,collectionName:r,fileName:i}=e,{branch:a,headSHA:o}=n?.workflow?.pullRequest??{},s=XJ.current?.workflow;if(t||!n||!a||!o||!s)return;let c;try{c=await s.fetchBranchHead(a)}catch(e){console.error(`Failed to check the workflow branch for changes.`,e);return}if(c===o)return;try{await B8({fresh:!0})}catch(e){console.error(`Failed to reload the unpublished entries.`,e)}if(!c)return;let l=n.arrayIndex===void 0,u=wY({collectionName:r,fileName:i,originalEntry:n});if(!u)return{type:`deleted`,canOverwrite:l};if(!(0,Cr.default)(u.locales,n.locales))return{type:`modified`,entry:u,canOverwrite:l}},fut=({useWorkflow:e,skipCI:t,count:n})=>{let r=!e&&G8.current&&!(t??K8.current);u1.current={...l1,saved:!0,published:r,count:n},nK(r)},put=async({draft:e,slugs:t,recreate:n})=>{let{collection:r,fileName:i,originalEntry:a}=e;try{let{savingEntry:o,changes:s,savingAssets:c}=await y4({draft:e,slugs:t,recreate:n}),{changes:l,savingEntries:u}=await Ict({collection:r,collectionFile:e.collectionFile,originalEntry:a,savingEntry:o});s.push(...l);let{changes:d,savingEntries:f}=await kct({collection:r,originalEntry:a,savingEntry:o});s.push(...d);let{changes:p,savingAssets:m}=await jct({collection:r,fileName:i,originalEntry:n?void 0:a,savingEntry:o,changes:s});return s.push(...p),c.push(...m),{savingEntry:_4(o),changes:s,savingAssets:c,cascadeEntries:u,movedEntries:f}}catch(e){throw console.error(e),Error(`saving_failed`,{cause:e})}},mut=async(e,{remoteChecked:t})=>{let n=EM(e);if(n.length){if(!t)try{await U4()}catch(e){console.error(`Failed to check the repository for changes.`,e)}for(let{collectionName:t,entry:r,baseEntry:i}of n){let n=h6e(e,i);if(n){let e=$L(YA(t),r);throw Error(`saving_failed`,{cause:Error(X(n.type===`deleted`?`relation_field.edit_deleted`:`relation_field.edit_conflict`,{values:{name:e}}))})}}}},hut=async({draft:e,useWorkflow:t,overwrite:n,publish:r})=>{if(zY(e)){let{collection:t,collectionFile:n}=e;throw Error(`saving_failed`,{cause:Error(BY(`entry`,{collection:t,collectionFile:n}))})}if(!await l8({draft:e,enforceRequired:r||l2(e)}))throw Error(`validation_failed`);let i=t?await dut(e):await X3e(e);if(i&&!n)throw Error(`save_conflict`,{cause:i});return await mut(e,{remoteChecked:!t&&!e.isNew&&!!e.originalEntry}),i},gut=async e=>{let t=[];for(let n of NCe(e))t.push(await nYe(n));return t},_ut=async({draft:e,useWorkflow:t,changes:n,savingEntry:r,otherSavingEntries:i,pendingEntries:a,savingAssets:o,options:s})=>{let{collectionName:c,fileName:l,originalEntry:u}=e;try{return t?await alt({changes:n,savingEntry:r,savingAssets:o,options:s,collectionName:c,fileName:l,slug:r.slug,originalEntry:u,companions:a.map(({collectionName:e,entry:t,baseEntry:n})=>({collectionName:e,entry:t,...n&&tj.current.some(({id:e})=>e===t.id)?{edited:!0}:{}}))}):await G4({changes:n,savingEntries:[r,...i],savingAssets:o,options:s})}catch(e){throw P4(e)?e:(console.error(e.cause??e),Error(`saving_failed`,{cause:e.cause??e}))}},vut=async({draft:e,savingEntry:t,pendingEntries:n,useWorkflow:r,skipCI:i,count:a})=>{let{isNew:o,collection:s,collectionName:c,originalEntry:l}=e;t8();try{await Q6(c,e8(e))}catch(e){console.error(e)}await h4({type:`postSave`,entry:t,collection:s,collectionFile:e.collectionFile,isNew:o}),await Promise.all(n.map(({collectionName:e,entry:t,baseEntry:n})=>h4({type:`postSave`,entry:t,collection:YA(e),isNew:!n}))),fut({useWorkflow:r,skipCI:i,count:a}),[l,...n.map(({baseEntry:e})=>e)].forEach(e=>{e&&_st(e.id)})},yut=async({draft:e,skipCI:t=void 0,overwrite:n=!1,publish:r=!1})=>{let i=r?!!wY(e):TY(e),a=await hut({draft:e,useWorkflow:i,overwrite:n,publish:r});Q3e(e,wM(e,e.collectionName).length);let o=w2({draft:e}),s=a?.type===`deleted`,{savingEntry:c,changes:l,savingAssets:u,cascadeEntries:d,movedEntries:f}=await put({draft:e,slugs:o,recreate:s}),p=await gut(e);l.push(...p.flatMap(e=>e.changes)),u.push(...p.flatMap(e=>e.savingAssets));let m=await _ut({draft:e,useWorkflow:i,changes:l,savingEntry:c,otherSavingEntries:[...d,...f,...p.map(e=>e.entry)],pendingEntries:p,savingAssets:u,options:{commitType:e.isNew||s?`create`:`update`,collection:e.collection,skipCI:t}});return await vut({draft:e,savingEntry:c,pendingEntries:p,useWorkflow:i,skipCI:t,count:1+d.length+f.length+p.length}),m.savedEntries[0]},but=({collection:e,collectionFile:t,isIndexFile:n,readonly:r,creationDisabled:i})=>!r&&!t&&!n&&(e?._type!==`entry`||e.duplicate!==!1)&&!i,xut=({publishedVersionExists:e,canDeleteEntry:t,isCollectionFile:n,readonly:r,locked:i})=>({discard:!r&&(e||t&&!n),delete:e&&t&&!n&&!i}),Sut=e=>e.message===`validation_failed`?{type:`validation`}:e.message===`save_conflict`?{type:`conflict`,conflict:e.cause}:e.message===`saving_failed`?{type:`error`,message:e.cause?.message??``,unexpected:!1}:{type:`error`,message:``,unexpected:!0},Cut=({collection:e,collectionFile:t,isIndexFile:n,hasPullRequest:r,workflowEnabled:i,publishedVersionExists:a,pendingDeletion:o,readonly:s,openAuthoring:c,creationDisabled:l})=>{let u=r||i,d=e?._type!==`entry`||e.delete!==!1,f=r&&!a,p=d&&(f||!c),m=o||s;return{useWorkflow:u,discardsDraft:f,locked:m,canDuplicate:but({collection:e,collectionFile:t,isIndexFile:n,readonly:s,creationDisabled:l}),removalMenuItems:xut({publishedVersionExists:a,canDeleteEntry:p,isCollectionFile:!!t,readonly:s,locked:m})}},wut=async({entryDraft:e,useWorkflow:t,skipCI:n=void 0,overwrite:r=!1,publish:i=!1,askForReview:a,closeOnSave:o})=>{let s=e.current,{isNew:c,collection:l,collectionFile:u}=s,d=()=>e.current===s;try{if(await Iz(),!d()||!c&&!e.modified)return{type:`skipped`};oRe(Object.keys(s.files??{}).length);let f=await yut({draft:s,skipCI:n,overwrite:r,publish:i}),p=f,m;if(i&&p.workflow)try{await llt(p);let{workflow:e,...t}=p;f=t}catch(e){m=v7(e,`workflow.publishing_entry_failed`),console.error(e)}if(!d())return{type:`saved`,savedEntry:f,statusError:m};let h=!i&&t()&&p.workflow?sHe(p,l):void 0;if(h&&tY(p,l)===`draft`&&c8({draft:s}).valid&&await a(h))try{await x7(p,h)}catch(e){m=v7(e,`workflow.status_change_failed`),console.error(e)}if(!d())return{type:`saved`,savedEntry:f,statusError:m};let g=c?oP(`/collections/${l.name}/entries/${u?.name??f.subPath}`):void 0,_=o()&&m===void 0?`close`:`reset`;return{type:`saved`,savedEntry:f,statusError:m,path:g,next:_}}catch(e){if(P4(e))return{type:`skipped`};let t=Sut(e);return t.type===`validation`?{type:`invalid`,errorCount:P3e(s.validities)}:t.type===`conflict`?d()?{type:`conflict`,conflict:t.conflict}:{type:`error`,message:``}:(t.unexpected&&console.error(e),{type:`error`,message:t.message})}finally{bq()}},Tut=async e=>{let{collectionName:t}=e.current;return await uut(e)?`/collections/${t}/new`:void 0},Eut=V(`<bdi> </bdi> › <bdi> </bdi>`,1),Dut=V(`<h2 role="none"><!></h2>`),Z7=V(`<!> <!>`,1),Out=V(`<!> <!> <!> <!> <!> <!> <!>`,1),kut=V(`<!> <!> <!> <!> <span class="save-progress svelte-zjrq31" aria-live="polite"><!></span> <!> <!> <!>`,1),Aut=V(`<div role="none" class="error svelte-zjrq31"> </div>`),jut=V(` <!>`,1),Mut=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),Nut={hash:`svelte-zjrq31`,code:`.save-progress.svelte-zjrq31 {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;}.error.svelte-zjrq31 {margin-top:8px;border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);line-height:1.5;}`};function Put(e,t){k(t,!0),q(e,Nut);let n=e=>{var t=U(),n=F(t),r=e=>{{let t=j(()=>B(fe)?.workflow?.pullRequest),n=j(()=>!sW.isLargeScreen),r=j(()=>sW.isSmallScreen?`menuitem`:`button`);G5(e,{get entry(){return B(ee)},get locale(){return B(te)},get collection(){return B(w)},get collectionFile(){return B(T)},get pullRequest(){return B(t)},get iconic(){return B(n)},get as(){return B(r)}})}};K(n,e=>{!i()&&B(w)&&B(ee)&&e(r)}),W(e,t)},r=Ez(),i=Y(t,`disabled`,3,!1),a=M(!1),o=M(0),s=M(!1),c=M(void 0),l=M(void 0),u=M(!1),d=M(void 0),f=M(!1),p=M(``),m=M(!1),h=M(!1),g=M(!1),_=M(!1),v=M(void 0),y=M(void 0),b=j6(()=>{let e=r.current;return{restore:!!e&&k6({draft:e,restore:!0}),clear:!!e&&k6({draft:e})}}),x=j(()=>r.current===void 0),S=j(()=>r.current?.isNew??!0),C=j(()=>!!r.current?.isIndexFile),w=j(()=>r.current?.collection),T=j(()=>r.current?.collectionFile),ee=j(()=>r.current?.originalEntry),E=j(()=>BA(r.current)),te=j(()=>B(E).defaultLocale),ne=j(()=>B(w)?.name),re=j(()=>B(T)?.name),ie=j(()=>Fc.current&&B(w)?XA(B(w)):``),ae=j(()=>Fc.current&&B(w)?XA(B(w),{useSingular:!0}):``),oe=j(()=>B(T)?oj(B(T)):B(w)&&B(ee)&&Fc.current?$L(B(w),B(ee)):``),se=j(()=>B(x)?``:B(S)?X(`create_entry_title`,{values:{name:B(ae)}}):`${B(ie)} › ${B(oe)}`);R(()=>(f$.current=B(se),()=>{f$.current=``}));let ce=j(()=>B(m)||B(g)||B(_)),le=j(()=>i()||B(ce)),ue=j(()=>B(S)||r.modified||Fz.current),de=j(()=>B(ne)&&B(ee)?p4({entry:B(ee),collectionName:B(ne),fileName:B(re)}):[]),fe=j(()=>sY.current&&B(ne)?wY({collectionName:B(ne),fileName:B(re),originalEntry:B(ee)}):void 0),pe=j(()=>FY(B(fe))),me=j(()=>EY(B(fe))),he=j(()=>zY(r.current)),ge=j(()=>Cut({collection:B(w),collectionFile:B(T),isIndexFile:B(C),hasPullRequest:!!B(fe),workflowEnabled:cY(B(w)),publishedVersionExists:B(pe),pendingDeletion:B(me),readonly:B(he),openAuthoring:NB.current,creationDisabled:K7.current.creationDisabled})),_e=j(()=>B(ge).useWorkflow),ve=j(()=>B(ge).discardsDraft),ye=j(()=>B(ge).locked),be=j(()=>B(ge).canDuplicate),xe=j(()=>B(ge).removalMenuItems),Se=j(()=>B(_e)&&uHe(B(w),B(fe))),Ce=j(()=>B(Se)&&!AY([...r.current?.pendingEntries.length?TM(r.current):[],...B(fe)?.workflow.companions??[]])),we=j(()=>X(B(c)===`pending_publish`?`workflow.mark_as_ready`:`workflow.send_for_review`)),Te=j(()=>w7({pendingDeletion:B(me),publishedVersionExists:B(pe)}));R(()=>Hot());let Ee=()=>{let e=B(w)&&aA(B(w))?rA.current:``;x$(rGe({collectionName:B(ne),dirPath:e}),{returnTo:k5})},De=e=>new Promise(t=>{N(c,e,!0),N(l,t,!0),N(s,!0)}),Oe=()=>B(_e),ke=()=>CW.closeOnSave??!0,Ae=async({skipCI:e=void 0,overwrite:t=!1,publish:n=!1}={})=>{let i=r.current;if(B(w)&&i){N(m,!0),N(h,n,!0);try{let s=await wut({entryDraft:r,useWorkflow:Oe,skipCI:e,overwrite:t,publish:n,askForReview:De,closeOnSave:ke});s.type===`saved`?(s.statusError!==void 0&&(N(f,!0),N(p,s.statusError,!0)),s.path&&b$(s.path,{replaceState:!0,notifyChange:!1}),s.next===`close`?(Ee(),r.current=null):s.next===`reset`&&o8({entryDraft:r,collection:B(w),collectionFile:B(T),originalEntry:s.savedEntry,extraValues:i.extraValues,expanderStates:i.expanderStates})):s.type===`invalid`?(N(o,s.errorCount,!0),N(a,!0)):s.type===`conflict`?(N(d,{conflict:s.conflict,skipCI:e,publish:n},!0),N(u,!0)):s.type===`error`&&(N(f,!0),N(p,s.message,!0))}finally{N(m,!1),N(h,!1)}}};var je=Mut(),Me=F(je);{let e=j(()=>X(`primary`));pO(Me,{variant:`primary`,get ariaLabel(){return B(e)},children:(e,t)=>{var a=kut(),o=F(a);{let e=j(()=>X(`cancel_editing`)),t=j(()=>CW.closeWithEscape&&!t$.current);b5(o,{get"aria-label"(){return B(e)},get useShortcut(){return B(t)},onclick:()=>{Ee()}})}var s=L(o,2),c=e=>{Ml(e,{flex:!0})},l=e=>{var t=Dut(),n=P(t),r=e=>{Xc(e,{children:(e,t)=>{var n=U(),r=F(n),i=e=>{var t=H();z(()=>G(t,B(se))),W(e,t)},a=e=>{var t=Eut(),n=F(t),r=I(n,!0),i=I(L(n,2),!0);z(()=>{G(r,B(ie)),G(i,B(oe))}),W(e,t)};K(r,e=>{B(S)?e(i):e(a,-1)}),W(e,n)},$$slots:{default:!0}})};K(n,e=>{B(x)||e(r)}),O(t),W(e,t)};K(s,e=>{sW.isSmallScreen?e(c):e(l,-1)});var u=L(s,2),d=e=>{n(e)};K(u,e=>{sW.isSmallScreen||e(d)});var f=L(u,2),p=e=>{Alt(e,{get entry(){return B(fe)},get disabled(){return B(le)}})};K(f,e=>{B(fe)&&!B(ye)&&e(p)});var g=L(f,2),C=P(g),w=e=>{var t=H();z(e=>G(t,e),[()=>X(`save_progress.${yq.current.phase}`,{values:{done:yq.current.done,total:yq.current.total}})]),W(e,t)};K(C,e=>{B(m)&&yq.current&&e(w)}),O(g);var T=L(g,2),ee=e=>{},E=e=>{{let t=e=>{ru(e,{children:(e,t)=>{{let t=j(()=>X(K8.current?`save_and_publish`:`save_without_publishing`));iu(e,{get label(){return B(t)},onclick:()=>{Ae({skipCI:!K8.current})}})}},$$slots:{default:!0}})},n=j(()=>X(K8.current?B(m)?`saving`:`save`:B(m)?`publishing`:`publish`)),r=j(()=>B(le)||!B(ue));Al(e,{variant:`primary`,get label(){return B(n)},get disabled(){return B(r)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()},popup:t,$$slots:{popup:!0}})}},te=e=>{{let t=e=>{ru(e,{children:(e,t)=>{{let t=j(()=>X(B(Ce)?`save_and_publish_needs_review`:`save_and_publish`));iu(e,{get label(){return B(t)},get disabled(){return B(Ce)},onclick:()=>{Ae({publish:!0,skipCI:!1})}})}},$$slots:{default:!0}})},n=j(()=>X(B(m)?B(h)?`publishing`:`saving`:`save`)),r=j(()=>B(le)||!B(ue));Al(e,{variant:`primary`,get label(){return B(n)},get disabled(){return B(r)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()},popup:t,$$slots:{popup:!0}})}},ne=e=>{{let t=j(()=>X(B(m)?`saving`:`save`)),n=j(()=>B(le)||!B(ue));ll(e,{variant:`primary`,get label(){return B(t)},get disabled(){return B(n)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()}})}};K(T,e=>{B(ye)?e(ee):G8.current&&!B(_e)?e(E,1):B(Se)?e(te,2):e(ne,-1)});var re=L(T,2),ae=e=>{Mlt(e,{get entry(){return B(fe)},get disabled(){return B(le)},get modified(){return B(ue)}})};K(re,e=>{B(fe)&&!B(he)&&e(ae)});var ce=L(re,2);{let e=e=>{{let t=j(()=>X(`editor_options`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var a=Out(),o=F(a),s=e=>{var t=Z7(),i=F(t);n(i);var a=L(i,2),o=e=>{var t=Z7(),n=F(t);Ro(n,17,()=>Hst(r.current),({key:e,disabled:t})=>e,(e,t)=>{let n=()=>B(t).key,r=()=>B(t).disabled;{let t=j(()=>X(`entry_sidebar.${n()}.title`));iu(e,{get label(){return B(t)},get disabled(){return r()},onclick:()=>{p7(n())}})}}),ql(L(n,2),{}),W(e,t)};K(a,e=>{B(x)||e(o)}),W(e,t)};K(o,e=>{sW.isSmallScreen&&e(s)});var c=L(o,2),l=e=>{var t=Z7(),n=F(t),i=e=>{{let t=j(()=>X(`duplicate`)),n=j(()=>X(`duplicate_entry`));iu(e,{variant:`ghost`,get disabled(){return B(le)},get label(){return B(t)},get"aria-label"(){return B(n)},onclick:async()=>{N(_,!0);let e=await Tut(r);N(_,!1),e&&b$(e,{replaceState:!0,notifyChange:!1,transitionType:`forwards`})}})}};K(n,e=>{B(be)&&e(i)});var a=L(n,2),o=e=>{iu(e,{variant:`ghost`,get disabled(){return B(le)},get label(){return B(Te).label},get"aria-label"(){return B(Te).title},onclick:()=>{B(pe)?B(y)?.confirmDiscard():B(y)?.confirmDelete()}})};K(a,e=>{B(xe).discard&&e(o)}),W(e,t)};K(c,e=>{!i()&&!B(S)&&e(l)});var u=L(c,2),d=e=>{{let t=j(()=>X(`delete`));iu(e,{get label(){return B(t)},onclick:()=>{B(y)?.confirmDelete()}})}};K(u,e=>{B(xe).delete&&e(d)});var f=L(u,2),p=e=>{{let t=j(()=>X(`edit_slug`)),n=j(()=>!h3e(r.current));iu(e,{get label(){return B(t)},get disabled(){return B(n)},onclick:()=>{p7(`slug`)}})}};K(f,e=>{sW.isSmallScreen||e(p)});var m=L(f,2);{let e=j(()=>!sW.isSmallScreen||!i()&&!B(S)),t=j(()=>({revert:B(ue)&&!B(ye),restore:b.availability.restore&&!B(ye),clear:b.availability.clear&&!B(ye)}));D6(m,{scope:`entry`,get separator(){return B(e)},get available(){return B(t)},get onSelect(){return b.select}})}var h=L(m,2),g=e=>{var t=Z7(),n=F(t);ql(n,{});var r=L(n,2);{let e=j(()=>X(`deploy_preview.check_again`));iu(r,{get label(){return B(e)},onclick:()=>{Uot()}})}W(e,t)};K(h,e=>{tK.current&&e(g)});var v=L(h,2),C=e=>{ict(e,{})};K(v,e=>{sW.isLargeScreen&&e(C)}),W(e,a)},$$slots:{default:!0}})}},t=j(()=>X(`show_editor_options`));ms(kl(ce,{get disabled(){return B(le)},variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return B(t)},get onclick(){return b.update},get onkeydown(){return b.update},popup:e,$$slots:{popup:!0}}),e=>N(v,e,!0),()=>B(v))}W(e,a)},$$slots:{default:!0}})}var Ne=L(Me,2);D3e(Ne,{get count(){return B(o)},onShowErrors:()=>{p7(`validation`)},get show(){return B(a)},set show(e){N(a,e,!0)}});var Pe=L(Ne,2);Pu(Pe,{get id(){return r$.current.id},get show(){return r$.current.show},set show(e){r$.current.show=e},children:(e,t)=>{let n=j(()=>r$.current);Vc(e,{get status(){return B(n).status},children:(e,t)=>{$r();var r=H();z(e=>G(r,e),[()=>X(`editor.${B(n).message}`,{values:{count:B(n).count,source:B(n).sourceLanguage?kA(B(n).sourceLanguage)??B(n).sourceLanguage:``}})]),W(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}});var Fe=L(Pe,2);Pu(Fe,{get id(){return i$.current.id},get show(){return i$.current.show},set show(e){i$.current.show=e},children:(e,t)=>{Vc(e,{get status(){return i$.current.status},children:(e,t)=>{$r();var n=H();z(()=>G(n,i$.current.message)),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var Ie=L(Fe,2);Sot(Ie,{get action(){return b.action},onClose:()=>{B(v)?.focus()},get open(){return b.dialogOpen},set open(e){b.dialogOpen=e}});var Le=L(Ie,2);{let e=j(()=>X(`later`));Il(Le,{get title(){return B(we)},get okLabel(){return B(we)},get cancelLabel(){return B(e)},onOk:()=>{B(l)?.(!0)},onClose:()=>{B(l)?.(!1)},get open(){return B(s)},set open(e){N(s,e,!0)},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(B(c)===`pending_publish`?`workflow.confirm_marking_as_ready`:`workflow.confirm_sending_for_review`)]),W(e,n)},$$slots:{default:!0}})}var Re=L(Le,2);ms(ylt(Re,{get collection(){return B(w)},get collectionFile(){return B(T)},get originalEntry(){return B(ee)},get unpublishedEntry(){return B(fe)},get associatedAssets(){return B(de)},get discardsDraft(){return B(ve)},get useWorkflow(){return B(_e)},get pendingDeletion(){return B(me)},onDone:()=>{Ee()},onClose:()=>{B(v)?.focus()},get deleting(){return B(g)},set deleting(e){N(g,e,!0)}}),e=>N(y,e,!0),()=>B(y));var ze=L(Re,2);{let e=j(()=>B(d)?.conflict);blt(ze,{get conflict(){return B(e)},onOverwrite:async()=>{await Ae({skipCI:B(d)?.skipCI,overwrite:!0,publish:B(d)?.publish})},onClose:()=>{B(v)?.focus()},get open(){return B(u)},set open(e){N(u,e,!0)}})}var Be=L(ze,2);{let e=j(()=>X(`saving_entry.error.title`));Fl(Be,{get title(){return B(e)},onClose:()=>{B(v)?.focus()},get open(){return B(f)},set open(e){N(f,e,!0)},children:(e,t)=>{$r();var n=jut(),r=F(n),i=L(r),a=e=>{var t=Aut(),n=I(t,!0);z(()=>G(n,B(p))),W(e,t)};K(i,e=>{B(p)&&e(a)}),z(e=>G(r,`${e??``} `),[()=>X(`saving_entry.error.description`)]),W(e,n)},$$slots:{default:!0}})}W(e,je),A()}var Fut=V(`<!> <!>`,1),Iut=V(`<div class="pane-wrapper svelte-jrunrx"><!></div>`),Lut=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),Rut=V(`<div role="none"> </div>`),zut=V(`<div role="none"><!></div> <div role="none"><!></div>`,1),But=V(`<div role="none" class="pane-measure svelte-jrunrx"><!></div>`),Vut=V(`<!> <!> <!>`,1),Hut=V(`<div role="none" class="content-area svelte-jrunrx"><!></div> <!>`,1),Uut=V(`<!> <!> <div role="none" class="body svelte-jrunrx"><!></div>`,1),Wut=V(`<div role="group" class="wrapper content-editor svelte-jrunrx"><!></div> <!>`,1),Gut={hash:`svelte-jrunrx`,code:`.wrapper.svelte-jrunrx {position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;background-color:var(--sui-secondary-background-color);}.pane-wrapper.svelte-jrunrx {display:contents;& > .pane {flex:auto;height:100%;overflow:hidden;display:flex;flex-direction:column;}}.body.svelte-jrunrx {flex:auto;display:flex;overflow:hidden;}.content-area.svelte-jrunrx {position:relative;flex:auto;border-block-start:var(--area-border); /* below the toolbar */background-color:var(--sui-primary-background-color);&:not(:only-child) {border-inline-end:var(--area-border); /* sidebar is present */border-start-end-radius:16px;}.sui.resizable-handle {border-inline:var(--area-border); /* between the panes */background-color:var(--sui-secondary-background-color); /* same as toolbar */}
|
||
|
||
/* Centred over the gutter, whose position is the first pane’s width */.swap-button {position:absolute;top:calc(50% - 12px);inset-inline-start:calc(
|
||
var(--gutter-position) + var(--sui-resizable-handle-size, 4px) / 2
|
||
);
|
||
/* Above the handle’s hit area, a positioned \`::before\` pseudo-element at \`z-index: 1\` */z-index:2;margin:0;border-radius:50%;opacity:0.5;translate:-50%;&:dir(rtl) {translate:50%;}&:hover,
|
||
&:focus-visible {opacity:1;}}}.pane-measure.svelte-jrunrx {display:flex;flex-direction:column;height:100%;}`};function Kut(e,t){k(t,!0),q(e,Gut);let n=(e,t=jr,n)=>{let r=()=>(n?.()).locale,i=()=>(n?.()).mode,a=j(()=>t()===`first`?a$:o$),o=j(()=>t()===`first`?o$:a$);var s=Iut(),c=P(s);{let e=j(()=>K5(i()===`edit`?`edit_x_locale`:`preview_x_locale`,r()));OO(c,{class:`pane`,get ariaLabel(){return B(e)},get"data-locale"(){return r()},get"data-mode"(){return i()},children:(e,n)=>{var r=Fut(),i=F(r);{let e=j(()=>`${t()}-pane-header`);Yot(i,{get id(){return B(e)},get thisPane(){return B(a)},get thatPane(){return B(o)}})}var s=L(i,2),c=e=>{xot(e,{id:`first-pane-body`,get thisPane(){return B(a)},get thatPaneContentArea(){return B(p)},get thisPaneContentArea(){return B(f)},set thisPaneContentArea(e){N(f,e,!0)}})},l=e=>{xot(e,{id:`second-pane-body`,get thisPane(){return B(a)},get thatPaneContentArea(){return B(f)},get thisPaneContentArea(){return B(p)},set thisPaneContentArea(e){N(p,e,!0)}})};K(s,e=>{t()===`first`?e(c):e(l,-1)}),W(e,r)},$$slots:{default:!0}})}O(s),W(e,s)},r=Y(t,`entryDraft`,7),i=Y(t,`editorLocale`,3,void 0),a=Y(t,`loading`,3,!1);Tz(r());let o=!1,s=!1,c=AL(),l=M(0),u=M(!0),d=M(void 0),f=M(void 0),p=M(void 0),m=j(()=>r().current===void 0),h=j(()=>r().current??{}),g=j(()=>Nr(B(h).isNew,!0)),_=j(()=>Nr(B(h).canPreview,!0)),v=j(()=>Nr(B(h).canShowSecondPane,!0)),y=j(()=>B(h).collection),b=j(()=>B(h).collectionName),x=j(()=>B(h).collectionFile),S=j(()=>B(h).fileName),C=j(()=>B(h).isIndexFile),w=j(()=>u8.current??{}),T=j(()=>B(w).showPreview),ee=j(()=>Nr(B(w).showSecondPane,!0)),E=j(()=>B(v)&&B(ee)),te=j(()=>BA(r().current)),ne=j(()=>B(te).i18nEnabled),re=j(()=>B(te).allLocales),ie=j(()=>B(te).defaultLocale),ae=j(()=>kot({collection:B(y),collectionFile:B(x)})),oe=j(()=>K7.current),se=j(()=>B(oe).readonly),ce=j(()=>B(oe).canCreate),le=j(()=>B(oe).quota),ue=j(()=>B(oe).creationDisabled),de=j(()=>zY(r().current)),fe=j(()=>Aot({firstPane:a$.current,secondPane:o$.current})),pe=j(()=>Pr(B(fe),3)),me=j(()=>B(pe)[0]),he=j(()=>B(pe)[1]),ge=j(()=>B(pe)[2]),_e=async()=>{if(o)return!1;let e=jot({savedPanes:u8.current?.paneStates?.[B(ae)??``],editorLocale:i(),allLocales:B(re),defaultLocale:B(ie),canPreview:B(_),showPreview:B(T),showSecondPane:B(E)});return e?(o=!0,await ao(),[a$.current,o$.current]=e,(sW.isSmallScreen||sW.isMediumScreen)&&(o$.current=null),await ao(),o=!1,!0):!1},ve=async()=>{r().current&&!s&&(s=!0,await _e()||([a$.current,o$.current]=Mot({editorLocale:i(),currentLocale:a$.current?.locale,defaultLocale:B(ie),allLocales:B(re),i18nEnabled:B(ne),canPreview:B(_),showPreview:B(T),showSecondPane:B(E),singlePane:sW.isSmallScreen||sW.isMediumScreen})),s=!1)},ye=()=>{let e=a$.current,t=o$.current;B(y)&&!o&&e&&t&&B(ae)&&Pot(B(ae),[e,t])},be=()=>{Lz(()=>{[a$.current,o$.current]=[o$.current,a$.current]})},xe=e=>{e.isTrusted&&r().current&&!r().current.interacted&&(r().current.interacted=!0)},Se=async e=>{await Iz();let t=Not({firstPane:a$.current,secondPane:o$.current,locale:e});t&&([a$.current,o$.current]=t,await Zc(100))},Ce=async({locale:e,keyPath:t})=>{let n=c.next();await Se(e);let i=r().current;i&&await m0e({draft:i,locale:e,keyPath:t,isOutdated:()=>!n()})},we=async()=>{let{state:e}=window.history,{locale:t,keyPath:n}=e?.highlight??{};typeof t==`string`&&typeof n==`string`&&t&&n&&(await Ce({locale:t,keyPath:n}),window.history.replaceState({...e,highlight:null},``))},Te=e=>{e.source===window&&e.data?.type===`highlight-editor-field`&&e.data.payload&&Ce(e.data.payload)};vs(()=>{$Q.current||(r().current=null);let e=lH();return window.addEventListener(`message`,Te),()=>{window.removeEventListener(`message`,Te),e()}}),R(()=>{CW.devModeEnabled&&console.info(`entryDraft`,ai(r().current))}),Y3e(()=>r(),()=>B(d)),R(()=>{let e=r().current;e&&(Object.values(e.currentValues).forEach(mz),ai(e.currentLocales),ai(e.currentSlugs),Object.values(e.files).forEach(({file:e})=>void 0),e.pendingEntries.forEach(e=>void 0),e.interacted),co(()=>X4e(e))}),R(()=>{B(ae)&&(a$.current=null,o$.current=null)}),YO(()=>[B(ae),B(y),B(E),B(T),B(_),sW.isSmallScreen,sW.isMediumScreen],()=>{ve()}),R(()=>{a$.current,o$.current,ye()}),R(()=>{B(d)&&(async()=>{B(u)&&(N(u,!1),await ve(),await dH(()=>B(d)),await we(),Y4e())})()});var Ee=Wut(),De=F(Ee);No(P(De),()=>r().current?.id,e=>{var t=Vut(),i=F(t),o=e=>{var t=Lut(),n=F(t);Po(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{dismissible:!1,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>BY(`entry`,{collection:B(y),collectionFile:B(x)})]),W(e,n)},$$slots:{default:!0}}),O(n),W(e,t)};K(i,e=>{B(de)&&!a()&&!(B(g)&&B(ue))&&e(o)});var s=L(i,2);{let e=j(()=>a()||B(g)&&B(ue));Put(s,{get disabled(){return B(e)}})}var c=L(s,2),u=e=>{DO(e,{children:(e,t)=>{var n=Rut(),r=I(n,!0);z(e=>G(r,e),[()=>X(`loading_entries`,{values:{count:1}})]),W(e,n)},$$slots:{default:!0}})},d=e=>{},f=e=>{DO(e,{children:(e,t)=>{var n=zut(),r=F(n),i=P(r),a=e=>{var t=H();z(e=>G(t,e),[()=>X(`entry_not_found`)]),W(e,t)},o=e=>{var t=H();z(e=>G(t,e),[()=>BY(`collection`,{collection:B(y)})]),W(e,t)},s=e=>{var t=H();z(e=>G(t,e),[()=>X(`creating_entries_disabled_by_admin`)]),W(e,t)},c=e=>{var t=H();z(e=>G(t,e),[()=>X(`creating_entries_disabled_by_quota`,{values:{quota:B(le)}})]),W(e,t)};K(i,e=>{B(m)?e(a):B(se)?e(o,1):B(ce)?e(c,-1):e(s,2)}),O(r);var l=L(r,2);ll(P(l),{variant:`primary`,onclick:()=>{let e=B(b)??WA.current?.name;b$(e?`/collections/${e}`:`/collections`,{replaceState:!0,transitionType:`backwards`})},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`back_to_collection`)]),W(e,n)},$$slots:{default:!0}}),O(l),W(e,n)},$$slots:{default:!0}})},p=e=>{var t=Uut(),r=F(t);ist(r,{});var i=L(r,2);Zot(i,{});var a=L(i,2);No(P(a),()=>`${B(b)}|${B(S)}|${B(C)}`,e=>{var t=Hut(),r=F(t),i=P(r),a=e=>{var t=Fut(),r=F(t);mu(r,{onResize:({sizes:e})=>{if(a$.current&&o$.current){let[t,n]=e;a$.current={...a$.current,width:t},o$.current={...o$.current,width:n}}},children:(e,t)=>{var r=Vut(),i=F(r);hu(i,{get defaultSize(){return B(me)},get minSize(){return B(ge)},children:(e,t)=>{var r=But(),i=P(r);n(i,()=>`first`,()=>a$.current),O(r),lne(r,`clientWidth`,e=>N(l,e)),W(e,r)},$$slots:{default:!0}});var a=L(i,2);pu(a,{}),hu(L(a,2),{get defaultSize(){return B(he)},get minSize(){return B(ge)},children:(e,t)=>{n(e,()=>`second`,()=>o$.current)},$$slots:{default:!0}}),W(e,r)},$$slots:{default:!0}});var i=L(r,2);{let e=j(()=>X(`swap_panes`));ll(i,{class:`swap-button`,iconic:!0,size:`small`,variant:`tertiary`,get"aria-label"(){return B(e)},get style(){return`--gutter-position: ${B(l)??``}px`},onclick:be,children:(e,t)=>{Lc(e,{name:`swap_horiz`})},$$slots:{default:!0}})}W(e,t)},o=e=>{n(e,()=>`first`,()=>a$.current)},s=e=>{n(e,()=>`second`,()=>o$.current)},c=e=>{Ml(e,{flex:!0})};K(i,e=>{a$.current&&o$.current?e(a):a$.current?e(o,1):o$.current?e(s,2):e(c,-1)}),O(r);var u=L(r,2),d=e=>{Qst(e,{})},f=e=>{nct(e,{})};K(u,e=>{sW.isSmallScreen?e(d):e(f,-1)}),W(e,t)}),O(a),_o(`pointerdown`,a,xe),_o(`keydown`,a,xe),W(e,t)};K(c,e=>{a()?e(u):r().current===null?e(d,1):B(m)||B(g)&&B(ue)?e(f,2):e(p,-1)}),W(e,t)}),O(De),ms(De,e=>N(d,e),()=>B(d)),Pu(L(De,2),{get show(){return e$.current},set show(e){e$.current=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`entry_duplicated`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),z(e=>J(De,`aria-label`,e),[()=>X(`content_editor`)]),W(e,Ee),A()}vo([`pointerdown`,`keydown`]);var qut=V(`<div role="none"> </div>`),Jut=V(`<div role="alert" class="error svelte-1n3qj92"></div>`),Yut=V(`<div role="none"><span hidden=""> </span> <!> <!></div>`),Xut={hash:`svelte-1n3qj92`,code:`.cell.svelte-1n3qj92 {--sui-textbox-singleline-min-width: 10em;--sui-combobox-min-width: 10em;display:flex;flex-direction:column;gap:4px;border-radius:var(--sui-control-medium-border-radius);padding:2px;&.edited {background-color:var(--sui-secondary-background-color);}.sui:is(.text-input, .number-input, .combobox) {margin:0;}}.error.svelte-1n3qj92 {color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function Zut(e,t){let n=Co();k(t,!0),q(e,Xut);let r=Y(t,`edited`,3,!1),i=Y(t,`errors`,19,()=>[]),a=Y(t,`readonly`,3,!1),o=j(()=>t.fieldConfig.name),s=j(()=>Nr(t.fieldConfig.widget,`string`)),c=j(()=>ER({config:t.fieldConfig,locale:t.locale})),l=j(()=>k8[B(s)]),u=j(()=>!!i().length),d=j(()=>I1e({fieldConfig:t.fieldConfig,inline:!0}));var f=Yut();let p;var m=P(f),h=I(m,!0),g=L(m,2),_=()=>t.value,v=e=>t.onChange(e);{let e=j(()=>bM({fieldConfig:t.fieldConfig,locale:t.locale}));Wo(g,()=>B(l),(r,i)=>{i(r,{get locale(){return t.locale},get keyPath(){return B(o)},get typedKeyPath(){return B(o)},get fieldId(){return n},get fieldLabel(){return B(c)},get fieldConfig(){return B(d)},get currentValue(){return _()},set currentValue(e){v(e)},get required(){return B(e)},get readonly(){return a()},get invalid(){return B(u)}})})}var y=L(g,2),b=e=>{var t=Jut();Ro(t,21,i,Fo,(e,t)=>{var n=qut(),r=I(n,!0);z(()=>G(r,B(t))),W(e,n)}),O(t),z(()=>J(t,`id`,`${n}-error`)),W(e,t)};K(y,e=>{B(u)&&e(b)}),O(f),z(e=>{p=rs(f,1,`cell svelte-1n3qj92`,null,p,{edited:r(),invalid:B(u)}),J(f,`data-field-type`,B(s)),J(m,`id`,`${n}-label`),G(h,e)},[()=>X(`bulk_edit_cell`,{values:{field:B(c),entry:t.entryLabel}})]),W(e,f),A()}var Qut=(e,t)=>!!t.locales[e._i18n.defaultLocale]?.content&&!zk(e,t)&&!S4(t),$ut=(e,t,n)=>t.locales[e._i18n.defaultLocale]?.content[n],edt=({collection:e,entry:t,keyPath:n,edits:r})=>{let i=r[t.id];return i&&Object.hasOwn(i,n)?i[n]:$ut(e,t,n)},tdt=(e,t)=>{let n=e=>Nj(e)?``:e;return(0,Cr.default)(n(e),n(t))},ndt=({collection:e,entry:t,keyPath:n,value:r,edits:i})=>{let{[n]:a,...o}=i[t.id]??{},{[t.id]:s,...c}=i,l=$ut(e,t,n),u=tdt(r,E7(e.fields,n)?.widget===`boolean`?l??!1:l)?o:{...o,[n]:r};return Object.keys(u).length?{...c,[t.id]:u}:c},rdt=e=>Object.values(e).reduce((e,t)=>e+Object.keys(t).length,0),idt=({collection:e,entry:t,entryEdits:n})=>{let{defaultLocale:r}=e._i18n,i=Object.fromEntries(Object.entries(t.locales).filter(([,{content:e}])=>!!e).map(([e,{content:t}])=>[e,{...t}]));return Object.entries(n).forEach(([t,n])=>{let a=E7(e.fields,t),o=!!a&&WR(a),s=i[r][t];Object.entries(i).forEach(([e,i])=>{e===r?i[t]=n:(iR(a?.i18n)||o&&sje({fieldConfig:a,targetValue:i[t],previousValue:s,sourceLocale:r,targetLocale:e}))&&(i[t]=UR({fieldConfig:a,value:n,sourceLocale:r,targetLocale:e}))})}),F2({...b4({collection:e}),isNew:!1,currentValues:i}),{...t,locales:Object.fromEntries(Object.entries(t.locales).map(([e,t])=>[e,i[e]?{...t,content:i[e]}:{...t}]))}},adt=({collection:e,keyPath:t,fieldType:n,edits:r})=>{let i=new Map,a=BL(e.name).filter(t=>!zk(e,t)),o=new Set(a.flatMap(e=>CP(e))),s=mY(e.name).filter(t=>!zk(e,t)&&!CP(t,{includePrevious:!0}).some(e=>o.has(e)));return[...a,...s,...gY(e.name)].forEach(a=>{let o=j2(edt({collection:e,entry:a,keyPath:t,edits:r}),n);o!==void 0&&i.set(o,(i.get(o)??0)+1)}),i},odt=({collection:e,entries:t,edits:n})=>{let{defaultLocale:r}=e._i18n,i=b4({collection:e}),a=new Map,o={};return t.forEach(t=>{let s=n[t.id];if(!s)return;let c={...t.locales[r]?.content,...s};Object.entries(s).forEach(([s,l])=>{let u=E7(e.fields,s),d=z2({draft:{...i,originalEntry:t},locale:r,keyPath:s,value:l,valueMap:c,validities:{[r]:{}}});if(d&&M2({draft:i,fieldConfig:u,keyPath:s})){let t=u.widget??`string`,r=j2(l,t),i=mA(a,s,()=>adt({collection:e,keyPath:s,fieldType:t,edits:n})),o={...d};delete o.valid,o.duplicateError=r!==void 0&&i.get(r)>1,d=o2(o)}d&&!d.valid&&(o[t.id]={...o[t.id],[s]:n2({validity:d,fieldConfig:u})})})}),o},sdt=async({collection:e,entries:t,edits:n})=>{let r=new Map(BL(e.name).map(e=>[e.id,e])),i=t.filter(e=>!!n[e.id]&&r.has(e.id)).map(t=>p0({collection:e,entry:idt({collection:e,entry:r.get(t.id),entryEdits:n[t.id]})})),a=b4({collection:e}),o=T0();return{changes:(await Promise.all(i.map(t=>x4({collection:e,entry:t,draft:a,cacheDB:o})))).flat(),savingEntries:i}},cdt=async({collection:e,entries:t,edits:n})=>{if(LY({collection:e}))return 0;try{await U4()}catch(e){console.error(`Failed to check the repository for changes.`,e)}let{changes:r,savingEntries:i}=await sdt({collection:e,entries:t,edits:n});return gct({collection:e,changes:r,savingEntries:i})},ldt=e=>{let t=q7.current.map(({name:t,entries:n})=>({name:t,entries:n.filter(t=>Qut(e,t))})).filter(({entries:e})=>e.length);return z7.current=t.flatMap(({entries:e})=>e),t},udt=({collection:e,entry:t,keyPath:n,value:r})=>{L7.current=ndt({collection:e,entry:t,keyPath:n,value:r,edits:L7.current}),Object.keys(B7.current).length&&(B7.current=odt({collection:e,entries:z7.current,edits:L7.current}))},ddt=V(`<div role="columnheader" class="cell svelte-bf9j9b"> </div>`),fdt=V(`<div class="group-header svelte-bf9j9b" aria-hidden="true"> </div>`),pdt=V(`<bdi></bdi>`),mdt=V(`<div role="cell" class="cell svelte-bf9j9b"><!></div>`),hdt=V(`<div role="row" class="row svelte-bf9j9b"><div role="rowheader" class="cell title svelte-bf9j9b"><!></div> <!> <div role="none" class="cell filler svelte-bf9j9b"></div></div>`),gdt=V(`<div role="rowgroup" class="rowgroup svelte-bf9j9b"><!> <!></div>`),_dt=V(`<div role="none" class="wrapper svelte-bf9j9b"><div role="table" class="table svelte-bf9j9b"><div role="row" class="row header svelte-bf9j9b"><div role="columnheader" class="cell title svelte-bf9j9b"> </div> <!> <div role="none" class="cell filler svelte-bf9j9b"></div></div> <!></div></div>`),vdt={hash:`svelte-bf9j9b`,code:`.wrapper.svelte-bf9j9b {height:100%;overflow:auto;overscroll-behavior:contain;}.table.svelte-bf9j9b {display:grid;
|
||
/* The entry titles, a column sized to its control for each field, and a filler taking up the
|
||
rest of the width so the row borders run across the list */grid-template-columns:minmax(160px, 280px) repeat(var(--column-count), max-content) 1fr;width:max-content;min-width:100%;.spinner {grid-column:1 / -1;}}.rowgroup.svelte-bf9j9b,
|
||
.row.svelte-bf9j9b {display:contents;}.group-header.svelte-bf9j9b {grid-column:1 / -1;border-bottom:1px solid var(--sui-secondary-border-color);padding:4px 8px;font-weight:var(--sui-font-weight-bold);background-color:var(--sui-secondary-background-color);}.cell.svelte-bf9j9b {display:flex;align-items:center;border-bottom:1px solid var(--sui-secondary-border-color);padding:4px 8px;min-width:0;&.filler {padding:0;}
|
||
|
||
/* The entry titles stay in view as the table is scrolled sideways, like a frozen column */&.title {position:sticky;inset-inline-start:0;z-index:1;border-inline-end:1px solid var(--sui-secondary-border-color);background-color:var(--sui-primary-background-color);}}.header.svelte-bf9j9b .cell:where(.svelte-bf9j9b) {position:sticky;top:0;z-index:2;background-color:var(--sui-primary-background-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);&.title {z-index:3;}}`};function ydt(e,t){k(t,!0),q(e,vdt),Tz({current:void 0});let n=j(()=>Flt(t.collection)),r=j(()=>t.collection._i18n.defaultLocale),i=M([]),a=(e,n,r)=>{udt({collection:t.collection,entry:e,keyPath:n,value:r})},o=e=>Fc.current?$L(t.collection,e):``,s=j(()=>new Map(z7.current.map((e,t)=>[e.id,t+2])));vs(()=>{N(i,ldt(t.collection))});var c=_dt(),l=P(c);let u;var d=P(l);J(d,`aria-rowindex`,1);var f=P(d),p=I(f,!0);Ro(L(f,2),17,()=>B(n),e=>e.name,(e,t)=>{var n=ddt(),i=I(n,!0);z(e=>G(i,e),[()=>ER({config:B(t),locale:B(r)})]),W(e,n)}),$r(2),O(d),Ro(L(d,2),17,()=>B(i),({name:e,entries:t})=>e,(e,i)=>{let c=()=>B(i).name,l=()=>B(i).entries,u=j(()=>c()===`*`?void 0:gR(c()));var d=gdt(),f=P(d),p=e=>{var t=fdt(),n=I(t,!0);z(()=>G(n,B(u))),W(e,t)};K(f,e=>{B(u)&&e(p)}),gu(L(f,2),{get items(){return l()},itemKey:`id`,renderItem:(e,i=jr)=>{let c=j(()=>o(i()));var l=hdt(),u=P(l);Xc(P(u),{lines:2,children:(e,n)=>{var r=U();No(F(r),()=>Fc.current,e=>{var n=pdt();Ho(n,()=>$L(t.collection,i(),{useTemplate:!0,allowMarkdown:!0}),!0),O(n),W(e,n)}),W(e,r)},$$slots:{default:!0}}),O(u),Ro(L(u,2),17,()=>B(n),e=>e.name,(e,n)=>{let o=j(()=>B(n).name),s=j(()=>L7.current[i().id]);var l=mdt(),u=P(l);{let e=j(()=>edt({collection:t.collection,entry:i(),keyPath:B(o),edits:L7.current})),l=j(()=>!!B(s)&&Object.hasOwn(B(s),B(o))),d=j(()=>B7.current[i().id]?.[B(o)]);Zut(u,{get locale(){return B(r)},get fieldConfig(){return B(n)},get entryLabel(){return B(c)},get value(){return B(e)},get edited(){return B(l)},get errors(){return B(d)},get readonly(){return R7.current},onChange:e=>{a(i(),B(o),e)}})}O(l),W(e,l)}),$r(2),O(l),z(e=>J(l,`aria-rowindex`,e),[()=>B(s).get(i().id)]),W(e,l)},$$slots:{renderItem:!0}}),O(d),z(()=>J(d,`aria-label`,B(u))),W(e,d)}),O(l),O(c),z((e,t)=>{J(l,`aria-label`,e),J(l,`aria-rowcount`,z7.current.length+1),u=as(l,``,u,{"--column-count":B(n).length}),G(p,t)},[()=>X(`bulk_edit_table`),()=>X(`bulk_edit_entry`)]),W(e,c),A()}var bdt=V(`<bdi></bdi>`),xdt=V(`<!> <!>`,1),Sdt=V(`<div role="none" class="label svelte-b1f01"><!></div>`),Cdt=V(`<bdi> </bdi>`),wdt=V(`<!> <!> <!> <!>`,1),Tdt={hash:`svelte-b1f01`,code:`.label.svelte-b1f01 {.icon.home {opacity:0.5;font-size:20px;vertical-align:-4px;}}`};function Edt(e,t){k(t,!0),q(e,Tdt);let n=e=>{Zl(e,{class:`title`,children:(e,n)=>{var r=Sdt();Xc(P(r),{lines:2,children:(e,n)=>{var r=xdt(),i=F(r);No(i,()=>Fc.current,e=>{var n=bdt();Ho(n,()=>$L(t.collection,t.entry,{useTemplate:!0,allowMarkdown:!0}),!0),O(n),W(e,n)});var a=L(i,2),o=e=>{{let n=j(()=>Lk(t.collection)?.icon);Lc(e,{get name(){return B(n)},class:`home`})}},s=j(()=>zk(t.collection,t.entry));K(a,e=>{B(s)&&e(o)}),W(e,r)},$$slots:{default:!0}}),O(r),W(e,r)},$$slots:{default:!0}})},r=Y(t,`showCheckbox`,3,!1),i=Y(t,`onSelect`,3,void 0),a=Y(t,`columns`,19,()=>[]),o=j(()=>t.entry.workflow),s=j(()=>Fc.current?$L(t.collection,t.entry):``);var c=wdt(),l=F(c),u=e=>{Zl(e,{class:`checkbox`,children:(e,n)=>{{let n=j(()=>X(`select_item`,{values:{name:B(s)}})),r=j(()=>gOe.current.has(t.entry.id));jl(e,{tabindex:`-1`,get ariaLabel(){return B(n)},get checked(){return B(r)},onChange:({detail:{checked:e}})=>{i()?.(e)}})}},$$slots:{default:!0}})};K(l,e=>{r()&&!(sW.isSmallScreen||sW.isMediumScreen)&&e(u)});var d=L(l,2),f=e=>{Zl(e,{class:`image`,children:(e,n)=>{{let n=j(()=>t.viewType===`grid`?`tile`:`icon`);V5(e,{get collection(){return t.collection},get entry(){return t.entry},get variant(){return B(n)}})}},$$slots:{default:!0}})};K(d,e=>{t.collection._thumbnailFieldNames.length&&e(f)});var p=L(d,2),m=e=>{var r=U();Ro(F(r),17,a,e=>e.key,(e,r)=>{var i=U(),a=F(i),o=e=>{n(e)},s=e=>{let n=j(()=>WYe({collection:t.collection,entry:t.entry,column:B(r)}));Zl(e,{class:`column`,get"data-key"(){return B(r).key},children:(e,t)=>{var r=U(),i=F(r),a=e=>{var t=U(),r=F(t),i=e=>{{let t=j(()=>X(`boolean.true`));Lc(e,{name:`check`,role:`img`,get"aria-label"(){return B(t)}})}};K(r,e=>{B(n).value&&e(i)}),W(e,t)},o=e=>{var t=Sdt();Xc(P(t),{children:(e,t)=>{var r=Cdt(),i=I(r,!0);z(()=>G(i,B(n).value)),W(e,r)},$$slots:{default:!0}}),O(t),W(e,t)};K(i,e=>{B(n).type===`boolean`?e(a):e(o,-1)}),W(e,r)},$$slots:{default:!0}})};K(a,e=>{B(r).key===`_summary`?e(o):e(s,-1)}),W(e,i)}),W(e,r)},h=e=>{n(e)};K(p,e=>{t.viewType===`table`?e(m):e(h,-1)}),Zl(L(p,2),{class:`status`,children:(e,n)=>{var r=U(),i=F(r),a=e=>{{let n=j(()=>tY(t.entry,t.collection));T7(e,{get status(){return B(n)}})}};K(i,e=>{B(o)&&e(a)}),W(e,r)},$$slots:{default:!0}}),W(e,c),A()}function Ddt(e,t){k(t,!0);let n=Y(t,`columns`,19,()=>[]),r=j(()=>{let e=nut.current.get(t.entry.id);if(e!==void 0)return t.viewType===`table`?e+2:e+1}),i=j(()=>Fc.current?$L(t.collection,t.entry):``),a=e=>{LL.current=Eq(LL.current,t.entry,e)};$l(e,{get"aria-rowindex"(){return B(r)},get"aria-label"(){return B(i)},onChange:e=>{a(e.detail.selected)},onclick:()=>{b$(oP(`/collections/${t.collection.name}/entries/${t.entry.subPath}`),{transitionType:`forwards`})},children:(e,r)=>{{let r=j(()=>!NB.current);Edt(e,{get collection(){return t.collection},get entry(){return t.entry},get viewType(){return t.viewType},get columns(){return n()},get showCheckbox(){return B(r)},onSelect:a})}},$$slots:{default:!0}}),A()}var Odt=V(`<!> <!>`,1);function kdt(e,t){k(t,!0);let n=Y(t,`canMoveUp`,3,!1),r=Y(t,`canMoveDown`,3,!1),i=Y(t,`onMoveUp`,3,void 0),a=Y(t,`onMoveDown`,3,void 0),o=async(e,t,n)=>{e.stopPropagation();let r=e.currentTarget.closest(`[role="row"]`);n?.(),await ao(),EZe({item:r,action:t})};var s=Odt(),c=F(s);Edt(c,{get collection(){return t.collection},get entry(){return t.entry},get viewType(){return t.viewType}}),Zl(L(c,2),{class:`reorder-actions`,children:(e,t)=>{var s=Odt(),c=F(s);{let e=e=>{Lc(e,{name:`arrow_upward`})},t=j(()=>!n()),r=j(()=>X(`move_up`));ll(c,{variant:`ghost`,iconic:!0,get disabled(){return B(t)},"data-action":`move-up`,get"aria-label"(){return B(r)},onclick:e=>o(e,`move-up`,i()),startIcon:e,$$slots:{startIcon:!0}})}var l=L(c,2);{let e=e=>{Lc(e,{name:`arrow_downward`})},t=j(()=>!r()),n=j(()=>X(`move_down`));ll(l,{variant:`ghost`,iconic:!0,get disabled(){return B(t)},"data-action":`move-down`,get"aria-label"(){return B(n)},onclick:e=>o(e,`move-down`,a()),startIcon:e,$$slots:{startIcon:!0}})}W(e,s)},$$slots:{default:!0}}),W(e,s),A()}var Adt=V(`<div role="row" tabindex="0" aria-selected="false" draggable="true"><!></div>`),jdt=V(`<div role="none" class="wrapper svelte-1txp9gj"></div>`),Mdt={hash:`svelte-1txp9gj`,code:`.wrapper.svelte-1txp9gj {
|
||
/* The rows aren’t \`<GridRow>\` components, so they don’t get its scoped layout rules */.grid-row {display:table-row;height:var(--sui-primary-row-height);}
|
||
|
||
/* The dragged row is left as a faint placeholder marking the gap it would drop into. The
|
||
pointer already carries the browser’s own drag image of it, so showing it twice at full
|
||
strength would just be confusing. */.grid-row.drag-source {opacity:0.25;cursor:grabbing;}.grid-row[draggable='true']:not(.drag-source) {cursor:grab;}}`};function Ndt(e,t){k(t,!0),q(e,Mdt);let n=M({}),r=M(void 0),i=M(void 0),a=(e=B(n))=>{P7.current=q7.current.flatMap(({name:t,entries:n})=>e[t]??n)},o=(e,t)=>B(n)[e]??t,s=j(()=>new Map(q7.current.flatMap(({name:e,entries:t})=>o(e,t)).map((e,t)=>[e.id,t]))),c=e=>B(s).get(e.id)+1,l=(e,t,r)=>{if(t===r)return;let i=B(n)[e]??[];N(n,{...B(n),[e]:i6(i,t,r)}),F7.current=!0,a()},u=e=>{if(B(r)){let{name:t,entries:i}=B(r);e?(B(n)[t]??[]).some((e,t)=>e.id!==i[t]?.id)&&(F7.current=!0,a()):N(n,{...B(n),[t]:i})}N(r,void 0),N(i,void 0)};vs(()=>{let e=Object.fromEntries(q7.current.map(({name:e,entries:n})=>[e,WL(n.filter(e=>!zk(t.collection,e)),t.collection)]));N(n,e),a(e)});var d=jdt();Ro(d,21,()=>q7.current,({name:e,entries:t})=>e,(e,a)=>{let s=()=>B(a).name,d=()=>B(a).entries;var f=U();Mo(F(f),Zc,null,e=>{{let a=j(()=>s()===`*`?void 0:gR(s()));Yl(e,{get label(){return B(a)},children:(e,a)=>{let f=j(()=>o(s(),d()));var p=U();Ro(F(p),27,()=>B(f),e=>e.id,(e,a,o)=>{var d=Adt();let p;var m=P(d);{let e=j(()=>B(o)>0),n=j(()=>B(o)<B(f).length-1);kdt(m,{get collection(){return t.collection},get entry(){return B(a)},get viewType(){return t.viewType},get canMoveUp(){return B(e)},get canMoveDown(){return B(n)},onMoveUp:()=>{l(s(),B(o),B(o)-1)},onMoveDown:()=>{l(s(),B(o),B(o)+1)}})}O(d),z(e=>{p=rs(d,1,`sui grid-row`,null,p,{"drag-source":B(i)?.id===B(a).id}),J(d,`aria-rowindex`,e)},[()=>c(B(a))]),go(`dragstart`,d,e=>{N(r,{name:s(),entries:[...B(f)]}),N(i,B(a)),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`)}),go(`dragover`,d,e=>{let t=s()===B(r)?.name;if(t){e.preventDefault();let t=B(n)[s()]??[],r=t.findIndex(({id:e})=>e===B(i)?.id),a=bZe({dragIndex:r,dropIndex:yZe({index:B(o),clientY:e.clientY,rect:e.currentTarget.getBoundingClientRect()})});a!==void 0&&N(n,{...B(n),[s()]:i6(t,r,a)})}e.dataTransfer&&(e.dataTransfer.dropEffect=t?`move`:`none`)}),go(`drop`,d,e=>{e.preventDefault(),u(s()===B(r)?.name)}),go(`dragend`,d,()=>{u(!1)}),Xo(d,()=>_u,()=>({duration:200})),W(e,d)}),W(e,p)},$$slots:{default:!0}})}}),W(e,f)}),O(d),W(e,d),A()}var Pdt=V(`<!> <!> <!> <!>`,1);function Fdt(e,t){k(t,!0);let n=j(()=>jR.current.map(({key:e})=>e));Kae(e,{children:(e,r)=>{$l(e,{"aria-rowindex":1,children:(e,r)=>{var i=Pdt(),a=F(i),o=e=>{Ql(e,{class:`checkbox`})};K(a,e=>{t.showCheckbox&&e(o)});var s=L(a,2),c=e=>{Ql(e,{class:`image`})};K(s,e=>{t.collection._thumbnailFieldNames.length&&e(c)});var l=L(s,2);Ro(l,17,()=>t.columns,e=>e.key,(e,r)=>{let i=j(()=>GYe({collection:t.collection,column:B(r),sortKeys:B(n)})),a=j(()=>t3.current);var o=U(),s=F(o),c=e=>{{let t=j(()=>B(r).key===`_summary`?`title`:`column`),n=j(()=>B(a).sort?.key===B(i)?B(a).sort.order:`none`);Ql(e,{get class(){return B(t)},get sortOrder(){return B(n)},onSort:e=>{t3.current={...t3.current,sort:{key:B(i),order:e.detail.sortOrder}}},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(r).label)),W(e,n)},$$slots:{default:!0}})}},l=e=>{{let t=j(()=>B(r).key===`_summary`?`title`:`column`);Ql(e,{get class(){return B(t)},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(r).label)),W(e,n)},$$slots:{default:!0}})}};K(s,e=>{B(i)?e(c):e(l,-1)}),W(e,o)}),Ql(L(l,2),{class:`status`}),W(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}}),A()}var Idt=V(`<!> <!>`,1);function Ldt(e,t){k(t,!0);let n=e=>{ru(e,{children:(e,t)=>{var n=Idt(),r=F(n);{let e=j(()=>X(`entry`));iu(r,{get label(){return B(e)},onclick:()=>c()})}iu(L(r,2),{get label(){return B(o)},onclick:()=>c(!0)}),W(e,n)},$$slots:{default:!0}})},r=Y(t,`label`,3,void 0),i=Y(t,`keyShortcuts`,3,void 0),a=j(()=>tj.current&&WA.current?TOe(WA.current):!1),o=j(()=>Fc.current&&WA.current?Lk(WA.current)?.label:``),s=j(()=>B(a)?Al:ll),c=(e=!1)=>{let n=!e&&WA.current&&oA(WA.current)&&rA.current?`?path=${lP(rA.current)}`:``;b$(`/collections/${t.collectionName}/new${n}`,{state:{index:e},transitionType:`forwards`})};var l=U(),u=F(l);{let e=e=>{Lc(e,{name:`edit`})},t=j(()=>!r()),o=j(()=>X(`create_new_entry`)),l=j(()=>B(a)?n:void 0);Wo(u,()=>B(s),(n,a)=>{a(n,{variant:`primary`,get iconic(){return B(t)},get disabled(){return K7.current.creationDisabled},get label(){return r()},get"aria-label"(){return B(o)},get keyShortcuts(){return i()},onclick:()=>c(),get popup(){return B(l)},startIcon:e,$$slots:{startIcon:!0}})})}W(e,l),A()}var Rdt=V(`<!> <!> <!>`,1),zdt=V(`<span role="none"> </span>`),Bdt=V(`<span role="none"> </span> <!>`,1);function Vdt(e,t){k(t,!0);let n=(e,t=jr,n=jr,r=jr)=>{let o=j(()=>t()._i18n);{let s=j(()=>n()===`*`?G7.current.length?X(`workflow.published_entries`):void 0:gR(n())),c=j(()=>n()!==`*`),l=j(()=>!yR(t3.current,n()));Yl(e,{get label(){return B(s)},get collapsible(){return B(c)},get expanded(){return B(l)},onChange:({detail:{expanded:e}})=>{t3.current=Bke(t3.current,n(),!e)},children:(e,n)=>{{let n=(e,n=jr)=>{Ddt(e,{get collection(){return t()},get entry(){return n()},get viewType(){return B(i)},get columns(){return B(a)}})},s=j(()=>r().filter(e=>!!xP(e,{defaultLocale:B(o).defaultLocale})?.content));gu(e,{get items(){return B(s)},itemKey:`id`,renderItem:n,$$slots:{renderItem:!0}})}},$$slots:{default:!0}})}},r=j(()=>WA.current),i=j(()=>KYe({type:t3.current.type,types:n3(B(r)),isLargeScreen:sW.isLargeScreen,reordering:N7.current})),a=j(()=>B(i)===`table`&&B(r)?HYe({collection:B(r),sortKeys:jR.current.map(({key:e})=>e)}):[]),o=j(()=>q7.current.some(({entries:e})=>e.length)),s=j(()=>qYe(t3.current)),c=()=>co(()=>B(i))===`table`?void 0:Zc();{let t=j(()=>X(`entry_list`));w5(e,{get"aria-label"(){return B(t)},children:(e,t)=>{var l=U(),u=F(l),d=e=>{var t=U(),l=F(t),u=e=>{ydt(e,{get collection(){return B(r)}})},d=e=>{{let t=j(()=>X(`entries`)),o=j(()=>W7.current.length+G7.current.length+ +(B(i)===`table`));T5(e,{get viewType(){return B(i)},id:`entry-list`,get"aria-label"(){return B(t)},get scrollKey(){return B(s)},get"aria-rowcount"(){return B(o)},children:(e,t)=>{var o=U(),l=F(o),u=e=>{Ndt(e,{get collection(){return B(r)},get viewType(){return B(i)}})},d=e=>{var t=Rdt(),o=F(t),l=e=>{{let t=j(()=>!NB.current);Fdt(e,{get collection(){return B(r)},get columns(){return B(a)},get showCheckbox(){return B(t)}})}};K(o,e=>{B(i)===`table`&&e(l)});var u=L(o,2),d=e=>{{let t=j(()=>X(`workflow.unpublished_entries`));Yl(e,{get label(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>G7.current,e=>e.id,(e,t)=>{Ddt(e,{get collection(){return B(r)},get entry(){return B(t)},get viewType(){return B(i)},get columns(){return B(a)}})}),W(e,n)},$$slots:{default:!0}})}};K(u,e=>{G7.current.length&&e(d)}),No(L(u,2),()=>B(s),e=>{var t=U();Ro(F(t),17,()=>q7.current,({name:e,entries:t})=>e,(e,t)=>{let i=()=>B(t).name,a=()=>B(t).entries;var o=U();Mo(F(o),c,null,e=>{n(e,()=>B(r),i,a)}),W(e,o)}),W(e,t)}),W(e,t)};K(l,e=>{N7.current?e(u):e(d,-1)}),W(e,o)},$$slots:{default:!0}})}},f=e=>{DO(e,{children:(e,t)=>{var n=zdt(),r=I(n,!0);z(e=>G(r,e),[()=>X(`no_entries_found`)]),W(e,n)},$$slots:{default:!0}})},p=e=>{DO(e,{children:(e,t)=>{var n=Bdt(),i=F(n),a=I(i,!0),o=L(i,2);{let e=j(()=>X(`create_new_entry`));Ldt(o,{get collectionName(){return B(r).name},get label(){return B(e)}})}z(e=>G(a,e),[()=>X(`no_entries_created`)]),W(e,n)},$$slots:{default:!0}})};K(l,e=>{I7.current?e(u):B(o)||G7.current.length?e(d,1):W7.current.length?e(f,2):e(p,-1)}),W(e,t)},f=e=>{DO(e,{children:(e,t)=>{var n=zdt(),r=I(n,!0);z(e=>G(r,e),[()=>X(`collection_not_found`)]),W(e,n)},$$slots:{default:!0}})};K(u,e=>{B(r)?e(d):e(f,-1)}),W(e,l)},$$slots:{default:!0}})}A()}var Hdt=V(`<bdi></bdi>`),Udt=V(`<div role="none" class="label svelte-1nfjp1"><!> <!></div>`),Wdt=V(`<!> <!>`,1),Gdt=V(`<span role="none"> </span>`),Kdt={hash:`svelte-1nfjp1`,code:`.label.svelte-1nfjp1 {display:flex;align-items:center;gap:16px;.icon {display:flex;align-items:center;justify-content:center;border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size);height:var(--icon-size);background-color:var(--sui-secondary-background-color);}}`};function qdt(e,t){k(t,!0),q(e,Kdt);let n=j(()=>WA.current?.files.filter(lk)??[]),r=j(()=>Object.fromEntries(lY.current.filter(({workflow:e})=>e.collectionName===WA.current?.name).map(e=>[e.workflow.fileName,tY(e,WA.current)])));{let t=j(()=>X(`file_list`));w5(e,{get"aria-label"(){return B(t)},children:(e,t)=>{var i=U(),a=F(i),o=e=>{{let t=j(()=>X(`files`));T5(e,{viewType:`list`,get"aria-label"(){return B(t)},get"aria-rowcount"(){return B(n).length},children:(e,t)=>{gu(e,{get items(){return B(n)},itemKey:`name`,renderItem:(e,t)=>{let n=()=>(t?.()).name,i=()=>(t?.()).label,a=()=>(t?.()).icon,o=j(()=>cke(WA.current,n()));$l(e,{onclick:()=>{b$(oP(`/collections/${WA.current?.name}/entries/${n()}`),{transitionType:`forwards`})},children:(e,t)=>{var s=Wdt(),c=F(s);Zl(c,{class:`title`,children:(e,t)=>{var r=Udt(),s=P(r),c=e=>{Lc(e,{get name(){return a()}})};K(s,e=>{a()&&e(c)}),Xc(L(s,2),{lines:2,children:(e,t)=>{var r=U(),a=F(r),s=e=>{var t=Hdt();Ho(t,()=>B(o),!0),O(t),W(e,t)},c=e=>{var t=H();z(()=>G(t,i()||n())),W(e,t)};K(a,e=>{B(o)===void 0?e(c,-1):e(s)}),W(e,r)},$$slots:{default:!0}}),O(r),W(e,r)},$$slots:{default:!0}}),Zl(L(c,2),{class:`status`,children:(e,t)=>{var i=U(),a=F(i),o=e=>{T7(e,{get status(){return B(r)[n()]}})};K(a,e=>{B(r)[n()]&&e(o)}),W(e,i)},$$slots:{default:!0}}),W(e,s)},$$slots:{default:!0}})},$$slots:{renderItem:!0}})},$$slots:{default:!0}})}},s=e=>{DO(e,{children:(e,t)=>{var n=Gdt(),r=I(n,!0);z(e=>G(r,e),[()=>X(`no_files_in_collection`)]),W(e,n)},$$slots:{default:!0}})};K(a,e=>{B(n)?.length?e(o):e(s,-1)}),W(e,i)},$$slots:{default:!0}})}A()}function Jdt(e,t){k(t,!0);let n=e=>{var n=U();Ro(F(n),17,()=>B(a),e=>e.path,(e,n)=>{Jdt(e,{get node(){return B(n)},get collectionName(){return t.collectionName}})}),W(e,n)},r=j(()=>t.node.path),i=j(()=>t.node.label),a=j(()=>t.node.children),o=j(()=>WA.current?.name===t.collectionName),s=j(()=>B(o)&&rA.current===B(r)),c=j(()=>B(o)&&fA(B(r),rA.current)),l=M(!1);R(()=>{(B(s)||B(c))&&co(()=>{N(l,!0)})});{let o=e=>{Lc(e,{name:`folder`})},c=j(()=>B(a).length?n:void 0);TO(e,{get label(){return B(i)},get selected(){return B(s)},get items(){return B(c)},onSelect:()=>{b$(oP(`/collections/${t.collectionName}/filter/${B(r)}`),{transitionType:`forwards`})},get expanded(){return B(l)},set expanded(e){N(l,e,!0)},startIcon:o,$$slots:{startIcon:!0}})}A()}var Ydt=V(`<span class="count"> </span>`);function Xdt(e,t){k(t,!0);let n=e=>{var t=U();Ro(F(t),17,()=>B(d),e=>e.path,(e,t)=>{Jdt(e,{get node(){return B(t)},get collectionName(){return B(i)}})}),W(e,t)},r=Y(t,`isSearchPage`,3,!1),i=j(()=>t.collection.name),a=j(()=>t.collection.label),o=j(()=>t.collection.icon),s=j(()=>WA.current?.name===B(i)),c=j(()=>sW.isSmallScreen||r()?!1:B(s)&&!rA.current),l=j(()=>`files`in t.collection?[]:Y2(t.collection)),u=j(()=>`files`in t.collection?t.collection.files.length:wOe(B(i),B(l))),d=j(()=>C4e({collection:YA(B(i)),entries:B(l)})),f=M(!1);R(()=>{B(s)&&co(()=>{N(f,!0)})});{let t=e=>{{let t=j(()=>B(o)||`bookmark_manager`);Lc(e,{get name(){return B(t)}})}},r=e=>{var t=Ydt(),n=I(t,!0);z((e,r)=>{J(t,`aria-label`,`(${e??``})`),G(n,r)},[()=>X(`x_entries`,{values:{count:B(u)}}),()=>g5.current.format(B(u))]),W(e,t)},s=j(()=>B(a)||B(i)),l=j(()=>B(d).length?n:void 0);TO(e,{get label(){return B(s)},get selected(){return B(c)},get items(){return B(l)},onSelect:()=>{b$(`/collections/${B(i)}`,{transitionType:`forwards`})},get expanded(){return B(f)},set expanded(e){N(f,e,!0)},startIcon:t,endIcon:r,$$slots:{startIcon:!0,endIcon:!0}})}A()}var Zdt=V(`<div class="wrapper svelte-ozneys"><!></div>`),Qdt={hash:`svelte-ozneys`,code:`.wrapper.svelte-ozneys {display:contents;}`};function $dt(e,t){k(t,!0),q(e,Qdt);let n=j(()=>t.file.name),r=j(()=>t.file.icon),i=j(()=>t.file.label||B(n)),a=M(!1),o=M(void 0);var s=Zdt();TO(P(s),{get label(){return B(i)},onSelect:()=>{u$.current=X(`singleton_selected_announcement`,{values:{file:B(i)}})},onclick:()=>{b$(oP(`/collections/_singletons/entries/${B(n)}`),{transitionType:`forwards`}),N(a,!1),B(o)?.querySelector(`[role="treeitem"]`)?.classList.remove(`focused`)},get selected(){return B(a)},set selected(e){N(a,e,!0)},startIcon:e=>{{let t=j(()=>B(r)||`edit_document`);Lc(e,{get name(){return B(t)}})}},$$slots:{startIcon:!0}}),O(s),ms(s,e=>N(o,e),()=>B(o)),W(e,s),A()}var eft=KO(()=>{let{published:e,time:t}=eK.current,{current:n}=$G,r=n?QG.current[n]:void 0;return!r||r.checkedTime<=t?e:r.state===`ready`||r.state===`pending`||r.state!==`error`&&e}),tft=KO(()=>(!!CW.deployHookURL||typeof XJ.current?.triggerDeployment==`function`)&&!eft.current),nft=async()=>{let{deployHookURL:e,deployHookAuthHeader:t}=CW;if(e&&!iW(e))throw Error(`Deploy hook URL must use HTTPS or localhost`);let{ok:n,status:r}=e?await fetch(e,{method:`POST`,mode:t?`cors`:`no-cors`,headers:t?{Authorization:t}:{}}):await XJ.current?.triggerDeployment?.()??{};if(!n&&(t||r!==0))throw Error(`Webhook returned ${r} error`);nK(!0)},rft=V(`<!> <!>`,1);function ift(e,t){k(t,!0);let n=M(`info`),r=M(!1),i=async()=>{N(n,`info`),N(r,!0);try{await nft()}catch(e){N(n,`error`),N(r,!0),console.error(e)}};var a=U(),o=F(a),s=e=>{var t=rft(),a=F(t);{let e=j(()=>sW.isSmallScreen?`small`:`medium`),t=j(()=>X(`publish_changes`)),n=j(()=>!tft.current);ll(a,{variant:`secondary`,get size(){return B(e)},get label(){return B(t)},get disabled(){return B(n)},onclick:()=>i()})}Pu(L(a,2),{get show(){return B(r)},set show(e){N(r,e,!0)},children:(e,t)=>{Vc(e,{get status(){return B(n)},children:(e,t)=>{$r();var r=H();z(e=>G(r,e),[()=>X(B(n)===`error`?`publishing_changes_failed`:`publishing_changes`)]),W(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,t)};K(o,e=>{G8.current&&e(s)}),W(e,a),A()}var aft=V(`<header><h2> </h2> <!></header> <!>`,1),oft=V(`<span class="count"> </span>`),sft=V(`<!> <!>`,1),cft=V(`<nav class="primary-sidebar"><!> <!></nav>`);function lft(e,t){k(t,!0);let n=Y(t,`isSearchPage`,3,!1),r=j(()=>$O.current?.collections?.filter(({hide:e})=>!e)??[]),i=j(()=>$O.current?.singletons??[]),a=j(()=>B(r).some(e=>!(`divider`in e)&&aA(e)));var o=cft(),s=P(o),c=e=>{var t=aft(),n=F(t),r=P(n),i=I(r,!0);ift(L(r,2),{}),O(n),I5(L(n,2),{onclick:e=>{e.preventDefault(),b$(`/search`)}}),z(e=>G(i,e),[()=>X(`contents`)]),W(e,t)};K(s,e=>{sW.isSmallScreen&&e(c)});var l=L(s,2);{let e=j(()=>B(a)?void 0:`flat`),t=j(()=>X(`collection_list`)),o=j(()=>n()?void 0:`collection-container`);Bxe(l,{get class(){return B(e)},get ariaLabel(){return B(t)},get"aria-controls"(){return B(o)},expandOnSelect:!1,children:(e,t)=>{var a=sft(),o=F(a),s=e=>{{let t=j(()=>X(`collections`));tu(e,{get label(){return B(t)},children:(e,t)=>{var i=U();Ro(F(i),19,()=>B(r),(e,t)=>e.name??t,(e,t)=>{var r=U();Mo(F(r),Zc,null,e=>{var r=U(),i=F(r),a=e=>{Xdt(e,{get collection(){return B(t)},get isSearchPage(){return n()}})},o=e=>{ql(e,{})};K(i,e=>{`divider`in B(t)?B(t).divider&&e(o,1):e(a)}),W(e,r)}),W(e,r)}),W(e,i)},$$slots:{default:!0}})}};K(o,e=>{B(r).length&&e(s)});var c=L(o,2),l=e=>{var t=U(),n=F(t),a=e=>{{let t=j(()=>X(`files`));tu(e,{get label(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),19,()=>B(i),(e,t)=>e.name??t,(e,t)=>{var n=U();Mo(F(n),Zc,null,e=>{var n=U(),r=F(n),i=e=>{$dt(e,{get file(){return B(t)}})},a=e=>{ql(e,{})};K(r,e=>{`divider`in B(t)?B(t).divider&&e(a,1):e(i)}),W(e,n)}),W(e,n)}),W(e,n)},$$slots:{default:!0}})}},o=e=>{let t=j(()=>B(i).filter(e=>!(`divider`in e)).length);{let n=j(()=>X(`collections`));tu(e,{get label(){return B(n)},children:(e,n)=>{{let n=e=>{Lc(e,{name:`bookmark_manager`})},r=e=>{var n=oft(),r=I(n,!0);z((e,t)=>{J(n,`aria-label`,`(${e??``})`),G(r,t)},[()=>X(`x_entries`,{values:{count:B(t)}}),()=>g5.current.format(B(t))]),W(e,n)},i=j(()=>X(`files`)),a=j(()=>WA.current?.name===`_singletons`);TO(e,{get label(){return B(i)},get selected(){return B(a)},onSelect:()=>{b$(`/collections/_singletons`,{transitionType:`forwards`})},startIcon:n,endIcon:r,$$slots:{startIcon:!0,endIcon:!0}})}},$$slots:{default:!0}})}};K(n,e=>{sW.isSmallScreen||B(r).length?e(a):e(o,-1)}),W(e,t)};K(c,e=>{B(i).length&&e(l)}),W(e,a)},$$slots:{default:!0}})}O(o),z(e=>J(o,`aria-label`,e),[()=>X(`contents`)]),W(e,o),A()}var uft=V(`<!> <!> <!> <!> <!> <!>`,1);function dft(e,t){k(t,!0);let n=Y(t,`canSave`,3,!0),r=Y(t,`saving`,15,!1),i=Y(t,`validate`,3,void 0),a=Y(t,`invalidMessage`,3,``),o=Y(t,`discardMessage`,3,``),s=Y(t,`onExit`,3,void 0),c=Y(t,`leading`,3,void 0),l=M(!1),u=M(!1),d=M(!1),f=M(void 0),p=M(void 0),m=()=>{let e=B(f);(e.disabled?B(p):e).focus()},h=()=>{t.exitMode(),s()?.()},g=async()=>{if(i()&&!i()()){N(u,!0);return}r(!0);let{ok:e,cancelled:n}=await F4(t.commit);r(!1),e?h():(n||N(d,!0),await ao(),B(f).focus())};var _={focus:m},v=uft(),y=F(v);Uo(y,()=>c()??jr);var b=L(y,2);{let e=j(()=>r()||!n());ll(b,{variant:`primary`,get label(){return t.saveLabel},get"aria-label"(){return t.saveAriaLabel},get disabled(){return B(e)},onclick:()=>{g()},get element(){return B(f)},set element(e){N(f,e,!0)}})}var x=L(b,2);{let e=j(()=>X(`cancel`));ll(x,{variant:`secondary`,get label(){return B(e)},get"aria-label"(){return t.cancelAriaLabel},get disabled(){return r()},onclick:()=>{o()&&n()?N(l,!0):h()},get element(){return B(p)},set element(e){N(p,e,!0)}})}var S=L(x,2),C=e=>{{let n=j(()=>X(`discard`));Il(e,{get title(){return t.cancelAriaLabel},get okLabel(){return B(n)},onOk:()=>{h()},get open(){return B(l)},set open(e){N(l,e,!0)},children:(e,t)=>{$r();var n=H();z(()=>G(n,o())),W(e,n)},$$slots:{default:!0}})}};K(S,e=>{o()&&e(C)});var w=L(S,2),T=e=>{Pu(e,{get show(){return B(u)},set show(e){N(u,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(()=>G(n,a())),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};return K(w,e=>{a()&&e(T)}),Pu(L(w,2),{get show(){return B(d)},set show(e){N(d,e,!0)},children:(e,n)=>{Vc(e,{status:`error`,children:(e,n)=>{$r();var r=H();z(()=>G(r,t.savingFailedMessage)),W(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,v),A(_)}var fft=V(`<div role="status" class="count svelte-a3wcu0"> </div> <!>`,1),pft={hash:`svelte-a3wcu0`,code:`.count.svelte-a3wcu0 {font-size:var(--sui-font-size-small);opacity:0.8;white-space:nowrap;}`};function mft(e,t){k(t,!0),q(e,pft);let n=Y(t,`onExit`,3,void 0),r=M(void 0),i=j(()=>rdt(L7.current)),a=()=>{B(r).focus()},o=()=>({collection:WA.current,entries:z7.current,edits:L7.current});var s={focus:a};{let t=e=>{var t=fft(),n=F(t),r=I(n,!0);Ml(L(n,2),{}),z(e=>G(r,e),[()=>X(`bulk_edit_count`,{values:{count:B(i)}})]),W(e,t)},a=j(()=>X(`save`)),s=j(()=>X(`save_bulk_edits`)),c=j(()=>X(`cancel_bulk_edits`)),l=j(()=>X(`saving_bulk_edits_failed`)),u=j(()=>X(`bulk_edit_invalid`)),d=j(()=>X(`discard_bulk_edits_confirm`)),f=j(()=>!!B(i));ms(dft(e,{get saveLabel(){return B(a)},get saveAriaLabel(){return B(s)},get cancelAriaLabel(){return B(c)},get savingFailedMessage(){return B(l)},get invalidMessage(){return B(u)},get discardMessage(){return B(d)},get canSave(){return B(f)},validate:()=>{let e=odt(o());return!Object.keys(e).length||(B7.current=e,!1)},commit:()=>cdt(o()),exitMode:()=>X7(!1),get onExit(){return n()},get saving(){return R7.current},set saving(e){R7.current=e},leading:t,$$slots:{leading:!0}}),e=>N(r,e,!0),()=>B(r))}return A(s)}function hft(e,t){k(t,!0);let n=Y(t,`onExit`,3,void 0),r=M(void 0);var i={focus:()=>{B(r).focus()}};{let t=j(()=>X(`done`)),i=j(()=>X(`done_reordering_entries`)),a=j(()=>X(`cancel_reordering_entries`)),o=j(()=>X(`saving_reorder_failed`));ms(dft(e,{get saveLabel(){return B(t)},get saveAriaLabel(){return B(i)},get cancelAriaLabel(){return B(a)},get savingFailedMessage(){return B(o)},get canSave(){return F7.current},commit:()=>bct(WA.current,P7.current),exitMode:()=>Y7(!1),get onExit(){return n()}}),e=>N(r,e,!0),()=>B(r))}return A(i)}var gft=V(` <!>`,1),_ft=V(`<!> <!>`,1);function vft(e,t){k(t,!0);let n=Y(t,`open`,15,!1),r=M(!1),i=M(``),a=j(()=>LL.current.filter(e=>`workflow`in e)),o=j(()=>LL.current.filter(e=>!(`workflow`in e))),s=j(()=>{let e=WA.current;return n()&&e&&B(o).length?h7({collection:e,entries:B(o)}):fct}),c=j(()=>{let e=f4({entries:B(o),collectionName:WA.current?.name});return B(o).map((t,n)=>({entry:t,assets:e[n]}))}),l=j(()=>B(c).flatMap(({assets:e})=>e)),u=async()=>{let e=WA.current,{ok:t,cancelled:n,result:o,error:s}=await F4(()=>glt({drafts:B(a),items:B(c),collection:e,useWorkflow:cY(e)}));t?(o&&(u1.current={...l1,...o}),LL.current=[]):n||(N(i,pU(s,`deleting_entry_failed`),!0),N(r,!0))};var d=_ft(),f=F(d);{let e=j(()=>X(`delete_entries`,{values:{count:LL.current.length}})),t=j(()=>X(`delete`)),r=j(()=>!!B(s).blockers.length);Il(f,{get title(){return B(e)},get okLabel(){return B(t)},get okDisabled(){return B(r)},onOk:async()=>{await u()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{let n=j(()=>LL.current.length>1&&LL.current.length===W7.current.length+G7.current.length);var r=_ft(),i=F(r),c=e=>{var t=gft(),r=F(t),i=L(r),s=e=>{var t=H();z(e=>G(t,e),[()=>X(B(o).length?`workflow.deleting_unpublished_note_some`:`workflow.deleting_unpublished_note_all`,{values:{count:B(a).length}})]),W(e,t)};K(i,e=>{B(a).length&&e(s)}),z(e=>G(r,`${e??``} `),[()=>X(B(l).length?B(n)?`confirm_deleting_all_entries_with_assets`:`confirm_deleting_selected_entries_with_assets`:B(n)?`confirm_deleting_all_entries`:`confirm_deleting_selected_entries`,{values:{count:LL.current.length}})]),W(e,t)};K(i,e=>{B(s).blockers.length||e(c)}),v5(L(i,2),{get plan(){return B(s)},get count(){return B(o).length}}),W(e,r)},$$slots:{default:!0}})}Pu(L(f,2),{get show(){return B(r)},set show(e){N(r,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(()=>G(n,B(i))),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,d),A()}var yft=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),bft=V(`<bdi></bdi>`),xft=V(`<div role="none" class="description svelte-83jnuc"><!></div>`),Sft=V(`<!> <!> <!> <!>`,1),Cft=V(`<!> <h2 role="none" class="svelte-83jnuc"><bdi> </bdi></h2> <!> <!>`,1),wft=V(`<!> <!>`,1),Tft={hash:`svelte-83jnuc`,code:`h2.svelte-83jnuc {flex:none !important;}.description.svelte-83jnuc {flex:auto;font-size:var(--sui-font-size-small);opacity:0.8;}`};function Eft(e,t){k(t,!0),q(e,Tft);let n=M(!1),r=M(void 0),i=M(void 0),a=M(void 0),o=M(void 0),s=M(void 0),c=j(()=>WA.current?.name??``),l=j(()=>Fc.current&&WA.current?XA(WA.current):B(c)),u=j(()=>WA.current?.description),d=j(()=>K7.current),f=j(()=>B(d).isEntryCollection),p=j(()=>B(d).readonly),m=j(()=>B(d).canCreate),h=j(()=>B(d).canDelete),g=j(()=>B(d).canReorder),_=j(()=>B(d).canBulkEdit),v=j(()=>B(d).quota),y=j(()=>B(d).remaining),b=j(()=>B(d).nearingQuota),x=j(()=>B(d).creationDisabled),S=j(()=>!LL.current.length||!B(h)),C=j(()=>!!(W7.current.length||G7.current.length));ba(()=>{B(S)&&document.activeElement===B(r)&&ao().then(()=>uH())});var w=wft(),T=F(w),ee=e=>{var t=wft(),d=F(t),h=e=>{var t=yft(),n=F(t);Po(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{dismissible:!1,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>BY(`collection`,{collection:WA.current})]),W(e,n)},$$slots:{default:!0}}),O(n),W(e,t)},w=e=>{var t=yft(),n=F(t);Po(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),ul(n.lastChild,{dismissible:!1,children:(e,t)=>{var n=U(),r=F(n),i=e=>{var t=H();z(e=>G(t,e),[()=>X(`creating_entries_disabled_by_admin`)]),W(e,t)},a=e=>{var t=H();z(e=>G(t,e),[()=>X(`creating_entries_disabled_by_quota`,{values:{quota:B(v)}})]),W(e,t)},o=e=>{var t=H();z(e=>G(t,e),[()=>X(`creating_entries_nearing_quota`,{values:{quota:B(v),remaining:B(y)}})]),W(e,t)};K(r,e=>{B(m)?B(x)?e(a,1):e(o,-1):e(i)}),W(e,n)},$$slots:{default:!0}}),O(n),W(e,t)};K(d,e=>{B(p)?e(h):B(f)&&(B(x)||B(b))&&e(w,1)});var T=L(d,2);{let e=j(()=>X(`collection`));pO(T,{variant:`primary`,get ariaLabel(){return B(e)},children:(e,t)=>{var d=Cft(),p=F(d),m=e=>{{let t=j(()=>X(`back_to_collection_list`));b5(e,{get"aria-label"(){return B(t)},onclick:()=>{x$(`/collections`)}})}};K(p,e=>{sW.isSmallScreen&&e(m)});var h=L(p,2),v=I(P(h),!0);O(h);var y=L(h,2),b=e=>{Ml(e,{flex:!0})},w=e=>{var t=xft();Xc(P(t),{children:(e,t)=>{var n=bft();Ho(n,()=>eA(B(u)||``),!0),O(n),W(e,n)},$$slots:{default:!0}}),O(t),W(e,t)};K(y,e=>{sW.isSmallScreen?e(b):e(w,-1)});var T=L(y,2),ee=e=>{ms(hft(e,{onExit:async()=>{await ao(),B(i).focus()}}),e=>N(a,e,!0),()=>B(a))},E=e=>{ms(mft(e,{onExit:async()=>{await ao(),B(o).focus()}}),e=>N(s,e,!0),()=>B(s))},te=e=>{var t=Sft(),l=F(t),u=e=>{{let t=j(()=>X(`delete`)),i=j(()=>X(`delete_selected_entries`,{values:{count:LL.current.length}}));ll(e,{variant:`ghost`,get label(){return B(t)},get"aria-label"(){return B(i)},get disabled(){return B(S)},onclick:()=>{N(n,!0)},get element(){return B(r)},set element(e){N(r,e,!0)}})}};K(l,e=>{!sW.isSmallScreen&&!NB.current&&e(u)});var d=L(l,2),f=e=>{{let t=j(()=>X(`edit`)),n=j(()=>X(`bulk_edit_entries`)),r=j(()=>!W7.current.length);ll(e,{variant:`ghost`,get label(){return B(t)},get"aria-label"(){return B(n)},get disabled(){return B(r)},onclick:async()=>{X7(!0),await ao(),B(s).focus()},get element(){return B(o)},set element(e){N(o,e,!0)}})}};K(d,e=>{B(_)&&!sW.isSmallScreen&&e(f)});var p=L(d,2),m=e=>{{let t=j(()=>X(`reorder`)),n=j(()=>X(`reorder_entries`)),r=j(()=>!W7.current.length);ll(e,{variant:`ghost`,get label(){return B(t)},get"aria-label"(){return B(n)},get disabled(){return B(r)},onclick:async()=>{Y7(!0),await ao(),B(a).focus()},get element(){return B(i)},set element(e){N(i,e,!0)}})}};K(p,e=>{B(g)&&e(m)}),dl(L(p,2),{children:(e,t)=>{var n=U(),r=F(n),i=e=>{{let t=j(()=>sW.isSmallScreen?void 0:X(`create`));Ldt(e,{get collectionName(){return B(c)},get label(){return B(t)},keyShortcuts:`Accel+E`})}};K(r,e=>{(!sW.isSmallScreen||B(C)&&!B(x))&&e(i)}),W(e,n)},$$slots:{default:!0}}),W(e,t)};K(T,e=>{B(f)&&N7.current?e(ee):B(f)&&I7.current?e(E,1):B(f)&&e(te,2)}),z(()=>G(v,B(l))),W(e,d)},$$slots:{default:!0}})}W(e,t)};K(T,e=>{WA.current&&e(ee)}),vft(L(T,2),{get open(){return B(n)},set open(e){N(n,e,!0)}}),W(e,w),A()}function Dft(e,t){k(t,!0);let n=j(()=>HB({collectionName:WA.current?.name})),r=j(()=>qB.current.filter(e=>aX(e,B(n)))),i=j(()=>B(n)?.internalPath),a=j(()=>!WB(B(n))||GB.current);var o=U(),s=F(o),c=e=>{{let t=j(()=>X(`collection_assets`));OO(e,{id:`collection-assets`,class:`secondary-sidebar`,get ariaLabel(){return B(t)},children:(e,t)=>{R$(e,{get disabled(){return B(a)},multiple:!0,onDrop:({files:e})=>{QB.current={folder:B(n),files:e}},children:(e,t)=>{$1(e,{get assets(){return B(r)},onSelect:({asset:e})=>{b$(oP(`/assets/${e.path}`),{transitionType:`forwards`})}})},$$slots:{default:!0}})},$$slots:{default:!0}})}};K(s,e=>{B(i)!==void 0&&sW.isLargeScreen&&t3.current.showMedia&&e(c)}),W(e,o),A()}var Oft=V(`<!> <!>`,1),kft=V(`<!> <!> <!> <!> <!> <!> <!>`,1);function Aft(e,t){k(t,!0);let n=j(()=>WA.current?._type===`entry`?WA.current:void 0),r=j(()=>B(n)?.name),i=j(()=>W7.current.length+G7.current.length),a=j(()=>!!B(i)),o=j(()=>B(i)>1);var s=U(),c=F(s),l=e=>{{let t=j(()=>X(`entry_list`));pO(e,{variant:`secondary`,get ariaLabel(){return B(t)},children:(e,t)=>{var i=kft(),s=F(i),c=e=>{{let t=j(()=>[...G7.current,...q7.current.flatMap(({entries:e})=>e)]);brt(e,{get allItems(){return B(t)},get selectedItems(){return LL}})}};K(s,e=>{!(sW.isSmallScreen||sW.isMediumScreen)&&!NB.current&&e(c)});var l=L(s,2);Ml(l,{flex:!0});var u=L(l,2);{let e=j(()=>!B(o)||!jR.current.length);Srt(u,{get disabled(){return B(e)},get currentView(){return t3},get sortKeys(){return jR.current},get collectionName(){return B(r)},"aria-controls":`entry-list`})}var d=L(u,2),f=e=>{{let t=j(()=>!B(o));mrt(e,{get disabled(){return B(t)},get currentView(){return t3},get filters(){return Wlt.current},multiple:!0,"aria-controls":`entry-list`})}};K(d,e=>{Wlt.current?.length&&e(f)});var p=L(d,2),m=e=>{{let t=j(()=>!B(o)),n=j(()=>q7.current.map(({name:e})=>e));grt(e,{get disabled(){return B(t)},get currentView(){return t3},get groups(){return Jlt.current},get groupNames(){return B(n)},"aria-controls":`entry-list`})}};K(p,e=>{Jlt.current?.length&&e(m)});var h=L(p,2);{let e=j(()=>!B(a)),t=j(()=>n3(B(n)));a3(h,{get disabled(){return B(e)},get currentView(){return t3},get types(){return B(t)},"aria-controls":`entry-list`})}var g=L(h,2),_=e=>{var t=Oft(),n=F(t);ql(n,{orientation:`vertical`});var i=L(n,2);{let e=e=>{Lc(e,{name:`photo_library`})},t=j(()=>!B(a)||!HB({collectionName:B(r)})),n=j(()=>!!t3.current.showMedia),o=j(()=>t3.current.showMedia?`collection-assets`:void 0),s=j(()=>X(t3.current.showMedia?`hide_assets`:`show_assets`));ll(i,{variant:`ghost`,iconic:!0,get disabled(){return B(t)},get pressed(){return B(n)},get"aria-controls"(){return B(o)},get"aria-expanded"(){return t3.current.showMedia},get"aria-label"(){return B(s)},onclick:()=>{t3.current={...t3.current,showMedia:!t3.current.showMedia}},startIcon:e,$$slots:{startIcon:!0}})}W(e,t)};K(g,e=>{sW.isSmallScreen||sW.isMediumScreen||e(_)}),W(e,i)},$$slots:{default:!0}})}};K(c,e=>{B(n)&&!N7.current&&!I7.current&&e(l)}),W(e,s),A()}var jft=/^\/collections(?:\/(?<_collectionName>[^/]+)(?:\/(?<routeType>new|entries|filter))?(?:\/(?<subPath>.+?))?)?$/,Q7=(e,t)=>($Q.current=!1,u$.current=X(t),{...e,notFoundKey:t}),$7=(e,t,n)=>(t.current=void 0,u$.current=X(n),e),Mft=e=>sW.isSmallScreen?(WA.current=void 0,$Q.current=!1,u$.current=X(`viewing_collection_list`),{...e,isIndexPage:!0}):(b$(`/collections/${(WA.current||ZSe()||JA())?.name}`,{replaceState:!0}),e),Nft=e=>{!e||e.hide?WA.current=void 0:WA.current?.name!==e.name&&(WA.current=e,rA.current=``)},Pft=({state:e,collection:t,collectionName:n,collectionLabel:r,routeType:i,subPath:a})=>i===`filter`&&!MSe({collection:t,entries:NY(BL(n),mY(n)),dirPath:a??``})?pY.current?Q7(e,`page_not_found`):($Q.current=!1,u$.current=X(`loading`),{...e,awaitingDrafts:!0}):(rA.current=i===`filter`?a??``:``,$Q.current=!1,u$.current=X(`viewing_x_collection`,{values:{collection:r,count:W7.current.length}}),e),Fft=({state:e,entryDraft:t,collection:n,collectionName:r,collectionLabel:i,routeType:a,subPath:o,fileMap:s})=>{if(a!==`entries`||!o)return $7(e,t,`file_not_found`);let c=Object.hasOwn(s,o)?s[o]:void 0;return c?(o8({entryDraft:t,collection:n,collectionFile:c,originalEntry:bY({collectionName:r,subPath:o})??cj(r,o)??{slug:c.name,locales:Object.fromEntries(c._i18n.initialLocales.map(e=>[e,{}]))}}),est(t),u$.current=X(`edit_${n._type}_announcement`,{values:{collection:i,file:oj(c)}}),e):$7(e,t,`file_not_found`)},Ift=({state:e,entryDraft:t,collection:n,collectionName:r,collectionLabel:i,routeType:a,subPath:o,params:s})=>{if(a===`new`&&!o){let r=oA(n)?s.path:void 0;r!==void 0&&delete s.path;let{_slug:a}=s;return delete s._slug,o8({entryDraft:t,collection:n,dynamicValues:s,initialPath:r,initialSlug:a,isIndexFile:!!window.history.state?.index}),u$.current=X(`create_entry_announcement`,{values:{collection:i}}),e}if(a===`entries`&&o){let a=bY({collectionName:r,subPath:o})??BL(r).find(e=>e.subPath===o);return a?(Fc.current&&(o8({entryDraft:t,collection:n,originalEntry:a}),est(t),u$.current=X(`edit_entry_announcement`,{values:{collection:i,entry:$L(WA.current,a)}})),e):$7(e,t,`entry_not_found`)}return $7(e,t,`entry_not_found`)},Lft=({entryDraft:e})=>{let{path:t,params:n}=p$(),r=t.match(jft),i={isIndexPage:!1,isSearchPage:!1,notFoundKey:``,awaitingDrafts:!1,editorLocale:n._locale};if(delete n._locale,WA.current?.name===`_singletons`&&KA().length&&(WA.current=void 0),!r?.groups)return $Q.current=!1,{...i,isSearchPage:Lrt(t)};let{_collectionName:a,routeType:o,subPath:s}=r.groups;if(!a)return Mft(i);let c=YA(a);if(Nft(c),!c||!WA.current)return Q7(i,`collection_not_found`);let{name:l}=WA.current,u=XA(WA.current),d=`_fileMap`in WA.current?WA.current._fileMap:void 0;if(!o&&s)return Q7(i,`page_not_found`);let f={state:i,entryDraft:e,collection:c,collectionName:l,collectionLabel:u,routeType:o,subPath:s};return!o||o===`filter`?Pft(f):($Q.current=!0,o===`entries`&&s&&!pY.current?(u$.current=X(`loading_entries`,{values:{count:1}}),{...i,awaitingDrafts:!0}):d?Fft({...f,fileMap:d}):Ift({...f,params:n}))},Rft=V(`<!> <!> <!>`,1);function zft(e,t){k(t,!0);let n=new wz,r=M(!1),i=M(!1),a=M(``),o=M(!1),s=M(void 0),c=j(()=>!!(W7.current.length||G7.current.length)),l=j(()=>`files`in(WA.current??{})?qdt:Vdt),u=()=>{(e=>{N(r,e.isIndexPage,!0),N(i,e.isSearchPage,!0),N(a,e.notFoundKey,!0),N(o,e.awaitingDrafts,!0),N(s,e.editorLocale,!0)})(Lft({entryDraft:n}))};vs(()=>(u(),()=>{$Q.current=!1})),YO(()=>$Q.current,()=>{$Q.current||J4e(n.current)}),R(()=>{B(o)&&pY.current&&co(()=>u())});var d=Rft();go(`hashchange`,ra,e=>{y$(e,u,jft)});var f=F(d);{let e=e=>{var t=U(),n=F(t),a=e=>{lft(e,{get isSearchPage(){return B(i)}})};K(n,e=>{(!sW.isSmallScreen||B(r))&&e(a)}),W(e,t)},t=e=>{var t=U(),n=F(t),o=e=>{H5(e,{})},s=e=>{{let t=e=>{{let t=j(()=>X(B(a)));C5(e,{get message(){return B(t)}})}},n=j(()=>X(`content_library`));E5(e,{id:`collection-container`,get"aria-label"(){return B(n)},mainContent:t,$$slots:{mainContent:!0}})}},u=e=>{{let t=e=>{Eft(e,{})},n=e=>{var t=U(),n=F(t),r=e=>{Aft(e,{})};K(n,e=>{WA.current?._type===`entry`&&B(c)&&e(r)}),W(e,t)},r=e=>{var t=U();Wo(F(t),()=>B(l),(e,t)=>{t(e,{})}),W(e,t)},i=e=>{Dft(e,{})},a=j(()=>X(`x_collection`,{values:{collection:Fc.current&&WA.current?XA(WA.current):``}})),o=j(()=>WA.current?.description);E5(e,{id:`collection-container`,get"aria-label"(){return B(a)},get"aria-description"(){return B(o)},primaryToolbar:t,secondaryToolbar:n,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}};K(n,e=>{B(i)?e(o):B(a)?e(s,1):sW.isSmallScreen&&B(r)||e(u,2)}),W(e,t)},n=j(()=>X(`content_library`));B5(f,{uiSettingsKey:`contents-page`,get"aria-label"(){return B(n)},primarySidebar:e,main:t,$$slots:{primarySidebar:!0,main:!0}})}var p=L(f,2),m=e=>{Kut(e,{get entryDraft(){return n},get editorLocale(){return B(s)},get loading(){return B(o)}})};K(p,e=>{$Q.current&&e(m)}),Kat(L(p,2),{}),W(e,d),A()}function Bft(e,t){k(t,!0);{let t=j(()=>X(`prefs.i18n.translators.default.select_service`));yu(e,{get ariaLabel(){return B(t)},get value(){return CW.defaultTranslationService},onChange:e=>{CW.defaultTranslationService=e.detail.value},children:(e,t)=>{var n=U();Ro(F(n),17,()=>Object.entries(x6),([e,{serviceLabel:t}])=>e,(e,t)=>{var n=j(()=>Pr(B(t),2));let r=()=>B(n)[0],i=()=>B(n)[1].serviceLabel;{let t=j(()=>r()===CW.defaultTranslationService);nu(e,{get label(){return i()},get value(){return r()},get selected(){return B(t)}})}}),W(e,n)},$$slots:{default:!0}})}A()}var Vft=V(`<!> <!> <!>`,1);function Hft(e,t){k(t,!0);let n=j(()=>S6.current),r=j(()=>B(n).serviceId),i=j(()=>B(n).apiLabel),a=j(()=>B(n).developerURL),o=j(()=>B(n).apiKeyURL),s=j(()=>B(n).apiKeyPattern),c=M(``);R(()=>{N(c,CW.apiKeys?.[B(r)]??``,!0)}),R(()=>{!$Q.current&&n$.current.show&&(n$.current.show=!1,n$.current.resolve?.())});let l=()=>{let e=j$(B(r),B(c),B(s));e!==void 0&&(n$.current.show=!1,n$.current.resolve?.(e))};{let t=j(()=>X(`translate_fields`,{values:{count:n$.current.multiple?2:1}})),n=j(()=>({spellcheck:!1,monospace:!0,ariaLabel:X(`api_key`)}));Kl(e,{get title(){return B(t)},get textboxAttrs(){return B(n)},oninput:e=>{e.inputType===`insertFromPaste`&&l()},onOk:()=>l(),onCancel:()=>{n$.current.resolve?.()},get open(){return n$.current.show},set open(e){n$.current.show=e},get value(){return B(c)},set value(e){N(c,e,!0)},children:(e,t)=>{var n=Vft(),r=F(n);Bft(r,{});var s=L(r,2);Ml(s,{}),Ho(L(s,2),()=>k$(`prefs.i18n.translators.description`,{service:B(i),developerURL:B(a),apiKeyURL:B(o)})),W(e,n)},$$slots:{default:!0}})}A()}var Uft=V(`<!> <!> <!> <!> <!>`,1);function Wft(e,t){k(t,!0);var n=Uft(),r=F(n);Pu(r,{get show(){return u1.current.saved},set show(e){u1.current.saved=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(u1.current.published?`entry_saved_and_published`:`entry_saved`,{values:{count:u1.current.count}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var i=L(r,2);Pu(i,{get show(){return u1.current.deletionCancelled},set show(e){u1.current.deletionCancelled=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`workflow.deletion_cancelled`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var a=L(i,2);Pu(a,{get show(){return u1.current.discarded},set show(e){u1.current.discarded=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`workflow.changes_discarded`,{values:{count:u1.current.count}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var o=L(a,2);Pu(o,{get show(){return u1.current.deleted},set show(e){u1.current.deleted=e},children:(e,t)=>{Vc(e,{status:`success`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(u1.current.deletionPending?`workflow.deletion_pending`:`entries_deleted`,{values:{count:u1.current.count}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Pu(L(o,2),{get show(){return u1.current.alreadyPublished},set show(e){u1.current.alreadyPublished=e},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`open_authoring.entry_already_published`)]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,n),A()}function Gft(e,t){k(t,!0);let n=M(!!rj.current.length);Pu(e,{get show(){return B(n)},set show(e){N(n,e,!0)},children:(e,t)=>{Vc(e,{status:`error`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`entry_parse_errors`,{values:{count:rj.current.length}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),A()}var Kft=/^\/pages\/(?<id>[^/]+)$/,e9=WO(``),qft=KO(()=>e9.current?PO.get(e9.current):void 0),t9=KO(()=>[...PO.values()]),Jft=e=>e.match(Kft)?.groups?.id??``,Yft=({id:e})=>`/pages/${e}`,Xft=e=>{e.newTab?hB(e.url):b$(Yft(e))},Zft=V(`<!> <h2 role="none"> </h2> <!>`,1),Qft=V(`<div role="none" class="content svelte-gu8e5g"></div>`),$ft=V(`<iframe class="svelte-gu8e5g"></iframe>`),ept={hash:`svelte-gu8e5g`,code:`.content.svelte-gu8e5g {flex:auto;overflow:auto;}iframe.svelte-gu8e5g {flex:auto;border:0;width:100%;}`};function tpt(e,t){k(t,!0),q(e,ept);let n=j(()=>qft.current),r=j(()=>B(n)&&!B(n).newTab?B(n):void 0),i=j(()=>B(r)?.label??X(`page_not_found`)),a=j(()=>B(r)?.component),o=e=>t=>F3(t,(0,br.createElement)(e));R(()=>{B(r)||(u$.current=X(`page_not_found`))}),B5(e,{get"aria-label"(){return B(i)},main:e=>{E5(e,{get"aria-label"(){return B(i)},primaryToolbar:e=>{pO(e,{variant:`primary`,children:(e,t)=>{var n=Zft(),r=F(n),a=e=>{b5(e,{onclick:()=>x$(`/menu`)})};K(r,e=>{sW.isSmallScreen&&e(a)});var o=L(r,2),s=I(o,!0);Ml(L(o,2),{flex:!0}),z(()=>G(s,B(i))),W(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=U(),n=F(t),i=e=>{{let t=j(()=>X(`page_not_found`));C5(e,{get message(){return B(t)}})}},s=e=>{var t=Qft();$o(t,()=>o(B(a))),W(e,t)},c=e=>{var t=$ft();z(()=>{J(t,`src`,B(r).url),J(t,`title`,B(r).label)}),W(e,t)};K(n,e=>{B(r)?B(a)?e(s,1):e(c,-1):e(i)}),W(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},$$slots:{main:!0}}),A()}var npt=[`file-cache`,`asset-thumbnails`,`asset-hashes`],rpt=RegExp(`^(?:${[...Object.keys(FJ),`test-repo`].join(`|`)}):`),ipt=async()=>{try{await(await navigator.storage.getDirectory()).removeEntry(`sveltia-cms-test`,{recursive:!0})}catch{}},apt=async()=>{let e=XJ.current,{databaseName:t}=e?.repository??{};t&&await npt.reduce((e,n)=>e.then(()=>new tD(t,n).clear()),Promise.resolve()),e?.name===`test-repo`&&await ipt()},opt=async()=>{let e=KJ(XJ.current),t=new Set(e?[e]:[]);try{(await globalThis.indexedDB.databases?.())?.forEach(({name:e})=>{e&&rpt.test(e)&&t.add(e)})}catch{}return[...t]},spt=async e=>new Promise(t=>{let n=()=>t(),r=globalThis.indexedDB.deleteDatabase(e);r.onsuccess=n,r.onerror=n,r.onblocked=n}),cpt=async()=>{try{let e=(await rD.keys()).filter(e=>e.startsWith(`sveltia-cms.`)||_U.includes(e));await Promise.all(e.map(e=>rD.delete(e)))}catch{}},lpt=async()=>{let e=await opt();await Promise.all([...e.map(e=>spt(e)),cpt(),ipt()])},upt=KO(()=>sW.isLargeScreen&&sW.hasMouse&&!sW.isLocalHost&&!!XJ.current?.isGit&&!!vU.account?.token),n9=WO(!1),dpt=async e=>{let t=z5();if(t)return(await t.get(`onboarding`)??{})[e]},r9=async(e,t)=>{let n=z5();if(!n)return;let r=await n.get(`onboarding`)??{};await n.set(`onboarding`,{...r,[e]:t})},fpt={get:dpt,set:r9},i9=(e,t=fpt)=>{let n=WO(!1);return{show:n,showIfNeeded:async()=>{n.current=!await t.get(e)},hide:()=>{n.current=!1,t.set(e,!0)}}},a9=i9(`sveltia-cms.demo-welcome-seen`,{get:async e=>{try{return await rD.get(e)}catch{return}},set:async(e,t)=>{try{await rD.set(e,t)}catch{}}}),ppt=async()=>{GJ(XJ.current?.name)&&await a9.showIfNeeded()},mpt=V(`<p class="svelte-isqcpj"> </p> <p class="svelte-isqcpj"> </p>`,1),hpt={hash:`svelte-isqcpj`,code:`p.svelte-isqcpj {margin:0;&:not(:first-child) {margin-top:1em;}}`};function gpt(e,t){k(t,!0),q(e,hpt),vs(()=>{ppt()});{let t=j(()=>X(`demo_welcome.title`)),n=j(()=>X(`demo_welcome.button_label`));Pl(e,{get title(){return B(t)},size:`small`,get okLabel(){return B(n)},showCancel:!1,onClose:()=>{a9.hide()},get open(){return a9.show.current},set open(e){a9.show.current=e},children:(e,t)=>{var n=mpt(),r=F(n),i=I(r,!0),a=I(L(r,2),!0);z((e,t)=>{G(i,e),G(a,t)},[()=>X(`demo_welcome.description`),()=>X(`demo_welcome.reset_hint`)]),W(e,n)},$$slots:{default:!0}})}A()}var _pt=()=>!!document.querySelector(`script[src*="/@vite/client"]`),vpt=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function ypt(e,t){k(t,!0);let n=j(()=>YJ.current===`local`&&_pt());var r=vpt(),i=F(r);Po(i,()=>({"--sui-infobar-message-justify-content":`center`})),ul(i.lastChild,{get show(){return B(n)},status:`warning`,children:(e,t)=>{var n=U();Ho(F(n),()=>$k(X(`live_reload_warning`),`https://sveltiacms.app/en/docs/workflows/local#troubleshooting`)),W(e,n)},$$slots:{default:!0}}),O(i),W(e,r),A()}var bpt=V(` <!> <!>`,1),xpt=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Spt(e,t){k(t,!0);let n=i9(`mobileCta`);R(()=>{n.showIfNeeded()});var r=xpt(),i=F(r);Po(i,()=>({"--sui-infobar-message-justify-content":`center`})),ul(i.lastChild,{get show(){return n.show.current},dismissible:!1,children:(e,t)=>{$r();var r=bpt(),i=F(r),a=L(i);{let e=j(()=>X(`mobile_promo_button`));ll(a,{variant:`link`,get label(){return B(e)},onclick:()=>{n9.current=!0,n.hide()}})}var o=L(a,2);{let e=j(()=>X(`later`));ll(o,{variant:`link`,get label(){return B(e)},onclick:()=>{n.hide()}})}z(e=>G(i,`${e??``} `),[()=>X(`mobile_promo_title`)]),W(e,r)},$$slots:{default:!0}}),O(i),W(e,r),A()}var Cpt=V(` <!> <!>`,1),wpt=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Tpt(e,t){k(t,!0);let n=M(``),r=M(!1),i=!1,a=async()=>{if(await dpt(`newLanguageCta`))return;let e=Fc.current,t=navigator.language,[i]=t.split(`-`);t!==e&&i!==e&&(N(n,pc.find(e=>e===t)??pc.find(e=>e.split(`-`)[0]===i)??``,!0),B(n)&&B(n)!==e&&N(r,!0))},o=()=>{N(r,!1),r9(`newLanguageCta`,!0)};R(()=>{let{locale:e}=CW;co(()=>{!i&&e&&(i=!0,e!==`auto`&&a())})});var s=wpt(),c=F(s);Po(c,()=>({"--sui-infobar-message-justify-content":`center`})),ul(c.lastChild,{get show(){return B(r)},dismissible:!1,children:(e,t)=>{$r();var r=Cpt(),i=F(r),a=L(i);{let e=j(()=>X(`change_language`,{locale:B(n)}));ll(a,{variant:`link`,get label(){return B(e)},onclick:()=>{CW.locale=B(n),o()}})}var s=L(a,2);{let e=j(()=>X(`later`,{locale:B(n)}));ll(s,{variant:`link`,get label(){return B(e)},onclick:()=>{o()}})}z(e=>G(i,`${e??``} `),[()=>X(`new_language_available`,{locale:B(n),values:{locale:kA(B(n),{displayLocale:B(n)})}})]),W(e,r)},$$slots:{default:!0}}),O(c),W(e,s),A()}var Ept=({reason:e,detail:t=``})=>e===`operation_in_progress`?X(`local_git_skip_reasons.operation_in_progress.${t}`):X(`local_git_skip_reasons.${e}`,{values:{path:t,message:t}}),Dpt=({ready:e,reason:t,detail:n,branch:r,author:i})=>{if(!e)return X(`prefs.developer.local_git.not_ready`,{values:{reason:Ept({reason:t,detail:n})}});let{name:a,email:o}=i;return X(`prefs.developer.local_git.ready`,{values:{branch:r.replace(/^refs\/heads\//,``),name:a,email:o}})};function Opt(e,t){k(t,!0);let n=M(!1),r=PU.current;R(()=>{let e=PU.current;e&&e!==r&&(r=e,N(n,!0))});var i=U();No(F(i),()=>PU.current,e=>{var t=U(),r=F(t),i=e=>{Pu(e,{get show(){return B(n)},set show(e){N(n,e,!0)},children:(e,t)=>{Vc(e,{status:`warning`,children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`local_git_not_committed`,{values:{reason:Ept(PU.current)}})]),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(r,e=>{PU.current&&e(i)}),W(e,t)}),W(e,i),A()}function kpt(e,t){k(t,!0),vs(()=>{u$.current=X(`page_not_found`)});{let t=e=>{E5(e,{mainContent:e=>{{let t=j(()=>X(`page_not_found`));C5(e,{get message(){return B(t)}})}},$$slots:{mainContent:!0}})},n=j(()=>X(`page_not_found`));B5(e,{get"aria-label"(){return B(n)},main:t,$$slots:{main:!0}})}A()}var Apt=({selectedPageName:e,searchMode:t,hasAssets:n,assetsLink:r,workflowEnabled:i,workflowLabelKey:a,customPages:o,selectedCustomPageId:s,isSmallScreen:c})=>{let l=[{key:`collections`,label:X(`contents`),icon:`article`,link:`/collections`,selected:e===`collections`||t===`contents`}];return n&&l.push({key:`assets`,label:X(`assets`),icon:`photo`,link:r,selected:e===`assets`||t===`assets`}),i&&l.push({key:`workflow`,label:X(a),icon:`rebase_edit`,link:`/workflow`,selected:e===`workflow`}),o.forEach(e=>{l.push({key:`pages/${e.id}`,label:e.label,icon:e.icon,link:Yft(e),selected:s===e.id})}),c&&l.push({key:`menu`,label:X(`menu`),icon:`menu`,link:`/menu`,selected:e===`menu`}),l},jpt=V(`<div role="none" class="wrapper svelte-t2r4ty"><!> <!></div>`),Mpt={hash:`svelte-t2r4ty`,code:`.wrapper.svelte-t2r4ty {display:contents;.sui.select-button-group {gap:4px;
|
||
|
||
@media (width < 768px) {justify-content:space-evenly;width:100%;
|
||
}}.sui.button {border-radius:var(--sui-button-medium-border-radius) !important;}}`};function Npt(e,t){k(t,!0),q(e,Mpt);let n=j(()=>sW.isSmallScreen?`/assets`:vQ.current?mQ(vQ.current):RB.current.length?oP(`/assets/${BB.current?.internalPath??`-/all`}`):mQ(pQ.current[0]??fQ)),r=j(()=>sW.isSmallScreen?[]:t9.current),i=j(()=>B(r).filter(({newTab:e})=>e)),a=j(()=>Apt({selectedPageName:l$.current,searchMode:D5.current,hasAssets:!!(RB.current.length||pQ.current.length||dQ.current.length),assetsLink:B(n),workflowEnabled:sY.current,workflowLabelKey:oY.current,customPages:B(r).filter(({newTab:e})=>!e),selectedCustomPageId:e9.current,isSmallScreen:sW.isSmallScreen}));var o=jpt(),s=P(o);{let e=j(()=>X(`switch_page`));Dl(s,{get ariaLabel(){return B(e)},"aria-controls":`page-container`,children:(e,t)=>{var n=U();Ro(F(n),19,()=>B(a),({key:e,label:t,icon:n,link:r,selected:i})=>e,(e,t,n)=>{let r=()=>B(t).label,i=()=>B(t).icon,a=()=>B(t).link,o=()=>B(t).selected;{let t=e=>{Lc(e,{get name(){return i()}})},s=j(()=>B(n)<9?`Alt+${B(n)+1}`:void 0);Ol(e,{variant:`ghost`,iconic:!0,get selected(){return o()},get"aria-label"(){return r()},get keyShortcuts(){return B(s)},onclick:()=>{b$(a())},startIcon:t,$$slots:{startIcon:!0}})}}),W(e,n)},$$slots:{default:!0}})}Ro(L(s,2),17,()=>B(i),e=>e.id,(e,t)=>{ll(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return B(t).label},onclick:()=>{Xft(B(t))},startIcon:e=>{Lc(e,{get name(){return B(t).icon}})},$$slots:{startIcon:!0}})}),O(o),W(e,o),A()}var Ppt=V(`<div role="none" class="buttons"><!></div>`);function Fpt(e,t){k(t,!0),fie(e,{get inert(){return c$.current},children:(e,t)=>{{let t=j(()=>X(`global`));pO(e,{variant:`primary`,get ariaLabel(){return B(t)},children:(e,t)=>{var n=Ppt();Npt(P(n),{}),O(n),W(e,n)},$$slots:{default:!0}})}},$$slots:{default:!0}}),A()}var o9=WO(null),Ipt=e=>{e.preventDefault(),o9.current=e},Lpt=()=>{o9.current=null},Rpt=()=>(window.addEventListener(`beforeinstallprompt`,Ipt),window.addEventListener(`appinstalled`,Lpt),()=>{window.removeEventListener(`beforeinstallprompt`,Ipt),window.removeEventListener(`appinstalled`,Lpt)}),zpt=async()=>{let e=o9.current;e&&(o9.current=null,await e.prompt())};function Bpt(e,t){k(t,!0);var n=U(),r=F(n),i=e=>{{let t=j(()=>X(`install_as_app`));iu(e,{get label(){return B(t)},onclick:async()=>{await zpt()}})}};K(r,e=>{o9.current&&e(i)}),W(e,n),A()}var Vpt=V(`<kbd class="svelte-13q15u"> </kbd>`),Hpt=V(`<!> <!>`,1),Upt=V(`<div role="none" class="wrapper svelte-13q15u"><!></div>`),Wpt={hash:`svelte-13q15u`,code:`.wrapper.svelte-13q15u {display:contents;.table-row {display:flex;align-items:center;gap:16px;padding:8px 0;border-top:1px solid var(--sui-secondary-border-color);&:last-child {border-bottom:1px solid var(--sui-secondary-border-color);}.feature {flex:auto;}.keys {display:flex;gap:8px;}}}kbd.svelte-13q15u {display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-color:var(--sui-primary-accent-color);border-radius:4px;padding:0 8px;height:32px;min-width:32px;background-color:var(--sui-tertiary-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}`};function Gpt(e,t){k(t,!0),q(e,Wpt);let n=Y(t,`open`,15,!1),r=Y(t,`onClose`,3,void 0),i=[{feature:`view_content_library`,keys:`Alt+1`},{feature:`view_asset_library`,keys:`Alt+2`},{feature:`search`,keys:`Accel+F`},{feature:`create_entry`,keys:`Accel+E`},{feature:`save_entry`,keys:`Accel+S`},{feature:`cancel_editing`,keys:`Escape`}];{let t=j(()=>X(`keyboard_shortcuts`));Pl(e,{get title(){return B(t)},size:`small`,showOk:!1,showCancel:!1,showClose:!0,style:`--sui-dialog-small-content-max-height:auto`,onClose:()=>{r()?.()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=Upt(),r=P(n);{let e=j(()=>X(`keyboard_shortcuts`));Nse(r,{get ariaLabel(){return B(e)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>i,({feature:e,keys:t})=>t,(e,t)=>{let n=()=>B(t).feature,r=()=>B(t).keys;kse(e,{children:(e,t)=>{var i=Hpt(),a=F(i);Eu(a,{class:`feature`,children:(e,t)=>{$r();var r=H();z(e=>G(r,e),[()=>X(`keyboard_shortcuts_.${n()}`)]),W(e,r)},$$slots:{default:!0}}),Eu(L(a,2),{class:`keys`,children:(e,t)=>{var n=U();Ro(F(n),16,()=>r().split(`+`),e=>e,(e,t)=>{var n=Vpt(),r=I(n,!0);z(e=>G(r,e),[()=>t.replace(`Accel`,sW.isMacOS?`⌘`:`Ctrl`)]),W(e,n)}),W(e,n)},$$slots:{default:!0}}),W(e,i)},$$slots:{default:!0}})}),W(e,n)},$$slots:{default:!0}})}O(n),W(e,n)},$$slots:{default:!0}})}A()}var Kpt=V(`<!> <!>`,1);function qpt(e,t){k(t,!0);let n=M(!1);var r=Kpt(),i=F(r),a=e=>{{let t=j(()=>X(`keyboard_shortcuts`));iu(e,{get label(){return B(t)},onclick:()=>{N(n,!0)}})}};K(i,e=>{sW.hasMouse&&e(a)}),Gpt(L(i,2),{onClose:()=>{t.menuButton?.focus()},get open(){return B(n)},set open(e){N(n,e,!0)}}),W(e,r),A()}function s9(e,t){let n=Y(t,`defaultValue`,3,!0),r=CW;var i=()=>!!(r[t.key]??n()),a=e=>{r[t.key]=e};Tu(e,{get checked(){return i()},set checked(e){a(e)},get label(){return t.label}})}var Jpt=V(`<section><h3> </h3> <p> </p> <div role="none"><!></div></section>`);function Ypt(e,t){k(t,!0);var n=Jpt(),r=P(n),i=I(r,!0),a=L(r,2),o=I(a,!0),s=L(a,2),c=P(s);{let e=j(()=>X(`prefs.accessibility.underline_links.switch_label`));s9(c,{key:`underlineLinks`,get label(){return B(e)}})}O(s),O(n),z((e,t)=>{G(i,e),G(o,t)},[()=>X(`prefs.accessibility.underline_links.title`),()=>X(`prefs.accessibility.underline_links.description`)]),W(e,n),A()}function Xpt(e,t){k(t,!0);let n=Y(t,`onChange`,3,void 0),r=j(()=>t.service.apiKeyPattern),i=M(``);vs(()=>{N(i,CW.apiKeys?.[t.serviceId]??``,!0)}),Oxe(e,{flex:!0,autocomplete:`off`,spellcheck:`false`,get ariaLabel(){return t.ariaLabel},onchange:()=>{let e=B(i).trim(),a=!!e&&!!B(r)&&!B(r).test(e);A$(t.serviceId,a?``:e),n()?.({message:X(a?`prefs.changes.api_key_invalid`:e?`prefs.changes.api_key_saved`:`prefs.changes.api_key_removed`),status:a?`error`:`success`})},get value(){return B(i)},set value(e){N(i,e,!0)}}),A()}var Zpt=V(`<section><h4> </h4> <div role="none"><!></div></section>`),Qpt=V(`<section><h3> </h3> <p><!></p> <!></section>`);function c9(e,t){k(t,!0);let n=Y(t,`docsURL`,3,void 0),r=Y(t,`onChange`,3,void 0);var i=Qpt(),a=P(i),o=I(a,!0),s=L(a,2),c=P(s),l=e=>{var r=U();Ho(F(r),()=>$k(t.description,n())),W(e,r)},u=e=>{var n=H();z(()=>G(n,t.description)),W(e,n)};K(c,e=>{n()?e(l):e(u,-1)}),O(s),Ro(L(s,2),17,()=>t.entries,([e,t])=>e,(e,n)=>{var i=j(()=>Pr(B(n),2));let a=()=>B(i)[0],o=()=>B(i)[1],s=j(()=>o().serviceLabel);var c=Zpt(),l=P(c),u=I(l,!0),d=L(l,2),f=P(d);{let e=j(()=>t.getFieldLabel(B(s)));Xpt(f,{get serviceId(){return a()},get service(){return o()},get ariaLabel(){return B(e)},get onChange(){return r()}})}O(d),O(c),z(()=>G(u,B(s))),W(e,c)}),O(i),z(()=>G(o,t.title)),W(e,i),A()}function $pt(e,t){k(t,!0);let n=Y(t,`onChange`,3,void 0);{let t=j(()=>X(`prefs.ai.api_keys.title`)),r=j(()=>X(`prefs.ai.api_keys.description`)),i=j(()=>Object.entries(k$e));c9(e,{get title(){return B(t)},get description(){return B(r)},get entries(){return B(i)},getFieldLabel:e=>X(`prefs.ai.field_label`,{values:{service:e}}),get onChange(){return n()}})}A()}var emt=V(`<section><h3> </h3> <div role="none"><!></div></section>`);function tmt(e,t){k(t,!0);var n=emt(),r=P(n),i=I(r,!0),a=L(r,2),o=P(a);{let e=j(()=>X(`prefs.appearance.select_theme`));Dl(o,{get ariaLabel(){return B(e)},onChange:e=>{CW.theme=e.detail.value},children:(e,t)=>{var n=U();Ro(F(n),16,()=>[`auto`,`dark`,`light`],e=>e,(e,t)=>{{let n=j(()=>X(t===`auto`?`automatic`:`prefs.theme.${t}`)),r=j(()=>!CW.theme&&t===`auto`||CW.theme===t);Ol(e,{variant:`tertiary`,get label(){return B(n)},get value(){return t},get selected(){return B(r)}})}}),W(e,n)},$$slots:{default:!0}})}O(a),O(n),z(e=>G(i,e),[()=>X(`prefs.appearance.theme`)]),W(e,n),A()}var nmt=V(`<section><h3> </h3> <div role="none"><!></div> <div role="none"><!></div> <div role="none"><!></div></section>`);function rmt(e,t){k(t,!0);var n=nmt(),r=P(n),i=I(r,!0),a=L(r,2),o=P(a);{let e=j(()=>X(`prefs.contents.editor.use_draft_backup.switch_label`));s9(o,{key:`useDraftBackup`,get label(){return B(e)}})}O(a);var s=L(a,2),c=P(s);{let e=j(()=>X(`prefs.contents.editor.close_on_save.switch_label`));s9(c,{key:`closeOnSave`,get label(){return B(e)}})}O(s);var l=L(s,2),u=P(l);{let e=j(()=>X(`prefs.contents.editor.close_with_escape.switch_label`));s9(u,{key:`closeWithEscape`,get label(){return B(e)}})}O(l),O(n),z(e=>G(i,e),[()=>X(`prefs.contents.editor.title`)]),W(e,n),A()}var imt=V(`<section><h3> </h3> <p> </p> <div role="none"><!></div> <p> </p> <div role="none"><!></div></section> <!> <!>`,1);function amt(e,t){k(t,!0);let n=M(!1),r=M(!1),i=async()=>{await apt(),window.location.reload()},a=async()=>{await lpt(),window.location.reload()};var o=imt(),s=F(o),c=P(s),l=I(c,!0),u=L(c,2),d=I(u,!0),f=L(u,2),p=P(f);{let e=j(()=>X(`prefs.data.clear_data.file_cache.button_label`));ll(p,{variant:`tertiary`,get label(){return B(e)},onclick:()=>{N(n,!0)}})}O(f);var m=L(f,2),h=I(m,!0),g=L(m,2),_=P(g);{let e=j(()=>X(`prefs.data.clear_data.all_data.button_label`));ll(_,{variant:`tertiary`,get label(){return B(e)},onclick:()=>{N(r,!0)}})}O(g),O(s);var v=L(s,2);{let e=j(()=>X(`prefs.data.clear_data.file_cache.button_label`)),t=j(()=>X(`prefs.data.clear_data.file_cache.button_label`));Il(v,{get title(){return B(e)},get okLabel(){return B(t)},onOk:i,get open(){return B(n)},set open(e){N(n,e,!0)},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`prefs.data.clear_data.file_cache.confirmation`)]),W(e,n)},$$slots:{default:!0}})}var y=L(v,2);{let e=j(()=>X(`prefs.data.clear_data.all_data.button_label`)),t=j(()=>X(`prefs.data.clear_data.all_data.button_label`));Il(y,{get title(){return B(e)},get okLabel(){return B(t)},onOk:a,get open(){return B(r)},set open(e){N(r,e,!0)},children:(e,t)=>{$r();var n=H();z(e=>G(n,e),[()=>X(`prefs.data.clear_data.all_data.confirmation`)]),W(e,n)},$$slots:{default:!0}})}z((e,t,n)=>{G(l,e),G(d,t),G(h,n)},[()=>X(`prefs.data.clear_data.title`),()=>X(`prefs.data.clear_data.file_cache.description`),()=>X(`prefs.data.clear_data.all_data.description`)]),W(e,o),A()}var omt=V(`<div role="none"><!></div>`),smt=V(`<p> </p>`),cmt=V(`<section><h3> </h3> <p> </p> <div role="none"><!></div> <!></section>`),lmt=V(`<section><h3> </h3> <p> </p> <!> <!></section>`),umt=V(`<section><h3> </h3> <p> </p> <div role="none"><!></div></section> <!> <!>`,1);function dmt(e,t){k(t,!0);let n=(e,t=jr,n=jr,i=jr,a=jr)=>{var o=omt();Gl(P(o),{dir:`ltr`,flex:!0,get ariaLabel(){return n()},showInlineLabel:!0,onchange:()=>{r()?.({message:CW[t()]?i():a()})},get value(){return CW[t()]},set value(e){CW[t()]=e}}),O(o),W(e,o)},r=Y(t,`onChange`,3,void 0),i=async()=>await JVe();var a=umt(),o=F(a),s=P(o),c=I(s,!0),l=L(s,2),u=I(l,!0),d=L(l,2),f=P(d);{let e=j(()=>X(`prefs.developer.developer_mode.switch_label`));s9(f,{key:`devModeEnabled`,get label(){return B(e)},defaultValue:!1})}O(d),O(o);var p=L(o,2),m=e=>{var t=cmt(),n=P(t),r=I(n,!0),a=L(n,2),o=I(a,!0),s=L(a,2),c=P(s);{let e=j(()=>X(`prefs.developer.local_git.switch_label`));s9(c,{key:`localGitCommits`,get label(){return B(e)},defaultValue:!1})}O(s);var l=L(s,2),u=e=>{var t=omt();Mo(P(t),i,e=>{var t=smt(),n=I(t,!0);z(e=>G(n,e),[()=>X(`prefs.developer.local_git.checking`)]),W(e,t)},(e,t)=>{{let n=j(()=>B(t).ready?`success`:`warning`);Vc(e,{get status(){return B(n)},children:(e,n)=>{$r();var r=H();z(e=>G(r,e),[()=>Dpt(B(t))]),W(e,r)},$$slots:{default:!0}})}}),O(t),W(e,t)};K(l,e=>{CW.localGitCommits&&e(u)}),O(t),z((e,t)=>{G(r,e),G(o,t)},[()=>X(`prefs.developer.local_git.title`),()=>X(`prefs.developer.local_git.description`)]),W(e,t)};K(p,e=>{YJ.current===`local`&&e(m)});var h=L(p,2),g=e=>{var t=lmt(),r=P(t),i=I(r,!0),a=L(r,2),o=I(a,!0),s=L(a,2);{let e=j(()=>X(`prefs.developer.deploy_hook.url.field_label`)),t=j(()=>X(`prefs.developer.deploy_hook.url.saved`)),r=j(()=>X(`prefs.developer.deploy_hook.url.removed`));n(s,()=>`deployHookURL`,()=>B(e),()=>B(t),()=>B(r))}var c=L(s,2);{let e=j(()=>X(`prefs.developer.deploy_hook.auth.field_label`)),t=j(()=>X(`prefs.developer.deploy_hook.auth.saved`)),r=j(()=>X(`prefs.developer.deploy_hook.auth.removed`));n(c,()=>`deployHookAuthHeader`,()=>B(e),()=>B(t),()=>B(r))}O(t),z((e,t)=>{G(i,e),G(o,t)},[()=>X(`prefs.developer.deploy_hook.title`),()=>X(`prefs.developer.deploy_hook.description`)]),W(e,t)};K(h,e=>{G8.current&&e(g)}),z((e,t)=>{G(c,e),G(u,t)},[()=>X(`prefs.developer.developer_mode.title`),()=>X(`prefs.developer.developer_mode.description`)]),W(e,a),A()}var fmt=V(`<section><h3> </h3> <div role="none"><!></div></section> <!>`,1);function pmt(e,t){k(t,!0);let n=Y(t,`onChange`,3,void 0);var r=fmt(),i=F(r),a=P(i),o=I(a,!0),s=L(a,2);Bft(P(s),{}),O(s),O(i);var c=L(i,2);{let e=j(()=>X(`prefs.i18n.translators.api_keys.title`)),t=j(()=>X(`prefs.i18n.translators.api_keys.description`)),r=j(()=>Object.entries(Q$e));c9(c,{get title(){return B(e)},get description(){return B(t)},get docsURL(){return`https://sveltiacms.app/en/docs/integrations/translations`},get entries(){return B(r)},getFieldLabel:e=>X(`prefs.i18n.translators.field_label`,{values:{service:e}}),get onChange(){return n()}})}z(e=>G(o,e),[()=>X(`prefs.i18n.translators.default.title`)]),W(e,r),A()}var mmt=V(`<!> <!> <!>`,1),hmt=V(`<section><h3> </h3> <div role="none"><!></div></section> <!>`,1);function gmt(e,t){k(t,!0);let n=j(()=>pc.map(e=>{let t=kA(e,{displayLocale:Fc.current})??e,n=kA(e,{displayLocale:e})??e,r=t===n?t:`${t} — ${n}`;return{value:e,searchValue:`${r} (${e})`,label:r}}).sort((e,t)=>e.label.localeCompare(t.label))),r=j(()=>CW.locale??`auto`),i=M(``),a=j(()=>kA(B(i))??B(i));R(()=>{m5.current&&N(i,m5.current,!0)});var o=hmt(),s=F(o),c=P(s),l=I(c,!0),u=L(c,2);No(P(u),()=>Fc.current,e=>{{let t=j(()=>X(`prefs.language.ui_language.select_language`));yu(e,{get ariaLabel(){return B(t)},get value(){return B(r)},onChange:e=>{CW.locale=e.detail.value,r9(`newLanguageCta`,!0)},children:(e,t)=>{var i=mmt(),a=F(i);{let e=j(()=>X(`automatic`)),t=j(()=>B(r)===`auto`);nu(a,{get value(){return`auto`},get label(){return B(e)},get selected(){return B(t)}})}var o=L(a,2);ql(o,{}),Ro(L(o,2),17,()=>B(n),({value:e,searchValue:t,label:n})=>e,(e,t)=>{let n=()=>B(t).value,i=()=>B(t).searchValue,a=()=>B(t).label;{let t=j(()=>n()===B(r));nu(e,{get value(){return n()},get searchValue(){return i()},get label(){return a()},get selected(){return B(t)}})}}),W(e,i)},$$slots:{default:!0}})}}),O(u),O(s);var d=L(s,2);{let e=j(()=>!!m5.current);Pu(d,{get show(){return B(e)},duration:0,children:(e,t)=>{Vc(e,{status:`info`,children:(e,t)=>{var n=U(),r=F(n),i=e=>{var t=H();z(e=>G(t,e),[()=>X(`switching_language`,{values:{locale:B(a)}})]),W(e,t)};K(r,e=>{B(a)&&e(i)}),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})}z(e=>G(l,e),[()=>X(`prefs.language.ui_language.title`)]),W(e,o),A()}var _mt=V(`<!> <!>`,1);function vmt(e,t){k(t,!0);let n=Y(t,`onChange`,3,void 0),r=j(()=>{let{providers:e=[]}=i1();return Object.entries(r1).filter(([t,{authType:n}])=>e.includes(t)&&n!==`none`)}),i=j(()=>Object.entries(vZ).filter(([,{isEnabled:e,authType:t}])=>(e?.()??!0)&&t!==`widget`));var a=_mt(),o=F(a);{let e=j(()=>X(`prefs.media.cloud_storage.api_keys.title`)),t=j(()=>B(i).length?X(`prefs.media.cloud_storage.api_keys.description`):X(`prefs.media.cloud_storage.no_services`));c9(o,{get title(){return B(e)},get description(){return B(t)},get docsURL(){return`https://sveltiacms.app/en/docs/media`},get entries(){return B(i)},getFieldLabel:e=>X(`prefs.media.cloud_storage.field_label`,{values:{service:e}}),get onChange(){return n()}})}var s=L(o,2);{let e=j(()=>X(`prefs.media.stock_photos.api_keys.title`)),t=j(()=>B(r).length?X(`prefs.media.stock_photos.api_keys.description`):X(`prefs.media.stock_photos.no_services`));c9(s,{get title(){return B(e)},get description(){return B(t)},get docsURL(){return`https://sveltiacms.app/en/docs/integrations/stock-photos`},get entries(){return B(r)},getFieldLabel:e=>X(`prefs.media.stock_photos.field_label`,{values:{service:e}}),get onChange(){return n()}})}W(e,a),A()}var l9=KO(()=>[{key:`appearance`,icon:`palette`,component:tmt},{key:`language`,icon:`language`,component:gmt},{key:`contents`,icon:`library_books`,component:rmt},{key:`i18n`,icon:`translate`,component:pmt,enabled:($O.current?.i18n?.locales?.length??0)>1},{key:`media`,icon:`photo_library`,component:vmt},{key:`ai`,icon:`auto_awesome`,component:$pt},{key:`accessibility`,icon:`accessibility_new`,component:Ypt},{key:`developer`,icon:`code_xml`,component:dmt},{key:`data`,icon:`database`,component:amt}]),ymt=V(`<div class="container svelte-1attlke" role="none"><!></div> <!>`,1),bmt={hash:`svelte-1attlke`,code:`.container.svelte-1attlke {display:contents;section:not(:first-child) {margin:16px 0 0;}p {margin-top:0;}h3 {font-size:inherit;& ~ div {margin:8px 0 0;}& ~ p {margin:8px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}}h4 {margin-bottom:4px;font-size:var(--sui-font-size-small);}}`};function xmt(e,t){q(e,bmt);let n=M(``),r=M(`success`),i=M(!1);var a=ymt(),o=F(a);Wo(P(o),()=>t.Panel,(e,t)=>{t(e,{onChange:({message:e,status:t})=>{N(n,e,!0),N(r,t??`success`,!0),N(i,!0)}})}),O(o),Pu(L(o,2),{get show(){return B(i)},set show(e){N(i,e,!0)},children:(e,t)=>{Vc(e,{get status(){return B(r)},children:(e,t)=>{$r();var r=H();z(()=>G(r,B(n))),W(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),W(e,a)}var Smt=V(`<div role="none" class="wrapper svelte-pwxwga"><!> <!></div>`),Cmt={hash:`svelte-pwxwga`,code:`.wrapper.svelte-pwxwga {display:flex;.sui.tab-list {flex:none;}.sui.tab-panel {flex:auto;border-width:0;}}`};function wmt(e,t){k(t,!0),q(e,Cmt);let n=Y(t,`open`,15,!1),r=Y(t,`onClose`,3,void 0),i=M(`appearance`);{let t=j(()=>X(`settings`));Pl(e,{get title(){return B(t)},size:`large`,showOk:!1,showCancel:!1,showClose:!0,onClose:()=>{r()?.()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=Smt(),r=P(n);{let e=j(()=>X(`categories`));Rse(r,{orientation:`vertical`,get ariaLabel(){return B(e)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>l9.current,({key:e,icon:t,enabled:n=!0})=>e,(e,t)=>{let n=()=>B(t).key,r=()=>B(t).icon,a=Ei(()=>Nr(B(t).enabled,!0));var o=U(),s=F(o),c=e=>{{let t=e=>{Lc(e,{get name(){return r()}})},a=j(()=>X(`prefs.${n()}.title`)),o=j(()=>n()===B(i));Wse(e,{get label(){return B(a)},get selected(){return B(o)},get"aria-controls"(){return`prefs-tab-${n()??``}`},onSelect:()=>{N(i,n(),!0)},startIcon:t,$$slots:{startIcon:!0}})}};K(s,e=>{B(a)&&e(c)}),W(e,o)}),W(e,n)},$$slots:{default:!0}})}Ro(L(r,2),17,()=>l9.current,({key:e,component:t})=>e,(e,t)=>{let n=()=>B(t).key,r=()=>B(t).component;Hse(e,{get id(){return`prefs-tab-${n()??``}`},children:(e,t)=>{xmt(e,{get Panel(){return r()}})},$$slots:{default:!0}})}),O(n),W(e,n)},$$slots:{default:!0}})}A()}var Tmt=V(`<!> <!>`,1),Emt=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1);function Dmt(e,t){k(t,!0);let n=M(!1),r=j(()=>YJ.current===`local`),i=j(()=>YJ.current===`test-repo`),a=j(()=>GJ(YJ.current));var o=Tmt(),s=F(o);{let e=j(()=>X(`account`));ru(s,{get ariaLabel(){return B(e)},children:(e,o)=>{var s=Emt(),c=F(s);{let e=j(()=>B(r)?X(`working_with_local_repo`):B(a)?X(`working_in_demo_mode`):B(i)?X(`working_with_test_repo`):X(`signed_in_as_x`,{values:{name:vU.account?.login}})),t=j(()=>B(r)||B(i));iu(c,{get label(){return B(e)},get disabled(){return B(t)},onclick:()=>{hB(vU.account?.profileURL)}})}var l=L(c,2);ql(l,{});var u=L(l,2);{let e=j(()=>X(`live_site`));iu(u,{get label(){return B(e)},onclick:()=>{S$()}})}var d=L(u,2),f=e=>{var t=Tmt(),n=F(t);{let e=j(()=>X(`git_repository`)),t=j(()=>!XJ.current?.repository?.treeBaseURL);iu(n,{get label(){return B(e)},get disabled(){return B(t)},onclick:()=>{hB(XJ.current?.repository?.treeBaseURL)}})}var r=L(n,2);{let e=j(()=>X(`cms_config`));iu(r,{get label(){return B(e)},onclick:()=>{b$(`/config`,{transitionType:`forwards`})}})}W(e,t)};K(d,e=>{CW.devModeEnabled&&e(f)});var p=L(d,2);ql(p,{});var m=L(p,2);{let e=j(()=>X(`settings`));iu(m,{get label(){return B(e)},onclick:()=>{sW.isSmallScreen?b$(`/settings`,{transitionType:`forwards`}):N(n,!0)}})}var h=L(m,2),g=e=>{qpt(e,{get menuButton(){return t.menuButton}})};K(h,e=>{CW.devModeEnabled||e(g)});var _=L(h,2),v=e=>{{let t=j(()=>X(`sign_in_with_mobile`));iu(e,{get label(){return B(t)},onclick:()=>{n9.current=!0}})}};K(_,e=>{upt.current&&e(v)});var y=L(_,2);Bpt(y,{});var b=L(y,2);ql(b,{});var x=L(b,2);{let e=j(()=>X(`sign_out`));iu(x,{get label(){return B(e)},onclick:async()=>{window.requestAnimationFrame(()=>{G9e()})}})}W(e,s)},$$slots:{default:!0}})}wmt(L(s,2),{onClose:()=>{t.menuButton?.focus()},get open(){return B(n)},set open(e){N(n,e,!0)}}),W(e,o),A()}var Omt=V(`<img class="avatar svelte-q0ng4j" loading="lazy" alt=""/>`),kmt=V(`<div role="none" class="wrapper svelte-q0ng4j"><!></div>`),Amt={hash:`svelte-q0ng4j`,code:`.wrapper.svelte-q0ng4j {display:contents;button.avatar {border-width:0;background-color:transparent;}}.avatar.svelte-q0ng4j {width:32px;height:32px;border-radius:32px;object-fit:cover;}`};function jmt(e,t){k(t,!0),q(e,Amt);let n=M(void 0),r=j(()=>YJ.current===`local`),i=j(()=>!!vU.account?.avatarURL);var a=kmt(),o=P(a);{let e=e=>{var t=U(),n=F(t),a=e=>{Lc(e,{name:`arrow_drop_down`,class:`small-arrow`})},o=e=>{var t=Omt();z(()=>J(t,`src`,vU.account?.avatarURL)),W(e,t)},s=e=>{Lc(e,{name:`account_circle`})};K(n,e=>{B(r)?e(a):B(i)?e(o,1):e(s,-1)}),W(e,t)},t=e=>{Dmt(e,{get menuButton(){return B(n)}})},a=j(()=>!B(r)),s=j(()=>B(r)?X(`local_workflow.indicator`):void 0),c=j(()=>B(i)?`avatar`:``),l=j(()=>X(`show_account_menu`));ms(kl(o,{variant:`ghost`,get iconic(){return B(a)},get label(){return B(s)},get class(){return B(c)},popupPosition:`bottom-right`,get"aria-label"(){return B(l)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}}),e=>N(n,e,!0),()=>B(n))}O(a),W(e,a),A()}var Mmt=V(`<!> <!>`,1);function Nmt(e,t){k(t,!0);let n=j(()=>KA({visible:!0,type:`entry`})),r=j(()=>B(n).map(e=>{let{name:t,label:n,label_singular:r,create:i=!0,limit:a=1/0}=e;return{name:t,label:r||n||t,disabled:!i||RY({collection:e})||a<1/0&&h8(t)>=a}})),i=j(()=>GB.current||RY()),a=j(()=>B(i)&&B(r).every(({disabled:e})=>e));{let t=e=>{Lc(e,{name:`add`})},n=e=>{{let t=j(()=>X(`create_entry_or_assets`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=Mmt(),a=F(n),o=e=>{var t=Mmt(),n=F(t);Ro(n,17,()=>B(r),({name:e,label:t,disabled:n})=>e,(e,t)=>{let n=()=>B(t).name,r=()=>B(t).label,i=()=>B(t).disabled;iu(e,{get label(){return r()},get disabled(){return i()},onclick:()=>{b$(`/collections/${n()}/new`,{transitionType:`forwards`})}})}),ql(L(n,2),{}),W(e,t)};K(a,e=>{B(r).length&&e(o)});var s=L(a,2);{let e=j(()=>X(`assets`));iu(s,{get label(){return B(e)},get disabled(){return B(i)},onclick:async()=>{b$(`/assets`,{transitionType:`forwards`}),await Zc(100),UQ.current=!0}})}W(e,n)},$$slots:{default:!0}})}},o=j(()=>X(`create_entry_or_assets`));kl(e,{variant:`ghost`,iconic:!0,get disabled(){return B(a)},popupPosition:`bottom-right`,get"aria-label"(){return B(o)},endIcon:t,popup:n,$$slots:{endIcon:!0,popup:!0}})}A()}var Pmt=V(`<span class="version svelte-wmw2gz"> </span>`),Fmt={hash:`svelte-wmw2gz`,code:`.version.svelte-wmw2gz {border-radius:4px;padding:0 6px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-selected-background-color);font-size:var(--sui-font-size-small);}`};function Imt(e,t){k(t,!0),q(e,Fmt);{let t=e=>{var t=U(),n=F(t),r=e=>{var t=Pmt(),n=I(t);z(e=>{J(t,`aria-label`,`(${e??``})`),G(n,`v${xr??``}`)},[()=>X(`version_x`,{values:{version:xr}})]),W(e,t)};K(n,e=>{CW.devModeEnabled&&e(r)}),W(e,t)},n=j(()=>X(`release_notes`));iu(e,{get label(){return B(n)},onclick:()=>{hB(`https://github.com/sveltia/sveltia-cms/releases`)},endIcon:t,$$slots:{endIcon:!0}})}A()}var u9=(e,t=jr,n=jr)=>{{let r=j(()=>X(t()));iu(e,{get label(){return B(r)},onclick:()=>{hB(n())}})}},Lmt=V(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),Rmt=V(`<!> <!>`,1);function zmt(e,t){k(t,!0);{let n=j(()=>X(`help`));ru(e,{get ariaLabel(){return B(n)},children:(e,n)=>{var r=Rmt(),i=F(r);qpt(i,{get menuButton(){return t.menuButton}});var a=L(i,2),o=e=>{var t=Lmt(),n=F(t);u9(n,()=>`documentation`,()=>`https://sveltiacms.app/en/docs`);var r=L(n,2);Imt(r,{});var i=L(r,2);u9(i,()=>`announcements`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/announcements`);var a=L(i,2);ql(a,{});var o=L(a,2);u9(o,()=>`report_issue`,()=>`https://github.com/sveltia/sveltia-cms/issues`);var s=L(o,2);u9(s,()=>`share_feedback`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/ideas`);var c=L(s,2);u9(c,()=>`get_help`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/q-a`);var l=L(c,2);u9(l,()=>`donate`,()=>`https://github.com/sponsors/kyoshino`);var u=L(l,2);ql(u,{});var d=L(u,2);u9(d,()=>`bluesky`,()=>`https://bsky.app/profile/sveltiacms.app`),u9(L(d,2),()=>`join_discord`,()=>`https://discord.com/invite/5hwCGqup5b`),W(e,t)};K(a,e=>{CW.devModeEnabled&&e(o)}),W(e,r)},$$slots:{default:!0}})}A()}var Bmt=V(`<div role="none" class="wrapper svelte-bzzge3"><!></div>`),Vmt={hash:`svelte-bzzge3`,code:`.wrapper.svelte-bzzge3 {display:contents;}`};function Hmt(e,t){k(t,!0),q(e,Vmt);let n=M(void 0);var r=Bmt(),i=P(r);{let e=e=>{Lc(e,{name:`help`})},t=e=>{zmt(e,{get menuButton(){return B(n)}})},r=j(()=>X(`show_help_menu`));ms(kl(i,{variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return B(r)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}}),e=>N(n,e,!0),()=>B(n))}O(r),W(e,r),A()}function Umt(e,t){k(t,!0);{let t=e=>{Lc(e,{name:`notifications`})},n=j(()=>X(`show_notifications`));ll(e,{variant:`ghost`,iconic:!0,hidden:!0,get"aria-label"(){return B(n)},onclick:()=>{},startIcon:t,$$slots:{startIcon:!0}})}A()}var Wmt=V(`<img alt="" class="logo svelte-15c9hhi"/>`),Gmt={hash:`svelte-15c9hhi`,code:`img.svelte-15c9hhi {width:24px;height:24px;object-fit:contain;}`};function Kmt(e,t){k(t,!0),q(e,Gmt);let n=j(()=>o5.current!==aet&&($O.current?.logo?.show_in_header??!0));var r=U(),i=F(r),a=e=>{{let t=j(()=>X(`visit_live_site`));ll(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return B(t)},onclick:()=>{S$()},children:(e,t)=>{var n=Wmt();z(()=>J(n,`src`,o5.current)),W(e,n)},$$slots:{default:!0}})}};K(i,e=>{B(n)&&e(a)}),W(e,r),A()}var qmt=V(`<div role="none" class="buttons"><!> <!></div> <!> <div role="none" class="buttons"><!> <!> <!> <!> <!></div>`,1),Jmt=V(`<div role="none" class="toolbar-wrapper svelte-1kz79fh"><!></div>`),Ymt={hash:`svelte-1kz79fh`,code:`.toolbar-wrapper.svelte-1kz79fh {display:contents;&[inert] {.sui.search-bar {
|
||
/* Disable the keyboard shortcut for the search bar */display:none !important;}}& > .sui.toolbar {
|
||
@media (width < 768px) {padding:0 4px;
|
||
}.buttons {flex:auto;display:flex;align-items:center;width:50%;&:last-child {justify-content:flex-end;}}.sui.search-bar {flex:none;width:640px;max-width:50%;
|
||
|
||
@media (width < 768px) {flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;max-width:none;
|
||
}}}}`};function Xmt(e,t){k(t,!0),q(e,Ymt);var n=Jmt(),r=P(n);{let e=j(()=>X(`global`));pO(r,{variant:`primary`,get ariaLabel(){return B(e)},children:(e,t)=>{var n=qmt(),r=F(n),i=P(r);Kmt(i,{}),Npt(L(i,2),{}),O(r);var a=L(r,2);I5(a,{});var o=L(a,2),s=P(o);ift(s,{});var c=L(s,2);Nmt(c,{});var l=L(c,2);Umt(l,{});var u=L(l,2),d=e=>{Hmt(e,{})};K(u,e=>{CW.devModeEnabled&&e(d)}),jmt(L(u,2),{}),O(o),W(e,n)},$$slots:{default:!0}})}O(n),z(()=>n.inert=c$.current),W(e,n),A()}var Zmt=V(`<h2 role="none"> </h2> <!>`,1),Qmt=V(`<section><h3 class="svelte-16cq5v7"> </h3> <!></section>`),$mt=V(`<div role="none" class="wrapper svelte-16cq5v7"><!> <section><h3 class="svelte-16cq5v7"> </h3> <!></section> <!></div>`),eht={hash:`svelte-16cq5v7`,code:`.wrapper.svelte-16cq5v7 {overflow-y:auto;height:100%;--sui-menu-border-width: 0;--sui-menu-border-radius: 0;--sui-menu-padding: 8px 0;--sui-menu-divider-margin: 4px 0;}h3.svelte-16cq5v7 {padding:8px 16px;background-color:var(--sui-tertiary-background-color);color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-normal);}`};function tht(e,t){k(t,!0),q(e,eht);{let t=e=>{E5(e,{primaryToolbar:e=>{pO(e,{variant:`primary`,children:(e,t)=>{var n=Zmt(),r=F(n),i=I(r,!0);Ml(L(r,2),{flex:!0}),z(e=>G(i,e),[()=>X(`menu`)]),W(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=$mt(),n=P(t),r=e=>{var t=Qmt(),n=P(t),r=I(n,!0),i=L(n,2);{let e=j(()=>X(`custom_pages`));ru(i,{get ariaLabel(){return B(e)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>t9.current,e=>e.id,(e,t)=>{iu(e,{get label(){return B(t).label},onclick:()=>{Xft(B(t))},startIcon:e=>{Lc(e,{get name(){return B(t).icon}})},$$slots:{startIcon:!0}})}),W(e,n)},$$slots:{default:!0}})}O(t),z(e=>G(r,e),[()=>X(`custom_pages`)]),W(e,t)};K(n,e=>{t9.current.length&&e(r)});var i=L(n,2),a=P(i),o=I(a,!0);Dmt(L(a,2),{}),O(i);var s=L(i,2),c=e=>{var t=Qmt(),n=P(t),r=I(n,!0);zmt(L(n,2),{}),O(t),z(e=>G(r,e),[()=>X(`help`)]),W(e,t)};K(s,e=>{CW.devModeEnabled&&e(c)}),O(t),z(e=>G(o,e),[()=>X(`account`)]),W(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},n=j(()=>X(`menu`));B5(e,{get"aria-label"(){return B(n)},main:t,$$slots:{main:!0}})}A()}var nht=V(`<div> </div> <canvas class="svelte-1eeac91"></canvas>`,1),rht={hash:`svelte-1eeac91`,code:`canvas.svelte-1eeac91 {display:block;margin:32px auto 16px;width:200px !important;height:200px !important;}`};function iht(e,t){k(t,!0),q(e,rht);let n=M(void 0);XO(()=>{if(!B(n)||!n9.current)return;let e=B(n),{origin:t,pathname:r}=window.location,i=ai(CW),a=`${t}${r}#/signin/${E9e({token:vU.account?.token,prefs:i})}`;return CW.devModeEnabled&&console.info(`Mobile sign-in URL:`,a),pN(`qrcode`).then(({toCanvas:t})=>({toCanvas:t,target:e,url:a}))},({toCanvas:e,target:t,url:n})=>{e(t,n)},e=>{console.error(e)});{let t=j(()=>X(`sign_in_with_mobile`));Pl(e,{get title(){return B(t)},size:`small`,showOk:!1,showCancel:!1,showClose:!0,style:`--sui-dialog-small-content-max-height:auto`,get open(){return n9.current},set open(e){n9.current=e},children:(e,t)=>{var r=nht(),i=F(r),a=I(i,!0);ms(L(i,2),e=>N(n,e),()=>B(n)),z(e=>G(a,e),[()=>X(`sign_in_with_mobile_instruction`)]),W(e,r)},$$slots:{default:!0}})}A()}function aht(e,t){k(t,!0);let n=/^\/search\/(?<terms>.+)$/,r=()=>{let{path:e}=p$(),{terms:t}=e.match(n)?.groups??{};t&&t!==O5.current&&(O5.current=t),D5.current??=`contents`};vs(()=>{r(),document.querySelector(`.sui.search-bar input`)?.focus()}),go(`hashchange`,ra,()=>{r()});{let t=e=>{H5(e,{})},n=j(()=>X(`search_results_for_x`,{values:{terms:O5.current}}));B5(e,{get"aria-label"(){return B(n)},main:t,$$slots:{main:!0}})}A()}var d9=V(`<!> <h2 role="none"> </h2>`,1),oht=V(`<!> <!>`,1),sht=V(`<div role="none" class="wrapper svelte-116bna3"><!></div>`),cht={hash:`svelte-116bna3`,code:`.wrapper.svelte-116bna3 {overflow-y:auto;height:100%;--sui-menu-border-width: 0;--sui-menu-border-radius: 0;--sui-menu-padding: 8px 0;& > .container {display:block;padding:16px;}}`};function lht(e,t){k(t,!0),q(e,cht);let n=/^\/settings(?:\/(?<panelKey>.+))?$/,r=M(void 0),i=M(!1),a=()=>{let{path:e}=p$(),t=e.match(n);if(!t?.groups)return;let{panelKey:a}=t.groups;N(r,a?l9.current.find(e=>e.key===a):void 0,!0),N(i,!!a&&!B(r),!0),B(i)&&(u$.current=X(`page_not_found`))};vs(()=>{a()}),go(`hashchange`,ra,e=>{y$(e,a,n)});{let t=e=>{E5(e,{primaryToolbar:e=>{pO(e,{variant:`primary`,children:(e,t)=>{var n=oht(),a=F(n),o=e=>{var t=d9(),n=F(t);b5(n,{onclick:()=>x$(`/settings`)});var i=I(L(n,2),!0);z(e=>G(i,e),[()=>X(`prefs.${B(r).key}.title`)]),W(e,t)},s=e=>{var t=d9(),n=F(t);b5(n,{onclick:()=>x$(`/settings`)});var r=I(L(n,2),!0);z(e=>G(r,e),[()=>X(`page_not_found`)]),W(e,t)},c=e=>{var t=d9(),n=F(t);b5(n,{onclick:()=>x$(`/menu`)});var r=I(L(n,2),!0);z(e=>G(r,e),[()=>X(`settings`)]),W(e,t)};K(a,e=>{B(r)?e(o):B(i)?e(s,1):e(c,-1)}),Ml(L(a,2),{flex:!0}),W(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=sht(),n=P(t),a=e=>{xmt(e,{get Panel(){return B(r).component}})},o=e=>{{let t=j(()=>X(`page_not_found`));C5(e,{get message(){return B(t)},backPath:`/settings`})}},s=e=>{{let t=j(()=>X(`settings`));ru(e,{get ariaLabel(){return B(t)},children:(e,t)=>{var n=U();Ro(F(n),17,()=>l9.current,({key:e,icon:t,enabled:n=!0})=>e,(e,t)=>{let n=()=>B(t).key,r=()=>B(t).icon,i=Ei(()=>Nr(B(t).enabled,!0));var a=U(),o=F(a),s=e=>{{let t=e=>{Lc(e,{get name(){return r()}})},i=j(()=>X(`prefs.${n()}.title`));iu(e,{get label(){return B(i)},onclick:()=>b$(`/settings/${n()}`,{transitionType:`forwards`}),startIcon:t,$$slots:{startIcon:!0}})}};K(o,e=>{B(i)&&e(s)}),W(e,a)}),W(e,n)},$$slots:{default:!0}})}};K(n,e=>{B(r)?e(a):B(i)?e(o,1):e(s,-1)}),O(t),W(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},n=j(()=>X(`settings`));B5(e,{get"aria-label"(){return B(n)},main:t,$$slots:{main:!0}})}A()}function uht(e,t){k(t,!0);let n={pending:{label:`deploy_preview.short.building`,tone:`warning`},error:{label:`deploy_preview.short.failed`,tone:`error`}},r=j(()=>n[t.state]);var i=U(),a=F(i),o=e=>{{let n=j(()=>X(B(r).label));Clt(e,{get tone(){return B(r).tone},get label(){return B(n)},get class(){return`deploy-status-badge ${t.state??``}`}})}};K(a,e=>{B(r)&&e(o)}),W(e,i),A()}var dht=V(`<p class="companions svelte-1nx78nt"> </p>`),fht=V(`<span role="none" class="author svelte-1nx78nt"><bdi> </bdi></span>`),pht=V(`<span role="none" class="note svelte-1nx78nt"> </span>`),mht=V(`<div role="listitem"><button type="button" class="summary svelte-1nx78nt"><!> <span role="none" class="text svelte-1nx78nt"><span role="none" class="collection svelte-1nx78nt"><bdi> </bdi></span> <span role="none" class="title svelte-1nx78nt"><bdi> </bdi></span></span></button> <!> <footer role="none" class="svelte-1nx78nt"><div role="none" class="meta svelte-1nx78nt"><!> <span role="none" class="date svelte-1nx78nt"> </span> <!> <!></div> <div role="none" class="actions svelte-1nx78nt"><!> <!> <!></div></footer></div>`),hht={hash:`svelte-1nx78nt`,code:`.card.svelte-1nx78nt {display:flex;flex-direction:column;gap:4px;border:1px solid var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);padding:8px 12px;background-color:var(--sui-primary-background-color);cursor:grab;&.dragging {opacity:0.5;}&.static {cursor:default;}}.summary.svelte-1nx78nt {display:flex;align-items:center;gap:8px;border:0;padding:0;background:none;color:inherit;font-family:inherit;text-align:left;cursor:pointer;&:disabled {cursor:default;}
|
||
|
||
/* Let the label column shrink instead of pushing the thumbnail out of the card */.text:where(.svelte-1nx78nt) {display:flex;flex-direction:column;gap:2px;min-width:0;}}.collection.svelte-1nx78nt {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.title.svelte-1nx78nt {font-size:var(--sui-font-size-default);line-height:1.4;overflow-wrap:anywhere;}.companions.svelte-1nx78nt {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);overflow-wrap:anywhere;}footer.svelte-1nx78nt {display:flex;align-items:center;justify-content:space-between;gap:8px;.meta:where(.svelte-1nx78nt) {display:flex;align-items:center;gap:6px;min-width:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}
|
||
|
||
/* Let a long user name truncate rather than push the date out of the card */.author:where(.svelte-1nx78nt) {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.date:where(.svelte-1nx78nt),
|
||
.note:where(.svelte-1nx78nt) {flex:none;}.author:where(.svelte-1nx78nt) + .date:where(.svelte-1nx78nt)::before,
|
||
.date:where(.svelte-1nx78nt) + .note:where(.svelte-1nx78nt)::before {margin-inline-end:6px;content:'\\00B7'; /* middle dot */}.actions:where(.svelte-1nx78nt) {display:flex;flex:none;align-items:center;}}`};function f9(e,t){k(t,!0),q(e,hht);let n=Y(t,`dragging`,3,!1),r=Y(t,`busy`,3,!1),i=Y(t,`deploying`,3,!1),a=Y(t,`onDragStart`,3,void 0),o=Y(t,`onDragEnd`,3,void 0),s=Y(t,`onDelete`,3,void 0),c=Y(t,`onPublish`,3,void 0),l=j(()=>t.entry.workflow),u=j(()=>B(l).collectionName),d=j(()=>B(l).fileName),f=j(()=>B(l).status),p=j(()=>B(l).pullRequest),m=j(()=>B(f)===`pending_deletion`),h=j(()=>YA(B(u))),g=j(()=>B(h)&&B(d)?ij(B(h),B(d)):void 0),_=j(()=>RY({collection:B(h),collectionFile:B(g)})),v=j(()=>!B(m)&&!i()&&!B(_)&&$J(B(h)).length>1),y=j(()=>(B(g)??B(h))?._i18n?.defaultLocale),b=j(()=>i()?$G.current:B(p).headSHA),x=j(()=>(B(b)?QG.current[B(b)]?.state:void 0)??`unknown`),S=j(()=>Fc.current?u6e(t.entry):t.entry.slug),C=j(()=>d6e(t.entry,Fc.current)),w=j(()=>Fc.current&&B(h)?XA(B(h),{useSingular:!0}):``),T=j(()=>!i()&&!B(_)&&jY(t.entry,B(h))),ee=j(()=>FY(t.entry)),E=j(()=>!i()&&!B(_)&&(B(ee)||B(h)?._type!==`entry`||B(h).delete!==!1)),te=j(()=>i()&&B(m)),ne=j(()=>B(m)||B(ee)?`undo`:`delete`);var re=mht();let ie;var ae=P(re),oe=P(ae),se=e=>{V5(e,{get collection(){return B(h)},get entry(){return t.entry},variant:`icon`})};K(oe,e=>{B(h)?._type===`entry`&&e(se)});var ce=L(oe,2),le=P(ce),ue=I(P(le),!0);O(le);var de=L(le,2),fe=I(P(de),!0);O(de),O(ce),O(ae);var pe=L(ae,2);Ro(pe,16,()=>B(C),e=>e,(e,t)=>{var n=dht(),r=I(n,!0);z(()=>G(r,t)),W(e,n)});var me=L(pe,2),he=P(me),ge=P(he),_e=e=>{var t=fht(),n=I(P(t),!0);O(t),z(()=>G(n,B(p).author.name)),W(e,t)};K(ge,e=>{B(p).author?.name&&e(_e)});var ve=L(ge,2),ye=I(ve,!0),be=L(ve,2),xe=e=>{var t=pht(),n=I(t,!0);z(e=>G(n,e),[()=>X(`workflow.deploying_deletion`)]),W(e,t)};K(be,e=>{B(te)&&e(xe)}),uht(L(be,2),{get state(){return B(x)}}),O(he);var Se=L(he,2),Ce=P(Se),we=e=>{{let n=j(()=>i()?void 0:B(p));G5(e,{get entry(){return t.entry},get locale(){return B(y)},get collection(){return B(h)},get collectionFile(){return B(g)},get pullRequest(){return B(n)},size:`small`,iconic:!0})}};K(Ce,e=>{B(h)&&B(y)&&!B(te)&&e(we)});var Te=L(Ce,2),Ee=e=>{{let t=e=>{Lc(e,{get name(){return B(ne)}})},n=j(()=>B(m)?X(`workflow.cancel_deletion`):B(ee)?X(`workflow.discard_changes`):X(`delete_entries`,{values:{count:1}}));ll(e,{variant:`ghost`,size:`small`,iconic:!0,get disabled(){return r()},get"aria-label"(){return B(n)},onclick:()=>{s()?.()},startIcon:t,$$slots:{startIcon:!0}})}};K(Te,e=>{B(E)&&e(Ee)});var De=L(Te,2),Oe=e=>{{let t=e=>{{let t=j(()=>B(m)?`delete`:`publish`);Lc(e,{get name(){return B(t)}})}},n=j(()=>B(m)?X(`delete_entries`,{values:{count:1}}):X(`workflow.publish_entry`));ll(e,{variant:`primary`,size:`small`,iconic:!0,get disabled(){return r()},get"aria-label"(){return B(n)},onclick:()=>{c()?.()},startIcon:t,$$slots:{startIcon:!0}})}};K(De,e=>{B(T)&&e(Oe)}),O(Se),O(me),O(re),z(e=>{ie=rs(re,1,`card svelte-1nx78nt`,null,ie,{dragging:n(),static:!B(v)}),J(re,`draggable`,!r()&&B(v)),J(ae,`aria-label`,B(S)),ae.disabled=B(te),G(ue,B(w)),G(fe,B(S)),G(ye,e)},[()=>B(p).updatedDate.toLocaleDateString(Fc.current,{month:`short`,day:`numeric`})]),go(`dragstart`,re,e=>{e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,B(p).branch)),a()?.()}),go(`dragend`,re,()=>{o()?.()}),_o(`click`,ae,()=>{b$(oP(`/collections/${B(u)}/entries/${B(d)??t.entry.subPath}`),{transitionType:`forwards`})}),W(e,re),A()}vo([`click`]);var ght=V(`<h2 role="none"> </h2> <!> <!>`,1),_ht=V(`<span role="none"> </span>`),vht=V(`<header role="none" class="svelte-ljqw9n"><h3 role="none" class="svelte-ljqw9n"> </h3></header> <div role="list"></div>`,1),yht=V(`<header role="none" class="svelte-ljqw9n"><h3 role="none" id="deletions-title" class="svelte-ljqw9n"> </h3></header> <div role="list" class="entries svelte-ljqw9n"></div>`,1),bht=V(`<div role="none" class="tray svelte-ljqw9n"><!></div>`),xht=V(`<header role="none" class="svelte-ljqw9n"><h3 role="none" id="deploying-title" class="svelte-ljqw9n"> </h3></header> <div role="list" class="entries svelte-ljqw9n"></div>`,1),Sht=V(`<div role="none"><div role="none" class="columns svelte-ljqw9n"></div> <!> <!></div>`),Cht=V(`<!> <!> <!> <!>`,1),wht={hash:`svelte-ljqw9n`,code:`
|
||
/*
|
||
* Entries awaiting removal, and merged ones the site hasn’t caught up with, are listed in trays
|
||
* below the board rather than as extra columns: they have no stages to move through, and a
|
||
* column would take a share of the width for something rare
|
||
*/.board.svelte-ljqw9n {flex:auto;display:flex;flex-direction:column;overflow:hidden;}
|
||
|
||
/*
|
||
* With a single column, as with Preview Workflow, the cards would be stretched across the page,
|
||
* so they’re laid out in a grid instead, both in the column and in the trays below it
|
||
*/.board.single.svelte-ljqw9n .entries:where(.svelte-ljqw9n) {display:grid;grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));align-content:start;}.tray.svelte-ljqw9n {flex:none;display:flex;flex-direction:column;max-height:33%;border-block-start:1px solid var(--sui-secondary-border-color);background-color:var(--sui-primary-background-color);.group {display:flex;flex-direction:column;overflow:hidden;}header:where(.svelte-ljqw9n) {display:flex;align-items:center;padding:0 16px;height:40px;background-color:var(--sui-tertiary-background-color);h3:where(.svelte-ljqw9n) {font-size:var(--sui-font-size-x-large);}}
|
||
|
||
/* Mirror the board’s track count, so a card here is the same size as one in a column */.entries:where(.svelte-ljqw9n) {display:grid;grid-template-columns:repeat(var(--column-count), 1fr);gap:8px;padding:8px;overflow-y:auto;
|
||
|
||
@media (width < 768px) {grid-template-columns:1fr;
|
||
}}}.columns.svelte-ljqw9n {flex:auto;display:flex;gap:4px;background-color:var(--sui-secondary-background-color); /* same as toolbar */
|
||
|
||
@media (width < 768px) {flex-direction:column;gap:0;
|
||
}.column {flex:auto;display:flex;flex-direction:column;width:calc(100% / var(--column-count));background-color:var(--sui-primary-background-color);
|
||
|
||
@media (width < 768px) {width:100%;height:calc(100% / var(--column-count));
|
||
}}header:where(.svelte-ljqw9n) {flex:none;display:flex;align-items:center;padding:0 16px;height:40px;background-color:var(--sui-tertiary-background-color);h3:where(.svelte-ljqw9n) {font-size:var(--sui-font-size-x-large);}}.entries:where(.svelte-ljqw9n) {flex:auto;display:flex;flex-direction:column;gap:8px;padding:8px;overflow-y:auto;&.drop-target {background-color:var(--sui-selected-background-color);}}}`};function Tht(e,t){k(t,!0),q(e,wht);let n=M(void 0),r=M(void 0),i=M(void 0),a=M(!1),o=M(!1),s=M(`info`),c=M(``),l=M(!1),u=M([]),d=M(!1),f=({workflow:{pullRequest:{branch:e}}})=>B(u).includes(e)||fY.current.includes(e),p=j(()=>FY(B(i))),m=j(()=>B(i)?.workflow.status===`pending_deletion`),h=j(()=>w7({pendingDeletion:B(m),publishedVersionExists:B(p)})),g=j(()=>_lt({deletion:B(m)})),_=j(()=>l6e(aY.current,lY.current,rY)),v=j(()=>B(_).columns),y=j(()=>B(_).pendingDeletions),b=j(()=>A9e.current);R(()=>Hot());let x=!1,S=(e,t)=>{N(s,e,!0),N(c,t,!0),N(l,!0)},C=async(e,t,n,r=()=>X(t.error))=>{S(`info`,X(t.info));try{await e,S(`success`,X(t.success))}catch(e){S(`error`,r(e)),console.error(e)}finally{n()}},w=async(e,t,n)=>{let{branch:r}=e.workflow.pullRequest;N(u,[...B(u),r]),await C(t,n,()=>{N(u,B(u).filter(e=>e!==r))},e=>v7(e,n.error))},T=async()=>{N(d,!0),await C(B8({fresh:!0}),n6e,()=>{N(d,!1)})},ee=e=>{S(`error`,X(e))},E=e=>{N(i,e),N(a,!0)},te=e=>{N(i,e),N(o,!0)},ne=async e=>{let t=SY(B(n)?.id);N(n,void 0),N(r,void 0),t&&rY(t)!==e&&iY(t,e)&&(Dlt({entry:t,status:e})?await w(t,x7(t,e),t6e):ee(`workflow.status_change_blocked`))};R(()=>{if(x||!pY.current)return;x=!0;let{key:e,values:t}=c6e(B(v),B(y));u$.current=X(e,{values:t})});var re=Cht(),ie=F(re);{let e=e=>{{let t=e=>{pO(e,{variant:`primary`,children:(e,t)=>{var n=ght(),r=F(n),i=I(r,!0),a=L(r,2);Ml(a,{flex:!0});var o=L(a,2);{let e=e=>{Lc(e,{name:`refresh`})},t=j(()=>X(`workflow.refresh`)),n=j(()=>!pY.current||B(d));ll(o,{variant:`ghost`,iconic:!0,get"aria-label"(){return B(t)},get disabled(){return B(n)},onclick:T,startIcon:e,$$slots:{startIcon:!0}})}z(e=>G(i,e),[()=>X(oY.current)]),W(e,n)},$$slots:{default:!0}})},i=e=>{var t=U(),i=F(t),a=e=>{DO(e,{children:(e,t)=>{var n=_ht(),r=I(n,!0);z(e=>G(r,e),[()=>X(`loading_entries`,{values:{count:2}})]),W(e,n)},$$slots:{default:!0}})},o=e=>{var t=Sht();let i,a;var o=P(t);Ro(o,21,()=>B(v),({status:e,entries:t})=>e,(e,t)=>{let i=()=>B(t).status,a=()=>B(t).entries;OO(e,{class:`column`,get"aria-labelledby"(){return`${i()??``}-column-title`},children:(e,t)=>{var o=vht(),s=F(o),c=P(s),l=I(c,!0);O(s);var u=L(s,2);let d;Ro(u,21,a,e=>e.id,(e,t)=>{{let i=j(()=>f(B(t))),a=j(()=>B(n)?.id===B(t).id);f9(e,{get entry(){return B(t)},get busy(){return B(i)},get dragging(){return B(a)},onDragStart:()=>{N(n,B(t))},onDragEnd:()=>{N(n,void 0),N(r,void 0)},onDelete:()=>E(B(t)),onPublish:()=>te(B(t))})}},e=>{DO(e,{children:(e,t)=>{var n=_ht(),r=I(n,!0);z(e=>G(r,e),[()=>X(`workflow.no_entries`)]),W(e,n)},$$slots:{default:!0}})}),O(u),z((e,t)=>{J(c,`id`,`${i()??``}-column-title`),G(l,e),d=rs(u,1,`entries svelte-ljqw9n`,null,d,{"drop-target":B(r)===i()}),J(u,`aria-label`,t)},[()=>X(e6e[i()]),()=>X(e6e[i()])]),go(`dragover`,u,e=>{B(n)&&iY(B(n),i())&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),N(r,i(),!0))}),go(`dragleave`,u,()=>{B(r)===i()&&N(r,void 0)}),go(`drop`,u,e=>{e.preventDefault(),ne(i())}),W(e,o)},$$slots:{default:!0}})}),O(o);var s=L(o,2),c=e=>{var t=bht();OO(P(t),{class:`group`,"aria-labelledby":`deletions-title`,children:(e,t)=>{var n=yht(),r=F(n),i=I(P(r),!0);O(r);var a=L(r,2);Ro(a,21,()=>B(y),e=>e.id,(e,t)=>{{let n=j(()=>f(B(t)));f9(e,{get entry(){return B(t)},get busy(){return B(n)},onDelete:()=>E(B(t)),onPublish:()=>te(B(t))})}}),O(a),z((e,t)=>{G(i,e),J(a,`aria-label`,t)},[()=>X(`status.pending_deletion`),()=>X(`status.pending_deletion`)]),W(e,n)},$$slots:{default:!0}}),O(t),W(e,t)};K(s,e=>{B(y).length&&e(c)});var l=L(s,2),u=e=>{var t=bht();OO(P(t),{class:`group`,"aria-labelledby":`deploying-title`,children:(e,t)=>{var n=xht(),r=F(n),i=I(P(r),!0);O(r);var a=L(r,2);Ro(a,21,()=>B(b),({entry:e})=>e.workflow.pullRequest.branch,(e,t)=>{let n=()=>B(t).entry;f9(e,{get entry(){return n()},deploying:!0})}),O(a),z((e,t)=>{G(i,e),J(a,`aria-label`,t)},[()=>X(`status.deploying`),()=>X(`status.deploying`)]),W(e,n)},$$slots:{default:!0}}),O(t),W(e,t)};K(l,e=>{B(b).length&&e(u)}),O(t),z(()=>{i=rs(t,1,`board svelte-ljqw9n`,null,i,{single:B(v).length===1}),a=as(t,``,a,{"--column-count":B(v).length})}),W(e,t)};K(i,e=>{pY.current?e(o,-1):e(a)}),W(e,t)},a=j(()=>X(oY.current));E5(e,{get"aria-label"(){return B(a)},primaryToolbar:t,mainContent:i,$$slots:{primaryToolbar:!0,mainContent:!0}})}},t=j(()=>X(oY.current));B5(ie,{get"aria-label"(){return B(t)},main:e,$$slots:{main:!0}})}var ae=L(ie,2);Il(ae,{get title(){return B(h).title},get okLabel(){return B(h).label},onOk:async()=>{let e=SY(B(i)?.id);e&&await w(e,S7(e),o6e(EY(e)))},get open(){return B(a)},set open(e){N(a,e,!0)},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(h).message)),W(e,n)},$$slots:{default:!0}});var oe=L(ae,2);Il(oe,{get title(){return B(g).title},get okLabel(){return B(g).label},onOk:async()=>{let e=SY(B(i)?.id);e&&(Olt({entry:e})?await w(e,ult(e,B(i)),s6e(EY(e))):ee(`workflow.publish_blocked`))},get open(){return B(o)},set open(e){N(o,e,!0)},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(g).message)),W(e,n)},$$slots:{default:!0}});var se=L(oe,2),ce=e=>{Pu(e,{get id(){return B(c)},get show(){return B(l)},set show(e){N(l,e,!0)},children:(e,t)=>{Vc(e,{get status(){return B(s)},children:(e,t)=>{$r();var n=H();z(()=>G(n,B(c))),W(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};K(se,e=>{B(c)&&e(ce)}),W(e,re),A()}var Eht=V(`<!> <!>`,1),Dht=V(`<!> <!> <!> <!> <div role="none" class="page-root svelte-1a6c577"><!></div> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),Oht={hash:`svelte-1a6c577`,code:`.page-root.svelte-1a6c577 {position:relative;flex:auto;display:flex;flex-direction:column;overflow:hidden;view-transition-name:page-root;}`};function kht(e,t){k(t,!0),q(e,Oht);let n=`not-found`,r=j(()=>({collections:zft,assets:wat,search:sW.isSmallScreen?aht:D5.current?{contents:zft,assets:wat}[D5.current]:aht,workflow:Tht,config:Wat,pages:tpt,menu:tht,settings:lht})),i=j(()=>l$.current===n?kpt:B(r)[l$.current]),a=()=>{if($We())return;let{path:e}=p$(),t=nGe(e,Object.keys(B(r)));e9.current=Jft(e),`redirect`in t?window.location.replace(t.redirect):`notFound`in t?(l$.current=n,D5.current=null):(l$.current!==t.pageName&&(l$.current=t.pageName),t.searchMode!==void 0&&(D5.current=t.searchMode))};vs(()=>{a()});var o=Dht();go(`hashchange`,ra,()=>{a()});var s=F(o);ypt(s,{});var c=L(s,2);Tpt(c,{});var l=L(c,2),u=e=>{var t=Eht(),n=F(t);Spt(n,{}),iht(L(n,2),{}),W(e,t)};K(l,e=>{upt.current&&e(u)});var d=L(l,2),f=e=>{Xmt(e,{})};K(d,e=>{sW.isSmallScreen||e(f)});var p=L(d,2);Wo(P(p),()=>B(i),(e,t)=>{t(e,{})}),O(p);var m=L(p,2),h=e=>{Fpt(e,{})};K(m,e=>{sW.isSmallScreen&&e(h)});var g=L(m,2);Vat(g,{});var _=L(g,2);Bat(_,{});var v=L(_,2);kat(v,{});var y=L(v,2);Wft(y,{});var b=L(y,2);Hft(b,{});var x=L(b,2);Gft(x,{});var S=L(x,2);Opt(S,{});var C=L(S,2);gpt(C,{}),Dat(L(C,2),{}),W(e,o),A()}function Aht(e,t){k(t,!0);let n=j(()=>LB.current),r=j(()=>!!B(n));{let t=j(()=>X(`open_authoring.fork_repository`)),i=j(()=>X(`open_authoring.fork`));Il(e,{get title(){return B(t)},get okLabel(){return B(i)},onOk:()=>{B(n)?.respond(!0)},onClose:()=>{B(n)?.respond(!1)},get open(){return B(r)},set open(e){N(r,e)},children:(e,t)=>{$r();var r=H();z(e=>G(r,e),[()=>X(`open_authoring.confirm_forking_repository`,{values:{repo:B(n).repo}})]),W(e,r)},$$slots:{default:!0}})}A()}var jht=V(` <!>`,1),Mht=V(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Nht(e,t){k(t,!0);let n=i9(`openAuthoringNotice`),r=j(()=>MB.current),i=j(()=>IB(B(r))),a=j(()=>kMe(XJ.current?.repository,B(r)));R(()=>{B(r)&&n.showIfNeeded()});var o=U(),s=F(o),c=e=>{var t=Mht(),r=F(t);Po(r,()=>({"--sui-infobar-message-justify-content":`center`})),ul(r.lastChild,{get show(){return n.show.current},onDismiss:()=>{n.hide()},children:(e,t)=>{$r();var r=jht(),o=F(r),s=L(o),c=e=>{{let t=j(()=>X(`open_authoring.view_fork`));ll(e,{variant:`link`,get label(){return B(t)},onclick:()=>{hB(B(a)),n.hide()}})}};K(s,e=>{B(a)&&e(c)}),z(e=>G(o,`${e??``} `),[()=>X(`open_authoring.contributing_via_fork`,{values:{repo:B(i)}})]),W(e,r)},$$slots:{default:!0}}),O(r),W(e,t)};K(s,e=>{B(r)&&e(c)}),W(e,o),A()}var Pht=u(s(((e,t)=>{var n=Object.getPrototypeOf({});function r(){return function(e){return typeof e==`object`&&!!e&&!(e instanceof RegExp)&&!(e instanceof Date)}}function i(e){function t(e){return e!==`constructor`&&e!==`prototype`&&e!==`__proto__`}function i(e){let t=0,n=e.length,r=Array(n);for(;t<n;++t)r[t]=h(e[t]);return r}function a(e){let r={};if(u&&Object.getPrototypeOf(e)!==n)return u(e);let i=l(e),a,o,s;for(a=0,o=i.length;a<o;++a)t(s=i[a])&&(r[s]=h(e[s]));return r}function o(e,t){let n=e.length,r=t.length,i=0,a=Array(n+r);for(;i<n;++i)a[i]=h(e[i]);for(i=0;i<r;++i)a[i+n]=h(t[i]);return a}let s=Object.prototype.propertyIsEnumerable;function c(e){let t=Object.keys(e),n=Object.getOwnPropertySymbols(e);for(let r=0,i=n.length;r<i;++r)s.call(e,n[r])&&t.push(n[r]);return t}let l=e?.symbols?c:Object.keys,u=typeof e?.cloneProtoObject==`function`?e.cloneProtoObject:void 0,d=typeof e?.isMergeableObject==`function`?e.isMergeableObject:r(),f=e?.onlyDefinedProperties===!0;function p(e){return typeof e!=`object`||!e}let m=e&&typeof e.mergeArray==`function`?e.mergeArray({clone:h,deepmerge:_,getKeys:l,isMergeableObject:d}):o;function h(e){return d(e)?Array.isArray(e)?i(e):a(e):e}function g(e,r){let i={},a=l(e),o=l(r),s,c,p;for(s=0,c=a.length;s<c;++s)t(p=a[s])&&o.indexOf(p)===-1&&(i[p]=h(e[p]));for(s=0,c=o.length;s<c;++s)if(t(p=o[s])){if(p in e)a.indexOf(p)!==-1&&(u&&d(r[p])&&Object.getPrototypeOf(r[p])!==n?i[p]=u(r[p]):i[p]=_(e[p],r[p]));else{if(f&&r[p]===void 0)continue;i[p]=h(r[p])}}return i}function _(e,t){if(f&&t===void 0)return h(e);let n=Array.isArray(t),r=Array.isArray(e);return p(t)?t:d(e)?n&&r?m(e,t):n===r?g(e,t):h(t):h(t)}function v(){switch(arguments.length){case 0:return{};case 1:return h(arguments[0]);case 2:return _(arguments[0],arguments[1])}let e;for(let t=0,n=arguments.length;t<n;++t)e=_(e,arguments[t]);return e}return e?.all?v:_}t.exports=i,t.exports.default=i,t.exports.deepmerge=i,Object.defineProperty(t.exports,"isMergeableObject",{get:r})}))(),1),Fht=({collection:e,file:t})=>{let n=XE(t.file);if(!n.includes(`{{locale}}`))return{_default:n};let r=UA(e,t);return Object.fromEntries(r.allLocales.map(e=>[e,jA({_i18n:r,locale:e,path:n})]))},Iht=(e,t)=>{if(lk(t))return{collectionName:e.name,fileName:t.name,filePathMap:Fht({collection:e,file:t})}},Lht=(e,t)=>$E(Object.values(e.filePathMap??{})[0],Object.values(t.filePathMap??{})[0]),Rht=({collections:e})=>KA({collections:e,type:`entry`}).map(e=>{let{name:t,folder:n,file:r}=e;if(typeof r==`string`)return{collectionName:t,filePathMap:{_default:XE(r)}};let i=XE(n),a=UA(e),{allLocales:o,defaultLocale:s,omitDefaultLocaleFromFilePath:c,structureMap:{i18nMultiRootFolder:l}}=a,u=e=>SA(i)?jA({_i18n:a,locale:e,path:i}):l?c&&e===s?i:`${e}/${i}`:i;return{collectionName:t,folderPath:i,folderPathMap:Object.fromEntries(o.map(e=>[e,u(e)]))}}).sort((e,t)=>$E(e.folderPath??e.filePathMap._default,t.folderPath??t.filePathMap._default)),zht=({collections:e})=>KA({collections:e,type:`file`}).flatMap(e=>(e.files??[]).map(t=>Iht(e,t))).filter(e=>!!e).sort(Lht),Bht=({singletons:e})=>{let t=Array.isArray(e)?uk(e):[];if(!t.length)return[];let n={name:`_singletons`,files:t};return t.map(e=>Iht(n,e)).filter(e=>!!e).sort(Lht)},Vht=e=>[...Rht(e),...zht(e),...Bht(e)],Hht=`https://sveltiacms.app/en/docs/api/initialization#providing-a-full-configuration`,Uht=`https://sveltiacms.app/en/docs/config-basics#validation-and-autocomplete`,Wht=(0,Pht.default)({all:!0}),p9=new Map,Ght=e=>{let t=new URL(e);return t.searchParams.set(`_`,Date.now().toString()),fetch(t)},Kht=async({href:e,type:t=`application/yaml`},{manualInit:n=!1,showSchemaTip:r}={})=>{let i;if(!fSe.includes(t))throw Error(X(`config.error.parse_failed`),{cause:Error(X(`config.error.parse_failed_unsupported_type`))});let a=$k(X(n?`config.error.fetch_failed_with_manual_init`:`config.error.fetch_failed`),Hht);try{let t=new URL(e,window.location.href),n=p9.get(t.href);p9.delete(t.href),i=await(n??Ght(t))}catch(e){throw Error(a,{cause:e})}let{ok:o,status:s}=i;if(!o)throw Error(a,{cause:Error(X(`config.error.fetch_failed_not_ok`,{values:{status:s}}))});let c=!1,l;try{if(t===`application/json`)l=await i.json(),D(l)&&l.$schema!==`https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`&&(c=!0);else{let e=await i.text();t===`application/toml`?(l=PDe(e),e.includes(`#:schema https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`)||(c=!0)):(l=IDe(e,{merge:!0,maxAliasCount:-1}),e.includes(`# yaml-language-server: $schema=https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`)||(c=!0))}}catch(e){throw Error(X(`config.error.parse_failed`),{cause:e})}if(!D(l))throw Error(X(`config.error.parse_failed`),{cause:Error(X(`config.error.parse_failed_invalid_object`))});return r&&c&&console.info(X(`config.schema_tip`,{values:{link:Uht}})),l},qht=e=>{if(e=e.replace(/^\/+/,`/`),e.endsWith(`/`))return`${e}config.yml`;let t=e.split(`/`);return t.pop()?.includes(`.`)?`${t.join(`/`)}/config.yml`:`${e}/config.yml`},Jht=e=>{let{origin:t}=window.location;return e.every(({href:e})=>iW(e,t))},Yht=()=>{let e=[...document.querySelectorAll(`link[rel="cms-config-url"]`)].map(({href:e,type:t})=>({href:e,type:t||void 0}));return e.length||e.push(VO?{href:`${VO}/admin/config.yml`}:{href:qht(window.location.pathname)}),e},Xht=()=>{let e=Yht();Jht(e)&&e.forEach(({href:e})=>{try{let t=new URL(e,window.location.href);if(!p9.has(t.href)){let e=Ght(t);e.catch(()=>{}),p9.set(t.href,e)}}catch{}})},Zht=async({manualInit:e=!1}={})=>{let t=Yht();if(!Jht(t))throw Error(X(`config.error.insecure_urls`,{values:{count:t.length}}));let n=sW.isLocalHost&&!e&&t.length===1,r;try{r=await Promise.all(t.map(t=>Kht(t,{manualInit:e,showSchemaTip:n})))}finally{p9.clear()}return r.length===1?r[0]:Wht(...r)},Qht=[{type:`warning`,prop:`use_graphql`,strKey:`unsupported_ignored_option`}],$ht=`https://sveltiacms.app/en/docs/backends#supported-backends`,egt=`https://sveltiacms.app/en/docs/backends/BACKEND_NAME#authentication`,tgt={gitea:`gitea-forgejo`,forgejo:`gitea-forgejo`},ngt=`https://sveltiacms.app/en/docs/workflows/open`,rgt=[`api_root`,`graphql_api_root`,`base_url`],igt=/^\.|\.lock$|[\x00-\x20\x7f~^:?*[\\]|@\{/,agt=e=>e.split(`/`).every(e=>!igt.test(e)),ogt=(e,t)=>{let{backend:n}=e,{errors:r,warnings:i}=t;if(!D(n)){r.add(X(`config.error.missing_backend`));return}let{name:a}=n;if(!a){r.add(X(`config.error.missing_backend_name`));return}if(!oHe.includes(a)){let e=aHe[a],t=e?e.deprecated?`deprecated`:`known`:`custom`,n=e?.label,i=$k(X(`config.error.unsupported_${t}_backend`,{values:{name:n}}),`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#compatibility`),o=$k(X(`config.error.unsupported_backend_suggestion`),$ht);r.add(`${i} ${o}`);return}let{root_dir:o}=n;if(typeof o==`string`&&(o.split(`/`).includes(`..`)?r.add(X(`config.error.invalid_root_dir`)):gq(e)&&!agt(vH(o))&&r.add(X(`config.error.invalid_root_dir_branch`))),a in FJ){let{repo:o,automatic_deployments:s,auth_methods:c,auth_type:l,app_id:u,open_authoring:d,auth_scope:f,api_root:p}=n;Array.isArray(c)&&!c.length&&r.add(X(`config.error.no_auth_methods`)),a===`github`&&Array.isArray(f)&&!f.some(e=>e===`repo`||e===`public_repo`)&&r.add(X(`config.error.auth_scope_no_repo`));let m=!c||c.includes(`token`),h=egt.replace(`BACKEND_NAME`,tgt[a]??a);o===void 0?r.add(X(`config.error.missing_repository`)):typeof o==`string`&&/^[^/:]+(?:\/[^/:]+)+$/.test(o)||r.add(X(`config.error.invalid_repository`)),a===`forgejo`&&p===void 0&&r.add(X(`config.error.missing_api_root`)),l===`implicit`&&r.add($k(X(`config.error.oauth_implicit_flow`),h)),a===`github`&&l===`pkce`&&r.add($k(X(`config.error.github_pkce_unsupported`),h)),a===`gitlab`&&l===`pkce`&&!u&&r.add(X(`config.error.oauth_no_app_id`)),d&&(mq(pq({cmsConfig:e}))||r.add($k(X(`config.error.open_authoring_no_workflow`),ngt)),a===`github`&&f===void 0&&i.add(`The \`open_authoring\` option is enabled without \`auth_scope\`, so contributors are asked for access to all their repositories, including private ones. Set \`auth_scope: public_repo\` if your repository is public, or \`auth_scope: repo\` to confirm the broader scope is needed. ${ngt}`)),UW(a)&&!u&&(m?i.add(X(`config.warning.oauth_no_app_id`)):r.add(X(`config.error.oauth_no_app_id`))),rgt.forEach(r=>{let i=n[r];typeof i==`string`&&!Yk(i)&&b8({strKey:`invalid_url_option`,values:{option:r,url:i},context:{cmsConfig:e},collectors:t})}),s!==void 0&&Pk(`automatic_deployments`),x8({UNSUPPORTED_OPTIONS:Qht,config:n,context:{cmsConfig:e},collectors:t})}},sgt=[`code`,`markdown`,`richtext`,`text`],cgt=[`yaml`,`toml`,`json`],m9=(e,t,n=[])=>{if(!e||!t||t===`raw`||IO.has(t))return!1;let r=t.endsWith(`-frontmatter`)||t===`frontmatter`;if(r&&n.length===1){let[{name:e,widget:t=`string`}]=n;if(e===`body`&&sgt.includes(t))return!1}let i=e===`yml`?`yaml`:e,a=t===`yml`?`yaml`:t;if(Bk.includes(i))return!r;if(r){let e=Vk[i];return e!==void 0&&e!==a.replace(`-frontmatter`,``)}return cgt.includes(a)?cgt.includes(i)&&i!==a:!1},lgt=[`boolean`,`keyvalue`,`list`,`number`,`object`],ugt=e=>{let{widget:t=`string`}=e;return t===`number`?!(e.value_type??``).endsWith(`/string`):t===`compute`?JN(e):lgt.includes(t)||mM(e)},h9=({extension:e,format:t,bodyField:n,fields:r,context:i,collectors:a})=>{let{key:o=`body`,inline:s=!1}=n??{},c=Array.isArray(r)?r.find(({name:e})=>e===o):void 0;if(s||!c||typeof o!=`string`)return;let l=NA({extension:MA({extension:e,format:t}),format:t});(l===`frontmatter`||l.endsWith(`-frontmatter`))&&ugt(c)&&b8({strKey:`front_matter_body_field_not_text`,values:{name:o,widget:c.widget},context:{...i,typedKeyPath:o},collectors:a})},g9=({cmsConfig:e,collection:t,file:n})=>{let r=zA({cmsConfig:e,collection:t,file:n});if(r?.locales?.length)return r.canonical_slug?.key??RA.key},dgt=/<[^>]+>$/,_9=e=>{let{field:t}=e,{fields:n}=e,{types:r,typeKey:i=`type`}=e;return t?[t]:n||(r?[...r.flatMap(({fields:e=[]})=>e),{name:i}]:[])},fgt=(e,t)=>{let{widget:n=`string`}=e;if(n===`keyvalue`)return!0;if(n!==`code`)return!1;let{output_code_only:r=!1,keys:i={code:`code`,lang:`lang`}}=e;return!r&&[i.code,i.lang].includes(t)},pgt=(e,t)=>{let n=[],r=!0,i=!1;return t.split(`.`).every(t=>{let a=t.replace(dgt,``);if(i)return!1;if(!a||a===`*`||cM(a))return!0;let o=r?e:n.flatMap(e=>_9(e)),s=r?[]:n.filter(e=>fgt(e,a));return r=!1,n=o.filter(({name:e})=>e===a),!n.length&&s.length&&(n=s,i=!0),!!n.length})?n:[]},v9=(e,t)=>!!pgt(e,t).length,mgt=({collection:e,collectionFile:t,isIndexFile:n})=>{if(t)return t.fields;if(!e||`files`in e)return;let{fields:r,index_file:i}=e;return n&&typeof i==`object`&&i.fields?i.fields:r},hgt=(e,{canonicalSlugKey:t,orderFieldKey:n})=>SR.includes(e)||e===`_manual`||e===t||e===n,y9=({option:e,template:t,keyPaths:n,specialTags:r=[],prefixedOnly:i=!1,type:a,strKey:o=`option_field_not_found`,fields:s,context:c,collectors:l})=>{let u=[];typeof t==`string`?FM(t).forEach(({content:e,name:t})=>{TSe.test(e)||i&&!Dk.test(t)||r.includes(t)||u.push(t)}):(Array.isArray(n)?n:[n]).forEach(e=>{typeof e==`string`&&e&&u.push(e)}),u.forEach(t=>{v9(s,kk(t))||b8({type:a,strKey:o,values:{option:e,name:t},context:c,collectors:l})})},ggt=({thumbnail:e,fields:t,context:n,collectors:r})=>{if(y9({option:`thumbnail`,keyPaths:e,fields:t,context:n,collectors:r}),typeof e!=`string`||!e)return;let i=pgt(t,kk(e)).map(({widget:e=`string`})=>e);i.length&&!i.some(e=>mk.includes(e))&&b8({strKey:`thumbnail_field_not_media`,values:{name:e,widget:i[0]},context:n,collectors:r})},_gt=({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i})=>{Ek.test(e)&&((t?n.some(({widget:e,name:n})=>e===`datetime`&&n===t):n.some(({widget:e})=>e===`datetime`))||b8({type:`warning`,strKey:t?`preview_path_date_field_not_found`:`preview_path_no_date_field`,values:{name:t},context:r,collectors:i}))},vgt=({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i})=>{e&&(_gt({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i}),y9({option:`preview_path`,template:e,prefixedOnly:!0,type:`warning`,strKey:`preview_path_field_not_found`,fields:n,context:r,collectors:i}))},ygt=[...Tk,...Object.keys(Ok),`slug`,`_slug`,`fields._slug`],bgt=[`slug`,`locales`,`dirname`,`filename`,`extension`,`commit_date`,`commit_author`,`title`,`fields.title`],b9=({template:e,fields:t,context:n,collectors:r})=>{t?.length&&y9({option:`summary`,template:e,specialTags:bgt,fields:t,context:n,collectors:r})},xgt=({collection:e,context:t,collectors:n})=>{let{fields:r,path:i,summary:a,thumbnail:o}=e;if(!r?.length)return;let s={fields:r,context:t,collectors:n};y9({...s,option:`slug`,template:u2(e),specialTags:ygt}),y9({...s,option:`path`,template:i,specialTags:ygt}),b9({...s,template:a}),(typeof o==`string`||Array.isArray(o))&&(Array.isArray(o)?o:[o]).forEach(e=>{typeof e==`string`&&e.startsWith(`/`)?y9({...s,option:`thumbnail`,template:e,prefixedOnly:!0}):y9({...s,option:`thumbnail`,keyPaths:e})})},Sgt=({config:e,context:t,collectors:n})=>{let{default:r,output_code_only:i=!1,keys:a={code:`code`,lang:`lang`}}=e;if(!D(r))return;if(i){b8({strKey:`code_field_invalid_default_object`,context:t,collectors:n});return}let{code:o,lang:s}=a;Object.keys(r).filter(e=>![o,s].includes(e)).forEach(e=>{b8({strKey:`code_field_invalid_default_key`,values:{key:e,code:o,lang:s},context:t,collectors:n})})},Cgt=({config:e,context:t,collectors:n})=>{let{value:r,value_type:i}=e,{tree:a,tags:o}=Yz(r);a?o.some(({content:e})=>Object.hasOwn(Ok,IN(e).value))&&b8({strKey:`compute_field_uuid_in_expression`,values:{valueType:i},context:t,collectors:n}):b8({strKey:`compute_field_invalid_expression`,values:{valueType:i},context:t,collectors:n})},wgt=(e,t)=>{if(t){let{tree:t,tags:n}=Yz(e);return t?n:[]}return PM(e).tags.map(e=>({content:e,allItems:!1}))},Tgt=/<[^>]*>/g,Egt=/(?<=^|\.)\d+(?=\.|$)/g,x9=e=>{let{value:t,transformations:n}=IN(e),r=[];return Dk.test(t)&&r.push({tagName:t,keyPath:kk(t).replace(Egt,`*`)}),RM(n,e=>(r.push(...x9(e)),``)),r},Dgt=({context:e,collectors:t},n)=>{let r=(e.typedKeyPath??``).replace(Tgt,``),i=r.split(`.`);n.forEach(({content:n,allItems:a})=>{let o=x9(n).find(({keyPath:e})=>e===r);if(o){b8({type:`warning`,strKey:`compute_field_self_reference`,values:{name:o.tagName},context:e,collectors:t});return}let{value:s}=IN(n);if(!Dk.test(s))return;let c=kk(s);if(a)return;let l=c.split(`.`);l.every((e,t)=>e!==`*`||l.slice(0,t+1).every((e,t)=>e===i[t]))||b8({type:`warning`,strKey:`compute_field_wildcard_without_item`,values:{name:s},context:e,collectors:t})})},S9=(e,t=``)=>(Array.isArray(e)?e:[]).flatMap(e=>kgt(e,t?`${t}.${e?.name}`:`${e?.name}`)),Ogt=(e,t)=>(Array.isArray(e)?e:[]).flatMap(e=>S9(e?.fields,`${t}<${e?.name}>`)),kgt=(e,t)=>{let{widget:n=`string`,value:r}=e??{};if(n===`compute`){let n=new Set((typeof r==`string`?wgt(r,qN(e)):[]).flatMap(({content:e})=>x9(e).map(({keyPath:e})=>e)));return[{typedKeyPath:t,keyPath:t.replace(Tgt,``),references:n}]}if(n===`object`)return[...S9(e.fields,t),...Ogt(e.types,t)];if(n===`list`){let n=`${t}.*`;return[...e.field?kgt(e.field,n):[],...S9(e.fields,n),...Ogt(e.types,n)]}return[]},Agt=new WeakMap,jgt=e=>mA(Agt,e,()=>{let t=S9(e),n=new Map(t.map(e=>[e,t.filter(t=>t.keyPath!==e.keyPath&&e.references.has(t.keyPath))])),r=new Map,i=[],a=new Set,o=new Map,s=e=>{let t={index:r.size,lowLink:r.size};if(r.set(e,t),i.push(e),a.add(e),n.get(e).forEach(e=>{r.has(e)?a.has(e)&&(t.lowLink=Math.min(t.lowLink,r.get(e).index)):(s(e),t.lowLink=Math.min(t.lowLink,r.get(e).lowLink))}),t.lowLink!==t.index)return;let c=[],l;do l=i.pop(),a.delete(l),c.push(l);while(l!==e);if(c.length>1){let[e]=c.toSorted((e,t)=>e.typedKeyPath.localeCompare(t.typedKeyPath)),t=n.get(e).find(e=>c.includes(e));o.set(e.typedKeyPath,t.keyPath)}};return t.forEach(e=>{r.has(e)||s(e)}),o}),Mgt=({config:e,context:t,collectors:n})=>{let{value:r}=e,i=qN(e),a=mgt(t);if(typeof r==`string`&&(i&&Cgt({config:e,context:t,collectors:n}),t.componentName||Dgt({config:e,context:t,collectors:n},wgt(r,i))),a?.length){let e=jgt(a).get(t.typedKeyPath??``);e!==void 0&&b8({type:`warning`,strKey:`compute_field_reference_cycle`,values:{name:`fields.${e}`},context:t,collectors:n}),y9({option:`value`,template:r,prefixedOnly:!0,fields:a,context:t,collectors:n})}},Ngt=[{prop:`dateFormat`,newProp:`date_format`},{prop:`timeFormat`,newProp:`time_format`},{prop:`pickerUtc`,newProp:`picker_utc`}],Pgt=e=>{try{return Intl.DateTimeFormat(`en-US`,{timeZone:e}),!0}catch{return!1}},Fgt=e=>{let{config:t,context:n,collectors:r}=e,{picker_utc:i,input_timezone:a,output_utc:o}=t;i!==void 0&&(a!==void 0||o!==void 0)&&b8({type:`warning`,strKey:`conflicting_timezone_options`,context:n,collectors:r}),cN(a)&&!Pgt(a)&&b8({strKey:`invalid_timezone`,values:{timeZone:a},context:n,collectors:r})},Igt=e=>{let{config:t,context:n,collectors:r}=e,i=t,{localize_format:a}=i;if(!a)return;if(!lN(i).format){b8({type:`warning`,strKey:`localize_format_without_format`,context:n,collectors:r});return}if(typeof a==`string`){if(!gN(a)){b8({type:`warning`,strKey:`localize_format_unsupported_locale`,values:{locale:a},context:n,collectors:r});return}r.formatLocales.add(a);return}let{cmsConfig:o,collection:s,collectionFile:c}=n,l=s?zA({cmsConfig:o,collection:s,file:c})?.locales??[]:o?.i18n?.locales??[];l.length?l.forEach(e=>{r.formatLocales.add(e)}):b8({type:`warning`,strKey:`localize_format_without_i18n`,context:n,collectors:r})},Lgt=e=>{x8({...e,UNSUPPORTED_OPTIONS:Ngt}),Fgt(e),Igt(e)},Rgt=e=>e.includes(`{{`)?NM(e,(e,t)=>`{{${FN(t).join(` | `)}}}`,{unescape:!1}):e,C9=[`media_folder`,`public_folder`],zgt={compute:[`value`],datetime:[`default`],hidden:[`default`],list:[`summary`],object:[`summary`],relation:[`value_field`,`display_fields`,`search_fields`]},Bgt=[`pattern`,...pR],w9=(e,t)=>{D(e)&&t.forEach(t=>{let n=e[t];typeof n==`string`?e[t]=Rgt(n):Array.isArray(n)&&(e[t]=n.map(e=>typeof e==`string`?Rgt(e):e))})},Vgt=e=>{let{media_libraries:t,media_library:n}=e;D(t)&&Object.values(t).forEach(e=>{w9(e?.config,[`filename_template`])}),w9(n?.config,[`filename_template`])},T9=e=>{w9(e.i18n?.canonical_slug,[`value`])},E9=e=>{Array.isArray(e)&&e.forEach(e=>{if(!D(e))return;let{widget:t=`string`,filters:n,types:r}=e;w9(e,[...C9,...zgt[t]??[]]),Vgt(e),Array.isArray(r)&&r.forEach(e=>w9(e,[`summary`])),t===`relation`&&Array.isArray(n)&&n.forEach(e=>w9(e,[`values`])),E9(_9(e))})},Hgt=e=>{D(e)&&(w9(e,[`file`,`summary`,`preview_path`,...C9]),T9(e),E9(e.fields))},Ugt=(e,t)=>{let n=Array.isArray(e)?e:e?.[t];Array.isArray(n)&&n.forEach(e=>w9(e,Bgt))},Wgt=e=>{if(!D(e))return;let{slug:t,nested:n,table_columns:r,index_file:i,files:a}=e;w9(e,[`folder`,`file`,`slug`,`path`,`summary`,`preview_path`,`table_columns`,`summary_fields`,`thumbnail`,...C9]),w9(t,[`template`]),w9(n,[`summary`]),T9(e),Ugt(e.view_filters,`filters`),Ugt(e.view_groups,`groups`),Array.isArray(r)&&r.forEach(e=>w9(e,[`field`])),E9(e.fields),D(i)&&(w9(i,[`summary`]),E9(i.fields)),Array.isArray(a)&&a.forEach(Hgt)},Ggt=e=>{let{backend:t,collections:n,singletons:r,asset_collections:i}=e;return w9(e,C9),Vgt(e),T9(e),D(t?.commit_messages)&&w9(t.commit_messages,Object.keys(t.commit_messages)),Array.isArray(n)&&n.forEach(Wgt),Array.isArray(r)&&r.forEach(Hgt),Array.isArray(i)&&i.forEach(e=>w9(e,C9)),e},Kgt=e=>{w9(e,[`summary`]),E9(e.fields)},qgt=[...Tk,...Object.keys(Ok),`slug`,`dirname`,`filename`,`extension`],Jgt=[`{{media_folder}}`,`{{public_folder}}`],D9=({config:e,isGlobal:t=!1,context:n,collectors:r})=>{C9.forEach(i=>{let a=e[i];typeof a==`string`&&FM(a).forEach(({tag:e,name:a})=>{(t||!Jgt.includes(e)&&!qgt.includes(a))&&b8({strKey:t?`global_folder_template_tag`:`unsupported_folder_template_tag`,values:{option:i,tag:e},context:n,collectors:r})})})},Ygt=({media_library:e,media_libraries:t})=>yZ.includes(e?.name??``)||Object.keys(t??{}).some(e=>yZ.includes(e)),Xgt=(e,t)=>{let{media_folder:n,public_folder:r,asset_collections:i}=e,{errors:a,warnings:o}=t;if(n===void 0&&!Ygt(e)&&a.add(X(`config.error.missing_media_folder`)),r===``&&n!==void 0&&o.add(X(`config.warning.empty_public_folder`)),typeof r==`string`&&(/^\.{1,2}\//.test(r)&&a.add(X(`config.error.public_folder_relative_path`)),/^https?:/.test(r)&&a.add(X(`config.error.public_folder_absolute_url`))),D9({config:e,isGlobal:!0,context:{cmsConfig:e},collectors:t}),Array.isArray(i)){let n={nameCounts:{},strKeyBase:`asset_collection_name`,collectors:t};i.forEach((r,i)=>{let{name:a}=r;S8({...n,name:a,index:i,context:{cmsConfig:e}}),D9({config:r,isGlobal:!0,context:{cmsConfig:e},collectors:t})})}},Zgt=[`raster_image`,...dV,...mV],Qgt=({key:e,options:t,context:n,collectors:r})=>{let{quality:i}=t,a={values:{key:e},context:n,collectors:r};i!==void 0&&!(Number.isSafeInteger(i)&&i>=0&&i<=100)&&b8({...a,strKey:`invalid_transformation_quality`}),[`width`,`height`].forEach(n=>{let r=t[n];r!==void 0&&!(Number.isSafeInteger(r)&&r>0)&&b8({...a,strKey:`invalid_transformation_size`,values:{key:e,prop:n}})})},$gt=({transformations:e,context:t,collectors:n})=>{D(e)&&Object.entries(e).forEach(([e,r])=>{Zgt.includes(e)?D(r)&&!mV.includes(e)&&Qgt({key:e,options:r,context:t,collectors:n}):b8({strKey:`invalid_transformation_key`,values:{key:e},context:t,collectors:n})})},e_t=({config:e,context:t,collectors:n})=>{let{media_library:r,media_libraries:i}=e,a=[];D(i)&&(a.push(i.all),D(i.default)&&a.push(i.default.config)),D(r)&&(r.name??`default`)==="default"&&a.push(r.config),a.forEach(e=>{D(e)&&$gt({transformations:e.transformations,context:t,collectors:n})})},O9=({defaultValue:e,multiple:t=!1,context:n,collectors:r})=>{if(e==null)return;let i=Array.isArray(e);t&&!i&&b8({strKey:`invalid_default_multiple`,context:n,collectors:r}),!t&&i&&b8({strKey:`invalid_default_single`,context:n,collectors:r})},t_t=({value:e,fields:t,strKeyBase:n,context:r,collectors:i})=>{let a=t.map(({name:e})=>e);Object.keys(e).filter(e=>!a.includes(e)).forEach(e=>{b8({strKey:`${n}_invalid_default_key`,values:{key:e},context:r,collectors:i})})},n_t=({value:e,fields:t,types:n,typeKey:r=`type`,strKeyBase:i,context:a,collectors:o})=>{let s={value:e,strKeyBase:i,context:a,collectors:o};if(t){t_t({...s,fields:t});return}let c=e[r];if(c===void 0){b8({strKey:`${i}_default_missing_type`,values:{typeKey:r},context:a,collectors:o});return}let l=n?.find(({name:e})=>e===c);l?t_t({...s,fields:[...l.fields??[],{name:r}]}):b8({strKey:`${i}_invalid_default_type`,values:{typeKey:r,value:String(c)},context:a,collectors:o})},r_t=[{prop:`allow_multiple`,newProp:`multiple`,strKey:`allow_multiple`}],i_t=e=>{let{config:t,context:n,collectors:r}=e,{media_folder:i,default:a,multiple:o}=t;o!==void 0&&O9({defaultValue:a,multiple:o,context:n,collectors:r}),i!==void 0&&r.mediaFields.add({fieldConfig:t,context:n}),D9({config:t,context:n,collectors:r}),e_t({config:t,context:n,collectors:r}),x8({...e,UNSUPPORTED_OPTIONS:r_t})},a_t=e=>PM(e).tags.some(e=>{let{value:t,transformations:n}=IN(e),r=t===`locale`;return RM(n,e=>(a_t(`{{${e}}}`)&&(r=!0),``)),r}),o_t=({config:e,context:t,collectors:n})=>{let{default:r}=e,{cmsConfig:i,collection:a,collectionFile:o}=t;typeof r==`string`&&a&&a_t(r)&&(zA({cmsConfig:i,collection:a,file:o})?.locales?.length||b8({strKey:`hidden_field_locale_without_i18n`,context:t,collectors:n}))},s_t=[[`min`,`max`],[`minlength`,`maxlength`]],c_t=({config:e,context:t,collectors:n})=>{let{default_localized:r}=e,{cmsConfig:i,collection:a,collectionFile:o}=t;if(!D(r)||!a)return;let s=zA({cmsConfig:i,collection:a,file:o})?.locales??[];s.length?Object.keys(r).filter(e=>!s.includes(e)).forEach(e=>{b8({type:`warning`,strKey:`default_localized_unknown_locale`,values:{locale:e},context:t,collectors:n})}):b8({type:`warning`,strKey:`default_localized_without_i18n`,context:t,collectors:n})},l_t=({config:e,context:t,collectors:n})=>{let{widget:r=`string`,pattern:i,multiple:a,i18n:o}=e;_k.includes(r)&&a===!0&&o===`duplicate_if_empty`&&b8({type:`warning`,strKey:`duplicate_if_empty_multiple`,context:t,collectors:n}),Array.isArray(i)&&C8({option:`pattern`,pattern:i[0],context:t,collectors:n}),s_t.forEach(([r,i])=>{let{[r]:a,[i]:o}=e;typeof a==`number`&&typeof o==`number`&&a>o&&b8({strKey:`invalid_range_options`,values:{min:r,max:i},context:t,collectors:n})}),c_t({config:e,context:t,collectors:n})},u_t=({config:e,context:t,collectors:n})=>{let{media_folder:r}=e;r!==void 0&&n.mediaFields.add({fieldConfig:e,context:t}),D9({config:e,context:t,collectors:n})},d_t={},f_t=e=>{let{config:t,context:n}=e,{name:r,widget:i=`string`}=t,{typedKeyPath:a}=n,o={...e,context:{...n,typedKeyPath:a?`${a}.${r}`:r}},s=dk.includes(i),c=d_t[i]??(s?void 0:u_t);l_t(o),c?.(o),i===`date`&&b8({...o,strKey:`date_field_type`})},k9=(e,t,n)=>{let r={nameCounts:{},strKeyBase:`field_name`,context:t,collectors:n};e?.forEach((e,i)=>{let{name:a}=e;S8({...r,name:a,index:i})&&f_t({config:e,context:t,collectors:n})})},p_t=[`string`,`relation`,`select`],m_t=(e,t,n)=>e===`object`||(b8({strKey:`invalid_list_variable_type`,context:t,values:{widget:e},collectors:n}),!1),h_t=[`keyvalue`,`object`],g_t=({config:e,context:t,collectors:n})=>{let{default:r}=e,{field:i}=e,{fields:a}=e,{types:o,typeKey:s=`type`}=e;Array.isArray(r)&&r.forEach(e=>{if(!a&&!o){let{widget:r=`string`}=i??{},a=!!i&&(h_t.includes(r)||!dk.includes(r));D(e)&&!a&&b8({strKey:`list_field_invalid_default_object`,context:t,collectors:n})}else D(e)?n_t({value:e,fields:a,types:o,typeKey:s,strKeyBase:`list_field`,context:t,collectors:n}):b8({strKey:`list_field_invalid_default_item`,values:{value:String(e)},context:t,collectors:n})})},__t=({config:e,context:t,collectors:n})=>{let{fields:r}=e,{types:i}=e,{map_key_field:a}=e;if(typeof a!=`string`||!a)return;if(!r&&!i){b8({strKey:`list_field_map_key_no_subfields`,context:t,collectors:n});return}let o=(e,r)=>{let i=e.find(e=>e.name===a);if(!i){b8({strKey:r?`list_field_map_key_missing_in_type`:`list_field_map_key_not_found`,values:{name:a,type:r},context:t,collectors:n});return}let{widget:o=`string`,i18n:s}=i,{required:c=!0}=i;p_t.includes(o)||b8({strKey:`list_field_map_key_invalid_type`,values:{name:a,widget:o},context:t,collectors:n}),i.multiple===!0&&b8({strKey:`list_field_map_key_multiple`,values:{name:a},context:t,collectors:n});let{options:l}=i;o===`select`&&Array.isArray(l)&&l.some(e=>typeof(D(e)?e.value:e)!=`string`)&&b8({strKey:`list_field_map_key_option_not_string`,values:{name:a},context:t,collectors:n}),c!==!0&&b8({strKey:`list_field_map_key_not_required`,values:{name:a},context:t,collectors:n}),(s===!1||s===`none`)&&b8({strKey:`list_field_map_key_not_localized`,values:{name:a},context:t,collectors:n})};r?o(r):i.forEach(({name:e,fields:t=[]})=>o(t,e))},v_t=e=>{let{config:t,context:n,collectors:r}=e,{field:i}=t,{fields:a}=t,{types:o}=t,{thumbnail:s}=t,{typedKeyPath:c}=n,l={nameCounts:{},strKeyBase:`variable_type`,collectors:r};i&&a||i&&o||a&&o?b8({strKey:`invalid_list_field`,context:n,collectors:r}):a?.length===0||o?.length===0?b8({strKey:`list_field_no_subfields`,context:n,collectors:r}):(g_t(e),__t(e),ggt({thumbnail:s,fields:_9(t),context:n,collectors:r}),i&&f_t({config:i,context:{...n,typedKeyPath:`${c}.*`},collectors:r}),a&&k9(a,{...n,typedKeyPath:`${c}.*`},r),o?.forEach(({name:e,widget:t=`object`,fields:i},a)=>{let o={...n,typedKeyPath:`${c}.*<${e}>`};S8({...l,name:e,index:a,context:o})&&m_t(t,o,r)&&i&&k9(i,o,r)}))},y_t=[{prop:`valueType`,newProp:`value_type`}],b_t=[`int`,`int/string`],x_t=[`float`,`float/string`],S_t=({config:e,context:t,collectors:n})=>{let{default:r,value_type:i=`int`}=e;if(![`string`,`number`].includes(typeof r))return;let a=b_t.includes(i);if(!a&&!x_t.includes(i))return;let o=YN(r);(a?!Number.isInteger(o):!Number.isFinite(o))&&b8({strKey:a?`number_field_default_not_integer`:`number_field_default_not_number`,values:{value:String(r),valueType:i},context:t,collectors:n})},C_t=e=>{let{config:t,context:n,collectors:r}=e,{step:i}=t;S_t(e),typeof i==`number`&&i<=0&&i!==-1&&b8({strKey:`invalid_step`,values:{step:String(i)},context:n,collectors:r}),x8({...e,UNSUPPORTED_OPTIONS:y_t})},w_t=e=>{let{config:t,context:n,collectors:r}=e,{fields:i}=t,{types:a,typeKey:o}=t,{default:s,thumbnail:c}=t,{typedKeyPath:l}=n,u={nameCounts:{},strKeyBase:`variable_type`,collectors:r};i&&a?b8({strKey:`invalid_object_field`,context:n,collectors:r}):i?.length===0||a?.length===0?b8({strKey:`object_field_no_subfields`,context:n,collectors:r}):(D(s)&&n_t({value:s,fields:i,types:a,typeKey:o,strKeyBase:`object_field`,context:n,collectors:r}),ggt({thumbnail:c,fields:_9(t),context:n,collectors:r}),i&&k9(i,n,r),a?.forEach(({name:e,fields:t},i)=>{let a={...n,typedKeyPath:`${l}<${e}>`};S8({...u,name:e,index:i,context:a})&&t&&k9(t,a,r)}))},T_t=[`extension`,`path`,`slug`,`slug_length`,`nested`,`meta`,`index_file`,`reorder`],E_t=e=>FM(e).some(({name:e})=>e===`slug`),D_t=(e,t)=>{let{cmsConfig:n,collection:r}=e,{file:i,format:a,preview_path:o,thumbnail:s}=r;typeof i==`string`&&((bk(i).extension!==`json`||SA(i))&&b8({strKey:`invalid_collection_data_file`,values:{file:i},context:e,collectors:t}),a!==void 0&&a!==`json`&&b8({strKey:`file_format_mismatch`,values:{extension:`json`,format:a},context:e,collectors:t}),T_t.forEach(n=>{n in r&&b8({strKey:`unsupported_collection_data_file_option`,values:{prop:n},context:e,collectors:t})}),[[`preview_path`,o],...(Array.isArray(s)?s:[s]).map(e=>[`thumbnail`,e])].forEach(([n,r])=>{typeof r==`string`&&E_t(r)&&b8({strKey:`collection_data_file_slug_tag`,values:{prop:n},context:e,collectors:t})}),(mq(pq({cmsConfig:n,collection:r}))||n.backend?.open_authoring)&&b8({strKey:`collection_data_file_workflow`,context:e,collectors:t}))},O_t=[`slug`,`locale`],k_t=[{prop:`displayFields`,newProp:`display_fields`},{prop:`searchFields`,newProp:`search_fields`},{prop:`valueField`,newProp:`value_field`},{type:`warning`,prop:`options_length`,strKey:`unsupported_ignored_option`}],A_t=[{option:`value_field`,strKey:`relation_field_invalid_value_field`,list:!1},{option:`display_fields`,strKey:`relation_field_invalid_display_field`,list:!0},{option:`search_fields`,strKey:`relation_field_invalid_search_field`,list:!0}],j_t=({reference:e,strKey:t,fields:n,canonicalSlugKey:r,context:i,collectors:a})=>{let o=FM(e).map(({content:e})=>e);(o.length?o.filter(e=>!O_t.includes(e)):[e]).forEach(e=>{let o=kk(e);o!==r&&!v9(n,o)&&b8({strKey:t,context:i,collectors:a,values:{field:e}})})},M_t=({fieldConfig:e,fields:t,canonicalSlugKey:n,orderFieldKey:r,context:i,collectors:a})=>{let{file:o,filters:s,sort_by:c}=e;Array.isArray(s)&&s.forEach(e=>{let r=D(e)?e.field:void 0;if(typeof r==`string`&&r&&r!==`slug`){let e=kk(r);e!==n&&!v9(t,e)&&b8({strKey:`relation_field_invalid_filter_field`,context:i,collectors:a,values:{field:r}})}});let l=D(c)?c.field:void 0;!o&&typeof l==`string`&&l&&!hgt(l,{canonicalSlugKey:n,orderFieldKey:r})&&!v9(t,l)&&b8({strKey:`relation_field_invalid_sort_field`,context:i,collectors:a,values:{field:l}}),A_t.forEach(({option:r,strKey:o,list:s})=>{let c=e[r];Array.isArray(c)===s&&(s?c:[c]).forEach(e=>{typeof e==`string`&&e&&j_t({reference:e,strKey:o,fields:t,canonicalSlugKey:n,context:i,collectors:a})})})},N_t=({fieldConfig:e,context:t,collectors:n})=>{let{collection:r,value_field:i=`{{slug}}`}=e;E_t(i)&&b8({strKey:`relation_field_array_file_slug`,context:t,collectors:n,values:{collection:r}})},P_t=({collection:e,context:t,collectors:n})=>{let{cmsConfig:r,collection:i}=t;!i||!(`file`in i)||typeof i.file!=`string`||`divider`in e||`files`in e||!mq(pq({cmsConfig:r,collection:e}))||b8({strKey:`relation_field_array_file_workflow`,context:t,collectors:n,values:{collection:e.name}})},F_t=e=>{let{config:t,context:n,collectors:r}=e,i=t,{collection:a,file:o,default:s,multiple:c}=i,{cmsConfig:l}=n;O9({defaultValue:s,multiple:c,context:n,collectors:r});let u=a===`_singletons`?{name:a,files:l?.singletons}:l?.collections?.find(e=>e.name===a),d,f;if(u){let e=`files`in u&&Array.isArray(u.files);o?(e&&(d=u.files.find(e=>`file`in e&&e.name===o)),d||b8({strKey:`relation_field_invalid_collection_file`,context:n,collectors:r,values:{file:o}})):e&&b8({strKey:`relation_field_missing_file_name`,context:n,collectors:r,values:{collection:a}}),f=g9({cmsConfig:l,collection:u,file:d}),`file`in u&&typeof u.file==`string`&&(i.value_field===void 0||typeof i.value_field==`string`)&&N_t({fieldConfig:i,context:n,collectors:r}),P_t({collection:u,context:n,collectors:r})}else b8({strKey:`relation_field_invalid_collection`,context:n,collectors:r,values:{collection:a}});o&&i.sort_by!==void 0&&b8({type:`warning`,strKey:`relation_field_sort_by_file_ignored`,context:n,collectors:r});let p=o?d?.fields:u?.fields;p?.length&&M_t({fieldConfig:i,fields:p,canonicalSlugKey:f,orderFieldKey:HL(u),context:n,collectors:r}),x8({...e,UNSUPPORTED_OPTIONS:k_t}),r.relationFields.add({fieldConfig:i,context:n})},I_t=[{prop:`editorComponents`,newProp:`editor_components`}],L_t=[...DZ.filter(e=>!EZ.includes(e)),`align`],R_t=e=>{if(OZ.includes(e))return!0;let t=iM(e);return!!t&&!Uj(t)},z_t=({config:e,context:t,collectors:n})=>{let{multiline:r=t.cmsConfig?.field_defaults?.richtext?.multiline??!0,buttons:i,editor_components:a}=e;r===!1&&[[`buttons`,i,e=>L_t.includes(e)],[`editor_components`,a,R_t]].forEach(([e,r,i])=>{Array.isArray(r)&&r.filter(i).forEach(r=>{b8({type:`warning`,strKey:`single_line_block_item`,values:{option:e,name:r},context:t,collectors:n})})})},B_t=e=>{x8({...e,UNSUPPORTED_OPTIONS:I_t}),z_t(e)};Object.assign(d_t,{code:Sgt,compute:Mgt,datetime:Lgt,file:i_t,hidden:o_t,image:i_t,list:v_t,markdown:B_t,number:C_t,object:w_t,relation:F_t,richtext:B_t,select:({config:e,context:t,collectors:n})=>{let{options:r,default:i,multiple:a}=e;if(O9({defaultValue:i,multiple:a,context:t,collectors:n}),!Array.isArray(r))return;if(!r.length){b8({strKey:`select_field_no_options`,context:t,collectors:n});return}let o=r.map(e=>D(e)?e.value:e);new Set(o.filter((e,t)=>o.indexOf(e)!==t)).forEach(e=>{b8({strKey:`select_field_duplicate_option`,values:{value:String(e)},context:t,collectors:n})}),i===void 0||i===null&&!o.includes(null)||(Array.isArray(i)?i:[i]).forEach(e=>{let r=D(e)?e.value:e;o.includes(r)||b8({strKey:`select_field_invalid_default`,values:{value:String(r)},context:t,collectors:n})})}});var V_t=[`locales`,`default_locale`,`initial_locales`],H_t=(e,t,n)=>{let{locales:r,default_locale:i,initial_locales:a}=e;Array.isArray(r)&&(r.length?(typeof i==`string`&&!r.includes(i)&&b8({strKey:`i18n_invalid_default_locale`,values:{locale:i},context:t,collectors:n}),Array.isArray(a)&&a.forEach(e=>{typeof e==`string`&&!r.includes(e)&&b8({strKey:`i18n_invalid_initial_locale`,values:{locale:e},context:t,collectors:n})})):b8({strKey:`i18n_no_locales`,context:t,collectors:n}))},A9=e=>e.some(e=>aR(e.i18n)||A9(_9(e))),j9=e=>Array.isArray(e)&&!!e.length,U_t=(e,t)=>{let{i18n:n,collections:r,singletons:i}=e;D(n)&&(H_t(n,{cmsConfig:e},t),(j9(r)||j9(i))&&([...r??[],...i??[]].some(e=>!(`divider`in e)&&!!e.i18n)||b8({strKey:`i18n_no_collections`,context:{cmsConfig:e},collectors:t})))},W_t=(e,t)=>{let{collection:n,collectionFile:r}=e;if(r){let{fields:n}=r;j9(n)&&!A9(n)&&b8({strKey:`collection_file_i18n_no_fields`,context:e,collectors:t});return}if(`files`in n){let{files:r}=n,i=Array.isArray(r)?r.filter(e=>!(`divider`in e)):[];i.length&&!i.some(e=>!!e.i18n)&&b8({strKey:`collection_i18n_no_files`,context:e,collectors:t});return}let{fields:i,index_file:a}=n;j9(i)&&!A9([...i,...D(a)?a.fields??[]:[]])&&b8({strKey:`collection_i18n_no_fields`,context:e,collectors:t})},G_t=(e,t)=>{let{cmsConfig:n,collection:r,collectionFile:i}=e,{i18n:a}=i??r;if(!a)return;let o=zA({cmsConfig:n,collection:r,file:i});o?(D(a)&&V_t.some(e=>e in a)&&H_t(o,e,t),W_t(e,t)):i&&r.i18n&&!D(n?.i18n)||b8({type:`warning`,strKey:`i18n_not_configured`,context:e,collectors:t})},K_t=(e,t)=>{let{cmsConfig:n,collection:r,collectionFile:i}=e,{file:a,format:o=r.format,fields:s,i18n:c,summary:l}=i,{preview_path:u,preview_path_date_field:d}=i,{extension:f}=bk(a);if(m9(f,o,s)&&b8({strKey:`file_format_mismatch`,context:e,values:{extension:f,format:o},collectors:t}),s?.length||b8({strKey:`collection_file_no_fields`,context:e,collectors:t}),SA(a)&&!c&&b8({strKey:`collection_file_i18n_required`,context:e,collectors:t}),SA(a)&&!wA(a)){let o=zA({cmsConfig:n,collection:r,file:i});o?.locales?.length&&WSe(o)&&b8({type:`warning`,strKey:`locale_not_omitted_from_file_path`,values:{file:a},context:e,collectors:t})}G_t(e,t),D9({config:i,context:e,collectors:t}),k9(s,e,t),h9({extension:f,format:o,bodyField:i.body_field??r.body_field,fields:s,context:e,collectors:t}),vgt({pathTemplate:u,dateFieldName:d,fields:s??[],context:e,collectors:t}),b9({template:l,fields:s,context:e,collectors:t})},q_t=(e,t)=>{let{cmsConfig:n,collection:r}=e,{files:i}=r,a={nameCounts:{},strKeyBase:`collection_file_name`,collectors:t};i.forEach((e,i)=>{if(`divider`in e)return;let{name:o}=e,s={cmsConfig:n,collection:r,collectionFile:e};S8({...a,name:o,index:i,context:s})&&K_t(s,t)})},J_t=({bulkEdit:e,fields:t=[],context:n,collectors:r})=>{D(e)&&Array.isArray(e.fields)&&e.fields.forEach(e=>{let i=E7(t,e);i?Nlt(i)||b8({strKey:`unsupported_bulk_edit_field`,values:{name:String(e)},context:n,collectors:r}):b8({strKey:`invalid_bulk_edit_field`,values:{name:String(e)},context:n,collectors:r})})},Y_t=({collection:e,context:t,collectors:n})=>{let{fields:r,filter:i}=e;if(!D(i))return;let{field:a,value:o,pattern:s}=i;typeof a==`string`&&a&&!SR.includes(a)&&a!==g9({cmsConfig:t.cmsConfig,collection:e})&&r?.length&&!v9(r,a)&&b8({strKey:`invalid_filter_field`,values:{name:a},context:t,collectors:n}),o===void 0&&s===void 0&&b8({strKey:`invalid_filter_no_condition`,context:t,collectors:n}),C8({option:`filter`,pattern:s,context:t,collectors:n})},X_t=({collection:e,context:t,collectors:n})=>{let{create:r=!0,fields:i,identifier_field:a}=e;if(!i?.length)return;if(a!==void 0){typeof a==`string`&&!v9(i,a)&&b8({strKey:`invalid_identifier_field`,values:{name:a},context:t,collectors:n});return}let o=f2(e);r&&u2(e)===void 0&&!o.editorRequired&&!o.autoIncrement&&!v9(i,`title`)&&b8({type:`warning`,strKey:`missing_identifier_field`,values:{name:`title`},context:t,collectors:n})},Z_t=[LA.SINGLE_FILE,LA.SINGLE_FILE_DEFAULT_ROOT],Q_t=({collection:e,context:t,collectors:n})=>{let{cmsConfig:r}=t,{slug:i,folder:a}=e,o=u2(e);if(d2(o)&&Pk(`slug_editor_tag`),o?.includes(`/`)&&b8({strKey:`invalid_slug_slash`,values:{slug:o},context:t,collectors:n}),!D(i))return;let{pattern:s,i18n:c,auto_increment:l}=i;if(l===!0&&o!==void 0&&b8({type:`warning`,strKey:`slug_template_ignored`,context:t,collectors:n}),Array.isArray(s)&&C8({option:`pattern`,pattern:s[0],context:t,collectors:n}),c===!0){let i=zA({cmsConfig:r,collection:e}),o=i?.structure??LA.SINGLE_FILE;(!i?.locales?.length||Z_t.includes(o)&&!(typeof a==`string`&&SA(a)))&&b8({type:`warning`,strKey:`slug_i18n_ineffective`,context:t,collectors:n})}},$_t=({config:e,options:t,fields:n,specialKeys:r,optionType:i,context:a,collectors:o})=>{let s=D(e),c={};t.forEach((e,t)=>{let{name:l,field:u,pattern:d}=D(e)?e:{};S8({name:l,index:t,nameCounts:c,strKeyBase:`${i}_name`,context:a,collectors:o,required:s}),i===`view_filter`&&D(e)&&d===void 0&&(Nke(e)||b8({strKey:`invalid_view_filter_no_condition`,values:{count:String(t+1)},context:a,collectors:o})),typeof u==`string`&&u&&!r.includes(u)&&(v9(n,u)||b8({strKey:`invalid_${i}_field`,values:{name:u},context:a,collectors:o}))});let l=D(e)?e.default:void 0;typeof l==`string`&&l&&(t.some(e=>D(e)&&e.name===l)||b8({strKey:`invalid_${i}_default`,values:{name:l},context:a,collectors:o}))},evt=(e,t)=>{let{fields:n,sortable_fields:r,table_columns:i,view_groups:a,view_filters:o}=e.collection;if(!n?.length)return;let s=g9({cmsConfig:e.cmsConfig,collection:e.collection}),c=[...SR,...s?[s]:[]];if(r){let{keys:i,defaultKey:a}=Gke(r),o=HL(e.collection);new Set([...i,a]).forEach(r=>{r&&r!==`_summary`&&!hgt(r,{canonicalSlugKey:s,orderFieldKey:o})&&!v9(n,r)&&b8({strKey:`invalid_sortable_field`,values:{name:r},context:e,collectors:t})}),Array.isArray(r)&&r.filter(Uke).length>1&&b8({strKey:`multiple_sortable_field_defaults`,context:e,collectors:t})}let l=wR(e.collection);if(l){let r=Array.isArray(i)?`table_columns`:`summary_fields`;l.forEach(({key:i})=>{typeof i==`string`&&CR(i)?y9({option:r,template:i,specialTags:bgt,fields:n,context:e,collectors:t}):typeof i==`string`&&i&&i!==`_summary`&&!c.includes(i)&&!v9(n,i)&&b8({strKey:`invalid_table_column_field`,values:{option:r,name:i},context:e,collectors:t})})}$_t({config:a,options:xR(a,`groups`).options,fields:n,specialKeys:c,optionType:`view_group`,context:e,collectors:t}),$_t({config:o,options:xR(o,`filters`).options,fields:n,specialKeys:c,optionType:`view_filter`,context:e,collectors:t})},tvt=e=>e[0]===`draft`&&e.every((t,n)=>n===0||OK.indexOf(t)>OK.indexOf(e[n-1])),nvt=({value:e,context:t,collectors:n})=>{e&&typeof e==`object`&&Array.isArray(e.stages)&&(tvt(e.stages)||b8({strKey:`invalid_publish_mode_stages`,context:t,collectors:n}),(e.type===`preview`||e.type===`simple`)&&b8({type:`warning`,strKey:`publish_mode_stages_ignored`,values:{type:e.type},context:t,collectors:n}))},rvt=[{prop:`sortableFields`,newProp:`sortable_fields`}],ivt=(e,t)=>{let{cmsConfig:n,collection:r}=e,{body_field:i,extension:a,fields:o,folder:s,format:c,index_file:l,preview_path:u,preview_path_date_field:d,reorder:f,bulk_edit:p,slug_length:m,view_groups:h}=r;if(m9(a,c)&&b8({strKey:`file_format_mismatch`,values:{extension:a,format:c},context:e,collectors:t}),m!==void 0&&Pk(`slug_length`),x8({UNSUPPORTED_OPTIONS:rvt,config:r,context:e,collectors:t}),o?.length||b8({strKey:`collection_no_fields`,context:e,collectors:t}),D_t(e,t),typeof s==`string`&&SA(s)&&(zA({cmsConfig:n,collection:r})?.locales?.length||b8({strKey:`collection_folder_i18n_required`,context:e,collectors:t}),PSe(s)||b8({strKey:`invalid_collection_folder_locale`,values:{folder:s},context:e,collectors:t})),k9(o,e,t),h9({extension:a,format:c,bodyField:i,fields:o,context:e,collectors:t}),X_t({collection:r,context:e,collectors:t}),Q_t({collection:r,context:e,collectors:t}),xgt({collection:r,context:e,collectors:t}),Y_t({collection:r,context:e,collectors:t}),l){D(l)&&m9(l.extension,l.format)&&b8({strKey:`file_format_mismatch`,values:{extension:l.extension,format:l.format},context:{cmsConfig:n,collection:r,isIndexFile:!0},collectors:t});let e={cmsConfig:n,collection:r,isIndexFile:!0},s=l===!0?o:l.fields??o;if(k9(s,e,t),D(l)){let{extension:n,format:r,fields:o,summary:u}=l,d=n!==void 0||r!==void 0;(o||d)&&h9({...d?{extension:n,format:r}:{extension:a,format:c},bodyField:i,fields:s,context:e,collectors:t}),b9({template:u,fields:s,context:e,collectors:t})}}let g=OOe({reorder:f});if(g){let{options:n}=xR(h,`groups`);n.some(({name:e})=>e===g)||b8({strKey:`invalid_reorder_group`,values:{name:g},context:e,collectors:t})}J_t({bulkEdit:p,fields:o,context:e,collectors:t}),vgt({pathTemplate:u,dateFieldName:d,fields:[...o??[],...D(l)?l.fields??[]:[]],context:e,collectors:t}),evt(e,t)},avt=({cmsConfig:e,collection:t},n)=>{let r=`divider`in t,i=`files`in t,a=`folder`in t,o=`file`in t,s=[r,i,a,o].filter(Boolean).length;s?s>1?b8({strKey:`invalid_collection_multiple_options`,context:{cmsConfig:e,collection:t},collectors:n}):(G_t({cmsConfig:e,collection:t},n),D9({config:t,context:{cmsConfig:e,collection:t},collectors:n}),nvt({value:t.publish_mode,context:{cmsConfig:e,collection:t},collectors:n}),i?q_t({cmsConfig:e,collection:t},n):(a||o)&&ivt({cmsConfig:e,collection:t},n)):b8({strKey:`invalid_collection_no_options`,context:{cmsConfig:e,collection:t},collectors:n})},ovt=(e,t)=>{let{collections:n,singletons:r}=e,{errors:i}=t;if(!Array.isArray(n)&&!Array.isArray(r)){i.add(X(`config.error.no_collection`));return}n?.some(e=>!(`divider`in e)&&!e.hide)||r?.length||i.add(X(`config.error.no_visible_collection`));let a={nameCounts:{},strKeyBase:`collection_name`,collectors:t};n?.forEach((n,r)=>{if(`divider`in n)return;let{name:i}=n,o={cmsConfig:e,collection:n};S8({...a,name:i,index:r,context:o})&&avt(o,t)}),Array.isArray(r)&&q_t({cmsConfig:e,collection:{name:`_singletons`,label:X(`singletons`),label_singular:X(`singleton`),files:r}},t)},svt=(e,t)=>{let{encoding:n=`unicode`,sanitize_replacement:r}=e.slug??{};typeof r==`string`&&r&&(n===`ascii`?$M:QM).test(r.replaceAll(` `,``))&&b8({strKey:`invalid_sanitize_replacement`,values:{replacement:r},context:{cmsConfig:e},collectors:t})},cvt=[{type:`warning`,prop:`local_backend`,strKey:`unsupported_ignored_option`},{type:`warning`,prop:`locale`,strKey:`unsupported_ignored_option`},{type:`warning`,prop:`search`,strKey:`unsupported_ignored_option`}],lvt=[`site_url`],uvt=(e,t)=>{ogt(e,t),lvt.forEach(n=>{let r=e[n];Jk(r)&&!Yk(r)&&b8({strKey:`invalid_url_option`,values:{option:n,url:r},context:{cmsConfig:e},collectors:t})}),e.logo_url!==void 0&&Pk(`logo_url`),nvt({value:e.publish_mode,context:{cmsConfig:e},collectors:t}),Xgt(e,t),e_t({config:e,context:{cmsConfig:e},collectors:t}),svt(e,t),U_t(e,t),ovt(e,t),x8({UNSUPPORTED_OPTIONS:cvt,config:e,context:{cmsConfig:e},collectors:t}),NO.forEach((n,r)=>{n8e({definition:n,componentName:r,cmsConfig:e,collectors:t}),zj(n)||k9(n.fields,{cmsConfig:e,componentName:r},t)})},M9=e=>{let t=0,n=0;return e.split(`/`).forEach(e=>{e===`..`?(--t,n=Math.min(n,t)):e&&e!==`.`&&(t+=1)}),-n},dvt=(e,{collectionName:t,fileName:n})=>{if(n||t===`_singletons`)return 0;let r=e.collections?.find(e=>!(`divider`in e)&&`name`in e&&e.name===t);if(r&&`folder`in r&&!r.nested)return(r.path??``).split(`/`).length-1+(r.i18n||e.i18n?1:0)},fvt=({config:e,entryFolders:t,assetFolders:n,collectors:r})=>{if(!yH())return;let i=new Set;t.forEach(({folderPath:e,folderPathMap:t,filePathMap:n})=>{[e,...Object.values(t??{}),...Object.values(n??{})].filter(e=>e!==void 0&&M9(e)>0).forEach(e=>i.add(e))}),n.forEach(t=>{let{internalPath:n,internalSubPath:r,entryRelative:a}=t;if(n===void 0)return;if(!a){M9(n)>0&&i.add(n);return}let o=dvt(e,t),s=[n,r].filter(Boolean).join(`/`);o!==void 0&&M9(s)>o&&i.add(s)}),i.forEach(e=>{r.errors.add(X(`config.error.path_outside_root_dir`,{values:{path:e}}))})},pvt={$schema:`http://json-schema.org/draft-07/schema#`,$id:`http://json-schema.org/draft-07/schema#`,title:`Core schema meta-schema`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0},N9=e=>e.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`),P9=e=>e.replace(/^#/,``).split(`/`).filter(Boolean).map(N9),mvt=[`widget`,`name`],hvt=8,gvt=(e,t)=>{let n=new Set,r=t;for(;D(r)&&typeof r.$ref==`string`;){if(n.has(r.$ref))return;n.add(r.$ref),r=P9(r.$ref).reduce((e,t)=>e?.[t],e)}return D(r)?r:void 0},F9=(e,t,n=0)=>{let r=gvt(e,t);return!r||n>hvt?[]:Array.isArray(r.anyOf)?r.anyOf.flatMap(t=>F9(e,t,n+1)):D(r.properties)?[r]:[]},_vt=(e,t)=>{let n=e.properties?.[t];if(D(n))return n.const===void 0?Array.isArray(n.enum)?n.enum:void 0:[n.const]},vvt=(e,t,n)=>{let r=F9(e,t);if(!r.length)return;let i=[],a=!1;if(r.every(e=>{let t=_vt(e,n);return t?(i.push(...t),a||=!(e.required??[]).includes(n),!0):!1}))return{values:[...new Set(i)],optional:a}},yvt=(e,t)=>{let n=F9(e,t);if(n.length)return n.map(e=>new Set(e.required??[])).reduce((e,t)=>e.intersection(t))},bvt=(e,t)=>new Set(F9(e,t).flatMap(e=>Object.keys(e.properties))),I9=(e,t)=>({properties:{[e]:t.length===1?{const:t[0]}:{enum:t}}}),xvt=(e,t)=>e.reduceRight((e,{condition:t,branch:n})=>({if:t,then:n,else:e}),t),Svt=(e,t,n)=>mvt.reduce((r,i)=>{if(r)return r;let a=t.map(t=>vvt(e,t,i)),o=a.filter(Boolean),s=o.flatMap(e=>e.values);return!o.length||a.length-o.length>1||s.length!==new Set(s).size?void 0:xvt(n.map((e,t)=>({branch:e,tag:a[t]})).filter(e=>!!e.tag).sort((e,t)=>Number(e.tag?.optional)-Number(t.tag?.optional)).map(({branch:e,tag:t})=>({branch:e,condition:t?.optional?I9(i,t.values):{required:[i],...I9(i,t?.values)}})),n.filter((e,t)=>!a[t])[0]??{required:[i],...I9(i,s)})},void 0),Cvt=(e,t,n)=>{let r=t.map(t=>yvt(e,t));if(r.some(e=>!e))return;let i=r,a=t.map(t=>bvt(e,t)),o=i.map((e,t)=>{let n=a.reduce((e,n,r)=>t===r?e:e.union(n),new Set);return[...e.difference(n)]});if(o.filter(e=>!e.length).length>1)return;let s=n.map((e,t)=>({branch:e,markers:o[t]})).filter(e=>e.markers.length).map(({branch:e,markers:t})=>({branch:e,condition:t.length===1?{required:[t[0]]}:{anyOf:t.map(e=>({required:[e]}))}})),c=o.findIndex(e=>!e.length);return xvt(s,c>-1?n[c]:{anyOf:s.map(({condition:e})=>e)})},L9=(e,{allowUnknownProperties:t=!1}={})=>{let n=r=>{if(Array.isArray(r))return r.map(n);if(!D(r))return r;let i={};if(Object.entries(r).forEach(([e,r])=>{e!==`anyOf`&&!(t&&e===`additionalProperties`&&r===!1)&&(i[e]=n(r))}),Array.isArray(r.anyOf)){let t=r.anyOf.map(n),a=r.anyOf.length>1?Svt(e,r.anyOf,t)??Cvt(e,r.anyOf,t):void 0;a?Object.assign(i,a):i.anyOf=t}return i};return n(e)};function R9(e,t){let n=typeof e;if(n!==typeof t)return!1;let r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!R9(e[r],t[r]))return!1;return!0}if(n===`object`){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!R9(e[r],t[r]))return!1;return!0}return e===t}function z9(e){return encodeURI(wvt(e)).replace(/#/g,`%23`)}function wvt(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var Tvt=/^[A-Za-z0-9._~!$&'()*+,;=:@/?-]$/,Evt=/^%[0-9A-Fa-f]{2}$/,Dvt=/^[A-Za-z0-9._~-]$/;function Ovt(e){let t=``;for(let n=0;n<e.length;){let r=e[n],i=e.slice(n,n+3);if(r===`%`&&Evt.test(i)){let e=String.fromCharCode(parseInt(i.slice(1),16));t+=Dvt.test(e)?e:i.toUpperCase(),n+=3;continue}let a=String.fromCodePoint(e.codePointAt(n));t+=Tvt.test(a)?a:encodeURIComponent(a),n+=a.length}return t}function B9(e,t){let n=new URL(e,t.href);return n.hash=n.hash?Ovt(n.hash.slice(1)):``,n}var kvt={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Avt={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},jvt={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,dependentRequired:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},Mvt=typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);function V9(e,t=Object.create(null),n=Mvt,r=``){if(e&&typeof e==`object`&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=B9(i,n);a.hash.length>1?t[a.href]=e:(a.hash=``,r===``?n=a:V9(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0&&t[i]!==e)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=B9(e.$ref,n);Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=B9(e.$recursiveRef,n);Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=B9(`#`+e.$anchor,n);t[r.href]=e}for(let i in e){if(jvt[i])continue;let a=`${r}/${z9(i)}`,o=e[i];if(Array.isArray(o)){if(kvt[i]){let e=o.length;for(let r=0;r<e;r++)V9(o[r],t,n,`${a}/${r}`)}}else if(Avt[i])for(let e in o)V9(o[e],t,n,`${a}/${z9(e)}`);else V9(o,t,n,a)}return t}var Nvt=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Pvt=[0,31,28,31,30,31,30,31,31,30,31,30,31],Fvt=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|([+-])(\d\d):(\d\d))?$/i,Ivt=/^(?=.{1,253}$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,Lvt=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,Rvt=/^(?:(?:[^\x00-\x20\x7f"<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,zvt=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Bvt=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Vvt=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Hvt=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Uvt=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Wvt=/^("(?:[\x20-\x21\x23-\x5b\x5d-\x7e]|\\[\x20-\x7e])*"|[a-z0-9.!#$%&'*+/=?^_`{|}~-]+)@(.+)$/i,Gvt=e=>{let t=e.match(Wvt);if(!t)return!1;let n=t[1],r=t[2];if(!n||!r||n.length>64||r.length>253||n[0]!==`"`&&(n[0]===`.`||n.endsWith(`.`)||n.includes(`..`)))return!1;if(r.startsWith(`[`)&&r.endsWith(`]`)){let e=r.slice(1,-1);return/^ipv6:/i.test(e)?qvt.test(e.slice(5)):Kvt.test(e)}return Ivt.test(r)},Kvt=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,qvt=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Jvt=e=>/^P(?:\d+W|(?:(?:\d+Y(?:\d+M(?:\d+D)?)?|\d+M(?:\d+D)?|\d+D)(?:T(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S))?|T(?:\d+H(?:\d+M(?:\d+S)?)?|\d+M(?:\d+S)?|\d+S)))$/.test(e);function H9(e){return e.test.bind(e)}var Yvt={date:Zvt,time:Qvt.bind(void 0,!0),"date-time":eyt,duration:Jvt,uri:ryt,"uri-reference":H9(Lvt),"uri-template":H9(Rvt),url:H9(zvt),email:Gvt,hostname:H9(Ivt),ipv4:H9(Kvt),ipv6:H9(qvt),regex:ayt,uuid:H9(Bvt),"json-pointer":H9(Vvt),"json-pointer-uri-fragment":H9(Hvt),"relative-json-pointer":H9(Uvt)};function Xvt(e){return e%4==0&&(e%100!=0||e%400==0)}function Zvt(e){let t=e.match(Nvt);if(!t)return!1;let n=t[1],r=t[2],i=t[3];if(!n||!r||!i)return!1;let a=+n,o=+r,s=+i,c=o==2&&Xvt(a)?29:Pvt[o];return o>=1&&o<=12&&s>=1&&c!==void 0&&s<=c}function Qvt(e,t){let n=t.match(Fvt);if(!n)return!1;let r=n[1],i=n[2],a=n[3];if(!r||!i||!a)return!1;let o=+r,s=+i,c=+a,l=n[5],u=n[6],d=+(n[7]??0),f=+(n[8]??0);if(o>23||s>59||c>60||d>23||f>59||e&&l===void 0)return!1;if(c<60)return!0;let p=u===`+`?1:u===`-`?-1:0;return(o*60+s-p*(d*60+f)+1440)%1440==1439}var $vt=/t|\s/i;function eyt(e){let[t,n,r]=e.split($vt);return t!==void 0&&n!==void 0&&r===void 0&&Zvt(t)&&Qvt(!0,n)}var tyt=/\/|:/,nyt=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function ryt(e){return tyt.test(e)&&nyt.test(e)}var iyt=/[^\\]\\Z/;function ayt(e){if(iyt.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function oyt(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function U9(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function syt(e){let t=Math.abs(e).toString().split(`e`),n=t[0],r=t[1]??`0`,i=n.indexOf(`.`),a=i===-1?0:n.length-i-1;return[BigInt(n.replace(`.`,``)),Number(r)-a]}function cyt(e,t){if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0)return!1;let[n,r]=syt(e),[i,a]=syt(t),o=r-a;return o>=0?n*10n**BigInt(o)%i==0n:n%(i*10n**BigInt(-o))==0n}function W9(e,t,n=`2019-09`,r=V9(t),i=!0,a=null,o=`#`,s=`#`,c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:o,keyword:`false`,keywordLocation:o,error:`False boolean schema.`}]};let l=typeof e,u;switch(l){case`boolean`:case`number`:case`string`:u=l;break;case`object`:u=e===null?`null`:Array.isArray(e)?`array`:`object`;break;default:throw Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:_,not:v,anyOf:y,allOf:b,oneOf:x,if:S,then:C,else:w,format:T,properties:ee,patternProperties:E,additionalProperties:te,unevaluatedProperties:ne,minProperties:re,maxProperties:ie,propertyNames:ae,dependentRequired:oe,dependentSchemas:se,dependencies:ce,prefixItems:le,items:ue,additionalItems:de,unevaluatedItems:fe,contains:pe,minContains:me,maxContains:he,minItems:ge,maxItems:_e,uniqueItems:ve,minimum:ye,maximum:be,exclusiveMinimum:xe,exclusiveMaximum:Se,multipleOf:Ce,minLength:we,maxLength:Te,pattern:Ee,__absolute_ref__:De,__absolute_recursive_ref__:Oe}=t,ke=[];if(p===!0&&a===null&&(a=t),f===`#`){let l=a===null?r[Oe]:a,u=`${s}/$recursiveRef`,d=W9(e,a===null?t:a,n,r,i,l,o,u,c);d.valid||ke.push({instanceLocation:o,keyword:`$recursiveRef`,keywordLocation:u,error:`A subschema had errors.`},...d.errors)}if(d!==void 0){let t=r[De||d];if(t===void 0){let e=`Unresolved $ref "${d}".`;throw De&&De!==d&&(e+=` Absolute URI "${De}".`),e+=`\nKnown schemas:\n- ${Object.keys(r).join(`
|
||
- `)}`,Error(e)}let l=`${s}/$ref`,u=W9(e,t,n,r,i,a,o,l,c);if(u.valid||ke.push({instanceLocation:o,keyword:`$ref`,keywordLocation:l,error:`A subschema had errors.`},...u.errors),n===`4`||n===`7`)return{valid:ke.length===0,errors:ke}}if(Array.isArray(m)){let t=m.length,n=!1;for(let r=0;r<t;r++)if(u===m[r]||m[r]===`integer`&&u===`number`&&e%1==0&&e===e){n=!0;break}n||ke.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m.join(`", "`)}".`})}else m===`integer`?(u!==`number`||e%1||e!==e)&&ke.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`}):m!==void 0&&u!==m&&ke.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`});if(h!==void 0&&(u===`object`||u===`array`?R9(e,h)||ke.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`}):e!==h&&ke.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})),g!==void 0&&(u===`object`||u===`array`?g.some(t=>R9(e,t))||ke.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||ke.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;W9(e,v,n,r,i,a,o,t).valid&&ke.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let Ae=[];if(y!==void 0){let t=`${s}/anyOf`,l=ke.length,u=!1;for(let[s,l]of y.entries()){let d=Object.create(c),f=W9(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ke.push(...f.errors),u||=f.valid,f.valid&&Ae.push(d)}u?ke.length=l:ke.splice(l,0,{instanceLocation:o,keyword:`anyOf`,keywordLocation:t,error:`Instance does not match any subschemas.`})}if(b!==void 0){let t=`${s}/allOf`,l=ke.length,u=!0;for(let[s,l]of b.entries()){let d=Object.create(c),f=W9(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ke.push(...f.errors),u&&=f.valid,f.valid&&Ae.push(d)}u?ke.length=l:ke.splice(l,0,{instanceLocation:o,keyword:`allOf`,keywordLocation:t,error:`Instance does not match every subschema.`})}if(x!==void 0){let t=`${s}/oneOf`,l=ke.length,u=x.filter((s,l)=>{let u=Object.create(c),d=W9(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return ke.push(...d.errors),d.valid&&Ae.push(u),d.valid}).length;u===1?ke.length=l:ke.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...Ae),S!==void 0){let t=`${s}/if`,l=Object.create(null);if(W9(e,S,n,r,i,a,o,t,l).valid){if(Object.assign(c,l),C!==void 0){let l=W9(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||ke.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=W9(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||ke.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)U9(e,t)||ke.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(re!==void 0&&t.length<re&&ke.push({instanceLocation:o,keyword:`minProperties`,keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${re} properties.`}),ie!==void 0&&t.length>ie&&ke.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${ie} properties.`}),ae!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${z9(s)}`,c=W9(s,ae,n,r,i,a,e,t);c.valid||ke.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(oe!==void 0){let t=`${s}/dependantRequired`;for(let n in oe)if(U9(e,n)){let r=oe[n];for(let i of r)U9(e,i)||ke.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(se!==void 0)for(let[t,l]of Object.entries(se)){let u=`${s}/dependentSchemas`;if(U9(e,t)){let s=W9(e,l,n,r,i,a,o,`${u}/${z9(t)}`,c);s.valid||ke.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:u,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(ce!==void 0){let t=`${s}/dependencies`;for(let s in ce)if(U9(e,s)){let c=ce[s];if(Array.isArray(c))for(let n of c)U9(e,n)||ke.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=W9(e,c,n,r,i,a,o,`${t}/${z9(s)}`);l.valid||ke.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(ee!==void 0){let t=`${s}/properties`;for(let[s,d]of Object.entries(ee)){if(!U9(e,s))continue;let f=`${o}/${z9(s)}`,p=W9(e[s],d,n,r,i,a,f,`${t}/${z9(s)}`);if(l[s]=!0,p.valid)c[s]=!0;else if(u=i,ke.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...p.errors),u)break}}if(!u&&E!==void 0){let t=`${s}/patternProperties`;for(let[s,d]of Object.entries(E)){let f=new RegExp(s,`u`);for(let p in e){if(!f.test(p))continue;let m=`${o}/${z9(p)}`,h=W9(e[p],d,n,r,i,a,m,`${t}/${z9(s)}`);l[p]=!0,h.valid?c[p]=!0:(u=i,ke.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&te!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${z9(s)}`,f=W9(e[s],te,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,ke.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&ne!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${z9(s)}`,u=W9(e[s],ne,n,r,i,a,l,t);u.valid?c[s]=!0:ke.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){_e!==void 0&&e.length>_e&&ke.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${_e}).`}),ge!==void 0&&e.length<ge&&ke.push({instanceLocation:o,keyword:`minItems`,keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${ge}).`});let t=e.length,l=0,u=!1;if(le!==void 0){let d=`${s}/prefixItems`,f=Math.min(le.length,t);for(;l<f;l++){let t=W9(e[l],le[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ke.push({instanceLocation:o,keyword:`prefixItems`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}if(ue!==void 0){let d=`${s}/items`;if(Array.isArray(ue)){let s=Math.min(ue.length,t);for(;l<s;l++){let t=W9(e[l],ue[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ke.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}else for(;l<t;l++){let t=W9(e[l],ue,n,r,i,a,`${o}/${l}`,d);if(c[l]=!0,!t.valid&&(u=i,ke.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}if(!u&&de!==void 0){let d=`${s}/additionalItems`;for(;l<t;l++){let t=W9(e[l],de,n,r,i,a,`${o}/${l}`,d);c[l]=!0,t.valid||(u=i,ke.push({instanceLocation:o,keyword:`additionalItems`,keywordLocation:d,error:`Items did not match additional items schema.`},...t.errors))}}}if(pe!==void 0){if(t===0&&me===void 0)ke.push({instanceLocation:o,keyword:`contains`,keywordLocation:`${s}/contains`,error:`Array is empty. It must contain at least one item matching the schema.`});else if(me!==void 0&&t<me)ke.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array has less items (${t}) than minContains (${me}).`});else{let l=`${s}/contains`,u=ke.length,d=0;for(let s=0;s<t;s++){let t=W9(e[s],pe,n,r,i,a,`${o}/${s}`,l);t.valid?(c[s]=!0,d++):ke.push(...t.errors)}d>=(me||0)&&(ke.length=u),me===void 0&&d===0?ke.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):me!==void 0&&d<me?ke.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array must contain at least ${me} items matching schema. Only ${d} items were found.`}):he!==void 0&&d>he&&ke.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${he} items matching schema. ${d} items were found.`})}}if(!u&&fe!==void 0){let u=`${s}/unevaluatedItems`;for(;l<t;l++){if(c[l])continue;let t=W9(e[l],fe,n,r,i,a,`${o}/${l}`,u);c[l]=!0,t.valid||ke.push({instanceLocation:o,keyword:`unevaluatedItems`,keywordLocation:u,error:`Items did not match unevaluated items schema.`},...t.errors)}}if(ve)for(let n=0;n<t;n++){let r=e[n],i=typeof r==`object`&&!!r;for(let a=0;a<t;a++){if(n===a)continue;let t=e[a];(r===t||i&&typeof t==`object`&&t&&R9(r,t))&&(ke.push({instanceLocation:o,keyword:`uniqueItems`,keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${n} and ${a}.`}),n=2**53-1,a=2**53-1)}}}else if(u===`number`)n===`4`?(ye!==void 0&&(xe===!0&&e<=ye||e<ye)&&ke.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${xe?`or equal to `:``} ${ye}.`}),be!==void 0&&(Se===!0&&e>=be||e>be)&&ke.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${Se?`or equal to `:``} ${be}.`})):(ye!==void 0&&e<ye&&ke.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${ye}.`}),be!==void 0&&e>be&&ke.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${be}.`}),xe!==void 0&&e<=xe&&ke.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${xe}.`}),Se!==void 0&&e>=Se&&ke.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${Se}.`})),Ce!==void 0&&(cyt(e,Ce)||ke.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${Ce}.`}));else if(u===`string`){let t=we===void 0&&Te===void 0?0:oyt(e);we!==void 0&&t<we&&ke.push({instanceLocation:o,keyword:`minLength`,keywordLocation:`${s}/minLength`,error:`String is too short (${t} < ${we}).`}),Te!==void 0&&t>Te&&ke.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${Te}).`}),Ee!==void 0&&!new RegExp(Ee,`u`).test(e)&&ke.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&Yvt[T]&&!Yvt[T](e)&&ke.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:ke.length===0,errors:ke}}var lyt=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=V9(e)}validate(e){return W9(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),V9(e,this.lookup)}},uyt=`7`,dyt=[`$ref`,`properties`,`items`,`if`,`allOf`,`oneOf`,`additionalProperties`],G9=`false`,fyt={type:`type`,enum:`allowedValues`,const:`allowedValue`,minItems:`limit`,maxItems:`limit`,minLength:`limit`,maxLength:`limit`},pyt=(e,t)=>P9(t).reduce((t,n)=>n===`$ref`&&D(t)&&typeof t.$ref==`string`?P9(t.$ref).reduce((e,t)=>e?.[t],e):t?.[n],e),myt=(e,t)=>P9(t).reduce((e,t)=>e?.[t],e),hyt=({keyword:e,keywordLocation:t,instanceLocation:n},r,i)=>{let a=n.replace(/^#/,``);if(e===`required`){let o=pyt(r,t),s=myt(i,n);return!Array.isArray(o)||!D(s)?[]:o.filter(e=>!(e in s)).map(t=>({instancePath:a,keyword:e,params:{missingProperty:t}}))}let o=fyt[e];return[{instancePath:a,keyword:e,params:o?{[o]:pyt(r,t)}:{}}]},gyt=e=>{let t=e.filter(({keyword:e})=>e!==G9).map(({instanceLocation:e})=>e);return e.filter(({keyword:e,instanceLocation:n})=>e===G9&&!t.some(e=>e===n||e.startsWith(`${n}/`))).map(({instanceLocation:e})=>{let t=e.replace(/^#/,``),n=t.lastIndexOf(`/`);return{instancePath:t.slice(0,n),keyword:`additionalProperties`,params:{additionalProperty:N9(t.slice(n+1))}}})},K9=e=>{let t=new lyt(structuredClone(e),uyt,!1);return n=>{let{valid:r,errors:i}=t.validate(n);if(r)return[];let a=new Set;return gyt(i).concat(i.filter(({keyword:e})=>e!==G9&&!dyt.includes(e)).filter(({keyword:e,instanceLocation:t,keywordLocation:n})=>{if(e!==`required`)return!0;let r=`${t}|${n}`;return!a.has(r)&&(a.add(r),!0)}).flatMap(t=>hyt(t,e,n)))}},_yt=()=>{let e=[],t;return FO.forEach(({schema:n},r)=>{D(n)&&(t??=K9(pvt),t(n).length?console.warn(`Ignoring the invalid schema registered for the \`${r}\` field type`):e.push({if:{required:[`widget`],properties:{widget:{const:r}}},then:L9(n,{allowUnknownProperties:!0})}))}),e},vyt=e=>{let t=e.definitions?.CustomField,n=D(t)?_yt():[];return n.length?{...e,definitions:{...e.definitions,CustomField:{allOf:[t,...n]}}}:e},yyt=[`string`,`number`,`integer`,`boolean`,`array`,`object`,`null`],q9=e=>AA(Fc.current,{type:`disjunction`}).format(e),byt=e=>`\`${typeof e==`string`&&e?e:JSON.stringify(e)}\``,xyt=e=>X(`config.error.schema_value_type.${e}`),J9=e=>e.reduce((e,t)=>cM(t)?`${e}[${t}]`:e?`${e}.${t}`:t,``),Syt=(e,t,n)=>{let r=t?.widget===`list`?`${e}.*`:e;return r?`${r}.${n}`:n},Cyt=(e,t)=>{let n=t.split(`/`).slice(1).map(N9),r={},i=[],a=e,o=``,s=0,c=!0;for(;s<n.length&&c;){let t=n[s],i=n[s+1],l=i!==void 0&&cM(i)?a?.[t]?.[i]:void 0;D(l)&&a===e&&(t===`collections`||t===`singletons`)?(r[t===`collections`?`collection`:`collectionFile`]=l,a=l,s+=2):D(l)&&t===`files`&&r.collection?(r.collectionFile=l,a=l,s+=2):D(l)&&t===`fields`?(o=Syt(o,a,l.name),a=l,s+=2):D(l)&&t===`types`?(o=`${o}${a?.widget===`list`?`.*`:``}<${l.name}>`,a=l,s+=2):t===`field`&&D(a?.field)?(o=Syt(o,a,a.field.name),a=a.field,s+=1):c=!1}return i.push(...n.slice(s)),o&&(r.typedKeyPath=o),{context:r,option:i}},wyt=({keyword:e,params:t},n)=>e===`enum`?{strKey:`schema_invalid_enum`,values:{option:n,values:q9(t.allowedValues.map(byt))}}:e===`const`?t.allowedValue===``?{strKey:`schema_invalid_empty_value`,values:{option:n}}:{strKey:`schema_invalid_const`,values:{option:n,value:String(t.allowedValue)}}:e===`minItems`||e===`maxItems`?{strKey:`schema_invalid_item_count`,values:{option:n,count:String(t.limit)}}:{strKey:`schema_invalid_value`,values:{option:n}},Tyt=({config:e,errors:t,collectors:n})=>{t.filter(({keyword:e})=>e===`additionalProperties`).forEach(({instancePath:t,params:r})=>{let{context:i,option:a}=Cyt(e,t);b8({type:`warning`,strKey:`schema_unknown_option`,values:{option:J9([...a,r.additionalProperty])},context:i,collectors:n})});let r=t.filter(({keyword:e})=>e!==`if`&&e!==`additionalProperties`),i=[...new Set(r.map(({instancePath:e})=>e))];i.filter(e=>!i.some(t=>t.startsWith(`${e}/`))).forEach(t=>{let i=r.filter(({instancePath:e})=>e===t),{context:a,option:o}=Cyt(e,t),s=i.some(({keyword:e})=>e===`anyOf`),c=i.filter(({keyword:e})=>e===`required`).map(({params:e})=>J9([...o,e.missingProperty])),l=i.filter(({keyword:e})=>e!==`required`&&e!==`anyOf`),u=[...new Set(l.filter(({keyword:e,params:t})=>e===`type`&&yyt.includes(t.type)).map(({params:e})=>e.type))];c.length>1&&s?b8({strKey:`schema_missing_one_of`,values:{options:q9([...new Set(c)].map(byt))},context:a,collectors:n}):[...new Set(c)].forEach(e=>{b8({strKey:`schema_missing_option`,values:{option:e},context:a,collectors:n})}),u.length&&b8({strKey:`schema_invalid_type`,values:{option:J9(o),type:q9(u.map(xyt))},context:a,collectors:n}),l.filter(({keyword:e,params:t})=>!(e===`type`&&yyt.includes(t.type))).forEach(e=>{b8({...wyt(e,J9(o)),context:a,collectors:n})}),!c.length&&!l.length&&b8({strKey:`schema_invalid_value`,values:{option:J9(o)},context:a,collectors:n})})},Y9={$schema:`http://json-schema.org/draft-07/schema#`,$ref:`#/definitions/CmsConfig`,definitions:{CmsConfig:{type:`object`,properties:{load_config_file:{type:`boolean`},backend:{$ref:`#/definitions/Backend`},publish_mode:{anyOf:[{type:`string`,const:``},{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{$ref:`#/definitions/GlobalLegacyMediaLibrary`},media_libraries:{$ref:`#/definitions/MediaLibraries`},app_title:{type:`string`},site_url:{type:`string`},display_url:{type:`string`},logo_url:{type:`string`},logo:{$ref:`#/definitions/LogoOptions`},logout_redirect_url:{type:`string`},issue_reports:{$ref:`#/definitions/IssueReports`},show_preview_links:{type:`boolean`},slug:{$ref:`#/definitions/SlugOptions`},collections:{type:`array`,items:{anyOf:[{$ref:`#/definitions/Collection`},{$ref:`#/definitions/CollectionDivider`}]}},singletons:{type:`array`,items:{anyOf:[{$ref:`#/definitions/CollectionFile`},{$ref:`#/definitions/CollectionDivider`}]}},asset_collections:{type:`array`,items:{$ref:`#/definitions/AssetCollection`}},i18n:{$ref:`#/definitions/I18nOptions`},editor:{$ref:`#/definitions/EditorOptions`},output:{$ref:`#/definitions/OutputOptions`},field_defaults:{$ref:`#/definitions/FieldDefaults`},readonly:{type:`boolean`},$schema:{type:`string`,format:`uri`}},required:[`backend`],additionalProperties:!1,anyOf:[{required:[`collections`]},{required:[`singletons`]}]},Backend:{anyOf:[{$ref:`#/definitions/GitBackend`},{$ref:`#/definitions/TestBackend`}]},GitBackend:{anyOf:[{$ref:`#/definitions/GitHubBackend`},{$ref:`#/definitions/GitLabBackend`},{$ref:`#/definitions/GiteaBackend`},{$ref:`#/definitions/ForgejoBackend`}]},GitHubBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`github`},repo:{type:`string`},api_root:{type:`string`},graphql_api_root:{type:`string`},base_url:{type:`string`},auth_type:{type:`string`,const:``},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},auth_scope:{anyOf:[{type:`string`,const:`repo`},{type:`string`,const:`public_repo`},{type:`array`,items:{type:`string`,enum:[`repo`,`public_repo`,`workflow`]}}]},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},signoff_commits:{type:`boolean`},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},CommitMessages:{type:`object`,properties:{create:{type:`string`},update:{type:`string`},delete:{type:`string`},uploadMedia:{type:`string`},deleteMedia:{type:`string`},openAuthoring:{type:`string`}},additionalProperties:!1},AuthMethodName:{type:`string`,enum:[`oauth`,`token`]},GitLabBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`gitlab`},repo:{type:`string`},api_root:{type:`string`},graphql_api_root:{type:`string`},base_url:{type:`string`},auth_type:{type:`string`,enum:[``,`pkce`]},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},signoff_commits:{type:`boolean`},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},GiteaBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`gitea`},repo:{type:`string`},api_root:{type:`string`},base_url:{type:`string`},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},signoff_commits:{type:`boolean`},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},ForgejoBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`forgejo`},api_root:{type:`string`},base_url:{type:`string`},repo:{type:`string`},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},signoff_commits:{type:`boolean`},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`api_root`,`name`,`repo`]},TestBackend:{type:`object`,properties:{name:{type:`string`,const:`test-repo`},root_dir:{type:`string`}},required:[`name`],additionalProperties:!1},PublishModeType:{type:`string`,enum:[`simple`,`preview`,`editorial_workflow`]},PublishModeOptions:{type:`object`,properties:{type:{$ref:`#/definitions/PublishModeType`},stages:{type:`array`,items:{$ref:`#/definitions/PublishModeStage`}},direct_publish:{type:`boolean`},allow_incomplete_drafts:{type:`boolean`}},additionalProperties:!1},PublishModeStage:{type:`string`,enum:[`draft`,`pending_review`,`pending_publish`]},GlobalLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`default`},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}}},{$ref:`#/definitions/NamedLegacyMediaLibrary`}]},DefaultMediaLibraryConfig:{type:`object`,additionalProperties:!1,properties:{multiple:{type:`boolean`},max_file_size:{type:`number`},slugify_filename:{type:`boolean`},filename_template:{type:`string`},transformations:{$ref:`#/definitions/ImageTransformations`}}},ImageTransformations:{type:`object`,additionalProperties:!1,properties:{svg:{$ref:`#/definitions/VectorImageTransformationOptions`},raster_image:{$ref:`#/definitions/RasterImageTransformationOptions`},avif:{$ref:`#/definitions/RasterImageTransformationOptions`},gif:{$ref:`#/definitions/RasterImageTransformationOptions`},heic:{$ref:`#/definitions/RasterImageTransformationOptions`},jpeg:{$ref:`#/definitions/RasterImageTransformationOptions`},png:{$ref:`#/definitions/RasterImageTransformationOptions`},webp:{$ref:`#/definitions/RasterImageTransformationOptions`}}},VectorImageTransformationOptions:{type:`object`,properties:{optimize:{type:`boolean`}},additionalProperties:!1},RasterImageTransformationOptions:{type:`object`,properties:{format:{type:`string`,const:`webp`},quality:{type:`number`},width:{type:`number`},height:{type:`number`}},additionalProperties:!1},NamedLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`cloudinary`},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`uploadcare`},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/S3MediaLibraryName`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`,`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`azure_blob_storage`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`,`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`stock_assets`},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}},required:[`name`]}]},UploadcareMediaLibrarySettings:{type:`object`,properties:{autoFilename:{type:`boolean`},defaultOperations:{type:`string`}},additionalProperties:!1},S3MediaLibraryName:{type:`string`,enum:[`aws_s3`,`backblaze_b2`,`bunny_storage`,`cloudflare_r2`,`digitalocean_spaces`,`neon_object_storage`,`scaleway_object_storage`,`supabase_storage`]},StockAssetProviderName:{type:`string`,enum:[`pexels`,`picsum`,`pixabay`,`unsplash`]},MediaLibraries:{type:`object`,properties:{all:{$ref:`#/definitions/SharedMediaLibraryOptions`},default:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/DefaultMediaLibrary`}]},cloudinary:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/CloudinaryMediaLibrary`}]},uploadcare:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/UploadcareMediaLibrary`}]},aws_s3:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},azure_blob_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/AzureMediaLibrary`}]},cloudflare_r2:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},digitalocean_spaces:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},backblaze_b2:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},bunny_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},neon_object_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},scaleway_object_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},supabase_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},stock_assets:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/StockMediaLibrary`}]}},additionalProperties:!1},SharedMediaLibraryOptions:{type:`object`,properties:{max_file_size:{type:`number`},slugify_filename:{type:`boolean`},filename_template:{type:`string`},transformations:{$ref:`#/definitions/ImageTransformations`}},additionalProperties:!1},DefaultMediaLibrary:{type:`object`,properties:{config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}},additionalProperties:!1},CloudinaryMediaLibrary:{type:`object`,properties:{output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}},additionalProperties:!1},UploadcareMediaLibrary:{type:`object`,properties:{config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}},additionalProperties:!1},S3MediaLibrary:{type:`object`,properties:{access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`],additionalProperties:!1},AzureMediaLibrary:{type:`object`,properties:{account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`],additionalProperties:!1},StockMediaLibrary:{type:`object`,properties:{providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}},additionalProperties:!1},LogoOptions:{type:`object`,properties:{src:{type:`string`},show_in_header:{type:`boolean`}},additionalProperties:!1},IssueReports:{type:`object`,properties:{url:{type:`string`}},additionalProperties:!1},SlugOptions:{type:`object`,properties:{encoding:{type:`string`,enum:[`unicode`,`ascii`]},clean_accents:{type:`boolean`},sanitize_replacement:{type:`string`},maxlength:{type:`number`},trim:{type:`boolean`},lowercase:{type:`boolean`},timezone:{type:`string`,enum:[`local`,`utc`]}},additionalProperties:!1},Collection:{anyOf:[{$ref:`#/definitions/EntryCollection`},{$ref:`#/definitions/FileCollection`}]},EntryCollection:{type:`object`,additionalProperties:!1,properties:{folder:{type:`string`},file:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},path:{type:`string`},filter:{$ref:`#/definitions/CollectionFilter`},create:{type:`boolean`},delete:{type:`boolean`},duplicate:{type:`boolean`},reorder:{anyOf:[{type:`boolean`},{$ref:`#/definitions/ReorderOptions`}]},table_columns:{type:`array`,items:{anyOf:[{type:`string`},{$ref:`#/definitions/TableColumn`}]}},summary_fields:{type:`array`,items:{type:`string`}},bulk_edit:{anyOf:[{type:`boolean`},{$ref:`#/definitions/BulkEditOptions`}]},extension:{type:`string`},identifier_field:{type:`string`},slug:{anyOf:[{type:`string`},{$ref:`#/definitions/CollectionSlugOptions`}]},slug_length:{type:`number`},summary:{type:`string`},sortable_fields:{anyOf:[{$ref:`#/definitions/SortableFields`},{type:`array`,items:{anyOf:[{type:`string`},{$ref:`#/definitions/SortableField`}]}}]},view_filters:{anyOf:[{$ref:`#/definitions/ViewFilters`},{type:`array`,items:{$ref:`#/definitions/ViewFilter`}}]},view_groups:{anyOf:[{$ref:`#/definitions/ViewGroups`},{type:`array`,items:{$ref:`#/definitions/ViewGroup`}}]},nested:{$ref:`#/definitions/NestedEntryOptions`},meta:{$ref:`#/definitions/CollectionMetaData`},index_file:{anyOf:[{type:`boolean`},{$ref:`#/definitions/CollectionIndexFile`}]},thumbnail:{anyOf:[{type:`string`},{type:`boolean`},{type:`array`,items:{type:`string`}}]},limit:{type:`number`},aliases_field:{type:[`string`,`boolean`]},permalink_field:{type:[`string`,`boolean`]},label_singular:{type:`string`},description:{type:`string`},media_folder:{type:`string`},public_folder:{type:`string`},hide:{type:`boolean`},publish_mode:{anyOf:[{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},publish:{type:`boolean`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},yaml_quote:{type:`boolean`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`fields`,`name`]},Field:{anyOf:[{$ref:`#/definitions/StandardField`},{$ref:`#/definitions/CustomField`}]},StandardField:{anyOf:[{$ref:`#/definitions/VisibleField`},{$ref:`#/definitions/HiddenField`}]},VisibleField:{anyOf:[{$ref:`#/definitions/BooleanField`},{$ref:`#/definitions/CodeField`},{$ref:`#/definitions/ColorField`},{$ref:`#/definitions/ComputeField`},{$ref:`#/definitions/DateTimeField`},{$ref:`#/definitions/FileField`},{$ref:`#/definitions/ImageField`},{$ref:`#/definitions/KeyValueField`},{$ref:`#/definitions/ListField`},{$ref:`#/definitions/MapField`},{$ref:`#/definitions/MarkdownField`},{$ref:`#/definitions/NumberField`},{$ref:`#/definitions/ObjectField`},{$ref:`#/definitions/RelationField`},{$ref:`#/definitions/RichTextField`},{$ref:`#/definitions/SelectField`},{$ref:`#/definitions/StringField`},{$ref:`#/definitions/TextField`},{$ref:`#/definitions/UuidField`}]},BooleanField:{type:`object`,additionalProperties:!1,properties:{before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`boolean`},default:{type:`boolean`},default_localized:{type:`object`,additionalProperties:{type:`boolean`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},FieldI18nStrategy:{anyOf:[{type:`boolean`},{type:`string`,const:`duplicate`},{type:`string`,const:`sync`},{type:`string`,const:`translate`},{type:`string`,const:`none`}]},CodeField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`code`},default:{anyOf:[{type:`string`},{type:`object`,additionalProperties:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`object`,additionalProperties:{type:`string`}}]}},default_language:{type:`string`},allow_language_selection:{type:`boolean`},output_code_only:{type:`boolean`},keys:{type:`object`,properties:{code:{type:`string`},lang:{type:`string`}},required:[`code`,`lang`],additionalProperties:!1},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ColorField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`color`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},allowInput:{type:`boolean`},enableAlpha:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ComputeField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`compute`},value:{type:`string`},value_type:{type:`string`,enum:[`string`,`float`,`int`,`int/string`,`float/string`]},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`value`,`widget`]},DateTimeField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`datetime`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},type:{$ref:`#/definitions/DateTimeInputType`},min:{type:`string`},max:{type:`string`},step:{anyOf:[{type:`number`},{type:`string`,const:`any`}]},format:{type:`string`},date_format:{type:[`string`,`boolean`]},time_format:{type:[`string`,`boolean`]},localize_format:{type:[`string`,`boolean`]},picker_utc:{type:`boolean`},input_timezone:{type:`string`},output_utc:{type:`boolean`},auto_now:{anyOf:[{type:`boolean`},{type:`array`,items:{$ref:`#/definitions/DateTimeAutoNowStage`}}]},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},DateTimeInputType:{type:`string`,enum:[`datetime-local`,`date`,`time`]},DateTimeAutoNowStage:{type:`string`,enum:[`create`,`update`]},FileField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`file`},select_folder:{type:`boolean`},default:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]}},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},accept:{type:`string`},choose_url:{type:`boolean`},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{$ref:`#/definitions/FieldLegacyMediaLibrary`},media_libraries:{$ref:`#/definitions/MediaLibraries`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},FieldLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`default`},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}},required:[`name`]},{$ref:`#/definitions/FieldNamedLegacyMediaLibrary`},{$ref:`#/definitions/UnnamedLegacyMediaLibrary`}]},FieldNamedLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`cloudinary`},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`uploadcare`},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/S3MediaLibraryName`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`azure_blob_storage`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`name`]},{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`stock_assets`},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}},required:[`name`]}]},UnnamedLegacyMediaLibrary:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{not:{}},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}}},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}}},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}}},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`]},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`]},{type:`object`,additionalProperties:!1,properties:{name:{not:{}},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}}}]},ImageField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`image`},default:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]}},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},accept:{type:`string`},choose_url:{type:`boolean`},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{$ref:`#/definitions/FieldLegacyMediaLibrary`},media_libraries:{$ref:`#/definitions/MediaLibraries`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},KeyValueField:{type:`object`,additionalProperties:!1,properties:{min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`keyvalue`},default:{type:`object`,additionalProperties:{type:`string`}},default_localized:{type:`object`,additionalProperties:{type:`object`,additionalProperties:{type:`string`}}},key_label:{type:`string`},value_label:{type:`string`},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},root:{type:`boolean`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_keys`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ListField:{anyOf:[{$ref:`#/definitions/SimpleListField`},{$ref:`#/definitions/ListFieldWithSubField`},{$ref:`#/definitions/ListFieldWithSubFields`},{$ref:`#/definitions/ListFieldWithTypes`}]},SimpleListField:{type:`object`,additionalProperties:!1,properties:{pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{type:`array`,items:{}},default_localized:{type:`object`,additionalProperties:{type:`array`,items:{}}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ListFieldWithSubField:{type:`object`,additionalProperties:!1,properties:{field:{$ref:`#/definitions/Field`},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{type:`array`,items:{}},default_localized:{type:`object`,additionalProperties:{type:`array`,items:{}}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`field`,`name`,`widget`]},ListFieldWithSubFields:{type:`object`,additionalProperties:!1,properties:{map_key_field:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{type:`array`,items:{}},default_localized:{type:`object`,additionalProperties:{type:`array`,items:{}}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`fields`,`name`,`widget`]},ListFieldWithTypes:{type:`object`,additionalProperties:!1,properties:{map_key_field:{type:`string`},types:{type:`array`,items:{$ref:`#/definitions/VariableFieldType`}},typeKey:{type:`string`},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{type:`array`,items:{}},default_localized:{type:`object`,additionalProperties:{type:`array`,items:{}}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`types`,`widget`]},VariableFieldType:{type:`object`,properties:{name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},widget:{type:`string`,const:`object`},description:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},summary:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}}},required:[`name`],additionalProperties:!1},MapField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`map`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},decimals:{type:`number`},type:{type:`string`,enum:[`Point`,`LineString`,`Polygon`]},center:{type:`array`,items:{type:`number`},minItems:2,maxItems:2},zoom:{type:`number`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},MarkdownField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`markdown`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},multiline:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},RichTextEditorButtonName:{type:`string`,enum:[`bold`,`italic`,`strikethrough`,`code`,`link`,`heading-one`,`heading-two`,`heading-three`,`heading-four`,`heading-five`,`heading-six`,`quote`,`bulleted-list`,`numbered-list`,`align`]},RichTextEditorMode:{type:`string`,enum:[`rich_text`,`raw`]},NumberField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`number`},default:{type:[`string`,`number`]},default_localized:{type:`object`,additionalProperties:{type:[`string`,`number`]}},value_type:{type:`string`,enum:[`float`,`int`,`int/string`,`float/string`]},min:{type:`number`},max:{type:`number`},step:{type:`number`},auto_increment:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ObjectField:{anyOf:[{$ref:`#/definitions/ObjectFieldWithSubFields`},{$ref:`#/definitions/ObjectFieldWithTypes`}]},ObjectFieldWithSubFields:{type:`object`,additionalProperties:!1,properties:{fields:{type:`array`,items:{$ref:`#/definitions/Field`}},widget:{type:`string`,const:`object`},default:{type:`object`},default_localized:{type:`object`,additionalProperties:{type:`object`}},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},summary:{type:`string`},thumbnail:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`fields`,`name`,`widget`]},ObjectFieldWithTypes:{type:`object`,additionalProperties:!1,properties:{types:{type:`array`,items:{$ref:`#/definitions/VariableFieldType`}},typeKey:{type:`string`},widget:{type:`string`,const:`object`},default:{type:`object`},default_localized:{type:`object`,additionalProperties:{type:`object`}},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},summary:{type:`string`},thumbnail:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`types`,`widget`]},RelationField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},dropdown_threshold:{type:`number`},widget:{type:`string`,const:`relation`},default:{anyOf:[{},{type:`array`,items:{}}]},default_localized:{type:`object`},collection:{type:`string`},file:{type:`string`},value_field:{type:`string`},display_fields:{type:`array`,items:{type:`string`}},search_fields:{type:`array`,items:{type:`string`}},filters:{type:`array`,items:{$ref:`#/definitions/RelationFieldFilterOptions`}},sort_by:{$ref:`#/definitions/RelationFieldSortOptions`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`collection`,`name`,`widget`]},RelationFieldFilterOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},values:{type:`array`,items:{}},exclude:{type:`boolean`}},required:[`field`,`values`],additionalProperties:!1},FieldKeyPath:{type:`string`},RelationFieldSortOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},direction:{type:`string`,enum:[`ascending`,`descending`]}},required:[`field`],additionalProperties:!1},RichTextField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`richtext`},format:{$ref:`#/definitions/RichTextValueFormat`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},multiline:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},RichTextValueFormat:{type:`string`,enum:[`markdown`,`html`]},SelectField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},dropdown_threshold:{type:`number`},widget:{type:`string`,const:`select`},default:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`},{type:`array`,items:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`}]}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`},{type:`array`,items:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`}]}}]}},options:{anyOf:[{type:`array`,items:{$ref:`#/definitions/SelectFieldValue`}},{type:`array`,items:{$ref:`#/definitions/SelectFieldOption`}}]},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`options`,`widget`]},SelectFieldValue:{type:[`string`,`number`,`boolean`,`null`]},SelectFieldOption:{type:`object`,properties:{label:{type:`string`},value:{$ref:`#/definitions/SelectFieldValue`}},required:[`label`,`value`],additionalProperties:!1},StringField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},minlength:{type:`number`},maxlength:{type:`number`},before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`string`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},type:{type:`string`,enum:[`url`,`text`,`email`]},prefix:{type:`string`},suffix:{type:`string`},use_emoji_autocomplete:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`]},TextField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},minlength:{type:`number`},maxlength:{type:`number`},widget:{type:`string`,const:`text`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},use_emoji_autocomplete:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{$ref:`#/definitions/FieldI18nStrategy`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},UuidField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`uuid`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},prefix:{type:`string`},use_b32_encoding:{type:`boolean`},read_only:{type:`boolean`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},HiddenField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`hidden`},default:{},default_localized:{type:`object`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},CustomField:{type:`object`,properties:{widget:{type:`string`,minLength:1,not:{enum:[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`]}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{$ref:`#/definitions/FieldI18nStrategy`},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},CollectionFilter:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},value:{anyOf:[{},{type:`array`,items:{}}]},pattern:{anyOf:[{type:`string`},{type:`string`,format:`regex`}]}},required:[`field`],additionalProperties:!1},ReorderOptions:{type:`object`,properties:{key:{type:`string`},group:{type:`string`}},additionalProperties:!1},TableColumn:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},label:{type:`string`}},required:[`field`],additionalProperties:!1},BulkEditOptions:{type:`object`,properties:{fields:{type:`array`,items:{type:`string`}}},additionalProperties:!1},CollectionSlugOptions:{type:`object`,properties:{template:{type:`string`},editable:{anyOf:[{type:`boolean`},{type:`array`,items:{$ref:`#/definitions/SlugEditableStage`}}]},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`duplicate`}]},auto_increment:{type:`boolean`},hint:{type:`string`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2}},additionalProperties:!1},SlugEditableStage:{type:`string`,enum:[`create`,`update`]},SortableFields:{type:`object`,properties:{fields:{type:`array`,items:{$ref:`#/definitions/FieldKeyPath`}},default:{$ref:`#/definitions/SortableFieldsDefaultOptions`}},required:[`fields`],additionalProperties:!1},SortableFieldsDefaultOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},direction:{type:`string`,enum:[`ascending`,`descending`,`Ascending`,`Descending`,`None`]}},required:[`field`],additionalProperties:!1},SortableField:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},label:{type:`string`},default_sort:{anyOf:[{type:`boolean`},{type:`string`,const:`desc`},{type:`string`,const:`asc`}]}},required:[`field`],additionalProperties:!1},ViewFilters:{type:`object`,properties:{filters:{type:`array`,items:{$ref:`#/definitions/ViewFilter`}},default:{type:`string`}},required:[`filters`],additionalProperties:!1},ViewFilter:{type:`object`,additionalProperties:!1,properties:{eq:{$ref:`#/definitions/ViewComparisonValue`},ne:{$ref:`#/definitions/ViewComparisonValue`},lt:{$ref:`#/definitions/ViewComparisonValue`},lte:{$ref:`#/definitions/ViewComparisonValue`},gt:{$ref:`#/definitions/ViewComparisonValue`},gte:{$ref:`#/definitions/ViewComparisonValue`},in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},not_in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},empty:{type:`boolean`},name:{type:`string`},label:{type:`string`},field:{$ref:`#/definitions/FieldKeyPath`},pattern:{anyOf:[{type:`string`},{type:`boolean`},{type:`string`,format:`regex`}]}},required:[`field`,`label`]},ViewComparisonValue:{type:[`string`,`number`,`boolean`]},ViewGroups:{type:`object`,properties:{groups:{type:`array`,items:{$ref:`#/definitions/ViewGroup`}},default:{type:`string`}},required:[`groups`],additionalProperties:!1},ViewGroup:{type:`object`,additionalProperties:!1,properties:{eq:{$ref:`#/definitions/ViewComparisonValue`},ne:{$ref:`#/definitions/ViewComparisonValue`},lt:{$ref:`#/definitions/ViewComparisonValue`},lte:{$ref:`#/definitions/ViewComparisonValue`},gt:{$ref:`#/definitions/ViewComparisonValue`},gte:{$ref:`#/definitions/ViewComparisonValue`},in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},not_in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},empty:{type:`boolean`},name:{type:`string`},label:{type:`string`},field:{$ref:`#/definitions/FieldKeyPath`},pattern:{anyOf:[{type:`string`},{type:`boolean`},{type:`string`,format:`regex`}]}},required:[`field`,`label`]},NestedEntryOptions:{type:`object`,properties:{depth:{type:`number`},summary:{type:`string`},subfolders:{type:`boolean`}},additionalProperties:!1},CollectionMetaData:{type:`object`,properties:{path:{$ref:`#/definitions/CollectionMetaDataPath`}},additionalProperties:!1},CollectionMetaDataPath:{type:`object`,properties:{widget:{type:`string`},label:{type:`string`},index_file:{type:`string`}},additionalProperties:!1},CollectionIndexFile:{type:`object`,properties:{name:{type:`string`},extension:{type:`string`},format:{type:`string`},label:{type:`string`},icon:{type:`string`},summary:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},editor:{$ref:`#/definitions/EditorOptions`}},additionalProperties:!1},EditorOptions:{type:`object`,properties:{preview:{type:`boolean`},second_pane:{type:`boolean`}},additionalProperties:!1},BodyFieldOptions:{type:`object`,properties:{key:{type:`string`},inline:{type:`boolean`}},additionalProperties:!1},I18nOptions:{type:`object`,properties:{structure:{$ref:`#/definitions/I18nFileStructure`},locales:{type:`array`,items:{type:`string`}},default_locale:{type:`string`},initial_locales:{anyOf:[{type:`array`,items:{type:`string`}},{type:`string`,const:`default`},{type:`string`,const:`all`}]},save_all_locales:{type:`boolean`},canonical_slug:{type:`object`,properties:{key:{type:`string`},value:{type:`string`}},additionalProperties:!1},omit_default_locale_from_filename:{type:`boolean`},omit_default_locale_from_file_path:{type:`boolean`},omit_default_locale_from_preview_path:{type:`boolean`}},additionalProperties:!1},I18nFileStructure:{type:`string`,enum:[`single_file`,`single_file_default_root`,`multiple_files`,`multiple_folders`,`multiple_folders_i18n_root`,`multiple_root_folders`]},FileCollection:{type:`object`,additionalProperties:!1,properties:{files:{type:`array`,items:{$ref:`#/definitions/CollectionFile`}},label_singular:{type:`string`},description:{type:`string`},media_folder:{type:`string`},public_folder:{type:`string`},hide:{type:`boolean`},publish_mode:{anyOf:[{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},publish:{type:`boolean`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},yaml_quote:{type:`boolean`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`files`,`name`]},CollectionFile:{type:`object`,properties:{name:{type:`string`},label:{type:`string`},icon:{type:`string`},summary:{type:`string`},file:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},media_folder:{type:`string`},public_folder:{type:`string`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},readonly:{type:`boolean`}},required:[`name`,`file`,`fields`],additionalProperties:!1},CollectionDivider:{type:`object`,properties:{name:{type:`string`},divider:{type:`boolean`}},required:[`divider`],additionalProperties:!1},AssetCollection:{type:`object`,additionalProperties:!1,properties:{media_folder:{type:`string`},public_folder:{type:`string`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`media_folder`,`name`]},OutputOptions:{type:`object`,properties:{omit_empty_optional_fields:{type:`boolean`},encode_file_path:{type:`boolean`},json:{$ref:`#/definitions/JsonFormatOptions`},yaml:{$ref:`#/definitions/YamlFormatOptions`}},additionalProperties:!1},JsonFormatOptions:{type:`object`,properties:{indent_style:{type:`string`,enum:[`space`,`tab`]},indent_size:{type:`number`}},additionalProperties:!1},YamlFormatOptions:{type:`object`,properties:{indent_size:{type:`number`},indent_sequences:{type:`boolean`},quote:{type:`string`,enum:[`none`,`double`,`single`]}},additionalProperties:!1},FieldDefaults:{type:`object`,properties:{richtext:{$ref:`#/definitions/RichTextFieldDefaults`}},additionalProperties:!1},RichTextFieldDefaults:{type:`object`,additionalProperties:!1,properties:{format:{$ref:`#/definitions/RichTextValueFormat`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},multiline:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`}}}}},Eyt=void 0,Dyt=()=>{if(Y9)return Eyt??={strict:L9(Y9),lenient:L9(Y9,{allowUnknownProperties:!0})},Eyt},X9=e=>e instanceof RegExp?e.source:Array.isArray(e)?e.map(X9):D(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,X9(t)])):e,Oyt=({config:e,schemas:t,collectors:n})=>{if(t)try{let r=X9(e),i=K9(vyt(t.strict))(r);if(!i.length)return;let a=i.filter(({keyword:e})=>e===`additionalProperties`),o=a.length?K9(vyt(t.lenient))(r):i;Tyt({config:e,errors:[...a,...o],collectors:n})}catch(e){console.warn(`Skipping configuration schema validation`,e)}},{DEV:kyt}={DEV:!1},Ayt=(0,Pht.default)(),jyt=e=>{let t=Vht(e),n=xHe(e,[...ik.mediaFields]);ej.current=t,RB.current=n,CW.devModeEnabled&&(console.info(`allEntryFolders`,t),console.info(`allAssetFolders`,n))},Myt=async e=>{$O.current=void 0,nk.current=[],Object.assign(ik,{errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set});try{if(!window.isSecureContext)throw Error(X(`config.error.no_secure_context`));let t;if(e){if(!D(e))throw Error(X(`config.error.parse_failed`));t=e,t.load_config_file!==!1&&(t=Ayt(await Zht({manualInit:!0}),t))}else t=await Zht();Object.assign(ek,t);let n=Ggt(structuredClone(t));if(Oyt({config:n,schemas:Dyt(),collectors:ik}),uvt(n,ik),ik.errors.size)throw ik.errors.forEach(e=>{console.error(e)}),Error(`Errors found in configuration`);if(ik.warnings.size&&ik.warnings.forEach(e=>{console.warn(e)}),n._siteURL=n.site_url?.trim()||(kyt?VO:window.location.origin),n._baseURL=QE(n._siteURL)?new URL(n._siteURL).origin:``,n.collections?.forEach(e=>{`folder`in e&&(e.folder=e.folder.replace(/^\.(?:\/|$)/,``).replace(/^\/$/,``))}),await vwe(ik.formatLocales),$O.current=n,jyt(n),fvt({config:n,entryFolders:ej.current,assetFolders:RB.current,collectors:ik}),ik.errors.size)throw $O.current=void 0,Error(`Errors found in configuration`);tk.current=await el(JSON.stringify(n,(e,t)=>typeof t==`bigint`?t.toString():t)),console.debug(`CMS configuration:`,n),CW.devModeEnabled&&console.info(`collectors`,ik)}catch(e){nk.current=ik.errors.size?[...ik.errors]:[e.name===`Error`?e.message:X(`config.error.unexpected`)],console.error(e,e.cause)}},Nyt=V(`<link rel="apple-touch-icon"/>`),Pyt=V(`<link rel="manifest"/>`),Fyt=V(`<link rel="icon"/> <!> <!>`,1),Iyt=V(`<link type="application/yaml" rel="cms-config-url"/>`),Lyt=V(`<meta name="referrer" content="same-origin"/> <meta name="robots" content="noindex"/> <!> <!>`,1),Ryt=V(`<!> <!> <!> <!> <!> <!> <div role="none" class="main svelte-7y4msj"><!></div>`,1),zyt=V(`<div role="none" class="outer svelte-7y4msj"><!></div> <div role="status" class="svelte-7y4msj"> </div>`,1),Byt={hash:`svelte-7y4msj`,code:`
|
||
@view-transition {navigation:auto;
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-slide-out-to-left {
|
||
from {
|
||
transform: translateX(0);
|
||
filter: brightness(1);
|
||
}
|
||
|
||
to {
|
||
transform: translateX(-20%);
|
||
filter: brightness(0.5);
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-slide-out-to-right {
|
||
from {
|
||
transform: translateX(0);
|
||
opacity: 1;
|
||
}
|
||
|
||
to {
|
||
transform: translateX(100%);
|
||
opacity: 0;
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-slide-in-from-right {
|
||
from {
|
||
transform: translateX(100%);
|
||
opacity: 0;
|
||
}
|
||
|
||
to {
|
||
transform: translateX(0);
|
||
opacity: 1;
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-slide-in-from-left {
|
||
from {
|
||
transform: translateX(-20%);
|
||
filter: brightness(0.5);
|
||
}
|
||
|
||
to {
|
||
transform: translateX(0);
|
||
filter: brightness(1);
|
||
}
|
||
}
|
||
|
||
/* RTL-specific keyframes that mirror the depth effect */
|
||
@keyframes svelte-7y4msj-slide-out-to-left-rtl {
|
||
from {
|
||
transform: translateX(0);
|
||
opacity: 1;
|
||
}
|
||
|
||
to {
|
||
transform: translateX(-100%);
|
||
opacity: 0;
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-slide-out-to-right-rtl {
|
||
from {
|
||
transform: translateX(0);
|
||
filter: brightness(1);
|
||
}
|
||
|
||
to {
|
||
transform: translateX(20%);
|
||
filter: brightness(0.5);
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-slide-in-from-right-rtl {
|
||
from {
|
||
transform: translateX(20%);
|
||
filter: brightness(0.5);
|
||
}
|
||
|
||
to {
|
||
transform: translateX(0);
|
||
filter: brightness(1);
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-slide-in-from-left-rtl {
|
||
from {
|
||
transform: translateX(-100%);
|
||
opacity: 0;
|
||
}
|
||
|
||
to {
|
||
transform: translateX(0);
|
||
opacity: 1;
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-fade-out {
|
||
from {
|
||
opacity: 1;
|
||
}
|
||
|
||
to {
|
||
opacity: 0;
|
||
}
|
||
}
|
||
|
||
@keyframes svelte-7y4msj-fade-in {
|
||
from {
|
||
opacity: 0;
|
||
}
|
||
|
||
to {
|
||
opacity: 1;
|
||
}
|
||
}html:active-view-transition-type(forwards) {
|
||
@media (width < 768px) {&::view-transition-old(page-root) {z-index:999;
|
||
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-left;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}&::view-transition-new(page-root) {
|
||
@media (width < 768px) {z-index:1000;
|
||
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-right;
|
||
}
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}&:dir(rtl) {&::view-transition-old(page-root) {
|
||
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-right-rtl;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}&::view-transition-new(page-root) {
|
||
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-left-rtl;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}}
|
||
}}html:active-view-transition-type(backwards) {
|
||
@media (width < 768px) {&::view-transition-old(page-root) {z-index:1000;
|
||
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-right;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}&::view-transition-new(page-root) {z-index:999;
|
||
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-left;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}&:dir(rtl) {&::view-transition-old(page-root) {
|
||
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-left-rtl;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}&::view-transition-new(page-root) {
|
||
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-right-rtl;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}}
|
||
}}html:active-view-transition-type(unknown) {&::view-transition-old(page-main) {
|
||
animation: 100ms ease-in both svelte-7y4msj-fade-out;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}&::view-transition-new(page-main) {
|
||
animation: 100ms ease-in both svelte-7y4msj-fade-in;
|
||
|
||
@media (prefers-reduced-motion) {
|
||
animation: none;
|
||
}}}body:not(:has(#nc-root)) {overflow:hidden;}#nc-root > .sui.app-shell {position:absolute;}.sui.app-shell {
|
||
/* A placeholder is often the only visible label of a search box, so it has to meet the 4.5:1
|
||
text contrast. Sveltia UI only renders it at full strength in the high-contrast themes; the
|
||
default themes leave it at 50% opacity, which is 2.6:1 on white. */--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;
|
||
/* Border drawn where a primary area (page content, editor panes, asset preview) meets a
|
||
secondary one (sidebars, toolbars, the gutter between panes). The default themes tell them
|
||
apart by background alone, so the width is zero; the high-contrast themes, which set
|
||
\`--sui-modal-border-width\` to outline dialogs for the same reason, get a visible line. */--area-border: var(--sui-modal-border-width) solid var(--sui-primary-border-color);}.outer.svelte-7y4msj {display:flex;flex-direction:column;position:absolute;inset:0;overflow:hidden;}.main.svelte-7y4msj {position:relative;flex:auto;display:flex;flex-direction:column;overflow:hidden;background-color:var(--sui-secondary-background-color);}[role='status'].svelte-7y4msj {position:absolute;z-index:-1;opacity:0;pointer-events:none;-webkit-user-select:none;user-select:none;}`};function Vyt(e,t){k(t,!0),q(e,Byt),Yet(),ba(()=>{iFe()}),vs(()=>{c5.current.length?console.error(`Unsupported browser. Missing features:`,c5.current):Myt(t.config)}),vs(()=>Rpt()),vs(()=>{let e=document.querySelector(`#nc-root`);e&&window.getComputedStyle(e).position===`static`&&window.requestAnimationFrame(()=>{let{top:t,height:n}=e.getBoundingClientRect();n?e.style.position=`relative`:(e.style.position=`fixed`,e.style.inset=`${t}px 0 0 0`)})});let n=M(!1),r=j(()=>[f$.current||d$.current,a5.current].filter(Boolean).join(` – `));R(()=>{QA.current&&vU.account?v$(`forwards`,()=>{N(n,!0)}):v$(`backwards`,()=>{N(n,!1)})}),Qo(`7y4msj`,e=>{var t=Lyt(),n=L(F(t),4),i=e=>{var t=Fyt(),n=F(t),i=L(n,2),a=e=>{var t=Nyt();z(()=>J(t,`href`,s5.current.large)),W(e,t)};K(i,e=>{s5.current&&e(a)});var o=L(i,2),s=e=>{var t=Pyt();z(()=>J(t,`href`,cet.current)),W(e,t)};K(o,e=>{cet.current&&e(s)}),z(()=>{J(n,`href`,o5.current),J(n,`type`,oet.current)}),ate(()=>{ia.title=B(r)??``}),W(e,t)};K(n,e=>{rk.current&&e(i)});var a=L(n,2),o=e=>{var t=Iyt();z(()=>J(t,`href`,`${VO??``}/admin/config.yml`)),W(e,t)};K(a,e=>{VO&&e(o)}),W(e,t)}),go(`mousedown`,ia.body,e=>{let t=e.target?.closest(`a`);if(t){let{origin:e,pathname:n}=t;(e!==window.location.origin||n!==window.location.pathname)&&(t.rel=`noopener noreferrer`,t.target=`_blank`)}}),Xxe(e,{children:(e,t)=>{var r=zyt(),i=F(r);h6(P(i),{scope:`page`,children:(e,t)=>{var r=Ryt(),i=F(r);Xet(i,{});var a=L(i,2);Iet(a,{});var o=L(a,2);Aht(o,{});var s=L(o,2);Tet(s,{});var c=L(s,2),l=e=>{Oet(e,{})};K(c,e=>{XJ.current&&e(l)});var u=L(c,2),d=e=>{Nht(e,{})};K(u,e=>{vU.account&&QA.current&&e(d)});var f=L(u,2);h6(P(f),{scope:`page`,children:(e,t)=>{var r=U(),i=F(r),a=e=>{kht(e,{})},o=e=>{bet(e,{})};K(i,e=>{vU.account&&QA.current&&B(n)?e(a):e(o,-1)}),W(e,r)},$$slots:{default:!0}}),O(f),W(e,r)},$$slots:{default:!0}}),O(i);var a=I(L(i,2),!0);z(()=>G(a,u$.current)),W(e,r)},$$slots:{default:!0}}),A()}var Hyt=!1,Z9=async({config:e}={})=>{N8(e===void 0||D(e),`init`,`config`,`an object`),Hyt||(Hyt=!0,document.readyState===`loading`&&!document.querySelector(`#nc-root`)&&await new Promise(e=>{window.addEventListener(`DOMContentLoaded`,()=>e(void 0),{once:!0})}),e?.load_config_file!==!1&&Xht(),To(Vyt,{target:document.querySelector(`#nc-root`)??document.body,props:{config:e}}))},Uyt=(e,t,{fromFile:n,toFile:r}={})=>{if(N8(Jk(e),`registerCustomFormat`,`name`,`a non-empty string`),N8(Jk(t),`registerCustomFormat`,`extension`,`a non-empty string`),N8(n===void 0||typeof n==`function`,`registerCustomFormat`,`fromFile`,`a function`),N8(r===void 0||typeof r==`function`,`registerCustomFormat`,`toFile`,`a function`),typeof n!=`function`&&typeof r!=`function`)throw Error("At least one of `fromFile` or `toFile` must be provided to `CMS.registerCustomFormat()`");Wk.includes(e)||(n||console.warn(`The custom “${e}” format has no \`fromFile\` method, so its entries can’t be loaded`),r||console.warn(`The custom “${e}” format has no \`toFile\` method, so its entries can’t be saved`)),IO.set(e,{extension:t,parser:n,formatter:r})},Wyt=e=>{N8(D(e),`registerCustomPage`,`definition`,`an object`);let{id:t,label:n,icon:r,component:i,url:a,newTab:o}=e;P8(typeof t==`string`&&/^[\w-]+$/.test(t),`id`,`a non-empty string of alphanumeric characters, hyphens and underscores`),P8(Jk(n),`label`,`a non-empty string`),P8(r===void 0||Jk(r),`icon`,`a non-empty string`),M8(i===void 0!=(a===void 0),"Either `definition.component` or `definition.url` must be given"),P8(i===void 0||t6(i),`component`,`a React component`),P8(o===void 0||typeof o==`boolean`&&i===void 0,`newTab`,"a boolean given along with `url`");let s;if(a!==void 0){let e=Jk(a)?W7e(a):null;P8(!!e&&[`http:`,`https:`].includes(e.protocol),`url`,"a valid `http` or `https` URL or file path"),s=e.href}PO.set(t,{id:t,label:n,icon:r??`extension`,component:i,url:s,newTab:o??!1}),i&&N3()},Q9=(e,t)=>{P8(e===void 0||typeof e==`function`,t,`a function`)},Gyt=e=>{let{fromInline:t,toInline:n,trigger:r,toPreview:i,onInsert:a,onEdit:o}=e,{fromBlock:s,toBlock:c}=e;P8(typeof(n??c)==`function`,`toInline`,`a function`),Q9(t??s,`fromInline`),Q9(i,`toPreview`),Q9(a,`onInsert`),Q9(o,`onEdit`),P8(r===void 0||Jk(r),`trigger`,`a non-empty string`)},Kyt=e=>{P8(typeof e.toBlock==`function`,`toBlock`,`a function`),Q9(e.toPreview,`toPreview`),P8(Array.isArray(e.fields),`fields`,`an array`);let{htmlSelector:t,fromBlockHTML:n,toBlockHTML:r}=e,i=[t,n,r];i.some(e=>e!==void 0)&&(M8(!i.includes(void 0),"The `definition.htmlSelector`, `definition.fromBlockHTML` and `definition.toBlockHTML` must be given together"),P8(Jk(t)&&yCe(t),`htmlSelector`,`a valid CSS selector`),M8(!!Wj(t),"Each selector in the `definition.htmlSelector` must name the element type it matches"),P8(typeof n==`function`,`fromBlockHTML`,`a function`),P8(typeof r==`function`,`toBlockHTML`,`a function`))},qyt=e=>{N8(D(e),`registerEditorComponent`,`definition`,`an object`),P8(Jk(e.id),`id`,`a non-empty string`),P8(e.label===void 0||Jk(e.label),`label`,`a non-empty string`),P8(e.pattern instanceof RegExp,`pattern`,`a RegExp`),zj(e)?Gyt(e):(Kyt(e),Kgt(e)),NO.set(e.id,e),(e.toPreview?.length??0)>=3&&M0()},Jyt=e=>{if(!D(e))throw TypeError(`The event listener must be an object`);let{name:t,handler:n}=e;if(typeof t!=`string`||typeof n!=`function`)throw TypeError("The event listener must have a string `name` property and a function `handler` property");if(!m4.includes(t))throw RangeError(`Unsupported event listener name "${t}". Supported names are: ${m4.join(`, `)}`);BO.add(e),M0()},$9=(e,t,n,r)=>{let i=D(e),a=i?e:{name:e,controlComponent:t,previewComponent:n,schema:r},[o,s]=i?[`controlComponent`,`previewComponent`]:[`control`,`preview`],{name:c,controlComponent:l,previewComponent:u,summaryComponent:d,schema:f}=a;N8(Jk(c),`registerFieldType`,`name`,`a non-empty string`),U7e({name:c,reserved:dk,subject:`field type`,builtin:`built-in field type`,custom:`custom field type`}),N8(t6(l)||typeof l==`string`,`registerFieldType`,o,`a React component or a string`),N8(u===void 0||t6(u),`registerFieldType`,s,`a React component`),N8(d===void 0||t6(d),`registerFieldType`,`summaryComponent`,`a React component`),N8(f===void 0||D(f),`registerFieldType`,`schema`,`an object`),FO.set(c,{control:l,preview:u,summary:d,schema:f}),M0(),N3()},Yyt=(e,{raw:t=!1,collection:n,file:r}={})=>{N8(Jk(e),`registerPreviewStyle`,`style`,`a non-empty string`),N8(typeof t==`boolean`,`registerPreviewStyle`,`raw`,`a boolean`),N8(n===void 0||Jk(n),`registerPreviewStyle`,`collection`,`a non-empty string`),N8(r===void 0||Jk(r),`registerPreviewStyle`,`file`,`a non-empty string`),M8(r===void 0||n!==void 0,"The `file` option for `CMS.registerPreviewStyle()` requires the `collection` option");let i=t?null:W7e(e);N8(t||!!i,`registerPreviewStyle`,`style`,"a valid URL or file path when `raw` is false");let a=t?URL.createObjectURL(new Blob([e],{type:`text/css`})):i.href;[...LO].some(e=>e.url===a&&e.collection===n&&e.file===r)||LO.add({url:a,collection:n,file:r})},Xyt=(e,t)=>{N8(Jk(e),`registerPreviewTemplate`,`name`,`a non-empty string`),N8(t6(t),`registerPreviewTemplate`,`component`,`a React component`),RO.set(e,t),M0(),N3()},Zyt=(e,t)=>{N8(typeof e==`string`&&PN.test(e),`registerStringTransformation`,`name`,`a string consisting of letters, digits and underscores, not starting with a digit`),U7e({name:e,reserved:NN,subject:`string transformation`,builtin:`built-in transformation`,custom:`custom transformation`}),N8(typeof t==`function`,`registerStringTransformation`,`transform`,`a function`),zO.set(e,t)},Qyt=(e,t,{fieldConfig:n}={})=>{N8(e instanceof Element,`renderRichText`,`target`,`an element`),N8(typeof t==`string`,`renderRichText`,`value`,`a string`),N8(n===void 0||D(n),`renderRichText`,`fieldConfig`,`an object`);let r=To(O8,{target:e,props:{locale:``,keyPath:``,typedKeyPath:``,fieldConfig:{name:`body`,sanitize_preview:!0,...n,widget:`richtext`},currentValue:t}});return()=>{Oo(r)}},$yt=br.default,ebt=new Proxy({React:$yt,getFieldType:F8,getWidget:F8,init:Z9,registerCustomFormat:Uyt,registerCustomPage:Wyt,registerEditorComponent:qyt,registerEventListener:Jyt,registerFieldType:$9,registerPreviewStyle:Yyt,registerPreviewTemplate:Xyt,registerStringTransformation:Zyt,registerWidget:$9,renderRichText:Qyt},{get:(e,t)=>{if(t in e)return e[t];if(lee.includes(t))return console.warn(`CMS.%s() is not supported in Sveltia CMS, and we don’t have any plans to implement it. See %s for compatibility information.`,t,`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#compatibility`),()=>void 0}}),tbt=function(e,t,n,r){var i;t[0]=0;for(var a=1;a<t.length;a++){var o=t[a++],s=t[a]?(t[0]|=o?1:2,n[t[a++]]):t[++a];o===3?r[0]=s:o===4?r[1]=Object.assign(r[1]||{},s):o===5?(r[1]=r[1]||{})[t[++a]]=s:o===6?r[1][t[++a]]+=s+``:o?(i=e.apply(s,tbt(e,s,n,[``,null])),r.push(i),s[0]?t[0]|=2:(t[a-2]=0,t[a]=i)):r.push(s)}return r},nbt=new Map;function rbt(e){var t=nbt.get(this);return t||(t=new Map,nbt.set(this,t)),(t=tbt(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i=``,a=``,o=[0],s=function(e){r===1&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,``)))?o.push(0,e,i):r===3&&(e||i)?(o.push(3,e,i),r=2):r===2&&i===`...`&&e?o.push(4,e,0):r===2&&i&&!e?o.push(5,0,!0,i):r>=5&&((i||!e&&r===5)&&(o.push(r,0,i,n),r=6),e&&(o.push(r,e,0,n),r=6)),i=``},c=0;c<e.length;c++){c&&(r===1&&s(),s(c));for(var l=0;l<e[c].length;l++)t=e[c][l],r===1?t===`<`?(s(),o=[o],r=3):i+=t:r===4?i===`--`&&t===`>`?(r=1,i=``):i=t+i[0]:a?t===a?a=``:i+=t:t===`"`||t===`'`?a=t:t===`>`?(s(),r=1):r&&(t===`=`?(r=5,n=i,i=``):t===`/`&&(r<5||e[c][l+1]===`>`)?(s(),r===3&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):t===` `||t===` `||t===`
|
||
`||t===`\r`?(s(),r=2):i+=t),r===3&&i===`!--`&&(r=4,o=o[0])}return s(),o}(e)),t),arguments,[])).length>1?t:t[0]}var ibt=e=>{let t={},n=``,r=0,i=``,a=()=>{let e=n.indexOf(`:`),r=n.slice(0,e).trim(),i=n.slice(e+1).replace(/!\s*important\s*$/i,``).trim();e>0&&r&&i&&(t[r.startsWith(`--`)?r:r.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=i),n=``};return[...e].forEach(e=>{if(i)i=e===i?``:i;else if(e===`"`||e===`'`)i=e;else if(e===`(`)r+=1;else if(e===`)`)--r;else if(e===`;`&&r<=0){a();return}n+=e}),a(),t},abt=rbt.bind((e,t,...n)=>(0,br.createElement)(e,typeof t?.style==`string`?{...t,style:ibt(t.style)}:t,...n)),obt=ebt;window.CMS=ebt,window.initCMS=Z9,window.createClass=h.default,window.createElement=br.createElement,window.h=br.createElement,window.rf=br.Fragment,window.html=abt,globalThis.__SVELTIA_CMS_REACT__=br.default,window.marked=gr,window.DOMPurify=gt,document.querySelector(`link[rel="stylesheet"][href$="/sveltia-cms.css"]`)&&console.warn("Sveltia CMS does not require a stylesheet. Remove the invalid `<link>` tag referencing `sveltia-cms.css` to avoid unnecessary network requests.");var sbt=document.querySelector(`script[src$="/sveltia-cms.js"]`);return sbt?.type===`module`&&console.warn('The Sveltia CMS script is not an ES module. Remove the "type="module" attribute from the `<script>` tag to avoid unexpected behavior when using the JavaScript API.'),document.querySelector(`script[src="https://identity.netlify.com/v1/netlify-identity-widget.js"]`)&&console.warn(`Netlify Identity Widget is not supported in Sveltia CMS.`),!window.CMS_MANUAL_INIT&&(document.currentScript||sbt)&&Z9(),e.React=$yt,e.default=obt,e.getFieldType=F8,e.getWidget=F8,e.init=Z9,e.registerCustomFormat=Uyt,e.registerCustomPage=Wyt,e.registerEditorComponent=qyt,e.registerEventListener=Jyt,e.registerFieldType=$9,e.registerWidget=$9,e.registerPreviewStyle=Yyt,e.registerPreviewTemplate=Xyt,e.registerStringTransformation=Zyt,e.renderRichText=Qyt,e})({});
|
||
//# sourceMappingURL=sveltia-cms.js.map |