vendor: 4,895 bytes, lines 1-9
1(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function I1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z1={exports:{}},nm={},P1={exports:{}},lt={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Bu=Symbol.for("react.element"),FE=Symbol.for("react.portal"),UE=Symbol.for("react.fragment"),HE=Symbol.for("react.strict_mode"),VE=Symbol.for("react.profiler"),KE=Symbol.for("react.provider"),WE=Symbol.for("react.context"),GE=Symbol.for("react.forward_ref"),qE=Symbol.for("react.suspense"),JE=Symbol.for("react.memo"),ZE=Symbol.for("react.lazy"),Ry=Symbol.iterator;function YE(t){return t===null||typeof t!="object"?null:(t=Ry&&t[Ry]||t["@@iterator"],typeof t=="function"?t:null)}var D1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O1=Object.assign,_1={};function Ml(t,e,n){this.props=t,this.context=e,this.refs=_1,this.updater=n||D1}Ml.prototype.isReactComponent={};Ml.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Ml.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function L1(){}L1.prototype=Ml.prototype;function Rx(t,e,n){this.props=t,this.context=e,this.refs=_1,this.updater=n||D1}var $x=Rx.prototype=new L1;$x.constructor=Rx;O1($x,Ml.prototype);$x.isPureReactComponent=!0;var $y=Array.isArray,R1=Object.prototype.hasOwnProperty,Bx={current:null},$1={key:!0,ref:!0,__self:!0,__source:!0};function B1(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)R1.call(e,r)&&!$1.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Bu,type:t,key:s,ref:o,props:i,_owner:Bx.current}}function QE(t,e){return{$$typeof:Bu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Fx(t){return typeof t=="object"&&t!==null&&t.$$typeof===Bu}function XE(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var By=/\/+/g;function uh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?XE(""+t.key):e.toString(36)}function of(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Bu:case FE:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+uh(o,0):r,$y(i)?(n="",t!=null&&(n=t.replace(By,"$&/")+"/"),of(i,e,n,"",function(u){return u})):i!=null&&(Fx(i)&&(i=QE(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(By,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",$y(t))for(var a=0;a<t.length;a++){s=t[a];var l=r+uh(s,a);o+=of(s,e,n,l,i)}else if(l=YE(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=r+uh(s,a++),o+=of(s,e,n,l,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function xd(t,e,n){if(t==null)return t;var r=[],i=0;return of(t,r,"","",function(s){return e.call(n,s,i++)}),r}function eT(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Vn={current:null},af={transition:null},tT={ReactCurrentDispatcher:Vn,ReactCurrentBatchConfig:af,ReactCurrentOwner:Bx};function F1(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 5,738 bytes, lines 9-25
9lt.Children={map:xd,forEach:function(t,e,n){xd(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return xd(t,function(){e++}),e},toArray:function(t){return xd(t,function(e){return e})||[]},only:function(t){if(!Fx(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};lt.Component=Ml;lt.Fragment=UE;lt.Profiler=VE;lt.PureComponent=Rx;lt.StrictMode=HE;lt.Suspense=qE;lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tT;lt.act=F1;lt.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=O1({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=Bx.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)R1.call(e,l)&&!$1.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Bu,type:t.type,key:i,ref:s,props:r,_owner:o}};lt.createContext=function(t){return t={$$typeof:WE,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:KE,_context:t},t.Consumer=t};lt.createElement=B1;lt.createFactory=function(t){var e=B1.bind(null,t);return e.type=t,e};lt.createRef=function(){return{current:null}};lt.forwardRef=function(t){return{$$typeof:GE,render:t}};lt.isValidElement=Fx;lt.lazy=function(t){return{$$typeof:ZE,_payload:{_status:-1,_result:t},_init:eT}};lt.memo=function(t,e){return{$$typeof:JE,type:t,compare:e===void 0?null:e}};lt.startTransition=function(t){var e=af.transition;af.transition={};try{t()}finally{af.transition=e}};lt.unstable_act=F1;lt.useCallback=function(t,e){return Vn.current.useCallback(t,e)};lt.useContext=function(t){return Vn.current.useContext(t)};lt.useDebugValue=function(){};lt.useDeferredValue=function(t){return Vn.current.useDeferredValue(t)};lt.useEffect=function(t,e){return Vn.current.useEffect(t,e)};lt.useId=function(){return Vn.current.useId()};lt.useImperativeHandle=function(t,e,n){return Vn.current.useImperativeHandle(t,e,n)};lt.useInsertionEffect=function(t,e){return Vn.current.useInsertionEffect(t,e)};lt.useLayoutEffect=function(t,e){return Vn.current.useLayoutEffect(t,e)};lt.useMemo=function(t,e){return Vn.current.useMemo(t,e)};lt.useReducer=function(t,e,n){return Vn.current.useReducer(t,e,n)};lt.useRef=function(t){return Vn.current.useRef(t)};lt.useState=function(t){return Vn.current.useState(t)};lt.useSyncExternalStore=function(t,e,n){return Vn.current.useSyncExternalStore(t,e,n)};lt.useTransition=function(){return Vn.current.useTransition()};lt.version="18.3.1";P1.exports=lt;var h=P1.exports;const ao=I1(h);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var nT=h,rT=Symbol.for("react.element"),iT=Symbol.for("react.fragment"),sT=Object.prototype.hasOwnProperty,oT=nT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,aT={key:!0,ref:!0,__self:!0,__source:!0};function U1(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)sT.call(e,r)&&!aT.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:rT,type:t,key:s,ref:o,props:i,_owner:oT.current}}nm.Fragment=iT;nm.jsx=U1;nm.jsxs=U1;z1.exports=nm;var c=z1.exports,Wg={},H1={exports:{}},yr={},V1={exports:{}},K1={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(t){function e(z,Y){var Q=z.length;z.push(Y);e:for(;0<Q;){var O=Q-1>>>1,U=z[O];if(0<i(U,Y))z[O]=Y,z[Q]=U,Q=O;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var Y=z[0],Q=z.pop();if(Q!==Y){z[0]=Q;e:for(var O=0,U=z.length,$=U>>>1;O<$;){var J=2*(O+1)-1,ie=z[J],oe=J+1,be=z[oe];if(0>i(ie,Q))oe<U&&0>i(be,ie)?(z[O]=be,z[oe]=Q,O=oe):(z[O]=ie,z[J]=Q,O=J);else if(oe<U&&0>i(be,Q))z[O]=be,z[oe]=Q,O=oe;else break e}}return Y}function i(z,Y){var Q=z.sortIndex-Y.sortIndex;return Q!==0?Q:z.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,f=null,p=3,m=!1,g=!1,y=!1,j=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(z){for(var Y=n(u);Y!==null;){if(Y.callback===null)r(u);else if(Y.startTime<=z)r(u),Y.sortIndex=Y.expirationTime,e(l,Y);else break;Y=n(u)}}function C(z){if(y=!1,N(z),!g)if(n(l)!==null)g=!0,H(w);else{var Y=n(u);Y!==null&&P(C,Y.startTime-z)}}function w(z,Y){g=!1,y&&(y=!1,x(L),L=-1),m=!0;var Q=p;try{for(N(Y),f=n(l);f!==null&&(!(f.expirationTime>Y)||z&&!ae());){var O=f.callback;if(typeof O=="function"){f.callback=null,p=f.priorityLevel;var U=O(f.expirationTime<=Y);Y=t.unstable_now(),typeof U=="function"?f.callback=U:f===n(l)&&r(l),N(Y)}else r(l);f=n(l)}if(f!==null)var $=!0;else{var J=n(u);J!==null&&P(C,J.startTime-Y),$=!1}return $}finally{f=null,p=Q,m=!1}}
vendor: 8,890 bytes, lines 25-34
25var E=!1,D=null,L=-1,V=5,te=-1;function ae(){return!(t.unstable_now()-te<V)}function ke(){if(D!==null){var z=t.unstable_now();te=z;var Y=!0;try{Y=D(!0,z)}finally{Y?ge():(E=!1,D=null)}}else E=!1}var ge;if(typeof k=="function")ge=function(){k(ke)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,me=Se.port2;Se.port1.onmessage=ke,ge=function(){me.postMessage(null)}}else ge=function(){j(ke,0)};function H(z){D=z,E||(E=!0,ge())}function P(z,Y){L=j(function(){z(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(z){z.callback=null},t.unstable_continueExecution=function(){g||m||(g=!0,H(w))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(z){switch(p){case 1:case 2:case 3:var Y=3;break;default:Y=p}var Q=p;p=Y;try{return z()}finally{p=Q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,Y){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var Q=p;p=z;try{return Y()}finally{p=Q}},t.unstable_scheduleCallback=function(z,Y,Q){var O=t.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?O+Q:O):Q=O,z){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=Q+U,z={id:d++,callback:Y,priorityLevel:z,startTime:Q,expirationTime:U,sortIndex:-1},Q>O?(z.sortIndex=Q,e(u,z),n(l)===null&&z===n(u)&&(y?(x(L),L=-1):y=!0,P(C,Q-O))):(z.sortIndex=U,e(l,z),g||m||(g=!0,H(w))),z},t.unstable_shouldYield=ae,t.unstable_wrapCallback=function(z){var Y=p;return function(){var Q=p;p=Y;try{return z.apply(this,arguments)}finally{p=Q}}}})(K1);V1.exports=K1;var lT=V1.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var cT=h,xr=lT;function ye(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var W1=new Set,lu={};function da(t,e){dl(t,e),dl(t+"Capture",e)}function dl(t,e){for(lu[t]=e,t=0;t<e.length;t++)W1.add(e[t])}var ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gg=Object.prototype.hasOwnProperty,uT=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Fy={},Uy={};function dT(t){return Gg.call(Uy,t)?!0:Gg.call(Fy,t)?!1:uT.test(t)?Uy[t]=!0:(Fy[t]=!0,!1)}function fT(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function pT(t,e,n,r){if(e===null||typeof e>"u"||fT(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Kn(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var kn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){kn[t]=new Kn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];kn[e]=new Kn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){kn[t]=new Kn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){kn[t]=new Kn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){kn[t]=new Kn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){kn[t]=new Kn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){kn[t]=new Kn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){kn[t]=new Kn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){kn[t]=new Kn(t,5,!1,t.toLowerCase(),null,!1,!1)});var Ux=/[\-:]([a-z])/g;function Hx(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Ux,Hx);kn[e]=new Kn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Ux,Hx);kn[e]=new Kn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Ux,Hx);kn[e]=new Kn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){kn[t]=new Kn(t,1,!1,t.toLowerCase(),null,!1,!1)});kn.xlinkHref=new Kn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){kn[t]=new Kn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Vx(t,e,n,r){var i=kn.hasOwnProperty(e)?kn[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(pT(e,n,i,r)&&(n=null),r||i===null?dT(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var as=cT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vd=Symbol.for("react.element"),Ba=Symbol.for("react.portal"),Fa=Symbol.for("react.fragment"),Kx=Symbol.for("react.strict_mode"),qg=Symbol.for("react.profiler"),G1=Symbol.for("react.provider"),q1=Symbol.for("react.context"),Wx=Symbol.for("react.forward_ref"),Jg=Symbol.for("react.suspense"),Zg=Symbol.for("react.suspense_list"),Gx=Symbol.for("react.memo"),Ps=Symbol.for("react.lazy"),J1=Symbol.for("react.offscreen"),Hy=Symbol.iterator;function lc(t){return t===null||typeof t!="object"?null:(t=Hy&&t[Hy]||t["@@iterator"],typeof t=="function"?t:null)}var Dt=Object.assign,dh;function wc(t){if(dh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);dh=e&&e[1]||""}return` 34`+dh+t}var fh=!1;function ph(t,e){if(!t||fh)return"";fh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}
vendor: 15,044 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(` 35`),s=r.stack.split(` 36`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=` 37`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{fh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?wc(t):""}function mT(t){switch(t.tag){case 5:return wc(t.type);case 16:return wc("Lazy");case 13:return wc("Suspense");case 19:return wc("SuspenseList");case 0:case 2:case 15:return t=ph(t.type,!1),t;case 11:return t=ph(t.type.render,!1),t;case 1:return t=ph(t.type,!0),t;default:return""}}function Yg(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Fa:return"Fragment";case Ba:return"Portal";case qg:return"Profiler";case Kx:return"StrictMode";case Jg:return"Suspense";case Zg:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case q1:return(t.displayName||"Context")+".Consumer";case G1:return(t._context.displayName||"Context")+".Provider";case Wx:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Gx:return e=t.displayName||null,e!==null?e:Yg(t.type)||"Memo";case Ps:e=t._payload,t=t._init;try{return Yg(t(e))}catch{}}return null}function hT(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Yg(e);case 8:return e===Kx?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function lo(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Z1(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function gT(t){var e=Z1(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function yd(t){t._valueTracker||(t._valueTracker=gT(t))}function Y1(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Z1(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function zf(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Qg(t,e){var n=e.checked;return Dt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Vy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=lo(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Q1(t,e){e=e.checked,e!=null&&Vx(t,"checked",e,!1)}function Xg(t,e){Q1(t,e);var n=lo(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?eb(t,e.type,n):e.hasOwnProperty("defaultValue")&&eb(t,e.type,lo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Ky(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function eb(t,e,n){(e!=="number"||zf(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Sc=Array.isArray;function rl(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+lo(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function tb(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ye(91));return Dt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Wy(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(ye(92));if(Sc(n)){if(1<n.length)throw Error(ye(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:lo(n)}}function X1(t,e){var n=lo(e.value),r=lo(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function Gy(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function ew(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function nb(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?ew(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var kd,tw=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(kd=kd||document.createElement("div"),kd.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=kd.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function cu(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var $c={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bT=["Webkit","ms","Moz","O"];Object.keys($c).forEach(function(t){bT.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),$c[e]=$c[t]})});function nw(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||$c.hasOwnProperty(t)&&$c[t]?(""+e).trim():e+"px"}function rw(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=nw(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var xT=Dt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function rb(t,e){if(e){if(xT[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ye(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ye(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ye(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ye(62))}}function ib(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var sb=null;function qx(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ob=null,il=null,sl=null;function qy(t){if(t=Hu(t)){if(typeof ob!="function")throw Error(ye(280));var e=t.stateNode;e&&(e=am(e),ob(t.stateNode,t.type,e))}}function iw(t){il?sl?sl.push(t):sl=[t]:il=t}function sw(){if(il){var t=il,e=sl;if(sl=il=null,qy(t),e)for(t=0;t<e.length;t++)qy(e[t])}}function ow(t,e){return t(e)}function aw(){}var mh=!1;function lw(t,e,n){if(mh)return t(e,n);mh=!0;try{return ow(t,e,n)}finally{mh=!1,(il!==null||sl!==null)&&(aw(),sw())}}function uu(t,e){var n=t.stateNode;if(n===null)return null;var r=am(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(ye(231,e,typeof n));return n}var ab=!1;if(ns)try{var cc={};Object.defineProperty(cc,"passive",{get:function(){ab=!0}}),window.addEventListener("test",cc,cc),window.removeEventListener("test",cc,cc)}catch{ab=!1}function vT(t,e,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var Bc=!1,Pf=null,Df=!1,lb=null,yT={onError:function(t){Bc=!0,Pf=t}};function kT(t,e,n,r,i,s,o,a,l){Bc=!1,Pf=null,vT.apply(yT,arguments)}function jT(t,e,n,r,i,s,o,a,l){if(kT.apply(this,arguments),Bc){if(Bc){var u=Pf;Bc=!1,Pf=null}else throw Error(ye(198));Df||(Df=!0,lb=u)}}function fa(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function cw(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Jy(t){if(fa(t)!==t)throw Error(ye(188))}function wT(t){var e=t.alternate;if(!e){if(e=fa(t),e===null)throw Error(ye(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Jy(i),t;if(s===r)return Jy(i),e;s=s.sibling}throw Error(ye(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(ye(189))}}if(n.alternate!==r)throw Error(ye(190))}if(n.tag!==3)throw Error(ye(188));return n.stateNode.current===n?t:e}function uw(t){return t=wT(t),t!==null?dw(t):null}function dw(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=dw(t);if(e!==null)return e;t=t.sibling}return null}var fw=xr.unstable_scheduleCallback,Zy=xr.unstable_cancelCallback,ST=xr.unstable_shouldYield,NT=xr.unstable_requestPaint,Bt=xr.unstable_now,CT=xr.unstable_getCurrentPriorityLevel,Jx=xr.unstable_ImmediatePriority,pw=xr.unstable_UserBlockingPriority,Of=xr.unstable_NormalPriority,ET=xr.unstable_LowPriority,mw=xr.unstable_IdlePriority,rm=null,Ei=null;function TT(t){if(Ei&&typeof Ei.onCommitFiberRoot=="function")try{Ei.onCommitFiberRoot(rm,t,void 0,(t.current.flags&128)===128)}catch{}}var oi=Math.clz32?Math.clz32:IT,AT=Math.log,MT=Math.LN2;function IT(t){return t>>>=0,t===0?32:31-(AT(t)/MT|0)|0}var jd=64,wd=4194304;function Nc(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function _f(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Nc(a):(s&=o,s!==0&&(r=Nc(s)))}else o=n&~i,o!==0?r=Nc(o):s!==0&&(r=Nc(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-oi(e),i=1<<n,r|=t[n],e&=~i;return r}function zT(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function PT(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-oi(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=zT(a,e)):l<=e&&(t.expiredLanes|=a),s&=~a}}function cb(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function hw(){var t=jd;return jd<<=1,!(jd&4194240)&&(jd=64),t}function hh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Fu(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-oi(e),t[e]=n}function DT(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-oi(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function Zx(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-oi(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var xt=0;function gw(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var bw,Yx,xw,vw,yw,ub=!1,Sd=[],qs=null,Js=null,Zs=null,du=new Map,fu=new Map,Rs=[],OT="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
vendor: 4,692 bytes, line 37
37function Yy(t,e){switch(t){case"focusin":case"focusout":qs=null;break;case"dragenter":case"dragleave":Js=null;break;case"mouseover":case"mouseout":Zs=null;break;case"pointerover":case"pointerout":du.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":fu.delete(e.pointerId)}}function uc(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=Hu(e),e!==null&&Yx(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function _T(t,e,n,r,i){switch(e){case"focusin":return qs=uc(qs,t,e,n,r,i),!0;case"dragenter":return Js=uc(Js,t,e,n,r,i),!0;case"mouseover":return Zs=uc(Zs,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return du.set(s,uc(du.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,fu.set(s,uc(fu.get(s)||null,t,e,n,r,i)),!0}return!1}function kw(t){var e=Oo(t.target);if(e!==null){var n=fa(e);if(n!==null){if(e=n.tag,e===13){if(e=cw(n),e!==null){t.blockedOn=e,yw(t.priority,function(){xw(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function lf(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=db(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);sb=r,n.target.dispatchEvent(r),sb=null}else return e=Hu(n),e!==null&&Yx(e),t.blockedOn=n,!1;e.shift()}return!0}function Qy(t,e,n){lf(t)&&n.delete(e)}function LT(){ub=!1,qs!==null&&lf(qs)&&(qs=null),Js!==null&&lf(Js)&&(Js=null),Zs!==null&&lf(Zs)&&(Zs=null),du.forEach(Qy),fu.forEach(Qy)}function dc(t,e){t.blockedOn===e&&(t.blockedOn=null,ub||(ub=!0,xr.unstable_scheduleCallback(xr.unstable_NormalPriority,LT)))}function pu(t){function e(i){return dc(i,t)}if(0<Sd.length){dc(Sd[0],t);for(var n=1;n<Sd.length;n++){var r=Sd[n];r.blockedOn===t&&(r.blockedOn=null)}}for(qs!==null&&dc(qs,t),Js!==null&&dc(Js,t),Zs!==null&&dc(Zs,t),du.forEach(e),fu.forEach(e),n=0;n<Rs.length;n++)r=Rs[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Rs.length&&(n=Rs[0],n.blockedOn===null);)kw(n),n.blockedOn===null&&Rs.shift()}var ol=as.ReactCurrentBatchConfig,Lf=!0;function RT(t,e,n,r){var i=xt,s=ol.transition;ol.transition=null;try{xt=1,Qx(t,e,n,r)}finally{xt=i,ol.transition=s}}function $T(t,e,n,r){var i=xt,s=ol.transition;ol.transition=null;try{xt=4,Qx(t,e,n,r)}finally{xt=i,ol.transition=s}}function Qx(t,e,n,r){if(Lf){var i=db(t,e,n,r);if(i===null)Nh(t,e,r,Rf,n),Yy(t,r);else if(_T(i,t,e,n,r))r.stopPropagation();else if(Yy(t,r),e&4&&-1<OT.indexOf(t)){for(;i!==null;){var s=Hu(i);if(s!==null&&bw(s),s=db(t,e,n,r),s===null&&Nh(t,e,r,Rf,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Nh(t,e,r,null,n)}}var Rf=null;function db(t,e,n,r){if(Rf=null,t=qx(r),t=Oo(t),t!==null)if(e=fa(t),e===null)t=null;else if(n=e.tag,n===13){if(t=cw(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Rf=t,null}function jw(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(CT()){case Jx:return 1;case pw:return 4;case Of:case ET:return 16;case mw:return 536870912;default:return 16}default:return 16}}var Us=null,Xx=null,cf=null;function ww(){if(cf)return cf;var t,e=Xx,n=e.length,r,i="value"in Us?Us.value:Us.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return cf=i.slice(t,1<r?1-r:void 0)}function uf(t){var e=t.keyCode;
vendor: 6,308 bytes, line 37
37return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Nd(){return!0}function Xy(){return!1}function kr(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Nd:Xy,this.isPropagationStopped=Xy,this}return Dt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Nd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Nd)},persist:function(){},isPersistent:Nd}),e}var Il={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ev=kr(Il),Uu=Dt({},Il,{view:0,detail:0}),BT=kr(Uu),gh,bh,fc,im=Dt({},Uu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tv,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==fc&&(fc&&t.type==="mousemove"?(gh=t.screenX-fc.screenX,bh=t.screenY-fc.screenY):bh=gh=0,fc=t),gh)},movementY:function(t){return"movementY"in t?t.movementY:bh}}),e0=kr(im),FT=Dt({},im,{dataTransfer:0}),UT=kr(FT),HT=Dt({},Uu,{relatedTarget:0}),xh=kr(HT),VT=Dt({},Il,{animationName:0,elapsedTime:0,pseudoElement:0}),KT=kr(VT),WT=Dt({},Il,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),GT=kr(WT),qT=Dt({},Il,{data:0}),t0=kr(qT),JT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},YT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=YT[t])?!!e[t]:!1}function tv(){return QT}var XT=Dt({},Uu,{key:function(t){if(t.key){var e=JT[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=uf(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?ZT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tv,charCode:function(t){return t.type==="keypress"?uf(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?uf(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),eA=kr(XT),tA=Dt({},im,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),n0=kr(tA),nA=Dt({},Uu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tv}),rA=kr(nA),iA=Dt({},Il,{propertyName:0,elapsedTime:0,pseudoElement:0}),sA=kr(iA),oA=Dt({},im,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),aA=kr(oA),lA=[9,13,27,32],nv=ns&&"CompositionEvent"in window,Fc=null;ns&&"documentMode"in document&&(Fc=document.documentMode);var cA=ns&&"TextEvent"in window&&!Fc,Sw=ns&&(!nv||Fc&&8<Fc&&11>=Fc),r0=" ",i0=!1;function Nw(t,e){switch(t){case"keyup":return lA.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ua=!1;function uA(t,e){switch(t){case"compositionend":return Cw(e);case"keypress":return e.which!==32?null:(i0=!0,r0);case"textInput":return t=e.data,t===r0&&i0?null:t;default:return null}}function dA(t,e){if(Ua)return t==="compositionend"||!nv&&Nw(t,e)?(t=ww(),cf=Xx=Us=null,Ua=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Sw&&e.locale!=="ko"?null:e.data;default:return null}}var fA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function s0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!fA[t.type]:e==="textarea"}function Ew(t,e,n,r){iw(r),e=$f(e,"onChange"),0<e.length&&(n=new ev("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Uc=null,mu=null;function pA(t){Rw(t,0)}function sm(t){var e=Ka(t);if(Y1(e))return t}function mA(t,e){if(t==="change")return e}var Tw=!1;if(ns){var vh;if(ns){var yh="oninput"in document;if(!yh){var o0=document.createElement("div");o0.setAttribute("oninput","return;"),yh=typeof o0.oninput=="function"}vh=yh}else vh=!1;Tw=vh&&(!document.documentMode||9<document.documentMode)}function a0(){Uc&&(Uc.detachEvent("onpropertychange",Aw),mu=Uc=null)}function Aw(t){if(t.propertyName==="value"&&sm(mu)){var e=[];Ew(e,mu,t,qx(t)),lw(pA,e)}}function hA(t,e,n){t==="focusin"?(a0(),Uc=e,mu=n,Uc.attachEvent("onpropertychange",Aw)):t==="focusout"&&a0()}function gA(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return sm(mu)}function bA(t,e){if(t==="click")return sm(e)}function xA(t,e){if(t==="input"||t==="change")return sm(e)}function vA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ci=typeof Object.is=="function"?Object.is:vA;function hu(t,e){if(ci(t,e))return!0;
vendor: 4,808 bytes, line 37
37if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Gg.call(e,i)||!ci(t[i],e[i]))return!1}return!0}function l0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function c0(t,e){var n=l0(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=l0(n)}}function Mw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Mw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Iw(){for(var t=window,e=zf();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=zf(t.document)}return e}function rv(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function yA(t){var e=Iw(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Mw(n.ownerDocument.documentElement,n)){if(r!==null&&rv(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=c0(n,s);var o=c0(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var kA=ns&&"documentMode"in document&&11>=document.documentMode,Ha=null,fb=null,Hc=null,pb=!1;function u0(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;pb||Ha==null||Ha!==zf(r)||(r=Ha,"selectionStart"in r&&rv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hc&&hu(Hc,r)||(Hc=r,r=$f(fb,"onSelect"),0<r.length&&(e=new ev("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Ha)))}function Cd(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Va={animationend:Cd("Animation","AnimationEnd"),animationiteration:Cd("Animation","AnimationIteration"),animationstart:Cd("Animation","AnimationStart"),transitionend:Cd("Transition","TransitionEnd")},kh={},zw={};ns&&(zw=document.createElement("div").style,"AnimationEvent"in window||(delete Va.animationend.animation,delete Va.animationiteration.animation,delete Va.animationstart.animation),"TransitionEvent"in window||delete Va.transitionend.transition);function om(t){if(kh[t])return kh[t];if(!Va[t])return t;var e=Va[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in zw)return kh[t]=e[n];return t}var Pw=om("animationend"),Dw=om("animationiteration"),Ow=om("animationstart"),_w=om("transitionend"),Lw=new Map,d0="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function po(t,e){Lw.set(t,e),da(e,[t])}for(var jh=0;jh<d0.length;jh++){var wh=d0[jh],jA=wh.toLowerCase(),wA=wh[0].toUpperCase()+wh.slice(1);po(jA,"on"+wA)}po(Pw,"onAnimationEnd");po(Dw,"onAnimationIteration");po(Ow,"onAnimationStart");po("dblclick","onDoubleClick");po("focusin","onFocus");po("focusout","onBlur");po(_w,"onTransitionEnd");dl("onMouseEnter",["mouseout","mouseover"]);dl("onMouseLeave",["mouseout","mouseover"]);dl("onPointerEnter",["pointerout","pointerover"]);dl("onPointerLeave",["pointerout","pointerover"]);da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,770 bytes, line 37
37da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));da("onBeforeInput",["compositionend","keypress","textInput","paste"]);da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),SA=new Set("cancel close invalid load scroll toggle".split(" ").concat(Cc));function f0(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,jT(r,e,void 0,t),t.currentTarget=null}function Rw(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;f0(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;f0(i,a,u),s=l}}}if(Df)throw t=lb,Df=!1,lb=null,t}function Ct(t,e){var n=e[xb];n===void 0&&(n=e[xb]=new Set);var r=t+"__bubble";n.has(r)||($w(e,t,2,!1),n.add(r))}function Sh(t,e,n){var r=0;e&&(r|=4),$w(n,t,r,e)}var Ed="_reactListening"+Math.random().toString(36).slice(2);function gu(t){if(!t[Ed]){t[Ed]=!0,W1.forEach(function(n){n!=="selectionchange"&&(SA.has(n)||Sh(n,!1,t),Sh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Ed]||(e[Ed]=!0,Sh("selectionchange",!1,e))}}function $w(t,e,n,r){switch(jw(e)){case 1:var i=RT;break;case 4:i=$T;break;default:i=Qx}n=i.bind(null,e,n,t),i=void 0,!ab||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Nh(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Oo(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}lw(function(){var u=s,d=qx(n),f=[];e:{var p=Lw.get(t);if(p!==void 0){var m=ev,g=t;switch(t){case"keypress":if(uf(n)===0)break e;case"keydown":case"keyup":m=eA;break;case"focusin":g="focus",m=xh;break;case"focusout":g="blur",m=xh;break;case"beforeblur":case"afterblur":m=xh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=e0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=UT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=rA;break;case Pw:case Dw:case Ow:m=KT;break;case _w:m=sA;break;case"scroll":m=BT;break;case"wheel":m=aA;break;case"copy":case"cut":case"paste":m=GT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=n0}var y=(e&4)!==0,j=!y&&t==="scroll",x=y?p!==null?p+"Capture":null:p;y=[];for(var k=u,N;k!==null;){N=k;var C=N.stateNode;if(N.tag===5&&C!==null&&(N=C,x!==null&&(C=uu(k,x),C!=null&&y.push(bu(k,C,N)))),j)break;k=k.return}0<y.length&&(p=new m(p,g,null,n,d),f.push({event:p,listeners:y}))}}if(!(e&7)){e:{if(p=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",p&&n!==sb&&(g=n.relatedTarget||n.fromElement)&&(Oo(g)||g[rs]))break e;if((m||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Oo(g):null,g!==null&&(j=fa(g),g!==j||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(y=e0,C="onMouseLeave",x="onMouseEnter",k="mouse",(t==="pointerout"||t==="pointerover")&&(y=n0,C="onPointerLeave",x="onPointerEnter",k="pointer"),j=m==null?p:Ka(m),N=g==null?p:Ka(g),p=new y(C,k+"leave",m,n,d),p.target=j,p.relatedTarget=N,C=null,Oo(d)===u&&(y=new y(x,k+"enter",g,n,d),y.target=N,y.relatedTarget=j,C=y),j=C,m&&g)t:{for(y=m,x=g,k=0,N=y;N;N=Aa(N))k++;for(N=0,C=x;C;C=Aa(C))N++;for(;0<k-N;)y=Aa(y),k--;for(;0<N-k;)x=Aa(x),N--;for(;k--;){if(y===x||x!==null&&y===x.alternate)break t;y=Aa(y),x=Aa(x)}y=null}else y=null;m!==null&&p0(f,p,m,y,!1),g!==null&&j!==null&&p0(f,j,g,y,!0)}}
vendor: 6,005 bytes, lines 37-38
37e:{if(p=u?Ka(u):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var w=mA;else if(s0(p))if(Tw)w=xA;else{w=gA;var E=hA}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=bA);if(w&&(w=w(t,u))){Ew(f,w,n,d);break e}E&&E(t,p,u),t==="focusout"&&(E=p._wrapperState)&&E.controlled&&p.type==="number"&&eb(p,"number",p.value)}switch(E=u?Ka(u):window,t){case"focusin":(s0(E)||E.contentEditable==="true")&&(Ha=E,fb=u,Hc=null);break;case"focusout":Hc=fb=Ha=null;break;case"mousedown":pb=!0;break;case"contextmenu":case"mouseup":case"dragend":pb=!1,u0(f,n,d);break;case"selectionchange":if(kA)break;case"keydown":case"keyup":u0(f,n,d)}var D;if(nv)e:{switch(t){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Ua?Nw(t,n)&&(L="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(Sw&&n.locale!=="ko"&&(Ua||L!=="onCompositionStart"?L==="onCompositionEnd"&&Ua&&(D=ww()):(Us=d,Xx="value"in Us?Us.value:Us.textContent,Ua=!0)),E=$f(u,L),0<E.length&&(L=new t0(L,t,null,n,d),f.push({event:L,listeners:E}),D?L.data=D:(D=Cw(n),D!==null&&(L.data=D)))),(D=cA?uA(t,n):dA(t,n))&&(u=$f(u,"onBeforeInput"),0<u.length&&(d=new t0("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=D))}Rw(f,e)})}function bu(t,e,n){return{instance:t,listener:e,currentTarget:n}}function $f(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=uu(t,n),s!=null&&r.unshift(bu(t,s,i)),s=uu(t,e),s!=null&&r.push(bu(t,s,i))),t=t.return}return r}function Aa(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function p0(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=uu(n,s),l!=null&&o.unshift(bu(n,l,a))):i||(l=uu(n,s),l!=null&&o.push(bu(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var NA=/\r\n?/g,CA=/\u0000|\uFFFD/g;function m0(t){return(typeof t=="string"?t:""+t).replace(NA,` 38`).replace(CA,"")}function Td(t,e,n){if(e=m0(e),m0(t)!==e&&n)throw Error(ye(425))}function Bf(){}var mb=null,hb=null;function gb(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var bb=typeof setTimeout=="function"?setTimeout:void 0,EA=typeof clearTimeout=="function"?clearTimeout:void 0,h0=typeof Promise=="function"?Promise:void 0,TA=typeof queueMicrotask=="function"?queueMicrotask:typeof h0<"u"?function(t){return h0.resolve(null).then(t).catch(AA)}:bb;function AA(t){setTimeout(function(){throw t})}function Ch(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),pu(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);pu(e)}function Ys(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function g0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var zl=Math.random().toString(36).slice(2),Ni="__reactFiber$"+zl,xu="__reactProps$"+zl,rs="__reactContainer$"+zl,xb="__reactEvents$"+zl,MA="__reactListeners$"+zl,IA="__reactHandles$"+zl;function Oo(t){var e=t[Ni];if(e)return e;for(var n=t.parentNode;n;){if(e=n[rs]||n[Ni]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=g0(t);t!==null;){if(n=t[Ni])return n;t=g0(t)}return e}t=n,n=t.parentNode}return null}function Hu(t){return t=t[Ni]||t[rs],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ka(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(ye(33))}function am(t){return t[xu]||null}var vb=[],Wa=-1;function mo(t){return{current:t}}function Tt(t){0>Wa||(t.current=vb[Wa],vb[Wa]=null,Wa--)}function wt(t,e){Wa++,vb[Wa]=t.current,t.current=e}var co={},zn=mo(co),nr=mo(!1),ea=co;function fl(t,e){var n=t.type.contextTypes;if(!n)return co;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function rr(t){return t=t.childContextTypes,t!=null}function Ff(){Tt(nr),Tt(zn)}function b0(t,e,n){if(zn.current!==co)throw Error(ye(168));wt(zn,e),wt(nr,n)}function Bw(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(ye(108,hT(t)||"Unknown",i));return Dt({},n,r)}function Uf(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||co,ea=zn.current,wt(zn,t),wt(nr,nr.current),!0}function x0(t,e,n){var r=t.stateNode;if(!r)throw Error(ye(169));n?(t=Bw(t,e,ea),r.__reactInternalMemoizedMergedChildContext=t,Tt(nr),Tt(zn),wt(zn,t)):Tt(nr),wt(nr,n)}var qi=null,lm=!1,Eh=!1;function Fw(t){qi===null?qi=[t]:qi.push(t)}function zA(t){lm=!0,Fw(t)}function ho(){if(!Eh&&qi!==null){Eh=!0;var t=0,e=xt;try{var n=qi;for(xt=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}qi=null,lm=!1}catch(i){throw qi!==null&&(qi=qi.slice(t+1)),fw(Jx,ho),i}finally{xt=e,Eh=!1}}return null}var Ga=[],qa=0,Hf=null,Vf=0,zr=[],Pr=0,ta=null,Ji=1,Zi="";function zo(t,e){Ga[qa++]=Vf,Ga[qa++]=Hf,Hf=t,Vf=e}function Uw(t,e,n){zr[Pr++]=Ji,zr[Pr++]=Zi,zr[Pr++]=ta,ta=t;var r=Ji;t=Zi;var i=32-oi(r)-1;r&=~(1<<i),n+=1;var s=32-oi(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ji=1<<32-oi(e)+i|n<<i|r,Zi=s+t}else Ji=1<<s|n<<i|r,Zi=t}function iv(t){t.return!==null&&(zo(t,1),Uw(t,1,0))}function sv(t){for(;t===Hf;
vendor: 16,611 bytes, line 38
38)Hf=Ga[--qa],Ga[qa]=null,Vf=Ga[--qa],Ga[qa]=null;for(;t===ta;)ta=zr[--Pr],zr[Pr]=null,Zi=zr[--Pr],zr[Pr]=null,Ji=zr[--Pr],zr[Pr]=null}var gr=null,hr=null,At=!1,ni=null;function Hw(t,e){var n=_r(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function v0(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,gr=t,hr=Ys(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,gr=t,hr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=ta!==null?{id:Ji,overflow:Zi}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=_r(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,gr=t,hr=null,!0):!1;default:return!1}}function yb(t){return(t.mode&1)!==0&&(t.flags&128)===0}function kb(t){if(At){var e=hr;if(e){var n=e;if(!v0(t,e)){if(yb(t))throw Error(ye(418));e=Ys(n.nextSibling);var r=gr;e&&v0(t,e)?Hw(r,n):(t.flags=t.flags&-4097|2,At=!1,gr=t)}}else{if(yb(t))throw Error(ye(418));t.flags=t.flags&-4097|2,At=!1,gr=t}}}function y0(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;gr=t}function Ad(t){if(t!==gr)return!1;if(!At)return y0(t),At=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!gb(t.type,t.memoizedProps)),e&&(e=hr)){if(yb(t))throw Vw(),Error(ye(418));for(;e;)Hw(t,e),e=Ys(e.nextSibling)}if(y0(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(ye(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){hr=Ys(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}hr=null}}else hr=gr?Ys(t.stateNode.nextSibling):null;return!0}function Vw(){for(var t=hr;t;)t=Ys(t.nextSibling)}function pl(){hr=gr=null,At=!1}function ov(t){ni===null?ni=[t]:ni.push(t)}var PA=as.ReactCurrentBatchConfig;function pc(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ye(309));var r=n.stateNode}if(!r)throw Error(ye(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(ye(284));if(!n._owner)throw Error(ye(290,t))}return t}function Md(t,e){throw t=Object.prototype.toString.call(e),Error(ye(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function k0(t){var e=t._init;return e(t._payload)}function Kw(t){function e(x,k){if(t){var N=x.deletions;N===null?(x.deletions=[k],x.flags|=16):N.push(k)}}function n(x,k){if(!t)return null;for(;k!==null;)e(x,k),k=k.sibling;return null}function r(x,k){for(x=new Map;k!==null;)k.key!==null?x.set(k.key,k):x.set(k.index,k),k=k.sibling;return x}function i(x,k){return x=to(x,k),x.index=0,x.sibling=null,x}function s(x,k,N){return x.index=N,t?(N=x.alternate,N!==null?(N=N.index,N<k?(x.flags|=2,k):N):(x.flags|=2,k)):(x.flags|=1048576,k)}function o(x){return t&&x.alternate===null&&(x.flags|=2),x}function a(x,k,N,C){return k===null||k.tag!==6?(k=Dh(N,x.mode,C),k.return=x,k):(k=i(k,N),k.return=x,k)}function l(x,k,N,C){var w=N.type;return w===Fa?d(x,k,N.props.children,C,N.key):k!==null&&(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ps&&k0(w)===k.type)?(C=i(k,N.props),C.ref=pc(x,k,N),C.return=x,C):(C=bf(N.type,N.key,N.props,null,x.mode,C),C.ref=pc(x,k,N),C.return=x,C)}function u(x,k,N,C){return k===null||k.tag!==4||k.stateNode.containerInfo!==N.containerInfo||k.stateNode.implementation!==N.implementation?(k=Oh(N,x.mode,C),k.return=x,k):(k=i(k,N.children||[]),k.return=x,k)}function d(x,k,N,C,w){return k===null||k.tag!==7?(k=Wo(N,x.mode,C,w),k.return=x,k):(k=i(k,N),k.return=x,k)}function f(x,k,N){if(typeof k=="string"&&k!==""||typeof k=="number")return k=Dh(""+k,x.mode,N),k.return=x,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case vd:return N=bf(k.type,k.key,k.props,null,x.mode,N),N.ref=pc(x,null,k),N.return=x,N;case Ba:return k=Oh(k,x.mode,N),k.return=x,k;case Ps:var C=k._init;return f(x,C(k._payload),N)}if(Sc(k)||lc(k))return k=Wo(k,x.mode,N,null),k.return=x,k;Md(x,k)}return null}function p(x,k,N,C){var w=k!==null?k.key:null;if(typeof N=="string"&&N!==""||typeof N=="number")return w!==null?null:a(x,k,""+N,C);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case vd:return N.key===w?l(x,k,N,C):null;case Ba:return N.key===w?u(x,k,N,C):null;case Ps:return w=N._init,p(x,k,w(N._payload),C)}if(Sc(N)||lc(N))return w!==null?null:d(x,k,N,C,null);Md(x,N)}return null}function m(x,k,N,C,w){if(typeof C=="string"&&C!==""||typeof C=="number")return x=x.get(N)||null,a(k,x,""+C,w);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case vd:return x=x.get(C.key===null?N:C.key)||null,l(k,x,C,w);case Ba:return x=x.get(C.key===null?N:C.key)||null,u(k,x,C,w);case Ps:var E=C._init;return m(x,k,N,E(C._payload),w)}if(Sc(C)||lc(C))return x=x.get(N)||null,d(k,x,C,w,null);Md(k,C)}return null}function g(x,k,N,C){for(var w=null,E=null,D=k,L=k=0,V=null;D!==null&&L<N.length;L++){D.index>L?(V=D,D=null):V=D.sibling;var te=p(x,D,N[L],C);if(te===null){D===null&&(D=V);break}t&&D&&te.alternate===null&&e(x,D),k=s(te,k,L),E===null?w=te:E.sibling=te,E=te,D=V}if(L===N.length)return n(x,D),At&&zo(x,L),w;if(D===null){for(;L<N.length;L++)D=f(x,N[L],C),D!==null&&(k=s(D,k,L),E===null?w=D:E.sibling=D,E=D);return At&&zo(x,L),w}for(D=r(x,D);L<N.length;L++)V=m(D,x,L,N[L],C),V!==null&&(t&&V.alternate!==null&&D.delete(V.key===null?L:V.key),k=s(V,k,L),E===null?w=V:E.sibling=V,E=V);return t&&D.forEach(function(ae){return e(x,ae)}),At&&zo(x,L),w}function y(x,k,N,C){var w=lc(N);if(typeof w!="function")throw Error(ye(150));if(N=w.call(N),N==null)throw Error(ye(151));for(var E=w=null,D=k,L=k=0,V=null,te=N.next();D!==null&&!te.done;L++,te=N.next()){D.index>L?(V=D,D=null):V=D.sibling;var ae=p(x,D,te.value,C);if(ae===null){D===null&&(D=V);break}t&&D&&ae.alternate===null&&e(x,D),k=s(ae,k,L),E===null?w=ae:E.sibling=ae,E=ae,D=V}if(te.done)return n(x,D),At&&zo(x,L),w;if(D===null){for(;!te.done;L++,te=N.next())te=f(x,te.value,C),te!==null&&(k=s(te,k,L),E===null?w=te:E.sibling=te,E=te);return At&&zo(x,L),w}for(D=r(x,D);!te.done;L++,te=N.next())te=m(D,x,L,te.value,C),te!==null&&(t&&te.alternate!==null&&D.delete(te.key===null?L:te.key),k=s(te,k,L),E===null?w=te:E.sibling=te,E=te);return t&&D.forEach(function(ke){return e(x,ke)}),At&&zo(x,L),w}function j(x,k,N,C){if(typeof N=="object"&&N!==null&&N.type===Fa&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case vd:e:{for(var w=N.key,E=k;E!==null;){if(E.key===w){if(w=N.type,w===Fa){if(E.tag===7){n(x,E.sibling),k=i(E,N.props.children),k.return=x,x=k;break e}}else if(E.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ps&&k0(w)===E.type){n(x,E.sibling),k=i(E,N.props),k.ref=pc(x,E,N),k.return=x,x=k;break e}n(x,E);break}else e(x,E);E=E.sibling}N.type===Fa?(k=Wo(N.props.children,x.mode,C,N.key),k.return=x,x=k):(C=bf(N.type,N.key,N.props,null,x.mode,C),C.ref=pc(x,k,N),C.return=x,x=C)}return o(x);case Ba:e:{for(E=N.key;k!==null;){if(k.key===E)if(k.tag===4&&k.stateNode.containerInfo===N.containerInfo&&k.stateNode.implementation===N.implementation){n(x,k.sibling),k=i(k,N.children||[]),k.return=x,x=k;break e}else{n(x,k);break}else e(x,k);k=k.sibling}k=Oh(N,x.mode,C),k.return=x,x=k}return o(x);case Ps:return E=N._init,j(x,k,E(N._payload),C)}if(Sc(N))return g(x,k,N,C);if(lc(N))return y(x,k,N,C);Md(x,N)}return typeof N=="string"&&N!==""||typeof N=="number"?(N=""+N,k!==null&&k.tag===6?(n(x,k.sibling),k=i(k,N),k.return=x,x=k):(n(x,k),k=Dh(N,x.mode,C),k.return=x,x=k),o(x)):n(x,k)}return j}var ml=Kw(!0),Ww=Kw(!1),Kf=mo(null),Wf=null,Ja=null,av=null;function lv(){av=Ja=Wf=null}function cv(t){var e=Kf.current;Tt(Kf),t._currentValue=e}function jb(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function al(t,e){Wf=t,av=Ja=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(tr=!0),t.firstContext=null)}function Fr(t){var e=t._currentValue;if(av!==t)if(t={context:t,memoizedValue:e,next:null},Ja===null){if(Wf===null)throw Error(ye(308));Ja=t,Wf.dependencies={lanes:0,firstContext:t}}else Ja=Ja.next=t;return e}var _o=null;function uv(t){_o===null?_o=[t]:_o.push(t)}function Gw(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,uv(e)):(n.next=i.next,i.next=n),e.interleaved=n,is(t,r)}function is(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Ds=!1;function dv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qw(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Qi(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Qs(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ft&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,is(t,n)}return i=r.interleaved,i===null?(e.next=e,uv(r)):(e.next=i.next,i.next=e),r.interleaved=e,is(t,n)}function df(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Zx(t,n)}}function j0(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Gf(t,e,n,r){var i=t.updateQueue;Ds=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,d=u=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=t,y=a;switch(p=e,m=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(m,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,p=typeof g=="function"?g.call(m,f,p):g,p==null)break e;f=Dt({},f,p);break e;case 2:Ds=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=m,l=f):d=d.next=m,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);ra|=o,t.lanes=o,t.memoizedState=f}}function w0(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ye(191,i));i.call(r)}}}var Vu={},Ti=mo(Vu),vu=mo(Vu),yu=mo(Vu);function Lo(t){if(t===Vu)throw Error(ye(174));return t}function fv(t,e){switch(wt(yu,e),wt(vu,t),wt(Ti,Vu),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:nb(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=nb(e,t)}Tt(Ti),wt(Ti,e)}function hl(){Tt(Ti),Tt(vu),Tt(yu)}function Jw(t){Lo(yu.current);var e=Lo(Ti.current),n=nb(e,t.type);e!==n&&(wt(vu,t),wt(Ti,n))}function pv(t){vu.current===t&&(Tt(Ti),Tt(vu))}var It=mo(0);function qf(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Th=[];function mv(){for(var t=0;t<Th.length;t++)Th[t]._workInProgressVersionPrimary=null;Th.length=0}var ff=as.ReactCurrentDispatcher,Ah=as.ReactCurrentBatchConfig,na=0,Pt=null,Zt=null,an=null,Jf=!1,Vc=!1,ku=0,DA=0;function Cn(){throw Error(ye(321))}function hv(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ci(t[n],e[n]))return!1;return!0}function gv(t,e,n,r,i,s){if(na=s,Pt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ff.current=t===null||t.memoizedState===null?RA:$A,t=n(r,i),Vc){s=0;do{if(Vc=!1,ku=0,25<=s)throw Error(ye(301));s+=1,an=Zt=null,e.updateQueue=null,ff.current=BA,t=n(r,i)}while(Vc)}if(ff.current=Zf,e=Zt!==null&&Zt.next!==null,na=0,an=Zt=Pt=null,Jf=!1,e)throw Error(ye(300));return t}function bv(){var t=ku!==0;return ku=0,t}function ki(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return an===null?Pt.memoizedState=an=t:an=an.next=t,an}function Ur(){if(Zt===null){var t=Pt.alternate;t=t!==null?t.memoizedState:null}else t=Zt.next;var e=an===null?Pt.memoizedState:an.next;if(e!==null)an=e,Zt=t;else{if(t===null)throw Error(ye(310));Zt=t,t={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},an===null?Pt.memoizedState=an=t:an=an.next=t}return an}function ju(t,e){return typeof e=="function"?e(t):e}function Mh(t){var e=Ur(),n=e.queue;if(n===null)throw Error(ye(311));n.lastRenderedReducer=t;var r=Zt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var d=u.lane;if((na&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,Pt.lanes|=d,ra|=d}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,ci(r,e.memoizedState)||(tr=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,Pt.lanes|=s,ra|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Ih(t){var e=Ur(),n=e.queue;if(n===null)throw Error(ye(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);ci(s,e.memoizedState)||(tr=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function Zw(){}function Yw(t,e){var n=Pt,r=Ur(),i=e(),s=!ci(r.memoizedState,i);if(s&&(r.memoizedState=i,tr=!0),r=r.queue,xv(eS.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||an!==null&&an.memoizedState.tag&1){if(n.flags|=2048,wu(9,Xw.bind(null,n,r,i,e),void 0,null),cn===null)throw Error(ye(349));na&30||Qw(n,e,i)}return i}function Qw(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Pt.updateQueue,e===null?(e={lastEffect:null,stores:null},Pt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Xw(t,e,n,r){e.value=n,e.getSnapshot=r,tS(e)&&nS(t)}function eS(t,e,n){return n(function(){tS(e)&&nS(t)})}function tS(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ci(t,n)}catch{return!0}}function nS(t){var e=is(t,1);e!==null&&ai(e,t,1,-1)}function S0(t){var e=ki();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ju,lastRenderedState:t},e.queue=t,t=t.dispatch=LA.bind(null,Pt,t),[e.memoizedState,t]}function wu(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Pt.updateQueue,e===null?(e={lastEffect:null,stores:null},Pt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}
vendor: 4,254 bytes, line 38
38function rS(){return Ur().memoizedState}function pf(t,e,n,r){var i=ki();Pt.flags|=t,i.memoizedState=wu(1|e,n,void 0,r===void 0?null:r)}function cm(t,e,n,r){var i=Ur();r=r===void 0?null:r;var s=void 0;if(Zt!==null){var o=Zt.memoizedState;if(s=o.destroy,r!==null&&hv(r,o.deps)){i.memoizedState=wu(e,n,s,r);return}}Pt.flags|=t,i.memoizedState=wu(1|e,n,s,r)}function N0(t,e){return pf(8390656,8,t,e)}function xv(t,e){return cm(2048,8,t,e)}function iS(t,e){return cm(4,2,t,e)}function sS(t,e){return cm(4,4,t,e)}function oS(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function aS(t,e,n){return n=n!=null?n.concat([t]):null,cm(4,4,oS.bind(null,e,t),n)}function vv(){}function lS(t,e){var n=Ur();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&hv(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function cS(t,e){var n=Ur();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&hv(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function uS(t,e,n){return na&21?(ci(n,e)||(n=hw(),Pt.lanes|=n,ra|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,tr=!0),t.memoizedState=n)}function OA(t,e){var n=xt;xt=n!==0&&4>n?n:4,t(!0);var r=Ah.transition;Ah.transition={};try{t(!1),e()}finally{xt=n,Ah.transition=r}}function dS(){return Ur().memoizedState}function _A(t,e,n){var r=eo(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fS(t))pS(e,n);else if(n=Gw(t,e,n,r),n!==null){var i=Bn();ai(n,t,r,i),mS(n,e,r)}}function LA(t,e,n){var r=eo(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fS(t))pS(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,ci(a,o)){var l=e.interleaved;l===null?(i.next=i,uv(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Gw(t,e,i,r),n!==null&&(i=Bn(),ai(n,t,r,i),mS(n,e,r))}}function fS(t){var e=t.alternate;return t===Pt||e!==null&&e===Pt}function pS(t,e){Vc=Jf=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function mS(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Zx(t,n)}}var Zf={readContext:Fr,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},RA={readContext:Fr,useCallback:function(t,e){return ki().memoizedState=[t,e===void 0?null:e],t},useContext:Fr,useEffect:N0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,pf(4194308,4,oS.bind(null,e,t),n)},useLayoutEffect:function(t,e){return pf(4194308,4,t,e)},useInsertionEffect:function(t,e){return pf(4,2,t,e)},useMemo:function(t,e){var n=ki();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ki();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=_A.bind(null,Pt,t),[r.memoizedState,t]},useRef:function(t){var e=ki();return t={current:t},e.memoizedState=t},useState:S0,useDebugValue:vv,useDeferredValue:function(t){return ki().memoizedState=t},useTransition:function(){var t=S0(!1),e=t[0];return t=OA.bind(null,t[1]),ki().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Pt,i=ki();if(At){if(n===void 0)throw Error(ye(407));n=n()}else{if(n=e(),cn===null)throw Error(ye(349));na&30||Qw(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,N0(eS.bind(null,r,s,t),[t]),r.flags|=2048,wu(9,Xw.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=ki(),e=cn.identifierPrefix;if(At){var n=Zi,r=Ji;n=(r&~(1<<32-oi(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=ku++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=DA++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},$A={readContext:Fr,useCallback:lS,useContext:Fr,useEffect:xv,useImperativeHandle:aS,useInsertionEffect:iS,useLayoutEffect:sS,useMemo:cS,useReducer:Mh,useRef
vendor: 5,438 bytes, lines 38-40
38:rS,useState:function(){return Mh(ju)},useDebugValue:vv,useDeferredValue:function(t){var e=Ur();return uS(e,Zt.memoizedState,t)},useTransition:function(){var t=Mh(ju)[0],e=Ur().memoizedState;return[t,e]},useMutableSource:Zw,useSyncExternalStore:Yw,useId:dS,unstable_isNewReconciler:!1},BA={readContext:Fr,useCallback:lS,useContext:Fr,useEffect:xv,useImperativeHandle:aS,useInsertionEffect:iS,useLayoutEffect:sS,useMemo:cS,useReducer:Ih,useRef:rS,useState:function(){return Ih(ju)},useDebugValue:vv,useDeferredValue:function(t){var e=Ur();return Zt===null?e.memoizedState=t:uS(e,Zt.memoizedState,t)},useTransition:function(){var t=Ih(ju)[0],e=Ur().memoizedState;return[t,e]},useMutableSource:Zw,useSyncExternalStore:Yw,useId:dS,unstable_isNewReconciler:!1};function Xr(t,e){if(t&&t.defaultProps){e=Dt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function wb(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Dt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var um={isMounted:function(t){return(t=t._reactInternals)?fa(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Bn(),i=eo(t),s=Qi(r,i);s.payload=e,n!=null&&(s.callback=n),e=Qs(t,s,i),e!==null&&(ai(e,t,i,r),df(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Bn(),i=eo(t),s=Qi(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Qs(t,s,i),e!==null&&(ai(e,t,i,r),df(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Bn(),r=eo(t),i=Qi(n,r);i.tag=2,e!=null&&(i.callback=e),e=Qs(t,i,r),e!==null&&(ai(e,t,r,n),df(e,t,r))}};function C0(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!hu(n,r)||!hu(i,s):!0}function hS(t,e,n){var r=!1,i=co,s=e.contextType;return typeof s=="object"&&s!==null?s=Fr(s):(i=rr(e)?ea:zn.current,r=e.contextTypes,s=(r=r!=null)?fl(t,i):co),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=um,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function E0(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&um.enqueueReplaceState(e,e.state,null)}function Sb(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},dv(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Fr(s):(s=rr(e)?ea:zn.current,i.context=fl(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(wb(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&um.enqueueReplaceState(i,i.state,null),Gf(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function gl(t,e){try{var n="",r=e;do n+=mT(r),r=r.return;while(r);var i=n}catch(s){i=` 39Error generating stack: `+s.message+` 40`+s.stack}return{value:t,source:e,stack:i,digest:null}}function zh(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Nb(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var FA=typeof WeakMap=="function"?WeakMap:Map;function gS(t,e,n){n=Qi(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Qf||(Qf=!0,Ob=r),Nb(t,e)},n}function bS(t,e,n){n=Qi(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Nb(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Nb(t,e),typeof r!="function"&&(Xs===null?Xs=new Set([this]):Xs.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function T0(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new FA;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=tM.bind(null,t,e,n),e.then(t,t))}function A0(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function M0(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Qi(-1,1),e.tag=2,Qs(n,e,1))),n.lanes|=1),t)}var UA=as.ReactCurrentOwner,tr=!1;function Rn(t,e,n,r){e.child=t===null?Ww(e,null,n,r):ml(e,t.child,n,r)}function I0(t,e,n,r,i){n=n.render;var s=e.ref;return al(e,i),r=gv(t,e,n,r,s,i),n=bv(),t!==null&&!tr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ss(t,e,i)):(At&&n&&iv(e),e.flags|=1,Rn(t,e,r,i),e.child)}function z0(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!Ev(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,xS(t,e,s,r,i)):(t=bf(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:hu,n(o,r)&&t.ref===e.ref)return ss(t,e,
vendor: 6,217 bytes, line 40
40i)}return e.flags|=1,t=to(s,r),t.ref=e.ref,t.return=e,e.child=t}function xS(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(hu(s,r)&&t.ref===e.ref)if(tr=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(tr=!0);else return e.lanes=t.lanes,ss(t,e,i)}return Cb(t,e,n,r,i)}function vS(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(Ya,fr),fr|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,wt(Ya,fr),fr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,wt(Ya,fr),fr|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,wt(Ya,fr),fr|=r;return Rn(t,e,i,n),e.child}function yS(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Cb(t,e,n,r,i){var s=rr(n)?ea:zn.current;return s=fl(e,s),al(e,i),n=gv(t,e,n,r,s,i),r=bv(),t!==null&&!tr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ss(t,e,i)):(At&&r&&iv(e),e.flags|=1,Rn(t,e,n,i),e.child)}function P0(t,e,n,r,i){if(rr(n)){var s=!0;Uf(e)}else s=!1;if(al(e,i),e.stateNode===null)mf(t,e),hS(e,n,r),Sb(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Fr(u):(u=rr(n)?ea:zn.current,u=fl(e,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&E0(e,o,r,u),Ds=!1;var p=e.memoizedState;o.state=p,Gf(e,r,o,i),l=e.memoizedState,a!==r||p!==l||nr.current||Ds?(typeof d=="function"&&(wb(e,n,d,r),l=e.memoizedState),(a=Ds||C0(e,n,a,r,p,l,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,qw(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Xr(e.type,a),o.props=u,f=e.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Fr(l):(l=rr(n)?ea:zn.current,l=fl(e,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||p!==l)&&E0(e,o,r,l),Ds=!1,p=e.memoizedState,o.state=p,Gf(e,r,o,i);var g=e.memoizedState;a!==f||p!==g||nr.current||Ds?(typeof m=="function"&&(wb(e,n,m,r),g=e.memoizedState),(u=Ds||C0(e,n,u,r,p,g,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),o.props=r,o.state=g,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return Eb(t,e,n,r,s,i)}function Eb(t,e,n,r,i,s){yS(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&x0(e,n,!1),ss(t,e,s);r=e.stateNode,UA.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=ml(e,t.child,null,s),e.child=ml(e,null,a,s)):Rn(t,e,a,s),e.memoizedState=r.state,i&&x0(e,n,!0),e.child}function kS(t){var e=t.stateNode;e.pendingContext?b0(t,e.pendingContext,e.pendingContext!==e.context):e.context&&b0(t,e.context,!1),fv(t,e.containerInfo)}function D0(t,e,n,r,i){return pl(),ov(i),e.flags|=256,Rn(t,e,n,r),e.child}var Tb={dehydrated:null,treeContext:null,retryLane:0};function Ab(t){return{baseLanes:t,cachePool:null,transitions:null}}function jS(t,e,n){var r=e.pendingProps,i=It.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),wt(It,i&1),t===null)return kb(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=pm(o,r,0,null),t=Wo(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Ab(n),e.memoizedState=Tb,t):yv(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return HA(t,e,o,r,a,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=to(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=to(a,s):(s=Wo(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?Ab(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=Tb,r}return s=t.child,t=s.sibling,r=to(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function yv(t,e){return e=pm({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Id(t,e,n,r){return r!==null&&ov(r),ml(e,t.child,null,n),t=yv(e,e.pen
vendor: 4,919 bytes, line 40
40dingProps.children),t.flags|=2,e.memoizedState=null,t}function HA(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=zh(Error(ye(422))),Id(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=pm({mode:"visible",children:r.children},i,0,null),s=Wo(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&ml(e,t.child,null,o),e.child.memoizedState=Ab(o),e.memoizedState=Tb,s);if(!(e.mode&1))return Id(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(ye(419)),r=zh(s,r,void 0),Id(t,e,o,r)}if(a=(o&t.childLanes)!==0,tr||a){if(r=cn,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,is(t,i),ai(r,t,i,-1))}return Cv(),r=zh(Error(ye(421))),Id(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=nM.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,hr=Ys(i.nextSibling),gr=e,At=!0,ni=null,t!==null&&(zr[Pr++]=Ji,zr[Pr++]=Zi,zr[Pr++]=ta,Ji=t.id,Zi=t.overflow,ta=e),e=yv(e,r.children),e.flags|=4096,e)}function O0(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),jb(t.return,e,n)}function Ph(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function wS(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Rn(t,e,r.children,n),r=It.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&O0(t,n,e);else if(t.tag===19)O0(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(wt(It,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&qf(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Ph(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&qf(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Ph(e,!0,n,null,s);break;case"together":Ph(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function mf(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ss(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ra|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ye(153));if(e.child!==null){for(t=e.child,n=to(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=to(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function VA(t,e,n){switch(e.tag){case 3:kS(e),pl();break;case 5:Jw(e);break;case 1:rr(e.type)&&Uf(e);break;case 4:fv(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;wt(Kf,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(wt(It,It.current&1),e.flags|=128,null):n&e.child.childLanes?jS(t,e,n):(wt(It,It.current&1),t=ss(t,e,n),t!==null?t.sibling:null);wt(It,It.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return wS(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),wt(It,It.current),r)break;return null;case 22:case 23:return e.lanes=0,vS(t,e,n)}return ss(t,e,n)}var SS,Mb,NS,CS;SS=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Mb=function(){};NS=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Lo(Ti.current);var s=null;switch(n){case"input":i=Qg(t,i),r=Qg(t,r),s=[];break;case"select":i=Dt({},i,{value:void 0}),r=Dt({},r,{value:void 0}),s=[];break;case"textarea":i=tb(t,i),r=tb(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Bf)}rb(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(lu.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];
vendor: 5,267 bytes, line 40
40if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(lu.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ct("scroll",t),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};CS=function(t,e,n,r){n!==r&&(e.flags|=4)};function mc(t,e){if(!At)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function En(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function KA(t,e,n){var r=e.pendingProps;switch(sv(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(e),null;case 1:return rr(e.type)&&Ff(),En(e),null;case 3:return r=e.stateNode,hl(),Tt(nr),Tt(zn),mv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Ad(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ni!==null&&(Rb(ni),ni=null))),Mb(t,e),En(e),null;case 5:pv(e);var i=Lo(yu.current);if(n=e.type,t!==null&&e.stateNode!=null)NS(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(ye(166));return En(e),null}if(t=Lo(Ti.current),Ad(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[Ni]=e,r[xu]=s,t=(e.mode&1)!==0,n){case"dialog":Ct("cancel",r),Ct("close",r);break;case"iframe":case"object":case"embed":Ct("load",r);break;case"video":case"audio":for(i=0;i<Cc.length;i++)Ct(Cc[i],r);break;case"source":Ct("error",r);break;case"img":case"image":case"link":Ct("error",r),Ct("load",r);break;case"details":Ct("toggle",r);break;case"input":Vy(r,s),Ct("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Ct("invalid",r);break;case"textarea":Wy(r,s),Ct("invalid",r)}rb(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Td(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Td(r.textContent,a,t),i=["children",""+a]):lu.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ct("scroll",r)}switch(n){case"input":yd(r),Ky(r,s,!0);break;case"textarea":yd(r),Gy(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Bf)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=ew(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Ni]=e,t[xu]=r,SS(t,e,!1,!1),e.stateNode=t;e:{switch(o=ib(n,r),n){case"dialog":Ct("cancel",t),Ct("close",t),i=r;break;case"iframe":case"object":case"embed":Ct("load",t),i=r;break;case"video":case"audio":for(i=0;i<Cc.length;i++)Ct(Cc[i],t);i=r;break;case"source":Ct("error",t),i=r;break;case"img":case"image":case"link":Ct("error",t),Ct("load",t),i=r;break;case"details":Ct("toggle",t),i=r;break;case"input":Vy(t,r),i=Qg(t,r),Ct("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Dt({},r,{value:void 0}),Ct("invalid",t);break;case"textarea":Wy(t,r),i=tb(t,r),Ct("invalid",t);break;default:i=r}rb(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?rw(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&tw(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&cu(t,l):typeof l=="number"&&cu(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(lu.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Ct("scroll",t):l!=null&&Vx(t,s,l,o))}switch(n){case"input":yd(t),Ky(t,r,!1);break;case"textarea":yd(t),Gy(t);break;case"option":r.value!=null&&t.setAttribute("value",""+lo(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?rl(t,!!r.multiple,s,!1):r.defaultValue!=null&&rl(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Bf)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}
vendor: 30,031 bytes, line 40
40return En(e),null;case 6:if(t&&e.stateNode!=null)CS(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(ye(166));if(n=Lo(yu.current),Lo(Ti.current),Ad(e)){if(r=e.stateNode,n=e.memoizedProps,r[Ni]=e,(s=r.nodeValue!==n)&&(t=gr,t!==null))switch(t.tag){case 3:Td(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Td(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ni]=e,e.stateNode=r}return En(e),null;case 13:if(Tt(It),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(At&&hr!==null&&e.mode&1&&!(e.flags&128))Vw(),pl(),e.flags|=98560,s=!1;else if(s=Ad(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(ye(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(ye(317));s[Ni]=e}else pl(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;En(e),s=!1}else ni!==null&&(Rb(ni),ni=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||It.current&1?Qt===0&&(Qt=3):Cv())),e.updateQueue!==null&&(e.flags|=4),En(e),null);case 4:return hl(),Mb(t,e),t===null&&gu(e.stateNode.containerInfo),En(e),null;case 10:return cv(e.type._context),En(e),null;case 17:return rr(e.type)&&Ff(),En(e),null;case 19:if(Tt(It),s=e.memoizedState,s===null)return En(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)mc(s,!1);else{if(Qt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=qf(t),o!==null){for(e.flags|=128,mc(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return wt(It,It.current&1|2),e.child}t=t.sibling}s.tail!==null&&Bt()>bl&&(e.flags|=128,r=!0,mc(s,!1),e.lanes=4194304)}else{if(!r)if(t=qf(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),mc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!At)return En(e),null}else 2*Bt()-s.renderingStartTime>bl&&n!==1073741824&&(e.flags|=128,r=!0,mc(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Bt(),e.sibling=null,n=It.current,wt(It,r?n&1|2:n&1),e):(En(e),null);case 22:case 23:return Nv(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?fr&1073741824&&(En(e),e.subtreeFlags&6&&(e.flags|=8192)):En(e),null;case 24:return null;case 25:return null}throw Error(ye(156,e.tag))}function WA(t,e){switch(sv(e),e.tag){case 1:return rr(e.type)&&Ff(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return hl(),Tt(nr),Tt(zn),mv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return pv(e),null;case 13:if(Tt(It),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ye(340));pl()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Tt(It),null;case 4:return hl(),null;case 10:return cv(e.type._context),null;case 22:case 23:return Nv(),null;case 24:return null;default:return null}}var zd=!1,An=!1,GA=typeof WeakSet=="function"?WeakSet:Set,ze=null;function Za(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Rt(t,e,r)}else n.current=null}function Ib(t,e,n){try{n()}catch(r){Rt(t,e,r)}}var _0=!1;function qA(t,e){if(mb=Lf,t=Iw(),rv(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,f=t,p=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===t)break t;if(p===n&&++u===i&&(a=o),p===s&&++d===r&&(l=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(hb={focusedElem:t,selectionRange:n},Lf=!1,ze=e;ze!==null;)if(e=ze,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ze=t;else for(;ze!==null;){e=ze;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,j=g.memoizedState,x=e.stateNode,k=x.getSnapshotBeforeUpdate(e.elementType===e.type?y:Xr(e.type,y),j);x.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var N=e.stateNode.containerInfo;N.nodeType===1?N.textContent="":N.nodeType===9&&N.documentElement&&N.removeChild(N.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ye(163))}}catch(C){Rt(e,e.return,C)}if(t=e.sibling,t!==null){t.return=e.return,ze=t;break}ze=e.return}return g=_0,_0=!1,g}function Kc(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Ib(e,n,s)}i=i.next}while(i!==r)}}function dm(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function zb(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function ES(t){var e=t.alternate;e!==null&&(t.alternate=null,ES(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ni],delete e[xu],delete e[xb],delete e[MA],delete e[IA])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function TS(t){return t.tag===5||t.tag===3||t.tag===4}function L0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||TS(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Pb(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Bf));else if(r!==4&&(t=t.child,t!==null))for(Pb(t,e,n),t=t.sibling;t!==null;)Pb(t,e,n),t=t.sibling}function Db(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Db(t,e,n),t=t.sibling;t!==null;)Db(t,e,n),t=t.sibling}var mn=null,ti=!1;function js(t,e,n){for(n=n.child;n!==null;)AS(t,e,n),n=n.sibling}function AS(t,e,n){if(Ei&&typeof Ei.onCommitFiberUnmount=="function")try{Ei.onCommitFiberUnmount(rm,n)}catch{}switch(n.tag){case 5:An||Za(n,e);case 6:var r=mn,i=ti;mn=null,js(t,e,n),mn=r,ti=i,mn!==null&&(ti?(t=mn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):mn.removeChild(n.stateNode));break;case 18:mn!==null&&(ti?(t=mn,n=n.stateNode,t.nodeType===8?Ch(t.parentNode,n):t.nodeType===1&&Ch(t,n),pu(t)):Ch(mn,n.stateNode));break;case 4:r=mn,i=ti,mn=n.stateNode.containerInfo,ti=!0,js(t,e,n),mn=r,ti=i;break;case 0:case 11:case 14:case 15:if(!An&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Ib(n,e,o),i=i.next}while(i!==r)}js(t,e,n);break;case 1:if(!An&&(Za(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Rt(n,e,a)}js(t,e,n);break;case 21:js(t,e,n);break;case 22:n.mode&1?(An=(r=An)||n.memoizedState!==null,js(t,e,n),An=r):js(t,e,n);break;default:js(t,e,n)}}function R0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new GA),e.forEach(function(r){var i=rM.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Qr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:mn=a.stateNode,ti=!1;break e;case 3:mn=a.stateNode.containerInfo,ti=!0;break e;case 4:mn=a.stateNode.containerInfo,ti=!0;break e}a=a.return}if(mn===null)throw Error(ye(160));AS(s,o,i),mn=null,ti=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Rt(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)MS(e,t),e=e.sibling}function MS(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Qr(e,t),vi(t),r&4){try{Kc(3,t,t.return),dm(3,t)}catch(y){Rt(t,t.return,y)}try{Kc(5,t,t.return)}catch(y){Rt(t,t.return,y)}}break;case 1:Qr(e,t),vi(t),r&512&&n!==null&&Za(n,n.return);break;case 5:if(Qr(e,t),vi(t),r&512&&n!==null&&Za(n,n.return),t.flags&32){var i=t.stateNode;try{cu(i,"")}catch(y){Rt(t,t.return,y)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Q1(i,s),ib(a,o);var u=ib(a,s);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?rw(i,f):d==="dangerouslySetInnerHTML"?tw(i,f):d==="children"?cu(i,f):Vx(i,d,f,u)}switch(a){case"input":Xg(i,s);break;case"textarea":X1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?rl(i,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?rl(i,!!s.multiple,s.defaultValue,!0):rl(i,!!s.multiple,s.multiple?[]:"",!1))}i[xu]=s}catch(y){Rt(t,t.return,y)}}break;case 6:if(Qr(e,t),vi(t),r&4){if(t.stateNode===null)throw Error(ye(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(y){Rt(t,t.return,y)}}break;case 3:if(Qr(e,t),vi(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{pu(e.containerInfo)}catch(y){Rt(t,t.return,y)}break;case 4:Qr(e,t),vi(t);break;case 13:Qr(e,t),vi(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(wv=Bt())),r&4&&R0(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(An=(u=An)||d,Qr(e,t),An=u):Qr(e,t),vi(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(ze=t,d=t.child;d!==null;){for(f=ze=d;ze!==null;){switch(p=ze,m=p.child,p.tag){case 0:case 11:case 14:case 15:Kc(4,p,p.return);break;case 1:Za(p,p.return);var g=p.stateNode;if(typeof g.componentWillUnmount=="function"){r=p,n=p.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(y){Rt(r,n,y)}}break;case 5:Za(p,p.return);break;case 22:if(p.memoizedState!==null){B0(f);continue}}m!==null?(m.return=p,ze=m):B0(f)}d=d.sibling}e:for(d=null,f=t;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=nw("display",o))}catch(y){Rt(t,t.return,y)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(y){Rt(t,t.return,y)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Qr(e,t),vi(t),r&4&&R0(t);break;case 21:break;default:Qr(e,t),vi(t)}}function vi(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(TS(n)){var r=n;break e}n=n.return}throw Error(ye(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(cu(i,""),r.flags&=-33);var s=L0(t);Db(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=L0(t);Pb(t,a,o);break;default:throw Error(ye(161))}}catch(l){Rt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function JA(t,e,n){ze=t,IS(t)}function IS(t,e,n){for(var r=(t.mode&1)!==0;ze!==null;){var i=ze,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||zd;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||An;a=zd;var u=An;if(zd=o,(An=l)&&!u)for(ze=i;ze!==null;)o=ze,l=o.child,o.tag===22&&o.memoizedState!==null?F0(i):l!==null?(l.return=o,ze=l):F0(i);for(;s!==null;)ze=s,IS(s),s=s.sibling;ze=i,zd=a,An=u}$0(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ze=s):$0(t)}}function $0(t){for(;ze!==null;){var e=ze;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:An||dm(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!An)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Xr(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&w0(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}w0(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&pu(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ye(163))}An||e.flags&512&&zb(e)}catch(p){Rt(e,e.return,p)}}if(e===t){ze=null;break}if(n=e.sibling,n!==null){n.return=e.return,ze=n;break}ze=e.return}}function B0(t){for(;ze!==null;){var e=ze;if(e===t){ze=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ze=n;break}ze=e.return}}function F0(t){for(;ze!==null;){var e=ze;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{dm(4,e)}catch(l){Rt(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Rt(e,i,l)}}var s=e.return;try{zb(e)}catch(l){Rt(e,s,l)}break;case 5:var o=e.return;try{zb(e)}catch(l){Rt(e,o,l)}}}catch(l){Rt(e,e.return,l)}if(e===t){ze=null;break}var a=e.sibling;if(a!==null){a.return=e.return,ze=a;break}ze=e.return}}var ZA=Math.ceil,Yf=as.ReactCurrentDispatcher,kv=as.ReactCurrentOwner,Lr=as.ReactCurrentBatchConfig,ft=0,cn=null,Kt=null,yn=0,fr=0,Ya=mo(0),Qt=0,Su=null,ra=0,fm=0,jv=0,Wc=null,Xn=null,wv=0,bl=1/0,Ki=null,Qf=!1,Ob=null,Xs=null,Pd=!1,Hs=null,Xf=0,Gc=0,_b=null,hf=-1,gf=0;function Bn(){return ft&6?Bt():hf!==-1?hf:hf=Bt()}function eo(t){return t.mode&1?ft&2&&yn!==0?yn&-yn:PA.transition!==null?(gf===0&&(gf=hw()),gf):(t=xt,t!==0||(t=window.event,t=t===void 0?16:jw(t.type)),t):1}function ai(t,e,n,r){if(50<Gc)throw Gc=0,_b=null,Error(ye(185));Fu(t,n,r),(!(ft&2)||t!==cn)&&(t===cn&&(!(ft&2)&&(fm|=n),Qt===4&&$s(t,yn)),ir(t,r),n===1&&ft===0&&!(e.mode&1)&&(bl=Bt()+500,lm&&ho()))}function ir(t,e){var n=t.callbackNode;PT(t,e);var r=_f(t,t===cn?yn:0);if(r===0)n!==null&&Zy(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Zy(n),e===1)t.tag===0?zA(U0.bind(null,t)):Fw(U0.bind(null,t)),TA(function(){!(ft&6)&&ho()}),n=null;else{switch(gw(r)){case 1:n=Jx;break;case 4:n=pw;break;case 16:n=Of;break;case 536870912:n=mw;break;default:n=Of}n=$S(n,zS.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function zS(t,e){if(hf=-1,gf=0,ft&6)throw Error(ye(327));var n=t.callbackNode;if(ll()&&t.callbackNode!==n)return null;var r=_f(t,t===cn?yn:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=ep(t,r);else{e=r;var i=ft;ft|=2;var s=DS();(cn!==t||yn!==e)&&(Ki=null,bl=Bt()+500,Ko(t,e));do try{XA();break}catch(a){PS(t,a)}while(!0);lv(),Yf.current=s,ft=i,Kt!==null?e=0:(cn=null,yn=0,e=Qt)}if(e!==0){if(e===2&&(i=cb(t),i!==0&&(r=i,e=Lb(t,i))),e===1)throw n=Su,Ko(t,0),$s(t,r),ir(t,Bt()),n;if(e===6)$s(t,r);else{if(i=t.current.alternate,!(r&30)&&!YA(i)&&(e=ep(t,r),e===2&&(s=cb(t),s!==0&&(r=s,e=Lb(t,s))),e===1))throw n=Su,Ko(t,0),$s(t,r),ir(t,Bt()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(ye(345));case 2:Po(t,Xn,Ki);break;case 3:if($s(t,r),(r&130023424)===r&&(e=wv+500-Bt(),10<e)){if(_f(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Bn(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=bb(Po.bind(null,t,Xn,Ki),e);break}Po(t,Xn,Ki);break;case 4:if($s(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-oi(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Bt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ZA(r/1960))-r,10<r){t.timeoutHandle=bb(Po.bind(null,t,Xn,Ki),r);break}Po(t,Xn,Ki);break;case 5:Po(t,Xn,Ki);break;default:throw Error(ye(329))}}}return ir(t,Bt()),t.callbackNode===n?zS.bind(null,t):null}function Lb(t,e){var n=Wc;return t.current.memoizedState.isDehydrated&&(Ko(t,e).flags|=256),t=ep(t,e),t!==2&&(e=Xn,Xn=n,e!==null&&Rb(e)),t}function Rb(t){Xn===null?Xn=t:Xn.push.apply(Xn,t)}function YA(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!ci(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function $s(t,e){for(e&=~jv,e&=~fm,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-oi(e),r=1<<n;t[n]=-1,e&=~r}}function U0(t){if(ft&6)throw Error(ye(327));ll();var e=_f(t,0);if(!(e&1))return ir(t,Bt()),null;var n=ep(t,e);if(t.tag!==0&&n===2){var r=cb(t);r!==0&&(e=r,n=Lb(t,r))}if(n===1)throw n=Su,Ko(t,0),$s(t,e),ir(t,Bt()),n;if(n===6)throw Error(ye(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Po(t,Xn,Ki),ir(t,Bt()),null}function Sv(t,e){var n=ft;ft|=1;try{return t(e)}finally{ft=n,ft===0&&(bl=Bt()+500,lm&&ho())}}function ia(t){Hs!==null&&Hs.tag===0&&!(ft&6)&&ll();var e=ft;ft|=1;var n=Lr.transition,r=xt;try{if(Lr.transition=null,xt=1,t)return t()}finally{xt=r,Lr.transition=n,ft=e,!(ft&6)&&ho()}}function Nv(){fr=Ya.current,Tt(Ya)}function Ko(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,EA(n)),Kt!==null)for(n=Kt.return;n!==null;){var r=n;switch(sv(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ff();break;case 3:hl(),Tt(nr),Tt(zn),mv();break;case 5:pv(r);break;case 4:hl();break;case 13:Tt(It);break;case 19:Tt(It);break;case 10:cv(r.type._context);break;case 22:case 23:Nv()}n=n.return}if(cn=t,Kt=t=to(t.current,null),yn=fr=e,Qt=0,Su=null,jv=fm=ra=0,Xn=Wc=null,_o!==null){for(e=0;e<_o.length;e++)if(n=_o[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}_o=null}return t}function PS(t,e){do{var n=Kt;try{if(lv(),ff.current=Zf,Jf){for(var r=Pt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Jf=!1}if(na=0,an=Zt=Pt=null,Vc=!1,ku=0,kv.current=null,n===null||n.return===null){Qt=1,Su=e,Kt=null;break}e:{var s=t,o=n.return,a=n,l=e;if(e=yn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=A0(o);if(m!==null){m.flags&=-257,M0(m,o,a,s,e),m.mode&1&&T0(s,u,e),e=m,l=u;var g=e.updateQueue;if(g===null){var y=new Set;y.add(l),e.updateQueue=y}else g.add(l);break e}else{if(!(e&1)){T0(s,u,e),Cv();break e}l=Error(ye(426))}}else if(At&&a.mode&1){var j=A0(o);if(j!==null){!(j.flags&65536)&&(j.flags|=256),M0(j,o,a,s,e),ov(gl(l,a));break e}}s=l=gl(l,a),Qt!==4&&(Qt=2),Wc===null?Wc=[s]:Wc.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var x=gS(s,l,e);j0(s,x);break e;case 1:a=l;var k=s.type,N=s.stateNode;if(!(s.flags&128)&&(typeof k.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Xs===null||!Xs.has(N)))){s.flags|=65536,e&=-e,s.lanes|=e;var C=bS(s,a,e);j0(s,C);break e}}s=s.return}while(s!==null)}_S(n)}catch(w){e=w,Kt===n&&n!==null&&(Kt=n=n.return);continue}break}while(!0)}function DS(){var t=Yf.current;return Yf.current=Zf,t===null?Zf:t}function Cv(){(Qt===0||Qt===3||Qt===2)&&(Qt=4),cn===null||!(ra&268435455)&&!(fm&268435455)||$s(cn,yn)}function ep(t,e){var n=ft;ft|=2;var r=DS();(cn!==t||yn!==e)&&(Ki=null,Ko(t,e));do try{QA();break}catch(i){PS(t,i)}while(!0);if(lv(),ft=n,Yf.current=r,Kt!==null)throw Error(ye(261));return cn=null,yn=0,Qt}function QA(){for(;Kt!==null;)OS(Kt)}function XA(){for(;Kt!==null&&!ST();)OS(Kt)}function OS(t){var e=RS(t.alternate,t,fr);t.memoizedProps=t.pendingProps,e===null?_S(t):Kt=e,kv.current=null}function _S(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=WA(n,e),n!==null){n.flags&=32767,Kt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Qt=6,Kt=null;return}}else if(n=KA(n,e,fr),n!==null){Kt=n;return}if(e=e.sibling,e!==null){Kt=e;return}Kt=e=t}while(e!==null);Qt===0&&(Qt=5)}function Po(t,e,n){var r=xt,i=Lr.transition;try{Lr.transition=null,xt=1,eM(t,e,n,r)}finally{Lr.transition=i,xt=r}return null}function eM(t,e,n,r){do ll();while(Hs!==null);if(ft&6)throw Error(ye(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(ye(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(DT(t,s),t===cn&&(Kt=cn=null,yn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Pd||(Pd=!0,$S(Of,function(){return ll(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Lr.transition,Lr.transition=null;var o=xt;xt=1;var a=ft;ft|=4,kv.current=null,qA(t,n),MS(n,t),yA(hb),Lf=!!mb,hb=mb=null,t.current=n,JA(n),NT(),ft=a,xt=o,Lr.transition=s}else t.current=n;if(Pd&&(Pd=!1,Hs=t,Xf=i),s=t.pendingLanes,s===0&&(Xs=null),TT(n.stateNode),ir(t,Bt()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Qf)throw Qf=!1,t=Ob,Ob=null,t;return Xf&1&&t.tag!==0&&ll(),s=t.pendingLanes,s&1?t===_b?Gc++:(Gc=0,_b=t):Gc=0,ho(),null}function ll(){if(Hs!==null){var t=gw(Xf),e=Lr.transition,n=xt;try{if(Lr.transition=null,xt=16>t?16:t,Hs===null)var r=!1;else{if(t=Hs,Hs=null,Xf=0,ft&6)throw Error(ye(331));var i=ft;for(ft|=4,ze=t.current;ze!==null;){var s=ze,o=s.child;if(ze.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(ze=u;ze!==null;){var d=ze;switch(d.tag){case 0:case 11:case 15:Kc(8,d,s)}var f=d.child;if(f!==null)f.return=d,ze=f;else for(;ze!==null;){d=ze;var p=d.sibling,m=d.return;if(ES(d),d===u){ze=null;break}if(p!==null){p.return=m,ze=p;break}ze=m}}}var g=s.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var j=y.sibling;y.sibling=null,y=j}while(y!==null)}}ze=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ze=o;else e:for(;ze!==null;){if(s=ze,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Kc(9,s,s.return)}var x=s.sibling;if(x!==null){x.return=s.return,ze=x;break e}ze=s.return}}var k=t.current;for(ze=k;ze!==null;){o=ze;var N=o.child;if(o.subtreeFlags&2064&&N!==null)N.return=o,ze=N;else e:for(o=k;ze!==null;){if(a=ze,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:dm(9,a)}}catch(w){Rt(a,a.return,w)}if(a===o){ze=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,ze=C;break e}ze=a.return}}if(ft=i,ho(),Ei&&typeof Ei.onPostCommitFiberRoot=="function")try{Ei.onPostCommitFiberRoot(rm,t)}catch{}r=!0}return r}finally{xt=n,Lr.transition=e}}return!1}function H0(t,e,n){e=gl(n,e),e=gS(t,e,1),t=Qs(t,e,1),e=Bn(),t!==null&&(Fu(t,1,e),ir(t,e))}function Rt(t,e,n){if(t.tag===3)H0(t,t,n);else for(;e!==null;){if(e.tag===3){H0(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Xs===null||!Xs.has(r))){t=gl(n,t),t=bS(e,t,1),e=Qs(e,t,1),t=Bn(),e!==null&&(Fu(e,1,t),ir(e,t));break}}e=e.return}}function tM(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Bn(),t.pingedLanes|=t.suspendedLanes&n,cn===t&&(yn&n)===n&&(Qt===4||Qt===3&&(yn&130023424)===yn&&500>Bt()-wv?Ko(t,0):jv|=n),ir(t,e)}function LS(t,e){e===0&&(t.mode&1?(e=wd,wd<<=1,!(wd&130023424)&&(wd=4194304)):e=1);var n=Bn();t=is(t,e),t!==null&&(Fu(t,e,n),ir(t,n))}function nM(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),LS(t,n)}function rM(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ye(314))}r!==null&&r.delete(e),LS(t,n)}var RS;RS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||nr.current)tr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return tr=!1,VA(t,e,n);tr=!!(t.flags&131072)}else tr=!1,At&&e.flags&1048576&&Uw(e,Vf,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;mf(t,e),t=e.pendingProps;var i=fl(e,zn.current);al(e,n),i=gv(null,e,r,t,i,n);var s=bv();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,rr(r)?(s=!0,Uf(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,dv(e),i.updater=um,e.stateNode=i,i._reactInternals=e,Sb(e,r,t,n),e=Eb(null,e,r,!0,s,n)):(e.tag=0,At&&s&&iv(e),Rn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(mf(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=sM(r),t=Xr(r,t),i){case 0:e=Cb(null,e,r,t,n);break e;case 1:e=P0(null,e,r,t,n);break e;case 11:e=I0(null,e,r,t,n);break e;case 14:e=z0(null,e,r,Xr(r.type,t),n);break e}throw Error(ye(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Xr(r,i),Cb(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Xr(r,i),P0(t,e,r,i,n);case 3:e:{if(kS(e),t===null)throw Error(ye(387));r=e.pendingProps,s=e.memoizedState,i=s.element,qw(t,e),Gf(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=gl(Error(ye(423)),e),e=D0(t,e,r,n,i);break e}else if(r!==i){i=gl(Error(ye(424)),e),e=D0(t,e,r,n,i);break e}else for(hr=Ys(e.stateNode.containerInfo.firstChild),gr=e,At=!0,ni=null,n=Ww(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pl(),r===i){e=ss(t,e,n);break e}Rn(t,e,r,n)}e=e.child}return e;case 5:return Jw(e),t===null&&kb(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,gb(r,i)?o=null:s!==null&&gb(r,s)&&(e.flags|=32),yS(t,e),Rn(t,e,o,n),e.child;case 6:return t===null&&kb(e),null;case 13:return jS(t,e,n);case 4:return fv(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ml(e,null,r,n):Rn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Xr(r,i),I0(t,e,r,i,n);case 7:return Rn(t,e,e.pendingProps,n),e.child;case 8:return Rn(t,e,e.pendingProps.children,n),e.child;case 12:return Rn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,wt(Kf,r._currentValue),r._currentValue=o,s!==null)if(ci(s.value,o)){if(s.children===i.children&&!nr.current){e=ss(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Qi(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),jb(s.return,n,e),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ye(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),jb(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Rn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,al(e,n),i=Fr(i),r=r(i),e.flags|=1,Rn(t,e,r,n),e.child;case 14:return r=e.type,i=Xr(r,e.pendingProps),i=Xr(r.type,i),z0(t,e,r,i,n);case 15:return xS(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Xr(r,i),mf(t,e),e.tag=1,rr(r)?(t=!0,Uf(e)):t=!1,al(e,n),hS(e,r,i),Sb(e,r,i,n),Eb(null,e,r,!0,t,n);case 19:return wS(t,e,n);case 22:return vS(t,e,n)}throw Error(ye(156,e.tag))};function $S(t,e){return fw(t,e)}function iM(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _r(t,e,n,r){return new iM(t,e,n,r)}function Ev(t){return t=t.prototype,!(!t||!t.isReactComponent)}function sM(t){if(typeof t=="function")return Ev(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Wx)return 11;if(t===Gx)return 14}return 2}function to(t,e){var n=t.alternate;return n===null?(n=_r(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deleti
vendor: 10,351 bytes, line 40
40ons=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function bf(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")Ev(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Fa:return Wo(n.children,i,s,e);case Kx:o=8,i|=8;break;case qg:return t=_r(12,n,e,i|2),t.elementType=qg,t.lanes=s,t;case Jg:return t=_r(13,n,e,i),t.elementType=Jg,t.lanes=s,t;case Zg:return t=_r(19,n,e,i),t.elementType=Zg,t.lanes=s,t;case J1:return pm(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G1:o=10;break e;case q1:o=9;break e;case Wx:o=11;break e;case Gx:o=14;break e;case Ps:o=16,r=null;break e}throw Error(ye(130,t==null?t:typeof t,""))}return e=_r(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function Wo(t,e,n,r){return t=_r(7,t,r,e),t.lanes=n,t}function pm(t,e,n,r){return t=_r(22,t,r,e),t.elementType=J1,t.lanes=n,t.stateNode={isHidden:!1},t}function Dh(t,e,n){return t=_r(6,t,null,e),t.lanes=n,t}function Oh(t,e,n){return e=_r(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function oM(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hh(0),this.expirationTimes=hh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Tv(t,e,n,r,i,s,o,a,l){return t=new oM(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=_r(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},dv(s),t}function aM(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ba,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function BS(t){if(!t)return co;t=t._reactInternals;e:{if(fa(t)!==t||t.tag!==1)throw Error(ye(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(rr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(ye(171))}if(t.tag===1){var n=t.type;if(rr(n))return Bw(t,n,e)}return e}function FS(t,e,n,r,i,s,o,a,l){return t=Tv(n,r,!0,t,i,s,o,a,l),t.context=BS(null),n=t.current,r=Bn(),i=eo(n),s=Qi(r,i),s.callback=e??null,Qs(n,s,i),t.current.lanes=i,Fu(t,i,r),ir(t,r),t}function mm(t,e,n,r){var i=e.current,s=Bn(),o=eo(i);return n=BS(n),e.context===null?e.context=n:e.pendingContext=n,e=Qi(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Qs(i,e,o),t!==null&&(ai(t,i,o,s),df(t,i,o)),o}function tp(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function V0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Av(t,e){V0(t,e),(t=t.alternate)&&V0(t,e)}function lM(){return null}var US=typeof reportError=="function"?reportError:function(t){console.error(t)};function Mv(t){this._internalRoot=t}hm.prototype.render=Mv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(ye(409));mm(t,e,null,null)};hm.prototype.unmount=Mv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;ia(function(){mm(null,t,null,null)}),e[rs]=null}};function hm(t){this._internalRoot=t}hm.prototype.unstable_scheduleHydration=function(t){if(t){var e=vw();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Rs.length&&e!==0&&e<Rs[n].priority;n++);Rs.splice(n,0,t),n===0&&kw(t)}};function Iv(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function gm(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function K0(){}function cM(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=tp(o);s.call(u)}}var o=FS(e,r,t,0,null,!1,!1,"",K0);return t._reactRootContainer=o,t[rs]=o.current,gu(t.nodeType===8?t.parentNode:t),ia(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=tp(l);a.call(u)}}var l=Tv(t,0,!1,null,null,!1,!1,"",K0);return t._reactRootContainer=l,t[rs]=l.current,gu(t.nodeType===8?t.parentNode:t),ia(function(){mm(e,l,n,r)}),l}function bm(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=tp(o);a.call(l)}}mm(e,o,t,i)}else o=cM(n,e,t,i,r);return tp(o)}bw=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Nc(e.pendingLanes);n!==0&&(Zx(e,n|1),ir(e,Bt()),!(ft&6)&&(bl=Bt()+500,ho()))}break;case 13:ia(function(){var r=is(t,1);if(r!==null){var i=Bn();ai(r,t,1,i)}}),Av(t,1)}};Yx=function(t){if(t.tag===13){var e=is(t,134217728);if(e!==null){var n=Bn();ai(e,t,134217728,n)}Av(t,134217728)}};xw=function(t){if(t.tag===13){var e=eo(t),n=is(t,e);if(n!==null){var r=Bn();ai(n,t,e,r)}Av(t,e)}};vw=function(){return xt};yw=function(t,e){var n=xt;try{return xt=t,e()}finally{xt=n}};ob=function(t,e,n){switch(e){case"input":if(Xg(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=am(r);if(!i)throw Error(ye(90));Y1(r),Xg(r,i)}}}break;case"textarea":X1(t,n);break;case"select":e=n.value,e!=null&&rl(t,!!n.multiple,e,!1)}};ow=Sv;aw=ia;var uM={usingClientEntryPoint:!1,Events:[Hu,Ka,am,iw,sw,Sv]},hc={findFiberByHostInstance:Oo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dM={bundleType:hc.bundleType,version:hc.version,rendererPackageName:hc.rendererPackageName,rendererConfig:hc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:as.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=uw(t),t===null?null:t.stateNode},findFiberByHostInstance:hc.findFiberByHostInstance||lM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dd.isDisabled&&Dd.supportsFiber)try{rm=Dd.inject(dM),Ei=Dd}catch{}}yr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uM;yr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Iv(e))throw Error(ye(200));return aM(t,e,null,n)};yr.createRoot=function(t,e){if(!Iv(t))throw Error(ye(299));var n=!1,r="",i=US;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Tv(t,1,!1,null,null,n,!1,r,i),t[rs]=e.current,gu(t.nodeType===8?t.parentNode:t),new Mv(e)};yr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(ye(188)):(t=Object.keys(t).join(","),Error(ye(268,t)));return t=uw(e),t=t===null?null:t.stateNode,t};yr.flushSync=function(t){return ia(t)};yr.hydrate=function(t,e,n){if(!gm(e))throw Error(ye(200));return bm(null,t,e,!0,n)};yr.hydrateRoot=function(t,e,n){if(!Iv(t))throw Error(ye(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=US;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=FS(e,null,t,1,n??null,i,!1,s,o),t[rs]=e.current,gu(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new hm(e)};yr.render=function(t,e,n){if(!gm(e))throw Error(ye(200));return bm(null,t,e,!1,n)};yr.unmountComponentAtNode=function(t){if(!gm(t))throw Error(ye(40));return t._reactRootContainer?(ia(function(){bm(null,null,t,!1,function(){t._reactRootContainer=null,t[rs]=null})}),!0):!1};yr.unstable_batchedUpdates=Sv;yr.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!gm(n))throw Error(ye(200));if(t==null||t._reactInternals===void 0)throw Error(ye(38));return bm(t,e,n,!1,r)};yr.version="18.3.1-next-f1338f8080-20240426";function HS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(HS)}catch(t){console.error(t)}}HS(),H1.exports=yr;var go=H1.exports;const fM=I1(go);var W0=go;Wg.createRoot=W0.createRoot,Wg.hydrateRoot=W0.hydrateRoot;function $b({className:t}){return c.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:t,children:[c.jsx("circle",{cx:"10.5",cy:"10.5",r:"6.75",fill:"none",stroke:"currentColor",strokeWidth:"2.8"}),c.jsx("line",{x1:"15.8",y1:"15.8",x2:"22",y2:"22",stroke:"currentColor",strokeWidth:"2.8",strokeLinecap:"round"})]})}function G0({className:t}){return c.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:t,children:[c.jsx("circle",{cx:"12",cy:"8",r:"3.6",fill:"none",stroke:"currentColor",strokeWidth:"2.1"}),c.jsx("path",{d:"M5.5 19.5c1.2-3.2 3.4-4.8 6.5-4.8s5.3 1.6 6.5 4.8",fill:"none",stroke:"currentColor",strokeWidth:"2.1",strokeLinecap:"round"})]})}function pM({className:t}){return c.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:t,children:[c.jsx("rect",{x:"4",y:"9",width:"3.1",height:"11",fill:"currentColor"}),c.jsx("circle",{cx:"5.55",cy:"5.9",r:"1.6",fill:"currentColor"}),c.jsx("path",{fill:"currentColor",d:"M10 9h3v1.6c.6-1.1 1.8-1.9 3.7-1.9 3.1 0 4.3 1.9 4.3 5.1V20h-3.2v-5.5c0-1.5-.3-2.8-1.9-2.8-1.6 0-2.2 1.1-2.2 2.8V2
400H10V9z"})]})}function Yn(t,e=""){return String(t??"").trim()||e}function mM(t,e){if(Array.isArray(t)){const r=t.map(i=>Yn(i)).filter(Boolean);if(r.length>0)return r}const n=Yn(t);if(n){const r=n.split(/\r?\n|;/g).map(i=>i.trim()).filter(Boolean);if(r.length>0)return r}return e}function hM({goTo:t,onOpenArchive:e,onOpenCookieSettings:n,settings:r}){const s=new Date().getFullYear(),o=s>2011?`2011.â${s}.`:"2011.",a=Yn(r==null?void 0:r.footer_company_name,"HRVATSKA KOMORA INŽENJERA Å UMARSTVA I DRVNE TEHNOLOGIJE"),l=Yn(r==null?void 0:r.footer_address,"Prilaz Gjure DeželiÄa 63, 10000 Zagreb").replace(/\bDezelica\b/gi,"DeželiÄa"),u=mM((r==null?void 0:r.footer_phone_lines)??(r==null?void 0:r.footer_phone),["+385 1 376 5501","+385 1 376 5502"]),d=Yn(r==null?void 0:r.footer_fax,"+385 1 376 5504"),f=Yn(r==null?void 0:r.footer_email,"[email protected]"),p=Yn(r==null?void 0:r.footer_working_hours,"pon â pet: 7 â 15 h"),m=Yn(r==null?void 0:r.footer_social_title),g=/facebook|instagram/i.test(m)?"Posjetite nas na LinkedInu":m||"Posjetite nas na LinkedInu",y=Yn(r==null?void 0:r.footer_linkedin_url,""),j=y&&y!=="#"?y:"https://linkedin.com/in/hkisdt",x=Yn(r==null?void 0:r.footer_copyright,`Copyright (c) Hrvatska komora inženjera Å¡umarstva i drvne tehnologije ${o} Sva prava pridržana.`),k=Yn(r==null?void 0:r.footer_credit_prefix,"Dizajn i razvoj:"),N=Yn(r==null?void 0:r.footer_credit_value,"BENvision"),C=Yn(r==null?void 0:r.footer_credit_url,"https://benvision.hr"),w=/^https?:\/\//i.test(C),E=Yn(r==null?void 0:r.footer_archive_label,"Arhiva"),D=/^arhiva\s+vijesti$/i.test(E)?"Arhiva":E,L=u.filter(Boolean).join(", ");return c.jsxs("footer",{className:"app-enter -mt-px w-full max-w-[100vw] overflow-x-hidden",children:[c.jsxs("div",{className:"footer-shell grid gap-6 px-4 py-5 text-[#f2f2f2] sm:px-6 md:grid-cols-2 md:gap-x-10 md:gap-y-6 md:px-8 md:py-6 lg:px-10 xl:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)]",children:[c.jsxs("section",{className:"text-center md:text-left",children:[c.jsx("h4",{className:"mb-2 text-sm font-bold md:text-[0.95rem]",children:a}),c.jsx("p",{className:"mb-2 text-sm md:text-[0.95rem]",children:l}),c.jsxs("p",{className:"mb-2 text-sm md:text-[0.95rem]",children:["Tel: ",L,c.jsx("br",{}),"Fax: ",d]}),c.jsxs("p",{className:"mb-2 text-sm md:text-[0.95rem]",children:["E-mail: ",f]}),c.jsxs("p",{className:"text-sm md:text-[0.95rem]",children:["Radno vrijeme: ",p]})]}),c.jsx("section",{className:"w-full border-t border-white/25 pt-5 text-sm text-center sm:border-t-0 sm:pt-0 md:text-left xl:justify-self-center",children:c.jsxs("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2 sm:gap-y-4 lg:gap-x-10 xl:gap-x-[7.5rem]",children:[c.jsxs("div",{className:"text-center md:text-left",children:[c.jsx("h5",{className:"mb-2 text-xs font-bold uppercase text-[#d9efe1] md:text-[0.78rem]",children:"Informacije"}),c.jsx("button",{type:"button",onClick:e,className:"mb-2 block w-full text-center font-semibold hover:text-[#d5f3df] hover:underline sm:text-left",children:D}),c.jsx("button",{type:"button",onClick:()=>t("pristup-informacijama"),className:"mb-2 block w-full text-center font-semibold hover:text-[#d5f3df] hover:underline sm:text-left",children:"Pristup informacijama"}),c.jsx("button",{type:"button",onClick:()=>t("zakoni-propisi"),className:"mb-2 block w-full text-center font-semibold hover:text-[#d5f3df] hover:underline sm:text-left",children:"Zakoni i propisi"}),c.jsx("button",{type:"button",onClick:()=>t("osiguranje-clanova"),className:"block w-full text-center font-semibold hover:text-[#d5f3df] hover:underline sm:text-left",children:"Osiguranje Älanova"})]}),c.jsxs("div",{className:"border-t border-white/25 pt-4 text-center sm:border-t-0 sm:pt-0 md:text-left",children:[c.jsx("h5",{className:"mb-2 text-xs font-bold uppercase text-[#d9efe1] md:text-[0.78rem]",children:"Pravila i privatnost"}),c.jsx("button",{type:"button",onClick:()=>t("zastita-osobnih-podataka"),className:"mb-2 block w-full text-center font-semibold hover:text-[#d5f3df] hover:underline sm:text-left",children:"ZaÅ¡tita osobnih podataka"}),c.jsx("button",{type:"button",onClick:()=>t("uvjeti-koristenja"),className:"mb-2 block w-full text-center font-semibold hover:text-[#d5f3df] hover:underline sm:text-left",children:"Uvjeti koriÅ¡tenja"}),c.jsx("button",{type:"button",onClick:()=>t("pravila-privatnosti"),className:"block w-full text-center font-semibold hover:text-[#d5f3df] hover:underline sm:text-left",children:"Pravila privatnosti"}),c.jsx("button",{type:"button",onClick:()=>n==null?void 0:n(),className:"mt-2 block w-full text-center font-semibold hover:text-[#d5f3df] hover:underline sm:text-left",children:"Postavke kolaÄiÄa"})]})]})}),c.jsxs("section",{className:"border-t border-white/25 pt-5 text-center md:col-span-2 md:mt-1 xl:col-span-1 xl:mt-0 xl:justify-self-end xl
40:border-t-0 xl:pt-0 xl:text-right",children:[c.jsx("h4",{className:"mb-3 text-base font-bold",children:g}),c.jsx("div",{className:"flex items-center justify-center gap-3",children:c.jsx("a",{href:j,"aria-label":"LinkedIn",target:"_blank",rel:"noreferrer",className:"footer-social grid h-11 w-11 place-items-center rounded-full bg-[#1778b6] text-white",children:c.jsx(pM,{className:"h-5 w-5"})})})]})]}),c.jsxs("div",{className:"bg-black px-4 py-4 text-center text-xs text-[#efefef] sm:text-sm",children:[c.jsx("p",{className:"my-1 leading-relaxed",children:x}),c.jsx("div",{className:"mx-auto mt-3 w-full max-w-4xl border-t border-white/20 pt-3",children:c.jsxs("p",{className:"m-0 flex flex-wrap items-center justify-center gap-2 leading-relaxed",children:[k&&c.jsx("span",{className:"text-[#d9d9d9]",children:k}),N&&c.jsx("a",{href:C||"#",target:w?"_blank":void 0,rel:w?"noreferrer":void 0,onClick:V=>{w||V.preventDefault()},className:`font-semibold transition ${w?"text-[#c9a35f] hover:text-[#e5be74] hover:underline":"cursor-default text-[#c9a35f]"}`,children:N})]})})]})]})}const gM={hr:{"language.hr":"Hrvatski","language.en":"Engleski","language.switch":"Promijeni jezik","header.contacts":"Kontakti","header.ekomoraImport":"Import eKomora","header.profile":"Profil Älana","header.logout":"Odjava","admin.loggedIn":"Admin je prijavljen."},en:{"language.hr":"Croatian","language.en":"English","language.switch":"Change language","header.contacts":"Contacts","header.ekomoraImport":"eKomora import","header.profile":"Member profile","header.logout":"Log out","admin.loggedIn":"Admin is logged in."}},Bb=1,VS="hkisdt_cookie_consent_v1",Fb="hkisdt:cookie-consent-changed",Ub="hkisdt:cookie-consent-open-settings";function Pl(){return typeof window<"u"}function bM(t){if(!t||typeof t!="object")return null;const e=t;if(Number(e.version)!==Bb||typeof e.externalServices!="boolean")return null;const n=String(e.decidedAt||"").trim();return n?{version:Bb,externalServices:e.externalServices,decidedAt:n}:null}function KS(){if(!Pl())return null;const t=String(window.localStorage.getItem(VS)||"").trim();if(!t)return null;try{return bM(JSON.parse(t))}catch{return null}}function xM(t){if(!Pl())return;const e=new CustomEvent(Fb,{detail:{consent:t}});window.dispatchEvent(e)}function _h(t){const e={version:Bb,externalServices:t,decidedAt:new Date().toISOString()};return Pl()&&(window.localStorage.setItem(VS,JSON.stringify(e)),xM(e)),e}function Hb(){var t;return!!((t=KS())!=null&&t.externalServices)}function zv(){Pl()&&window.dispatchEvent(new Event(Ub))}function Pv(t){if(!Pl())return()=>{};const e=n=>{const r=n.detail;t((r==null?void 0:r.consent)??null)};return window.addEventListener(Fb,e),()=>{window.removeEventListener(Fb,e)}}function vM(t){if(!Pl())return()=>{};const e=()=>t();return window.addEventListener(Ub,e),()=>{window.removeEventListener(Ub,e)}}function yM(){const[t,e]=h.useState(()=>KS());return h.useEffect(()=>Pv(e),[]),t}const WS=h.createContext(null),Lh="hkisdt_lang",dr="hr",GS="googtrans",Vb="hkisdt-google-translate-script",Nu="hkisdt-google-translate-element",kM="hkisdtGoogleTranslateInit";let Ec=null,xf=!1;function q0(){var r;if(typeof window>"u"||typeof document>"u")return;Ec=null,xf=!1;const t=document.getElementById(Vb);t!=null&&t.parentNode&&t.parentNode.removeChild(t);const e=document.getElementById(Nu);e!=null&&e.parentNode&&e.parentNode.removeChild(e);const n=window;if(delete n.hkisdtGoogleTranslateInit,(r=n.google)!=null&&r.translate)try{delete n.google.translate}catch{}}function jM(){if(typeof document>"u")return null;const t=document.cookie.match(/(?:^|;\s*)googtrans=([^;]+)/);return t!=null&&t[1]&&decodeURIComponent(t[1]).toLowerCase().endsWith("/en")?"en":null}function qS(){if(typeof document>"u")return null;let t=document.getElementById(Nu);return t||(t=document.createElement("div"),t.id=Nu,t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.left="-9999px",t.style.top="0",t.style.width="1px",t.style.height="1px",t.style.overflow="hidden",document.body.appendChild(t)),t}function J0(){var s,o,a;if(typeof window>"u"||typeof document>"u")return!1;const t=qS();if(!t)return!1;if(t.childElementCount>0)return xf=!0,!0;if(xf)return!0;const n=(o=(s=window.google)==null?void 0:s.translate)==null?void 0:o.TranslateElement;if(!n)return!1;const r={pageLanguage:dr,includedLanguages:"hr,en",autoDisplay:!1,multilanguagePage:!0},i=(a=n.InlineLayout)==null?void 0:a.SIMPLE;return i&&(r.layout=i),new n(r,Nu),xf=!0,!0}function wM(){return typeof window>"u"||typeof document>"u"?Promise.resolve():Ec||(Ec=new Promise(t=>{let e=!1;const n=()=>{e||(e=!0,t())},r=()=>{J0(),n()};if(qS(),J0()){n();return}const i=window,s=i.hkisdtGoogleTranslateInit;i.hkisdtGoogleTranslateInit=()=>{s==null||s(),r()};const o=document.getElementById(Vb);if(o){o.addEventListener("load",r,{once:!0}),window.setTimeout(n,3500);return}const a=document.createElement("script");a.id=Vb,a.src=`https://translate.googleapis.com/translate_a/element.js?cb=${kM}`,a.async=!0,a.defer=!0,a.onload=r,a.onerror=n,document.head.appendChild(a),window.setTimeout(n,7e3)}),Ec)}function SM(t){if(typeof window>"u"||typeof document>"u")return;const e=`/${dr}/${t}`,n=`${GS}=${e}; path=/; max-age=31536000; SameSite=Lax`;document.cookie=n;const r=window.location.hostname;r.includes(".")&&(document.cookie=`${n}; domain=.${r}`)}function JS(){if(typeof window>"u"||typeof document>"u")return;const t=`${GS}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax`;document.cookie=t;const e=window.location.hostname;e.includes(".")&&(document.cookie=`${t}; domain=.${e}`)}function NM(t){if(typeof window>"u")return;const e=`#googtrans(${dr}|${t})`;if(window.location.hash===e)return;const n=`${window.location.pathname}${window.location.search}${e}`;window.history.replaceState(null,"",n)}function ZS(){if(typeof window>"u"||!window.location.hash.startsWith("#googtrans"))return;const t=`${window.location.pathname}${window.location.search}`;window.history.replaceState(null,"",t)}function YS(t){if(typeof document>"u")return;const e=document.querySelector(".goog-te-combo");e&&(e.value!==t&&(e.value=t),e.dispatchEvent(new Event("change",{bubbles:!0})))}function Rh(t){if(!(typeof window>"u"||typeof document>"u")){if(t==="en"){document.documentElement.setAttribute("lang","en"),SM("en"),N
40M("en"),YS("en");return}document.documentElement.setAttribute("lang",dr),JS(),ZS(),document.body&&(document.body.classList.remove("translated-ltr","translated-rtl"),document.body.style.top="0px")}}function gc(){if(typeof document>"u")return;const t=["iframe.goog-te-banner-frame","iframe[class*='VIpgJd-ZVi9od-ORHb-OEVmcd']","body > .skiptranslate"];for(const e of t)for(const n of Array.from(document.querySelectorAll(e)))n.style.display="none",n.style.visibility="hidden",n.style.maxHeight="0";document.body&&(document.body.style.top="0px")}function CM(t){const e=t instanceof Element?t:t.parentElement;return e?!!(e.closest(`#${Nu}`)||e.closest(".goog-te-menu-frame")||e.closest(".goog-te-banner-frame")||e.closest(".goog-tooltip")||e.closest(".skiptranslate")):!1}function EM(t){if(t.tagName==="FONT")return!0;const e=typeof t.className=="string"?t.className:"";return e.includes("VIpgJd")||e.includes("goog-")}function TM(t){var e;for(const n of t)if(n.type==="childList"){for(const r of Array.from(n.addedNodes))if(!CM(r)){if(r.nodeType===Node.TEXT_NODE&&((e=r.textContent)!=null&&e.trim()))return!0;if(r instanceof Element){if(EM(r)||r.tagName==="SCRIPT"||r.tagName==="STYLE"||r.tagName==="NOSCRIPT")continue;return!0}}}return!1}function AM({children:t}){const[e,n]=h.useState(()=>{if(typeof window>"u")return dr;const u=Hb(),d=window.localStorage.getItem(Lh);return d==="hr"?"hr":d==="en"?u?"en":"hr":u?jM()??dr:dr}),[r,i]=h.useState(()=>Hb()),s=h.useRef(e),o=h.useCallback(u=>{const d=u==="en"?"en":"hr",f=s.current;if(f!==d){if(d==="en"&&!r){zv();return}s.current=d,n(d),!(typeof window>"u")&&(window.localStorage.setItem(Lh,d),Rh(d),f==="en"&&d==="hr"&&(q0(),window.setTimeout(()=>{window.location.reload()},80)))}},[r]),a=h.useCallback((u,d)=>{var p;const f=(p=gM[e])==null?void 0:p[u];return f||d||u},[e]),l=h.useMemo(()=>({lang:e,setLang:o,t:a}),[e,o,a]);return h.useEffect(()=>{s.current=e},[e]),h.useEffect(()=>Pv(u=>{i(!!(u!=null&&u.externalServices))}),[]),h.useEffect(()=>{let u=!1;return r?(Rh(e),gc(),e==="en"&&wM().then(()=>{u||(Rh(e),gc())}),()=>{u=!0}):(s.current!==dr&&(s.current=dr,n(dr),typeof window<"u"&&window.localStorage.setItem(Lh,dr)),JS(),ZS(),q0(),gc(),typeof document<"u"&&document.documentElement.setAttribute("lang",dr),()=>{u=!0})},[r,e]),h.useEffect(()=>{if(typeof window>"u"||typeof document>"u"||typeof MutationObserver>"u")return;gc();const u=new MutationObserver(()=>{gc()});return u.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),()=>{u.disconnect()}},[]),h.useEffect(()=>{if(!r||e===dr||typeof window>"u"||typeof document>"u"||typeof MutationObserver>"u")return;const u=document.getElementById("root");if(!u)return;let d=null,f=0;const p=new MutationObserver(m=>{Date.now()<f||TM(m)&&(d!==null&&window.clearTimeout(d),d=window.setTimeout(()=>{f=Date.now()+1500,YS(e)},500))});return p.observe(u,{childList:!0,subtree:!0}),()=>{d!==null&&window.clearTimeout(d),p.disconnect()}},[r,e]),c.jsx(WS.Provider,{value:l,children:t})}function QS(){const t=h.useContext(WS);if(!t)throw new Error("useI18n must be used within I18nProvider");return t}const MM={azurira:"ažurira",azuriran:"ažuriran",azurirani:"ažurirani",azurnost:"ažurnost",cekic:"ÄekiÄ",cekici:"ÄekiÄi",clan:"Älan",clana:"Älana",clanci:"Älanci",clanka:"Älanka",clanku:"Älanku",clanovi:"Älanovi",clanovima:"Älanovima",clanova:"Älanova",clanski:"Älanski",clanskog:"Älanskog",clanskom:"Älanskom",dogadanja:"dogaÄanja",dogadanje:"dogaÄanje",drzava:"država",drzave:"države",drzavnim:"državnim",drustvo:"druÅ¡tvo",duzni:"dužni",duzno:"dužno",inzenjer:"inženjer",inzenjera:"inženjera",inzenjeri:"inženjeri",inzenjerima:"inženjerima",inzenjerske:"inženjerske",inzenjerski:"inženjerski",inzenjerskih:"inženjerskih",inzenjerskom:"inženjerskom",izvjescivanje:"izvjeÅ¡Äivanje",izvodac:"izvoÄaÄ",izvodaca:"izvoÄaÄa",izvodenje:"izvoÄenje",izvodenja:"izvoÄenja",korisena:"koriÅ¡tena",korisene:"koriÅ¡tene",koristena:"koriÅ¡tena",koristene:"koriÅ¡tene",koristeni:"koriÅ¡teni",koristen:"koriÅ¡ten",koristenja:"koriÅ¡tenja",koristenje:"koriÅ¡tenje",koristenjem:"koriÅ¡tenjem",moguce:"moguÄe",moguci:"moguÄi",mogucnost:"moguÄnost",mogucnosti:"moguÄnosti",mreza:"mreža",mrezi:"mreži",mrezu:"mrežu",mreznim:"mrežnim",nadlezni:"nadležni",nadlezno:"nadležno",nadleznog:"nadležnog",nadleznosti:"nadležnosti",obiljezavanje:"obilježavanje",obiljezba:"obilježba",obiljezbi:"obilježbi",odrzan:"održan",odrzana:"održana",odrzane:"održane",odrzanoj:"održanoj",odrzano:"održano",odrzati:"održati",odrzavanje:"održavanje",odrzavanja:"održavanja",odrzavanju:"održavanju",odrziv:"održiv",odrzivo:"održivo",odrzivog:"održivog",odrzivosti:"održivosti",ovlasten:"ovlaÅ¡ten",ovlastena:"ovlaÅ¡tena",ovlastene:"ovlaÅ¡tene",ovlasteni:"ovlaÅ¡teni",ovlastenih:"ovlaÅ¡tenih",ovlastenim:"ovlaÅ¡tenim",ovlasteno:"ovlaÅ¡teno",ozujka:"ožujka",pecat:"peÄat",podrucje:"podruÄje",podrucja:"podruÄja",podrucjima:"podruÄjima",podrucju:"podruÄju",predv
40idenom:"predviÄenom",prezentacijski:"prezentacijski",procisceni:"proÄiÅ¡Äeni",racunalna:"raÄunalna",racunalne:"raÄunalne",racunalni:"raÄunalni",racunalno:"raÄunalno",sadrzaj:"sadržaj",sadrzaja:"sadržaja",sadrzajem:"sadržajem",sadrzaji:"sadržaji",sadrzajima:"sadržajima",sadrzaju:"sadržaju",sjecama:"sjeÄama",sjecanj:"sijeÄanj",sijecanj:"sijeÄanj",sijecnja:"sijeÄnja",staza:"staža",stetnih:"Å¡tetnih",strucna:"struÄna",strucne:"struÄne",strucni:"struÄni",strucnih:"struÄnih",strucnim:"struÄnim",strucnoga:"struÄnoga",strucno:"struÄno",strucnom:"struÄnom",strucnu:"struÄnu",suma:"Å¡uma",sumama:"Å¡umama",sumari:"Å¡umari",sumarija:"Å¡umarija",sumarihr:"Å¡umarihr",sumarskih:"Å¡umarskih",sumarski:"Å¡umarski",sumarsko:"Å¡umarsko",sumarskom:"Å¡umarskom",sumarskog:"Å¡umarskog",sumarsku:"Å¡umarsku",sumarske:"Å¡umarske",sumarstva:"Å¡umarstva",sumarstvu:"Å¡umarstvu",sumarstvo:"Å¡umarstvo",sume:"Å¡ume",sumi:"Å¡umi",sumom:"Å¡umom",sumoposjednik:"Å¡umoposjednik",sumski:"Å¡umski",sumska:"Å¡umska",sumske:"Å¡umske",sumskih:"Å¡umskih",sumskom:"Å¡umskom",sumu:"Å¡umu",tecaj:"teÄaj",trosak:"troÅ¡ak",usavrsavanje:"usavrÅ¡avanje",usavrsavanja:"usavrÅ¡avanja",usavrsavanju:"usavrÅ¡avanju",usavrsavati:"usavrÅ¡avati",vazeci:"važeÄi",vazecih:"važeÄih",vazecim:"važeÄim",vec:"veÄ",veljace:"veljaÄe",vijece:"vijeÄe",vijeca:"vijeÄa",vise:"viÅ¡e",vjestacenja:"vjeÅ¡taÄenja",vrsi:"vrÅ¡i",zastita:"zaÅ¡tita",zastite:"zaÅ¡tite",zastiti:"zaÅ¡titi",zastitu:"zaÅ¡titu",zasticen:"zaÅ¡tiÄen",zasticena:"zaÅ¡tiÄena",zasticene:"zaÅ¡tiÄene",zasticeni:"zaÅ¡tiÄeni",ziro:"žiro"},IM={"&":"&","'":"'",""":'"',"<":"<",">":">"," ":" ","„":"â","“":"â","”":"â","…":"â¦","–":"â","—":"â","š":"Å¡","Š":"Å ","ž":"ž","Ž":"Ž","č":"Ä","Č":"Ä","ć":"Ä","Ć":"Ä","đ":"Ä","Đ":"Ä"},zM=[["ââ¬Å¾","â"],["ââ¬Å","â"],["ââ¬Å¥","â"],["ââ¬â¢","â"],["ââ¬Ë","â"],["ââ¬â","â"],["ââ¬â","â"],["ââ¬Â¦","â¦"],["ââ¬Â¢","â¢"],["ââ¬","â¬"],["ââ¬",'"'],["ÃÂ","Ä"],["Ãâ","Ä"],["Ãâ ","Ä"],["Ãâ¡","Ä"],["ÃÅ","Ä"],["ÃŤ","Ä"],["Ĺ ","Å "],["ĹË","Å¡"],["ĹË","Ž"],["Ĺľ","ž"],["",""],["Ã",""]];function $h(t){let e=t;for(const[n,r]of zM)e.includes(n)&&(e=e.split(n).join(r));return e}function PM(t){return t.includes("&")?t.replace(/&(?:[A-Za-z]+|#\d+|#x[a-fA-F0-9]+);/g,e=>{const n=IM[e];if(n)return n;if(e.startsWith("&#x")||e.startsWith("&#X")){const r=Number.parseInt(e.slice(3,-1),16);return Number.isInteger(r)&&r>=0&&r<=1114111?String.fromCodePoint(r):e}if(e.startsWith("&#")){const r=Number.parseInt(e.slice(2,-1),10);return Number.isInteger(r)&&r>=0&&r<=1114111?String.fromCodePoint(r):e}return e}):t}function DM(t,e){return t===t.toUpperCase()?e.toUpperCase():t[0]&&t[0]===t[0].toUpperCase()?e.charAt(0).toUpperCase()+e.slice(1):e}function ut(t){if(!t)return t;const n=$h(PM(t).replace(/\u00A0/g," ")).replace(/\b[A-Za-z]+\b/g,r=>{const i=r.toLowerCase(),s=MM[i];return s?DM(r,$h(s)):r});return $h(n)}let qc=0,Kb="";function OM(){typeof document>"u"||(qc===0&&(Kb=document.body.style.overflow||""),qc+=1,document.body.style.overflow="hidden")}function _M(){if(!(typeof document>"u")&&!(qc<=0)){if(qc-=1,qc===0){document.body.style.overflow=Kb,Kb="";return}document.body.style.overflow="hidden"}}function Dl(){OM();let t=!1;return()=>{t||(t=!0,_M())}}function LM({navItems:t,route:e,goTo:n,onOpenEkomoraImport:r,onOpenSearch:i,onOpenProfile:s,profileOpen:o,isAdmin:a=!1,onLogout:l,isMember:u=!1,onMemberLogout:d}){const[f,p]=h.useState(!1),[m,g]=h.useState(null),[y,j]=h.useState(null),x=h.useRef(null),k=h.useRef(0),N=h.useRef(0),{lang:C,setLang:w,t:E}=QS(),D=a||u,L=a?E("header.ekomoraImport","Import eKomora"):E("header.contacts","Kontakti");function V(H){return ut(H).trim().toLowerCase().replace(/\s+/g," ")}function te(H,P){const z=V(H);if(C==="en"){if(z==="o nama")return c.jsx("span",{className:"notranslate",translate:"no",children:"About us"});if(z==="o komori"||P==="o-komori")return c.jsx("span",{className:"notranslate",translate:"no",children:"About the chamber"});if(z==="projekt"||z==="projekti"||z==="project")return c.jsx("span",{className:"notranslate",translate:"no",children:"Projects"})}if(C==="hr"){if(z==="about us"||z==="o name"||z==="o ime")return c.jsx("span",{className:"notranslate",translate:"no",children:"O nama"});if(z==="about the chamber")return c.jsx("span",{className:"notranslate",translate:"no",children:"O komori"})}return ut(H)}function ae(H){w(H==="en"?"en":"hr")}
40function ke(){if(ge(),a){l==null||l();return}if(u){d==null||d();return}s()}function ge(){p(!1),g(null),j(null)}function Se(){if(a&&r){r();return}n("kontakti")}function me(H,P){var Y;if(H.route===P)return!0;const z=[...H.children??[]];for(;z.length>0;){const Q=z.pop();if(Q.route===P)return!0;(Y=Q.children)!=null&&Y.length&&z.push(...Q.children)}return!1}return h.useEffect(()=>{f||(g(null),j(null))},[f]),h.useEffect(()=>{if(!f)return;const H=Dl(),P=document.documentElement.style.touchAction,z=Y=>{Y.key==="Escape"&&ge()};return document.documentElement.style.touchAction="auto",window.addEventListener("keydown",z),()=>{H(),document.documentElement.style.touchAction=P,window.removeEventListener("keydown",z)}},[f]),c.jsxs("header",{className:"relative z-[300] w-full overflow-visible border-0 bg-white",children:[c.jsx("div",{className:"px-3 py-3 sm:px-4 md:px-6 lg:py-4",children:c.jsxs("div",{className:"relative flex min-h-[56px] min-w-0 items-center justify-between gap-4 lg:min-h-[68px]",children:[c.jsx("img",{src:"/assets/logo.svg",alt:"HKISDT",className:"block h-[54px] w-auto max-w-[calc(100vw-5.5rem)] object-contain sm:h-[62px] lg:h-[66px] xl:h-[72px]"}),c.jsxs("div",{className:"hidden min-w-0 flex-wrap items-center justify-end gap-2 xl:gap-3 lg:flex",children:[c.jsx("button",{className:"btn-natural btn-natural-primary rounded-md px-3 py-2 text-sm font-semibold",onClick:Se,children:L}),a&&c.jsx("span",{className:"inline-flex items-center rounded-full border border-[#2f8f4b] bg-[#e8f6ee] px-3 py-1 text-xs font-extrabold uppercase text-[#1f5a31] shadow-[0_6px_14px_rgba(26,74,49,0.16)]",children:"Admin"}),c.jsx("button",{className:`group btn-natural rounded-md px-3 py-2 text-sm font-semibold ${D?"btn-natural-danger":o?"border-[#376d44] bg-[#376d44] text-white":"btn-natural-primary"}`,onClick:ke,children:c.jsxs("span",{className:"inline-flex items-center gap-2",children:[D?E("header.logout","Odjava"):E("header.profile","Profil Älana"),!D&&c.jsx(G0,{className:"h-5 w-5 text-current"})]})}),c.jsxs("div",{className:"relative min-w-[116px] xl:min-w-[132px]",children:[c.jsx("label",{className:"sr-only",htmlFor:"site-language-select-desktop",children:E("language.switch","Promijeni jezik")}),c.jsxs("select",{id:"site-language-select-desktop",value:C,onChange:H=>ae(H.target.value),className:"w-full rounded-md border-2 border-[#b8c7be] bg-[#edf3ef] px-3 py-2 text-left text-sm font-semibold text-[#2f5f3e] shadow-sm outline-none transition focus:border-[#376d44] focus:bg-white","aria-label":E("language.switch","Promijeni jezik"),title:E("language.switch","Promijeni jezik"),children:[c.jsx("option",{value:"hr",children:E("language.hr","Hrvatski")}),c.jsx("option",{value:"en",children:E("language.en","Engleski")})]})]}),c.jsx("button",{className:"btn-natural btn-natural-primary grid h-11 w-11 shrink-0 place-items-center rounded-md text-white",onClick:i,children:c.jsx($b,{className:"h-6 w-6"})})]}),c.jsx("div",{className:"shrink-0 lg:hidden",children:c.jsxs("button",{type:"button","aria-label":f?"Zatvori navigaciju":"Otvori navigaciju","aria-expanded":f,className:"relative grid h-11 w-11 place-items-center rounded-lg border border-[#c0d1c7] bg-white/95 p-0 shadow-[0_10px_18px_rgba(22,48,34,0.15)]",onClick:()=>p(H=>!H),children:[c.jsx("span",{className:`absolute block h-[2.5px] w-5 rounded-full bg-[#244e33] transition-all duration-300 ${f?"rotate-45":"-translate-y-[6px]"}`}),c.jsx("span",{className:`absolute block h-[2.5px] w-5 rounded-full bg-[#244e33] transition-all duration-300 ${f?"scale-x-0 opacity-0":"opacity-100"}`}),c.jsx("span",{className:`absolute block h-[2.5px] w-5 rounded-full bg-[#244e33] transition-all duration-300 ${f?"-rotate-45":"translate-y-[6px]"}`})]})})]})}),c.jsxs("div",{className:"mb-3 flex min-w-0 items-center justify-between gap-2 px-3 sm:px-4 lg:hidden",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a&&c.jsx("span",{className:"inline-flex shrink-0 items-center rounded-full border border-[#2f8f4b] bg-[#e8f6ee] px-2.5 py-1 text-[0.68rem] font-extrabold uppercase text-[#1f5a31] shadow-[0_4px_10px_rgba(26,74,49,0.14)]",children:"Admin"}),c.jsx("button",{type:"button",className:`group btn-natural inline-flex h-10 min-w-0 items-center rounded-md px-3 text-sm font-semibold ${D?"btn-natural-danger":o?"border-[#376d44] bg-[#376d44] text-white":"btn-natural-primary"}`,onClick:ke,children:c.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 truncate",children:[D?E("header.logout","Odjava"):E("header.profile","Profil Älana"),!D&&c.jsx(G0,{className:"h-4 w-4 shrink-0 text-current"})]})})]}),c.jsx("button",{type:"button",className:"btn-natural btn-natural-primary grid h-10 w-10 shrink-0 place-items-center rounded-md text-white",onClick:i,"aria-label":E("header.search","Pretraži"),children:c.jsx($b,{className:"h-5 w-5"})})]}),c.jsxs("nav",{className:`${f?"fixed inset-0 z-[340] block h-[100dvh] overflow-hidden pointer-events-auto":"hidden"} lg:relative lg:inset-auto lg:z-[320] lg:block lg:h-auto lg:pointer-events-auto lg:overflow-visible`,children:[c.jsx("button",{type:"button","aria-hidden":!f,tabIndex:f?0:-1,className:`absolute inset-0 z-0 bg-[#0a120f]/72 backdrop-blur-[2px] transition-opacity duration-300 lg:hidden ${f?"opacity-100":"opacity-0"}`,onClick:ge}),c.jsxs("div",{className:`absolute inset-y-0 right-0 z-[1] flex h-[100dvh] max-h-[100dvh] w-full flex-col overflow-hidden bg-[#232325] shadow-[0_24px_50px_rgba(3,8,6,0.55)] transition-transform duration-300 ease-[
40cubic-bezier(0.22,1,0.36,1)] ${f?"translate-x-0":"translate-x-full"} lg:static lg:h-auto lg:max-h-none lg:w-full lg:translate-x-0 lg:overflow-visible lg:shadow-[0_10px_20px_rgba(10,16,14,0.25)]`,children:[c.jsxs("div",{className:"sticky top-0 z-[2] flex items-center justify-between border-b border-[#4f5055] bg-[#232325] px-4 py-3 lg:hidden",children:[c.jsx("span",{className:"text-sm font-extrabold uppercase text-[#dce4df]",children:"Navigacija"}),c.jsx("button",{type:"button",className:"grid h-10 w-10 place-items-center rounded-full border border-[#5d6662] bg-[#1c1f24] text-xl font-bold leading-none text-[#f2f4f3]",onClick:ge,"aria-label":"Zatvori navigaciju",children:"x"})]}),c.jsxs("div",{className:"border-b border-[#4f5055] bg-[#232325] px-4 py-3 lg:hidden",children:[c.jsx("button",{type:"button",className:"btn-natural btn-natural-primary w-full rounded-md px-3 py-2 text-sm font-semibold",onClick:()=>{Se(),ge()},children:L}),c.jsxs("div",{className:"mt-3",children:[c.jsx("label",{className:"mb-1 block text-xs font-semibold uppercase text-[#c7d6cf]",htmlFor:"site-language-select-mobile-menu",children:E("language.switch","Promijeni jezik")}),c.jsxs("select",{id:"site-language-select-mobile-menu",value:C,onChange:H=>ae(H.target.value),className:"btn-natural h-10 w-full rounded-md border-[#6f7876] bg-[#1d2521] px-3 text-sm font-semibold text-[#e6eeea] outline-none transition focus:border-[#8fbe9f] focus:bg-[#23302a]","aria-label":E("language.switch","Promijeni jezik"),title:E("language.switch","Promijeni jezik"),children:[c.jsx("option",{value:"hr",children:E("language.hr","Hrvatski")}),c.jsx("option",{value:"en",children:E("language.en","Engleski")})]})]})]}),c.jsx("div",{ref:x,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain bg-[#232325] pb-[max(0.75rem,env(safe-area-inset-bottom))] [touch-action:pan-y] lg:overflow-visible lg:bg-transparent lg:pb-0",style:{WebkitOverflowScrolling:"touch"},onWheelCapture:H=>{if(!f)return;const P=x.current;P&&(P.scrollHeight<=P.clientHeight||(H.preventDefault(),P.scrollTop+=H.deltaY))},onTouchStartCapture:H=>{var z;if(!f)return;const P=x.current;P&&(k.current=((z=H.touches[0])==null?void 0:z.clientY)??0,N.current=P.scrollTop)},onTouchMoveCapture:H=>{var Q;if(!f)return;const P=x.current;if(!P||P.scrollHeight<=P.clientHeight)return;const Y=(((Q=H.touches[0])==null?void 0:Q.clientY)??0)-k.current;P.scrollTop=N.current-Y,H.preventDefault()},children:c.jsx("div",{className:"flex flex-col lg:flex-row",children:t.map(H=>{const P=me(H,e);return c.jsxs("div",{className:"group relative shrink-0 lg:flex-1 lg:overflow-visible",children:[c.jsx("button",{className:`min-h-[54px] w-full border-b border-[#6e6e72] px-2 py-2 text-center text-xs font-bold uppercase leading-tight text-[#f0f0f0] lg:border-b-0 lg:border-r lg:border-[#d8d8d8] ${P?"bg-[#376d44] text-white":"lg:hover:bg-[#2b2b2e] lg:hover:text-[#7ff0a3]"}`,onClick:()=>{var Y;if(typeof window<"u"&&window.matchMedia("(max-width: 1023.98px)").matches&&((Y=H.children)!=null&&Y.length)){const Q=m===H.id;g(Q?null:H.id),j(null);return}n(H.route),ge()},children:te(H.label,H.route)}),H.children&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:`lg:hidden overflow-hidden transition-[max-height,opacity] duration-300 ease-out ${m===H.id?"max-h-[1400px] border-t border-[#5f6064] bg-[#1f2023] opacity-100":"max-h-0 opacity-0"}`,children:H.children.map(z=>{var Y;return c.jsxs("div",{className:"border-b border-[#56575b]",children:[c.jsx("button",{className:`block w-full px-4 py-3 text-center text-xs font-bold uppercase text-[#f3f3f3] ${e===z.route?"bg-[#376d44] text-white":"hover:bg-[#2c2d31]"}`,onClick:()=>{var O;const Q=`${H.id}:${z.id}`;if((O=z.children)!=null&&O.length){j(U=>U===Q?null:Q);return}n(z.route),ge()},children:c.jsxs("span",{className:"relative flex items-center justify-center",children:[c.jsx("span",{children:te(z.label,z.route)}),(Y=z.children)!=null&&Y.length?c.jsx("span",{className:"absolute right-0 text-[11px]",children:y===`${H.id}:${z.id}`?"-":"+"}):null]})}),z.children&&c.jsx("div",{className:`overflow-hidden transition-[max-height,opacity] duration-300 ease-out ${y===`${H.id}:${z.id}`?"max-h-[900px] opacity-100":"max-h-0 opacity-0"}`,children:c.jsx("div",{className:"bg-[#17181b]",children:z.children.map(Q=>c.jsx("button",{className:`block w-full border-t border-[#4f5054] px-6 py-2.5 text-center text-[11px] font-semibold uppercase text-[#e7e7e7] ${e===Q.route?"bg-[#2f5f3e] text-white":"hover:bg-[#25262a]"}`,onClick:()=>{n(Q.route),ge()},children:te(Q.label,Q.route)},`mobile-${Q.id}`))})})]},`mobile-${z.id}`)})}),c.jsx("div",{className:"hidden overflow-hidden border border-[#7d7d7d] bg-[#232325] shadow-[0_14px_28px_rgba(6,8,7,0.45)] lg:absolute lg:-left-px lg:top-[calc(100%-1px)] lg:z-[350] lg:min-w-full lg:w-full lg:border-t-0 lg:overflow-visible lg:group-hover:block",children:H.children.map(z=>c.jsxs("div",{className:"group/child relative",children:[c.jsx("button",{className:`block w-full border-b border-[#9f9f9f] bg-[#232325] px-4 py-3 text-center text-xs font-bold uppercase leading-tight whitespace-normal break-words text-[#f3f3f3] ${e===z.route?"bg-[#376d44] text-white":"hover:bg-transparent hover:text-[#23dc5e]"} ${z.children?"relative pr-9 after:absolute after:right-3 after:top-1/2 after:-translate-y-1/2 after:content-['>']":""}`,onClick:()=>{n(z.route),ge()},children:te(z.label,z.route)}),z.children&&c.jsx("div",{className:"hidden overflow-hidden border border-[#7d7d7d] bg-[#232325] shadow-[0_14px_28px_rgba(6,8,7,0.45)] lg:absolute lg:left-full lg:top-0 lg:z-[360] lg:min-w-full lg:w-full lg:max-w-none lg:overflow-visible lg:group-hover/child:block",children:z.children.map(Y=>c.jsx("button",{className:`block w-full border-b border-[#9f9f9f] bg-[#232325] px-4 py-3 text-center text-xs font-bold uppercase leading-tight whitespace-normal break-words text-[#f3f3f3] ${e===Y.route?"bg-[#376d44] text-white":"hover:bg-transparent hover:text-[#23dc5e]"}`,onClick:()=>{n(Y.route),ge()},children:te(Y.label,Y.route)},Y.id))})]},z.id))})]})]},H.id)})})})]})]})]})}const Ro="hkisdt_access_token";let Cu="",np=!1;function RM(){if(typeof window>"u")return"";const t=String(window.sessionStorage.getItem(Ro)||"").trim();if(t)return t;const e=String(window.localStorage.getItem(Ro)||"").trim();return e?(window.sessionStorage.setItem(Ro,e),window.localStorage.removeItem(Ro),e):""}function XS(t){typeof window>"u"||(t?window.sessionStorage.setItem(Ro,t):window.sessionStorage.removeItem(Ro),window.localStorage.removeItem(Ro))}function $M(){np||(Cu=RM(),np=!0)}function eN(){return $M(),Cu}function BM(t){Cu=t.trim(),np=!0,XS(Cu)}function tN(){Cu="",np=!0,XS("")}const FM="https://hkisdt.hr";function Tc(t){return String(t||"").replace(/\/+$/,"")}function UM(t){const e=String(t||"").trim();return e?/^https?:\/\//i.test(e)?Tc(e):e.startsWith("/")?Tc(typeof window>"u"?e:`${window.location.origin}${e}`):Tc(`https://${e}`):""}function HM(){var e;const t=UM("https://www.hkisdt.hr");return t||(typeof window<"u"&&((e=window.location)!=null&&e.origin)?Tc(window.location.origin):FM)}const xm=HM(),VM=3e4,vf=new Map,yf=new Map;
40class KM extends Error{constructor(e,n,r){super(e),this.name="ApiError",this.status=n,this.details=r}}function WM(t,e){if(e)for(const[n,r]of Object.entries(e)){if(Array.isArray(r)){for(const i of r)i==null||i===""||t.searchParams.append(n,String(i));continue}r==null||r===""||t.searchParams.set(n,String(r))}}function GM(t,e){const n=t.startsWith("/")?t:`/${t}`,r=new URL(`${xm}${n}`);return WM(r,e),r.toString()}async function qM(t){const e=await t.text();if(!e)return null;try{return JSON.parse(e)}catch{return e}}function JM(t){return t&&typeof t=="object"&&"data"in t?t.data:t}function ZM(t,e){var r;if(!t||typeof t!="object")return e;const n=t;return(r=n.error)!=null&&r.message?n.error.message:typeof n.message=="string"&&n.message.trim()?n.message:e}function Bh(t){return t==null||typeof t!="object"?t:typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}function YM(){vf.clear(),yf.clear()}function QM(t,e){return e?`${t}::auth=${e}`:t}async function vm(t,e,n={}){const r={...n.headers||{}};let i;n.body!=null&&(n.body instanceof FormData?i=n.body:(r["Content-Type"]="application/json",i=JSON.stringify(n.body)));let s="";n.auth&&(s=eN(),s&&(r.Authorization=`Bearer ${s}`));const o=GM(e,n.query),a=QM(o,s),l=t==="GET"&&!n.skipMemoryCache&&!n.signal;if(l){const f=vf.get(a);if(f&&f.expiresAt>Date.now())return Bh(f.value);f&&vf.delete(a);const p=yf.get(a);if(p){const m=await p;return Bh(m)}}const u=async()=>{const f=t==="GET"&&!n.auth&&!n.skipMemoryCache?"default":"no-store",p=await fetch(o,{method:t,headers:r,body:i,cache:f,signal:n.signal}),m=await qM(p);if(!p.ok){const y=ZM(m,`HTTP ${p.status}`);throw new KM(y,p.status,m)}const g=JM(m);return t!=="GET"&&YM(),g};if(!l)return u();const d=u();yf.set(a,d);try{const f=await d;return vf.set(a,{expiresAt:Date.now()+VM,value:f}),Bh(f)}finally{yf.delete(a)}}function Hr(t,e){return vm("GET",t,e)}function Ol(t,e){return vm("POST",t,e)}function ym(t,e){return vm("PATCH",t,e)}function nN(t,e){return vm("DELETE",t,e)}const Wb=/^(?:\/)?(?:cdn|web\/dokumenti|api\/web\/dokumenti|dokumenti|podaci)(?:\/|$)/i,Z0=/^(?:\/)?api(?:\/|$)/i,XM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,e3=/^https?:\/\//i,t3=/^https?:\/{3,}(?=(?:cdn|web\/dokumenti|api\/web\/dokumenti|dokumenti|podaci)(?:\/|$))/i,n3=/^\/?api\/web\/dokumenti\/(\d+)(\/[^?#]*)?$/i,r3="media-fix-20260525";function Y0(t){return t.toLowerCase().replace(/^www\./,"")}function rN(){var e;if(typeof window>"u"||!((e=window.location)!=null&&e.hostname))return!1;const t=window.location.hostname.toLowerCase();try{const n=new URL(xm).hostname.toLowerCase();return Y0(t)===Y0(n)}catch{return!1}}function Fh(t){const e=t.startsWith("/")?t:`/${t}`;return rN()?e:`${xm}${e}`}function Q0(t){const e=String(t||"").startsWith("/")?String(t||""):`/${String(t||"")}`,n=n3.exec(e);if(!n)return e;const r=n[2]||"";return`/dokumenti/${n[1]}${r}`}function Uh(t){const e=String(t||"").trim();if(!e)return e;try{const n=new URL(e,"https://hkisdt.hr");if(!Wb.test(n.pathname))return e;n.searchParams.has("v")||n.searchParams.set("v",r3);const r=`${n.pathname}${n.search||""}${n.hash||""}`;return/^https?:\/\//i.test(e)?n.toString():r}catch{return e}}function ui(t){const e=String(t||"").trim();if(!e||e==="#")return e;const n=e.replace(/\\/g,"/").replace(t3,"/");if(e3.test(n))try{const r=new URL(n),i=r.pathname||"";if(Wb.test(i)||Z0.test(i)){const s=new URL(xm).origin.toLowerCase(),o=Q0(i),a=Uh(`${o}${r.search||""}${r.hash||""}`);return rN()||r.origin.toLowerCase()!==s?Fh(a):Uh(`${r.origin}${o}${r.search||""}${r.hash||""}`)}return n}catch{return n}if(XM.test(n))return n;if(Wb.test(n)||Z0.test(n)){const r=Q0(n.startsWith("/")?n:`/${n}`);return Fh(Uh(r))}return n}function i3({image:t,title:e,kicker:n,alt:r,isAdmin:i=!1,onEdit:s,lockTitleTranslation:o=!1}){const a="/assets/sume-2.jpg",l=ui(String(t||"").trim())||a,u=ut(e),d=n?ut(n):"",f=ut(r||e);return c.jsxs("section",{className:"app-enter relative mb-2 w-full overflow-hidden shadow-[0_8px_20px_rgba(13,32,23,0.18)]",style:{height:"clamp(240px, 20vw, 620px)"},children:[c.jsx("img",{src:l,alt:f,className:"h-full w-full object-cover",onError:p=>{const m=p.currentTarget;m.src.toLowerCase().endsWith("/assets/sume-2.jpg")||(m.src=a)}}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-black/55 to-black/70"}),i&&s&&c.jsx("button",{type:"button",className:"btn-natural absolute right-3 top-3 z-10 border border-white/80 bg-white/10 px-3 py-1.5 text-xs font-extrabold uppercase text-white backdrop-blur hover:bg-white hover:text-[#1f5a31] sm:right-4 md:right-6",onClick:s,children:"Uredi"}),c.jsxs("div",{className:"absolute inset-0 grid place-content-center px-4 text-center text-white sm:px-6",children:[c.jsx("h2",{className:`m-0 mx-auto mt-1 max-w-[920px] text-2xl font-bold uppercase leading-tight sm:text-3xl lg:text-[2rem] ${o?"notranslate":""}`,translate:o?"no":void 0,children:u}),d&&c.jsx("p",{className:"m-0 mx-auto mt-2 max-w-[760px] text-sm leading-6 opacity-90 md:text-base",children:d})]})]})}function s3({open:t,loginEmail:e,loginPassword:n,loginError:r,onEmailChange:i,onPasswordChange:s,onClose:o,onSubmit:a}){const[l,u]=h.useState(!1);return h.useEffect(()=>{if(t)return Dl()},[t]),h.useEffect(()=>{if(!t)return;const d=f=>{f.key==="Escape"&&o()};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[t,o]),h.useEffect(()=>{t||u(!1)},[t]),t?go.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[300] flex items-center justify-center overflow-hidden p-2 sm:p-4 md:p-8",onClick:o,children:[c.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top,rgba(30,52,39,0.5),rgba(10,16,12,0.85))] backdrop-blur-[2px]"}),c.jsxs("form",{onSubmit:a,role:"dialog","aria-modal":"true","aria-labelledby":"login-modal-title",className:"relative z-[1] max-h-[calc(100dvh-1rem)] w-full min-w-0 max-w-[min(560px,calc(100vw-1rem))] overflow-y-auto rounded-lg border border-white/25 bg-[#2f5f3e] px-4 pb-5 pt-5 text-white shadow-[0_28px_80px_rgba(0,0,0,0.45)] sm:max-h-[calc(100dvh-2rem)] sm:max-w-[min(560px,calc(100vw-2rem))] sm:px-7 sm:pb-8 sm:pt-7 md:max-h-[calc(100dvh-3rem)] md:max-w-[560px] md:px-10 md:pb-10 md:pt-9",onClick:d=>d.stopPropagation(),children:[c.jsx("button",{className:"absolute right-4 top-3 bg-transparent text-4xl font-black leading-none text-white transition-colors duration-200 hover:text-[#b42318]",onClick:o,type:"button","aria-label":"Zatvori prijavu",children:"x"}),c.jsx("h2",{id:"login-modal-title",className:"m-0 break-words text-center text-4xl font-black uppercase leading-none [overflow-wrap:anywhere] md:text-5xl",children:"Prijava"}),c.jsx("p",{className:"m-0 mb-6 mt-2 break-words text-center text-lg font-semibold leading-tight text-[#e8f5ec] [overflow-wrap:anywhere] md:text-xl",children:"za Älanove komore"}),c.jsx("label",{className:"mb-2 block text-base font-semibold md:text-lg",children:"KorisniÄko ime"}
40),c.jsx("input",{value:e,onChange:d=>i(d.target.value),placeholder:"JMBG",className:"mb-5 h-12 w-full rounded-lg border border-white/20 bg-white/95 px-4 text-base font-medium text-[#1f2f24] shadow-inner outline-none transition placeholder:text-[#8f97a8] focus:border-[#c6efd7] focus:ring-4 focus:ring-[#9fd4b8]/35 md:mb-6 md:text-lg"}),c.jsx("label",{className:"mb-2 block text-base font-semibold md:text-lg",children:"Lozinka"}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{value:n,onChange:d=>s(d.target.value),placeholder:"Lozinka",type:l?"text":"password",className:"h-12 w-full rounded-lg border border-white/20 bg-white/95 px-4 pr-12 text-base font-medium text-[#1f2f24] shadow-inner outline-none transition placeholder:text-[#8f97a8] focus:border-[#c6efd7] focus:ring-4 focus:ring-[#9fd4b8]/35 md:px-5 md:pr-14 md:text-lg"}),c.jsx("button",{type:"button",onClick:()=>u(d=>!d),"aria-label":l?"Sakrij lozinku":"Prikazi lozinku",className:"absolute right-3 top-1/2 inline-flex -translate-y-1/2 items-center justify-center rounded-md p-1 text-[#355643] transition hover:bg-[#e8f5ec] hover:text-[#1f4b2e] focus:outline-none focus:ring-2 focus:ring-[#9fd4b8]/60 md:right-4",children:l?c.jsxs("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 md:h-6 md:w-6",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[c.jsx("path",{d:"M3 3l18 18"}),c.jsx("path",{d:"M10.6 10.6A3 3 0 0013.4 13.4"}),c.jsx("path",{d:"M9.9 5.1A10.7 10.7 0 0112 5c5 0 9.3 3.1 11 7-0.5 1.2-1.2 2.3-2.1 3.3"}),c.jsx("path",{d:"M6.1 6.1C4.4 7.4 3 9.1 2 12c1.7 3.9 6 7 10 7 1.3 0 2.6-0.3 3.8-0.8"})]}):c.jsxs("svg",{viewBox:"0 0 24 24",className:"h-5 w-5 md:h-6 md:w-6",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[c.jsx("path",{d:"M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7z"}),c.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),r&&c.jsx("p",{className:"mt-3 rounded-lg border border-[#ffb5b5]/60 bg-[#a52323]/35 px-3 py-2 text-sm font-semibold text-[#ffe3e3]",children:r}),c.jsx("button",{type:"submit",className:"mt-5 inline-flex w-full items-center justify-center rounded-lg bg-white px-6 py-3 text-center text-base font-bold uppercase text-[#1f4b2e] shadow-lg transition-all duration-200 hover:-translate-y-0.5 hover:bg-[#dff2e6] hover:text-[#153823] hover:shadow-[0_14px_28px_rgba(10,32,19,0.34)] focus:outline-none focus:ring-4 focus:ring-[#9fd4b8]/40 md:mt-6 md:py-3.5",children:"Prijavi se"})]})]}),document.body):null}function o3(t){return`${t}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function a3(t,e="article"){return{id:o3(e),blocks:t}}function l3(t,e,n){return t.map(r=>r.id===e?{...r,blocks:n}:r)}function kf(t,e){return t.filter(n=>n.id!==e)}function jf(t){return t.filter(e=>e.blocks.length>0)}function hn(t){this.content=t}hn.prototype={constructor:hn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new hn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new hn(n)},addToStart:function(t,e){return new hn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new hn(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new hn(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=hn.from(t),t.size?new hn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=hn.from(t),t.size?new hn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=hn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};hn.from=function(t){if(t instanceof hn)return t;var e=[];
vendor: 7,617 bytes, line 40
40if(t)for(var n in t)e.push(n,t[n]);return new hn(e)};function iN(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=iN(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function sN(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,d=Math.min(o.text.length,a.text.length);for(;u<d&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=sN(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class he{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new he(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new he(r,i)}cutByIndex(e,n){return e==n?he.empty:e==0&&n==this.content.length?this:new he(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new he(i,s)}addToStart(e){return new he([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new he(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return iN(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return sN(this,e,n,r)}findIndex(e){if(e==0)return Od(0,e);if(e==this.size)return Od(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?Od(n+1,s):Od(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return he.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new he(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return he.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new he(n||e,r)}static from(e){if(!e)return he.empty;if(e instanceof he)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new he([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}he.empty=new he([],0);const Hh={index:0,offset:0};function Od(t,e){return Hh.index=t,Hh.offset=e,Hh}function rp(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!rp(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!rp(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let kt=class Gb{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&rp(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Gb.none;if(e instanceof Gb)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};kt.none=[];class ip extends Error{}class Ae{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=aN(this.content,e+this.openStart,n);return r&&new Ae(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Ae(oN(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Ae.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ae(he.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new Ae(e,r,i)}}Ae.empty=new Ae(he.empty,0,0);function oN(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");
vendor: 5,026 bytes, line 40
40return t.replaceChild(r,s.copy(oN(s.content,e-i-1,n-i-1)))}function aN(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=aN(o.content,e-s-1,n,o);return a&&t.replaceChild(i,o.copy(a))}function c3(t,e,n){if(n.openStart>t.depth)throw new ip("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ip("Inconsistent open depths");return lN(t,e,n,0)}function lN(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=lN(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return qo(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=u3(n,t);return qo(s,uN(t,o,a,e,r))}else return qo(s,sp(t,e,r))}function cN(t,e){if(!e.type.compatibleContent(t.type))throw new ip("Cannot join "+e.type.name+" onto "+t.type.name)}function qb(t,e,n){let r=t.node(n);return cN(r,e.node(n)),r}function Go(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Jc(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Go(t.nodeAfter,r),s++));for(let a=s;a<o;a++)Go(i.child(a),r);e&&e.depth==n&&e.textOffset&&Go(e.nodeBefore,r)}function qo(t,e){return t.type.checkContent(e),t.copy(e)}function uN(t,e,n,r,i){let s=t.depth>i&&qb(t,e,i+1),o=r.depth>i&&qb(n,r,i+1),a=[];return Jc(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(cN(s,o),Go(qo(s,uN(t,e,n,r,i+1)),a)):(s&&Go(qo(s,sp(t,e,i+1)),a),Jc(e,n,i,a),o&&Go(qo(o,sp(n,r,i+1)),a)),Jc(r,null,i,a),new he(a)}function sp(t,e,n){let r=[];if(Jc(null,t,n,r),t.depth>n){let i=qb(t,e,n+1);Go(qo(i,sp(t,e,n+1)),r)}return Jc(e,null,n,r),new he(r)}function u3(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(he.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Eu{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return kt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new op(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(r.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new Eu(n,r,s)}
vendor: 4,385 bytes, line 40
40static resolveCached(e,n){let r=X0.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else X0.set(e,r=new d3);let i=r.elts[r.i]=Eu.resolve(e,n);return r.i=(r.i+1)%f3,i}}class d3{constructor(){this.elts=[],this.i=0}}const f3=12,X0=new WeakMap;class op{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const p3=Object.create(null);let no=class Jb{constructor(e,n,r,i=kt.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||he.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&rp(this.attrs,n||e.defaultAttrs||p3)&&kt.sameSet(this.marks,r||kt.none)}copy(e=null){return e==this.content?this:new Jb(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Jb(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Ae.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new Ae(u,i.depth-o,s.depth-o)}replace(e,n,r){return c3(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Eu.resolveCached(this,e)}resolveNoCache(e){return Eu.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),dN(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=he.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=kt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!kt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}
40`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=he.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};no.prototype.text=void 0;class ap extends no{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):dN(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ap(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ap(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function dN(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class sa{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new m3(e,n);if(r.next==null)return sa.empty;let i=fN(r);r.next&&r.err("Unexpected trailing text");let s=k3(y3(i));return j3(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return he.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:f}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=s(f,a.concat(d));if(p)return p}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(` 41`)}}sa.empty=new sa(!0);class m3{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function fN(t){let e=[];do e.push(h3(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function h3(t){let e=[];do e.push(g3(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function g3(t){let e=v3(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=b3(t,e);else break;return e}function ek(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");
vendor: 4,613 bytes, line 41
41let e=Number(t.next);return t.pos++,e}function b3(t,e){let n=ek(t),r=n;return t.eat(",")&&(t.next!="}"?r=ek(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function x3(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function v3(t){if(t.eat("(")){let e=fN(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=x3(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function y3(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let d=n();i(s(o.expr,l),d),l=d}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let d=n();r(l,d),i(s(o.expr,l),d),l=d}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function pN(t,e){return e-t}function tk(t,e){let n=[];return r(e),n.sort(pN);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function k3(t){let e=Object.create(null);return n(tk(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let d=0;d<i.length;d++)i[d][0]==a&&(u=i[d][1]);tk(t,l).forEach(d=>{u||i.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=e[r.join(",")]=new sa(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(pN);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function j3(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function mN(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function hN(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function gN(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function bN(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new S3(t,r,e[r]);return n}let nk=class xN{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=bN(e,r.attrs),this.defaultAttrs=mN(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==sa.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:hN(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new no(this,this.computeAttrs(e),he.from(n),kt.setFrom(r))}createChecked(e=null,n,r){return n=he.from(n),this.checkContent(n),new no(this,this.computeAttrs(e),n,kt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=he.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(he.empty,!0);
vendor: 9,491 bytes, lines 41-42
41return s?new no(this,e,n.append(s),kt.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){gN(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:kt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new xN(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function w3(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class S3{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?w3(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class km{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=bN(e,i.attrs),this.excluded=null;let s=mN(this.attrs);this.instance=s?new kt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new kt(this,hN(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new km(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){gN(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class vN{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=hn.from(e.nodes),n.marks=hn.from(e.marks||{}),this.nodes=nk.compile(this.spec.nodes,this),this.marks=km.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=sa.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?rk(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:rk(this,o.split(" "))}this.nodeFromJSON=i=>no.fromJSON(this,i),this.markFromJSON=i=>kt.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof nk){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new ap(r,r.defaultAttrs,e,kt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function rk(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function N3(t){return t.tag!=null}function C3(t){return t.style!=null}class ro{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(N3(i))this.tags.push(i);else if(C3(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new sk(this,n,!1);return r.addAll(e,kt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new sk(this,n,!0);return r.addAll(e,kt.none,n.from,n.to),Ae.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(A3(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=ok(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=ok(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ro(e,ro.schemaRules(e)))}}const yN={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},E3={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},kN={ol:!0,ul:!0},Tu=1,Zb=2,Zc=4;function ik(t,e,n){return e!=null?(e?Tu:0)|(e==="full"?Zb:0):t&&t.whitespace=="pre"?Tu|Zb:n&~Zc}class _d{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=kt.none,this.match=s||(o&Zc?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(he.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Tu)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=he.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(he.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!yN.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class sk{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=ik(null,n.preserveWhitespace,0)|(r?Zc:0);i?s=new _d(i.type,i.attrs,kt.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new _d(null,null,kt.none,!0,null,o):s=new _d(e.schema.topNodeType,null,kt.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&Zb?"full":this.localPreserveWS||(i.options&Tu)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,` 42`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;kN.hasOwnProperty(o)&&this.parser.normalizeLists&&T3(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:E3.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,d=this.needsBlock;
vendor: 4,817 bytes, lines 42-43
42if(yN.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),u&&this.sync(s),this.needsBlock=d}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` 43`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+a)&&(i=u,s=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=kt.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):ak(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=ik(e,s,o.options);o.options&Zc&&o.content.length==0&&(a|=Zc);let l=kt.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):ak(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new _d(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Tu)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let d=l>
vendor: 8,229 bytes, line 43
430||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function T3(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&kN.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function A3(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ok(t){let e={};for(let n in t)e[n]=t[n];return e}function ak(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:d}=a.edge(l);if(u==e||s.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class pa{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Vh(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],d=this.serializeMark(u,o.isInline,n);d&&(s.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=wf(Vh(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&wf(Vh(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return wf(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new pa(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=lk(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return lk(e.marks)}}function lk(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Vh(t){return t.document||window.document}const ck=new WeakMap;function M3(t){let e=ck.get(t);return e===void 0&&ck.set(t,e=I3(t)),e}function I3(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function wf(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=M3(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let f in u)if(u[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=d;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:g}=wf(t,p,n,r);if(l.appendChild(m),g){if(a)throw new RangeError("Multiple content holes");a=g}}}return{dom:l,contentDOM:a}}const jN=65535,wN=Math.pow(2,16);function z3(t,e){return t+e*wN}function uk(t){return t&jN}function P3(t){return(t-(t&jN))/wN}const SN=1,NN=2,Sf=4,CN=8;class Yb{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&CN)>0}get deletedBefore(){return(this.delInfo&(SN|Sf))>0}get deletedAfter(){return(this.delInfo&(NN|Sf))>0}get deletedAcross(){return(this.delInfo&Sf)>0}}class pr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&pr.empty)return pr.empty}recover(e){let n=0,r=uk(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+P3(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],d=this.ranges[a+o],f=l+u;if(e<=f){let p=u?e==l?-1:e==f?1:n:n,m=l+i+(p<0?0:d);if(r)return m;let g=e==(n<0?l:f)?null:z3(a/3,e-l),y=e==l?NN:e==f?SN:Sf;return(n<0?e!=l:e!=f)&&(y|=CN),new Yb(m,y,g)}i+=d-u}return r?e+i:new Yb(e+i,0,null)}touches(e,n){let r=0,i=uk(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+s],d=l+u;if(e<=d&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+n],d=this.ranges[i+r];e(a,a+u,l,l+d),s+=d-u}}invert(){return new pr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?pr.empty:new pr(e<0?[0,-e,0]:[0,0,e])}}pr.empty=new pr([]);class Au{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Au(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Au;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Yb(e,i,null)}}const Kh=Object.create(null);class Dn{getMap(){return pr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Kh[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Kh)throw new RangeError("Duplicate use of step JSON ID "+e);return Kh[e]=n,n.prototype.jsonID=e,n}}class Wt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Wt(e,null)}static fail(e){return new Wt(null,e)}static fromReplace(e,n,r,i){try{return Wt.ok(e.replace(n,r,i))}catch(s){if(s instanceof ip)return Wt.fail(s.message);throw s}}}function Dv(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Dv(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return he.fromArray(r)}class Vs extends Dn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.no
vendor: 7,308 bytes, line 43
43de(r.sharedDepth(this.to)),s=new Ae(Dv(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Wt.fromReplace(e,this.from,this.to,s)}invert(){return new ii(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Vs(n.pos,r.pos,this.mark)}merge(e){return e instanceof Vs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Vs(n.from,n.to,e.markFromJSON(n.mark))}}Dn.jsonID("addMark",Vs);class ii extends Dn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Ae(Dv(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Wt.fromReplace(e,this.from,this.to,r)}invert(){return new Vs(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ii(n.pos,r.pos,this.mark)}merge(e){return e instanceof ii&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ii(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ii(n.from,n.to,e.markFromJSON(n.mark))}}Dn.jsonID("removeMark",ii);class Ks extends Dn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Wt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Wt.fromReplace(e,this.pos,this.pos+1,new Ae(he.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ks(this.pos,n.marks[i]);return new Ks(this.pos,this.mark)}}return new oa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ks(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ks(n.pos,e.markFromJSON(n.mark))}}Dn.jsonID("addNodeMark",Ks);class oa extends Dn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Wt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Wt.fromReplace(e,this.pos,this.pos+1,new Ae(he.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ks(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new oa(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new oa(n.pos,e.markFromJSON(n.mark))}}Dn.jsonID("removeNodeMark",oa);class ln extends Dn{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Qb(e,this.from,this.to)?Wt.fail("Structure replace would overwrite content"):Wt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new pr([this.from,this.to-this.from,this.slice.size])}invert(e){return new ln(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ln(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ln)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?Ae.empty:new Ae(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ln(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?Ae.empty:new Ae(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ln(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ln(n.from,n.to,Ae.fromJSON(e,n.slice),!!n.structure)}}Dn.jsonID("replace",ln);class un extends Dn{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Qb(e,this.from,this.gapFrom)||Qb(e,this.gapTo,this.to)))return Wt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Wt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Wt.fromReplace(e,this.from,this.to,r):Wt.fail("Content does not fit in gap")}getMap(){return new pr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new un(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new un(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new un(n.from,n.to,n.gapFrom,n.gapTo,Ae.fromJSON(e,n.slice),n.insert,!!n.structure)}}Dn.jsonID("replaceAround",un);function Qb(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function D3(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,u,d)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let p=Math.max(u,e),m=Math.min(u+l.nodeSize,n),g=r.addToSet(f);for(let y=0;y<f.length;
vendor: 5,393 bytes, lines 43-44
43y++)f[y].isInSet(g)||(o&&o.to==p&&o.mark.eq(f[y])?o.to=m:i.push(o=new ii(p,m,f[y])));a&&a.to==p?a.to=m:s.push(a=new Vs(p,m,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function O3(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof km){let u=o.marks,d;for(;d=r.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let d=0;d<l.length;d++){let f=l[d],p;for(let m=0;m<i.length;m++){let g=i[m];g.step==s-1&&f.eq(i[m].style)&&(p=g)}p?(p.to=u,p.step=s):i.push({style:f,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>t.step(new ii(o.from,o.to,o.style)))}function Ov(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),d=a+u.nodeSize,f=r.matchType(u.type);if(!f)o.push(new ln(a,d,Ae.empty));else{r=f;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||t.step(new ii(a,d,u.marks[p]));if(i&&u.isText&&n.whitespace!="pre"){let p,m=/\r?\n|\r/g,g;for(;p=m.exec(u.text);)g||(g=new Ae(he.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new ln(a+p.index,a+p.index+p[0].length,g))}}a=d}if(!r.validEnd){let l=r.fillBefore(he.empty,!0);t.replace(a,a,new Ae(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function _3(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function _l(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!_3(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function L3(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,u=a,d=he.empty,f=0;for(let g=s,y=!1;g>n;g--)y||r.index(g)>0?(y=!0,d=he.from(r.node(g).copy(d)),f++):l--;let p=he.empty,m=0;for(let g=s,y=!1;g>n;g--)y||i.after(g+1)<i.end(g)?(y=!0,p=he.from(i.node(g).copy(p)),m++):u++;t.step(new un(l,u,o,a,new Ae(d.append(p),f,m),d.size-f,!0))}function _v(t,e,n=null,r=t){let i=R3(t,e),s=i&&$3(r,e);return s?i.map(dk).concat({type:e,attrs:n}).concat(s.map(dk)):null}function dk(t){return{type:t,attrs:null}}function R3(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function $3(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:o}function B3(t,e,n){let r=he.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=he.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new un(i,s,i,s,new Ae(r,0,0),n.length,!0))}function F3(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&U3(t.doc,t.mapping.slice(s).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let m=r.whitespace=="pre",g=!!r.contentMatch.matchType(r.schema.linebreakReplacement);m&&!g?u=!1:!m&&g&&(u=!0)}u===!1&&TN(t,o,a,s),Ov(t,t.mapping.slice(s).map(a,1),r,void 0,u===null);let d=t.mapping.slice(s),f=d.map(a,1),p=d.map(a+o.nodeSize,1);return t.step(new un(f,p,f+1,p-1,new Ae(he.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&EN(t,o,a,s),!1}})}function EN(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function TN(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(` 44`))}})}function U3(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function H3(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new un(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new Ae(he.from(o),0,0),1,!0))}function Xi(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,d=n-2;u>s;u--,d--){let f=i.node(u),p=i.index(u);if(f.type.spec.isolating)return!1;let m=f.content.cutByIndex(p,f.childCount),g=r&&r[d+1];g&&(m=m.replaceChild(0,g.type.create(g.attrs)));let y=r&&r[d]||f;if(!f.canReplace(p+1,f.childCount)||!y.type.validContent(m))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function V3(t,e,n=1,r){let i=t.doc.resolve(e),s=he.empty,o=he.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){s=he.from(i.node(a).copy(s));let d=r&&r[u];
vendor: 11,808 bytes, line 44
44o=he.from(d?d.type.create(d.attrs,o):i.node(a).copy(o))}t.step(new ln(e,e,new Ae(s.append(o),n,n),!0))}function bo(t,e){let n=t.resolve(e),r=n.index();return AN(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function K3(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),o=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function AN(t,e){return!!(t&&e&&!t.isLeaf&&K3(t,e))}function jm(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&AN(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function W3(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,s=t.doc.resolve(e-n),o=s.node().type;if(i&&o.inlineContent){let d=o.whitespace=="pre",f=!!o.contentMatch.matchType(i);d&&!f?r=!1:!d&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);TN(t,d.node(),d.before(),a)}o.inlineContent&&Ov(t,e+n-1,o,s.node().contentMatchAt(s.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new ln(u,l.map(e+n,-1),Ae.empty,!0)),r===!0){let d=t.doc.resolve(u);EN(t,d.node(),d.before(),t.steps.length)}return t}function G3(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function MN(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),d=!1;if(s==1)d=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);d=f&&u.canReplaceWith(l,l,f[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function wm(t,e,n=e,r=Ae.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return IN(i,s,r)?new ln(e,n,r):new q3(i,s,r).fit()}function IN(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class q3{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=he.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=he.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new Ae(s,o,a);return e>-1?new un(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new ln(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Wh(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],d,f=null;if(n==1&&(o?u.matchType(o.type)||(f=u.fillBefore(he.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:f};if(n==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:d};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Wh(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Ae(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Wh(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new Ae(Ac(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new Ae(Ac(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let y=0;y<s.length;y++)this.openFrontierNode(s[y]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,u=0,d=[],{match:f,type:p}=this.frontier[n];if(i){for(let y=0;y<i.childCount;y++)d.push(i.child(y));f=f.matchFragment(i)}let m=a.size+e-(o.content.size-o.openEnd);for(;u<a.childCount;){let y=a.child(u),j=f.matchType(y.type);if(!j)break;u++,(u>1||l==0||y.content.size)&&(f=j,d.push(zN(y.mark(p.allowedMarks(y.marks)),u==1?l:0,u==a.childCount?m:-1)))}let g=u==a.childCount;g||(m=-1),this.placed=Mc(this.placed,n,he.from(d)),this.frontier[n].match=f,g&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,j=a;y<m;y++){let x=j.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),j=x.content}this.unplaced=g?e==0?Ae.empty:new Ae(Ac(o.content,e-1,1),e-1,m<0?o.openEnd:e-1):new Ae(Ac(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Gh(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=Gh(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],d=Gh(e,a,u,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Mc(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Mc(this.placed,this.depth,he.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(he.empty,!0);n.childCount&&(this.placed=Mc(this.placed,this.frontier.length,n))}}function Ac(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ac(t.firstChild.content,e-1,n)))}function Mc(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Mc(t.lastChild.content,e-1,n)))}function Wh(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function zN(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,zN(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(he.empty,!0)))),t.copy(r)}function Gh(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!J3(n,s.content,o)?a:null}function J3(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Z3(t){return t.spec.defining||t.spec.definingForContent}function Y3(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(IN(i,s,r))return t.step(new ln(e,n,r));let o=DN(i,s);o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let p=i.depth,m=i.pos-1;p>0;p--,m--){let g=i.node(p).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(p)>-1?a=p:i.before(p)==m&&o.splice(1,0,-p)}let l=o.indexOf(a),u=[],d=r.openStart;for(let p=r.content,m=0;;m++){let g=p.firstChild;if(u.push(g),m==r.openStart)break;p=g.content}for(let p=d-1;p>=0;p--){let m=u[p],g=Z3(m.type);if(g&&!m.sameMarkup(i.node(Math.abs(a)-1)))d=p;else if(g||!m.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let m=(p+d+1)%(r.openStart+1),g=u[m];if(g)for(let y=0;y<o.length;y++){let j=o[(y+l)%o.length],x=!0;j<0&&(x=!1,j=-j);let k=i.node(j-1),N=i.index(j-1);if(k.canReplaceWith(N,N,g.type,g.marks))return t.replace(i.before(j),x?s.after(j):n,new Ae(PN(r.content,0,r.openStart,m),m,r.openEnd))}}let f=t.steps.length;for(let p=o.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>f));p--){let m=o[p];m<0||(e=i.before(m),n=s.after(m))}}function PN(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(PN(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(he.empty,!0))}return t}function Q3(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=G3(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Ae(he.from(r),0,0))}function X3(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=DN(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function DN(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class cl extends Dn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Wt.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Wt.fromReplace(e,this.pos,this.pos+1,new Ae(he.from(i),0,n.isLeaf?0:1))}getMap(){return pr.empty}invert(e){return new cl(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new cl(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new cl(n.pos,n.attr,n.value)}}Dn.jsonID("attr",cl);class Mu extends Dn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Wt.ok(r)}getMap(){return pr.empty}invert(e){return new Mu(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Mu(n.attr,n.value)}}Dn.jsonID("docAttr",Mu);
vendor: 4,285 bytes, line 44
44let xl=class extends Error{};xl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};xl.prototype=Object.create(Error.prototype);xl.prototype.constructor=xl;xl.prototype.name="TransformError";class ON{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Au}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new xl(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(e=i.map(e,1),n=i.map(n,-1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Ae.empty){let i=wm(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Ae(he.from(r),0,0))}delete(e,n){return this.replace(e,n,Ae.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Y3(this,e,n,r),this}replaceRangeWith(e,n,r){return Q3(this,e,n,r),this}deleteRange(e,n){return X3(this,e,n),this}lift(e,n){return L3(this,e,n),this}join(e,n=1){return W3(this,e,n),this}wrap(e,n){return B3(this,e,n),this}setBlockType(e,n=e,r,i=null){return F3(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return H3(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new cl(e,n,r)),this}setDocAttribute(e,n){return this.step(new Mu(e,n)),this}addNodeMark(e,n){return this.step(new Ks(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof kt)n.isInSet(r.marks)&&this.step(new oa(e,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new oa(e,s)),i=s.removeFromSet(i);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return V3(this,e,n,r),this}addMark(e,n,r){return D3(this,e,n,r),this}removeMark(e,n,r){return O3(this,e,n,r),this}clearIncompatible(e,n,r){return Ov(this,e,n,r),this}}const qh=Object.create(null);class rt{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new eI(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=Ae.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:u}=o[a],d=e.mapping.slice(s);e.replaceRange(d.map(l.pos),d.map(u.pos),a?Ae.empty:n),a==0&&mk(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),u=l.map(o.pos),d=l.map(a.pos);s?e.deleteRange(u,d):(e.replaceRangeWith(u,d,n),mk(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new Ze(e):Oa(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?Oa(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Oa(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new br(e.node(0))}static atStart(e){return Oa(e,e,0,0,1)||new br(e)}static atEnd(e){return Oa(e,e,e.content.size,e.childCount,-1)||new br(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=qh[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in qh)throw new RangeError("Duplicate use of selection JSON ID "+e);return qh[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ze.between(this.$anchor,this.$head).getBookmark()}}rt.prototype.visible=!0;class eI{constructor(e,n){this.$from=e,this.$to=n}}let fk=!1;function pk(t){!fk&&!t.parent.inlineContent&&(fk=!0,console.warn("TextSelection endpoint not pointing into a
44node with inline content ("+t.parent.type.name+")"))}class Ze extends rt{constructor(e,n=e){pk(e),pk(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return rt.near(r);let i=e.resolve(n.map(this.anchor));return new Ze(i.parent.inlineContent?i:r,r)}replace(e,n=Ae.empty){if(super.replace(e,n),n==Ae.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ze&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Sm(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ze(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=rt.findFrom(n,r,!0)||rt.findFrom(n,-r,!0);if(s)n=s.$head;else return rt.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(rt.findFrom(e,-r,!0)||rt.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Ze(e,n)}}rt.jsonID("text",Ze);class Sm{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Sm(e.map(this.anchor),e.map(this.head))}resolve(e){return Ze.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ue extends rt{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?rt.near(s):new Ue(s)}content(){return new Ae(he.from(this.node),0,0)}eq(e){return e instanceof Ue&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Lv(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ue(e.resolve(n.anchor))}static create(e,n){return new Ue(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Ue.prototype.visible=!1;rt.jsonID("node",Ue);class Lv{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Sm(r,r):new Lv(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ue.isSelectable(r)?new Ue(n):rt.near(n)}}class br extends rt{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Ae.empty){if(n==Ae.empty){e.delete(0,e.doc.content.size);let r=rt.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new br(e)}map(e){return new br(e)}eq(e){return e instanceof br}getBookmark(){return tI}}rt.jsonID("all",br);const tI={map(){return this},resolve(t){return new br(t)}};function Oa(t,e,n,r,i,s=!1){if(e.inlineContent)return Ze.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&Ue.isSelectable(a))return Ue.create(t,n-(i<0?a.nodeSize:0))}else{let l=Oa(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function mk(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof ln||i instanceof un))return;let s=t.mapping.maps[r],o;s.forEach((a,l,u,d)=>{o==null&&(o=d)}),t.setSelection(rt.near(t.doc.resolve(o),n))}const hk=1,Ld=2,gk=4;class nI extends ON{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|hk)&~Ld,this.storedMarks=null,this}get selectionSet(){return(this.updated&hk)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ld,this}ensureMarks(e){return kt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ld)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ld,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||kt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(rt.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=gk,this}get scrolledIntoView(){return(this.updated&gk)>0}}function bk(t,e){return!e||!t?t:t.bind(e)}class Ic{constructor(e,n,r){this.name=e,this.init=bk(n.init,r),this.apply=bk(n.apply,r)}}const rI=[new Ic("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ic("selection",{init(t,e){return t.selection||rt.atStart(e.doc)},apply(t){return t.selection}}),new Ic("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ic("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Jh{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rI.slice(),n&&n.forEac
vendor: 4,971 bytes, line 44
44h(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ic(r.key,r.spec.state,r))})}}class Qa{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,r);if(d&&r.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<o?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Qa(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new nI(this)}static create(e){let n=new Jh(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Qa(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Jh(this.schema,e.plugins),r=n.fields,i=new Qa(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Jh(e.schema,e.plugins),s=new Qa(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=no.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=rt.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=u.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function _N(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=_N(i,e,{})),n[r]=i}return n}class Ot{constructor(e){this.spec=e,this.props={},e.props&&_N(e.props,this,this.props),this.key=e.key?e.key.key:LN("plugin")}getState(e){return e[this.key]}}const Zh=Object.create(null);function LN(t){return t in Zh?t+"$"+ ++Zh[t]:(Zh[t]=0,t+"$")}class Xt{constructor(e="key"){this.key=LN(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Rv=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function RN(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const $N=(t,e,n)=>{let r=RN(t,n);if(!r)return!1;let i=$v(r);if(!i){let o=r.blockRange(),a=o&&_l(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(qN(t,i,e,-1))return!0;if(r.parent.content.size==0&&(vl(s,"end")||Ue.isSelectable(s)))for(let o=r.depth;;o--){let a=wm(t.doc,r.before(o),r.after(o),Ae.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(vl(s,"end")?rt.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):Ue.create(l.doc,i.pos-s.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},iI=(t,e,n)=>{let r=RN(t,n);if(!r)return!1;let i=$v(r);return i?BN(t,i,e):!1},sI=(t,e,n)=>{let r=UN(t,n);if(!r)return!1;let i=Bv(r);return i?BN(t,i,e):!1};function BN(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let u=wm(t.doc,s,l,Ae.empty);if(!u||u.from!=s||u instanceof ln&&u.slice.size>=l-s)return!1;if(n){let d=t.tr.step(u);d.setSelection(Ze.create(d.doc,s)),n(d.scrollIntoView())}return!0}function vl(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
vendor: 12,165 bytes, lines 44-45
44if(n&&r.childCount!=1)return!1}return!1}const FN=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=$v(r)}let o=s&&s.nodeBefore;return!o||!Ue.isSelectable(o)?!1:(e&&e(t.tr.setSelection(Ue.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function $v(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function UN(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const HN=(t,e,n)=>{let r=UN(t,n);if(!r)return!1;let i=Bv(r);if(!i)return!1;let s=i.nodeAfter;if(qN(t,i,e,1))return!0;if(r.parent.content.size==0&&(vl(s,"start")||Ue.isSelectable(s))){let o=wm(t.doc,r.before(),r.after(),Ae.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(vl(s,"start")?rt.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):Ue.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},VN=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=Bv(r)}let o=s&&s.nodeAfter;return!o||!Ue.isSelectable(o)?!1:(e&&e(t.tr.setSelection(Ue.create(t.doc,s.pos)).scrollIntoView()),!0)};function Bv(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const oI=(t,e)=>{let n=t.selection,r=n instanceof Ue,i;if(r){if(n.node.isTextblock||!bo(t.doc,n.from))return!1;i=n.from}else if(i=jm(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(Ue.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},aI=(t,e)=>{let n=t.selection,r;if(n instanceof Ue){if(n.node.isTextblock||!bo(t.doc,n.to))return!1;r=n.to}else if(r=jm(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},lI=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&_l(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},KN=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` 45`).scrollIntoView()),!0)};function Fv(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const cI=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=Fv(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(rt.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},WN=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof br||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Fv(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(Ze.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},GN=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Xi(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&_l(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function uI(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Ue&&e.selection.node.isBlock)return!r.parentOffset||!Xi(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,a,l=!1,u=!1;for(let m=r.depth;;m--)if(r.node(m).isBlock){l=r.end(m)==r.pos+(r.depth-m),u=r.start(m)==r.pos-(r.depth-m),a=Fv(r.node(m-1).contentMatchAt(r.indexAfter(m-1))),s.unshift(l&&a?{type:a}:null),o=m;break}else{if(m==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof Ze||e.selection instanceof br)&&d.deleteSelection();let f=d.mapping.map(r.pos),p=Xi(d.doc,f,s.length,s);if(p||(s[0]=a?{type:a}:null,p=Xi(d.doc,f,s.length,s)),!p)return!1;if(d.split(f,s.length,s),!l&&u&&r.node(o).type!=a){let m=d.mapping.map(r.before(o)),g=d.doc.resolve(m);a&&r.node(o-1).canReplaceWith(g.index(),g.index()+1,a)&&d.setNodeMarkup(d.mapping.map(r.before(o)),a)}return n&&n(d.scrollIntoView()),!0}}const dI=uI(),fI=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(Ue.create(t.doc,i))),!0)};function pI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||bo(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function qN(t,e,n,r){let i=e.nodeBefore,s=e.nodeAfter,o,a,l=i.type.spec.isolating||s.type.spec.isolating;if(!l&&pI(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&a.matchType(o[0]||s.type).validEnd){if(n){let m=e.pos+s.nodeSize,g=he.empty;for(let x=o.length-1;x>=0;x--)g=he.from(o[x].create(null,g));g=he.from(i.copy(g));let y=t.tr.step(new un(e.pos-1,m,e.pos,m,new Ae(g,1,0),o.length,!0)),j=y.doc.resolve(m+2*o.length);j.nodeAfter&&j.nodeAfter.type==i.type&&bo(y.doc,j.pos)&&y.join(j.pos),n(y.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&l?null:rt.findFrom(e,1),f=d&&d.$from.blockRange(d.$to),p=f&&_l(f);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(f,p).scrollIntoView()),!0;if(u&&vl(s,"start",!0)&&vl(i,"end")){let m=i,g=[];for(;g.push(m),!m.isTextblock;)m=m.lastChild;let y=s,j=1;for(;!y.isTextblock;y=y.firstChild)j++;if(m.canReplace(m.childCount,m.childCount,y.content)){if(n){let x=he.empty;for(let N=g.length-1;N>=0;N--)x=he.from(g[N].copy(x));let k=t.tr.step(new un(e.pos-g.length,e.pos+s.nodeSize,e.pos+j,e.pos+s.nodeSize-j,new Ae(x,g.length,0),0,!0));n(k.scrollIntoView())}return!0}}return!1}function JN(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(Ze.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const mI=JN(-1),hI=JN(1);function gI(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&_v(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function xk(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let d=n.doc.resolve(u),f=d.index();i=d.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}function Uv(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}Uv(Rv,$N,FN);Uv(Rv,HN,VN);Uv(KN,WN,GN,dI);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function bI(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let a=r?n.tr:null;return xI(a,o,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function xI(t,e,n,r=null){let i=!1,s=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);s=new op(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new op(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let a=_v(s,n,r,e);return a?(t&&vI(t,e,a,i,n),!0):!1}function vI(t,e,n,r,i){let s=he.empty;for(let d=n.length-1;d>=0;d--)s=he.from(n[d].type.create(n[d].attrs,s));t.step(new un(e.start-(r?2:0),e.end,e.start,e.end,new Ae(s,0,0),n.length,!0));let o=0;for(let d=0;d<n.length;d++)n[d].type==i&&(o=d+1);let a=n.length-o,l=e.start+n.length-(r?2:0),u=e.parent;for(let d=e.startIndex,f=e.endIndex,p=!0;d<f;d++,p=!1)!p&&Xi(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=u.child(d).nodeSize;return t}function yI(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?kI(e,n,t,s):jI(e,n,s):!0:!1}}function kI(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new un(s-1,o,s,o,new Ae(he.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new op(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=_l(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return bo(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function jI(t,e,n){let r=t.tr,i=n.parent;for(let m=n.end,g=n.endIndex-1,y=n.startIndex;g>y;g--)m-=i.child(g).nodeSize,r.delete(m-1,m+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(a?0:1),d+1,o.content.append(l?he.empty:he.from(i))))return!1;let f=s.pos,p=f+o.nodeSize;return r.step(new un(f-(a?1:0),p+(l?1:0),f+1,p-1,new Ae((a?he.empty:he.from(i.copy(he.empty))).append(l?he.empty:he.from(i.copy(he.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function wI(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,d=he.from(u?t.create():null),f=new Ae(he.from(t.create(null,he.from(a.type.create(null,d)))),u?3:1,0),p=s.start,m=s.end;n(e.tr.step(new un(p-(u?3:1),m,p,m,f,1,!0)).scrollIntoView())}return!0}}const bn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},yl=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Xb=null;const Wi=function(t,e,n){let r=Xb||(Xb=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},SI=function(){Xb=null},aa=function(t,e,n,r){return n&&(vk(t,e,n,r,-1)||vk(t,e,n,r,1))},NI=/^(img|br|input|textarea|hr)$/i;function vk(t,e,n,r,i){for(var s;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Or(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Ku(t)||NI.test(t.nodeName)||t.contentEditable=="false")return!1;e=bn(t)+(i<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=i;else return!1;else t=o,e=i<0?Or(t):0}else return!1}}function Or(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function CI(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Or(t)}else if(t.parentNode&&!Ku(t))e=bn(t),t=t.parentNode;else return null}}function EI(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Ku(t))e=bn(t)+1,t=t.parentNode;else return null}}function TI(t,e,n){for(let r=e==0,i=e==Or(t);r||i;){if(t==n)return!0;let s=bn(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Or(t)}}function Ku(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Nm=function(t){return t.focusNode&&aa(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Do(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function AI(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function MI(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);
vendor: 5,031 bytes, line 45
45if(r)return{node:r.offsetNode,offset:Math.min(Or(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Or(r.startContainer),r.startOffset)}}}const Ai=typeof navigator<"u"?navigator:null,yk=typeof document<"u"?document:null,xo=Ai&&Ai.userAgent||"",ex=/Edge\/(\d+)/.exec(xo),ZN=/MSIE \d/.exec(xo),tx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xo),sr=!!(ZN||tx||ex),io=ZN?document.documentMode:tx?+tx[1]:ex?+ex[1]:0,Rr=!sr&&/gecko\/(\d+)/i.test(xo);Rr&&+(/Firefox\/(\d+)/.exec(xo)||[0,0])[1];const nx=!sr&&/Chrome\/(\d+)/.exec(xo),vn=!!nx,YN=nx?+nx[1]:0,Pn=!sr&&!!Ai&&/Apple Computer/.test(Ai.vendor),kl=Pn&&(/Mobile\/\w+/.test(xo)||!!Ai&&Ai.maxTouchPoints>2),Ir=kl||(Ai?/Mac/.test(Ai.platform):!1),QN=Ai?/Win/.test(Ai.platform):!1,Yi=/Android \d/.test(xo),Wu=!!yk&&"webkitFontSmoothing"in yk.documentElement.style,II=Wu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function zI(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Fi(t,e){return typeof t=="number"?t:t[e]}function PI(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function kk(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=yl(o);continue}let a=o,l=a==s.body,u=l?zI(s):PI(a),d=0,f=0;if(e.top<u.top+Fi(r,"top")?f=-(u.top-e.top+Fi(i,"top")):e.bottom>u.bottom-Fi(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+Fi(i,"top")-u.top:e.bottom-u.bottom+Fi(i,"bottom")),e.left<u.left+Fi(r,"left")?d=-(u.left-e.left+Fi(i,"left")):e.right>u.right-Fi(r,"right")&&(d=e.right-u.right+Fi(i,"right")),d||f)if(l)s.defaultView.scrollBy(d,f);else{let m=a.scrollLeft,g=a.scrollTop;f&&(a.scrollTop+=f),d&&(a.scrollLeft+=d);let y=a.scrollLeft-m,j=a.scrollTop-g;e={left:e.left-y,top:e.top-j,right:e.right-y,bottom:e.bottom-j}}let p=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(p))break;o=p=="absolute"?o.offsetParent:yl(o)}}function DI(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:XN(t.dom)}}function XN(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=yl(r));return e}function OI({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;e2(n,r==0?0:r-e)}function e2(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Ma=null;function _I(t){if(t.setActive)return t.setActive();if(Ma)return t.focus(Ma);let e=XN(t);t.focus(Ma==null?{get preventScroll(){return Ma={preventScroll:!0},!0}}:void 0),Ma||(Ma=!1,e2(e,0))}function t2(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,u;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=Wi(d).getClientRects();else continue;for(let m=0;m<p.length;m++){let g=p[m];if(g.top<=o&&g.bottom>=a){o=Math.max(g.bottom,o),a=Math.min(g.top,a);let y=g.left>e.left?g.left-e.left:g.right<e.left?e.left-g.right:0;if(y<r){n=d,r=y,i=y&&n.nodeType==3?{left:g.right<e.left?g.right:g.left,top:e.top}:e,d.nodeType==1&&y&&(s=f+(e.left>=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!l&&g.left<=e.left&&g.right>=e.left&&(l=d,u={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!n&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(s=f+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?LI(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:t2(n,i)}function LI(t,e){let n=t.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let o=Is(r,1);if(o.top!=o.bottom&&Hv(e,o)){i={node:t,offset:s+(e.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:t,offset:0}}function Hv(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function RI(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function $I(t,e,n){let{node:r,offset:i}=t2(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function BI(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>
vendor: 10,470 bytes, lines 45-46
45r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function n2(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(Hv(e,u))return n2(o,e,u)}}if((s=(s+1)%r)==i)break}return t}function FI(t,e){let n=t.dom.ownerDocument,r,i=0,s=MI(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!Hv(e,u)||(o=n2(t.dom,e,u),!o))return null}if(Pn)for(let u=o;r&&u;u=yl(u))u.draggable&&(r=void 0);if(o=RI(o,e),r){if(Rr&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let u;Wu&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=BI(t,r,i,e))}a==null&&(a=$I(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function jk(t){return t.top<t.bottom||t.left<t.right}function Is(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(jk(r))return r}return Array.prototype.find.call(n,jk)||t.getBoundingClientRect()}const UI=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function r2(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Wu||Rr;if(r.nodeType==3)if(o&&(UI.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=Is(Wi(r,i,i),n);if(Rr&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=Is(Wi(r,i-1,i-1),-1);if(u.top==l.top){let d=Is(Wi(r,i,i+1),-1);if(d.top!=l.top)return bc(d,d.left<u.left)}}return l}else{let l=i,u=i,d=n<0?1:-1;return n<0&&!i?(u++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:u++,bc(Is(Wi(r,l,u),d),d<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Or(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Yh(l.getBoundingClientRect(),!1)}if(s==null&&i<Or(r)){let l=r.childNodes[i];if(l.nodeType==1)return Yh(l.getBoundingClientRect(),!0)}return Yh(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Or(r))){let l=r.childNodes[i-1],u=l.nodeType==3?Wi(l,Or(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return bc(Is(u,1),!1)}if(s==null&&i<Or(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?Wi(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return bc(Is(u,-1),!0)}return bc(Is(r.nodeType==3?Wi(r):r,-n),n>=0)}function bc(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Yh(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function i2(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function HI(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return i2(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=r2(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Wi(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let d=l[u];if(d.bottom>d.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const VI=/[\u0590-\u08ac]/;function KI(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return a?!VI.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:i2(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let m=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:g,focusOffset:y}=t.domSelectionRange(),j=g&&!m.contains(g.nodeType==1?g:g.parentNode)||l==g&&u==y;try{a.collapse(d,f),l&&(l!=d||u!=f)&&a.extend&&a.extend(l,u)}catch{}return p!=null&&(a.caretBidiLevel=p),j}):r.pos==r.start()||r.pos==r.end()}let wk=null,Sk=null,Nk=!1;function WI(t,e,n){return wk==e&&Sk==n?Nk:(wk=e,Sk=n,Nk=n=="up"||n=="down"?HI(t,e,n):KI(t,e,n))}const $r=0,Ck=1,$o=2,Mi=3;class Gu{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=$r,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>bn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let a=i.children[o];if(a.size){i=a;break}}return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof o2){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof s2&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?bn(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?bn(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],u=o+l.size;if(i==-1&&e<=u){let d=o+l.border;if(e>=d&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let f=a;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=bn(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let d=a+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=bn(f.dom);break}n+=f.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let m=0,g=0;m<this.children.length;m++){let y=this.children[m],j=g+y.size;if(s>g&&o<j)return y.setSelection(e-g-y.border,n-g-y.border,r,i);g=j}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),d=r.domSelectionRange(),f=!1;if((Rr||Pn)&&e==n){let{node:m,offset:g}=a;if(m.nodeType==3){if(f=!!(g&&m.nodeValue[g-1]==` 46`),f&&g==m.nodeValue.length)for(let y=m,j;y;y=y.parentNode){if(j=y.nextSibling){j.nodeName=="BR"&&(a=l={node:j.parentNode,offset:bn(j)+1});break}let x=y.pmViewDesc;if(x&&x.node&&x.node.isBlock)break}}else{let y=m.childNodes[g-1];f=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(Rr&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let m=d.focusNode.childNodes[d.focusOffset];m&&m.contentEditable=="false"&&(i=!0)}if(!(i||f&&Pn)&&aa(a.node,a.offset,d.anchorNode,d.anchorOffset)&&aa(l.n
vendor: 4,114 bytes, line 46
46ode,l.offset,d.focusNode,d.focusOffset))return;let p=!1;if((u.extend||e==n)&&!(f&&Rr)){u.collapse(a.node,a.offset);try{e!=n&&u.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>n){let g=a;a=l,l=g}let m=document.createRange();m.setEnd(l.node,l.offset),m.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?$o:Ck,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Mi:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?$o:Mi}r=o}this.dirty=$o}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?$o:Ck;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class s2 extends Gu{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==$r&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class GI extends Gu{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class la extends Gu{constructor(e,n,r,i,s){super(e,[],r,i),this.mark=n,this.spec=s}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=pa.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new la(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Mi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Mi&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=$r){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=$r}}slice(e,n,r){let i=la.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=ix(s,n,o,r)),e>0&&(s=ix(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class so extends Gu{constructor(e,n,r,i,s,o,a,l,u){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,u=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:f}=pa.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let p=d;return d=c2(d,r,n),u?l=new qI(e,n,r,i,d,f||null,p,u,s,o+1):n.isText?new Cm(e,n,r,i,d,p,s):new so(e,n,r,i,d,f||null,p,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;
vendor: 6,801 bytes, line 46
46let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>he.empty)}return e}matchesNode(e,n,r){return this.dirty==$r&&e.eq(this.node)&&lp(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new ZI(this,o&&o.node,e);XI(this.node,this.innerDeco,(u,d,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e,d):u.type.side>=0&&!f&&l.syncToMarks(d==this.node.childCount?kt.none:this.node.child(d).marks,r,e,d),l.placeWidget(u,e,i)},(u,d,f,p)=>{l.syncToMarks(u.marks,r,e,p);let m;l.findNodeMatch(u,d,f,p)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(m=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(u,d,f,m,e)||l.updateNextNode(u,d,f,e,p,i)||l.addNode(u,d,f,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==$o)&&(o&&this.protectLocalComposition(e,o),a2(this.contentDOM,this.children,e),kl&&ez(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Ze)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=tz(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new GI(this,s,n,i);e.input.compositionNodes.push(o),this.children=ix(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==Mi||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=$r}updateOuterDeco(e){if(lp(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=l2(this.dom,this.nodeDOM,rx(this.outerDeco,this.node,n),rx(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Ek(t,e,n,r,i){c2(r,e,t);let s=new so(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Cm extends so{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Mi||this.dirty!=$r&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=$r||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=$r,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Cm(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Mi)}get domAtom(){return!1}isText(e){return this.node.text==e}}class o2 extends Gu{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$r&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class qI extends so{constructor(e,n,r,i,s,o,a,l,u,d){super(e,n,r,i,s,o,a,u,d),this.spec=l}update(e,n,r,i){if(this.dirty==Mi)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function a2(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=Tk(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof la){let l=r?r.previousSibling:t.lastChild;a2(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Tk(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Yc=function(t){t&&(this.nodeName=t)};Yc.prototype=Object.create(null);const Bo=[new Yc];function rx(t,e,n){if(t.length==0)return Bo;let r=n?Bo[0]:new Yc,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Yc(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Yc(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function l2(t,e,n,r){if(n==Bo&&r==Bo)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Bo[0]),i=l}JI(i,a||Bo[0],o)}return i}function JI(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);
vendor: 6,138 bytes, line 46
46if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function c2(t,e,n){return l2(t,t,Bo,rx(e,n,t.nodeType!=1))}function lp(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Tk(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class ZI{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=YI(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,i){let s=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;s<a&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=$r,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let d=this.index;d<u;d++){let f=this.top.children[d];if(f.matchesMark(e[o])&&!this.isLocked(f.dom)){l=d;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=la.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,n,r)&&!this.preMatch.matched.has(u)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==Mi&&o.dom==o.contentDOM&&(o.dirty=$o),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof so){let u=this.preMatch.matched.get(l);if(u!=null&&u!=s)return!1;let d=l.dom,f,p=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Mi&&lp(n,l.outerDeco));if(!p&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(l,e,n,r,i,o)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=$o,f.updateChildren(i,o+1),f.dirty=$r),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!lp(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=so.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=so.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new s2(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof la;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Cm)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Pn||vn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new o2(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function YI(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof la)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function QI(t,e){return t.type.side-e.type.side}function XI(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let u=0;u<t.childCount;u++){let d=t.child(u);r(d,i,e.forChild(s,d),u),s+=d.nodeSize}return}let o=0,a=[],l=null;for(let u=0;;){let d,f;for(;o<i.length&&i[o].to==s;){let j=i[o++];j.widget&&(d?(f||(f=[d])).push(j):d=j)}if(d)if(f){f.sort(QI);for(let j=0;j<f.length;j++)n(f[j],u,!!l)}else n(d,u,!!l);let p,m;if(l)m=-1,p=l,l=null;else if(u<t.childCount)m=u,p=t.child(u++);else break;for(let j=0;j<a.length;j++)a[j].to<=s&&a.splice(j--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let g=s+p.nodeSize;if(p.isText){let j=g;o<i.length&&i[o].from<j&&(j=i[o].from);for(let x=0;x<a.length;x++)a[x].to<j&&(j=a[x].to);j<g&&(l=p.cut(j-s),p=p.cut(0,j-s),g=j,m=-1)}else for(;o<i.length&&i[o].to<g;)o++;let y=p.isInline&&!p.isLeaf?a.filter(j=>
vendor: 8,955 bytes, line 46
46!j.inline):a.slice();r(p,y,e.forChild(s,p),m),s=g}}function ez(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function tz(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let u=t.child(i++);if(s+=u.nodeSize,!u.isText)break;l+=u.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a<r?l.lastIndexOf(e,r-a-1):-1;if(u>=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function ix(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],u=a,d=a+=l.size;u>=n||d<=e?s.push(l):(u<e&&s.push(l.slice(0,e-u,r)),i&&(s.push(i),i=void 0),d>n&&s.push(l.slice(n-u,l.size,r)))}return s}function Vv(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(Nm(n)){for(l=o;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&Ue.isSelectable(f)&&i.parent&&!(f.isInline&&TI(n.focusNode,n.focusOffset,i.dom))){let p=i.posBefore;u=new Ue(o==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=o,p=o;for(let m=0;m<n.rangeCount;m++){let g=n.getRangeAt(m);f=Math.min(f,t.docView.posFromDOM(g.startContainer,g.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(f<0)return null;[l,o]=p==t.state.selection.anchor?[p,f]:[f,p],a=r.resolve(o)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!u){let f=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;u=Kv(t,d,a,f)}return u}function u2(t){return t.editable?t.hasFocus():f2(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function es(t,e=!1){let n=t.state.selection;if(d2(t,n),!!u2(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&vn){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&aa(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)rz(t);else{let{anchor:r,head:i}=n,s,o;Ak&&!(n instanceof Ze)&&(n.$from.parent.inlineContent||(s=Mk(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Mk(t,n.to))),t.docView.setSelection(r,i,t,e),Ak&&(s&&Ik(s),o&&Ik(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&nz(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Ak=Pn||vn&&YN<63;function Mk(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Pn&&i&&i.contentEditable=="false")return Qh(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Qh(i);if(s)return Qh(s)}}function Qh(t){return t.contentEditable="true",Pn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Ik(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function nz(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!u2(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function rz(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,bn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&sr&&io<=11&&(n.disabled=!0,n.disabled=!1)}function d2(t,e){if(e instanceof Ue){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(zk(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else zk(t)}function zk(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Kv(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||Ze.between(e,n,r)}function Pk(t){return t.editable&&!t.hasFocus()?!1:f2(t)}function f2(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function iz(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return aa(e.node,e.offset,n.anchorNode,n.anchorOffset)}function sx(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&rt.findFrom(s,e)}function Os(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Dk(t,e,n){let r=t.state.selection;if(r instanceof Ze)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Os(t,new Ze(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=sx(t.state,e);return i&&i instanceof Ue?Os(t,i):!1}else if(!(Ir&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?Ue.isSelectable(s)?Os(t,new Ue(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Wu?Os(t,new Ze(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ue&&r.node.isInline)return Os(t,new Ze(e>0?r.$to:r.$from));{let i=sx(t.state,e);return i?Os(t,i):!1}}}function cp(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Qc(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ia(t,e){return e<0?sz(t):oz(t)}function sz(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(Rr&&n.nodeType==1&&r<cp(n)&&Qc(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Qc(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(p2(n))break;{let a=n.previousSibling;for(;a&&Qc(a,-1);)i=n.parentNode,s=bn(a),a=a.previousSibling;if(a)n=a,r=cp(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?ox(t,n,r):i&&ox(t,i,s)}function oz(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=cp(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Qc(a,1))s=n,o=++r;else break}else{if(p2(n))break;{let a=n.nextSibling;for(;a&&Qc(a,1);)s=a.parentNode,o=bn(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=cp(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&ox(t,s,o)}function p2(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function az(t,e){for(;t&&e==t.childNodes.length&&!Ku(t);)e=bn(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function lz(t,e){for(;t&&!e&&!Ku(t);)e=bn(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function ox(t,e,n){if(e.nodeType!=3){let s,o;(o=az(e,n))?(e=o,n=0):(s=lz(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Nm(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&es(t)},50)}function Ok(t,e){let n=t.state.doc.resolve(e);if(!(vn||QN)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function _k(t,e,n){let r=t.state.selection;if(r instanceof Ze&&!r.empty||n.indexOf("s")>-1||Ir&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=sx(t.state,e);if(o&&o instanceof Ue)return Os(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof br?rt.near(o,e):rt.findFrom(o,e);return a?Os(t,a):!1}return!1}function Lk(t,e){if(!(t.state.selection instanceof Ze))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;
vendor: 4,420 bytes, lines 46-49
46if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function Rk(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function cz(t){if(!Pn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Rk(t,r,"true"),setTimeout(()=>Rk(t,r,"false"),20)}return!1}function uz(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function dz(t,e){let n=e.keyCode,r=uz(e);if(n==8||Ir&&n==72&&r=="c")return Lk(t,-1)||Ia(t,-1);if(n==46&&!e.shiftKey||Ir&&n==68&&r=="c")return Lk(t,1)||Ia(t,1);if(n==13||n==27)return!0;if(n==37||Ir&&n==66&&r=="c"){let i=n==37?Ok(t,t.state.selection.from)=="ltr"?-1:1:-1;return Dk(t,i,r)||Ia(t,i)}else if(n==39||Ir&&n==70&&r=="c"){let i=n==39?Ok(t,t.state.selection.from)=="ltr"?1:-1:1;return Dk(t,i,r)||Ia(t,i)}else{if(n==38||Ir&&n==80&&r=="c")return _k(t,-1,r)||Ia(t,-1);if(n==40||Ir&&n==78&&r=="c")return cz(t)||_k(t,1,r)||Ia(t,1);if(r==(Ir?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Wv(t,e){t.someProp("transformCopied",m=>{e=m(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let m=r.firstChild;n.push(m.type.name,m.attrs!=m.type.defaultAttrs?m.attrs:null),r=m.content}let o=t.someProp("clipboardSerializer")||pa.fromSchema(t.state.schema),a=v2(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,d,f=0;for(;u&&u.nodeType==1&&(d=x2[u.nodeName.toLowerCase()]);){for(let m=d.length-1;m>=0;m--){let g=a.createElement(d[m]);for(;l.firstChild;)g.appendChild(l.firstChild);l.appendChild(g),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${f?` -${f}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",m=>m(e,t))||e.content.textBetween(0,e.content.size,` 47 48`);return{dom:l,text:p,slice:e}}function m2(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,s||r,t)}),s)return a=new Ae(he.from(t.state.schema.text(e.replace(/\r\n?/g,` 49`))),0,0),t.someProp("transformPasted",p=>{a=p(a,t,!0)}),a;let f=t.someProp("clipboardTextParser",p=>p(e,i,r,t));if(f)a=f;else{let p=i.marks(),{schema:m}=t.state,g=pa.fromSchema(m);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let j=o.appendChild(document.createElement("p"));y&&j.appendChild(g.serializeNode(m.text(y,p)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),o=hz(n),Wu&&gz(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let f=+d[3];f>0;f--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||ro.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!fz.test(p.parentNode.nodeName)?{ignore:!0}:null}})),d)a=bz($k(a,+d[1],+d[2]),d[4]);else if(a=Ae.maxOpen(pz(a.content,i),!0),a.openStart||a.openEnd){let f=0,p=0;for(let m=a.content.firstChild;f<a.openStart&&!m.type.spec.isolating;f++,m=m.firstChild);for(let m=a.content.lastChild;p<a.openEnd&&!m.type.spec.isolating;p++,m=m.lastChild);a=$k(a,f,p)}return t.someProp("transformPasted",f=>{a=f(a,t,l)}),a}const fz=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function pz(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&s.length&&g2(l,s,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=b2(o[o.length-1],s.length));let d=h2(a,l);o.push(d),i=i.matchType(d.type),s=l}}),o)return he.from(o)}return t}function h2(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,he.from(t));return t}function g2(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=g2(t,e,n,r.last
vendor: 5,159 bytes, line 49
49Child,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(he.from(h2(n,t,i+1))))}}function b2(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,b2(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(he.empty,!0);return t.copy(n.append(r))}function ax(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=ax(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(he.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function $k(t,e,n){return e<t.openStart&&(t=new Ae(ax(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Ae(ax(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const x2={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Bk=null;function v2(){return Bk||(Bk=document.implementation.createHTMLDocument("title"))}let Xh=null;function mz(t){let e=window.trustedTypes;return e?(Xh||(Xh=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Xh.createHTML(t)):t}function hz(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=v2().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&x2[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=mz(t),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function gz(t){let e=t.querySelectorAll(vn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="Â "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function bz(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=he.from(l.create(r[a+1],i)),s++,o++}return new Ae(i,s,o)}const Un={},Hn={},xz={touchstart:!0,touchmove:!0};class vz{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function yz(t){for(let e in Un){let n=Un[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{jz(t,r)&&!Gv(t,r)&&(t.editable||!(r.type in Hn))&&n(t,r)},xz[e]?{passive:!0}:void 0)}Pn&&t.dom.addEventListener("input",()=>null),lx(t)}function Ws(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function kz(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function lx(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Gv(t,r))})}function Gv(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function jz(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function wz(t,e){!Gv(t,e)&&Un[e.type]&&(t.editable||!(e.type in Hn))&&Un[e.type](t,e)}Hn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!k2(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Yi&&vn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),kl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Do(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||dz(t,n)?n.preventDefault():Ws(t,"key")};Hn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Hn.keypress=(t,e)=>{let n=e;if(k2(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ir&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ze)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i,s))&&t.dispatch(s()),n.preventDefault()}};function Em(t){return{left:t.clientX,top:t.clientY}}function Sz(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}
vendor: 20,698 bytes, line 49
49function qv(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function ul(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Nz(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ue.isSelectable(r)?(ul(t,new Ue(n)),!0):!1}function Cz(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof Ue&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(Ue.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(ul(t,Ue.create(t.state.doc,i)),!0):!1}function Ez(t,e,n,r,i){return qv(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?Cz(t,n):Nz(t,n))}function Tz(t,e,n,r){return qv(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Az(t,e,n,r){return qv(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Mz(t,n,r)}function Mz(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ul(t,Ze.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)ul(t,Ze.create(r,a+1,a+1+o.content.size));else if(Ue.isSelectable(o))ul(t,Ue.create(r,a));else continue;return!0}}function Jv(t){return up(t)}const y2=Ir?"metaKey":"ctrlKey";Un.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Jv(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&Sz(n,t.input.lastClick)&&!n[y2]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let o=t.posAtCoords(Em(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Iz(t,o,n,!!r)):(s=="doubleClick"?Tz:Az)(t,o.pos,o.inside,n)?n.preventDefault():Ws(t,"pointer"))};class Iz{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[y2],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);s=d.parent,o=d.depth?d.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof Ue&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Rr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ws(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>es(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Em(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ws(this.view,"pointer"):Ez(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Pn&&this.mightDrag&&!this.mightDrag.node.isAtom||vn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ul(this.view,rt.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ws(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ws(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Un.touchstart=t=>{t.input.lastTouch=Date.now(),Jv(t),Ws(t,"pointer")};Un.touchmove=t=>{t.input.lastTouch=Date.now(),Ws(t,"pointer")};Un.contextmenu=t=>Jv(t);function k2(t,e){return t.composing?!0:Pn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const zz=Yi?5e3:-1;Hn.compositionstart=Hn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ze&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||vn&&QN&&Pz(t)))t.markCursor=t.state.storedMarks||n.marks(),up(t,!0),t.markCursor=null;else if(up(t,!e.selection.empty),Rr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}j2(t,zz)};function Pz(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Hn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,j2(t,20))};function j2(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>up(t),e))}function w2(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Oz());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Dz(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=CI(e.focusNode,e.focusOffset),r=EI(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function Oz(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function up(t,e=!1){if(!(Yi&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),w2(t),e||t.docView&&t.docView.dirty){let n=Vv(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function _z(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Iu=sr&&io<15||kl&&II<604;Un.copy=Hn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=Iu?null:n.clipboardData,o=r.content(),{dom:a,text:l}=Wv(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):_z(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Lz(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Rz(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?zu(t,r.value,null,i,e):zu(t,r.textContent,r.innerHTML,i,e)},50)}function zu(t,e,n,r,i){let s=m2(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||Ae.empty)))return!0;if(!s)return!1;let o=Lz(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function S2(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Hn.paste=(t,e)=>{let n=e;if(t.composing&&!Yi)return;let r=Iu?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&zu(t,S2(r),r.getData("text/html"),i,n)?n.preventDefault():Rz(t,n)};class N2{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const $z=Ir?"altKey":"ctrlKey";function C2(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[$z]}Un.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(Em(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Ue?i.to-1:i.to))){if(r&&r.mightDrag)o=Ue.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(o=Ue.create(t.state.doc,f.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:d}=Wv(t,a);(!n.dataTransfer.files.length||!vn||YN>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Iu?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Iu||n.dataTransfer.setData("text/plain",u),t.dragging=new N2(d,C2(t,n),o)};Un.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Hn.dragover=Hn.dragenter=(t,e)=>e.preventDefault();Hn.drop=(t,e)=>{try{Bz(t,e,t.dragging)}finally{t.dragging=null}};function Bz(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Em(e));if(!r)return;let i=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",m=>{s=m(s,t,!1)}):s=m2(t,S2(e.dataTransfer),Iu?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&C2(t,e));if(t.someProp("handleDrop",m=>m(t,e,s||Ae.empty,o))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?MN(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let l=t.state.tr;if(o){let{node:m}=n;m?m.replace(l):l.deleteSelection()}let u=l.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=l.doc;if(d?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(f))return;let p=l.doc.resolve(u);if(d&&Ue.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Ue(p));else{let m=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((g,y,j,x)=>m=x),l.setSelection(Kv(t,p,l.doc.resolve(m)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}Un.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&es(t)},20))};Un.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Un.beforeinput=(t,e)=>{if(vn&&Yi&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,Do(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Hn)Un[t]=Hn[t];function Pu(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class dp{constructor(e,n){this.toDOM=e,this.spec=n||Jo,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new $n(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof dp&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Pu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oo{constructor(e,n){this.attrs=e,this.spec=n||Jo}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new $n(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof oo&&Pu(this.attrs,e.attrs)&&Pu(this.spec,e.spec)}static is(e){return e.type instanceof oo}destroy(){}}class Zv{constructor(e,n){this.attrs=e,this.spec=n||Jo}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new $n(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof Zv&&Pu(this.attrs,e.attrs)&&Pu(this.spec,e.spec)}destroy(){}}class $n{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new $n(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new $n(e,e,new dp(n,r))}static inline(e,n,r,i){return new $n(e,n,new oo(r,i))}static node(e,n,r,i){return new $n(e,n,new Zv(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof oo}get widget(){return this.type instanceof dp}}const _a=[],Jo={};class zt{constructor(e,n){this.local=e.length?e:_a,this.children=n.length?n:_a}static create(e,n){return n.length?fp(n,e,0,Jo):Tn}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==Tn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Jo)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?Fz(this.children,o||[],e,n,r,i,s):o?new zt(o.sort(Zo),_a):Tn}add(e,n){return n.length?this==Tn?zt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let u=l+r,d;if(d=T2(n,a,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,d,u+1):i.splice(s,0,l,l+a.nodeSize,fp(d,a,u+1,Jo)),s+=3}});let o=E2(s?A2(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new zt(o.length?this.local.concat(o).sort(Zo):this.local,i||this.children)}remove(e){return e.length==0||this==Tn?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let d=0,f;d<e.length;d++)(f=e[d])&&f.from>a&&f.to<l&&(e[d]=null,(o||(o=[])).push(f));if(!o)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(o,a+1);u!=Tn?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new zt(i,r):Tn}forChild(e,n){if(this==Tn)return this;if(n.isLeaf)return zt.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof oo){let u=Math.max(s,l.from)-s,d=Math.min(o,l.to)-s;u<d&&(i||(i=[])).push(l.copy(u,d))}}if(i){let a=new zt(i.sort(Zo),_a);return r?new Bs([a,r]):a}return r||Tn}eq(e){if(this==e)return!0;if(!(e instanceof zt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Yv(this.localsInner(e))}localsInner(e){if(this==Tn)return _a;if(e.inlineContent||!this.local.some(oo.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof oo||n.push(this.local[r]);return n}forEachSet(e){e(this)}}zt.empty=new zt([],[]);zt.removeOverlap=Yv;const Tn=zt.empty;class Bs{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Jo));return Bs.from(r)}forChild(e,n){if(n.isLeaf)return zt.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=Tn&&(s instanceof Bs?r=r.concat(s.members):r.push(s))}return Bs.from(r)}eq(e){if(!(e instanceof Bs)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?Yv(r?n:n.sort(Zo)):_a}static from(e){switch(e.length){case 0:return Tn;case 1:return e[0];default:return new Bs(e.every(n=>n instanceof zt)?e:e.reduce((n,r)=>n.concat(r instanceof zt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Fz(t,e,n,r,i,s,o){let a=t.slice();for(let u=0,d=s;u<n.maps.length;u++){let f=0;n.maps[u].forEach((p,m,g,y)=>{let j=y-g-(m-p);for(let x=0;x<a.length;x+=3){let k=a[x+1];if(k<0||p>k+d-f)continue;let N=a[x]+d-f;m>=N?a[x+1]=p<=N?-2:-1:p>=d&&j&&(a[x]+=j,a[x+1]+=j)}f+=j}),d=n.maps[u].map(d,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let d=n.map(t[u]+s),f=d-i;if(f<0||f>=r.content.size){l=!0;continue}let p=n.map(t[u+1]+s,-1),m=p-i,{index:g,offset:y}=r.content.findIndex(f),j=r.maybeChild(g);if(j&&y==f&&y+j.nodeSize==m){let x=a[u+2].mapInner(n,j,d+1,t[u]+s+1,o);x!=Tn?(a[u]=f,a[u+1]=m,a[u+2]=x):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=Uz(a,t,e,n,i,s,o),d=fp(u,r,0,o);e=d.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,p=0;f<d.children.length;f+=3){let m=d.children[f];for(;p<a.length&&a[p]<m;)p+=3;a.splice(p,0,d.children[f],d.children[f+1],d.children[f+2])}}return new zt(e.sort(Zo),a)}function E2(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new $n(i.from+e,i.to+e,i.type))}return n}function Uz(t,e,n,r,i,s,o){function a(l,u){for(let d=0;d<l.local.length;d++){let f=l.local[d].map(r,i,u);f?n.push(f):o.onRemove&&o.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+u+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function T2(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function A2(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function fp(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let u=T2(t,a,l+n);if(u){s=!0;let d=fp(u,a,n+l+1,r);d!=Tn&&i.push(l,l+a.nodeSize,d)}});let o=E2(s?A2(t):t,-n).sort(Zo);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new zt(o,i):Tn}function Zo(t,e){return t.from-e.from||t.to-e.to}function Yv(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),Fk(e,i+1,s.c
vendor: 9,895 bytes, line 49
49opy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),Fk(e,i,r.copy(s.from,r.to)));break}}}return e}function Fk(t,e,n){for(;e<t.length&&Zo(n,t[e])>0;)e++;t.splice(e,0,n)}function eg(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Tn&&e.push(r)}),t.cursorWrapper&&e.push(zt.create(t.state.doc,[t.cursorWrapper.deco])),Bs.from(e)}const Hz={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Vz=sr&&io<=11;class Kz{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Wz{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Kz,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);sr&&io<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Pn&&e.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Vz&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Hz)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Pk(this.view)){if(this.suppressingSelectionUpdates)return es(this.view);if(sr&&io<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&aa(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=yl(s))n.add(s);for(let s=e.anchorNode;s;s=yl(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Pk(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let f=this.registerMutation(n[d],l);f&&(s=s<0?f.from:Math.min(f.from,s),o=o<0?f.to:Math.max(f.to,o),f.typeOver&&(a=!0))}if(l.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let f=d.nextSibling;f&&f.nodeType==1&&f.contentEditable=="false"&&d.parentNode.removeChild(d)}}else if(Rr&&l.length){let d=l.filter(f=>f.nodeName=="BR");if(d.length==2){let[f,p]=d;f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let p of d){let m=p.parentNode;m&&m.nodeName=="LI"&&(!f||Jz(e,f)!=m)&&p.remove()}}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Nm(r)&&(u=Vv(e))&&u.eq(rt.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,es(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),Gz(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Zz(e,l)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||es(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let f=e.addedNodes[d];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(sr&&io<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:f,nextSibling:p}=e.addedNodes[d];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(s=p)}let o=i&&i.parentNode==e.target?bn(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?bn(s):e.target.childNodes.length,u=r.localPosFromDOM(e.target,l,1);return{from:a,to:u}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Uk=new WeakMap,Hk=!1;function Gz(t){if(!Uk.has(t)&&(Uk.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Rr,Hk)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Hk=!0}}function Vk(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return aa(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function qz(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Vk(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Vk(t,n):null}function Jz(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Zz(t,e){var n;let{focusNode:r,focusOffset:i}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let a=o;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function Yz(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),u,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:l.anchorOffset}],Nm(l)||u.push({node:l.focusNode,offset:l.focusOffset})),vn&&t.input.lastKeyCode===8)for(let j=s;j>i;j--){let x=r.childNodes[j-1],k=x.pmViewDesc;if(x.nodeName=="BR"&&!k){s=j;break}if(!k||k.size)break}let f=t.state.doc,p=t.someProp("domParser")||ro.fromSchema(t.state.schema),m=f.resolve(o),g=null,y=p.parse(r,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:i,to:s,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:Qz,context:m});if(u&&u[0].pos!=null){let j=u[0].pos,x=u[1]&&u[1].pos;x==null&&(x=j),g={anchor:j+o,head:x+o}}return{doc:y,sel:g,from:o,to:a}}function Qz(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Pn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Pn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Xz=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function eP(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let D=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,L=Vv(t,D);if(L&&!t.state.selection.eq(L)){if(vn&&Yi&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",te=>te(t,Do(13,"Enter"))))return;let V=t.state.tr.setSelection(L);D=="pointer"?V.setMeta("pointer",!0):D=="key"&&V.scrollIntoView(),s&&V.setMeta("composition",s),t.dis
vendor: 4,879 bytes, line 49
49patch(V)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=Yz(t,e,n),d=t.state.doc,f=d.slice(u.from,u.to),p,m;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,m="end"):(p=t.state.selection.from,m="start"),t.input.lastKeyCode=null;let g=rP(f.content,u.doc.content,u.from,p,m);if(g&&t.input.domChangeCount++,(kl&&t.input.lastIOSEnter>Date.now()-225||Yi)&&i.some(D=>D.nodeType==1&&!Xz.test(D.nodeName))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",D=>D(t,Do(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!g)if(r&&l instanceof Ze&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))g={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let D=Kk(t,t.state.doc,u.sel);if(D&&!D.eq(t.state.selection)){let L=t.state.tr.setSelection(D);s&&L.setMeta("composition",s),t.dispatch(L)}}return}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof Ze&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),sr&&io<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>u.from&&u.doc.textBetween(g.start-u.from-1,g.start-u.from+1)==" Â "&&(g.start--,g.endA--,g.endB--);let y=u.doc.resolveNoCache(g.start-u.from),j=u.doc.resolveNoCache(g.endB-u.from),x=d.resolve(g.start),k=y.sameParent(j)&&y.parent.inlineContent&&x.end()>=g.endA;if((kl&&t.input.lastIOSEnter>Date.now()-225&&(!k||i.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!k&&y.pos<u.doc.content.size&&(!y.sameParent(j)||!y.parent.inlineContent)&&y.pos<j.pos&&!/\S/.test(u.doc.textBetween(y.pos,j.pos,"","")))&&t.someProp("handleKeyDown",D=>D(t,Do(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>g.start&&nP(d,g.start,g.endA,y,j)&&t.someProp("handleKeyDown",D=>D(t,Do(8,"Backspace")))){Yi&&vn&&t.domObserver.suppressSelectionUpdates();return}vn&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),Yi&&!k&&y.start()!=j.start()&&j.parentOffset==0&&y.depth==j.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==g.endA&&(g.endB-=2,j=u.doc.resolveNoCache(g.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(D){return D(t,Do(13,"Enter"))})},20));let N=g.start,C=g.endA,w=D=>{let L=D||t.state.tr.replace(N,C,u.doc.slice(g.start-u.from,g.endB-u.from));if(u.sel){let V=Kk(t,L.doc,u.sel);V&&!(vn&&t.composing&&V.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(V.head==N||V.head==L.mapping.map(C)-1)||sr&&V.empty&&V.head==N)&&L.setSelection(V)}return s&&L.setMeta("composition",s),L.scrollIntoView()},E;if(k)if(y.pos==j.pos){sr&&io<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>es(t),20));let D=w(t.state.tr.delete(N,C)),L=d.resolve(g.start).marksAcross(d.resolve(g.endA));L&&D.ensureMarks(L),t.dispatch(D)}else if(g.endA==g.endB&&(E=tP(y.parent.content.cut(y.parentOffset,j.parentOffset),x.parent.content.cut(x.parentOffset,g.endA-x.start())))){let D=w(t.state.tr);E.type=="add"?D.addMark(N,C,E.mark):D.removeMark(N,C,E.mark),t.dispatch(D)}else if(y.parent.child(y.index()).isText&&y.index()==j.index()-(j.textOffset?0:1)){let D=y.parent.textBetween(y.parentOffset,j.parentOffset),L=()=>w(t.state.tr.insertText(D,N,C));t.someProp("handleTextInput",V=>V(t,N,C,D,L))||t.dispatch(L())}else t.dispatch(w());else t.dispatch(w())}function Kk(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Kv(t,e.resolve(n.anchor),e.resolve(n.head))}function tP(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<e.childCount;d++)u.push(l(e.child(d)));if(he.from(u).eq(t))return{mark:a,type:o}}function nP(t,e,n,r,i){if(n-e<=i.pos-r.pos||tg(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(tg(s,!0,!0));return!o.parent.isTextblock||o.pos>n||tg(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function tg(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function rP(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);
vendor: 4,499 bytes, line 49
49if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&Wk(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&Wk(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function Wk(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class M2{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new vz,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Yk),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Jk(this),qk(this),this.nodeViews=Zk(this),this.docView=Ek(this.state.doc,Gk(this),eg(this),this.dom,this),this.domObserver=new Wz(this,(r,i,s,o)=>eP(this,r,i,s,o)),this.domObserver.start(),yz(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&lx(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Yk),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(w2(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let m=Zk(this);sP(m,this.nodeViews)&&(this.nodeViews=m,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&lx(this),this.editable=Jk(this),qk(this);let l=eg(this),u=Gk(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=s||!this.docView.matchesNode(e.doc,u,l);(f||!e.selection.eq(i.selection))&&(o=!0);let p=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&DI(this);if(o){this.domObserver.stop();let m=f&&(sr||vn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&iP(i.selection,e.selection);if(f){let g=vn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Dz(this)),(s||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=Ek(e.doc,u,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&iz(this))?es(this,m):(d2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():p&&OI(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ue){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&kk(this,n.getBoundingClientRect(),e)}else kk(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;
vendor: 4,782 bytes, line 49
49else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new N2(e.slice,e.move,i<0?void 0:Ue.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(sr){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&_I(this.dom),es(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return FI(this,e)}coordsAtPos(e,n=1){return r2(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return WI(this,n||this.state,e)}pasteHTML(e,n){return zu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return zu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Wv(this,e)}destroy(){this.docView&&(kz(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],eg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,SI())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return wz(this,e)}domSelectionRange(){let e=this.domSelection();return e?Pn&&this.root.nodeType===11&&AI(this.dom.ownerDocument)==this.dom&&qz(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}M2.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Gk(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[$n.node(0,t.state.doc.content.size,e)]}function qk(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:$n.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Jk(t){return!t.someProp("editable",e=>e(t.state)===!1)}function iP(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Zk(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function sP(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Yk(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var uo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},pp={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},oP=typeof navigator<"u"&&/Mac/.test(navigator.platform),aP=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var xn=0;xn<10;xn++)uo[48+xn]=uo[96+xn]=String(xn);for(var xn=1;xn<=24;xn++)uo[xn+111]="F"+xn;
vendor: 19,048 bytes, line 49
49for(var xn=65;xn<=90;xn++)uo[xn]=String.fromCharCode(xn+32),pp[xn]=String.fromCharCode(xn);for(var ng in uo)pp.hasOwnProperty(ng)||(pp[ng]=uo[ng]);function lP(t){var e=oP&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||aP&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?pp:uo)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const cP=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),uP=typeof navigator<"u"&&/Win/.test(navigator.platform);function dP(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))cP?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function fP(t){let e=Object.create(null);for(let n in t)e[dP(n)]=t[n];return e}function rg(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function pP(t){return new Ot({props:{handleKeyDown:I2(t)}})}function I2(t){let e=fP(t);return function(n,r){let i=lP(r),s,o=e[rg(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[rg(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(uP&&r.ctrlKey&&r.altKey)&&(s=uo[r.keyCode])&&s!=i){let a=e[rg(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var mP=Object.defineProperty,Qv=(t,e)=>{for(var n in e)mP(t,n,{get:e[n],enumerable:!0})};function Tm(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var Am=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([o,a])=>[o,(...u)=>{const d=a(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],a=!!t,l=t||i.tr,u=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(l),o.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(n).map(([f,p])=>[f,(...g)=>{const y=this.buildProps(l,e),j=p(...g)(y);return o.push(j),d}])),run:u};return d}createCan(t){const{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:t,editor:r,view:s,state:Tm({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)(o)]))}};return o}},z2={};Qv(z2,{blur:()=>hP,clearContent:()=>gP,clearNodes:()=>bP,command:()=>xP,createParagraphNear:()=>vP,cut:()=>yP,deleteCurrentNode:()=>kP,deleteNode:()=>jP,deleteRange:()=>wP,deleteSelection:()=>SP,enter:()=>NP,exitCode:()=>CP,extendMarkRange:()=>EP,first:()=>TP,focus:()=>MP,forEach:()=>IP,insertContent:()=>zP,insertContentAt:()=>OP,joinBackward:()=>RP,joinDown:()=>LP,joinForward:()=>$P,joinItemBackward:()=>BP,joinItemForward:()=>FP,joinTextblockBackward:()=>UP,joinTextblockForward:()=>HP,joinUp:()=>_P,keyboardShortcut:()=>KP,lift:()=>WP,liftEmptyBlock:()=>GP,liftListItem:()=>qP,newlineInCode:()=>JP,resetAttributes:()=>ZP,scrollIntoView:()=>YP,selectAll:()=>QP,selectNodeBackward:()=>XP,selectNodeForward:()=>eD,selectParentNode:()=>tD,selectTextblockEnd:()=>nD,selectTextblockStart:()=>rD,setContent:()=>iD,setMark:()=>ND,setMeta:()=>CD,setNode:()=>ED,setNodeSelection:()=>TD,setTextDirection:()=>AD,setTextSelection:()=>MD,sinkListItem:()=>ID,splitBlock:()=>zD,splitListItem:()=>PD,toggleList:()=>DD,toggleMark:()=>OD,toggleNode:()=>_D,toggleWrap:()=>LD,undoInputRule:()=>RD,unsetAllMarks:()=>$D,unsetMark:()=>BD,unsetTextDirection:()=>FD,updateAttributes:()=>UD,wrapIn:()=>HD,wrapInList:()=>VD});var hP=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),gP=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),bP=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:d}=e,f=u.resolve(d.map(l)),p=u.resolve(d.map(l+a.nodeSize)),m=f.blockRange(p);if(!m)return;const g=_l(m);if(a.type.isTextblock){const{defaultType:y}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(m.start,y)}(g||g===0)&&e.lift(m,g)})}),!0},xP=t=>e=>t(e),vP=()=>({state:t,dispatch:e})=>WN(t,e),yP=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new Ze(r.doc.resolve(Math.max(o-1,0)))),!0},kP=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1};function Gt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var jP=t=>({tr:e,state:n,dispatch:r})=>{const i=Gt(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},wP=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},SP=()=>({state:t,dispatch:e})=>Rv(t,e),NP=()=>({commands:t})=>t.keyboardShortcut("Enter"),CP=()=>({state:t,dispatch:e})=>cI(t,e);function Xv(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function mp(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Xv(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function P2(t,e,n={}){return t.find(r=>r.type===e&&mp(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function Qk(t,e,n={}){return!!P2(t,e,n)}function ey(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!P2([...i.node.marks],e,n)))return;let o=i.index,a=t.start()+i.offset,l=o+1,u=a+i.node.nodeSize;for(;o>0&&Qk([...t.parent.child(o-1).marks],e,n);)o-=1,a-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&Qk([...t.parent.child(l).marks],e,n);)u+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function ls(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var EP=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=ls(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:d}=a;if(i){const f=ey(l,s,e);if(f&&f.from<=u&&f.to>=d){const p=Ze.create(o,f.from,f.to);n.setSelection(p)}}return!0},TP=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function D2(t){return t instanceof Ze}function Fo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function O2(t,e=null){if(!e)return null;const n=rt.atStart(t),r=rt.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?Ze.create(t,Fo(0,i,s),Fo(t.content.size,i,s)):Ze.create(t,Fo(e,i,s),Fo(e,i,s))}function Xk(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function hp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function AP(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var MP=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(hp()||Xk())&&r.dom.focus(),AP()&&!hp()&&!Xk()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!D2(n.state.selection))return o(),!0;const a=O2(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},IP=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),zP=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),_2=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&_2(r)}return t};function Rd(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return _2(n)}function Du(t,e,n){if(t instanceof no||t instanceof he)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return he.fromArray(t.map(a=>e.nodeFromJSON(a)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),Du("",e,n)}if(i){if(n.errorOnInvalidContent){let o=!1,a="";const l=new vN({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?ro.fromSchema(l).parseSlice(Rd(t),n.parseOptions):ro.fromSchema(l).parse(Rd(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=ro.fromSchema(e);return n.slice?s.parseSlice(Rd(t),n.parseOptions).content:s.parse(Rd(t),n.parseOptions)}return Du("",e,n)}function PP(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof ln||i instanceof un))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,u,d)=>{o===0&&(o=d)}),t.setSelection(rt.near(t.doc.resolve(o),n))}var DP=t=>!("type"in t),OP=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=j=>{s.emit("contentError",{editor:s,error:j,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Du(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(j){l(j)}try{a=Du(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(j){return l(j),!1}let{from:d,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,m=!0;if((DP(a)?a:[a]).forEach(j=>{j.check(),p=p?j.isText&&j.marks.length===0:!1,m=m?j.isBlock:!1}),d===f&&m){const{parent:j}=r.doc.resolve(d);j.isTextblock&&!j.type.spec.code&&!j.childCount&&(d-=1,f+=1)}let y;if(p){if(Array.isArray(e))y=e.map(j=>j.text||"").join("");else if(e instanceof he){let j="";e.forEach(x=>{x.text&&(j+=x.text)}),y=j}else typeof e=="object"&&e&&e.text?y=e.text:y=e;r.insertText(y,d,f)}else{y=a;const j=r.doc.resolve(d),x=j.node(),k=j.parentOffset===0,N=x.isText||x.isTextblock,C=x.content.size>0;k&&N&&C&&(d=Math.max(0,d-1)),r.replaceWith(d,f,y)}n.updateSelection&&PP(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:y}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:y})}return!0},_P=()=>({state:t,dispatch:e})=>oI(t,e),LP=()=>({state:t,dispatch:e})=>aI(t,e),RP=()=>({state:t,dispatch:e})=>$N(t,e),$P=()=>({state:t,dispatch:e})=>HN(t,e),BP=()=>({state:t,dispatch:e,tr:n})=>{try{const r=jm(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},FP=()=>({state:t,dispatch:e,tr:n})=>{try{const r=jm(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},UP=()=>({state:t,dispatch:e})=>iI(t,e),HP=()=>({state:t,dispatch:e})=>sI(t,e);function L2(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function VP(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))hp()||L2()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var KP=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=VP(t).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const d=u.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function fo(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?Gt(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const m=Math.max(r,p),g=Math.min(i,p+f.nodeSize);a.push({node:f,from:m,to:g})});const l=i-r,u=a.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>mp(f.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((f,p)=>f+p.to-p.from,0)>=l}var WP=(t,e={})=>({state:n,dispatch:r})=>{const i=Gt(t,n.schema);return fo(n,i,e)?lI(n,r):!1},GP=()=>({state:t,dispatch:e})=>GN(t,e),qP=t=>({state:e,dispatch:n})=>{const r=Gt(t,e.schema);return yI(r)(e,n)},JP=()=>({state:t,dispatch:e})=>KN(t,e);function Mm(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function ej(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var ZP=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Mm(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Gt(t,r.schema)),a==="mark"&&(o=ls(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,f)=>{s&&s===d.type&&(l=!0,i&&n.setNodeMarkup(f,void 0,ej(d.attrs,e))),o&&d.marks.length&&d.marks.forEach(p=>{o===p.type&&(l=!0,i&&n.addMark(f,f+d.nodeSize,o.create(ej(p.attrs,e))))})})}),l},YP=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),QP=()=>({tr:t,dispatch:e})=>{if(e){const n=new br(t.doc);t.setSelection(n)}return!0},XP=()=>({state:t,dispatch:e})=>FN(t,e),eD=()=>({state:t,dispatch:e})=>VN(t,e),tD=()=>({state:t,dispatch:e})=>fI(t,e),nD=()=>({state:t,dispatch:e})=>hI(t,e),rD=()=>({state:t,dispatch:e})=>mI(t,e);function cx(t,e,n={},r={}){return Du(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var iD=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const u=cx(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function R2(t,e){const n=ls(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function $2(t,e){const n=new ON(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function sD(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function oD(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function aD(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Im(t){return e=>aD(e.$from,t)}function Be(t,e,n){return t.config[e]===void 0&&t.parent?Be(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Be(t.parent,e,n):null}):t.config[e]}function ty(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Be(e,"addExtensions",n);return r?[e,...ty(r())]:e}).flat(10)}function ny(t,e){const n=pa.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function B2(t){return typeof t=="function"}function bt(t,e=void 0,...n){return B2(t)?e?t.bind(e)(...n):t(...n):t}function lD(t={}){return Object.keys(t).length===0&&t.constructor===Object}function jl(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function F2(t){const e=[],{nodeExtensions:n,markExtensions:r}=jl(t),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),l=[...o,...a];return t.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage,extensions:i},f=Be(u,"addGlobalAttributes",d);if(!f)return;f().forEach(m=>{let g;Array.isArray(m.types)?g=m.types:m.types==="*"?g=l:m.types==="nodes"?g=o:m.types==="marks"?g=a:g=[],g.forEach(y=>{Object.entries(m.attributes).forEach(([j,x])=>{e.push({type:y,name:j,attribute:{...s,...x}})})})})}
49),i.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage},f=Be(u,"addAttributes",d);if(!f)return;const p=f();Object.entries(p).forEach(([m,g])=>{const y={...s,...g};typeof(y==null?void 0:y.default)=="function"&&(y.default=y.default()),y!=null&&y.isRequired&&(y==null?void 0:y.default)===void 0&&delete y.default,e.push({type:u.name,name:m,attribute:y})})}),e}function cD(t){const e=[];let n="",r=!1,i=!1,s=0;const o=t.length;for(let a=0;a<o;a+=1){const l=t[a];if(l==="'"&&!i){r=!r,n+=l;continue}if(l==='"'&&!r){i=!i,n+=l;continue}if(!r&&!i){if(l==="("){s+=1,n+=l;continue}if(l===")"&&s>0){s-=1,n+=l;continue}if(l===";"&&s===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function tj(t){const e=[],n=cD(t||""),r=n.length;for(let i=0;i<r;i+=1){const s=n[i],o=s.indexOf(":");if(o===-1)continue;const a=s.slice(0,o).trim(),l=s.slice(o+1).trim();a&&l&&e.push([a,l])}return e}function qt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?String(s).split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(d=>!l.includes(d));r[i]=[...l,...u].join(" ")}else if(i==="style"){const a=new Map([...tj(r[i]),...tj(s)]);r[i]=Array.from(a.entries()).map(([l,u])=>`${l}: ${u}`).join("; ")}else r[i]=s}),r},{})}function Ou(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>qt(n,r),{})}function uD(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function nj(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):uD(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function rj(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&lD(n)?!1:n!=null))}function ij(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function dD(t,e){var n;const r=F2(t),{nodeExtensions:i,markExtensions:s}=jl(t),o=(n=i.find(u=>Be(u,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(u=>{const d=r.filter(x=>x.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((x,k)=>{const N=Be(k,"extendNodeSchema",f);return{...x,...N?N(u):{}}},{}),m=rj({...p,content:bt(Be(u,"content",f)),marks:bt(Be(u,"marks",f)),group:bt(Be(u,"group",f)),inline:bt(Be(u,"inline",f)),atom:bt(Be(u,"atom",f)),selectable:bt(Be(u,"selectable",f)),draggable:bt(Be(u,"draggable",f)),code:bt(Be(u,"code",f)),whitespace:bt(Be(u,"whitespace",f)),linebreakReplacement:bt(Be(u,"linebreakReplacement",f)),defining:bt(Be(u,"defining",f)),isolating:bt(Be(u,"isolating",f)),attrs:Object.fromEntries(d.map(ij))}),g=bt(Be(u,"parseHTML",f));g&&(m.parseDOM=g.map(x=>nj(x,d)));const y=Be(u,"renderHTML",f);y&&(m.toDOM=x=>y({node:x,HTMLAttributes:Ou(x,d)}));const j=Be(u,"renderText",f);return j&&(m.toText=j),[u.name,m]})),l=Object.fromEntries(s.map(u=>{const d=r.filter(j=>j.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},p=t.reduce((j,x)=>{const k=Be(x,"extendMarkSchema",f);return{...j,...k?k(u):{}}},{}),m=rj({...p,inclusive:bt(Be(u,"inclusive",f)),excludes:bt(Be(u,"excludes",f)),group:bt(Be(u,"group",f)),spanning:bt(Be(u,"spanning",f)),code:bt(Be(u,"code",f)),attrs:Object.fromEntries(d.map(ij))}),g=bt(Be(u,"parseHTML",f));g&&(m.parseDOM=g.map(j=>nj(j,d)));const y=Be(u,"renderHTML",f);return y&&(m.toDOM=j=>y({mark:j,HTMLAttributes:Ou(j,d)})),[u.name,m]}));return new vN({topNode:o,nodes:a,marks:l})}function fD(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Xc(t){return t.sort((n,r)=>{const i=Be(n,"priority")||100,s=Be(r,"priority")||100;return i>s?-1:i<s?1:0})}function U2(t){const e=Xc(ty(t)),n=fD(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function H2(t,e,n){const{from:r,to:i}=e,{blockSeparator:s=` 50
51`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,d,f)=>{var p;l.isBlock&&u>r&&(a+=s);const m=o==null?void 0:o[l.type.name];if(m)return d&&(a+=m({node:l,pos:u,parent:d,index:f,range:e})),!1;l.isText&&(a+=(p=l==null?void 0:l.text)==null?void 0:p.slice(Math.max(r,u)-u,i-u))}),a}function pD(t,e){const n={from:0,to:t.content.size};return H2(t,n,e)}function V2(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function mD(t,e){const n=Gt(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function K2(t,e){const n=Mm(typeof e=="string"?e:e.name,t.schema);return n==="node"?mD(t,e):n==="mark"?R2(t,e):{}}function hD(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function gD(t){const e=hD(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function W2(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(s).map(a,-1),d=e.slice(s).map(l),f=e.invert().map(u,-1),p=e.invert().map(d);r.push({oldRange:{from:f,to:p},newRange:{from:u,to:d}})})}),gD(r)}function ry(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=ey(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}var bD=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,o=null;for(;s>0&&o===null;){const a=i.node(s);(a==null?void 0:a.type.name)===e?o=a:s-=1}return[o,s]};function xc(t,e){return e.nodes[t]||e.marks[t]||null}function Nf(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var xD=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,u;const d=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),n};function ux(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?ls(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>mp(f.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:f,$to:p})=>{const m=f.pos,g=p.pos;t.doc.nodesBetween(m,g,(y,j)=>{if(s&&y.inlineContent&&!y.type.allowsMarkType(s))return!1;if(!y.isText&&!y.marks.length)return;const x=Math.max(m,j),k=Math.min(g,j+y.nodeSize),N=k-x;o+=N,a.push(...y.marks.map(C=>({mark:C,from:x,to:k})))})}),o===0)return!1;const l=a.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>mp(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),u=a.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,p)=>f+p.to-p.from,0);return(l>0?l+u:l)>=o}function vD(t,e,n={}){if(!e)return fo(t,null,n)||ux(t,null,n);const r=Mm(e,t.schema);return r==="node"?fo(t,e,n):r==="mark"?ux(t,e,n):!1}var yD=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=Im(a=>a.type.name===e)(t.selection);if(!s)return!1;const o=t.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},kD=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function sj(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function oj(t,e){const{nodeExtensions:n}=jl(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=bt(Be(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function zm(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;
vendor: 30,064 bytes, lines 51-92
51if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(zm(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function G2(t){return t instanceof Ue}var q2=class J2{constructor(e){this.position=e}static fromJSON(e){return new J2(e.position)}toJSON(){return{position:this.position}}};function jD(t,e){const n=e.mapping.mapResult(t.position);return{position:new q2(n.pos),mapResult:n}}function wD(t){return new q2(t)}function SD(t,e,n){var r;const{selection:i}=e;let s=null;if(D2(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,f,p)=>{if(u)return!1;if(d.isInline){const m=!p||p.type.allowsMarkType(n),g=!!n.isInSet(d.marks)||!d.marks.some(y=>y.type.excludes(n));u=m&&g}return!u}),u})}var ND=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=ls(t,r.schema);if(i)if(o){const u=R2(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const d=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(d,f,(p,m)=>{const g=Math.max(m,d),y=Math.min(m+p.nodeSize,f);p.marks.find(x=>x.type===l)?p.marks.forEach(x=>{l===x.type&&n.addMark(g,y,l.create({...x.attrs,...e}))}):n.addMark(g,y,l.create(e))})});return SD(r,n,l)},CD=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),ED=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=Gt(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>xk(s,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>xk(s,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},TD=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=Fo(t,0,r.content.size),s=Ue.create(r,i);e.setSelection(s)}return!0},AD=(t,e)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=s.from,a=s.to),i&&n.doc.nodesBetween(o,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},MD=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=Ze.atStart(r).from,a=Ze.atEnd(r).to,l=Fo(i,o,a),u=Fo(s,o,a),d=Ze.create(r,l,u);e.setSelection(d)}return!0},ID=t=>({state:e,dispatch:n})=>{const r=Gt(t,e.schema);return wI(r)(e,n)};function aj(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}var zD=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,d=Nf(u,a.node().type.name,a.node().attrs);if(s instanceof Ue&&s.node.isBlock)return!a.parentOffset||!Xi(o,a.pos)?!1:(r&&(t&&aj(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:sD(a.node(-1).contentMatchAt(a.indexAfter(-1)));let m=f&&p?[{type:p,attrs:d}]:void 0,g=Xi(e.doc,e.mapping.map(a.pos),1,m);if(!m&&!g&&Xi(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(g=!0,m=p?[{type:p,attrs:d}]:void 0),r){if(g&&(s instanceof Ze&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,m),p&&!f&&!a.parentOffset&&a.parent.type!==p)){const y=e.mapping.map(a.before()),j=e.doc.resolve(y);a.node(-1).canReplaceWith(j.index(),j.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&aj(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return g},PD=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=Gt(t,r.schema),{$from:l,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(u))return!1;const f=l.node(-1);if(f.type!==a)return!1;const p=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let x=he.empty;const k=l.index(-1)?1:l.index(-2)?2:3;for(let L=l.depth-k;L>=l.depth-3;L-=1)x=he.from(l.node(L).copy(x));const N=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,C={...Nf(p,l.node().type.name,l.node().attrs),...e},w=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(C))||void 0;x=x.append(he.from(a.createAndFill(null,w)||void 0));const E=l.before(l.depth-(k-1));n.replace(E,l.after(-N),new Ae(x,4-k,0));let D=-1;n.doc.nodesBetween(E,n.doc.content.size,(L,V)=>{if(D>-1)return!1;L.isTextblock&&L.content.size===0&&(D=V+1)}),D>-1&&n.setSelection(Ze.near(n.doc.resolve(D))),n.scrollIntoView()}return!0}const m=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,g={...Nf(p,f.type.name,f.attrs),...e},y={...Nf(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const j=m?[{type:a,attrs:g},{type:m,attrs:y}]:[{type:a,attrs:g}];if(!Xi(n.doc,l.pos,2))return!1;if(i){const{selection:x,storedMarks:k}=r,{splittableMarks:N}=s.extensionManager,C=k||x.$to.parentOffset&&x.$from.marks();if(n.split(l.pos,2,j).scrollIntoView(),!C||!i)return!0;const w=C.filter(E=>N.includes(E.type.name));n.ensureMarks(w)}return!0},ig=(t,e)=>{const n=Im(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&bo(t.doc,n.pos)&&t.join(n.pos),!0},sg=(t,e)=>{const n=Im(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&bo(t.doc,r)&&t.join(r),!0},DD=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:d})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,m=Gt(t,o.schema),g=Gt(e,o.schema),{selection:y,storedMarks:j}=o,{$from:x,$to:k}=y,N=x.blockRange(k),C=j||y.$to.parentOffset&&y.$from.marks();if(!N)return!1;const w=Im(E=>oj(E.type.name,f))(y);if(N.depth>=1&&w&&N.depth-w.depth<=1){if(w.node.type===m)return u.liftListItem(g);if(oj(w.node.type.name,f)&&m.validContent(w.node.content)&&a)return l().command(()=>(s.setNodeMarkup(w.pos,m),!0)).command(()=>ig(s,m)).command(()=>sg(s,m)).run()}return!n||!C||!a?l().command(()=>d().wrapInList(m,r)?!0:u.clearNodes()).wrapInList(m,r).command(()=>ig(s,m)).command(()=>sg(s,m)).run():l().command(()=>{const E=d().wrapInList(m,r),D=C.filter(L=>p.includes(L.type.name));return s.ensureMarks(D),E?!0:u.clearNodes()}).wrapInList(m,r).command(()=>ig(s,m)).command(()=>sg(s,m)).run()},OD=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=ls(t,r.schema);return ux(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},_D=(t,e,n={})=>({state:r,commands:i})=>{const s=Gt(t,r.schema),o=Gt(e,r.schema),a=fo(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},LD=(t,e={})=>({state:n,commands:r})=>{const i=Gt(t,n.schema);return fo(n,i,e)?r.lift(i):r.wrapIn(i,e)},RD=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},$D=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},BD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=ls(t,r.schema),{$from:u,empty:d,ranges:f}=a;if(!i)return!0;if(d&&o){let{from:p,to:m}=a;const g=(s=u.marks().find(j=>j.type===l))==null?void 0:s.attrs,y=ey(u,l,g);y&&(p=y.from,m=y.to),n.removeMark(p,m,l)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},FD=t=>({tr:e,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return typeof t=="number"?(s=t,o=t):t&&"from"in t&&"to"in t?(s=t.from,o=t.to):(s=i.from,o=i.to),r&&e.doc.nodesBetween(s,o,(a,l)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},UD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=Mm(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Gt(t,r.schema)),a==="mark"&&(o=ls(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{const d=u.$from.pos,f=u.$to.pos;let p,m,g,y;n.selection.empty?r.doc.nodesBetween(d,f,(j,x)=>{s&&s===j.type&&(l=!0,g=Math.max(x,d),y=Math.min(x+j.nodeSize,f),p=x,m=j)}):r.doc.nodesBetween(d,f,(j,x)=>{x<d&&s&&s===j.type&&(l=!0,g=Math.max(x,d),y=Math.min(x+j.nodeSize,f),p=x,m=j),x>=d&&x<=f&&(s&&s===j.type&&(l=!0,i&&n.setNodeMarkup(x,void 0,{...j.attrs,...e})),o&&j.marks.length&&j.marks.forEach(k=>{if(o===k.type&&(l=!0,i)){const N=Math.max(x,d),C=Math.min(x+j.nodeSize,f);n.addMark(N,C,o.create({...k.attrs,...e}))}}))}),m&&(p!==void 0&&i&&n.setNodeMarkup(p,void 0,{...m.attrs,...e}),o&&m.marks.length&&m.marks.forEach(j=>{o===j.type&&i&&n.addMark(g,y,o.create({...j.attrs,...e}))}))}),l},HD=(t,e={})=>({state:n,dispatch:r})=>{const i=Gt(t,n.schema);return gI(i,e)(n,r)},VD=(t,e={})=>({state:n,dispatch:r})=>{const i=Gt(t,n.schema);return bI(i,e)(n,r)},KD=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Pm=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},WD=(t,e)=>{if(Xv(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function $d(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(p=>p.type.spec.code))return!1;let d=!1;const f=xD(u)+s;return o.forEach(p=>{if(d)return;const m=WD(f,p.find);if(!m)return;const g=l.state.tr,y=Tm({state:l.state,transaction:g}),j={from:r-(m[0].length-s.length),to:i},{commands:x,chain:k,can:N}=new Am({editor:n,state:y});p.handler({state:y,range:j,match:m,commands:x,chain:k,can:N})===null||!g.steps.length||(p.undoable&&g.setMeta(a,{transform:g,from:r,to:i,text:s}),l.dispatch(g),d=!0)}),d}function GD(t){const{editor:e,rules:n}=t,r=new Ot({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=ny(he.from(d),o.schema);const{from:f}=l,p=f+d.length;$d({editor:e,from:f,to:p,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return $d({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&$d({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?$d({editor:e,from:o.pos,to:o.pos,text:` 52`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function qD(t){return Object.prototype.toString.call(t).slice(8,-1)}function Bd(t){return qD(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Z2(t,e){const n={...t};return Bd(t)&&Bd(e)&&Object.keys(e).forEach(r=>{Bd(e[r])&&Bd(t[r])?n[r]=Z2(t[r],e[r]):n[r]=e[r]}),n}var iy=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...bt(Be(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...bt(Be(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>Z2(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},ma=class Y2 extends iy{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new Y2(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const l=o.find(u=>(u==null?void 0:u.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function JD(t){return typeof t=="number"}var ZD=class{constructor(t){this.find=t.find,this.handler=t.handler}},YD=(t,e,n)=>{if(Xv(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function QD(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:d}=new Am({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(m,g)=>{var y,j,x,k,N;if((j=(y=m.type)==null?void 0:y.spec)!=null&&j.code||!(m.isText||m.isTextblock||m.isInline))return;const C=(N=(k=(x=m.content)==null?void 0:x.size)!=null?k:m.nodeSize)!=null?N:0,w=Math.max(r,g),E=Math.min(i,g+C);if(w>=E)return;const D=m.isText?m.text||"":m.textBetween(w-g,E-g,void 0,"");YD(D,s.find,o).forEach(V=>{if(V.index===void 0)return;const te=w+V.index+1,ae=te+V[0].length,ke={from:n.tr.mapping.map(te),to:n.tr.mapping.map(ae)},ge=s.handler({state:n,range:ke,match:V,commands:l,chain:u,can:d,pasteEvent:o,dropEvent:a});f.push(ge)})}),f.every(m=>m!==null)}var Fd=null,XD=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function e5(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:f,to:p,rule:m,pasteEvt:g})=>{const y=d.tr,j=Tm({state:d,transaction:y});if(!(!QD({editor:e,state:j,from:Math.max(f-1,0),to:p.b-1,rule:m,pasteEvent:g,dropEvent:a})||!y.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,y}};return n.map(d=>new Ot({view(f){const p=g=>{var y;r=(y=f.dom.parentElement)!=null&&y.contains(g.target)?f.dom.parentElement:null,r&&(Fd=e)},m=()=>{Fd&&(Fd=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",m),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",m)}}},props:{handleDOMEvents:{drop:(f,p)=>{if(s=r===f.dom.parentElement,a=p,!s){const m=Fd;m!=null&&m.isEditable&&setTimeout(()=>{const g=m.state.selection;g&&m.commands.deleteRange({from:g.from,to:g.to})},10)}return!1},paste:(f,p)=>{var m;const g=(m=p.clipboardData)==null?void 0:m.getData("text/html");return o=p,i=!!(g!=null&&g.includes("data-pm-slice")),!1}}},appendTransaction:(f,p,m)=>{const g=f[0],y=g.getMeta("uiEvent")==="paste"&&!i,j=g.getMeta("uiEvent")==="drop"&&!s,x=g.getMeta("applyPasteRules"),k=!!x;if(!y&&!j&&!k)return;if(k){let{text:w}=x;typeof w=="string"?w=w:w=ny(he.from(w),m.schema);const{from:E}=x,D=E+w.length,L=XD(w);return l({rule:d,state:m,from:E,to:{b:D},pasteEvt:L})}const N=p.doc.content.findDiffStart(m.doc.content),C=p.doc.content.findDiffEnd(m.doc.content);if(!(!JD(N)||!C||N===C.b))return l({rule:d,state:m,from:N,to:C,pasteEvt:o})}}))}var Dm=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=U2(t),this.schema=dD(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:xc(e.name,this.schema)},r=Be(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Xc([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:xc(r.name,this.schema)},s=[],o=Be(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&Be(r,"exitable",i)&&(a.ArrowRight=()=>ma.handleExit({editor:t,mark:r})),o){const p=Object.fromEntries(Object.entries(o()).map(([m,g])=>[m,()=>g({editor:t})]));a={...a,...p}}const l=pP(a);s.push(l);const u=Be(r,"addInputRules",i);if(sj(r,t.options.enableInputRules)&&u){const p=u();if(p&&p.length){const m=GD({editor:t,rules:p}),g=Array.isArray(m)?m:[m];s.push(...g)}}const d=Be(r,"addPasteRules",i);if(sj(r,t.options.enablePasteRules)&&d){const p=d();if(p&&p.length){const m=e5({editor:t,rules:p});s.push(...m)}}const f=Be(r,"addProseMirrorPlugins",i);if(f){const p=f();s.push(...p)}return s})}get attributes(){return F2(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=jl(this.extensions);return Object.fromEntries(e.filter(n=>!!Be(n,"addNodeView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Gt(n.name,this.schema)},s=Be(n,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const a=(l,u,d,f,p)=>{const m=Ou(l,r);return o({node:l,view:u,getPos:d,decorations:f,innerDecorations:p,editor:t,extension:n,HTMLAttributes:m})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return Xc([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:xc(i.name,this.schema)},o=Be(i,"dispatchTransaction",s);return o?a=>{o.call(s,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Xc([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:e,type:xc(i.name,this.schema)},o=Be(i,"transformPastedHTML",s);return o?(a,l)=>{const u=r(a,l);return o.call(s,u)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=jl(this.extensions);return Object.fromEntries(e.filter(n=>!!Be(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ls(n.name,this.schema)},s=Be(n,"addMarkView",i);if(!s)return[];const o=(a,l,u)=>{const d=Ou(a,r);return s()({mark:a,view:l,inline:u,editor:t,extension:n,HTMLAttributes:d,updateAttributes:f=>{m5(a,t,f)}})};return[n.name,o]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:xc(e.name,this.schema)};e.type==="mark"&&((n=bt(Be(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const i=Be(e,"onBeforeCreate",r),s=Be(e,"onCreate",r),o=Be(e,"onUpdate",r),a=Be(e,"onSelectionUpdate",r),l=Be(e,"onTransaction",r),u=Be(e,"onFocus",r),d=Be(e,"onBlur",r),f=Be(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}};Dm.resolve=U2;Dm.sort=Xc;Dm.flatten=ty;var t5={};Qv(t5,{ClipboardTextSerializer:()=>X2,Commands:()=>eC,Delete:()=>tC,Drop:()=>nC,Editable:()=>rC,FocusEvents:()=>sC,Keymap:()=>oC,Paste:()=>aC,Tabindex:()=>lC,TextDirection:()=>cC,focusEventsPluginKey:()=>iC});var Ft=class Q2 extends iy{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new Q2(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},X2=Ft.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ot({key:new Xt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(d=>d.$from.pos)),a=Math.max(...s.map(d=>d.$to.pos)),l=V2(n);return H2(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),eC=Ft.create({name:"commands",addCommands(){return{...z2}}}),tC=Ft.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var o,a,l,u;if((u=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?u:t.getMeta("y-sync$"))return;const d=$2(t.before,[t,...e]);W2(d).forEach(m=>{d.mapping.mapResult(m.oldRange.from).deletedAfter&&d.mapping.mapResult(m.oldRange.to).deletedBefore&&d.before.nodesBetween(m.oldRange.from,m.oldRange.to,(g,y)=>{const j=y+g.nodeSize-2,x=m.oldRange.from<=y&&j<=m.oldRange.to;this.editor.emit("delete",{type:"node",node:g,from:y,to:j,newFrom:d.mapping.map(y),newTo:d.mapping.map(j),deletedRange:m.oldRange,newRange:m.newRange,partial:!x,editor:this.editor,transaction:t,combinedTransform:d})})});const p=d.mapping;d.steps.forEach((m,g)=>{var y,j;if(m instanceof ii){const x=p.slice(g).map(m.from,-1),k=p.slice(g).map(m.to),N=p.invert().map(x,-1),C=p.invert().map(k),w=(y=d.doc.nodeAt(x-1))==null?void 0:y.marks.some(D=>D.eq(m.mark)),E=(j=d.doc.nodeAt(k))==null?void 0:j.marks.some(D=>D.eq(m.mark));this.editor.emit("delete",{type:"mark",mark:m.mark,from:m.from,to:m.to,deletedRange:{from:N,to:C},newRange:{from:x,to:k},partial:!!(E||w),editor:this.editor,transaction:t,combinedTransform:d})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),nC=Ft.create({name:"drop",addProseMirrorPlugins(){return[new Ot({key:new Xt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),rC=Ft.create({name:"editable",addProseMirrorPlugins(){return[new Ot({key:new Xt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),iC=new Xt("focusEvents"),sC=Ft.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ot({key:iC,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),oC=Ft.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:d,$anchor:f}=l,{pos:p,parent:m}=f,g=f.parent.isTextblock&&p>0?a.doc.resolve(p-1):f,y=g.parent.type.spec.isolating,j=f.pos-f.parentOffset,x=y&&g.parent.childCount===1?j===f.pos:rt.atStart(u).from===p;return!d||!m.type.isTextblock||m.textContent.length||!x||x&&f.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return hp()||L2()?s:i},addProseMirrorPlugins(){return[new Ot({key:new Xt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(y=>y.getMeta("composition")))return;const r=t.some(y=>y.docChanged)&&!e.doc.eq(n.doc),i=t.some(y=>y.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=rt.atStart(e.doc).from,u=rt.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!zm(n.doc))return;const p=n.tr,m=Tm({state:n,transaction:p}),{commands:g}=new Am({editor:this.editor,state:m});if(g.clearNodes(),!!p.steps.length)return p}})]}}),aC=Ft.create({name:"paste",addProseMirrorPlugins(){return[new Ot({key:new Xt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),lC=Ft.create({name:"tabindex",addProseMirrorPlugins(){return[new Ot({key:new Xt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),cC=Ft.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=jl(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ot({key:new Xt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),n5=class zc{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You canât set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new zc(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new zc(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new zc(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&!o&&l.depth<=this.depth)return;const u=new zc(l,this.editor,i,i||o?n:null);i&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},r5=`.ProseMirror { 53 position: relative; 54} 55 56.ProseMirror { 57 word-wrap: break-word; 58 white-space: pre-wrap; 59 white-space: break-spaces; 60 -webkit-font-variant-ligatures: none; 61 font-variant-ligatures: none; 62 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 63} 64 65.ProseMirror [contenteditable="false"] { 66 white-space: normal; 67} 68 69.ProseMirror [contenteditable="false"] [contenteditable="true"] { 70 white-space: pre-wrap; 71} 72 73.ProseMirror pre { 74 white-space: pre-wrap; 75} 76 77img.ProseMirror-separator { 78 display: inline !important; 79 border: none !important; 80 margin: 0 !important; 81 width: 0 !important; 82 height: 0 !important; 83} 84 85.ProseMirror-gapcursor { 86 display: none; 87 pointer-events: none; 88 position: absolute; 89 margin: 0; 90} 91 92.ProseMirror-gapcursor:after {
93 content: ""; 94 display: block; 95 position: absolute; 96 top: -2px; 97 width: 20px; 98 border-top: 1px solid black; 99 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 100} 101 102@keyframes ProseMirror-cursor-blink { 103 to { 104 visibility: hidden; 105 } 106} 107 108.ProseMirror-hideselection *::selection { 109 background: transparent; 110} 111 112.ProseMirror-hideselection *::-moz-selection { 113 background: transparent; 114} 115 116.ProseMirror-hideselection * { 117 caret-color: transparent; 118} 119 120.ProseMirror-focused .ProseMirror-gapcursor { 121 display: block; 122}`;function i5(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var s5=class extends KD{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:jD,createMappablePosition:wD},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=O2(e,this.options.autofocus);this.editorState=Qa.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=i5(r5,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}
vendor: 8,279 bytes, lines 122-124
122),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=B2(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(o=>!o.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[rC,X2.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),eC,sC,oC,lC,nC,aC,tC,cC.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Dm(r,this)}createCommandManager(){this.commandManager=new Am({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=cx(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=cx(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new M2(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(u)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return K2(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return vD(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ny(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=` 123 124`,textSerializers:n={}}=t||{};return pD(this.state.doc,{blockSeparator:e,textSerializers:{...V2(this.schema),...n}})}get isEmpty(){return zm(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new n5(e,this)}get $doc(){return this.$pos(0)}};function wl(t){return new Pm({find:t.find,handler:({state:e,range:n,match:r})=>{const i=bt(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),d=u+o.length;if(ry(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+l,u);const p=n.from+l+o.length;s.addMark(n.from+l,p,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function o5(t){return new Pm({find:t.find,handler:({state:e,range:n,match:r})=>{const i=bt(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let d=o+u;d>a?d=a:a=d+r[1].length;const f=r[0][r[0].length-1];s.insertText(f,o+r[0].length-1),s.replaceWith(d,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function dx(t){return new Pm({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=bt(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function Sl(t){return new Pm({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=bt(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&_v(l,t.type,s);if(!u)return null;if(o.wrap(l,u),t.keepMarks&&t.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:m}=t.editor.extensionManager,g=p||f.$to.parentOffset&&f.$from.marks();if(g){const y=g.filter(j=>m.includes(j.type.name));o.ensureMarks(y)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,s).run()}const d=o.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&bo(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&o.join(n.from-1)},undoable:t.undoable})}function a5(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof Ue){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}var l5={};Qv(l5,{createAtomBlockMarkdownSpec:()=>c5,createBlockMarkdownSpec:()=>u5,createInlineMarkdownSpec:()=>p5,parseAttributes:()=>sy,parseIndentedBlocks:()=>fx,renderNestedMarkdownContent:()=>ay,serializeAttributes:()=>oy});function sy(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}
124__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const u=i.map(d=>d.trim().slice(1));e.class=u.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,u,d])=>{var f;const p=parseInt(((f=d.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),m=n[p];m&&(e[u]=m.slice(1,-1))});const l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function oy(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function c5(t){const{nodeName:e,name:n,parseAttributes:r=sy,serializeAttributes:i=oy,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:a}=t,l=n||e,u=d=>{if(!a)return d;const f={};return a.forEach(p=>{p in d&&(f[p]=d[p])}),f};return{parseMarkdown:(d,f)=>{const p={...s,...d.attributes};return f.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(d){var f;const p=new RegExp(`^:::${l}(?:\\s|$)`,"m"),m=(f=d.match(p))==null?void 0:f.index;return m!==void 0?m:-1},tokenize(d,f,p){const m=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),g=d.match(m);if(!g)return;const y=g[1]||"",j=r(y);if(!o.find(k=>!(k in j)))return{type:e,raw:g[0],attributes:j}}},renderMarkdown:d=>{const f=u(d.attrs||{}),p=i(f),m=p?` {${p}}`:"";return`:::${l}${m} :::`}}}function u5(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=sy,serializeAttributes:s=oy,defaultAttributes:o={},content:a="block",allowedAttributes:l}=t,u=n||e,d=f=>{if(!l)return f;const p={};return l.forEach(m=>{m in f&&(p[m]=f[m])}),p};return{parseMarkdown:(f,p)=>{let m;if(r){const y=r(f);m=typeof y=="string"?[{type:"text",text:y}]:y}else a==="block"?m=p.parseChildren(f.tokens||[]):m=p.parseInline(f.tokens||[]);const g={...o,...f.attributes};return p.createNode(e,g,m)},markdownTokenizer:{name:e,level:"block",start(f){var p;const m=new RegExp(`^:::${u}`,"m"),g=(p=f.match(m))==null?void 0:p.index;return g!==void 0?g:-1},tokenize(f,p,m){var g;const y=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),j=f.match(y);if(!j)return;const[x,k=""]=j,N=i(k);let C=1;const w=x.length;let E="";const D=/^:::([\w-]*)(\s.*)?/gm,L=f.slice(w);for(D.lastIndex=0;;){const V=D.exec(L);if(V===null)break;const te=V.index,ae=V[1];if(!((g=V[2])!=null&&g.endsWith(":::"))){if(ae)C+=1;else if(C-=1,C===0){const ke=L.slice(0,te);E=ke.trim();const ge=f.slice(0,w+te+V[0].length);let Se=[];if(E)if(a==="block")for(Se=m.blockTokens(ke),Se.forEach(me=>{me.text&&(!me.tokens||me.tokens.length===0)&&(me.tokens=m.inlineTokens(me.text))});Se.length>0;){const me=Se[Se.length-1];if(me.type==="paragraph"&&(!me.text||me.text.trim()===""))Se.pop();else break}else Se=m.inlineTokens(E);return{type:e,raw:ge,attributes:N,content:E,tokens:Se}}}}}},renderMarkdown:(f,p)=>{const m=d(f.attrs||{}),g=s(m),y=g?` {${g}}`:"",j=p.renderChildren(f.content||[],` 125 126`);return`:::${u}${y} 127 128${j} 129 130:::`}}}function d5(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,i,s,o]=r;e[i]=s||o,r=n.exec(t)}return e}function f5(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function p5(t){const{nodeName:e,name:n,getContent:r,parseAttributes:i=d5,serializeAttributes:s=f5,defaultAttributes:o={},selfClosing:a=!1,allowedAttributes:l}=t,u=n||e,d=p=>{if(!l)return p;const m={};return l.forEach(g=>{const y=typeof g=="string"?g:g.name,j=typeof g=="string"?void 0:g.skipIfDefault;if(y in p){const x=p[y];if(j!==void 0&&x===j)return;m[y]=x}}),m},f=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(p,m)=>{const g={...o,...p.attributes};if(a)return m.createNode(e,g);const y=r?r(p):p.content||"";return y?m.createNode(e,g,[m.createTextNode(y)]):m.createNode(e,g,[])},markdownTokenizer:{name:e,level:"inline",start(p){const m=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),g=p.match(m),y=g==null?void 0:g.index;return y!==void 0?y:-1},tokenize(p,m,g){const y=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),j=p.match(y);if(!j)return;let x="",k="";if(a){const[,C]=j;k=C}else{const[,C,w]=j;k=C,x=w||""}const N=i(k.trim());return{type:e,raw:j[0],content:x.trim(),attributes:N}}},renderMarkdown:p=>{let m="";r?m=r(p):p.content&&p.content.length>0&&(m=p.content.filter(x=>x.type==="text").map(x=>x.text).join(""));const g=d(p.attrs||{}),y=s(g),j=y?` ${y}`:"";return a?`[${u}${j}]`:`[${u}${j}]${m}[/${u}]`}}
vendor: 5,747 bytes, lines 130-139
130}function fx(t,e,n){var r,i,s,o;const a=t.split(` 131`),l=[];let u="",d=0;const f=e.baseIndentSize||2;for(;d<a.length;){const p=a[d],m=p.match(e.itemPattern);if(!m){if(l.length>0)break;if(p.trim()===""){d+=1,u=`${u}${p} 132`;continue}else return}const g=e.extractItemData(m),{indentLevel:y,mainContent:j}=g;u=`${u}${p} 133`;const x=[j];for(d+=1;d<a.length;){const w=a[d];if(w.trim()===""){const D=a.slice(d+1).findIndex(te=>te.trim()!=="");if(D===-1)break;if((((i=(r=a[d+1+D].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>y){x.push(w),u=`${u}${w} 134`,d+=1;continue}else break}if((((o=(s=w.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>y)x.push(w),u=`${u}${w} 135`,d+=1;else break}let k;const N=x.slice(1);if(N.length>0){const w=N.map(E=>E.slice(y+f)).join(` 136`);w.trim()&&(e.customNestedParser?k=e.customNestedParser(w):k=n.blockTokens(w))}const C=e.createToken(g,k);l.push(C)}if(l.length!==0)return{items:l,raw:u}}function ay(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[s,...o]=t.content,a=e.renderChildren([s]),l=[`${i}${a}`];return o&&o.length>0&&o.forEach(u=>{const d=e.renderChildren([u]);if(d){const f=d.split(` 137`).map(p=>p?e.indent(p):"").join(` 138`);l.push(f)}}),l.join(` 139`)}function m5(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,o=t;i.descendants((a,l)=>{const u=s.mapping.map(l),d=s.mapping.map(l)+a.nodeSize;let f=null;if(a.marks.forEach(m=>{if(m!==o)return!1;f=m}),!f)return;let p=!1;if(Object.keys(n).forEach(m=>{n[m]!==f.attrs[m]&&(p=!0)}),p){const m=t.type.create({...t.attrs,...n});s.removeMark(u,d,t.type),s.addMark(u,d,m)}}),s.docChanged&&e.view.dispatch(s)}var jr=class uC extends iy{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new uC(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function ca(t){return new ZD({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=bt(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const d=l.search(/\S/),f=n.from+l.indexOf(a),p=f+a.length;if(ry(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(j=>j===t.type&&j!==g.mark.type)).filter(g=>g.to>f).length)return null;p<n.to&&o.delete(p,n.to),f>n.from&&o.delete(n.from+d,f),u=n.from+d+a.length,o.addMark(n.from+d,u,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}const h5="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
139ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",g5="ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
139ºÐ´2он1Ñква6онлайн5Ñг3ÑÑÑ2Ñ2ÑайÑ3Ñб3ÑкÑ3Òаз3Õ°Õ¡Õµ3×שר××5×§××3Ø§Ø¨ÙØ¸Ø¨Ù5را٠ÙÙ5ÙØ§Ø±Ø¯Ù4Ø¨ØØ±ÙÙ5جزائر5Ø³Ø¹ÙØ¯ÙØ©6عÙÙØ§Ù5٠غرب5٠ارات5ÛØ±Ø§Ù5بارت2زار4ÙØªÙ3ھارت5تÙÙØ³4Ø³ÙØ¯Ø§Ù3Ø±ÙØ©5Ø´Ø¨ÙØ©4عراÙ2ب2٠اÙ4ÙÙØ³Ø·ÙÙ6ÙØ·Ø±3ÙØ§Ø«ÙÙÙÙ6ÙÙ 3٠صر2ÙÙØ³Ùا5ÙØ±ÙتاÙÙØ§7ÙØ¹4Ù٠راÙ5پاکستاÙ7ÚØ§Ø±Øª4à¤à¥à¤®3नà¥à¤3à¤à¤¾à¤°à¤¤0मà¥3à¥à¤¤5सà¤à¤à¤ न5বাà¦à¦²à¦¾5à¦à¦¾à¦°à¦¤2ৰত4à¨à¨¾à¨°à¨¤4àªàª¾àª°àª¤4à¬à¬¾à¬°à¬¤4à®à®¨à¯à®¤à®¿à®¯à®¾6லà®à¯à®à¯6à®à®¿à®à¯à®à®ªà¯à®ªà¯à®°à¯11à°à°¾à°°à°¤à±5à²à²¾à²°à²¤4à´à´¾à´°à´¤à´5à¶½à¶à¶à·4à¸à¸à¸¡3à¹à¸à¸¢3ລາວ3áá2ã¿ããª3ã¢ãã¾ã³4ã¯ã©ã¦ã4ã°ã¼ã°ã«4ã³ã 2ã¹ãã¢3ã»ã¼ã«3ãã¡ãã·ã§ã³6ãã¤ã³ã4ä¸ç2ä¸ä¿¡1å½1å1æç½3äºé©¬é3ä¼ä¸2ä½å±±2ä¿¡æ¯2å¥åº·2å «å¦2å ¬å¸1ç2å°æ¹¾1ç£2åå1åº1æ 2åé0大é åº5å¨çº¿2大æ¿2天主æ3娱ä¹2å®¶é»2广ä¸2å¾®å2æ å2æç±ä½ 3ææº2æè2æ¿å¡1åº2æ°å å¡2é»2æ¶å°2æ¸ç±2æºæ2淡马é¡3游æ2æ¾³é2ç¹ç2ç§»å¨2ç»ç»æºæ4ç½å1åº1ç«1ç»2èé2è°·æ2è´ç©2é販2éå¢2é»è¨çç§4é£å©æµ¦3é£å2é¤å 2馿 ¼éæ3港2ë·ë·1ì»´2ì¼ì±2íêµ2",px="numeric",mx="ascii",hx="alpha",eu="asciinumeric",Pc="alphanumeric",gx="domain",dC="emoji",b5="scheme",x5="slashscheme",og="whitespace";function v5(t,e){return t in e||(e[t]=[]),e[t]}function Uo(t,e,n){e[px]&&(e[eu]=!0,e[Pc]=!0),e[mx]&&(e[eu]=!0,e[hx]=!0),e[eu]&&(e[Pc]=!0),e[hx]&&(e[Pc]=!0),e[Pc]&&(e[gx]=!0),e[dC]&&(e[gx]=!0);for(const r in e){const i=v5(r,n);i.indexOf(t)<0&&i.push(t)}}function y5(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function er(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}er.groups={};er.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){r=r||er.groups;let i;return e&&e.j?i=e:(i=new er(e),n&&r&&Uo(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const s=t.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(t[o]);return i.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||er.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let o,a=i.go(t);if(a?(o=new er,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new er,s){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(y5(o.t,r),n);Uo(s,l,r)}else n&&Uo(s,n,r);o.t=s}return i.j[t]=o,o}};const nt=(t,e,n,r,i)=>t.ta(e,n,r,i),Lt=(t,e,n,r,i)=>t.tr(e,n,r,i),lj=(t,e,n,r,i)=>t.ts(e,n,r,i),ve=(t,e,n,r,i)=>t.tt(e,n,r,i),Vi="WORD",bx="UWORD",fC="ASCIINUMERICAL",pC="ALPHANUMERICAL",_u="LOCALHOST",xx="TLD",vx="UTLD",Cf="SCHEME",La="SLASH_SCHEME",ly="NUM",yx="WS",cy="NL",tu="OPENBRACE",nu="CLOSEBRACE",gp="OPENBRACKET",bp="CLOSEBRACKET",xp="OPENPAREN",vp="CLOSEPAREN",yp="OPENANGLEBRACKET",kp="CLOSEANGLEBRACKET",jp="FULLWIDTHLEFTPAREN",wp="FULLWIDTHRIGHTPAREN",Sp="LEFTCORNERBRACKET",Np="RIGHTCORNERBRACKET",Cp="LEFTWHITECORNERBRACKET",Ep="RIGHTWHITECORNERBRACKET",Tp="FULLWIDTHLESSTHAN",Ap="FULLWIDTHGREATERTHAN",Mp="AMPERSAND",Ip="APOSTROPHE",zp="ASTERISK",_s="AT",Pp="BACKSLASH",Dp="BACKTICK",Op="CARET",Fs="COLON",uy="COMMA",_p="DOLLAR",ji="DOT",Lp="EQUALS",dy="EXCLAMATION",Mr="HYPHEN",ru="PERCENT",Rp="PIPE",$p="PLUS",Bp="POUND",iu="QUERY",fy="QUOTE",mC="FULLWIDTHMIDDLEDOT",py="SEMI",wi="SLASH",su="TILDE",Fp="UNDERSCORE",hC="EMOJI",Up="SYM";var gC=Object.freeze({__proto__:null,ALPHANUMERICAL:pC,AMPERSAND:Mp,APOSTROPHE:Ip,ASCIINUMERICAL:fC,ASTERISK:zp,AT:_s,BACKSLASH:Pp,BACKTICK:Dp,CARET:Op,CLOSEANGLEBRACKET:kp,CLOSEBRACE:nu,CLOSEBRACKET:bp,CLOSEPAREN:vp,COLON:Fs,COMMA:uy,DOLLAR:_p,DOT:ji,EMOJI:hC,EQUALS:Lp,EXCLAMATION:dy,FULLWIDTHGREATERTHAN:Ap,FULLWIDTHLEFTPAREN:jp,FULLWIDTHLESSTHAN:Tp,FULLWIDTHMIDDLEDOT:mC,FULLWIDTHRIGHTPAREN:wp,HYPHEN:Mr,LEFTCORNERBRACKET:Sp,LEFTWHITECORNERBRACKET:Cp,LOCALHOST:_u,NL:cy,NUM:ly,OPENANGLEBRACKET:yp,OPENBRACE:tu,OPENBRACKET:gp,OPENPAREN:xp,PERCENT:ru,PIPE:Rp,PLUS:$p,POUND:Bp,QUERY:iu,QUOTE:fy,RIGHTCORNERBRACKET:Np,RIGHTWHITECORNERBRACKET:Ep,SCHEME:Cf,SEMI:py,SLASH:wi,SLASH_SCHEME:La,SYM:Up,TILDE:su,TLD:xx,UNDERSCORE:Fp,UTLD:vx,UWORD:bx,WORD:Vi,WS:yx});const Ui=/[a-z]/,vc=new RegExp("\\p{L}","u"),ag=new RegExp("\\p{Emoji}","u"),Hi=/\d/,lg=/\s/,cj="\r",cg=` 140`,k5="ï¸",j5="â",ug="";let Ud=null,Hd=null;function w5(t=[]){const e={};er.groups=e;const n=new er;Ud==null&&(Ud=uj(h5)),Hd==null&&(Hd=uj(g5)),ve(n,"'",Ip),ve(n,"{",tu),ve(n,"}",nu),ve(n,"[",gp),ve(n,"]",bp),ve(n,"(",xp),ve(n,")",vp),ve(n,"<",yp),ve(n,">",kp),ve(n,"ï¼",jp),ve(n,"ï¼",wp),ve(n,"ã",Sp),ve(n,"ã",Np),ve(n,"ã",Cp),ve(n,"ã",Ep),ve(n,"ï¼",Tp),ve(n,"ï¼",Ap),ve(n,"&",Mp),ve(n,"*",zp),ve(n,"@",_s),ve(n,"`",Dp),ve(n,"^",Op),ve(n,":",Fs),ve(n,",",uy),ve(n,"$",_p),ve(n,".",ji),ve(n,"=",Lp),ve(n,"!",dy),ve(n,"-",Mr),ve(n,"%",ru),ve(n,"|",Rp),ve(n,"+",$p),ve(n,"#",Bp),ve(n,"?",iu),ve(n,'"',fy),ve(n,"/",wi),ve(n,";",py),ve(n,"~",su),ve(n,"_",Fp),ve(n,"\\",Pp),ve(n,"ã»",mC);const r=Lt(n,Hi,ly,{[px]:!0});Lt(r,Hi,r);const i=Lt(r,Ui,fC,{[eu]:!0}),s=Lt(r,vc,pC,{[Pc]:!0}),o=Lt(n,Ui,Vi,{[mx]:!0});Lt(o,Hi,i),Lt(o,Ui,o),Lt(i,Hi,i),Lt(i,Ui,i);const a=Lt(n,vc,bx,{[hx]:!0});Lt(a,Ui),Lt(a,Hi,s),Lt(a,vc,a),Lt(s,Hi,s),Lt(s,Ui),Lt(s,vc,s);const l=ve(n,cg,cy,{[og]:!0}
vendor: 9,747 bytes, lines 140-143
140),u=ve(n,cj,yx,{[og]:!0}),d=Lt(n,lg,yx,{[og]:!0});ve(n,ug,d),ve(u,cg,l),ve(u,ug,d),Lt(u,lg,d),ve(d,cj),ve(d,cg),Lt(d,lg,d),ve(d,ug,d);const f=Lt(n,ag,hC,{[dC]:!0});ve(f,"#"),Lt(f,ag,f),ve(f,k5,f);const p=ve(f,j5);ve(p,"#"),Lt(p,ag,f);const m=[[Ui,o],[Hi,i]],g=[[Ui,null],[vc,a],[Hi,s]];for(let y=0;y<Ud.length;y++)ws(n,Ud[y],xx,Vi,m);for(let y=0;y<Hd.length;y++)ws(n,Hd[y],vx,bx,g);Uo(xx,{tld:!0,ascii:!0},e),Uo(vx,{utld:!0,alpha:!0},e),ws(n,"file",Cf,Vi,m),ws(n,"mailto",Cf,Vi,m),ws(n,"http",La,Vi,m),ws(n,"https",La,Vi,m),ws(n,"ftp",La,Vi,m),ws(n,"ftps",La,Vi,m),Uo(Cf,{scheme:!0,ascii:!0},e),Uo(La,{slashscheme:!0,ascii:!0},e),t=t.sort((y,j)=>y[0]>j[0]?1:-1);for(let y=0;y<t.length;y++){const j=t[y][0],k=t[y][1]?{[b5]:!0}:{[x5]:!0};j.indexOf("-")>=0?k[gx]=!0:Ui.test(j)?Hi.test(j)?k[eu]=!0:k[mx]=!0:k[px]=!0,lj(n,j,j,k)}return lj(n,"localhost",_u,{ascii:!0}),n.jd=new er(Up),{start:n,tokens:Object.assign({groups:e},gC)}}function bC(t,e){const n=S5(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let a=t,l=null,u=0,d=null,f=-1,p=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(f=0,p=0,d=a):f>=0&&(f+=n[o].length,p++),u+=n[o].length,s+=n[o].length,o++;s-=f,o-=p,u-=f,i.push({t:d.t,v:e.slice(s-u,s),s:s-u,e:s})}return i}function S5(t){const e=[],n=t.length;let r=0;for(;r<n;){let i=t.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function ws(t,e,n,r,i){let s;const o=e.length;for(let a=0;a<o-1;a++){const l=e[a];t.j[l]?s=t.j[l]:(s=new er(r),s.jr=i.slice(),t.j[l]=s),t=s}return s=new er(n),s.jr=i.slice(),t.j[e[o-1]]=s,s}function uj(t){const e=[],n=[];let r=0,i="0123456789";for(;r<t.length;){let s=0;for(;i.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Lu={defaultProtocol:"http",events:null,format:dj,formatHref:dj,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function my(t,e=null){let n=Object.assign({},Lu);t&&(n=Object.assign(n,t instanceof my?t.o:t));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}my.prototype={o:Lu,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:Lu[t],typeof i=="function"&&r&&(i=i(e,n))):typeof i=="function"&&r&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function dj(t){return t}function xC(t,e){this.t="token",this.v=t,this.tk=e}xC.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"â¦":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Lu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),d=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),u&&(o.rel=u),d&&Object.assign(o,d),{tagName:i,attributes:o,content:s,eventListeners:f}}};function Om(t,e){class n extends xC{constructor(i,s){super(i,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const fj=Om("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),pj=Om("text"),N5=Om("nl"),Vd=Om("url",{isLink:!0,toHref(t=Lu.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==_u&&t[1].t===Fs}}),Tr=t=>new er(t);function C5({groups:t}){const e=t.domain.concat([Mp,zp,_s,Pp,Dp,Op,_p,Lp,Mr,ly,ru,Rp,$p,Bp,wi,Up,su,Fp]),n=[Ip,Fs,uy,ji,dy,ru,iu,fy,py,yp,kp,tu,nu,bp,gp,xp,vp,jp,wp,Sp,Np,Cp,Ep,Tp,Ap],r=[Mp,Ip,zp,Pp,Dp,Op,_p,Lp,Mr,tu,nu,ru,Rp,$p,Bp,iu,wi,Up,su,Fp],i=Tr(),s=ve(i,su);nt(s,r,s),nt(s,t.domain,s);const o=Tr(),a=Tr(),l=Tr();nt(i,t.domain,o),nt(i,t.scheme,a),nt(i,t.slashscheme,l),nt(o,r,s),nt(o,t.domain,o);const u=ve(o,_s);ve(s,_s,u),ve(a,_s,u),ve(l,_s,u);const d=ve(s,ji);nt(d,r,s),nt(d,t.domain,s);const f=Tr();nt(u,t.domain,f),nt(f,t.domain,f);const p=ve(f,ji);nt(p,t.domain,f);const m=Tr(fj);nt(p,t.tld,m),nt(p,t.utld,m),ve(u,_u,m);const g=ve(f,Mr);ve(g,Mr,g),nt(g,t.domain,f),nt(m,t.domain,f),ve(m,ji,p),ve(m,Mr,g);const y=ve(m,Fs);nt(y,t.numeric,fj);const j=ve(o,Mr),x=ve(o,ji);ve(j,Mr,j),nt(j,t.domain,o),nt(x,r,s),nt(x,t.domain,o);const k=Tr(Vd);nt(x,t.tld,k),nt(x,t.utld,k),nt(k,t.domain,o),nt(k,r,s),ve(k,ji,x),ve(k,Mr,j),ve(k,_s,u);const N=ve(k,Fs),C=Tr(Vd);nt(N,t.numeric,C);const w=Tr(Vd),E=Tr();nt(w,e,w),nt(w,n,E),nt(E,e,w),nt(E,n,E),ve(k,wi,w),ve(C,wi,w);const D=ve(a,Fs),L=ve(l,Fs),V=ve(L,wi),te=ve(V,wi);nt(a,t.domain,o),ve(a,ji,x),ve(a,Mr,j),nt(l,t.domain,o),ve(l,ji,x),ve(l,Mr,j),nt(D,t.domain,w),ve(D,wi,w),ve(D,iu,w),nt(te,t.domain,w),nt(te,e,w),ve(te,wi,w);const ae=[[tu,nu],[gp,bp],[xp,vp],[yp,kp],[jp,wp],[Sp,Np],[Cp,Ep],[Tp,Ap]];for(let ke=0;ke<ae.length;ke++){const[ge,Se]=ae[ke],me=ve(w,ge);ve(E,ge,me),ve(me,Se,w);const H=Tr(Vd);nt(me,e,H);const P=Tr();nt(me,n),nt(H,e,H),nt(H,n,P),nt(P,e,H),nt(P,n,P),ve(H,Se,w),ve(P,Se,w)}return ve(i,_u,k),ve(i,cy,N5),{start:i,tokens:gC}}function E5(t,e,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let a=t,l=null,u=null,d=0,f=null,p=-1;for(;i<r&&!(l=a.go(n[i].t));)o.push(n[i++]);for(;i<r&&(u=l||a.go(n[i].t));)l=null,a=u,a.accepts()?(p=0,f=a):p>=0&&p++,i++,d++;if(p<0)i-=d,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(dg(pj,e,o)),o=[]),i-=p,d-=p;const m=f.t,g=n.slice(i-d,i);s.push(dg(m,e,g))}}return o.length>0&&s.push(dg(pj,e,o)),s}function dg(t,e,n){const r=n[0].s,i=n[n.length-1].e,s=e.slice(r,i);return new t(s,n)}const T5=typeof console<"u"&&console&&console.warn||(()=>{}),A5="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Et={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function M5(){return er.groups={},Et.scanner=null,Et.parser=null,Et.tokenQueue=[],Et.pluginQueue=[],Et.customSchemes=[],Et.initialized=!1,Et}function mj(t,e=!1){if(Et.initialized&&T5(`linkifyjs: already initialized - will not register custom scheme "${t}" ${A5}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1411. Must only contain digits, lowercase ASCII letters or "-" 1422. Cannot start or end with "-" 1433. "-" cannot repeat`);Et.customSchemes.push([t,e])}function I5(){Et.scanner=w5(Et.customSchemes);for(let t=0;t<Et.tokenQueue.length;t++)Et.tokenQueue[t][1]({scanner:Et.scanner});Et.parser=C5(Et.scanner.tokens);for(let t=0;t<Et.pluginQueue.length;t++)Et.pluginQueue[t][1]({scanner:Et.scanner,parser:Et.parser});return Et.initialized=!0,Et}function hy(t){return Et.initialized||I5(),E5(Et.parser.start,t,bC(Et.scanner.start,t))}hy.scan=bC;function vC(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new my(n),i=hy(t),s=[];for(let o=0;o<i.length;o++){const a=i[o];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}var gy="[\0-  áá â-\u2029âã]",z5=new RegExp(gy),P5=new RegExp(`${gy}$`),D5=new RegExp(gy,"g");function O5(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function _5(t){return new Ot({key:new Xt("autolink"),appendTransaction:(e,n,r)=>{const i=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=$2(n.doc,[...e]);if(W2(a).forEach(({newRange:u})=>{const d=oD(r.doc,u,m=>m.isTextblock);let f,p;if(d.length>1)f=d[0],p=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(d.length){const m=r.doc.textBetween(u.from,u.to," "," ");if(!P5.test(m))return;f=d[0],p=r.doc.textBetween(f.pos,u.to,void 0," ")}if(f&&p){const m=p.split(z5).filter(Boolean);if(m.length<=0)return!1;const g=m[m.length-1],y=f.pos+p.lastIndexOf(g);if(!g)return!1;const j=hy(g).map(x=>x.toObject(t.defaultProtocol));if(!O5(j))return!1;j.filter(x=>x.isLink).map(x=>({...x,from:y+x.start+1,to:y+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate(x.value)).filter(x=>t.shouldAutoLink(x.value)).forEach(x=>{ry(x.from,x.to,r.doc).some(k=>k.mark.type===t.type)||o.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!o.steps.length)return o}})}function L5(t){return new Ot({key:new Xt("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const l=r.target;if(!l)return!1;const u=t.editor.view.dom;o=l.closest("a"),o&&!u.contains(o)&&(o=null)}if(!o)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const l=K2(e.state,t.type.n
vendor: 3,978 bytes, line 143
143ame),u=(i=o.href)!=null?i:l.href,d=(s=o.target)!=null?s:l.target;u&&(window.open(u,d),a=!0)}return a}}})}function R5(t){return new Ot({key:new Xt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:i}=t,{state:s}=e,{selection:o}=s,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const u=vC(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u||i!==void 0&&!i(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function Mo(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(D5,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var yC=ma.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){mj(t);return}mj(t.scheme,t.optionalSlashes)})},onDestroy(){M5()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Mo(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const i=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Mo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Mo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",qt(this.options.HTMLAttributes,t),0]:["a",qt(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,i,s;const o=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",a=(s=(i=t.attrs)==null?void 0:i.title)!=null?s:"",l=e.renderChildren(t);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Mo(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Mo(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ca({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=vC(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Mo(o,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e}
vendor: 10,853 bytes, lines 143-168
143,type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(_5({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Mo(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(L5({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(R5({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),$5=yC,Hp=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},B5=/^\s*>\s$/,F5=jr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Hp("blockquote",{...qt(this.options.HTMLAttributes,t),children:Hp("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach(i=>{const a=e.renderChildren([i]).split(` 144`).map(l=>l.trim()===""?n:`${n} ${l}`);r.push(a.join(` 145`))}),r.join(` 146${n} 147`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Sl({find:B5,type:this.type})]}}),U5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,H5=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,V5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,K5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,W5=ma.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Hp("strong",{...qt(this.options.HTMLAttributes,t),children:Hp("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[wl({find:U5,type:this.type}),wl({find:V5,type:this.type})]},addPasteRules(){return[ca({find:H5,type:this.type}),ca({find:K5,type:this.type})]}}),G5=/(^|[^`])`([^`]+)`(?!`)$/,q5=/(^|[^`])`([^`]+)`(?!`)/g,J5=ma.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[wl({find:G5,type:this.type})]},addPasteRules(){return[ca({find:q5,type:this.type})]}}),fg=4,Z5=/^```([a-z]+)?[\s\n]$/,Y5=/^~~~([a-z]+)?[\s\n]$/,Q5=jr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:fg,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",qt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const i=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(` 148`):r=`\`\`\`${i} 149 150\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:fg,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?t.commands.insertContent(a):t.commands.command(({tr:l})=>{const{from:u,to:d}=i,m=r.doc.textBetween(u,d,` 151`,` 152`).split(` 153`).map(g=>a+g).join(` 154`);return l.replaceWith(u,d,r.schema.text(m)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:fg,{state:r}=t,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?t.commands.command(({tr:a})=>{var l;const{pos:u}=s,d=s.start(),f=s.end(),m=r.doc.textBetween(d,f,` 155`,` 156`).split(` 157`);let g=0,y=0;const j=u-d;for(let E=0;E<m.length;E+=1){if(y+m[E].length>=j){g=E;break}y+=m[E].length+1}const k=((l=m[g].match(/^ */))==null?void 0:l[0])||"",N=Math.min(k.length,n);if(N===0)return!0;let C=d;for(let E=0;E<g;E+=1)C+=m[E].length+1;return a.delete(C,C+N),u-C<=N&&a.setSelection(Ze.create(a.doc,C)),!0}):t.commands.command(({tr:a})=>{const{from:l,to:u}=i,p=r.doc.textBetween(l,u,` 158`,` 159`).split(` 160`).map(m=>{var g;const y=((g=m.match(/^ */))==null?void 0:g[0])||"",j=Math.min(y.length,n);return m.slice(j)}).join(` 161`);return a.replaceWith(l,u,r.schema.text(p)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` 162 163`);return!s||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(rt.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[dx({find:Z5,type:this.type,getAttributes:t=>({language:t[1]})}),dx({find:Y5,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ot({key:new Xt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,` 164`));return o.replaceSelectionWith(this.type.create({language:s},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(Ze.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),X5=jr.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 165 166`):""}),eO=jr.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",qt(this.options.HTMLAttributes,t)]},renderText(){return` 167`},renderMarkdown:()=>` 168`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&l&&o){const f=l.filter(p=>a.includes(p.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),tO=jr.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,qt(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(r);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>dx({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
168)\\s$`),type:this.type,getAttributes:{level:t}}))}}),nO=jr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",qt(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!a5(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,i=t();return G2(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(Ze.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(Ue.create(o.doc,l.pos)):o.setSelection(Ze.create(o.doc,l.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,f=d==null?void 0:d.create();f&&(o.insert(u,f),o.setSelection(Ze.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[o5({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
vendor: 14,499 bytes, lines 168-179
168ype})]}}),rO=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,iO=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,sO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,oO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,aO=ma.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[wl({find:rO,type:this.type}),wl({find:sO,type:this.type})]},addPasteRules(){return[ca({find:iO,type:this.type}),ca({find:oO,type:this.type})]}}),lO=Object.defineProperty,cO=(t,e)=>{for(var n in e)lO(t,n,{get:e[n],enumerable:!0})},uO="listItem",hj="textStyle",gj=/^\s*([-+*])\s$/,kC=jr.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 169`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(uO,this.editor.getAttributes(hj)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Sl({find:gj,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Sl({find:gj,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(hj),editor:this.editor})),[t]}}),jC=jr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(i=>i.type==="paragraph"))n=e.parseChildren(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const o=t.tokens.slice(1),a=e.parseChildren(o);n.push(...a)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>ay(t,e,r=>{var i,s;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),dO={};cO(dO,{findListItemPos:()=>qu,getNextListDepth:()=>by,handleBackspace:()=>kx,handleDelete:()=>jx,hasListBefore:()=>wC,hasListItemAfter:()=>fO,hasListItemBefore:()=>SC,listItemHasSubList:()=>NC,nextListIsDeeper:()=>CC,nextListIsHigher:()=>EC});var qu=(t,e)=>{const{$from:n}=e.selection,r=Gt(t,e.schema);let i=null,s=n.depth,o=n.pos,a=null;for(;s>0&&a===null;)i=n.node(s),i.type===r?a=s:(s-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},by=(t,e)=>{const n=qu(t,e);if(!n)return!1;const[,r]=bD(e,t,n.$pos.pos+4);return r},wC=(t,e,n)=>{const{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},SC=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},NC=(t,e,n)=>{if(!n)return!1;const r=Gt(t,e.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},kx=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!fo(t.state,e)&&wC(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),u=[];l.node().descendants((p,m)=>{p.type.name===e&&u.push({node:p,pos:m})});const d=u.at(-1);if(!d)return!1;const f=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},f.end()).joinForward().run()}if(!fo(t.state,e)||!kD(t.state))return!1;const r=qu(e,t.state);if(!r)return!1;const s=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=NC(e,t.state,s);return SC(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},CC=(t,e)=>{const n=by(t,e),r=qu(t,e);return!r||!n?!1:n>r.depth},EC=(t,e)=>{const n=by(t,e),r=qu(t,e);return!r||!n?!1:n<r.depth},jx=(t,e)=>{if(!fo(t.state,e)||!yD(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:CC(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():EC(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},fO=(t,e)=>{var n;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},TC=Ft.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&jx(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&jx(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&kx(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&kx(t,n,r)&&(e=!0)}),e}}}}),bj=/^(\s*)(\d+)\.\s+(.*)$/,pO=/^\s/;function mO(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n],s=i.match(bj);if(!s)break;const[,o,a,l]=s,u=o.length;let d=l,f=n+1;const p=[i];for(;f<t.length;){const m=t[f];if(m.match(bj))break;if(m.trim()==="")p.push(m),d+=` 170`,f+=1;else if(m.match(pO))p.push(m),d+=` 171${m.slice(u+2)}`,f+=1;else break}e.push({indent:u,number:parseInt(a,10),content:d.trim(),raw:p.join(` 172`)}),r=f,n=f}return[e,r]}function AC(t,e,n){var r;const i=[];let s=0;for(;s<t.length;){const o=t[s];if(o.indent===e){const a=o.content.split(` 173`),l=((r=a[0])==null?void 0:r.trim())||"",u=[];l&&u.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.slice(1).join(` 174`).trim();if(d){const m=n.blockTokens(d);u.push(...m)}let f=s+1;const p=[];for(;f<t.length&&t[f].indent>e;)p.push(t[f]),f+=1;if(p.length>0){const m=Math.min(...p.map(y=>y.indent)),g=AC(p,m,n);u.push({type:"list",ordered:!0,start:p[0].number,items:g,raw:p.map(y=>y.raw).join(` 175`)})}i.push({type:"list_item",raw:o.raw,tokens:u}),s=f}else s+=1}return i}function hO(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=e.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var gO="listItem",xj="textStyle",vj=/^(\d+)\.\s$/,MC=jr.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",qt(this.options.HTMLAttributes,n),0]:["ol",qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.items?hO(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 176`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const i=t.split(` 177`),[s,o]=mO(i);if(s.length===0)return;const a=AC(s,0,n);return a.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:a,raw:i.slice(0,o).join(` 178`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(gO,this.editor.getAttributes(xj)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Sl({find:vj,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Sl({find:vj,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(xj)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),bO=/^\s*(\[([( |x])?\])\s$/,xO=jr.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",qt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const i=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return ay(t,e,i)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),u=f=>{var p,m;a.ariaLabel=((m=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:m.call(p,f,a.checked))||`Task item checkbox for ${f.textContent||"empty task item"}`};u(t),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",f=>f.preventDefault()),a.addEventListener("change",f=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:p}=f.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:m})=>{const g=n();if(typeof g!="number")return!1;const y=m.doc.nodeAt(g);return m.setNodeMarkup(g,void 0,{...y==null?void 0:y.attrs,checked:p}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,p])=>{i.setAttribute(f,p)}),i.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,s.append(a,o),i.append(s,l),Object.entries(e).forEach(([f,p])=>{i.setAttribute(f,p)});let d=new Set(Object.keys(e));return{dom:i,contentDOM:l,update:f=>{if(f.type!==this.type)return!1;i.dataset.checked=f.attrs.checked,a.checked=f.attrs.checked,u(f);const p=r.extensionManager.attributes,m=Ou(f,p),g=new Set(Object.keys(m)),y=this.options.HTMLAttributes;return d.forEach(j=>{g.has(j)||(j in y?i.setAttribute(j,y[j]):i.removeAttribute(j))}),Object.entries(m).forEach(([j,x])=>{x==null?j in y?i.setAttribute(j,y[j]):i.removeAttribute(j):i.setAttribute(j,x)}),d=g,!0}}}},addInputRules(){return[Sl({find:bO,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),vO=jr.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",qt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 179`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const o=fx(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>
vendor: 4,800 bytes, line 179
179({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(s)},i=fx(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ft.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(kC.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(jC.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(TC.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(MC.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(xO.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(vO.configure(this.options.taskList)),t}});var yj=" ",yO="Â ",kO=jr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",qt(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===yj||r[0].text===yO)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];return n.length===0?yj:e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),jO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,wO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,SO=ma.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[wl({find:jO,type:this.type})]},addPasteRules(){return[ca({find:wO,type:this.type})]}}),NO=jr.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),IC=ma.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",qt(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),CO=IC;function EO(t={}){return new Ot({view(e){return new TO(e,t)}})}class TO{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}
vendor: 4,302 bytes, line 179
179})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(n){let f=e.nodeBefore,p=e.nodeAfter;if(f||p){let m=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(m){let g=m.getBoundingClientRect(),y=f?g.bottom:g.top;f&&p&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let j=this.width/2*a;r={left:g.left,right:g.right,top:y-j,bottom:y+j}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*o;r={left:f.left-p,right:f.left+p,top:f.top,bottom:f.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,d=-pageYOffset;else{let f=l.getBoundingClientRect(),p=f.width/l.offsetWidth,m=f.height/l.offsetHeight;u=f.left-l.scrollLeft*p,d=f.top-l.scrollTop*m}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=MN(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class $t extends rt{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return $t.valid(r)?new $t(r):rt.near(r)}content(){return Ae.empty}eq(e){return e instanceof $t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new $t(e.resolve(n.pos))}getBookmark(){return new xy(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!AO(e)||!MO(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&$t.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){s=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=n;let l=e.doc.resolve(i);if($t.valid(l))return l}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!Ue.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let a=e.doc.resolve(i);if($t.valid(a))return a}return null}}}$t.prototype.visible=!1;$t.findFrom=$t.findGapCursorFrom;rt.jsonID("gapcursor",$t);class xy{constructor(e){this.pos=e}map(e){return new xy(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return $t.valid(n)?new $t(n):rt.near(n)}}function zC(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function AO(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||zC(i.type))return!0;
vendor: 9,698 bytes, line 179
179if(i.inlineContent)return!1}}return!0}function MO(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||zC(i.type))return!0;if(i.inlineContent)return!1}}return!0}function IO(){return new Ot({props:{decorations:OO,createSelectionBetween(t,e,n){return e.pos==n.pos&&$t.valid(n)?new $t(n):null},handleClick:PO,handleKeyDown:zO,handleDOMEvents:{beforeinput:DO}}})}const zO=I2({ArrowLeft:Kd("horiz",-1),ArrowRight:Kd("horiz",1),ArrowUp:Kd("vert",-1),ArrowDown:Kd("vert",1)});function Kd(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Ze){if(!s.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=$t.findGapCursorFrom(a,e,l);return u?(i&&i(r.tr.setSelection(new $t(u))),!0):!1}}function PO(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!$t.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Ue.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new $t(r))),!0)}function DO(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof $t))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=he.empty;for(let o=r.length-1;o>=0;o--)i=he.from(r[o].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new Ae(i,0,0));return s.setSelection(Ze.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function OO(t){if(!(t.selection instanceof $t))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",zt.create(t.doc,[$n.widget(t.selection.head,e,{key:"gapcursor"})])}var Vp=200,dn=function(){};dn.prototype.append=function(e){return e.length?(e=dn.from(e),!this.length&&e||e.length<Vp&&this.leafAppend(e)||this.length<Vp&&e.leafPrepend(this)||this.appendInner(e)):this};dn.prototype.prepend=function(e){return e.length?dn.from(e).append(this):this};dn.prototype.appendInner=function(e){return new _O(this,e)};dn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?dn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};dn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};dn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};dn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i};dn.from=function(e){return e instanceof dn?e:e&&e.length?new PC(e):dn.empty};var PC=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Vp)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Vp)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(dn);dn.empty=new PC([]);var _O=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(dn);const LO=500;class ri{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,u=[],d=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),s=i.maps.length),s--,d.push(f);return}if(i){d.push(new Si(f.map));let m=f.step.map(i.slice(s)),g;m&&o.maybeStep(m).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],u.push(new Si(g,void 0,void 0,u.length+d.length))),s--,g&&i.appendMap(g,s)}else o.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(s)):f.selection,l=new ri(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let f=e.steps[d].invert(e.docs[d]),p=new Si(e.mapping.maps[d],f,n),m;(m=l&&l.merge(p))&&(p=m,d?s.pop():a=a.slice(0,a.length-1)),s.push(p),n&&(o++,n=void 0),i||(l=p)}let u=o-r.depth;return u>$O&&(a=RO(a,u),o-=u),new ri(a.append(s),o)}remapping(e,n){let r=new Au;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new ri(this.items.append(e.map(n=>new Si(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=n;this.items.forEach(p=>{let m=s.getMirror(--l);if(m==null)return;o=Math.min(o,m);let g=s.maps[m];if(p.step){let y=e.steps[m].invert(e.docs[m]),j=p.selection&&p.selection.map(s.slice(l+1,m));j&&a++,r.push(new Si(g,y,j))}else r.push(new Si(g))},i);let u=[];for(let p=n;p<o;p++)u.push(new Si(s.maps[p]));let d=this.items.slice(0,i).append(u).append(r),f=new ri(d,a);return f.emptyItemCount()>LO&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&s++;let f=new Si(u.invert(),l,d),p,m=i.length-1;(p=i.length&&i[m].merge(f))?i[m]=p:i.push(f)}}else o.map&&r--},this.items.length,0),new ri(dn.from(i.reverse()),s)}}ri.empty=new ri(dn.empty,0);function RO(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Si{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Si(n.getMap().invert(),n,this.selection)}}}class Ls{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const $O=20;function BO(t,e,n,r){let i=n.getMeta(Yo),s;if(i)return i.historyState;n.getMeta(HO)&&(t=new Ls(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Yo))return o.getMeta(Yo).redo?new Ls(t.done.addTransform(n,void 0,r,Ef(e)),t.undone,kj(n.mapping.maps),t.prevTime,t.prevComposition):new Ls(t.done,t.undone.addTransform(n,void 0,r,Ef(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!FO(n,t.prevRanges)),u=o?pg(t.prevRanges,n.mapping):kj(n.mapping.maps);return new Ls(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Ef(e)),ri.empty,u,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Ls(t.done.rebased(n,s),t.undone.rebased(n,s),pg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Ls(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),pg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function FO(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function kj(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;
179n--)t[n].forEach((r,i,s,o)=>e.push(s,o));return e}function pg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function UO(t,e,n){let r=Ef(e),i=Yo.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new Ls(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(Yo,{redo:n,historyState:l})}let mg=!1,jj=null;function Ef(t){let e=t.plugins;if(jj!=e){mg=!1,jj=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){mg=!0;break}}return mg}const Yo=new Xt("history"),HO=new Xt("closeHistory");function VO(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ot({key:Yo,state:{init(){return new Ls(ri.empty,ri.empty,null,0,-1)},apply(e,n,r){return BO(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?OC:r=="historyRedo"?_C:null;return!i||!e.editable?!1:(n.preventDefault(),i(e.state,e.dispatch))}}}})}function DC(t,e){return(n,r)=>{let i=Yo.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=UO(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const OC=DC(!1,!0),_C=DC(!0,!0);Ft.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ot({key:new Xt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const i=this.options.limit;if(i==null||i===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const o=s-i,a=0,l=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,l);return t=!0,u}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=s-r,u=a-l,d=a;return e.deleteRange(u,d),!(this.storage.characters({node:e.doc})>r)}})]}});var KO=Ft.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[EO(this.options)]}});Ft.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ot({key:new Xt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,s=[];if(!n||!r)return zt.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(l.isText)return;if(!(i>=u&&i<=u+l.nodeSize-1))return!1;o+=1});let a=0;return t.descendants((l,u)=>{if(l.isText||!(i>=u&&i<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push($n.node(u,u+l.nodeSize,{class:this.options.className}))}),zt.create(t,s)}}})]}});var WO=Ft.create({name:"gapCursor",addProseMirrorPlugins(){return[IO()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=bt(Be(t,"allowGapCursor",n)))!=null?e:null}}}),wj="placeholder";function GO(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}Ft.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:wj,placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${GO(this.options.dataAttribute)}`:`data-${wj}`;return[new Ot({key:new Xt("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,s=[];if(!r)return null;const o=this.editor.isEmpty;return e.descendants((a,l)=>{const u=i>=l&&i<=l+a.nodeSize,d=!a.isLeaf&&zm(a);if((u||!this.options.showOnlyCurrent)&&d){const f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);const p=$n.node(l,l+a.nodeSize,{class:f.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});s.push(p)}return this.options.includeChildren}),zt.create(e,s)}}})]}});Ft.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ot({key:new Xt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||G2(n.selection)||t.view.dragging?null:zt.create(n.doc,[$n.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function Sj({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var qO=Ft.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Xt(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new Ot({key:e,appendTransaction:(i,s,o)=>{const{doc:a,tr:l,schema:u}=o,d=e.getState(o),f=a.content.size,p=u.nodes[n];if(d)return l.insert(f,p.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!Sj({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!Sj({node:o,types:r})}}})]}}),JO=Ft.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>OC(t,e),redo:()=>({state:t,dispatch:e})=>_C(t,e)}},addProseMirrorPlugins(){return[VO(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),ZO=Ft.create({name:"starterKit",addExtensions(){var t,e,n,r;const i=[];return this.options.bold!==!1&&i.push(W5.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(F5.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(kC.configure(this.options.bulletList)),this.options.code!==!1&&i.push(J5.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Q5.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(X5.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(KO.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(WO.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(eO.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(tO.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(JO.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(nO.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(aO.configure(this.options.italic)),this.options.listItem!==!1&&i.push(jC.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(TC.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(yC.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(MC.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(kO.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(SO.configure(this.options.strike)),this.options.text!==!1&&i.push(NO.configure(this.options.text)),this.options.underline!==!1&&i.push(IC.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(qO.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),YO=ZO,LC={exports:{}},RC={};/** 180 * @license React 181 * use-sync-external-store-shim.production.js 182 * 183 * Copyright (c) Meta Platforms, Inc. and affiliates. 184 * 185 * This source code is licensed under the MIT license found in the 186 * LICENSE file in the root directory of this source tree. 187 */var Nl=h;function QO(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var XO=typeof Object.is=="function"?Object.is:QO,e_=Nl.useState,t_=Nl.useEffect,n_=Nl.useLayoutEffect,r_=Nl.useDebugValue;function i_(t,e){var n=e(),r=e_({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return n_(function(){i.value=n,i.getSnapshot=e,hg(i)&&s({inst:i})},[t,n,e]),t_(function(){return hg(i)&&s({inst:i}),t(function(){hg(i)&&s({inst:i})})},[t]),r_(n),n}function hg(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!XO(t,n)}catch{return!0}}function s_(t,e){return e()}var o_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s_:i_;RC.useSyncExternalStore=Nl.useSyncExternalStore!==void 0?Nl.useSyncExternalStore:o_;LC.exports=RC;var vy=LC.exports;const{getOwnPropertyNames:a_,getOwnPropertySymbols:l_}=Object,{hasOwnProperty:c_}=Object.prototype;function gg(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Wd(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);const{cache:s}=i,o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);const l=t(n,r,i);return s.delete(n),s.delete(r),l}}function u_(t){return t!=null?t[Symbol.toStringTag]:void 0}function Nj(t){return a_(t).concat(l_(t))}const d_=Object.hasOwn||((t,e)=>c_.call(t,e));function ha(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const f_="__v",p_="__o",m_="_owner",{getOwnPropertyDescriptor:Cj,keys:Ej}=Object;function h_(t,e){return t.byteLength===e.byteLength&&Kp(new Uint8Array(t),new Uint8Array(e))}function g_(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function b_(t,e){return t.byteLength===e.byteLength&&Kp(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function x_(t,e){return ha(t.getTime(),e.getTime())}function v_(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function y_(t,e){return t===e}function Tj(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.entries();let o,a,l=0;for(;(o=s.next())&&!o.done;){const u=e.entries();let d=!1,f=0;for(;(a=u.next())&&!a.done;){if(i[f]){f++;continue}const p=o.value,m=a.value;if(n.equals(p[0],m[0],l,f,t,e,n)&&n.equals(p[1],m[1],p[0],m[0],t,e,n)){d=i[f]=!0;break}f++}if(!d)return!1;l++}return!0}const k_=ha;function j_(t,e,n){const r=Ej(t);let i=r.length;if(Ej(e).length!==i)return!1;for(;i-- >0;)if(!$C(t,e,n,r[i]))return!1;return!0}function yc(t,e,n){const r=Nj(t);let i=r.length;if(Nj(e).length!==i)return!1;let s,o,a;for(;i-- >0;)if(s=r[i],!$C(t,e,n,s)||(o=Cj(t,s),a=Cj(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function w_(t,e){return ha(t.valueOf(),e.valueOf())}function S_(t,e){return t.source===e.source&&t.flags===e.flags}function Aj(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const i=new Array(r),s=t.values();let o,a;for(;(o=s.next())&&!o.done;){const l=e.values();let u=!1,d=0;for(;(a=l.next())&&!a.done;){if(!i[d]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function Kp(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function N_(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}
187function $C(t,e,n,r){return(r===m_||r===p_||r===f_)&&(t.$$typeof||e.$$typeof)?!0:d_(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const C_="[object ArrayBuffer]",E_="[object Arguments]",T_="[object Boolean]",A_="[object DataView]",M_="[object Date]",I_="[object Error]",z_="[object Map]",P_="[object Number]",D_="[object Object]",O_="[object RegExp]",__="[object Set]",L_="[object String]",R_={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},$_="[object URL]",B_=Object.prototype.toString;function F_({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:p,areUrlsEqual:m,unknownTagComparators:g}){return function(j,x,k){if(j===x)return!0;if(j==null||x==null)return!1;const N=typeof j;if(N!==typeof x)return!1;if(N!=="object")return N==="number"?a(j,x,k):N==="function"?s(j,x,k):!1;const C=j.constructor;if(C!==x.constructor)return!1;if(C===Object)return l(j,x,k);if(Array.isArray(j))return e(j,x,k);if(C===Date)return r(j,x,k);if(C===RegExp)return d(j,x,k);if(C===Map)return o(j,x,k);if(C===Set)return f(j,x,k);const w=B_.call(j);if(w===M_)return r(j,x,k);if(w===O_)return d(j,x,k);if(w===z_)return o(j,x,k);if(w===__)return f(j,x,k);if(w===D_)return typeof j.then!="function"&&typeof x.then!="function"&&l(j,x,k);if(w===$_)return m(j,x,k);if(w===I_)return i(j,x,k);if(w===E_)return l(j,x,k);if(R_[w])return p(j,x,k);if(w===C_)return t(j,x,k);if(w===A_)return n(j,x,k);if(w===T_||w===P_||w===L_)return u(j,x,k);if(g){let E=g[w];if(!E){const D=u_(j);D&&(E=g[D])}if(E)return E(j,x,k)}return!1}}function U_({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:h_,areArraysEqual:n?yc:g_,areDataViewsEqual:b_,areDatesEqual:x_,areErrorsEqual:v_,areFunctionsEqual:y_,areMapsEqual:n?gg(Tj,yc):Tj,areNumbersEqual:k_,areObjectsEqual:n?yc:j_,arePrimitiveWrappersEqual:w_,areRegExpsEqual:S_,areSetsEqual:n?gg(Aj,yc):Aj,areTypedArraysEqual:n?gg(Kp,yc):Kp,areUrlsEqual:N_,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const i=Wd(r.areArraysEqual),s=Wd(r.areMapsEqual),o=Wd(r.areObjectsEqual),a=Wd(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:a})}return r}function H_(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function V_({circular:t,comparator:e,createState:n,equals:r,strict:i}){if(n)return function(a,l){const{cache:u=t?new WeakMap:void 0,meta:d}=n();return e(a,l,{cache:u,equals:r,meta:d,strict:i})};if(t)return function(a,l){return e(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return e(a,l,s)}}const K_=vo();vo({strict:!0});vo({circular:!0});vo({circular:!0,strict:!0});vo({createInternalComparator:()=>ha});vo({strict:!0,createInternalComparator:()=>ha});vo({circular:!0,createInternalComparator:()=>ha});vo({circular:!0,createInternalComparator:()=>ha,strict:!0});function vo(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:i=!1}=t,s=U_(t),o=F_(s),a=n?n(o):H_(o);return V_({circular:e,comparator:o,createState:r,equals:a,strict:i})}var BC={exports:{}},FC={};/** 188 * @license React 189 * use-sync-external-store-shim/with-selector.production.js 190 * 191 * Copyright (c) Meta Platforms, Inc. and affiliates. 192 * 193 * This source code is licensed under the MIT license found in the 194 * LICENSE file in the root directory of this source tree. 195 */var _m=h,W_=vy;function G_(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var q_=typeof Object.is=="function"?Object.is:G_,J_=W_.useSyncExternalStore,Z_=_m.useRef,Y_=_m.useEffect,Q_=_m.useMemo,X_=_m.useDebugValue;FC.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var s=Z_(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=Q_(function(){function l(m){if(!u){if(u=!0,d=m,m=r(m),i!==void 0&&o.hasValue){var g=o.value;if(i(g,m))return f=g}return f=m}if(g=f,q_(d,m))return g;var y=r(m);return i!==void 0&&i(g,y)?(d=m,g):(d=m,f=y)}var u=!1,d,f,p=n===void 0?null:n;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,n,r,i]);var a=J_(t,s[0],s[1]);return Y_(function(){o.hasValue=!0,o.value=a},[a]),X_(a),a};BC.exports=FC;var e4=BC.exports,t4=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},n4=({contentComponent:t})=>{const e=vy.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return c.jsx(c.Fragment,{children:Object.values(e)})};function r4(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:fM.createPortal(r.reactElement,r.element,n)},t.forEach(i=>
195i())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(i=>i())}}}var i4=class extends ao.Component{constructor(t){var e;super(t),this.editorContentRef=ao.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=r4(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:t4(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&c.jsx(n4,{contentComponent:t.contentComponent})]})}},s4=h.forwardRef((t,e)=>{const n=ao.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ao.createElement(i4,{key:n,innerRef:e,...t})}),UC=ao.memo(s4),o4=typeof window<"u"?h.useLayoutEffect:h.useEffect,a4=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function l4(t){var e;const[n]=h.useState(()=>new a4(t.editor)),r=e4.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:K_);return o4(()=>n.watch(t.editor),[t.editor,n]),h.useDebugValue(r),r}var c4=!1,wx=typeof window>"u",u4=wx||!!(typeof window<"u"&&window.next),d4=class HC{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?wx||u4?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)}
195,onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)}};return new s5(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,s)=>{var o;return i===((o=n.extensions)==null?void 0:o[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?HC.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function f4(t={},e=[]){const n=h.useRef(t);n.current=t;const[r]=h.useState(()=>new d4(n)),i=vy.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return h.useDebugValue(i),h.useEffect(r.onRender(e)),l4({editor:i,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),i}var VC=h.createContext({editor:null});VC.Consumer;var p4=h.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),m4=()=>h.useContext(p4);ao.forwardRef((t,e)=>{const{onDragStart:n}=m4(),r=t.as||"div";return c.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});ao.createContext({markViewContentRef:()=>{}});var yy=h.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});yy.displayName="TiptapContext";var h4=()=>h.useContext(yy);function KC({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=h.useMemo(()=>({editor:r}),[r]),s=h.useMemo(()=>({editor:r}),[r]);return c.jsx(VC.Provider,{value:s,children:c.jsx(yy.Provider,{value:i,children:n})})}KC.displayName="Tiptap";function WC({...t}){const{editor:e}=h4();return c.jsx(UC,{editor:e,...t})}WC.displayName="Tiptap.Content";Object.assign(KC,{Content:WC});function g4(){return Hr("/api/web/navigacija")}function b4(t=!0){return Hr("/api/web/rute",{query:{aktivne:t}})}function x4(t){return Hr("/api/web/hero",{query:t?{route_slug:t}:void 0})}function v4(t){return ym("/api/web/hero",{auth:!0,body:t})}function Dc(t,e){return Hr(`/api/web/kartice/${t}`,{auth:!0,query:e})}function bg(t,e){return Ol(`/api/web/kartice/${t}`,{auth:!0,body:e})}function pn(t,e,n){return ym(`/api/web/kartice/${t}/${e}`,{auth:!0,body:n})}function xg(t,e){return nN(`/api/web/kartice/${t}/${e}`,{auth:!0})}function ou(t){return Hr("/api/web/sadrzaj",{auth:!0,query:t})}async function za(t,e){const n=Number((e==null?void 0:e.pageSize)??200),r=Number.isFinite(n)?Math.max(1,Math.min(200,Math.trunc(n))):200,i=Number((e==null?void 0:e.maxPages)??50),s=Number.isFinite(i)?Math.max(1,Math.trunc(i)):50,o=[];for(let a=1;a<=s;a+=1){const l=await ou({...t||{},limit:r,page:a}),u=Array.isArray(l.items)?l.items:[];o.push(...u);const d=Number(l.limit||r),f=Number.isFinite(d)&&d>0?d:r;if(u.length<f)break}return o}function Ho(t){return Ol("/api/web/sadrzaj",{auth:!0,body:t})}function li(t,e){return ym(`/api/web/sadrzaj/${t}`,{auth:!0,body:e})}function Wp(t){return nN(`/api/web/sadrzaj/${t}`,{auth:!0})}function y4(t){return Hr("/api/web/postavke",{query:void 0})}function Gp(t){return Ol("/api/web/mediji",{auth:!0,body:t})}function k4(t){return ym("/api/web/mediji",{auth:!0,body:t})}function j4(t){return Hr("/api/web/clan/profil",{auth:!0,query:t?{clan_i
195d:t}:void 0})}function Mj(t){return t===window}function w4(t){if(typeof window>"u"||!t||t===window||typeof Element>"u"||!(t instanceof Element))return null;let e=t instanceof HTMLElement?t:t.parentElement;for(;e&&e!==document.body;){const r=window.getComputedStyle(e).overflowY;if(/(auto|scroll|overlay)/.test(r)&&e.scrollHeight>e.clientHeight+1)return e;e=e.parentElement}return null}function Ll(t={}){const e=Math.max(16,Number(t.edgeThresholdPx??100)),n=Math.max(2,Number(t.minSpeedPx??4)),r=Math.max(n,Number(t.maxSpeedPx??24));let i=0,s=null,o=0,a=null;function l(){s!=null&&(window.cancelAnimationFrame(s),s=null)}function u(){if(i===0){l();return}if(performance.now()-o>160){i=0,l();return}if(!a){i=0,l();return}Mj(a)?window.scrollBy(0,i):a.scrollBy({top:i}),s=window.requestAnimationFrame(u)}function d(){s==null&&(s=window.requestAnimationFrame(u))}return{update(f,p){var k;if(typeof window>"u")return;o=performance.now();const m=((k=t.getScrollElement)==null?void 0:k.call(t))??w4(p)??window;a=m;const g=Mj(m)?{top:0,bottom:window.innerHeight||0}:m.getBoundingClientRect();if(g.bottom<=g.top)return;const y=f-g.top,j=g.bottom-f;let x=0;if(y<e){const N=Math.min(1,Math.max(0,(e-y)/e));x=-Math.round(n+(r-n)*N)}else if(j<e){const N=Math.min(1,Math.max(0,(e-j)/e));x=Math.round(n+(r-n)*N)}i=x,i===0?l():d()},stop(){i=0,o=0,a=null,l()}}}function S4(t){return String(t||"").trim().toLowerCase()}function N4(t){return t.split(" ").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function C4(t){const e=String(t||"").trim();if(!e)return"";const r=(e.includes("@")?e.split("@")[0]:e).replace(/[._-]+/g," ").replace(/\s+/g," ").trim();return N4(r)}function ts(t){const e=String(t||"").trim();if(!e)return null;const n=S4(e),r=n.includes("@")?n.split("@")[0]:n,i=r.replace(/[._-]+/g," ").replace(/\s+/g," ").trim();return r==="silvija.zec"?"Silvija Zec":r==="maja.kis"||r==="maja.merc.kish"||i==="maja merc kish"?"Maja Merc Kish":C4(e)||null}const E4={"akti-komore":[],obrasci:[],ispiti:[{id:"ispiti-main-intro",type:"paragraph",text:["U okviru javnih ovlasti, Komora provodi strucne ispite za ovlastene inzenjere sumarstva i drvne tehnologije (Älanak 5. Zakona o HKISDT, Älanak 50. Zakona o sumama). Strucni ispit polazu ovlasteni inzenjeri sumarstva i drvne tehnologije nakon tri godine radnoga staza u struci. Temeljem clanka 23. Zakona o HKISDT, jedan od uvjeta za upis u Komoru je i polozen strucni ispit. Strucni ispit provodi se temeljem odredbi Pravilnika o sadrzaju i nacinu polaganja strucnih ispita za ovlastene inzenjere sumarstva i drvne tehnologije ",{text:"(NN 74/07)",href:"https://narodne-novine.nn.hr/"}," i Pravilnika o izmjenama i dopunama Pravilnika o sadrzaju i nacinu polaganja strucnih ispita za ovlastene inzenjere sumarstva i drvne tehnologije ",{text:"(NN 15/15)",href:"https://narodne-novine.nn.hr/"},". Ispitni program za svaki strucni smjer sadrzi i poznavanje zakonodavnih odredbi vezanih za konkretni strucni smjer. Na temelju propisanih ispitnih programa Povjerenstvo za strucne ispite predlozilo je popis preporucene strucne literature koji je Vijece Komore usvojilo na svojoj sjednici odrzanoj dana 21. prosinca 2015. godine."]},{id:"ispiti-popis-lit-title",type:"heading",accent:!0,text:"Popis literature"},{id:"ispiti-popis-lit-docs",type:"documents",items:[{label:"Popis literature",pdfUrl:"#",wordUrl:"#"}]},{id:"ispiti-dopuna-link",type:"paragraph",text:[{text:"Dopuna popisa literature",href:"#"}]},{id:"ispiti-sumski-proizvodi-doc",type:"documents",items:[{label:"âÅ umski proizvodiâ â skripta (autori: izv.prof.dr.sc. Zeljko Zecic, dr.sc. Dinko Vusic)",pdfUrl:"#"}]},{id:"ispiti-naknada-p",type:"paragraph",text:"Trosak polaganja strucnih ispita utvrden je u iznosu od 700,00 kn i uplacuje se na ziro racun Komore. Strucni ispit polaze se pred ispitnim povjerenstvima koja je, za svako strukovno podrucje i strucni smjer, imenovalo Vijece Komore. 31. ozujka 2008. godine odrzan je prvi ispitni rok za strukovno podrucje sumarstvo, strucni smjer ovlasteni inzenjer sumarstva za lovstvo. Ispitu su pristupila 3 pristupnika. O tijeku i rezultatima strucnoga ispita vodi se zapisnik koji odmah po zavrsetku potpisuju svi clanovi povjerenstva, tajnik i pristupnik."},{id:"ispiti-pravilnik-title",type:"heading",accent:!0,text:"Pravilnik"},{id:"ispiti-pravilnik-docs",type:"documents",items:[{label:"Pravilnik",pdfUrl:"#",wordUrl:"#"}]},{id:"ispiti-obrazac-title",type:"heading",text:"Obrazac zahtjeva za polaganje strucnoga ispita"},{id:"ispiti-obrazac-docs",type:"documents",items:[{label:"Obrazac zahtjeva za polaganje strucnoga ispita",pdfUrl:"#",wordUrl:"#"}]},{id:"ispiti-prilozi-doc",type:"documents",items:[{label:"Primjeri ispitnih pitanja za ovlastene inzenjere sumarstva",pdfUrl:"#"}]},{id:"ispiti-prilozi-p",type:"paragraph",text:"Temeljem nadleznosti i odluke Vijeca, uz preporuku i suglasnost predsjednika ispitnih povjerenstava, objavljujemo primjere ispitnih pitanja koja pristupnicima mogu biti postavljena na strucnom ispitu koje se provodi pred ispitnim povjerenstvima Komore, sukladno Pravilniku o sa
195drzaju i nacinu polaganja strucnih ispita za ovlastene inzenjere sumarstva i drvne tehnologije (NN 74/07). Uz postojeci popis strucne literature, ovi primjeri ispitnih pitanja olaksat ce pripremu pristupnika."},{id:"ispiti-smjerovi-title",type:"heading",text:"Primjeri ispitnih pitanja za ovlastene inzenjere sumarstva po strucnim smjerovima"},{id:"ispiti-smjerovi-docs",type:"documents",items:[{label:"Strucni smjer: ovlasteni inzenjer sumarstva - Novi primjer ispitnih pitanja",pdfUrl:"#"},{label:"Strucni smjer: ovlasteni inzenjer sumarstva za uredivanje suma (NOVO)",pdfUrl:"#"},{label:"Strucni smjer: ovlasteni inzenjer sumarstva za lovstvo (dopuna)",pdfUrl:"#"},{label:"Strucni smjer: ovlasteni inzenjer sumarstva za ekologiju, zastitu prirode i urbano sumarstvo",pdfUrl:"#"},{label:"Strucni smjer: ovlasteni inzenjer sumarstva za sumske prometnice i sumarsko graditeljstvo",pdfUrl:"#"}]},{id:"ispiti-propisi-title",type:"heading",accent:!0,text:"Pregled aktualnih propisa"},{id:"ispiti-propisi-p",type:"paragraph",text:["Svim clanovima Komore te kandidatima za pristupanje polaganju strucnoga ispita, sugeriramo koristenje web stranice ",{text:"www.propisi.hr",href:"https://www.propisi.hr"}," - hrvatski pravni portal s vazecim prociscenim propisima (zakoni i podzakonski akti), sudskom praksom te raznim misljenjima nadleznih tijela. Moguce je pregledati popis svih aktualnih i vazecih propisa grupiranih po pojedinim podrucjima (pa tako i sumarstvo); osigurana je dnevna azurnost. Pregledi cjelovitih akata moguci su na web stranici ",{text:"www.nn.hr",href:"https://www.nn.hr"},"."]}],upis:[],licenciranje:[{id:"lic-196-title",type:"heading",level:"article",text:"196. sjednica Povjerenstva za licenciranje"},{id:"lic-196-text",type:"paragraph",text:["Na svojoj 196. sjednici, odrzanoj 11. veljace 2026. godine, Povjerenstvo za licenciranje razmotrilo je zahtjeve za izdavanje licencija (odobrenja) za radove u sumarstvu na dan 16. veljace 2026. godine. Popis mozete pogledati ",{text:"ovdje",href:"#"},"."]},{id:"lic-pravilnici-title",type:"heading",accent:!0,text:"Novi pravilnik o postupku licenciranja"},{id:"lic-pravilnici-p1",type:"paragraph",text:"Skupstina Komore je na svojoj sjednici odrzanoj 21. prosinca 2015. godine donijela novi Pravilnik o izdavanju, obnavljanju i oduzimanju licencija (odobrenja) za radove u podrucju sumarstva, lovstva i drvne industrije."},{id:"lic-pravilnici-link-2016",type:"documents",items:[{label:"Pravilnik o izmjeni pravilnika od 20. prosinca 2016. godine",pdfUrl:"#"}]},{id:"lic-pravilnici-title-izmjene",type:"heading",accent:!0,text:"Izmjene i dopune pravilnika"},{id:"lic-pravilnici-p2",type:"paragraph",text:"Odredbama pravilnika o izdavanju, obnavljanju i oduzimanju licencija (odobrenja) za radove u podrucju sumarstva, lovstva i drvne industrije, uredeni su uvjeti i postupak licenciranja izvodaca radova te obveze vezane uz dostavu dokumentacije i izvjesca."},{id:"lic-pravilnici-p3",type:"paragraph",text:["U okviru svojih javnih ovlasti Komora daje, obnavlja i oduzima licence (odobrenja) pravnim i fizickim osobama za obavljanje radova iz podrucja sumarstva, lovstva i drvne industrije. U sumarskom dijelu to je regulirano clankom 50. ",{text:"Zakona o sumama (NN 68/2018, 115/2018, 98/2019, 32/2020, 145/2020, 101/2023 i 36/2024)",href:"#"},"."]},{id:"lic-pravilnici-p4",type:"paragraph",text:"Sukladno navedenim odredbama, nadlezno ministarstvo donijelo je Pravilnik o vrsti sumarskih radova, minimalnim uvjetima za njihovo izvodenje te radovima koje sumoposjednik moze izvoditi samostalno."},{id:"lic-pravilnici-p5",type:"paragraph",text:"Licenciranjem izvodaca radova osigurava se strucnost, kvaliteta izvedbe i odgovornost u obavljanju sumarskih radova."},{id:"lic-zahtjev-hr-docs",type:"documents",items:[{label:"Zahtjev za izdavanje ili za obnovu licencije za sumarske radove",pdfUrl:"#",wordUrl:"#"}]},{id:"lic-zahtjev-en-docs",type:"documents",items:[{label:"Application for issuing/renewal of the license for forestry operations",pdfUrl:"#",wordUrl:"#"}]},{id:"lic-cjenik-docs",type:"documents",items:[{label:"Cjenik za izdavanje i obnovu licencija (odobrenja) za radove u sumarstvu, lovstvu i drvnoj industriji",pdfUrl:"#"}]}],cekici:[{id:"cekici-title",type:"heading",level:"article",text:"Dokumentacija i pravilnici za cekice"},{id:"cekici-docs",type:"documents",items:[{label:"Pravilnik o postupku izrade i izdavanja zigova cekica",pdfUrl:"#",wordUrl:"#"},{label:"Pravilnik o pecatu",pdfUrl:"#"},{label:"Pravilnik o iskaznici",pdfUrl:"#"}]}],popratnice:[{id:"popratnice-title",type:"heading",level:"article",text:"Postupak vezan uz cekice licenciranih izvodaca"},{id:"popratnice-p1",type:"paragraph",text:"Komora izdaje odobrenja i vodi evidenciju vezanu uz cekice, popratnice i pripadajucu dokumentaciju licenciranih izvodaca."},{id:"popratnice-docs",type:"documents",items:[{label:"Pravilnik o oznaci stabala i popratnici",pdfUrl:"#"},{label:"Pravilnik o izmjenama pravilnika",pdfUrl:"#"},{label:"Ovlasteni izradivac",pdfUrl:"#"}]}],"racunalne-baze":[],imenik:[],"upisnik-licencija":[],strucno:[],"strucno-dogadaji":[],"strucno-prezentacije":[{id:"prezentacije-intro",type:"paragraph",text:"Komora objavljuje prezentacije predavaca i autora koji sudjeluju u programu strucnoga usavrsavanja za clanove Komore, pri cemu u kojem pogledu ne odgovara i ne mora biti suglasna sa stavovima i misljenjima autora."},{id:"prezentacije-dokumenti",type:"documents",items:[{label:"izv. prof. dr. sc. Kruno Lepoglavec: Planiranje pristupa sadrzajima za osobe s invaliditetom",pptUrl:"#"},{label:"izv. prof. dr. sc. Matija Landekic: Tehnike rada i mjere sigurnosti pri radu na stablima u urbanim sredinama",pptUrl:"#"},{label:"dr. sc. Hrvoje Marjanovic, dr. sc. Masa Zorana Ostrogov
195ic Sever: Suvremena prica o sumi i ugljiku - Gdje (ni)su krediti ugljika?",pptUrl:"#"},{label:"dr. sc. Dijana Vuletic: E-tecaj iz podrucja na sumi temeljene bioekonomije kao alat za usavrsavanje i cjelozivotno obrazovanje inzenjera sumarstva u RH",pptUrl:"#"},{label:"prof. dr. sc. Ivan Martinic: Natura 2000 i sumarstvo - transfer znanja i dobre prakse",pptUrl:"#"},{label:"Andelina Gavranovic Markic, Mladen Ivankovic: Dinamika plodonosenja i ocuvanje genofonda hrasta luznjaka (Quercus robur L.) i obicne bukve (Fagus sylvatica L.) u svijetlu klimatskih promjena",pptUrl:"#"},{label:"Miran Lanscak, Zvonimir Vujnovic, dr. sc. Mladen Ivankovic: Strucni nadzor nad sumskim sjemenskim objektima (SSO) i proizvodnjom sumskog reprodukcijskog materijala (SRM)",pptUrl:"#"},{label:"dr. sc. Nikola Zoric: Monitoring karantenskih stetnih organizama u RH",pptUrl:"#"},{label:"mr. sc. Dubravko Janes: Zakonske obveze sumarstva koje nisu propisane Zakonom o sumama nego drugim zakonima",pptUrl:"#"},{label:"prof. dr. sc. Ivan Martinic: Natura 2000 prvih 30 godina - EU pogled na stanje provedbe u sumarstvu",pptUrl:"#"},{label:"mr. Goran Kovac: Referentna razina za sume",pptUrl:"#"},{label:"Damir Dramalija: Mogucnosti razvoja urbanog sumarstva u poduzecu Hrvatske sume",pptUrl:"#"},{label:"akademik Igor Anic: Pomladivanje suma oplodnim sjecama na malim povrsinama",pptUrl:"#"},{label:"mr. Goran Kovac: Izvjescivanje o sumarstvu Republike Hrvatske prema medunarodnim obvezama",pptUrl:"#"}]}],"zakoni-propisi":[{id:"zakoni-subtitle",type:"heading",accent:!0,text:"Vazeci zakoni i podzakonski akti"},{id:"zakoni-lista",type:"list",items:[[{text:"Zakon o sumama (NN 68/2018, 115/2018, 98/2019, 32/2020, 145/2020, 101/2023 i 36/2024)",href:"https://narodne-novine.nn.hr/search.aspx?upit=Zakon%20o%20%C5%A1umama"}],[{text:"Zakon o sumskom reprodukcijskom materijalu - Urednicki procisceni tekst (NN 75/09, 61/11, 56/13, 14/14, 32/19)",href:"https://narodne-novine.nn.hr/search.aspx?upit=Zakon%20o%20%C5%A1umskom%20reprodukcijskom%20materijalu"}],[{text:"Pravilnik o uredivanju suma (NN 97/2018, 101/2018, 31/2020 i 99/2021)",href:"https://narodne-novine.nn.hr/search.aspx?upit=Pravilnik%20o%20ure%C4%91ivanju%20%C5%A1uma"}],[{text:"Pravilnik o doznaci stabala, obiljezbi sumskih proizvoda, teretnom listu (popratnici) i sumskom redu (NN 71/19)",href:"https://narodne-novine.nn.hr/search.aspx?upit=Pravilnik%20o%20doznaci%20stabala"}],[{text:"Zakon o zastiti prirode (NN 80/13 i 15/2018)",href:"https://narodne-novine.nn.hr/search.aspx?upit=Zakon%20o%20za%C5%A1titi%20prirode"}],[{text:"Uredba o ekoloskoj mrezi - Urednicki procisceni tekst (NN 124/13 i 105/15)",href:"https://narodne-novine.nn.hr/search.aspx?upit=Uredba%20o%20ekolo%C5%A1koj%20mre%C5%BEi"}],[{text:"Zakon o javnoj nabavi (NN 120/16)",href:"https://narodne-novine.nn.hr/search.aspx?upit=Zakon%20o%20javnoj%20nabavi"}],[{text:"Sumsko-odstetni cjenik (NN 37/15)",href:"https://narodne-novine.nn.hr/search.aspx?upit=%C5%A0umsko-od%C5%A1tetni%20cjenik"}]]}],"operativne-informacije":[],"operativne-zapisnici":[{id:"operativne-sub-vijece",type:"heading",text:"Vijece Komore"},{id:"operativne-vijece-2022",type:"documents",title:"Mandat 2022-2026",items:[{label:"Zapisnik 1. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 2. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 3. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 4. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 5. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 6. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 7. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 8. sjednice Vijeca Komore",pdfUrl:"#"}]},{id:"operativne-vijece-2018",type:"documents",title:"Mandat 2018-2022",items:[{label:"Zapisnik 1. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 2. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 3. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 4. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 5. sjednice Vijeca Komore",pdfUrl:"#"},{label:"Zapisnik 6. sjednice Vijeca Komore",pdfUrl:"#"}]},{id:"operativne-sub-no",type:"heading",text:"Nadzorni odbor Komore"},{id:"operativne-no-2022",type:"documents",title:"Mandat 2022-2026",
195items:[{label:"Zapisnik 1. sjednice Nadzornog odbora Komore",pdfUrl:"#"},{label:"Zapisnik 2. sjednice Nadzornog odbora Komore",pdfUrl:"#"},{label:"Zapisnik 3. sjednice Nadzornog odbora Komore",pdfUrl:"#"}]},{id:"operativne-sub-sum",type:"heading",text:"Razred inzenjera sumarstva"},{id:"operativne-sum-dok",type:"documents",title:"Zapisnici",items:[{label:"Zapisnik 1. sjednice Razreda inzenjera sumarstva",pdfUrl:"#"},{label:"Zapisnik 2. sjednice Razreda inzenjera sumarstva",pdfUrl:"#"},{label:"Zapisnik 3. sjednice Razreda inzenjera sumarstva",pdfUrl:"#"},{label:"Zapisnik 4. sjednice Razreda inzenjera sumarstva",pdfUrl:"#"}]},{id:"operativne-sub-drv",type:"heading",text:"Razred inzenjera drvne tehnologije"},{id:"operativne-drv-dok",type:"documents",title:"Zapisnici",items:[{label:"Zapisnik 1. sjednice Razreda inzenjera drvne tehnologije",pdfUrl:"#"},{label:"Zapisnik 2. sjednice Razreda inzenjera drvne tehnologije",pdfUrl:"#"},{label:"Zapisnik 3. sjednice Razreda inzenjera drvne tehnologije",pdfUrl:"#"},{label:"Zapisnik 4. sjednice Razreda inzenjera drvne tehnologije",pdfUrl:"#"}]},{id:"operativne-sub-steg",type:"heading",text:"Stegovni sud i tuziteljstvo"},{id:"operativne-steg-dok",type:"documents",items:[{label:"Rjesenje o imenovanju stegovnog suda",pdfUrl:"#"},{label:"Rjesenje o imenovanju stegovnog tuzitelja",pdfUrl:"#"},{label:"Poslovnik o radu stegovnih tijela",pdfUrl:"#"}]}],"operativne-izbori":[],"e-savjetovanje":[],"natjecaji-burza-rada":[],"izdanja-komore":[{id:"izdanja-main-title",type:"heading",level:"article",text:"Izdanja komore"},{id:"izdanja-vodic-date",type:"paragraph",text:"Cetvrtak, 11. lipnja 2015. 08:43"},{id:"izdanja-vodic-title",type:"heading",level:"article",text:"Vodic kroz EU fondove za sumarski sektor"},{id:"izdanja-vodic-p1",type:"paragraph",text:["26. svibnja 2015. godine Europska komisija je odobrila i usvojila ",{text:"Program ruralnog razvoja RH za razdoblje 2014.-2020.",href:"https://narodne-novine.nn.hr/"}," U izradi ovog Programa za sektor sumarstva sudjelovala je i radna skupina sastavljena od predstavnika svih relevantnih sumarskih institucija, uz koordinaciju nadleznog ministarstva."]},{id:"izdanja-vodic-p2",type:"paragraph",text:["Tim povodom, Komora izdaje ",{text:"Vodic kroz EU fondove za sumarski sektor",href:"#"},", koji daje pregled i ostalih operativnih programa kao i Programa Unije, odnosno EU fondova koji su na raspolaganju sumarskom sektoru u novom programskom razdoblju EU-a 2014.-2020."]},{id:"izdanja-vodic-p3",type:"paragraph",text:["Autori Vodica su Victoria Jane Primhak, konzultantica za EU fondove i Domagoj Troha, EU projekt menadzer. Autori ce Vodic azurirati slijedom eventualnih promjena u iducem razdoblju. Vodic je dostupan na hrvatskom i ",{text:"engleskom",href:"#"}," jeziku."]},{id:"izdanja-smjernice-title",type:"heading",accent:!0,text:"Smjernice za izradu elaborata radilista"},{id:"izdanja-smjernice-p1",type:"paragraph",text:["Vijece Komore je na svojoj sjednici odrzanoj 21. prosinca 2015. godine usvojilo prijedlog ",{text:"Smjernica za izradu elaborata radilista za radove u sumarstvu.",href:"#"}]},{id:"izdanja-smjernice-p2",type:"paragraph",text:"Dokument je izradila radna skupina imenovana odlukom Vijeca. Prijedlog akta bio je objavljen na web stranici Komore, uz poziv svim clanovima Komore na dostavu primjedbi."},{id:"izdanja-smjernice-p3",type:"paragraph",text:"Izrada elaborata strucni je posao koji pripada u fazu pripreme radova i, kojega obavljaju ovlasteni inzenjeri."},{id:"izdanja-smjernice-p4",type:"paragraph",text:"Smjernice su alat koji treba posluziti ovlastenim inzenjerima u otklanjanju potencijalnih nejasnoca i nedoumica u ovom strucnom poslu, neovisno o trenutnoj tvrtki zaposlenja kao i o narucitelju posla."},{id:"izdanja-smjernice-p5",type:"paragraph",text:"Ove Smjernice predstavljaju pocetnu osnovu za daljnji razvoj i ujednacavanje izrade ovakvih dokumenata. Kao podloga za izradu Smjernica koristena je dosadasnja praksa u izradi ovih dokumenata."},{id:"izdanja-smjernice-p6",type:"paragraph",text:"Ocekujemo da ce njihova primjena rezultirati razvojem aktivnosti na izradi slicnih akata te boljom praksom, kako bismo koristeci isku
195stva stecena prilikom njihove primjene, u buducim izdanjima Smjernice nadopunili, korigirali i prilagodili potrebama prakse i posla."},{id:"izdanja-brosura-title",type:"heading",accent:!0,text:'Brosura "10 godina HKISDT"'},{id:"izdanja-brosura-p1",type:"paragraph",text:["U povodu obiljezavanja 10 godina postojanja Komore odrzana je Prva konferencija ovlastenih inzenjera sumarstva i drvne tehnologije od 13. do 16. listopada 2016. godine, u Sibeniku, hotel Solaris. Tom prigodom objavili smo i ",{text:"brosuru",href:"#"}," o 10 godina rada ",{text:"Komore",href:"#"},"."]}],kontakti:[{id:"kontakti-list",type:"list",items:["Tel: +385 1 376 5501, +385 1 376 5502","Fax: +385 1 376 5504","Email: [email protected]"]},{id:"kontakti-docs",type:"documents",items:[{label:"Opci podaci Komore",pdfUrl:"#",wordUrl:"#"}]}]},T4={...E4},A4=[{id:"vijesti",label:"Vijesti",route:"vijesti"},{id:"o-nama",label:"O nama",route:"o-komori",children:[{id:"o-komori",label:"O komori",route:"o-komori"},{id:"struktura-komore",label:"Struktura komore",route:"struktura-komore"},{id:"akti-komore",label:"Akti komore",route:"akti-komore"},{id:"zakoni-propisi",label:"Zakoni i propisi",route:"zakoni-propisi"},{id:"operativne-informacije",label:"Operativne informacije",route:"operativne-informacije"},{id:"e-savjetovanje",label:"E-savjetovanje",route:"e-savjetovanje"},{id:"natjecaji-burza-rada",label:"NatjeÄaji, burza rada",route:"natjecaji-burza-rada"},{id:"izdanja-komore",label:"Izdanja komore",route:"izdanja-komore"}]},{id:"ispiti",label:"Ispiti i upis",route:"ispiti",children:[{id:"ispiti",label:"Ispiti",route:"ispiti"},{id:"upis",label:"Upis",route:"upis"}]},{id:"licenciranje",label:"Licenciranje",route:"licenciranje",children:[{id:"licenciranje",label:"Licenciranje",route:"licenciranje"},{id:"cekici",label:"Cekici",route:"cekici"},{id:"popratnice",label:"Popratnice",route:"popratnice"},{id:"racunalne-baze",label:"Racunalne baze",route:"racunalne-baze"}]},{id:"imenici",label:"Imenici i upisnici",route:"imenik",children:[{id:"imenik",label:"Imenik ovlastenih inzenjera",route:"imenik"},{id:"upisnik-licencija",label:"Upisnik licencija",route:"upisnik-licencija"}]},{id:"obrasci",label:"Obrasci",route:"obrasci"},{id:"strucno",label:"Strucno usavrsavanje",route:"strucno",children:[{id:"strucno",label:"Pravilnik i program",route:"strucno"},{id:"strucno-dogadaji",label:"Dogadanja",route:"strucno-dogadaji"},{id:"strucno-prezentacije",label:"Prezentacije",route:"strucno-prezentacije"}]},{id:"projekti",label:"Projekti",route:"projekti"}],Gd=(T4["strucno-prezentacije"]??[]).find(t=>t.type==="documents"),M4=(Gd==null?void 0:Gd.type)==="documents"?Gd.items:[];M4.map((t,e)=>({id:e+1,title:t.label,date:"",author:"",pptUrl:t.pptUrl||"#"}));const I4={vijesti:{image:"/assets/sume-2.jpg",title:"POGLEDAJTE NOVOSTI"},"pristup-informacijama":{image:"/assets/sume-2.jpg",title:"PRISTUP INFORMACIJAMA"},"osiguranje-clanova":{image:"/assets/sume-2.jpg",title:"Osiguranje Älanova"},"zastita-osobnih-podataka":{image:"/assets/sume-2.jpg",title:"ZASTITA OSOBNIH PODATAKA"},"uvjeti-koristenja":{image:"/assets/sume-2.jpg",title:"UVJETI KORISTENJA"},"pravila-privatnosti":{image:"/assets/sume-2.jpg",title:"PRAVILA PRIVATNOSTI"},"o-komori":{image:"/assets/sume-2.jpg",title:"O KOMORI"},"struktura-komore":{image:"/assets/sume-2.jpg",title:"STRUKTURA KOMORE"},"akti-komore":{image:"/assets/sume-2.jpg",title:"AKTI KOMORE"},"zakoni-propisi":{image:"/assets/sume-2.jpg",title:"ZAKONI I PROPISI"},"operativne-informacije":{image:"/assets/sume-2.jpg",title:"OPERATIVNE INFORMACIJE"},"operativne-zapisnici":{image:"/assets/sume-2.jpg",title:"OPERATIVNE INFORMACIJE"},"operativne-izbori":{image:"/assets/sume-2.jpg",title:"OPERATIVNE INFORMACIJE"},"e-savjetovanje":{image:"/assets/sume-2.jpg",title:"E-SAVJETOVANJE"},"natjecaji-burza-rada":{image:"/assets/sume-2.jpg",title:"NATJEÄAJI, BURZA RADA"},"izdanja-komore":{image:"/assets/sume-2.jpg",title:"IZDANJA KOMORE"},ispiti:{image:"/assets/sume-2.jpg",title:"STRUCNI ISPITI"},upis:{image:"/assets/sume-2.jpg",title:"UPIS"},licenciranje:{image:"/assets/sume-2.jpg",title:"LICENCIRANJE"},cekici:{image:"/assets/sume-2.jpg",title:"CEKICI"},popratnice:{image:"/assets/sume-2.jpg",title:"POPRATNICE"},"racunalne-baze":{image:"/assets/sume-2.jpg",title:"RACUNALNE BAZE"},imenik:{image:"/assets/sume-2.jpg",title:"IMENIK OVLASTENIH INZENJERA"},"upisnik-licencija":{image:"/assets/sume-2.jpg",title:"UPISNIK LICENCIJA"},obrasci:{image:"/assets/sume-2.jpg",title:"OBRASCI"},strucno:{image:"/assets/sume-2.jpg",title:"PRAVILNIK I PROGRAM"},"strucno-dogadaji":{image:"/assets/sume-2.jpg",title:"DOGADANJA"},"strucno-prezentacije":{image:"/assets/sume-2.jpg",title:"PREZENTACIJE"},projekti:{image:"/assets/sume-2.jpg",title:"PROJEKTI"},kontakti:{image:"/assets/sume-2.jpg",title:"KONTAKTI"},"profil-clana":{image:"/assets/sume-2.jpg",title:"Profil Älana"},"datoteka-nije-pronadena":{image:"/assets/sume-2.jpg",title:"DATOTEKA NIJE PRONAÄENA"}},qp={"pristup-informacijama":"Pristup informacijama","osiguranje-clanova":"Osiguranje Älanova","zastita-osobnih-podataka":"Zastita osobnih pod
195ataka","uvjeti-koristenja":"Uvjeti koristenja","pravila-privatnosti":"Pravila privatnosti","o-komori":"O komori","struktura-komore":"Struktura komore","akti-komore":"Akti komore","zakoni-propisi":"Zakoni i propisi","operativne-informacije":"Operativne informacije","e-savjetovanje":"E-savjetovanje","natjecaji-burza-rada":"NatjeÄaji, burza rada","izdanja-komore":"Izdanja komore",ispiti:"Strucni ispiti",upis:"Upis",licenciranje:"Licenciranje",cekici:"Cekici",popratnice:"Popratnice","racunalne-baze":"Racunalne baze",imenik:"Imenik ovlastenih inzenjera","upisnik-licencija":"Upisnik licencija",obrasci:"Obrasci",strucno:"Pravilnik i program","strucno-dogadaji":"Dogadanja","strucno-prezentacije":"Prezentacije",projekti:"EU projekti",kontakti:"Kontakti","profil-clana":"Profil Älana","datoteka-nije-pronadena":"Datoteka nije pronaÄena"},Dr=4,au="/assets/news-default.png",Br="/assets/news-default.png",vg=/\b(https?:\/\/[^\s<>'"[\]{}]+|www\.\s*[A-Za-z0-9.-]+\.[A-Za-z]{2,}(?:\/[^\s<>'"[\]{}]*)?|\/?(?:cdn|dokumenti|podaci|api\/web\/dokumenti|web\/dokumenti)\/[^\s<>'"[\]{}]+)/gi,z4=/^https?:\/{3,}(?=(?:cdn|dokumenti|podaci|api\/web\/dokumenti|web\/dokumenti)(?:\/|$))/i,Ij="rounded-[4px] px-1 py-[1px] font-semibold text-[#1f5b3a] underline decoration-[#2a7a4c] decoration-2 underline-offset-[4px] transition duration-200 hover:text-[#16442c] hover:decoration-[#16442c] hover:underline-offset-[6px] hover:shadow-[inset_0_-0.52em_0_rgba(85,196,130,0.22)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#2f5f3e]/60 focus-visible:ring-offset-2";function P4(t){const e=String(t||"");if(!e.includes("&")||typeof document>"u")return e;const n=document.createElement("textarea");return n.innerHTML=e,n.value}function zs(t){return ut(P4(t||""))}function zj(t){return zs(t||"").replace(/\r\n/g,` 196`).replace(/\r/g,` 197`).replace(/\n{2,}/g,` 198`)}function Ss(t){return ui(t)}function Pj(t){const e=t.currentTarget;e.dataset.fallbackApplied!=="true"&&(e.dataset.fallbackApplied="true",e.src=ui(Br)||Br)}function In({blocks:t,audit:e,renderBlockActions:n,onBlockClick:r,selectedBlockId:i=null,onBlockReorder:s,preserveBlockOrder:o=!0,onBlockDelete:a}){if(t.length===0)return null;const l=n||o?t:t.map((H,P)=>({block:H,index:P})).sort((H,P)=>{const z=H.block.type==="publishedDate",Y=P.block.type==="publishedDate",Q=H.block.type==="heading"&&H.block.level==="article",O=P.block.type==="heading"&&P.block.level==="article";return Q&&!O?-1:!Q&&O?1:z&&!Y?-1:!z&&Y?1:H.index-P.index}).map(H=>H.block),u=!n&&typeof r=="function",d=!n&&typeof s=="function",f=!n&&typeof a=="function",[p,m]=h.useState(null),[g,y]=h.useState(null),[j,x]=h.useState(null),k=h.useRef(""),N=h.useRef(null);N.current||(N.current=Ll({edgeThresholdPx:96,maxSpeedPx:22})),h.useEffect(()=>()=>{var H;(H=N.current)==null||H.stop()},[]);function C(H,P){if(!u||!r)return;P.target.closest("a")&&P.preventDefault(),r(H)}function w(H,P){d&&(P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",H),m(H),y(H),x("before"),k.current="")}function E(H,P,z){var ie;if(!d||!s)return;z.preventDefault(),z.dataTransfer.dropEffect="move",(ie=N.current)==null||ie.update(z.clientY,z.currentTarget);const Y=z.dataTransfer.getData("text/plain")||p;if(!Y||Y===H.id)return;const Q=z.currentTarget.getBoundingClientRect(),O=z.clientY>Q.top+Q.height/2,U=l[P+1],$=O?(U==null?void 0:U.id)??null:H.id;if($===Y)return;const J=`${Y}->${$??"__end__"}`;k.current!==J&&(k.current=J,y(H.id),x(O?"after":"before"),s(Y,$))}function D(){var H;d&&(m(null),y(null),x(null),k.current="",(H=N.current)==null||H.stop())}function L(H){function P(O){let U=O;for(;U&&".,;:!?".includes(U[U.length-1]);)U=U.slice(0,-1);for(;U.endsWith(")")&&U.split(")").length-1>U.split("(").length-1;)U=U.slice(0,-1);for(;U.endsWith("]")&&U.split("]").length-1>U.split("[").length-1;)U=U.slice(0,-1);for(;U.endsWith("}")&&U.split("}").length-1>U.split("{").length-1;)U=U.slice(0,-1);return U}function z(O){let U=zs(O).trim();if(U=U.replace(/^www\.\s+/i,"www."),U=U.replace(z4,"/"),U=P(U),!U)return null;if(/^\/?(cdn|dokumenti|podaci|api\/web\/dokumenti|web\/dokumenti)\//i.test(U)){const J=Ss(U.startsWith("/")?U:`/${U}`);return{display:U,href:J}}const $=/^www\./i.test(U)?`https://${U}`:U;try{const J=new URL($);return!J.hostname||J.hostname.toLowerCase()==="www"?null:{display:U,href:$}}catch{return null}}function Y(O,U,$=""){const J=zj(O||"");if(!J)return null;const ie=[];let oe=0,be=0;vg.lastIndex=0;let Ee=vg.exec(J);for(;Ee;){const le=Ee[0],Me=Ee.index,_=Me+le.length;Me>oe&&ie.push(c.jsx("span",{className:$,children:J.slice(oe,Me)},`${U}-txt-${be}`));const ce=z(le);
198ce?ie.push(c.jsx("a",{href:ce.href,target:"_blank",rel:"noreferrer noopener",className:Ij,children:c.jsx("span",{className:$,children:ce.display})},`${U}-lnk-${be}-${ce.href}`)):ie.push(c.jsx("span",{className:$,children:le},`${U}-raw-${be}`)),oe=_,be+=1,Ee=vg.exec(J)}return oe<J.length&&ie.push(c.jsx("span",{className:$,children:J.slice(oe)},`${U}-tail`)),ie.length===1?ie[0]:c.jsx(c.Fragment,{children:ie})}return typeof H=="string"?Y(H,"rich-plain"):H.reduce((O,U)=>{if(typeof U=="string"){if(!U)return O;const J=O[O.length-1];return typeof J=="string"?O[O.length-1]=J+U:O.push(U),O}if(!U.text)return O;const $=O[O.length-1];return $&&typeof $!="string"&&$.href===U.href&&$.bold===U.bold&&$.italic===U.italic&&$.underline===U.underline&&$.strike===U.strike&&$.code===U.code&&$.autoLink===U.autoLink?($.text+=U.text,O):(O.push({...U}),O)},[]).map((O,U)=>{if(typeof O=="string")return c.jsx("span",{children:Y(O,`text-${U}`)},`text-${U}`);const $=`${O.bold?"font-extrabold":""} ${O.italic?"italic":""} ${O.underline?"underline decoration-[1.5px] underline-offset-[2px]":""} ${O.strike?"line-through decoration-[1.5px]":""} ${O.code?"rounded bg-[#e5efe8] px-1 py-[1px] font-mono text-[0.92em] text-[#1f4b33]":""}`.trim(),J=c.jsx("span",{className:$,children:zj(O.text)});return O.href?c.jsx("a",{href:Ss(O.href),target:"_blank",rel:"noreferrer noopener",className:Ij,children:J},`link-${U}-${O.href}-${O.text}`):O.autoLink===!1?c.jsx("span",{children:J},`rich-no-link-${U}-${O.text}`):c.jsx("span",{children:Y(O.text,`rich-${U}`,$)},`rich-${U}-${O.text}`)})}function V(H){const P=String(H||"").trim();if(!P)return"";let z="",Y="",Q="";const O=/^(\d{4})-(\d{2})-(\d{2})$/.exec(P);if(O)Q=O[1],Y=O[2],z=O[3];else{const J=/^(\d{1,2})\s*[.\-/]\s*(\d{1,2})\s*[.\-/]\s*(\d{4})\.?$/.exec(P);if(J)z=String(Number(J[1])).padStart(2,"0"),Y=String(Number(J[2])).padStart(2,"0"),Q=J[3];else{const ie=new Date(P);if(Number.isNaN(ie.getTime()))return P;z=String(ie.getDate()).padStart(2,"0"),Y=String(ie.getMonth()+1).padStart(2,"0"),Q=String(ie.getFullYear())}}const U=new Date(Number(Q),Number(Y)-1,Number(z));return Number.isNaN(U.getTime())?P:`${U.toLocaleDateString("hr-HR",{weekday:"long"})}, ${String(z).padStart(2,"0")}.${String(Y).padStart(2,"0")}.${Q}.`}function te(){var z;if(typeof window>"u")return"";const H=window.__HKISDT_SERVER_TODAY__;if(typeof H=="string"&&H.trim())return H.trim();const P=(z=document.querySelector('meta[name="hki-server-today"]'))==null?void 0:z.getAttribute("content");return P&&P.trim()?P.trim():""}function ae(){const H=te();if(H){const U=V(H);if(U)return U}const P=new Date,z=String(P.getDate()).padStart(2,"0"),Y=String(P.getMonth()+1).padStart(2,"0"),Q=P.getFullYear();return`${P.toLocaleDateString("hr-HR",{weekday:"long"})}, ${z}.${Y}.${Q}.`}function ke(H){const P=String(H||"").trim();if(!P)return null;const z=new Date(P);return Number.isNaN(z.getTime())?P:new Intl.DateTimeFormat("hr-HR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(z)}function ge(){if(!e)return null;const H=ts(e.createdBy)||zs(String(e.createdBy||"").trim()),P=ts(e.updatedBy)||zs(String(e.updatedBy||"").trim());if(!!!(H||P))return null;const Y=H||"Nepoznato",Q=P||Y||"Nepoznato",O=ke(e.createdAt),U=ke(e.updatedAt);if(!!!(O||U))return null;const J=Date.parse(String(e.createdAt||"")),ie=Date.parse(String(e.updatedAt||"")),oe=Number.isFinite(J)&&Number.isFinite(ie),be=!!(P&&H&&P!==H);return(oe?Math.abs(ie-J)>1e3||be:!!(U&&O&&U!==O)||be)?{label:"Posljednje ažurirao/la",by:Q||"Nepoznato",at:U||O||""}:{label:"Dodao/la",by:Y||Q||"Nepoznato",at:O||U||""}}const Se=[];for(let H=0;H<l.length;H+=1){const P=l[H],z=H>0?l[H-1]:null,Y=(z==null?void 0:z.type)==="publishedDate",Q=(z==null?void 0:z.type)==="heading"&&z.level==="article",O=P.type==="publishedDate",U=H===0?"":Y||O&&Q?"mt-2":"mt-6";if(P.type==="image"&&!d){const J=[P];let ie=H+1;for(;ie<l.length&&l[ie].type==="image";)J.push(l[ie]),ie+=1;const oe=[];for(let be=0;be<J.length;be+=3)oe.push(J.slice(be,be+3));Se.push(c.jsx("div",{className:U,children:c.jsx("div",{className:"space-y-4",children:oe.map((be,Ee)=>c.jsx("div",{className:"flex flex-wrap justify-center gap-4",children:be.map(le=>c.jsx("div",{className:"w-full sm:w-[calc(50%-0.75rem)] lg:w-[calc(33.333%-0.75rem)] lg:min-w-[260px] lg:max-w-[420px]",children:c.jsxs("figure",{className:`overflow-hidden rounded-lg border border-[#d7e6df] bg-white shadow-[0_8px_20px_rgba(30,80,55,0.08)] transition duration-300 hover:-translate-y-[2px] hover:shadow-[0_14px_28px_rgba(30,80,55,0.13)] ${u?"curs
198or-pointer":""} ${i===le.id?"ring-2 ring-[#4f8a63]/35":""}`,onClick:Me=>C(le,Me),children:[c.jsx("img",{src:Ss(le.src),alt:le.alt,loading:"lazy",decoding:"async",onError:Pj,className:"h-auto w-full object-contain"}),le.caption&&c.jsx("figcaption",{className:"px-3 py-2 text-sm text-[#4c4c4c]",children:le.caption}),n&&c.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-[#edf3ef] px-3 py-2",children:n(le)})]})},le.id))},`image-row-${P.id}-${Ee}`))})},`image-group-${P.id}`)),H=ie-1;continue}let $=null;if(P.type==="heading"&&(P.level==="article"?$=c.jsx("h2",{className:"break-words text-2xl font-extrabold leading-[1.18] text-[#1f4630] [overflow-wrap:anywhere] sm:text-[1.7rem] md:text-[1.85rem] lg:text-[2rem]",children:zs(P.text)},P.id):P.accent?$=c.jsx("h3",{className:"break-words border-l-4 border-[#5a9b70] pl-3 text-lg font-semibold leading-snug text-[#417158] [overflow-wrap:anywhere] md:text-xl",children:zs(P.text)},P.id):$=c.jsx("h2",{className:"break-words text-xl font-bold leading-tight text-[#2a5a3d] [overflow-wrap:anywhere] md:text-2xl",children:zs(P.text)},P.id)),P.type==="paragraph"&&($=c.jsx("p",{className:"max-w-none whitespace-pre-line break-words text-base leading-7 text-[#31563d] [overflow-wrap:anywhere] md:text-[1.0625rem] md:leading-7",children:L(P.text)},P.id)),P.type==="list"&&($=c.jsx("ul",{className:"space-y-3 pl-7 text-base leading-7 marker:text-[#376d44] md:text-[1.0625rem] md:leading-7",style:{listStyleType:P.ordered?"decimal":"disc"},children:P.items.map(J=>c.jsx("li",{className:"whitespace-pre-line break-words [overflow-wrap:anywhere] text-[#2f5b3f] transition hover:text-[#244e33]",children:L(J)},`${P.id}-${typeof J=="string"?J:JSON.stringify(J)}`))},P.id)),P.type==="image"&&($=c.jsx("div",{className:"mx-auto w-full max-w-[420px]",children:c.jsxs("figure",{className:"overflow-hidden rounded-lg border border-[#d7e6df] bg-white shadow-[0_8px_20px_rgba(30,80,55,0.08)]",children:[c.jsx("img",{src:Ss(P.src),alt:P.alt,loading:"lazy",decoding:"async",onError:Pj,className:"h-auto w-full object-contain"}),P.caption&&c.jsx("figcaption",{className:"px-3 py-2 text-sm text-[#4c4c4c]",children:P.caption})]},P.id)})),P.type==="publishedDate"){const J=P.resolvedDate?V(P.resolvedDate):P.useToday?ae():P.date?V(P.date):"";J?$=c.jsxs("p",{className:"text-sm font-medium text-[#6f8679]",children:["Objavljeno: ",J]},P.id):$=null}if(P.type==="documents"&&($=c.jsx("section",{className:"space-y-3",children:c.jsx("div",{className:"space-y-2",children:P.items.map(J=>{const ie=Ss(String(J.wordUrl||"")),oe=Ss(String(J.pdfUrl||"")),be=Ss(String(J.pptUrl||"")),Ee=Ss(String(J.excelUrl||""));return c.jsx("div",{className:"rounded-2xl border border-[#d0ddd8] bg-[#d7e6e2] px-3 py-3 transition hover:bg-[#cfe0db] md:px-4",children:c.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[c.jsx("p",{className:"m-0 min-w-0 flex-1 break-words text-base font-semibold leading-snug text-[#204f35] [overflow-wrap:anywhere] md:text-[1.0625rem]",children:zs(J.label)}),c.jsxs("div",{className:"flex flex-wrap gap-2 md:gap-2.5 lg:shrink-0 lg:justify-end",children:[ie&&c.jsx("a",{href:ie,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 min-w-[124px] max-w-full items-center justify-center whitespace-nowrap rounded-full border-2 border-[#376d44] bg-[#376d44] px-3.5 text-[0.9rem] font-semibold text-white shadow-[0_3px_8px_rgba(47,95,62,0.2)] transition hover:-translate-y-px hover:bg-[#2f5f3e] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#376d44]/50 focus-visible:ring-offset-2",children:"WORD"}),oe&&c.jsx("a",{href:oe,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 min-w-[124px] max-w-full items-center justify-center whitespace-nowrap rounded-full border-2 border-[#376d44] bg-[#376d44] px-3.5 text-[0.9rem] font-semibold text-white shadow-[0_3px_8px_rgba(47,95,62,0.2)] transition hover:-translate-y-px hover:bg-[#2f5f3e] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#376d44]/50 focus-visible:ring-offset-2",children:"PDF"}),be&&c.jsx("a",{href:be,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 min-w-[124px] max-w-full items-center justify-center whitespace-nowrap rounded-full border-2 border-[#376d44] bg-[#376d44] px-3.5 text-[0.9rem] font-semibold text-white shadow-[0_3px_8px_rgba(47,95,62,0.2)] transition hover:-translate-y-
198px hover:bg-[#2f5f3e] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#376d44]/50 focus-visible:ring-offset-2",children:"PPT"}),Ee&&c.jsx("a",{href:Ee,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-10 min-w-[124px] max-w-full items-center justify-center whitespace-nowrap rounded-full border-2 border-[#376d44] bg-[#376d44] px-3.5 text-[0.9rem] font-semibold text-white shadow-[0_3px_8px_rgba(47,95,62,0.2)] transition hover:-translate-y-px hover:bg-[#2f5f3e] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#376d44]/50 focus-visible:ring-offset-2",children:"EXCEL"})]})]})},`${P.id}-${J.label}`)})})},P.id)),!!$){if(!n){Se.push(c.jsxs("div",{draggable:d,onDragStart:J=>w(P.id,J),onDragOver:J=>E(P,H,J),onDrop:J=>{J.preventDefault(),D()},onDragEnd:D,className:`${U} relative ${u?"cursor-pointer rounded-lg px-2 py-1.5 transition hover:bg-[#f3faf6]":""} ${i===P.id?"rounded-lg ring-2 ring-[#4f8a63]/35":""} ${d&&g===P.id?`ring-2 ring-[#4f8a63]/20 ${j==="after"?"shadow-[inset_0_-2px_0_0_rgba(79,138,99,0.65)]":"shadow-[inset_0_2px_0_0_rgba(79,138,99,0.65)]"}`:""} ${d&&p===P.id?"opacity-60":""}`,onClick:J=>C(P,J),children:[f&&i===P.id&&c.jsx("div",{className:"mb-1 flex justify-end",children:c.jsx("button",{type:"button",draggable:!1,onClick:J=>{J.preventDefault(),J.stopPropagation(),a==null||a(P.id)},className:"admin-btn h-7 border-[#e2b8b8] bg-white px-2 text-[11px] font-semibold text-[#a32a2a] transition hover:border-[#d8a2a2] hover:bg-[#fff1f1]",children:"Obriši"})}),$]},P.id));continue}Se.push(c.jsxs("div",{className:`${U} grid gap-2 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-start`,children:[c.jsx("div",{className:"min-w-0",children:$}),c.jsx("div",{className:"flex items-start justify-end pt-1",children:n(P)})]},P.id))}}const me=ge();return c.jsxs("article",{className:"mx-auto w-full max-w-[1320px] px-2 py-2 md:px-4 md:py-3",onDragOver:H=>{var P;!d||!p||H.isDefaultPrevented()||(P=N.current)==null||P.update(H.clientY,H.currentTarget)},children:[Se,me&&c.jsxs("p",{className:"mt-7 border-t border-[#d7e6df] pt-3 text-[0.86rem] font-medium leading-relaxed text-[#5b7768]",children:[me.label,": ",c.jsx("span",{className:"font-semibold text-[#2a5a3d]",children:me.by}),me.at?`, ${me.at}`:""]})]})}function Dj(t){if(!t)return[];const e=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(t.querySelectorAll(e)).filter(n=>!n.hasAttribute("disabled")&&n.getAttribute("aria-hidden")!=="true")}function D4({open:t,modalRef:e,initialFocusRef:n,closeConfirmOpen:r=!1,disableClose:i=!1,onRequestClose:s}){const o=h.useRef(null);h.useEffect(()=>{if(t){o.current=document.activeElement;return}const a=o.current;!a||typeof a.focus!="function"||window.setTimeout(()=>{try{a.focus()}catch{}},0)},[t]),h.useEffect(()=>{if(t)return Dl()},[t]),h.useEffect(()=>{if(!t||r)return;const a=window.setTimeout(()=>{const l=n==null?void 0:n.current;if(l&&typeof l.focus=="function"){l.focus();return}const u=Dj(e.current)[0];u==null||u.focus()},0);return()=>window.clearTimeout(a)},[r,n,e,t]),h.useEffect(()=>{if(!t)return;const a=l=>{var m;if(l.key==="Escape"){if(i||r)return;s==null||s();return}if(l.key!=="Tab"||r)return;const u=Dj(e.current);if(u.length===0){l.preventDefault();return}const d=u[0],f=u[u.length-1],p=document.activeElement;if(l.shiftKey){(!p||p===d||!((m=e.current)!=null&&m.contains(p)))&&(l.preventDefault(),f.focus());return}p===f&&(l.preventDefault(),d.focus())};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[r,i,e,s,t])}function Ju({open:t,onRequestClose:e,disableClose:n=!1,closeOnOverlayClick:r=!0,closeConfirmOpen:i=!1,initialFocusRef:s,labelledBy:o,describedBy:a,zIndexClassName:l="z-[500]",rootClassName:u="flex items-center justify-center p-4",overlayClassName:d="bg-black/60 backdrop-blur-[2px]",panelClassName:f="",panelProps:p,children:m}){const g=h.useRef(null);if(D4({open:t,modalRef:g,initialFocusRef:s,closeConfirmOpen:i,disableClose:n,onRequestClose:e}),!t)return null;function y(){e&&r&&(n||i||e())}return go.createPortal(c.jsxs("div",{className:`fixed inset-0 ${l} ${u}`,children:[c.jsx("div",{className:`absolute inset-0 ${d}`,onClick:y}
198),c.jsx("section",{...p,ref:g,role:"dialog","aria-modal":"true","aria-labelledby":o,"aria-describedby":a,className:`relative z-[1] ${f}`.trim(),onClick:j=>j.stopPropagation(),children:m})]}),document.body)}function vr({open:t,title:e,description:n,confirmLabel:r="Obriši",cancelLabel:i="Odustani",onConfirm:s,onCancel:o}){const a=h.useRef(null);return c.jsx(Ju,{open:t,onRequestClose:o,initialFocusRef:a,labelledBy:"danger-confirm-title",describedBy:"danger-confirm-description",zIndexClassName:"z-[520]",rootClassName:"flex items-center justify-center p-4",overlayClassName:"bg-[radial-gradient(circle_at_top,rgba(24,38,30,0.45),rgba(10,16,12,0.82))] backdrop-blur-[2px]",panelClassName:"w-full max-w-[540px] max-h-[calc(100dvh-2rem)] overflow-hidden rounded-lg border border-[#e9c6c6] bg-white shadow-[0_24px_60px_rgba(14,28,20,0.35)]",children:c.jsxs("div",{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto",children:[c.jsxs("div",{className:"border-b border-[#f2d6d6] px-5 py-4",children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#9d3b3b]",children:"Potvrda radnje"}),c.jsx("h3",{id:"danger-confirm-title",className:"m-0 mt-1 text-lg font-black leading-tight text-[#7d2222]",children:e}),c.jsx("p",{id:"danger-confirm-description",className:"m-0 mt-2 text-sm leading-6 text-[#7e3b3b]",children:n})]}),c.jsxs("div",{className:"sticky bottom-0 flex flex-wrap items-center justify-end gap-2 border-t border-[#f2d6d6] bg-white/95 px-5 py-4 backdrop-blur",children:[c.jsx("button",{ref:a,type:"button",onClick:o,className:"admin-btn h-10 border-[#d6c8c8] bg-white px-4 text-sm font-semibold text-[#5b5b5b] transition hover:bg-[#f7f7f7]",children:i}),c.jsx("button",{type:"button",onClick:s,className:"admin-btn h-10 border-[#bb2f2f] bg-[linear-gradient(180deg,#d33c3c,#b72424)] px-4 text-sm font-semibold text-white transition hover:brightness-95",children:r})]})]})})}function GC(t){const e=String(t.fontWeight||"").trim().toLowerCase();if(!e)return!1;if(e==="bold"||e==="bolder")return!0;const n=Number(e);return Number.isFinite(n)&&n>=600}function qC(t){const e=String(t.fontStyle||"").trim().toLowerCase();return e.includes("italic")||e.includes("oblique")}function JC(t){return String(t.textDecorationLine||t.textDecoration||"").toLowerCase().includes("line-through")}function ZC(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function yg(t){return ZC(t).replace(/\r\n/g,` 199`).replace(/\r/g,` 200`).replace(/\n/g,"<br>")}function YC(t){return typeof t=="string"?yg(t):t.map(e=>{if(typeof e=="string")return yg(e);const n=e;let r=yg(n.text);return n.code&&(r=`<code>${r}</code>`),n.bold&&(r=`<strong>${r}</strong>`),n.italic&&(r=`<em>${r}</em>`),n.underline&&(r=`<u>${r}</u>`),n.strike&&(r=`<s>${r}</s>`),n.autoLink===!1&&!n.href&&(r=`<span data-autolink="off">${r}</span>`),n.href&&(r=`<a href="${ZC(n.href)}" target="_blank" rel="noopener noreferrer">${r}</a>`),r}).join("")}function O4(t){const e=[],n=(r,i)=>r.href===i.href&&r.bold===i.bold&&r.italic===i.italic&&r.underline===i.underline&&r.strike===i.strike&&r.code===i.code&&r.autoLink===i.autoLink;for(const r of t){if(typeof r=="string"){if(!r)continue;const s=e[e.length-1];typeof s=="string"?e[e.length-1]=s+r:e.push(r);continue}if(!r.text)continue;const i=e[e.length-1];if(i&&typeof i!="string"&&n(i,r)){i.text+=r.text;continue}e.push({...r})}return e.some(r=>typeof r!="string")?e:e.join("")||""}function QC(t,e,n){if(t.nodeType===Node.TEXT_NODE){const o=t.textContent??"";if(!o)return;!e.bold&&!e.italic&&!e.underline&&!e.strike&&!e.code&&!e.href&&e.autoLink!==!1?n.push(o):n.push({text:o,bold:e.bold||void 0,italic:e.italic||void 0,underline:e.underline||void 0,strike:e.strike||void 0,code:e.code||void 0,href:e.href,autoLink:e.autoLink===!1?!1:void 0});return}if(t.nodeType!==Node.ELEMENT_NODE)return;const r=t,i=r.tagName.toLowerCase(),s={...e};if((i==="strong"||i==="b")&&(s.bold=!0),(i==="em"||i==="i")&&(s.italic=!0),i==="u"&&(s.underline=!0),(i==="s"||i==="strike"||i==="del")&&(s.strike=!0),i==="code"&&(s.code=!0),GC(r.style)&&(s.bold=!0),qC(r.style)&&(s.italic=!0),(r.style.textDecorationLine||r.style.textDecoration||"").toLowerCase().includes("underline")&&(s.underline=!0),JC(r.
200style)&&(s.strike=!0),i==="a"&&(s.href=r.getAttribute("href")||e.href),(r.getAttribute("data-autolink")==="off"||r.getAttribute("data-no-autolink")==="true")&&(s.autoLink=!1),i==="br"){n.push(` 201`);return}Array.from(r.childNodes).forEach(o=>QC(o,s,n))}function kg(t){const e=[],n=t.tagName.toLowerCase(),r={};return(n==="strong"||n==="b")&&(r.bold=!0),(n==="em"||n==="i")&&(r.italic=!0),n==="u"&&(r.underline=!0),(n==="s"||n==="strike"||n==="del")&&(r.strike=!0),n==="code"&&(r.code=!0),GC(t.style)&&(r.bold=!0),qC(t.style)&&(r.italic=!0),(t.style.textDecorationLine||t.style.textDecoration||"").toLowerCase().includes("underline")&&(r.underline=!0),JC(t.style)&&(r.strike=!0),n==="a"&&(r.href=t.getAttribute("href")||void 0),(t.getAttribute("data-autolink")==="off"||t.getAttribute("data-no-autolink")==="true")&&(r.autoLink=!1),Array.from(t.childNodes).forEach(i=>QC(i,r,e)),O4(e)}function qd(t,e){const n=document.createElement("div");n.innerHTML=t;const r=[];let i=0;function s(f){return Array.from(f.querySelectorAll(":scope > li")).map(p=>kg(p)).filter(p=>typeof p=="string"?p.trim().length>0:p.length>0)}function o(f){return["a","strong","b","em","i","span","u","s","strike","del","code","mark","small","sup","sub","br"].includes(f)}function a(f){if(f.length===0)return;const p=document.createElement("div");f.forEach(g=>p.appendChild(g.cloneNode(!0)));const m=kg(p);typeof m=="string"&&!m.trim()||Array.isArray(m)&&m.length===0||r.push({id:`${e}-p-${i++}`,type:"paragraph",text:m})}function l(f){const p=kg(f);typeof p=="string"&&!p.trim()||Array.isArray(p)&&p.length===0||r.push({id:`${e}-p-${i++}`,type:"paragraph",text:p})}function u(f,p=!1){const m=(f.textContent||"").trim();m&&r.push({id:`${e}-h-${i++}`,type:"heading",text:m,accent:p||void 0})}function d(f){const p=[],m=()=>{a(p),p.length=0};for(const g of f){if(g.nodeType===Node.TEXT_NODE){p.push(g);continue}if(g.nodeType!==Node.ELEMENT_NODE)continue;const y=g,j=y.tagName.toLowerCase();if(o(j)){p.push(g);continue}if(m(),j==="ul"||j==="ol"){const k=s(y);k.length>0&&r.push({id:`${e}-l-${i++}`,type:"list",items:k,ordered:j==="ol"||void 0});continue}if(j==="h2"){u(y,!1);continue}if(j==="h3"){u(y,!0);continue}if(Array.from(y.children).filter(k=>{const N=k.tagName.toLowerCase();return N==="ul"||N==="ol"}).length>0){const k=Array.from(y.childNodes).filter(N=>N.nodeType===Node.TEXT_NODE).map(N=>N.textContent??"").join("").trim();k&&r.push({id:`${e}-p-${i++}`,type:"paragraph",text:k}),d(Array.from(y.childNodes));continue}l(y)}m()}return d(Array.from(n.childNodes)),r}const Pa=["word","pdf","ppt","excel"],jg="application/x-admin-document-id",Jd=700*1024*1024,Zd=700*1024*1024,Yd=950*1024*1024,Oj=/^(?:\/)?(?:cdn|web\/dokumenti|api\/web\/dokumenti|dokumenti|podaci|api)(?:\/|$)/i,_4=/^https?:\/{3,}(?=(?:cdn|web\/dokumenti|api\/web\/dokumenti|dokumenti|podaci|api)(?:\/|$))/i,wg="Dokumenti s istim nazivom i istim formatom ostali su odvojeni. Promijeni naziv ili ukloni duplikat formata.",_j={article:"Naslov Älanka",publishedDate:"Datum objave",section:"Naslov sekcije",accent:"Podnaslov",paragraph:"Odlomak",image:"Slika",document:"Dokument"},L4=["article","publishedDate","section","accent","paragraph","image","document"];function R4(t){return t==="article"?"Unesi naslov Älanka":t==="section"?"Unesi naslov sekcije":t==="accent"?"Unesi podnaslov":"Unesi naslov"}function $4(t){return String(t||"").replace(/<br\s*\/?>/gi,"").replace(/ /gi," ").replace(/<div>(\s| )*<\/div>/gi,"").replace(/<p>(\s| )*<\/p>/gi,"").replace(/<[^>]+>/g,"").trim().length>0}function B4(t){return typeof t=="string"||Array.isArray(t)?t:t&&typeof t=="object"&&"text"in t&&typeof t.text=="string"?[t]:String(t??"")}function F4(t,e=!1){const n=e?"ol":"ul",r=t.map(i=>`<li>${YC(B4(i))}</li>`).join("");return`<${n}>${r}</${n}>`}function Qd(t){try{return JSON.stringify(t)}catch{return String(t.length)}}function Ra(t){const e=String(t||"").trim();if(!e)return"";const n=e.split("#")[0].split("?")[0].replace(/\\/g,"/").trim();if(!n)return"";try{return new URL(n,"https://hkisdt.hr").pathname.replace(/\/{2,}/g,"/").toLowerCase()}catch{return n.replace(/\/{2,}/g,"/").toLowerCase()}}function Lj(t){const e=new Set,n=[];let r=1;for(const i of t){if(i.type!=="image")continue;const s=String(i.src||"").trim();if(!s)continue;const o=Ra(s)||s;if(e.has(o))continue;e.add(o);const a=String(i.fileName||"").trim(),l=String(i.alt||"").trim(),u=a||l||`Slika ${r}`;n.push({id:i.id,src:s,label:`${r}. ${u}`}),r+=1}return n}function U4({blocks:t,onChange:e,onPublishArticle:n,onCloseEditor:r,openPreviewRequestId:i=0,publishButtonLabel:s="Spremi novi Älanak",onPendingInputChange:o,enableCardImageSelection:a=!1,initialCardImageSrc:l=null,isPublishing:u=!1}){var pd,md;const d=h.useRef(null),f=h.useRef(null),p=h.useRef(null),m=h.useRef(null),g=h.useRef(null),y=h.useRef(null),j=h.useRef(null),x=h.useRef(null),k=h.useRef(""),N=h.useRef(null);N.current||(N.current=Ll({edgeThresholdPx:96,maxSpeedPx:22}));const[C,w]=h.useState("article"),[E,D]=h.useState(""),[L,V]=h.useState([]),[te,ae]=h.useState(!1),[ke,ge]=h.useState(""),[Se,me]=h.useState(!1),[H,P]=h.useState(""),[z,Y]=h.useState(""),[Q,O]=h.useState(""),[U,$]=h.useState(""),[J,ie]=h.useState(""),[oe,be]=h.useState(""),[Ee,le]=h.useState(null),[Me,_]=h.useState(""),[ce,de]=h.useState([]),[De,Oe]=h.useState(""),[He,ot]=h.useState(!1),[Ge,Te]=h.useState(""),[Ke,Ne]=h.useState(!1),[_e,We]=h.useState(!1),[tt,at]=h.useState(!1),[Ut,vt]=h.useState(!1),[b,T]=h.useState(!1),[S,I]=h.useState(null),[K,X]=h.useState(null),[G,re]=h.useState("edit"),[pe,ue]=h.useState(!1),[Ve,Fe]=h.useState("article"),[et,qe]=
201h.useState(!1),[jn,wn]=h.useState(null),[Sn,Ye]=h.useState(null),[Ht,_t]=h.useState(null),[it,Qe]=h.useState(null),[On,wr]=h.useState(null),[en,tn]=h.useState(null),[yo,Nn]=h.useState(!1),[Vr,Wn]=h.useState(!1),[zi,nn]=h.useState(!1),[Kr,Sr]=h.useState(!1),[Wr,Gr]=h.useState(!1),[Jt,rn]=h.useState(null),[Pi,or]=h.useState("auto"),[cs,di]=h.useState(""),ko=((pd=t.find(v=>v.type==="heading"&&v.level==="article"))==null?void 0:pd.id)??null,us=ko!==null&&(S===null||ko!==S),ga=((md=t.find(v=>v.type==="publishedDate"))==null?void 0:md.id)??null,ds=ga!==null&&(S===null||ga!==S),$l="admin-input min-h-[112px] rounded-lg px-3 py-2 text-sm leading-6 text-[#244e33] [&_a]:font-semibold [&_a]:text-[#1f5b3a] [&_a]:underline [&_a]:decoration-[#2a7a4c] [&_a]:decoration-2 [&_a]:underline-offset-[3px] [&_a:hover]:text-[#16442c] [&_ol]:list-decimal [&_ol]:pl-6 [&_ul]:list-disc [&_ul]:pl-6 focus:outline-none";function jo(v){const M=String(v||"").trim();return!M||M==="<p></p>"||M==="<p><br></p>"||M==="<div></div>"?"":M}const Je=f4({immediatelyRender:!1,extensions:[YO.configure({heading:!1,blockquote:!1,
201code:!1,codeBlock:!1,horizontalRule:!1}),CO,$5.configure({autolink:!1,openOnClick:!1,linkOnPaste:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer",class:"font-semibold text-[#1f5b3a] underline decoration-[#2a7a4c] decoration-2 underline-offset-[3px] hover:text-[#16442c]"}})],content:"",editorProps:{attributes:{class:$l},handleKeyDown:(v,M)=>{var q;return!(M.ctrlKey||M.metaKey)||M.key.toLowerCase()!=="k"?!1:(M.preventDefault(),(q=y.current)==null||q.focus(),!0)}},onCreate:({editor:v})=>{Oe(v.getHTML()),Jr(v)},onSelectionUpdate:({editor:v})=>{Jr(v);const{empty:M,from:F,to:q}=v.state.selection;if(M){_("");return}g.current={from:F,to:q};const se=v.state.doc.textBetween(F,q," ").trim();_(se)},onUpdate:({editor:v})=>{const M=v.getHTML();Oe(M),Te(se=>se&&""),Jr(v);const F=document.createElement("div");F.innerHTML=M;const q=Array.from(F.querySelectorAll("a[href]")).map((se,Ce)=>({id:`editor-link-${Ce}`,text:(se.textContent||"").trim()||"(bez teksta)",href:se.getAttribute("href")||""}));de(q)}});h.useEffect(()=>{if(!i||t.length===0)return;re("preview");const v=window.setTimeout(()=>{var M;(M=m.current)==null||M.scrollIntoView({behavior:"smooth",block:"start"})},80);return()=>window.clearTimeout(v)},[i]),h.useEffect(()=>{t.length>0||re("edit")},[t.length]),h.useEffect(()=>{const v=M=>{const F=M.target;x.current&&F&&!x.current.contains(F)&&qe(!1)};return window.addEventListener("pointerdown",v),()=>{window.removeEventListener("pointerdown",v)}},[]),h.useEffect(()=>{u&&qe(!1)},[u]),h.useEffect(()=>{if(!Je)return;const v=C==="paragraph";Je.setEditable(v&&!u)},[u,C,Je]),h.useEffect(()=>{K&&!t.some(v=>v.id===K)&&X(null),S&&!t.some(v=>v.id===S)&&I(null)},[K,t,S]),h.useEffect(()=>{K===null&&t.length!==0&&X(t[0].id)},[K,t]),h.useEffect(()=>{S===null&&C!==Ve&&w(Ve)},[S,C,Ve]),h.useEffect(()=>{Gr(!1)},[S,C,G]),h.useEffect(()=>{U.trim()||ie("")},[U]);function Bl(v){const M=String((v==null?void 0:v.name)||"").trim(),F=oe.trim();if(!F)return M;const q=qr(F),se=qr(M);return!q.ext&&se.ext?`${q.base||F}${se.ext}`:F}function Fl(v){const M=String(v||"").trim();if(!M)return"";const F=qr(M);if(F.ext)return M;const q=qr(String(J||"").trim());if(q.ext)return`${F.base||M}${q.ext}`;const se=Z(String(U||"").trim());return se?`${F.base||M}${se}`:M}async function ba(){if(u||He)return;const v=Fl(oe);if(!v)return;const M=String(J||"").trim(),F=String(U||"").trim();if(be(v),!(!F||v===M)&&!(!Ee&&!Oj.test(F)))try{const q=await k4({medij_id:Ee||void 0,putanja_ili_url:Ee?void 0:F,naziv_datoteke:v}),se=Number((q==null?void 0:q.medij_id)||0);se>0&&le(se),ie(String((q==null?void 0:q.naziv_datoteke)||v)),be(String((q==null?void 0:q.naziv_datoteke)||v)),Te("")}catch{Te("Preimenovanje postojeÄe datoteke za link nije uspjelo. PokuÅ¡aj ponovno.")}}function Ul(v){const M=/^(\d{4})-(\d{2})-(\d{2})$/.exec(v);if(!M)return"";const[,F,q,se]=M;return`${new Date(Number(F),Number(q)-1,Number(se)).toLocaleDateString("hr-HR",{weekday:"long"})}, ${se}.${q}.${F}.`}function xa(v){const M=v.name.toLowerCase();return M.endsWith(".doc")||M.endsWith(".docx")?"word":M.endsWith(".pdf")?"pdf":M.endsWith(".ppt")||M.endsWith(".pptx")?"ppt":M.endsWith(".xls")||M.endsWith(".xlsx")?"excel":null}function fs(v){return v==="word"?"WORD":v==="pdf"?"PDF":v==="ppt"?"PPT":"EXCEL"}function qr(v){const M=v.trim(),F=/^(.*?)(\.[a-zA-Z0-9]+)$/.exec(M);return F?{base:F[1],ext:F[2].toLowerCase()}:{base:M,ext:""}}function R(v){const M=String(v||"").trim();if(!M||M.startsWith("data:"))return"";const q=M.split(/[?#]/)[0].split("/").pop()||"";if(!q)return"";try{return decodeURIComponent(q)}catch{return q}}function W(v,M){const F=M.trim().toLowerCase();return v==="word"?F===".doc"||F===".docx"?F:".docx":v==="pdf"?F===".pdf"?F:".pdf":v==="ppt"?F===".ppt"||F===".pptx"?F:".pptx":F===".xls"||F===".xlsx"?F:".xlsx"}function Z(v){const M=v.trim().split(/[?#]/)[0],F=/\.([a-zA-Z0-9]+)$/.exec(M);return F?`.${F[1].toLowerCase()}`:""}function ee(v){const M=v.trim().toLowerCase();return M===".doc"||M===".docx"||M===".pdf"||M===".ppt"||M===".pptx"||M===".xls"||M===".xlsx"}function xe(v){const M=v.trim();if(!M)return"";const F=qr(M);return!F.ext||!ee(F.ext)?M:F.base.trim()}function fe(v){return v.trim().toLowerCase().replace(/\s+/g," ")}function Pe(v){return Pa.some(M=>{var F;return!!((F=v.formats[M])!=null&&F.url.trim())})}function $e(v,M){for(const F of Pa){const q=v.formats[F];if(!q)continue;const se=qr(q.fileName).base.trim();if(se)return se}return`Dokument ${M+1}`}function ct(v){return Pa.filter(M=>{var F;return!!((F=v.formats[M])!=null&&F.url.trim())})}function _n(v,M){const q=fe(v)?v.trim():`Dokument ${M.length+1}`;let se=2,Ce=q;for(;M.some(je=>fe(je.labelBase)===fe(Ce));)Ce=`${q} (${se})`,se+=1;return Ce}function gt(v){const M={};return Pa.forEach(F=>{const q=v[F];q&&(M[F]={...q})}),M}function Gn(v,M){const F=Date.now(),q=M.map((se,Ce)=>{const je=xe(se.labelBase)||se.labelBase.trim()||`Dokument ${v.length+Ce+1}`;return{id:`doc-group-${F}-${Ce}-${v.length+Ce}`,labelBase:je,formats:{[se.kind]:{url:se.url,fileName:se.fileName,ext:se.ext}}}});return[...v,...q]}function Ln(v){const M=[];let F=0;return v.forEach((q,se)=>{if(!Pe(q))return;const Ce={...q,labelBase:(xe(q.labelBase)||q.labelBase.trim()).trim(),formats:gt(q.formats)};Ce.labelBase||(Ce.labelBase=$e(Ce,se));const je=fe(Ce.labelBase),dt=je===""?-1:M.findIndex(Xe=>fe(Xe.labelBase)===je);if(dt<0){M.push(Ce);return}const ht=M[dt];if(Pa.some(Xe=>!!(ht.formats[Xe]&&Ce.formats[Xe]))){F+=1,Ce.labelBase=_n(Ce.labelBase,M),M.push(Ce);return}Pa.forEach(Xe=>{const Nt=Ce.formats[Xe];Nt&&(ht.formats[Xe]=Nt)})}),{items:M,conflictCount:F}}function Nr(v){const M=[];return v.forEach((F,q)=>{var Mt,Xe,Nt,Yr;const se=((Mt=F.formats.word)==null?void 0:Mt.url.trim())||"",Ce=((Xe=F.formats.pdf)==null?void 0:Xe.url.trim())||"",je=((Nt=F.formats.ppt)==null?void 0:Nt.url.trim())||"",dt=((Yr=F.formats.excel)==null?void 0:Yr.url.trim())||"";if(!se&&!Ce&&!je&&!dt)return;const ht=F.labelBase.trim()||$e(F,q);M.push({label:ht,...se?{wordUrl:se}:{},...Ce?{pdfUrl:Ce}:{},...je?{pptUrl:je}:{},...dt?{excelUrl:dt}:{}})}),M}function sn(){const v=Ln(L);return Nr(v.items)}function Vt(v){return`${(v/1048576).toFixed(1)} MB`}function Cr(v){return v.reduce((M,F)=>{var q,se,Ce,je;return M+(((q=F.wordUrl)==null?void 0:q.length)||0)+(((se=F.pdfUrl)==null?void 0:se.length)||0)+(((Ce=F.pptUrl)==null?void 0:Ce.length)||0)+(((je=F.excelUrl)==null?void 0:je.length)||0)},0)}function Di(v,M){V(F=>F.map(q=>{if(q.id!==v)return q;const se={...q.formats};delete se[M];const Ce={...q,formats:se};return Pe(Ce)?Ce:null}).filter(q=>q!==null))}function $m(v,M,F){rn({kind:"remove-document-format",itemId:v,docKind:M,label:F.trim()||"odabrani dokument"})}function Qu(v){V(M=>M.filter(F=>F.id!==v)),it===v&&Qe(null),On===v&&(wr(null),tn(null))}function Bm(v,M){rn({kind:"remove-document-item",itemId:v,label:M.trim()||"odabrani dokument"})}function Fm(v,M){const F=M;V(q=>q.map(se=>se.id===v?{...se,labelBase:F}:se)),Ge===wg&&Te("")}function Hl(v=L){const M=Ln(v);return JSON.stringify(v)!==JSON.stringify(M.items)&&V(M.items),M.conflictCount>0?Te(wg):Ge===wg&&Te(""),M}function Xu(v,M,F){!v||!M||v===M||(V(q=>{const se=q.findIndex(Xe=>Xe.id===v),Ce=q.findIndex(Xe=>Xe.id===M);if(se<0||Ce<0)return q;const je=[...q],[dt]=je.splice(se,1),ht=je.findIndex(Xe=>Xe.id===M);if(ht<0)return je.push(dt),je;const Mt=F==="after"?ht+1:ht;return je.splice(Mt,0,dt),je}),Te(""))}function Um(v,M,F,q){const se={},Ce=(dt,ht)=>{const Mt=String(ht||"").trim();if(!Mt)return;const Xe=W(dt,Z(Mt));se[dt]={url:Mt,fileName:`Postojeci ${fs(dt)}${Xe}`,ext:Xe}};Ce("word",q.wordUrl),Ce("pdf",q.pdfUrl),Ce("ppt",q.pptUrl),Ce("excel",q.excelUrl);const je={id:`doc-existing-${v}-${M}`,labelBase:xe(F)||F.trim(),formats:se};return je.labelBase.trim()||(je.labelBase=$e(je,M)),Pe(je)?je:null}function va(v){return new Promise((M,F)=>{const q=new FileReader;q.onload=()=>{M(typeof q.result=="string"?q.result:"")},q.onerror=()=>{F(new Error("Neuspjelo uÄitavanje datoteke."))}
201,q.readAsDataURL(v)})}function St(v){return v?Array.from(v.types||[]).includes("Files"):!1}function Vl(v){if(String(v.type||"").toLowerCase().startsWith("image/"))return!0;const F=String(v.name||"").toLowerCase();return[".png",".jpg",".jpeg",".gif",".webp",".bmp",".svg",".avif"].some(q=>F.endsWith(q))}async function fi(v){if(u||(Wn(!1),!Array.isArray(v)||v.length===0))return;const M=v.filter(F=>Vl(F));if(M.length===0){Te("Podrzane su samo slikovne datoteke.");return}try{const F=M[0],q=await va(F);P(q),Y(F.name),v.length>1?Te("UÄitana je prva slika iz odabira."):Te("")}catch{Te("Neuspjelo uÄitavanje slike. PokuÅ¡aj ponovno.")}}async function Kl(v){if(u)return;nn(!1);const M=Array.isArray(v)?v:[];if(M.length===0)return;const F=[...M].reverse(),q=[];let se=!1,Ce=0,je=0,dt=0;ae(!0);try{for(let Mt=0;Mt<F.length;Mt+=1){const Xe=F[Mt],Nt=xa(Xe);if(!Nt){se=!0;continue}if(Xe.size>Jd){Ce+=1;continue}if(dt+Xe.size>Zd){je+=1;continue}const Yr=await va(Xe),xs=qr(Xe.name);q.push({kind:Nt,url:Yr,fileName:Xe.name,labelBase:xs.base,ext:W(Nt,xs.ext)}),dt+=Xe.size}q.length>0&&V(Mt=>Gn(Mt,q));const ht=[];se&&ht.push("Podrzane su samo DOC/DOCX, PDF, PPT/PPTX, XLS/XLSX datoteke."),Ce>0&&ht.push(`Preskoceno zbog velicine (${Ce}). Max po datoteci: ${Vt(Jd)}.`),je>0&&ht.push(`Dosegnut limit odabira (${Vt(Zd)}). Preskoceno: ${je}.`),ht.length>0?Te(ht.join(" ")):Te("")}catch{Te("Neuspjelo uÄitavanje dokumenta. PokuÅ¡aj ponovno.")}finally{ae(!1)}}function Oi(){Je==null||Je.commands.focus()}function Jr(v=Je){if(!v){Ne(!1),We(!1),at(!1),vt(!1),T(!1);return}Ne(v.isActive("bold")),We(v.isActive("italic")),at(v.isActive("underline")),vt(v.isActive("bulletList")),T(v.isActive("orderedList"))}function pi(v){const M=v.state.selection;if(!M.empty){const q={from:M.from,to:M.to};return g.current=q,q}const F=g.current;return!F||F.from>=F.to?null:F}function mi(v,M="Naredba nije uspjela."){if(!(u||!Je)){if(!v(Je)){Te(M);return}Te(""),Jr(Je)}}function Wl(v){if(!(u||!Je)){if(v==="bold"){mi(M=>M.chain().focus().toggleBold().run(),"Podebljavanje nije uspjelo.");return}if(v==="italic"){mi(M=>M.chain().focus().toggleItalic().run(),"Kurziv nije uspio.");return}if(v==="underline"){mi(M=>M.chain().focus().toggleUnderline().run(),"Podcrtavanje nije uspjelo.");return}}}function Gl(){mi(v=>v.chain().focus().toggleBulletList().run(),"Popis s toÄkama nije moguÄe postaviti.")}function Hm(){mi(v=>v.chain().focus().toggleOrderedList().run(),"Numerirani popis nije moguÄe postaviti.")}function Vm(){mi(v=>v.chain().focus().undo().run(),"Nema viÅ¡e koraka za poniÅ¡tavanje.")}function ar(){mi(v=>v.chain().focus().redo().run(),"Nema viÅ¡e koraka za vraÄanje.")}function ps(){if(u||!Je)return;const v=pi(Je);if(!(v?Je.chain().focus().setTextSelection(v).unsetLink().run():Je.chain().focus().extendMarkRange("link").unsetLink().run())){Te("Nema poveznice za uklanjanje na trenutnoj poziciji.");return}const F=Je.getHTML();Oe(F),So(F),Te(""),$(""),ie(""),be(""),le(null),_(""),Jr(Je)}function hi(v){let M=v.trim().replace(/\\/g,"/").replace(_4,"/");if(!M)return"";const F=M.toLowerCase();if(F.startsWith("javascript:")||F.startsWith("data:")||F.startsWith("vbscript:"))return"";if(Oj.test(M))return M.startsWith("/")?M:`/${M}`;if(!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(M))M=`https://${M}`;else if(!/^https?:\/\//i.test(M))return"";return M}function _i(v){return Vl(v)||xa(v)!==null}async function qn(v){if(u||He)return;Nn(!1);const M=Array.isArray(v)?v:[];if(M.length===0)return;const F=M.filter(q=>_i(q));if(F.length===0){Te("Za link su podrzani samo slika ili dokument (DOC/DOCX, PDF, PPT/PPTX, XLS/XLSX).");return}await gi(F[0])}async function gi(v){var M;if(!(!v||u||He)){if(Nn(!1),!_i(v)){Te("Za link su podrzani samo slika ili dokument (DOC/DOCX, PDF, PPT/PPTX, XLS/XLSX).");return}ot(!0);try{const F=await va(v),q=Bl(v)||v.name,se=await Gp({putanja_ili_url:F,naziv_datoteke:q,mime_tip:v.type||void 0,velicina_bajtova:Number(v.size||0)||void 0}),Ce=String((se==null?void 0:se.putanja_ili_url)||"").trim(),je=Number((se==null?void 0:se.medij_id)||0);if(!Ce){Te("Datoteka je uÄitana, ali putanja za link nije vraÄena.");return}$(Ce),ie(q),be(q),le(je>0?je:null),Te(""),(M=y.current)==null||M.focus()}catch{Te("Neuspjelo uÄitavanje datoteke za link. PokuÅ¡aj ponovno.")}finally{ot(!1)}}}function ms(v){return v.length>0?v[0]:""}function ed(v){return v.length>0?v[v.length-1]:""}function wo(v){return v?/[0-9A-Za-z\u00C0-\u024F\u1E00-\u1EFF]/.test(v):!1}function So(v){const M=typeof v=="string"?v:Li(),F=jo(M);if(!F){de([]);return}const q=document.createElement("div");q.innerHTML=F;const se=Array.from(q.querySelectorAll("a[href]")).map((Ce,je)=>({id:`editor-link-${je}`,text:(Ce.textContent||"").trim()||"(bez teksta)",href:Ce.getAttribute("href")||""}));de(se)}function Km(v){var xs,Jn;const M=Number(v.replace("editor-link-",""));if(!Number.isFinite(M)||M<0)return;const F=document.createElement("div");F.innerHTML=Li();const se=Array.from(F.querySelectorAll("a[href]"))[M];if(!se||!se.parentNode)return;const Ce=se.parentNode,je=((xs=se.previousSibling)==null?void 0:xs.textContent)||"",dt=((Jn=se.nextSibling)==null?void 0:Jn.textContent)||"",ht=se.textContent||"",Mt=wo(ed(je))&&wo(ms(ht)),Xe=wo(ed(ht))&&wo(ms(dt)),Nt=document.createElement("span");for(Nt.setAttribute("data-autolink","off"),Mt&&Ce.insertBefore(document.createTextNode(" "),se);se.firstChild;
201)Nt.appendChild(se.firstChild);Nt.childNodes.length>0&&Ce.insertBefore(Nt,se),Xe&&Ce.insertBefore(document.createTextNode(" "),se),Ce.removeChild(se),Ce.normalize();const Yr=F.innerHTML;Oe(Yr),Je&&Je.commands.setContent(Yr||"<p></p>",{emitUpdate:!1}),So(Yr),Te(""),Oi()}function Wm(v,M){u||rn({kind:"remove-link-pair",linkId:v,linkText:M.trim()||"odabrani tekst"})}function Gm(){if(u||He||!Je)return;const v=hi(U);if(!v){Te("Unesi URL ili ucitaj sliku/dokument prije povezivanja teksta.");return}const M=pi(Je);if(!M){Te("Oznaci dio teksta koji zelis povezati.");return}if(!Je.chain().focus().setTextSelection(M).setLink({href:v}).run()){Te("Povezivanje teksta nije uspjelo.");return}Te(""),$(""),_("");const q=Je.getHTML();Oe(q),So(q),Jr(Je)}function td(v){const M=String(v||"");Oe(M),Je&&(Je.commands.setContent(M||"<p></p>",{emitUpdate:!1}),Jr(Je)),So(M),g.current=null,_(""),$(""),be(""),le(null)}h.useEffect(()=>{if(!Je)return;const v=String(De||""),M=Je.getHTML();jo(M)!==jo(v)&&(Je.commands.setContent(v||"<p></p>",{emitUpdate:!1}),So(v),Jr(Je))},[De,Je]);function Li(){return Je?Je.getHTML():De||""}const No=C==="article"?!us&&!!E.trim():C==="section"||C==="accent"?!!E.trim():C==="publishedDate"?!ds&&(Se||!!ke.trim()):C==="paragraph"?qd(Li(),"draft").length>0:C==="image"?!!H.trim():C==="document"?!te&&sn().length>0:!!E.trim(),nd=t.length>0;function rd(v){var M;return v.type==="heading"?v.level==="article"?`Naslov Älanka: ${v.text}`:v.accent?`Podnaslov: ${v.text}`:`Naslov sekcije: ${v.text}`:v.type==="paragraph"?"Odlomak":v.type==="list"?`${v.ordered?"Numerirani popis":"Popis"} (${v.items.length})`:v.type==="image"?`Slika (${v.alt})`:v.type==="publishedDate"?`Datum objave: ${v.useToday?"danaÅ¡nji datum":v.date||"nije postavljen"}`:v.type==="documents"?`Dokument: ${((M=v.items[0])==null?void 0:M.label)||"bez naziva"}`:"Element"}function Er(v){var M;if(v.type==="heading")return v.text;if(v.type==="paragraph")return typeof v.text=="string"?v.text:v.text.map(F=>typeof F=="string"?F:F.text).join(" ").trim();if(v.type==="list"){if(v.items.length===0)return"Prazan popis";const F=v.items[0];return(typeof F=="string"?F:F.map(se=>typeof se=="string"?se:se.text).join(" ")).trim()}return v.type==="image"?v.alt||"Slika bez opisa":v.type==="publishedDate"?v.useToday?"DanaÅ¡nji datum":v.date||"Datum nije postavljen":((M=v.items[0])==null?void 0:M.label)||"Dokument bez naziva"}function hs(v){return v.type==="heading"?v.level==="article"?"article":v.accent?"accent":"section":v.type==="paragraph"||v.type==="list"?"paragraph":v.type==="image"?"image":v.type==="publishedDate"?"publishedDate":"document"}function ql(v){const M=hs(v);return M==="article"?"NAS":M==="section"?"SEK":M==="accent"?"POD":M==="paragraph"?"TXT":M==="image"?"IMG":M==="publishedDate"?"DAT":"DOC"}function ya(v){if(G==="preview"){X(v.id);return}lr(v)}function Jl(v){const M=t.find(F=>F.id===v.id);if(!M){re("edit"),window.setTimeout(()=>{var F;(F=d.current)==null||F.scrollIntoView({behavior:"smooth",block:"start"})},60);return}lr(M),window.setTimeout(()=>{var F;(F=d.current)==null||F.scrollIntoView({behavior:"smooth",block:"start"})},60)}function id(){if(!u){if(G==="preview"&&K){const v=t.find(M=>M.id===K);if(v){lr(v);return}}re("edit")}}function sd(v){window.setTimeout(()=>{var M,F;v==="article"||v==="section"||v==="accent"?(M=f.current)==null||M.focus():v==="publishedDate"?(F=p.current)==null||F.focus():v==="paragraph"&&(Je==null||Je.commands.focus("end"))},0)}function ka(){return Qd(Ql())!==Qd(t)}function qm(v){if(!u){if(ka()){rn({kind:"discard-active-draft",nextKind:v});return}Fe(v),ja(v),re("edit"),sd(v)}}function ja(v){if(!u){if(v==="article"&&us){Te("Ova objava vec ima glavni naslov. Uredi postojeci naslov.");return}if(v==="publishedDate"&&ds){Te("Ovaj Älanak vec ima datum objave. Uredi postojeci datum.");return}w(v),I(null),X(null),Te(""),_(""),de([]),$(""),ie(""),be(""),le(null),Qe(null),wr(null),tn(null),Nn(!1),Wn(!1),nn(!1),Sr(!1),(v==="article"||v==="section"||v==="accent")&&D(""),v==="publishedDate"&&(ge(""),me(!1)),v==="paragraph"&&(Oe(""),g.current=null),v==="image"&&(P(""),Y(""),O("")),v==="document"&&(V([]),ae(!1))}}function lr(v){var M;if(!u){if(I(v.id),X(v.id),re("edit"),Te(""),_(""),de([]),ie(""),be(""),le(null),Qe(null),wr(null),tn(null),Nn(!1),Wn(!1),nn(!1),v.type==="heading"){v.level==="article"?w("article"):v.accent?w("accent"):w("section"),D(v.text);return}if(v.type==="paragraph"){w("paragraph"),setTimeout(()=>td(`<div>${YC(v.text)}</div>`),0);return}if(v.type==="list"){w("paragraph"),setTimeout(()=>td(F4(v.items,!!v.ordered)),0);return}if(v.type==="publishedDate"){w("publishedDate"),ge(v.date||""),me(!!v.useToday);return}if(v.type==="image"){w("image"),P(v.src),Y(((M=v.fileName)==null?void 0:M.trim())||R(v.src)||"PostojeÄa slika"),O(v.alt);return}if(v.type==="documents"){w("document");const F=v.items.map((q,se)=>Um(v.id,se,q.label||"",{wordUrl:q.wordUrl,pdfUrl:q.pdfUrl,pptUrl:q.pptUrl,excelUrl:q.excelUrl})).filter(q=>q!==null);V(F),ae(!1)}}}function Zl(){u||(I(null),Te(""),_(""),D(""),ge(""),me(!1),Oe(""),g.current=null,$(""),ie(""),be(""),le(null),de([]),P(""),Y(""),O(""),
201V([]),ae(!1),Qe(null),wr(null),tn(null),Nn(!1),Wn(!1),nn(!1))}function gs(v){u||(e(t.filter(M=>M.id!==v)),S===v&&Zl(),K===v&&X(null))}function bi(v){var F,q,se;if(u)return;if(!S){e([...t,...v]),X(((F=v[0])==null?void 0:F.id)??null);return}const M=t.findIndex(Ce=>Ce.id===S);if(M===-1){e([...t,...v]),I(null),X(((q=v[0])==null?void 0:q.id)??null);return}e([...t.slice(0,M),...v,...t.slice(M+1)]),I(null),X(((se=v[0])==null?void 0:se.id)??null)}function od(v,M){if(u)return;const F=t.findIndex(je=>je.id===v);if(F<0)return;const q=[...t],[se]=q.splice(F,1);if(!M){q.push(se),e(q);return}let Ce=q.findIndex(je=>je.id===M);if(Ce<0){q.push(se),e(q);return}q.splice(Ce,0,se),e(q)}function Yl(v){u||rn({kind:"remove-single",blockId:v})}function Jm(){var v,M;u||t.length!==0&&(e(t.slice(0,-1)),S===((v=t[t.length-1])==null?void 0:v.id)&&Zl(),K===((M=t[t.length-1])==null?void 0:M.id)&&X(null))}function Zm(){u||t.length!==0&&rn({kind:"remove-last"})}function Ym(){u||t.length!==0&&(e([]),I(null),X(null),Te(""))}function Qm(){u||t.length!==0&&rn({kind:"reset-draft"})}function Xm(){if(u||!Jt)return;const v=Jt;switch(rn(null),v.kind){case"remove-single":gs(v.blockId);return;case"remove-last":Jm();return;case"reset-draft":Ym();return;case"discard-active-draft":Fe(v.nextKind),ja(v.nextKind),re("edit"),sd(v.nextKind);return;case"remove-link-pair":Km(v.linkId);return;case"remove-document-item":Qu(v.itemId);return;case"remove-document-format":Di(v.itemId,v.docKind);return;default:return}}function ad(){if(u||!No)return;const v=`admin-${Date.now()}`;if(C==="article"){if(us){Te("Ova objava vec ima glavni naslov. Uredi postojeci naslov.");return}if(!E.trim())return;bi([{id:S||v,type:"heading",level:"article",text:E.trim()}]),D("");return}if(C==="section"){if(!E.trim())return;bi([{id:S||v,type:"heading",text:E.trim()}]),D("");return}if(C==="accent"){if(!E.trim())return;bi([{id:S||v,type:"heading",accent:!0,text:E.trim()}]),D("");return}if(C==="publishedDate"){if(ds){Te("Ovaj Älanak vec ima datum objave. Uredi postojeci datum.");return}if(!Se&&!ke.trim()){Te("Unesi datum ili oznaci prikaz danasnjeg datuma.");return}bi([{id:S||v,type:"publishedDate",date:Se?void 0:ke,useToday:Se||void 0}]),ge(""),me(!1),Te("");return}if(C==="paragraph"){const se=Li(),Ce=qd(se,v);if(Ce.length===0){Te("Unesi tekst prije dodavanja.");return}const je=Ce.map((dt,ht)=>({...dt,id:ht===0&&S?S:dt.id}));bi(je),Oe(""),$(""),de([]),g.current=null,Te("");return}if(C==="image"){if(!H.trim())return;const se=z.trim();bi([{id:S||v,type:"image",src:H.trim(),alt:Q.trim()||"Slika clanka",fileName:se||void 0}]),P(""),Y(""),O(""),Wn(!1);return}const M=Hl(),F=Nr(M.items);if(F.length===0){Te("Odaberi barem jedan dokument prije dodavanja.");return}const q=Cr(F);if(q>Yd){Te(`Dokumenti su preveliki za jedan element (trenutno ~${Vt(q)}, limit ~${Vt(Yd)}).`);return}bi([{id:S||v,type:"documents",items:F}]),V([]),nn(!1)}function Ql(){const v="live-preview";let M=[];if(C==="article")E.trim()&&(M=[{id:S||`${v}-article`,type:"heading",level:"article",text:E.trim()}]);else if(C==="section")E.trim()&&(M=[{id:S||`${v}-section`,type:"heading",text:E.trim()}]);else if(C==="accent")E.trim()&&(M=[{id:S||`${v}-accent`,type:"heading",accent:!0,text:E.trim()}]);else if(C==="publishedDate")(Se||ke.trim())&&(M=[{id:S||`${v}-date`,type:"publishedDate",date:Se?void 0:ke,useToday:Se||void 0}]);else if(C==="paragraph"){const q=Li();M=qd(q,`${v}-paragraph`).map((Ce,je)=>({...Ce,id:je===0&&S?S:`${v}-paragraph-${je}`}))}else if(C==="image")H.trim()&&(M=[{id:S||`${v}-image`,type:"image",src:H.trim(),alt:Q.trim()||"Slika clanka"}]);else{const q=sn();q.length>0&&(M=[{id:S||`${v}-document`,type:"documents",items:q}])}if(M.length===0)return t;if(!S)return[...t,...M];const F=t.findIndex(q=>q.id===S);return F===-1?[...t,...M]:[...t.slice(0,F),...M,...t.slice(F+1)]}function eh(){return C==="article"||C==="section"||C==="accent"?!!E.trim():C==="publishedDate"?Se||!!ke.trim():C==="paragraph"?qd(Li(),"draft").length>0:C==="image"?!!H.trim():sn().length>0}function ld(v){if(!a)return{};if(Pi==="auto")return{cardImageSrc:null};const M=String(cs||"").trim();if(!M)return Te("Odaberi sliku za karticu ili ukljuci automatski odabir prve slike."),null;const F=Lj(v),q=Ra(M)||M,se=F.find(Ce=>(Ra(Ce.src)||Ce.src)===q);return se?{cardImageSrc:se.src}:(Te("Odabrana slika za karticu viÅ¡e nije meÄu slikama Älanka."),null)}function th(){if(u)return;if(te){Te("PriÄekaj da se dokumenti uÄitaju prije spremanja.");return}if(No){if(C==="document"){const q=Hl(),se=Nr(q.items),Ce=Cr(se);if(Ce>Yd){Te(`Dokumenti su preveliki za jedan element (trenutno ~${Vt(Ce)}, limit ~${Vt(Yd)}).`);return}}const M=Ql(),F=ld(M);if(F===null)return;n(M,F);return}if(eh()&&!No){Te("Aktivni element nije spreman. Dovrsi ga ili ga obrisi prije spremanja.");return}const v=ld(t);v!==null&&n(t,v)}const cd=K?t.find(v=>v.id===K)??null:null,Co=Ql(),ud=Lj(Co),Xl=Ra(cs)||cs,Ri=ud.find(v=>{const M=Ra(v.src)||v.src;return!!Xl&&M===Xl}),wa=!!Ri,$i=String(H||"").trim(),dd=Ra($i)||$i,ec=!!(Pi==="manual"&&dd&&Xl===dd),nh=ud[0]??null,fd=Pi==="manual"&&Ri?Ri:nh,Ty=Pi==="manual"&&Ri?"RuÄno odabrana":"Automatski (prva slika)",Zr=Qd(Co)!==Qd(t),bs=s,tc=S??K,rh=R4(C),ih="Unesi odlomak...",sh="URL za oznaÄeni tekst (https://...)",oh=!$4(Li()),ah=a&&C==="image";h.useEffect(()=>{if(!a){or("auto"),di("");return}const v=String(l||"").trim();if(v){or("manual"),di(v);return}or("auto"),di("")},[a,l]);const Bi=(v=!1)=>`admin-btn h-8 rounded-md border px-2.5 text-[11px] font-semibold text-[#2f5f3e] transition ${v?"border-[#3f7a4f] bg-[#edf6f1]":"border-[#c7d9cf] bg-white hover:border-[#97b7a6
201] hover:bg-[#edf6f1]"} disabled:cursor-not-allowed disabled:opacity-45`,nc=C==="article"?{title:"Naslov Älanka",items:["Glavni naslov objave. U Älanku može biti samo jedan.","Unesi naslov i klikni Dodaj/Spremi element."]}:C==="section"?{title:"Naslov sekcije",items:["Koristi se za razdvajanje sadržaja po cjelinama.","MožeÅ¡ ih imati viÅ¡e i ureÄivati redoslijed."]}:C==="accent"?{title:"Podnaslov",items:["KraÄi istaknuti naslov unutar sadržaja.","Koristi ga za uvod ili naglasak prije odlomka."]}:C==="publishedDate"?{title:"Datum objave",items:["MožeÅ¡ unijeti konkretan datum ili ukljuÄiti danaÅ¡nji datum.","U Älanku može biti samo jedan blok datuma."]}:C==="paragraph"?{title:"Odlomak i linkovi",items:["Ovdje ureÄujeÅ¡ tekst i liste (B/I/U, unordered i ordered).","Za link: 1) oznaÄi tekst, 2) unesi URL ili uÄitaj/povuci sliku ili dokument, 3) klikni Povezi oznaÄeni tekst.","Kod uÄitavanja datoteka se sprema u bazu medija i link se automatski popuni.","Prije uÄitavanja možeÅ¡ upisati prilagoÄeni naziv datoteke za link.","Linkovi se na webu otvaraju u novom tabu."]}:C==="image"?{title:"Slika",items:["Sliku možeÅ¡ odabrati ili povuÄi u zonu za upload.","Naziv datoteke je interni opis, a alt je tekst pristupaÄnosti."]}:{title:"Dokumenti",items:["Dokumente možeÅ¡ dodati klikom ili drag-and-drop.","Podržani su DOC/DOCX, PDF, PPT/PPTX i XLS/XLSX.","Isti naziv + razliÄit format grupira se u isti red.",`Limit je ${Vt(Jd)} po datoteci i ${Vt(Zd)} po odabiru.`]},Sa=(()=>{if(!Jt)return{title:"Potvrda brisanja",description:"Potvrdi brisanje odabrane stavke.",confirmLabel:"Potvrdi"};switch(Jt.kind){case"remove-single":return{title:"Obrisati odabrani element?",description:"Element Äe biti trajno uklonjen iz trenutnog nacrta.",confirmLabel:"ObriÅ¡i element"};case"remove-last":return{title:"Obrisati zadnji element iz nacrta?",description:"Uklonit ÄeÅ¡ posljednji dodani element iz nacrta.",confirmLabel:"ObriÅ¡i zadnji"};case"reset-draft":return{title:"Resetirati nacrt?",description:"Svi elementi iz trenutnog nacrta bit Äe obrisani.",confirmLabel:"Resetiraj nacrt"};case"discard-active-draft":return{title:"Odbaciti aktivni unos?",description:"Uneseni podaci aktivnog elementa nisu spremljeni u nacrt i bit Äe izgubljeni.",confirmLabel:"Odbaci unos"};case"remove-link-pair":return{title:"Ukloniti link s odabranog teksta?",description:`Link Äe biti uklonjen, a tekst "${Jt.linkText}" ostaje.`,confirmLabel:"Ukloni link"};case"remove-document-item":return{title:"Obrisati dokument?",description:`Dokument "${Jt.label}" i svi njegovi formati bit Äe uklonjeni.`,confirmLabel:"ObriÅ¡i dokument"};case"remove-document-format":return{title:"Obrisati format dokumenta?",description:`Format ${fs(Jt.docKind)} za dokument "${Jt.label}" bit Äe uklonjen.`,confirmLabel:"ObriÅ¡i format"};default:return{title:"Potvrda brisanja",description:"Potvrdi brisanje odabrane stavke.",confirmLabel:"Potvrdi"}}})();h.useEffect(()=>{o==null||o(Zr)},[Zr,o]),h.useEffect(()=>()=>{var v;(v=N.current)==null||v.stop()},[]);function rc(v){var M;(M=N.current)==null||M.update(v.clientY,v.currentTarget)}function ic(){var v;wn(null),Ye(null),_t(null),k.current="",(v=N.current)==null||v.stop()}function sc(){var v;Qe(null),wr(null),tn(null),(v=N.current)==null||v.stop()}return c.jsxs(c.Fragment,{children:[c.jsxs("section",{className:"admin-surface mx-auto w-full max-w-[1220px] rounded-xl p-2 sm:p-3 md:p-4",onDragOver:v=>{!jn&&!it||v.isDefaultPrevented()||rc(v)},children:[c.jsxs("div",{className:`grid gap-3 ${pe?"xl:grid-cols-[320px_minmax(0,1fr)]":""}`,children:[pe&&c.jsxs("aside",{className:"admin-card rounded-xl p-2.5",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[c.jsxs("p",{className:"m-0 flex items-center gap-2 text-sm font-semibold text-[#2f5f3e]",children:[c.jsx("span",{className:"admin-chip",children:"Elementi"}),c.jsx("span",{children:t.length})]}),c.jsx("p",{className:"m-0 text-[11px] text-[#5a7a68]",children:"Povuci i pusti za redoslijed"})]}),c.jsxs("div",{className:"max-h-[34vh] space-y-1.5 overflow-y-auto pr-1 sm:max-h-[46vh] lg:max-h-[52vh]",children:[t.length===0&&
201c.jsx("div",{className:"rounded-lg border border-dashed border-[#c9ddd2] bg-white/70 px-3 py-4 text-center text-sm text-[#5a7a68]",children:"Nema elemenata. Dodaj prvi blok."}),t.map((v,M)=>c.jsx("div",{draggable:!u,onDragStart:F=>{if(u){F.preventDefault();return}F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",v.id),wn(v.id),Ye(v.id),_t("before"),k.current=""},onDragEnd:ic,onDragOver:F=>{F.preventDefault(),F.dataTransfer.dropEffect="move",rc(F);const q=F.dataTransfer.getData("text/plain")||jn;if(!q||q===v.id)return;const se=F.currentTarget.getBoundingClientRect(),Ce=F.clientY>se.top+se.height/2,je=t.findIndex(Xe=>Xe.id===v.id);if(je<0)return;const dt=t[je+1],ht=Ce?(dt==null?void 0:dt.id)??null:v.id;if(ht===q)return;const Mt=`${q}->${ht??"__end__"}`;k.current!==Mt&&(k.current=Mt,Ye(v.id),_t(Ce?"after":"before"),od(q,ht))},onDrop:F=>{F.preventDefault(),ic()},className:`group rounded-lg border bg-white px-2 py-2 transition ${K===v.id?"border-[#4f8a63] shadow-[0_0_0_2px_rgba(79,138,99,0.18)]":"border-[#d5e3dc]"} ${Sn===v.id?`ring-2 ring-[#4f8a63]/20 ${Ht==="after"?"shadow-[inset_0_-2px_0_0_rgba(79,138,99,0.65)]":"shadow-[inset_0_2px_0_0_rgba(79,138,99,0.65)]"}`:""} ${jn===v.id?"opacity-55":""}`,children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>ya(v),className:"min-w-0 flex-1 text-left",children:[c.jsxs("span",{className:"mb-1 inline-flex items-center gap-1",children:[c.jsx("span",{className:"admin-chip",children:ql(v)}),c.jsxs("span",{className:"text-[11px] text-[#638171]",children:["#",M+1]})]}),c.jsx("span",{className:"block truncate text-xs font-semibold text-[#2f5f3e]",children:rd(v)}),c.jsx("span",{className:"block truncate text-[11px] text-[#628070]",children:Er(v)||"..."})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1 opacity-100 transition md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100",children:[c.jsx("button",{type:"button",className:"admin-btn h-7 w-7 border-[#d3e2db] bg-white text-[11px] font-bold text-[#4f6e5e] disabled:cursor-not-allowed disabled:opacity-45",title:"Uredi element",onClick:()=>lr(v),"aria-label":`Uredi element ${M+1}`,disabled:u,children:"â"}),c.jsx("button",{type:"button",className:"admin-btn h-7 w-7 border-[#e2b8b8] bg-white text-[11px] font-bold text-[#a32a2a] disabled:cursor-not-allowed disabled:opacity-45",title:"ObriÅ¡i element",onClick:()=>Yl(v.id),"aria-label":`ObriÅ¡i element ${M+1}`,disabled:u,children:"ð"}),c.jsx("span",{className:"inline-flex h-7 w-7 cursor-move items-center justify-center rounded-md border border-[#d3e2db] bg-white text-[12px] font-bold text-[#4f6e5e]","aria-label":"Povuci za promjenu redoslijeda",role:"img",children:"â ¿"})]})]})},`sidebar-${v.id}`))]})]}),c.jsxs("div",{className:"min-w-0 flex flex-col gap-3",children:[c.jsxs("div",{className:"admin-card grid gap-2 rounded-xl px-3 py-2.5 lg:grid-cols-3 lg:items-center",children:[c.jsx("div",{className:"flex flex-wrap items-center gap-2 lg:justify-self-start",children:c.jsxs("div",{className:"inline-flex self-start rounded-lg border border-[#cadcd2] bg-white p-1",children:[c.jsx("button",{type:"button",onClick:id,className:`rounded-md px-3 py-1.5 text-xs font-semibold transition ${G==="edit"?"bg-[#2f5f3e] text-white":"text-[#2f5f3e] hover:bg-[#edf6f1]"} disabled:cursor-not-allowed disabled:opacity-45`,disabled:u,children:"UreÄivanje + pregled"}),c.jsx("button",{type:"button",onClick:()=>{u||re("preview")},className:`rounded-md px-3 py-1.5 text-xs font-semibold transition ${G==="preview"?"bg-[#2f5f3e] text-white":"text-[#2f5f3e] hover:bg-[#edf6f1]"} disabled:cursor-not-allowed disabled:opacity-45`,disabled:u,children:"Samo pregled"})]})}),c.jsxs("div",{className:"flex w-full items-center justify-center gap-2 lg:w-auto lg:justify-self-center",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase text-[#5a7a68]",children:"Dodaj element:"}),c.jsx("select",{value:Ve,onChange:v=>qm(v.target.value),className:"admin-input h-9 w-full rounded-md px-2.5 text-xs font-semibold text-[#2f5f3e] lg:w-[220px]","aria-label":"Odaberi tip elementa za dodavanje",disabled:u,children:L4.map(v=>{const M=v==="article"&&us||v==="publishedDate"&&ds;return c.jsx("option",{value:v,disabled:M||u,children:_j[v]},`quick-kind-${v}`)})})]})]}),cd&&c.jsxs("p",{className:"m-0 rounded-lg border border-[#d6e4dd] bg-white/80 px-3 py-1.5 text-xs font-semibold text-[#557163]",children:["Odabrano: ",rd(cd)]}),c.jsxs("div",{className:`grid gap-3 ${G==="edit"?"xl:grid-cols-2 xl:items-start":""}`,children:[G==="edit"&&c.jsxs("div",{ref:d,className:"admin-card rounded-xl p-3",children:[c.jsxs("div",{className:"mb-3 flex flex-wrap items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#5a7a68]",children:S?"UreÄujeÅ¡ element":"DodajeÅ¡ element"}),c.jsx("p",{className:"m-0 text-sm font-semibold text-[#2f5f3e]",children:`${S?"UreÄujeÅ¡":"DodajeÅ¡"}: ${_j[C]}`})]}),c.jsxs("div",{className:"group relative self-start",children:[c.jsx("button",{type:"button",onClick:()=>Gr(v=>!v),className:"admin-btn inline-flex h-9 w-9 items-center justify-center rounded-full border border-[#2f5f3e] bg-[#edf6f1] text-sm font-extrabold text-[#1f5b3a] transition hover:bg-[#dff0e7] disabled:cursor-not-allowed disabled:opacity-45","aria-label":"Prikaži informacije i upute za trenutni element","aria-expanded":Wr,disabled:u,children:"i"}),c.jsxs("div",{className:`absolute right-0 top-10 z-20 w-[min(92vw,430px)] rounded-lg border border-[#d3e2db] bg-white p-3 text-xs text-[#355b43] shadow-[0_12px_28px_rgba(28,67,46,0.12)] transition ${Wr?"visible opacity-100":"invisible opacity-0 group-hover:visible group-hover:opacity-100"}`,children:[c.jsx("p",{className:"m-0 mb-1 text-xs font-semibold uppercase text-[#4f6e5e]",children:nc.title}),c.jsx("ul",{className:"m-0 list-disc space-y-1 pl-4",children:nc.items.map((v,M)=>c.jsx("li",{children:v},`${nc.title}-${M}`))})]})]})]}),c.jsxs("div",{className:"space-y-2.5",children:[(C==="article"||C==="section"||C==="accent")&&c.jsx("input",{ref:f,value:E,onChange:v=>D(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),ad())},placeholder:rh,className:"admin-input h-10 w-full rounded-lg px-3 text-sm text-[#244e33]",disabled:u}),C==="publishedDate"&&c.jsxs("div",{className:"grid gap-2 md:grid-cols-[minmax(0,220px)_minmax(0,1fr)] md:items-center",children:[c.jsx("input",{ref:p,type:"date",value:ke,onChange:v=>ge(v.target.value),disabled:Se||u,className:"admin-input h-10 rounded-lg px-3 text-sm text-[#244e33] disabled:cursor-not-allowed disabled:bg-[#f1f5f3]"}),c.jsxs("label",{className:"inline-flex items-center gap-2 text-sm font-semibold text-[#2f5f3e]",children:[c.jsx("input",{type:"checkbox",checked:Se,onChange:v=>
201me(v.target.checked),className:"h-4 w-4 rounded border-[#9fb8ab] text-[#376d44] focus:ring-[#376d44]/30",disabled:u}),"Prikaži danaÅ¡nji datum"]}),!Se&&ke&&c.jsxs("p",{className:"text-xs font-semibold text-[#557163] md:col-span-2",children:["Pregled: ",Ul(ke)]})]}),C==="paragraph"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"admin-card grid gap-1.5 rounded-lg p-2.5",children:c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[c.jsx("button",{type:"button",onClick:Vm,className:Bi(!1),disabled:u||!(Je!=null&&Je.can().chain().focus().undo().run()),children:"Undo"}),c.jsx("button",{type:"button",onClick:ar,className:Bi(!1),disabled:u||!(Je!=null&&Je.can().chain().focus().redo().run()),children:"Redo"}),c.jsx("span",{className:"mx-0.5 h-5 w-px bg-[#c7d9cf]","aria-hidden":"true"}),c.jsx("button",{type:"button",onClick:()=>Wl("bold"),className:Bi(Ke),disabled:u,children:"B"}),c.jsx("button",{type:"button",onClick:()=>Wl("italic"),className:Bi(_e),disabled:u,children:"I"}),c.jsx("button",{type:"button",onClick:()=>Wl("underline"),className:Bi(tt),disabled:u,children:"U"}),c.jsx("span",{className:"mx-0.5 h-5 w-px bg-[#c7d9cf]","aria-hidden":"true"}),c.jsx("button",{type:"button",onClick:Gl,className:Bi(Ut),disabled:u,"aria-label":"Popis s toÄkama",title:"Popis s toÄkama",children:"⢠Popis"}),c.jsx("button",{type:"button",onClick:Hm,className:Bi(b),disabled:u,"aria-label":"Numerirani popis",title:"Numerirani popis",children:"1. Popis"})]})}),c.jsxs("div",{className:"relative",children:[c.jsx(UC,{editor:Je,onFocus:()=>{Ge&&Te("")},className:u?"cursor-not-allowed opacity-75":""}),oh&&c.jsx("span",{className:"pointer-events-none absolute left-3 top-2 text-sm text-[#7f9388]",children:ih})]}),c.jsxs("div",{className:"admin-card space-y-2.5 rounded-lg p-2.5",children:[c.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_auto]",children:[c.jsx("input",{ref:y,value:U,onChange:v=>{$(v.target.value),ie(""),be(""),le(null),Ge&&Te("")},placeholder:sh,className:"admin-input h-9 rounded-md px-3 text-sm text-[#244e33]",disabled:u||He}),c.jsx("button",{type:"button",onClick:()=>{var v;return(v=j.current)==null?void 0:v.click()},className:"admin-btn h-9 rounded-md border border-[#c7d9cf] bg-white px-3 text-xs font-semibold text-[#2f5f3e] transition hover:border-[#97b7a6] hover:bg-[#edf6f1] disabled:cursor-not-allowed disabled:opacity-45",disabled:u||He,children:He?"UÄitavam...":"UÄitaj sliku/dokument"}),c.jsx("input",{ref:j,type:"file",accept:"image/*,.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",className:"hidden",disabled:u||He,onChange:v=>{qn(Array.from(v.target.files||[])),v.currentTarget.value=""}})]}),c.jsx("div",{className:`admin-input flex min-h-[40px] items-center rounded-md border-dashed px-3 text-xs font-semibold text-[#557163] transition ${yo?"border-[#4f8a63] bg-[#edf6f1] shadow-[0_0_0_3px_rgba(79,138,99,0.16)]":""} ${u||He?"cursor-not-allowed opacity-60":""}`,onDragEnter:v=>{u||He||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),Nn(!0))},onDragOver:v=>{u||He||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),v.dataTransfer.dropEffect="copy",Nn(!0))},onDragLeave:v=>{if(u||He)return;const M=v.relatedTarget;M&&v.currentTarget.contains(M)||Nn(!1)},onDrop:v=>{u||He||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),Nn(!1),qn(Array.from(v.dataTransfer.files||[])))},children:He?"UÄitavam...":J?"Datoteka uÄitana. Povuci novu datoteku ovdje za zamjenu.":"Povuci sliku ili dokument ovdje"}),!!(U.trim()&&J.trim())&&c.jsxs("div",{className:"grid gap-1",children:[c.jsx("label",{className:"text-[11px] font-semibold uppercase text-[#557163]",children:"Naziv datoteke za link"}),c.jsx("input",{value:oe,onChange:v=>be(v.target.value),onBlur:()=>{ba()},onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),ba())},placeholder:"Unesi naziv (npr. dokument-komore.pdf)",className:"admin-input h-9 rounded-md px-3 text-sm text-[#244e33]",disabled:u||He}),c.jsx("p",{className:"m-0 text-[11px] text-[#6f877b]",children:"Ako je prazno, koristi se izvorni naziv uÄitane datoteke."})]}),c.jsxs("p",{className:"m-0 text-xs text-[#557163]",children:["OznaÄeno: ",c.jsx("span",{className:"font-semibold text-[#2f5f3e]",children:Me||"(niÅ¡ta nije oznaÄeno)"})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:Gm,className:"admin-btn h-9 rounded-md border-[#2e5f3d] bg-[linear-gradient(180deg,#3f7e4f,#2d5f3b)] px-3 text-xs font-semibold text-white transition hover:bg-[#2f5f3e] disabled:cursor-not-allowed disabled:opacity-45",disabled:u||He,children:"Poveži oznaÄeni tekst"}),c.jsx("button",{type:"button",onClick:ps,className:"admin-btn h-9 rounded-md border border-[#d6c0c0] bg-white px-3 text-xs font-semibold text-[#8
201c2f2f] transition hover:border-[#cb9c9c] hover:bg-[#fff1f1] disabled:cursor-not-allowed disabled:opacity-45",disabled:u||He,children:"Ukloni link iz odabira"})]}),ce.length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"text-xs font-semibold uppercase text-[#557163]",children:"Poveznice u tekstu"}),ce.map(v=>c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-[#e1ebe6] bg-white px-2 py-2",children:[c.jsxs("p",{className:"min-w-0 flex-1 text-xs text-[#2f5f3e]",children:[c.jsxs("span",{className:"font-semibold",children:['"',v.text,'"']}),c.jsx("span",{className:"mx-1 text-[#7a9184]",children:"->"}),c.jsx("span",{className:"break-all",children:v.href})]}),c.jsx("button",{type:"button",onClick:()=>Wm(v.id,v.text),className:"admin-btn rounded-md border border-[#c81e1e] bg-[linear-gradient(180deg,#cf2c2c,#b21b1b)] px-2 py-1 text-xs font-semibold text-white transition hover:border-[#e8a9a9] hover:bg-[#ffe8e8] hover:text-[#8b1e1e] disabled:cursor-not-allowed disabled:opacity-45",disabled:u,children:"Ukloni link"})]},v.id))]})]})]}),C==="image"&&c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("label",{className:`admin-input flex h-10 items-center rounded-lg px-3 text-sm text-[#244e33] transition hover:border-[#9bbca9] ${Vr?"border-[#4f8a63] bg-[#edf6f1] shadow-[0_0_0_3px_rgba(79,138,99,0.16)]":""} ${u?"cursor-not-allowed opacity-60":"cursor-pointer"}`,onDragEnter:v=>{u||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),Wn(!0))},onDragOver:v=>{u||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),v.dataTransfer.dropEffect="copy",Wn(!0))},onDragLeave:v=>{if(u)return;const M=v.relatedTarget;M&&v.currentTarget.contains(M)||Wn(!1)},onDrop:v=>{u||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),Wn(!1),fi(Array.from(v.dataTransfer.files||[])))},children:[c.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:u,onChange:v=>{var F;if(u)return;const M=(F=v.target.files)==null?void 0:F[0];fi(M?[M]:[]),v.currentTarget.value=""}}),"Odaberi sliku s racunala ili je povuci ovdje"]}),c.jsx("input",{value:z,onChange:v=>Y(v.target.value),placeholder:"Naziv odabrane slike",className:"admin-input h-10 rounded-lg px-3 text-sm text-[#244e33]",disabled:u}),c.jsx("input",{value:Q,onChange:v=>O(v.target.value),placeholder:"Unesi opis slike (alt tekst)",className:"admin-input h-10 rounded-lg px-3 text-sm text-[#244e33]",disabled:u}),ah&&c.jsxs("div",{className:"rounded-lg border border-[#d3e2db] bg-white px-3 py-2",children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#557163]",children:"Slika kartice"}),c.jsxs("div",{className:"mt-1 rounded-md border border-[#e1ebe6] bg-[#f7fbf9] px-2.5 py-2",children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold text-[#3d6f4b]",children:"Trenutno odabrana"}),fd?c.jsxs("div",{className:"mt-1.5 min-w-0 space-y-0.5",children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold text-[#2f5f3e]",children:Ty}),c.jsx("p",{className:"m-0 break-all text-[11px] text-[#5a7a68]",children:fd.label})]}):c.jsx("p",{className:"m-0 mt-1 text-[11px] text-[#5a7a68]",children:"U Älanku joÅ¡ nema slike za karticu."})]}),c.jsxs("div",{className:"mt-2 rounded-md border border-[#e1ebe6] bg-white px-2.5 py-2",children:[c.jsxs("label",{className:"inline-flex items-center gap-2 text-[11px] font-semibold text-[#2f5f3e]",children:[c.jsx("input",{type:"checkbox",checked:ec,onChange:v=>{if(v.target.checked){if(!$i){Te("Prvo odaberi sliku pa je oznaÄi kao glavnu za karticu.");return}or("manual"),di($i),Te("");return}ec&&(or("auto"),di(""))},disabled:u||!$i}),"Koristi ovu sliku kao glavnu na kartici"]}),$i?c.jsxs("p",{className:"m-0 mt-1 text-[11px] text-[#5a7a68]",children:["Trenutno ureÄujeÅ¡: ",String(z||Q||"").trim()||"Sliku bez naziva"]}):c.jsx("p",{className:"m-0 mt-1 text-[11px] text-[#5a7a68]",children:"Prvo odaberi sliku da bi je mogao oznaÄiti za karticu."})]}),Pi==="manual"&&!ec&&c.jsx("button",{type:"button",onClick:()=>{or("auto"),di("")},className:"admin-btn mt-2 h-8 border border-[#c7d9cf] bg-white px-2.5 text-[11px] font-semibold text-[#2f5f3e] transition hover:bg-[#edf6f1] disabled:cursor-not-allowed disabled:opacity-45",disabled:u,children:"Vrati automatski odabir (prva slika)"}),!wa&&cs&&c.jsx("p",{className:"m-0 mt-2 text-[11px] font-semibold text-[#8b1e1e]",children:"Trenutno odabrana slika za karticu viÅ¡e nije meÄu slikama Älanka."})]})]}),C==="document"&&c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("label",{className:`admin-input flex h-10 items-center rounded-lg px-3 text-sm text-[#244e33] transition hover:border-[#9bbca9] ${zi?"border-[#4f8a63] bg-[#edf6f1] shadow-[0_0_0_3px_rgba(79,138,99,0.16)]":""}
201 ${u?"cursor-not-allowed opacity-60":"cursor-pointer"}`,onDragEnter:v=>{u||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),nn(!0))},onDragOver:v=>{u||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),v.dataTransfer.dropEffect="copy",nn(!0))},onDragLeave:v=>{if(u)return;const M=v.relatedTarget;M&&v.currentTarget.contains(M)||nn(!1)},onDrop:v=>{u||St(v.dataTransfer)&&(v.preventDefault(),v.stopPropagation(),nn(!1),Kl(Array.from(v.dataTransfer.files||[])))},children:[c.jsx("input",{type:"file",multiple:!0,accept:".doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",className:"hidden",disabled:u,onChange:async v=>{if(u)return;const M=v.currentTarget,F=Array.from(M.files||[]);await Kl(F),M.value=""}}),"Dodaj dokumente ili ih povuci ovdje"]}),te&&c.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-[#406851]",children:[c.jsx("span",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-[#5f8d72] border-t-transparent"}),"UÄitavam dokumente..."]}),c.jsx("p",{className:"m-0 text-[11px] text-[#557163]",children:"Podržano: DOC/DOCX, PDF, PPT/PPTX i XLS/XLSX."}),c.jsx("button",{type:"button",onClick:()=>Sr(v=>!v),className:"w-fit rounded-md border border-[#c7d9cf] bg-white px-2.5 py-1.5 text-[11px] font-semibold text-[#2f5f3e] transition hover:bg-[#edf6f1] disabled:cursor-not-allowed disabled:opacity-45",disabled:u,children:Kr?"Sakrij detaljna pravila":"Prikaži detaljna pravila"}),Kr&&c.jsxs("div",{className:"space-y-1 text-[11px] text-[#557163]",children:[c.jsx("p",{className:"m-0",children:'Dokumenti se grupiraju po nazivu iz polja "Naziv dokumenta". Isti naziv + razliÄit format (npr. PDF + WORD) ide u isti red.'}),c.jsxs("p",{className:"m-0",children:["OgraniÄenja: max ",Vt(Jd)," po datoteci i ",Vt(Zd)," po odabiru."]}),c.jsx("p",{className:"m-0",children:"Povuci dokument gore/dolje za promjenu redoslijeda u bloku."})]}),c.jsxs("div",{className:"grid gap-2",children:[L.length===0&&c.jsx("p",{className:"m-0 rounded-lg border border-dashed border-[#c9ddd2] bg-white/75 px-3 py-2 text-xs text-[#5a7a68]",children:"Jos nema dodanih dokumenata."}),L.map((v,M)=>{const F=ct(v);return c.jsxs("div",{draggable:!u,onDragStart:q=>{if(u){q.preventDefault();return}if(q.target.closest("input,button,textarea,select,a")){q.preventDefault();return}q.dataTransfer.effectAllowed="move",q.dataTransfer.setData(jg,v.id),Qe(v.id),wr(null),tn(null)},onDragEnd:sc,onDragOver:q=>{const se=q.dataTransfer.getData(jg)||it;if(!se||(q.preventDefault(),q.dataTransfer.dropEffect="move",rc(q),se===v.id))return;const Ce=q.currentTarget.getBoundingClientRect(),je=q.clientY>Ce.top+Ce.height/2?"after":"before";wr(v.id),tn(je)},onDragLeave:q=>{const se=q.relatedTarget;se&&q.currentTarget.contains(se)||On===v.id&&(wr(null),tn(null))},onDrop:q=>{q.preventDefault();const se=q.dataTransfer.getData(jg)||it,Ce=q.currentTarget.getBoundingClientRect(),je=q.clientY>Ce.top+Ce.height/2?"after":"before";sc(),!(!se||se===v.id)&&Xu(se,v.id,je)}
201,className:`admin-card rounded-lg p-2 transition ${On===v.id?`border-[#4f8a63] ring-2 ring-[#4f8a63]/20 ${en==="after"?"shadow-[inset_0_-2px_0_0_rgba(79,138,99,0.65)]":"shadow-[inset_0_2px_0_0_rgba(79,138,99,0.65)]"}`:""} ${it===v.id?"cursor-grabbing opacity-75":"cursor-grab"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("div",{className:"min-w-0",children:c.jsxs("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#557163]",children:["Dokument #",M+1]})}),c.jsx("button",{type:"button",onClick:()=>Bm(v.id,v.labelBase||$e(v,M)),className:"admin-btn h-7 border-[#e2b8b8] bg-white px-2 text-[11px] font-semibold text-[#a32a2a] transition hover:border-[#d8a2a2] hover:bg-[#fff1f1] disabled:cursor-not-allowed disabled:opacity-45",disabled:u,children:"Ukloni dokument"})]}),On===v.id&&it&&it!==v.id&&c.jsxs("p",{className:"m-0 mt-1 text-[11px] font-semibold text-[#3f7e4f]",children:["Pusti ovdje za premjestanje dokumenta ",en==="after"?"ispod":"iznad","."]}),c.jsx("div",{className:"mt-1 flex items-center gap-1",children:c.jsx("input",{value:v.labelBase,onChange:q=>Fm(v.id,q.target.value),onBlur:()=>{Hl()},placeholder:"Unesi zajedniÄki naziv dokumenta",className:"admin-input h-8 min-w-0 flex-1 rounded-md px-2 text-xs text-[#244e33]",disabled:u})}),c.jsx("div",{className:"mt-2 grid gap-1.5",children:F.map(q=>{const se=v.formats[q];return se?c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-[#d3e2db] bg-white px-2 py-1.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("p",{className:"m-0 text-[11px] font-semibold text-[#2f5f3e]",children:[fs(q)," ",c.jsx("span",{className:"text-[#557163]",children:se.ext})]}),c.jsx("p",{className:"m-0 truncate text-[11px] text-[#6a8477]",children:se.fileName})]}),c.jsx("button",{type:"button",onClick:()=>$m(v.id,q,v.labelBase||$e(v,M)),className:"admin-btn h-7 border-[#ead0d0] bg-white px-2 text-[11px] font-semibold text-[#a32a2a] transition hover:border-[#e1b7b7] hover:bg-[#fff1f1] disabled:cursor-not-allowed disabled:opacity-45",disabled:u,children:"Ukloni format"})]},`${v.id}-${q}`):null})})]},v.id)})]})]})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap justify-end gap-2 border-t border-[#d9e7df] pt-3",children:[c.jsx("button",{type:"button",onClick:ad,disabled:!No||u,className:"admin-btn h-10 w-full border-[#2e5f3d] bg-[linear-gradient(180deg,#3f7e4f,#2d5f3b)] px-4 text-sm font-semibold text-white transition hover:bg-[#2f5f3e] disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto",children:S?"Spremi element u nacrt":"Dodaj element u nacrt"}),c.jsx("button",{type:"button",onClick:()=>{tc&&Yl(tc)},disabled:!tc||u,className:"admin-btn h-10 w-full border-[#e2b8b8] bg-white px-4 text-sm font-semibold text-[#a32a2a] transition hover:border-[#d8a2a2] hover:bg-[#fff1f1] disabled:cursor-not-allowed disabled:opacity-45 sm:w-auto",children:"ObriÅ¡i element"}),S&&c.jsx("button",{type:"button",onClick:Zl,className:"admin-btn h-10 w-full border-[#376d44] bg-white px-4 text-sm font-semibold text-[#2f5f3e] transition hover:bg-[#edf6f1] disabled:cursor-not-allowed disabled:opacity-45 sm:w-auto",disabled:u,children:"Odustani"})]})]}),(G==="preview"||G==="edit")&&c.jsxs("div",{ref:m,className:"admin-card rounded-xl p-3",children:[c.jsx("p",{className:"m-0 mb-2 text-xs font-semibold text-[#557163]",children:"Klikni element za ureÄivanje ili ga povuci gore/dolje za promjenu redoslijeda."}),Co.length===0?c.jsx("div",{className:"space-y-2 rounded-lg border border-dashed border-[#c9ddd2] bg-white/70 px-3 py-4 text-center text-sm text-[#5a7a68]",children:c.jsx("p",{className:"m-0",children:"Nema elemenata za pregled."})}):c.jsx(In,{blocks:Co,onBlockClick:v=>Jl(v),onBlockReorder:u?void 0:od,onBlockDelete:u?void 0:Yl,preserveBlockOrder:!0,selectedBlockId:K})]})]}),Ge&&c.jsx("p",{className:"rounded-md border border-[#f0c9c9] bg-[#fff4f4] px-3 py-2 text-sm font-semibold text-[#b42318]",children:Ge})]})]}),c.jsx("div",{className:"sticky bottom-0 z-20 mt-3 border-t border-[#cfddd6] bg-white/95 pt-2 backdrop-blur",children:c.jsxs("div",{className:"admin-card flex flex-col items-stretch gap-2 rounded-xl px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("span",{className:"admin-chip",children:[Co.length," elemenata"]}),Zr&&c.jsx("span",{className:"text-[11px] font-semibold text-[#557163]",children:"Aktivni element s promjenama bit Äe ukljuÄen u spremanje."}),t.length>0&&c.jsxs("span",{className:"text-[11px] font-semibold text-[#557163]",children:['Klikom na "',bs,'" spremaÅ¡ cijeli Älanak (i aktivni element, ako ima promjene).']}),c.jsxs("div",{ref:x,className:"relative",children:[c.jsx("button",{type:"button",onClick:()=>qe(v=>!v),className:"admin-btn h-10 border-[#c7d9cf] bg-white px-3 text-sm font-semibold text-[#2f5f3e] transition hover:bg-[#edf6f1] disabled:cursor-not-allowed disabled:opacity-45","aria-label":"Dodatne radnje ureÄivaÄa",disabled:u,children:"Dodatne radnje"}),et&&c.jsxs("div",{className:"absolute bottom-[calc(100%+8px)] right-0 z-20 w-[min(92vw,240px)] rounded-lg border border-[#d3e2db] bg-white p-1.5
201shadow-[0_10px_24px_rgba(18,45,32,0.16)] sm:left-0 sm:right-auto",children:[c.jsx("button",{type:"button",onClick:()=>{qe(!1),ue(v=>!v)},className:"w-full rounded-md px-2.5 py-2 text-left text-xs font-semibold text-[#2f5f3e] transition hover:bg-[#eef6f2] disabled:cursor-not-allowed disabled:opacity-45",disabled:u,children:pe?"Sakrij popis elemenata":"Prikaži popis elemenata"}),c.jsx("button",{type:"button",onClick:()=>{qe(!1),Zm()},disabled:!nd||u,className:"w-full rounded-md px-2.5 py-2 text-left text-xs font-semibold text-[#8b1e1e] transition hover:bg-[#fff1f1] disabled:cursor-not-allowed disabled:opacity-45",children:"ObriÅ¡i zadnji element"}),c.jsx("button",{type:"button",onClick:()=>{qe(!1),Qm()},disabled:!nd||u,className:"w-full rounded-md px-2.5 py-2 text-left text-xs font-semibold text-[#8b1e1e] transition hover:bg-[#fff1f1] disabled:cursor-not-allowed disabled:opacity-45",children:"Resetiraj nacrt (obriÅ¡i sve)"})]})]})]}),c.jsxs("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[r&&c.jsx("button",{type:"button",onClick:r,className:"admin-btn h-10 border-[#c7d9cf] bg-white px-4 text-sm font-semibold text-[#2f5f3e] transition hover:bg-[#edf6f1] disabled:cursor-not-allowed disabled:opacity-45",disabled:u,children:"Zatvori"}),c.jsx("button",{type:"button",onClick:th,disabled:t.length===0&&!No||u,className:"admin-btn h-10 w-full border-[#2e5f3d] bg-[linear-gradient(180deg,#3f7e4f,#2d5f3b)] px-5 text-sm font-semibold text-white transition hover:bg-[#2f5f3e] disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto",children:u?"Spremam...":bs})]})]})})]}),c.jsx(vr,{open:!!Jt,title:Sa.title,description:Sa.description,confirmLabel:Sa.confirmLabel,cancelLabel:"Odustani",onConfirm:Xm,onCancel:()=>rn(null)})]})}function H4(t,e){const n=t.blocks.find(i=>i.type==="heading"&&i.level==="article");if(n&&n.type==="heading")return n.text;const r=t.blocks.find(i=>i.type==="heading");return r&&r.type==="heading"?r.text:`Älanak #${e+1}`}function V4(t){const e=t.blocks.find(n=>n.type==="publishedDate");return!e||e.type!=="publishedDate"?"":e.useToday?"DanaÅ¡nji datum":e.date||""}function K4({articles:t,editingId:e,onEditArticle:n,onDeleteArticle:r,busy:i=!1}
201){const[s,o]=h.useState({});h.useEffect(()=>{e&&o(l=>({...l,[e]:!0}))},[e]);const a=e?t.findIndex(l=>l.id===e):null;return c.jsxs("div",{className:"space-y-4",children:[a!==null&&a>=0&&c.jsx("div",{className:"admin-card rounded-md px-3 py-2",children:c.jsxs("p",{className:"m-0 flex items-center gap-2 text-sm font-semibold text-[#2f5f3e]",children:[c.jsx("span",{className:"admin-chip",children:"UreÄivanje"}),c.jsxs("span",{children:["UreÄujeÅ¡ objavljeni Älanak #",a+1,'. Klikni "Pohrani promjene u Älanku" za spremanje izmjena.']})]})}),t.map((l,u)=>{const d=!!s[l.id],f=e===l.id,p=H4(l,u),m=V4(l);return c.jsxs("section",{className:"admin-card rounded-xl p-2.5 md:p-3",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>o(g=>({...g,[l.id]:!d})),className:"min-w-0 flex-1 rounded-md border border-[#d7e5de] bg-white/80 px-3 py-2 text-left transition hover:bg-[#f4faf7]","aria-label":`${d?"Sakrij":"Prikaži"} sadržaj Älanka ${u+1}`,children:[c.jsx("p",{className:"m-0 truncate text-sm font-semibold text-[#2f5f3e]",children:p}),c.jsxs("p",{className:"m-0 mt-1 text-[11px] font-semibold text-[#557163]",children:[m?`Datum: ${m}`:"Datum nije postavljen"," ⢠",l.blocks.length," elemenata"]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("button",{type:"button",onClick:()=>o(g=>({...g,[l.id]:!d})),className:"admin-btn rounded-md border border-[#d2e1da] bg-white px-3 py-1.5 text-xs font-semibold text-[#2f5f3e] transition hover:bg-[#edf6f1]",children:d?"Sakrij":"Prikaži"}),c.jsx("button",{type:"button",onClick:()=>n(l.id),className:"admin-btn rounded-md border border-[#111111] bg-[#111111] px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-white hover:text-[#111111] disabled:cursor-not-allowed disabled:opacity-45",disabled:i,children:f?"UreÄujeÅ¡...":"Uredi Älanak"}),c.jsx("button",{type:"button",onClick:()=>r(l.id),className:"admin-btn rounded-md border border-[#c81e1e] bg-[linear-gradient(180deg,#cf2c2c,#b21b1b)] px-3 py-1.5 text-xs font-semibold text-white transition hover:border-[#e8a9a9] hover:bg-[#ffe8e8] hover:text-[#8b1e1e] disabled:cursor-not-allowed disabled:opacity-45",disabled:i,children:"ObriÅ¡i Älanak"})]})]}),d&&c.jsx("div",{className:"mt-2 border-t border-[#edf3ef] pt-2",children:c.jsx(In,{blocks:l.blocks})})]},`admin-article-${l.id}`)})]})}function W4({articles:t,onArticlesChange:e,onCloseEditor:n,externalDraftBlocks:r=null,externalDraftRequestId:i=0,publishButtonLabel:s,onExternalDraftPublish:o,enableCardImageSelection:a=!1,initialCardImageSrc:l=null,onDirtyChange:u,onBusyChange:d}){const[f,p]=h.useState([]),[m,g]=h.useState("[]"),[y,j]=h.useState(null),[x,k]=h.useState(0),[N,C]=h.useState(""),[w,E]=h.useState(""),[D,L]=h.useState(null),[V,te]=h.useState(!1),[ae,ke]=h.useState(!1),ge=h.useRef(null),Se=!o&&f.length===0&&y===null&&!V;function me($){return JSON.parse(JSON.stringify($))}function H($){try{return JSON.stringify($)}catch{return String($.length)}}function P($){return $ instanceof Error&&$.message.trim()?$.message.trim():"Spremanje sadržaja nije uspjelo. PokuÅ¡aj ponovno."}h.useEffect(()=>{var J;if(!i||r===null)return;const $=me(r);p($),g(H($)),j(null),C(""),E(""),te(!1),k(ie=>ie+1),(J=ge.current)==null||J.scrollIntoView({behavior:"smooth",block:"start"})},[r,i]),h.useEffect(()=>{const $=H(f)!==m||V;u==null||u($)},[m,f,V,u]),h.useEffect(()=>{d==null||d(ae)},[ae,d]),h.useEffect(()=>{if(!w)return;const $=window.setTimeout(()=>{E("")},3500);return()=>{window.clearTimeout($)}},[w]),h.useEffect(()=>()=>{u==null||u(!1),d==null||d(!1)},[d,u]);async function z($,J){if(ae)return;const ie=Array.isArray($)?$:f;if(ie.length===0)return;C(""),E("");const oe=me(ie),be=y!==null;ke(!0);try{if(o){await o(oe,J),p([]),g("[]"),j(null),te(!1),E("Sadržaj je uspjeÅ¡no spremljen.");return}e(be?l3(t,y,oe):[...t,a3(oe,"admin")]),p([]),g("[]"),j(null),te(!1),C(""),E(be?"Promjene Älanka su uspjeÅ¡no spremljene.":"Älanak je uspjeÅ¡no spremljen.")}catch(Ee){E(""),C(P(Ee)),console.error("Objava sadržaja nije uspjela:",Ee)}finally{ke(!1)}}function Y($){var oe;if(ae)return;const J=t.find(be=>be.id===$),ie=me((J==null?void 0:J.blocks)??[]);p(ie),g(H(ie)),j($),C(""),E(""),te(!1),k(be=>be+1),(oe=ge.current)==null||oe.scrollIntoView({behavior:"smooth",block:"start"})}function Q($){ae||(C(""),e(kf(t,$)),j(J=>J===null?null:J===$?(p([]),g("[]"),te(!1),null):J))}function O($){ae||L($)}function U(){ae||D&&(Q(D),L(null))}return c.jsxs("div",{className:"space-y-5",children:[c.jsxs("div",{ref:ge,children:[N&&c.jsx("div",{className:"mb-3 rounded-lg border border-[#e2b8b8] bg-[#fff6f6] px-3 py-2 text-sm font-semibold text-[#8b1e1e]","aria-live":"polite",children:N}),w&&c.jsx("div",{className:"mb-3 rounded-lg border border-[#cfe1d7] bg-[#f3fbf6] px-3 py-2 text-sm font-semibold text-[#2f5f3e]","aria-live":"polite",children:w}),ae&&c.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-lg border border-[#cfe1d7] bg-[#f7fbf9] px-3 py-2 text-sm font-semibold text-[#2f5f3e]","aria-live":"polite",children:[c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[#5f8d72] border-t-transparent"}),"Spremam sadržaj..."]}),c.jsx(U4,{blocks:f,onChange:p,onPublishArticle:z,onCloseEditor:n,openPreviewRequestId:x,publishButtonLabel:s,onPendingInputChange:te,enableCardImageSelection:a,initialCardImageSrc:l,isPublishing:ae})]}),Se&&c.jsx(K4,{articles:t,editingId:y,onEditArticle:Y,onDeleteArticle:O,busy:ae}),c.jsx(vr,{open:!!D,title:"Obrisati Älanak?",description:"Älanak Äe biti trajno obrisan.",confirmLabel:"ObriÅ¡i Älanak",cancelLabel:"Odustani",onConfirm:U,onCancel:()=>{ae||L(null)}})]})}function G4({open:t,title:e,articles:n,externalDraftBlocks:r,externalDraftRequestId:i,publishButtonLabel:s,onExternalDraftPublish:o,enableCardImageSelection:a=!1,initialCardImageSrc:l=null,activeAdminDisplayName:u,onClose:d,onArticlesChange:f}
201){const[p,m]=h.useState(!1),[g,y]=h.useState(!1),[j,x]=h.useState(!1),k=h.useRef(null),N=h.useCallback(()=>{if(!j){if(!p){d();return}y(!0)}},[p,j,d]);return h.useEffect(()=>{t||(y(!1),m(!1),x(!1))},[t]),c.jsxs(c.Fragment,{children:[c.jsxs(Ju,{open:t,onRequestClose:N,closeOnOverlayClick:!1,disableClose:j,closeConfirmOpen:g,initialFocusRef:k,labelledBy:"admin-editor-modal-title",describedBy:"admin-editor-modal-description",zIndexClassName:"z-[500]",rootClassName:"flex items-stretch justify-center p-0 sm:p-3 md:items-center md:p-6",overlayClassName:"bg-[radial-gradient(circle_at_top,rgba(43,74,55,0.5),rgba(10,16,12,0.86))] backdrop-blur-[3px]",panelClassName:"admin-modal-enter admin-surface relative flex h-full max-h-[100dvh] w-full max-w-[1260px] flex-col overflow-hidden rounded-none sm:max-h-[calc(100vh-1rem)] sm:rounded-2xl md:max-h-[calc(100vh-2.5rem)]",children:[c.jsx("p",{id:"admin-editor-modal-description",className:"sr-only",children:"Administratorski editor za dodavanje i ureÄivanje sadržaja."}),c.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-[#3f7a4f] via-[#5e9b6f] to-[#3f7a4f]"}),c.jsxs("div",{className:"admin-modal-header flex items-start justify-between gap-3 border-b border-[#d8e7df]/90 bg-[linear-gradient(120deg,rgba(248,253,250,0.95),rgba(237,246,241,0.92))] px-3 py-2.5 md:px-4 md:py-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#5a7a68]",children:"Admin Editor"}),c.jsx("h3",{id:"admin-editor-modal-title",className:"m-0 truncate text-sm font-black text-[#244e33] md:text-base",children:e})]}),c.jsx("button",{ref:k,className:"admin-btn shrink-0 rounded-lg border-[#d4e3dc] bg-white/90 px-2 text-2xl font-black leading-none text-[#244e33] transition-colors hover:border-[#f1c6c6] hover:bg-[#fff1f1] hover:text-[#b42318] disabled:cursor-not-allowed disabled:opacity-55",type:"button",onClick:N,"aria-label":"Zatvori admin editor",disabled:j,children:"Ã"})]}),c.jsx("div",{className:"admin-modal-body min-h-0 overflow-y-auto overflow-x-hidden bg-[linear-gradient(180deg,rgba(247,252,249,0.68),rgba(241,248,244,0.38))] px-1.5 py-1.5 sm:px-2 sm:py-2 md:px-3 md:py-3",children:c.jsx(W4,{articles:n,onCloseEditor:N,externalDraftBlocks:r,externalDraftRequestId:i,publishButtonLabel:s,onExternalDraftPublish:o,enableCardImageSelection:a,initialCardImageSrc:l,onArticlesChange:f,onDirtyChange:m,onBusyChange:x})})]}),c.jsx(vr,{open:g,title:"Zatvoriti editor?",description:"ImaÅ¡ nespremljene promjene. Ako zatvoriÅ¡ editor, uneseni sadržaj neÄe biti spremljen.",confirmLabel:"Zatvori bez spremanja",cancelLabel:"Nastavi ureÄivanje",onConfirm:()=>{y(!1),m(!1),d()},onCancel:()=>y(!1)})]})}function Ru(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>typeof e=="string"?e:e&&typeof e=="object"&&"text"in e&&typeof e.text=="string"?e.text:"").join("").trim():""}function q4(t){var o,a,l,u,d,f,p,m,g,y,j,x,k,N,C,w;const e=t.find(E=>E.type==="heading"&&E.level==="article")??t.find(E=>E.type==="heading"),n=t.find(E=>E.type==="publishedDate"),r=t.filter(E=>E.type==="paragraph").map(E=>Ru(E.text)).filter(Boolean),i=t.find(E=>E.type==="image"),s=t.find(E=>E.type==="documents");return{title:(e==null?void 0:e.type)==="heading"?e.text.trim():"",date:(n==null?void 0:n.type)==="publishedDate"?n.date||n.resolvedDate||(n.useToday?new Date().toLocaleDateString("hr-HR"):""):"",paragraphs:r,image:(i==null?void 0:i.type)==="image"?i.src:"",pptDocumentUrl:(s==null?void 0:s.type)==="documents"&&(((a=(o=s.items)==null?void 0:o[0])==null?void 0:a.pptUrl)||((u=(l=s.items)==null?void 0:l[0])==null?void 0:u.pdfUrl)||((f=(d=s.items)==null?void 0:d[0])==null?void 0:f.wordUrl)||((m=(p=s.items)==null?void 0:p[0])==null?void 0:m.excelUrl))||"#",documentUrl:(s==null?void 0:s.type)==="documents"&&(((y=(g=s.items)==null?void 0:g[0])==null?void 0:y.pdfUrl)||((x=(j=s.items)==null?void 0:j[0])==null?void 0:x.wordUrl)||((N=(k=s.items)==null?void 0:k[0])==null?void 0:N.excelUrl)||((w=(C=s.items)==null?void 0:C[0])==null?void 0:w.pptUrl))||"#"}}function Ns(t){return String(t||"").trim().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"x"}function Fn(t){return t.kind==="article"?`search-article-${Ns(t.route||"route")}-${Ns(t.entryId||"entry")}`:t.kind==="subnav"?`search-subnav-${Ns(t.route||"route")}-${Ns(t.tabId||"tab")}-${Ns(t.entryId||"entry")}`:t.kind==="project"?`search-project-${Ns(t.itemId||0)}`:t.kind==="news"?`search-news-${Ns(t.itemId||0)}`:`search-prezentacija-${Ns(t.itemId||0)}`}function Gi(t){return t.toLowerCase().replace(/[ÄÄ]/g,"c").replace(/[Ä]/g,"d").replace(/[Å¡]/g,"s").replace(/[ž]/g,"z").replace(/\s+/g," ").trim()}function J4(t,e){const n=t.find(r=>r.type==="heading"&&r.level==="article")??t.find(r=>r.type==="heading");return n&&n.type==="heading"?n.text.trim():e}function Z4(t){const e=t.find(r=>r.type==="paragraph");if(e&&e.type==="paragraph")return Ru(e.text);const n=t.find(r=>r.type==="list");return n&&n.type==="list"?Ru(n.items[0]??""):""}function XC(t){const e=[];return t.forEach(n=>
201{n.type==="heading"&&e.push(n.text),n.type==="paragraph"&&e.push(Ru(n.text)),n.type==="list"&&n.items.forEach(r=>e.push(Ru(r))),n.type==="image"&&(n.alt&&e.push(n.alt),n.caption&&e.push(n.caption)),n.type==="documents"&&(n.title&&e.push(n.title),n.items.forEach(r=>{r.label&&e.push(r.label)}))}),e.join(" ").trim()}function Sg({route:t,entries:e,fallbackTitle:n,kind:r,tabId:i}){return e.map((s,o)=>{const a=J4(s.blocks,n),l=Z4(s.blocks),u=Gi(`${a} ${l} ${XC(s.blocks)}`),d=Fn(r==="subnav"?{kind:"subnav",route:t,tabId:i||"",entryId:s.id}:{kind:"article",route:t,entryId:s.id});return{id:`${r}-${t}-${i??"main"}-${s.id}-${o}`,title:a,excerpt:l,route:t,kind:r,tabId:i,targetId:d,searchText:u}})}function Y4(t){const e=[],{pageTitleByRoute:n,getBaseRouteArticles:r,getSubnavBaseSections:i,getSubnavLabel:s,subnavTabIdsByRoute:o,routeArticleOverrides:a,subnavArticleOverrides:l,adminArticlesByRoute:u,newsCardItems:d,archivedNewsItems:f,archivedItems:p=[],projectsCardItems:m,prezentacijeItems:g}=t;Object.keys(n).forEach(x=>{const k=n[x]??x,N=a[x]??r(x),C=u[x]??[];if(N.length===0&&C.length===0){e.push({id:`page-${x}`,title:k,excerpt:"",route:x,kind:"page",searchText:Gi(k)});return}e.push(...Sg({route:x,entries:N,fallbackTitle:k,kind:"article"})),C.length>0&&e.push(...Sg({route:x,entries:C,fallbackTitle:k,kind:"article"}))}),Object.entries(o).forEach(([x,k])=>{const N=x;k==null||k.forEach(C=>{var D;const w=`${n[N]??N} / ${s(N,C)}`,E=((D=l[N])==null?void 0:D[C])??i(N,C);if(E.length===0){e.push({id:`subnav-${N}-${C}`,title:w,excerpt:"",route:N,kind:"subnav",tabId:C,searchText:Gi(w)});return}e.push(...Sg({route:N,entries:E,fallbackTitle:w,kind:"subnav",tabId:C}))})}),d.forEach(x=>{const k=Gi(`${x.title} ${x.summary} ${x.body.join(" ")}`);e.push({id:`news-${x.id}`,title:x.title,excerpt:x.summary,route:"vijesti",kind:"news",newsId:x.id,searchText:k})}),m.forEach(x=>{const k=Gi(`${x.title} ${x.summary} ${x.body.join(" ")}`);e.push({id:`project-${x.id}`,title:x.title,excerpt:x.summary,route:"projekti",kind:"project",targetId:Fn({kind:"project",itemId:x.id}),searchText:k})}),g.forEach(x=>{const k=x.author||x.description||"",N=Gi(`${x.title} ${k}`);e.push({id:`prezentacija-${x.id}`,title:x.title,excerpt:k,route:"strucno-prezentacije",kind:"prezentacija",targetId:Fn({kind:"prezentacija",itemId:x.id}),searchText:N})});const j=new Set(p.filter(x=>x.kind==="news"&&typeof x.sourceId=="number").map(x=>
201Number(x.sourceId)));return p.forEach(x=>{const k=Array.isArray(x.blocks)?XC(x.blocks):"",N=Array.isArray(x.body)?x.body.join(" "):"",C=x.subtitle||N||x.date||"",w=Gi(`${x.title} ${x.subtitle||""} ${x.date||""} ${N} ${k} arhiva arhivirano`);e.push({id:`archive-${x.id}`,title:x.title,excerpt:C,route:x.route??"vijesti",kind:"archive",archiveItemId:x.id,searchText:w})}),f.forEach(x=>{if(j.has(x.id))return;const k=Gi(`${x.title} ${x.summary} ${x.body.join(" ")} arhiva arhivirano`);e.push({id:`news-archived-${x.id}`,title:x.title,excerpt:x.summary,route:"vijesti",kind:"news",newsId:x.id,newsArchived:!0,searchText:k})}),e}function Q4(t,e){const n=Gi(e);if(!n)return[];const r=n.split(" ").filter(Boolean);return t.filter(i=>r.every(s=>i.searchText.includes(s)))}function X4({open:t,onClose:e,results:n,onSelectResult:r}){const[i,s]=h.useState(""),o=h.useMemo(()=>Q4(n,i),[n,i]);return h.useEffect(()=>{t||s("")},[t]),h.useEffect(()=>{if(t)return Dl()},[t]),h.useEffect(()=>{if(!t)return;const a=l=>{l.key==="Escape"&&e()};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[t,e]),t?go.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[300] flex items-center justify-center overflow-hidden p-2 sm:p-4 md:p-8",onClick:e,children:[c.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top,rgba(30,52,39,0.5),rgba(10,16,12,0.85))] backdrop-blur-[2px]"}),c.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"search-modal-title",className:"relative z-[1] box-border max-h-[calc(100dvh-1rem)] w-full min-w-0 max-w-[980px] overflow-x-hidden overflow-y-hidden rounded-lg bg-[rgba(255,255,255,0.08)] px-4 pb-4 pt-10 shadow-[0_24px_64px_rgba(0,0,0,0.35)] sm:max-h-[calc(100dvh-2rem)] sm:px-8 sm:pb-8 sm:pt-12 md:max-h-[calc(100dvh-3rem)]",onClick:a=>a.stopPropagation(),children:[c.jsx("h2",{id:"search-modal-title",className:"sr-only",children:"Pretraži sadržaj"}),c.jsx("button",{className:"absolute right-3 top-1 sm:top-2 bg-transparent text-4xl font-black leading-none text-white transition-colors duration-200 hover:text-[#b42318]",onClick:e,type:"button","aria-label":"Zatvori pretragu",children:"x"}),c.jsxs("div",{className:"mx-auto my-8 grid w-full max-w-[760px] min-w-0 grid-cols-1 gap-4 md:my-12 md:grid-cols-[1fr_auto] md:gap-4",children:[c.jsx("input",{placeholder:"Pretraži...",className:"min-h-[58px] w-full border-0 px-4",value:i,autoFocus:!0,onChange:a=>s(a.target.value),onKeyDown:a=>{a.key==="Enter"&&o.length>0&&r(o[0])}}),c.jsxs("button",{className:"inline-flex w-full items-center justify-center gap-2 rounded-lg border border-[#376d44] bg-[#376d44] px-4 py-2 text-sm font-semibold text-white transition-colors duration-200 hover:bg-white hover:border-white hover:text-[#1f4b2e] md:w-auto",onClick:()=>{o.length>0&&r(o[0])},children:[c.jsx($b,{className:"h-6 w-6"}),"Pretraži"]})]}),c.jsxs("div",{className:"mx-auto max-h-[45vh] w-full max-w-[760px] min-w-0 overflow-x-hidden overflow-y-auto rounded-lg border border-white/20 bg-white/90 p-4 text-sm text-[#1f2d24] shadow-inner",children:[i.trim().length===0&&c.jsx("div",{className:"text-center text-[#5a6c60]",children:"UpiÅ¡ite pojam za pretragu."}),i.trim().length>0&&o.length===0&&c.jsx("div",{className:"text-center text-[#5a6c60]",children:"Nema rezultata."}),o.length>0&&c.jsx("div",{className:"space-y-3",children:o.map(a=>c.jsxs("button",{className:"w-full rounded-lg border border-[#d6e2da] bg-white px-3 py-2 text-left transition hover:border-[#2f8f4b] hover:bg-[#f2faf6]",onClick:()=>r(a),children:[c.jsx("div",{className:"break-words text-sm font-semibold text-[#1f2d24]",children:a.title}),a.excerpt&&c.jsx("div",{className:"mt-1 break-words text-xs text-[#5a6c60]",children:a.excerpt})]},a.id))})]})]})]}),document.body):null}const Rj={news:"Vijesti",project:"Projekti",prezentacija:"Prezentacije",article:"Stranice"},eL=["SijeÄanj","VeljaÄa","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"];function Ng(t){const e=String(t.date||"").trim();return e||""}function eE(t){const e=Number(t.sortValue||0);if(Number.isFinite(e)&&e>0){const s=new Date(e);if(!Number.isNaN(s.getTime()))return{year:String(s.getFullYear()),month:String(s.getMonth()+1)}}const n=String(t.date||"").trim();if(!n)return null;const r=n.match(/(\d{4})[-/.]\s*(\d{1,2})[-/.]\s*(\d{1,2})/);if(r)return{year:r[1],month:String(Number(r[2]))};const i=n.match(/(\d{1,2})\.\s*(\d{1,2})\.\s*(\d{4})/);return i?{year:i[3],month:String(Number(i[2]))}:null}function tL(t){const e=new Map;return t.forEach(n=>{const r=eE(n);if(!r)return;const i=Number(r.month),s=Number(r.year);if(!Number.isFinite(i)||i<1||i>12||!Number.isFinite(s))return;let o=e.get(r.year);o||(o={key:r.year,label:r.year,count:0,yearSort:s,months:[]},e.set(r.year,o)),o.count+=1;let a=o.months.find(l=>l.key===r.month);a||(a={key:r.month,label:eL[i-1]??r.month,count:0,monthSort:i},o.months.push(a)),a.count+=1}),Array.from(e.values()).map(n=>({...n,months:[...n.months].sort((r,i)=>i.monthSort-r.monthSort)})).sort((n,r)=>
201r.yearSort-n.yearSort)}function nL({open:t,items:e,targetItemId:n=null,loading:r=!1,error:i="",isAdmin:s=!1,restoringId:o=null,onClose:a,onRestore:l}){const[u,d]=h.useState(null),[f,p]=h.useState(null),[m,g]=h.useState("all"),[y,j]=h.useState("all");h.useEffect(()=>{if(t)return Dl()},[t]),h.useEffect(()=>{if(!t)return;const E=D=>{D.key==="Escape"&&a()};return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E)}},[t,a]);const x=h.useMemo(()=>tL(e),[e]),k=h.useMemo(()=>x.find(E=>E.key===m)??null,[m,x]),N=h.useMemo(()=>(k==null?void 0:k.months.find(E=>E.key===y))??null,[y,k]),C=h.useMemo(()=>e.filter(E=>{const D=eE(E);return!(m!=="all"&&(D==null?void 0:D.year)!==m||y!=="all"&&(D==null?void 0:D.month)!==y)}),[e,y,m]);h.useEffect(()=>{m!=="all"&&!x.some(E=>E.key===m)&&g("all")},[m,x]),h.useEffect(()=>{if(m==="all"&&y!=="all"){j("all");return}y!=="all"&&!(k!=null&&k.months.some(E=>E.key===y))&&j("all")},[y,m,k]),h.useEffect(()=>{if(!t){d(null),p(null),g("all"),j("all");return}if(n&&n!==f&&e.some(E=>E.id===n)){g("all"),j("all"),d(n),p(n);return}if(C.length===0){d(null);return}(!u||!C.some(E=>E.id===u))&&d(C[0].id)},[f,C,e,t,u,n]);const w=h.useMemo(()=>C.find(E=>E.id===u)??C[0]??null,[C,u]);return t?go.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[300] flex items-center justify-center overflow-hidden p-2 sm:p-4 md:p-6",onClick:a,children:[c.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top,rgba(30,52,39,0.45),rgba(10,16,12,0.88))] backdrop-blur-[2px]"}),c.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"global-archive-title",className:"relative z-[1] flex h-[calc(100dvh-1rem)] w-full max-w-[1180px] min-w-0 flex-col overflow-hidden rounded-lg border border-white/20 bg-[#f8fbf8] text-[#1f2d24] shadow-[0_28px_80px_rgba(0,0,0,0.42)] sm:h-[calc(100dvh-2rem)] md:h-[min(820px,calc(100dvh-3rem))]",onClick:E=>E.stopPropagation(),children:[c.jsxs("header",{className:"flex shrink-0 items-start justify-between gap-3 border-b border-[#d8e7df] bg-white px-4 py-3 md:px-5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#5a7a68]",children:"Arhiva"}),c.jsx("h2",{id:"global-archive-title",className:"m-0 break-words text-xl font-black leading-tight text-[#244e33] md:text-2xl",children:"Arhiva"})]}),c.jsx("button",{type:"button",onClick:a,"aria-label":"Zatvori arhivu",className:"shrink-0 rounded-lg border border-[#d4e3dc] bg-white px-2.5 py-1 text-2xl font-black leading-none text-[#244e33] transition hover:border-[#f1c6c6] hover:bg-[#fff1f1] hover:text-[#b42318]",children:"x"})]}),c.jsxs("div",{className:"shrink-0 border-b border-[#d8e7df] bg-[#edf6f0] px-4 py-2 text-sm font-semibold text-[#315c40] md:px-5",children:["Ukupno arhiviranih stavki: ",e.length]}),i&&c.jsx("div",{className:"shrink-0 border-b border-[#f2c4c4] bg-[#fff1f1] px-4 py-2 text-sm font-semibold text-[#9f2424] md:px-5",children:i}),c.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 md:grid-cols-[minmax(260px,340px)_minmax(0,1fr)]",children:[c.jsx("aside",{className:"min-h-0 border-b border-[#d8e7df] bg-white md:border-b-0 md:border-r",children:c.jsxs("div",{className:"h-full overflow-y-auto p-3",children:[c.jsxs("div",{className:"rounded-lg border border-[#dce7e0] bg-white/80 p-3",children:[c.jsxs("div",{className:"grid gap-3 border-y border-[#e5eee8] py-3 sm:grid-cols-2 md:grid-cols-1",children:[c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"block text-[11px] font-semibold uppercase text-[#5a7f67]",children:"Godina"}),c.jsxs("select",{className:"mt-1.5 w-full rounded-lg border border-[#cfe0d6] bg-white px-3 py-2 text-sm font-bold text-[#245d3b] shadow-sm outline-none transition focus:border-[#75a889] focus:ring-2 focus:ring-[#dcefe4]",value:m,onChange:E=>{g(E.target.value),j("all")},children:[c.jsxs("option",{value:"all",children:["Sve godine (",e.length,")"]}),x.map(E=>c.jsxs("option",{value:E.key,children:[E.label," (",E.count,")"]},`archive-year-option-${E.key}`))]})]}),c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"block text-[11px] font-semibold uppercase text-[#5a7f67]",children:"Mjesec"}),c.jsxs("select",{className:"mt-1.5 w-full rounded-lg border border-[#cfe0d6] bg-white px-3 py-2 text-sm font-bold text-[#245d3b] shadow-sm outline-none transition focus:border-[#75a889] focus:ring-2 focus:ring-[#dcefe4] disabled:bg-[#f3f7f5] disabled:text-[#8aa092]",value:y,disabled:!k,onChange:E=>j(E.target.value),children:[c.jsx("option",{value:"all",children:k?`Svi mjeseci (${k.count})`:`Svi mjeseci (${e.length})`}),k==null?void 0:k.months.map(E=>c.jsxs("option",{value:E.key,children:[E.label," (",E.count,")"]},`archive-month-option-${E.key}`))]})]})]}),c.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[c.jsx("p",{className:"m-0 text-sm font-bold text-[#2f5f3e]",children:k?N?`${N.label} ${k.label}`:k.label:"Sve godine"}),c.jsx("span",{className:"shrink-0 rounded-full border border-[#d7e5dd] bg-white px-2.5 py-1 text-[11px] font-semibold text-[#557162]",children:C.length})]})]}),r&&c.jsx("div",{className:"mt-3 rounded-lg border border-[#d8e7df] bg-[#f7fcf9] px-3 py-3 text-sm font-semibold text-[#547260]",children:"UÄitavanje arhive..."}
201),!r&&C.length===0&&c.jsx("div",{className:"mt-3 rounded-lg border border-[#d8e7df] bg-[#f7fcf9] px-3 py-3 text-sm font-semibold text-[#547260]",children:"Nema arhiviranog sadržaja."}),c.jsx("div",{className:"mt-3 space-y-2",children:C.map(E=>{const D=(w==null?void 0:w.id)===E.id,L=Ng(E);return c.jsxs("button",{type:"button",onClick:()=>d(E.id),className:`w-full rounded-lg border px-3 py-2 text-left transition ${D?"border-[#2f5f3e] bg-[#edf6f0] shadow-[inset_3px_0_0_#2f5f3e]":"border-[#d8e7df] bg-white hover:border-[#8fb49c] hover:bg-[#f7fcf9]"}`,children:[c.jsx("span",{className:"mb-1 inline-flex rounded-full bg-[#e2eee7] px-2 py-0.5 text-[11px] font-bold uppercase text-[#315c40]",children:Rj[E.kind]}),c.jsx("span",{className:"block break-words text-sm font-extrabold leading-snug text-[#213f2c]",children:E.title}),c.jsx("span",{className:"mt-1 block break-words text-xs font-semibold leading-snug text-[#5d7567]",children:E.subtitle}),L&&c.jsx("span",{className:"mt-1 block text-xs text-[#71887a]",children:L})]},E.id)})})]})}),c.jsx("main",{className:"min-h-0 overflow-y-auto bg-[#f8fbf8]",children:w?c.jsxs("div",{className:"mx-auto w-full max-w-[820px] px-4 py-4 md:px-6 md:py-5",children:[c.jsxs("div",{className:"mb-4 flex flex-col gap-3 border-b border-[#d8e7df] pb-4 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"mb-2 inline-flex rounded-full bg-[#dcece2] px-2.5 py-1 text-[11px] font-bold uppercase text-[#315c40]",children:Rj[w.kind]}),c.jsx("h3",{className:"m-0 break-words text-2xl font-black leading-tight text-[#244e33] md:text-3xl",children:w.title}),c.jsx("p",{className:"m-0 mt-1 break-words text-sm font-semibold text-[#5c7566]",children:w.subtitle}),Ng(w)&&c.jsx("p",{className:"m-0 mt-1 text-sm text-[#71887a]",children:Ng(w)})]}),s&&l&&c.jsx("button",{type:"button",disabled:o===w.id,onClick:()=>l(w),className:"inline-flex h-10 shrink-0 items-center justify-center rounded-full border border-[#2f5f3e] bg-[#2f5f3e] px-4 text-sm font-bold text-white transition hover:bg-[#244e33] disabled:cursor-not-allowed disabled:opacity-60",children:o===w.id?"VraÄanje...":"Odarhiviraj"})]}),w.blocks&&w.blocks.length>0?c.jsx(In,{blocks:w.blocks}):w.body&&w.body.length>0?c.jsx("div",{className:"space-y-4 text-base leading-7 text-[#31563d] md:text-lg md:leading-8",children:w.body.map((E,D)=>c.jsx("p",{className:"m-0 whitespace-pre-line break-words [overflow-wrap:anywhere]",children:E},`${w.id}-body-${D}`))}):c.jsx("p",{className:"m-0 text-sm font-semibold text-[#5d7567]",children:"Nema dodatnog sadržaja za prikaz."}),w.url&&w.url!=="#"&&c.jsx("div",{className:"mt-5 border-t border-[#d8e7df] pt-4",children:c.jsx("a",{href:w.url,target:"_blank",rel:"noreferrer noopener",className:"inline-flex min-h-10 max-w-full items-center justify-center rounded-full border border-[#376d44] bg-[#376d44] px-4 text-sm font-bold text-white transition hover:bg-[#2f5f3e]",children:"Otvori dokument"})})]}):c.jsx("div",{className:"flex h-full items-center justify-center p-6 text-center text-sm font-semibold text-[#5d7567]",children:r?"UÄitavanje arhive...":"Nema arhiviranog sadržaja."})})]})]})]}),document.body):null}function $j(t){const e=String(t||"").trim();if(!e||e.startsWith("data:"))return"";const r=e.split("?")[0].split("/").pop()||"";return decodeURIComponent(r).trim()}function Bj(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("Neuspjelo Äitanje datoteke.")),r.readAsDataURL(t)})}function Cg(t){return{title:String(t.title||"").trim(),author:String(t.author||"").trim(),date:String(t.date||"").trim(),documentUrl:String(t.documentUrl||"").trim(),documentName:String(t.documentName||"").trim()}}function rL(t,e){return t.title===e.title&&t.author===e.author&&t.date===e.date&&t.documentUrl===e.documentUrl&&t.documentName===e.documentName}function iL({open:t,mode:e,initialValue:n,saving:r=!1,submitError:i="",onClose:s,onSubmit:o}){const[a,l]=h.useState(""),[u,d]=h.useState(""),[f,p]=h.useState(""),[m,g]=h.useState(""),[y,j]=h.useState(""),[x,k]=h.useState(!1),[N,C]=h.useState(""),[w,E]=h.useState(!1),D=h.useRef(null),[L,V]=h.useState(()=>Cg({title:"",author:"",date:"",documentUrl:"",documentName:""})),te=h.useMemo(()=>Cg({title:a,author:u,date:f,documentUrl:m,documentName:y}),[u,f,y,m,a]),ae=h.useMemo(()=>!rL(L,te),[te,L]),ke=h.useCallback(()=>
201{if(!r){if(!ae){s();return}E(!0)}},[ae,s,r]);h.useEffect(()=>{if(!t)return;const P=String((n==null?void 0:n.title)||"").trim(),z=String((n==null?void 0:n.author)||"").trim(),Y=String((n==null?void 0:n.date)||"").trim(),Q=String((n==null?void 0:n.documentUrl)||"").trim(),O=String((n==null?void 0:n.documentName)||"").trim()||$j(Q);l(P),d(z),p(Y),g(Q),j(O),V(Cg({title:P,author:z,date:Y,documentUrl:Q,documentName:O})),C(""),E(!1)},[t,n]),h.useEffect(()=>{t||E(!1)},[t]);const ge=e==="edit"?"Uredi prezentaciju":"Dodaj prezentaciju",Se=e==="edit"?"Spremi promjene":"Dodaj prezentaciju",me=m.trim().length===0,H=h.useMemo(()=>a.trim().length>0&&u.trim().length>0&&!me&&!r,[u,me,r,a]);return c.jsxs(c.Fragment,{children:[c.jsxs(Ju,{open:t,onRequestClose:ke,closeOnOverlayClick:!1,disableClose:r,closeConfirmOpen:w,initialFocusRef:D,labelledBy:"prezentacija-form-title",describedBy:"prezentacija-form-description",zIndexClassName:"z-[500]",rootClassName:"flex items-start justify-center p-2 sm:p-4 md:items-center",overlayClassName:"bg-[radial-gradient(circle_at_top,rgba(24,38,30,0.45),rgba(10,16,12,0.82))] backdrop-blur-[2px]",panelClassName:"my-2 flex w-full max-w-[620px] max-h-[calc(100dvh-1rem)] flex-col overflow-hidden rounded-2xl border border-[#d7e4dd] bg-[linear-gradient(180deg,#ffffff_0%,#f6faf8_100%)] shadow-[0_26px_68px_rgba(10,28,18,0.42)] sm:max-h-[calc(100dvh-2rem)] md:my-0",children:[c.jsx("p",{id:"prezentacija-form-description",className:"sr-only",children:"Dodavanje ili ureÄivanje prezentacije s naslovom, autorom, datumom i dokumentom."}),c.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[#dde9e2] px-5 py-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#5a7f67]",children:"Prezentacije"}),c.jsx("h3",{id:"prezentacija-form-title",className:"m-0 mt-1 text-lg font-black text-[#1f5131]",children:ge})]}),c.jsx("button",{ref:D,type:"button",className:"grid h-10 w-10 place-items-center rounded-xl border border-[#cad9d1] bg-white text-xl font-bold text-[#365a46] transition hover:bg-[#f1f7f3] disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Zatvori modal",onClick:ke,disabled:r,children:"X"})]}),c.jsxs("form",{className:"flex min-h-0 flex-1 flex-col",onSubmit:async P=>{if(P.preventDefault(),!H){C(me?"Dodaj dokument (PPT/PPTX/PDF) prije spremanja prezentacije.":"Unesi naslov i autora.");return}const z=y.trim()||$j(m);C(""),await o({title:a.trim(),author:u.trim(),date:f.trim(),documentUrl:m.trim(),documentName:z})},children:[c.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto p-5",children:[c.jsxs("label",{className:"block text-sm font-semibold text-[#2f5f3e]",children:["Naslov",c.jsx("input",{type:"text",className:"mt-1 w-full rounded-xl border border-[#cbded2] bg-white px-3 py-2.5 text-sm text-[#1f5131] outline-none transition focus:border-[#79a98d] focus:ring-2 focus:ring-[#d7ece0]",value:a,onChange:P=>l(P.target.value),placeholder:"Unesi naslov prezentacije",maxLength:255,required:!0,disabled:r})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsxs("label",{className:"block text-sm font-semibold text-[#2f5f3e]",children:["Autor / Autori",c.jsx("input",{type:"text",className:"mt-1 w-full rounded-xl border border-[#cbded2] bg-white px-3 py-2.5 text-sm text-[#1f5131] outline-none transition focus:border-[#79a98d] focus:ring-2 focus:ring-[#d7ece0]",value:u,onChange:P=>d(P.target.value),placeholder:"Unesi autora",maxLength:255,required:!0,disabled:r})]}),c.jsxs("label",{className:"block text-sm font-semibold text-[#2f5f3e]",children:["Datum",c.jsx("input",{type:"date",className:"mt-1 w-full rounded-xl border border-[#cbded2] bg-white px-3 py-2.5 text-sm text-[#1f5131] outline-none transition focus:border-[#79a98d] focus:ring-2 focus:ring-[#d7ece0]",value:f,onChange:P=>p(P.target.value),disabled:r})]})]}),c.jsxs("div",{className:"block text-sm font-semibold text-[#2f5f3e]",children:[c.jsx("p",{className:"m-0",children:"Dokument (PPT/PPTX/PDF)"}),c.jsxs("label",{className:`mt-1 flex w-full cursor-pointer items-center justify-center rounded-xl border-2 border-dashed px-3 py-3 text-center text-sm transition ${x?"border-[#5f8d72] bg-[#eef7f1] text-[#2f5f3e]":"border-[#cbded2] bg-white text-[#355843] hover:border-[#94b9a3] hover:bg-[#f6fbf8]"}`,onDragEnter:P=>{var Y;!Array.from(((Y=P.dataTransfer)==null?void 0:Y.types)||[]).includes("Files")||r||(P.preventDefault(),P.stopPropagation(),k(!0))},onDragOver:P=>{var Y;!Array.from(((Y=P.dataTransfer)==null?void 0:Y.types)||[]).includes("Files")||r||(P.preventDefault(),P.stopPropagation(),P.dataTransfer.dropEffect="copy",k(!0))},onDragLeave:P=>{const z=P.relatedTarget;z&&P.currentTarget.contains(z)||k(!1)},onDrop:async P=>{var Q,O;if(!Array.from(((Q=P.dataTransfer)==null?void 0:Q.types)||[]).includes("Files")||r)return;P.preventDefault(),P.stopPropagation(),k(!1);const Y=(O=P.dataTransfer.files)==null?void 0:O[0];if(Y)try{const U=await Bj(Y);if(!U)throw new Error("Datoteka je prazna.");g(U),j(Y.name),C("")}catch{C("Datoteku nije moguÄe uÄitati. PokuÅ¡aj ponovno.")}},children:[c.jsx("input",{type:"file",accept:".ppt,.pptx,.pdf,application/pdf,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation",className:"hidden",disabled:r,onChange:async P=>{var Y;const z=(Y=P.target.files)==null?void 0:Y[0];if(!(!z||r))try{const Q=await Bj(z);if(!Q)throw new Error("Datoteka je prazna.");g(Q),j(z.name),C("")}catch{C("Datoteku nije moguÄe uÄitati. PokuÅ¡aj ponovno.")}finally{P.currentTarget.value=""}}}),"Dodaj dokument ili ga povuci ovdje"]}),c.jsxs("label",{className:"mt-3 block text-sm font-semibold text-[#2f5f3e]",children:["Naziv dokumenta",c.jsx("input",{type:"text",className:"mt-1 w-full rounded-xl border border-[#cbded2] bg-white px-3 py-2.5 text-sm text-[#1f5131] outline-none transition focus:border-[#79a98d] focu
201s:ring-2 focus:ring-[#d7ece0]",value:y,onChange:P=>j(P.target.value),placeholder:"Unesi naziv dokumenta",maxLength:255,disabled:r})]})]}),y&&c.jsxs("p",{className:"m-0 rounded-lg border border-[#d8e7dd] bg-[#f7fbf9] px-3 py-2 text-sm text-[#355843]",children:["Odabrani dokument: ",c.jsx("span",{className:"font-semibold",children:y})]}),N&&c.jsx("p",{className:"m-0 text-sm font-semibold text-[#9e2b2b]",children:N}),i&&c.jsx("p",{className:"m-0 rounded-lg border border-[#f0c9c9] bg-[#fff4f4] px-3 py-2 text-sm font-semibold text-[#b42318]","aria-live":"polite",children:i})]}),c.jsxs("div",{className:"sticky bottom-0 flex flex-wrap items-center justify-end gap-2 border-t border-[#e3ede7] bg-white/95 px-5 py-4 backdrop-blur",children:[c.jsx("button",{type:"button",className:"admin-btn h-10 border-[#d6e1da] bg-white px-4 text-sm font-semibold text-[#355843] transition hover:bg-[#f5faf7]",onClick:ke,disabled:r,children:"Odustani"}),c.jsxs("button",{type:"submit",className:"btn-natural btn-natural-primary inline-flex items-center justify-center gap-2 px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-60",disabled:r,children:[r&&c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/80 border-t-transparent"}),r?"Spremam...":Se]})]})]})]}),c.jsx(vr,{open:w,title:"Zatvoriti bez spremanja?",description:"Unesene promjene neÄe biti spremljene.",confirmLabel:"Zatvori bez spremanja",cancelLabel:"Nastavi ureÄivanje",onConfirm:()=>{E(!1),s()},onCancel:()=>E(!1)})]})}function sL(){return Hr("/api/web/ekomora-import",{auth:!0})}function oL(t){return Ol("/api/web/ekomora-import",{auth:!0,body:t})}function aL(t){const e=String(t||"").trim();if(!e)return"Nije dostupno";const n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat("hr-HR",{dateStyle:"medium",timeStyle:"short"}).format(n)}function Fj(t){const e=Number(t||0);if(!Number.isFinite(e)||e<=0)return"0 B";if(e<1024)return`${e} B`;const n=e/1024;return n<1024?`${n.toFixed(1)} KB`:`${(n/1024).toFixed(2)} MB`}function lL(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>e(String(r.result||"")),r.onerror=()=>n(new Error("Neuspjelo Äitanje datoteke.")),r.readAsDataURL(t)})}function cL(t){return String(t.name||"").trim().toLowerCase().endsWith(".csv")}function uL(t,e){return String((t==null?void 0:t.name)||"").trim().toLowerCase()===String(e).trim().toLowerCase()}function dL({open:t,onClose:e}){var Q,O,U;const n=h.useRef(null),[r,i]=h.useState(null),[s,o]=h.useState(!1),[a,l]=h.useState(""),[u,d]=h.useState(!1),[f,p]=h.useState(""),[m,g]=h.useState(""),[y,j]=h.useState({bod_clan:!1,bod_akt:!1}),[x,k]=h.useState(!1),[N,C]=h.useState(!1),[w,E]=h.useState(!1),[D,L]=h.useState(null),[V,te]=h.useState(null),ae=y.bod_clan||y.bod_akt,ke=h.useMemo(()=>!u&&!ae&&!!(D&&V),[V,D,ae,u]);async function ge(){try{o(!0),l("");const $=await sL();i($)}catch($){const J=$ instanceof Error&&$.message.trim()?$.message.trim():"NeuspjeÅ¡no uÄitavanje zadnjeg importa.";l(J)}finally{o(!1)}}h.useEffect(()=>{t&&(p(""),g(""),ge())},[t]),h.useEffect(()=>{t||(k(!1),C(!1),E(!1),j({bod_clan:!1,bod_akt:!1}),L(null),te(null),p(""),g(""))},[t]);async function Se($,J){if(!cL(J)){p("Dozvoljeno je uÄitati samo .csv datoteke.");return}const ie=$==="bod_clan"?"bod_clan.csv":"bod_akt.csv";if(!uL(J,ie)){p(`Naziv datoteke mora biti toÄno: ${ie}`);return}j(oe=>({...oe,[$]:!0}));try{const oe=await lL(J);if(!oe){p("Datoteka je prazna ili neispravna.");return}const be={fileName:J.name,dataUrl:oe,sizeBytes:Number(J.size||0)};$==="bod_clan"?L(be):te(be),p(""),g("")}catch{p("Neuspjelo Äitanje datoteke.")}finally{j(oe=>({...oe,[$]:!1}))}}async function me($){if($.preventDefault(),ae){p("PriÄekaj da se uÄitavanje datoteka zavrÅ¡i.");return}if(!D||!V){p("Potrebno je uÄitati obje CSV datoteke (bod_clan i bod_akt).");return}if(!u)try{d(!0),p(""),g("");const J=await oL({bod_clan_csv:{file_name:D.fileName,data_url:D.dataUrl},bod_akt_csv:{file_name:V.fileName,data_url:V.dataUrl}});i(J),L(null),te(null),g("CSV datoteke su uspjeÅ¡no importane.")}catch(J){const ie=J instanceof Error&&J.message.trim()?J.message.trim():"Import nije uspio.";p(ie)}finally{d(!1)}}const H=((Q=r==null?void 0:r.files)==null?void 0:Q.find($=>$.key==="bod_clan"))||null,P=((O=r==null?void 0:r.files)==null?void 0:O.find($=>$.key==="bod_akt"))||null,z=y.bod_clan,Y=y.bod_akt;return c.jsxs(Ju,{open:t,onRequestClose:()=>{u||ae||e()},closeOnOverlayClick:!1,disableClose:u||ae,initialFocusRef:n,labelledBy:"ekomora-import-title",describedBy:"ekomora-import-description",zIndexClassName:"z-[500]",rootClassName:"flex items-start justify-center p-2 sm:p-4 md:items-center",overlayClassName:"bg-[radial-gradient(circle_at_top,rgba(43,74,55,0.5),rgba(10,16,12,0.86))] backdrop-blur-[3px]",panelClassName:"my-2 flex w-full max-w-[720px] max-h-[calc(100dvh-1rem)] flex-col overflow-hidden rounded-2xl border border-[#d7e4dd] bg-[linear-gradient(180deg,#ffffff_0%,#f6faf8_100%)] shadow-[0_26px_68px_rgba(10,28,18,0.42)] sm:max-h-[calc(100dvh-2rem)] md:my-0",children:[c.jsx("p",{id:"ekomora-import-description",className:"sr-only",children:"RuÄni import eKomora CSV datoteka za bod_clan i bod_akt tablice."}),c.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-1 bg-gradient-to-r from-[#3f7a4f] via-[#5e9b6f] to-[#3f7a4f]"}),c.jsxs("div",{className:"admin-modal-header flex items-start justify-between gap-3 border-b border-[#d8e7df]/90 bg-[linear-gradient(120deg,rgba(248,253,250,0.95),rgba(237,246,241,0.92))] px-3 py-2.5 md:px-4 md:py-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#5a7a68]",children:"Admin eKomora import"}),c.jsxs("div",{className:"group relative self-start",children:[c.jsx("button",{type:"button",onClick:()=>E($=>
201!$),className:"admin-btn inline-flex h-7 w-7 items-center justify-center rounded-full border border-[#2f5f3e] bg-[#edf6f1] text-xs font-extrabold text-[#1f5b3a] transition hover:bg-[#dff0e7] disabled:cursor-not-allowed disabled:opacity-45","aria-label":"Prikaži informacije i upute za eKomora import","aria-expanded":w,disabled:u||ae,children:"i"}),c.jsxs("div",{className:`absolute left-0 top-8 z-20 w-[min(92vw,440px)] rounded-lg border border-[#d3e2db] bg-white p-3 text-xs text-[#355b43] shadow-[0_12px_28px_rgba(28,67,46,0.12)] transition ${w?"visible opacity-100":"invisible opacity-0 group-hover:visible group-hover:opacity-100"}`,children:[c.jsx("p",{className:"m-0 mb-1 text-xs font-semibold uppercase text-[#4f6e5e]",children:"Upute za import"}),c.jsxs("ul",{className:"m-0 list-disc space-y-1 pl-4",children:[c.jsx("li",{children:"Potrebno je uÄitati obje datoteke: bod_clan.csv i bod_akt.csv."}),c.jsx("li",{children:"Nazivi datoteka moraju biti toÄni: bod_clan.csv i bod_akt.csv."}),c.jsx("li",{children:"Dozvoljen je iskljuÄivo CSV format."}),c.jsx("li",{children:"Novi import zamjenjuje postojeÄe podatke u eKomora tablicama."}),c.jsx("li",{children:"Sprema se evidencija: tko je importao, kada i koje datoteke."})]})]})]})]}),c.jsx("h3",{id:"ekomora-import-title",className:"m-0 truncate text-sm font-black text-[#244e33] md:text-base",children:"eKomora CSV import"})]}),c.jsx("button",{ref:n,type:"button",className:"admin-btn shrink-0 rounded-lg border-[#d4e3dc] bg-white/90 px-2 text-2xl font-black leading-none text-[#244e33] transition-colors hover:border-[#f1c6c6] hover:bg-[#fff1f1] hover:text-[#b42318] disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Zatvori admin eKomora import",onClick:()=>{u||ae||e()},disabled:u||ae,children:"Ã"})]}),c.jsxs("form",{className:"flex min-h-0 flex-1 flex-col",onSubmit:me,children:[c.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto p-5",children:[c.jsxs("div",{className:"rounded-xl border border-[#d8e7dd] bg-[#f7fbf9] p-4",children:[c.jsx("p",{className:"m-0 text-sm font-bold text-[#2f5f3e]",children:"Posljednji import"}),s&&c.jsx("p",{className:"m-0 mt-2 text-sm text-[#355843]",children:"UÄitavam..."}),!s&&a&&c.jsx("p",{className:"m-0 mt-2 text-sm font-semibold text-[#b42318]",children:a}),!s&&!a&&!r&&c.jsx("p",{className:"m-0 mt-2 text-sm text-[#355843]",children:"JoÅ¡ nije spremljen nijedan eKomora CSV import."}),!s&&!a&&r&&c.jsxs("div",{className:"mt-2 space-y-1 text-sm text-[#355843]",children:[c.jsxs("p",{className:"m-0",children:[c.jsx("span",{className:"font-semibold",children:"Vrijeme:"})," ",aL(r.imported_at)]}),c.jsxs("p",{className:"m-0",children:[c.jsx("span",{className:"font-semibold",children:"Admin:"})," ",((U=r.imported_by)==null?void 0:U.display_name)||"Nepoznato"]}),c.jsxs("p",{className:"m-0",children:[c.jsx("span",{className:"font-semibold",children:"bod_clan:"})," ",H?`${H.file_name} (${H.rows_count} redaka)`:"Nije dostupno"]}),c.jsxs("p",{className:"m-0",children:[c.jsx("span",{className:"font-semibold",children:"bod_akt:"})," ",P?`${P.file_name} (${P.rows_count} redaka)`:"Nije dostupno"]})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx("p",{className:"m-0 text-sm font-semibold text-[#2f5f3e]",children:"bod_clan.csv"}),c.jsxs("label",{className:`mt-1 flex min-h-[108px] w-full cursor-pointer items-center justify-center rounded-xl border-2 border-dashed px-3 py-3 text-center text-sm transition ${x?"border-[#5f8d72] bg-[#eef7f1] text-[#2f5f3e]":"border-[#cbded2] bg-white text-[#355843] hover:border-[#94b9a3] hover:bg-[#f6fbf8]"} ${u||z?"cursor-not-allowed opacity-80":""}`,onDragEnter:$=>{var ie;u||z||!Array.from(((ie=$.dataTransfer)==null?void 0:ie.types)||[]).includes("Files")||($.preventDefault(),$.stopPropagation(),k(!0))},onDragOver:$=>{var ie;u||z||!Array.from(((ie=$.dataTransfer)==null?void 0:ie.types)||[]).includes("Files")||($.preventDefault(),$.stopPropagation(),$.dataTransfer.dropEffect="copy",k(!0))},onDragLeave:$=>{const J=$.relatedTarget;J&&$.currentTarget.contains(J)||k(!1)},onDrop:$=>{var oe,be;if(u||z||!Array.from(((oe=$.dataTransfer)==null?void 0:oe.types)||[]).includes("Files"))return;$.preventDefault(),$.stopPropagation(),k(!1);const ie=(be=$.dataTransfer.files)==null?void 0:be[0];ie&&Se("bod_clan",ie)},children:[c.jsx("input",{type:"file",className:"hidden",accept:".csv,text/csv",disabled:u||z,onCh
201ange:$=>{var ie;const J=(ie=$.target.files)==null?void 0:ie[0];J&&Se("bod_clan",J),$.currentTarget.value=""}}),c.jsxs("span",{className:"inline-flex items-center gap-2",children:[z&&c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[#5d7f6b] border-t-transparent"}),z?"UÄitavam bod_clan.csv...":"UÄitaj ili povuci bod_clan.csv"]})]}),D&&c.jsxs("p",{className:"m-0 mt-2 text-xs text-[#355843]",children:[D.fileName," (",Fj(D.sizeBytes),")"]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"m-0 text-sm font-semibold text-[#2f5f3e]",children:"bod_akt.csv"}),c.jsxs("label",{className:`mt-1 flex min-h-[108px] w-full cursor-pointer items-center justify-center rounded-xl border-2 border-dashed px-3 py-3 text-center text-sm transition ${N?"border-[#5f8d72] bg-[#eef7f1] text-[#2f5f3e]":"border-[#cbded2] bg-white text-[#355843] hover:border-[#94b9a3] hover:bg-[#f6fbf8]"} ${u||Y?"cursor-not-allowed opacity-80":""}`,onDragEnter:$=>{var ie;u||Y||!Array.from(((ie=$.dataTransfer)==null?void 0:ie.types)||[]).includes("Files")||($.preventDefault(),$.stopPropagation(),C(!0))},onDragOver:$=>{var ie;u||Y||!Array.from(((ie=$.dataTransfer)==null?void 0:ie.types)||[]).includes("Files")||($.preventDefault(),$.stopPropagation(),$.dataTransfer.dropEffect="copy",C(!0))},onDragLeave:$=>{const J=$.relatedTarget;J&&$.currentTarget.contains(J)||C(!1)},onDrop:$=>{var oe,be;if(u||Y||!Array.from(((oe=$.dataTransfer)==null?void 0:oe.types)||[]).includes("Files"))return;$.preventDefault(),$.stopPropagation(),C(!1);const ie=(be=$.dataTransfer.files)==null?void 0:be[0];ie&&Se("bod_akt",ie)},children:[c.jsx("input",{type:"file",className:"hidden",accept:".csv,text/csv",disabled:u||Y,onChange:$=>{var ie;const J=(ie=$.target.files)==null?void 0:ie[0];J&&Se("bod_akt",J),$.currentTarget.value=""}}),c.jsxs("span",{className:"inline-flex items-center gap-2",children:[Y&&c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[#5d7f6b] border-t-transparent"}),Y?"UÄitavam bod_akt.csv...":"UÄitaj ili povuci bod_akt.csv"]})]}),V&&c.jsxs("p",{className:"m-0 mt-2 text-xs text-[#355843]",children:[V.fileName," (",Fj(V.sizeBytes),")"]})]})]}),f&&c.jsx("p",{className:"m-0 rounded-lg border border-[#f0c9c9] bg-[#fff4f4] px-3 py-2 text-sm font-semibold text-[#b42318]",children:f}),m&&c.jsx("p",{className:"m-0 rounded-lg border border-[#cfe8d8] bg-[#f2fbf5] px-3 py-2 text-sm font-semibold text-[#25633d]",children:m})]}),c.jsxs("div",{className:"sticky bottom-0 flex flex-wrap items-center justify-end gap-2 border-t border-[#e3ede7] bg-white/95 px-5 py-4 backdrop-blur",children:[c.jsx("button",{type:"button",className:"admin-btn h-10 border-[#d6e1da] bg-white px-4 text-sm font-semibold text-[#355843] transition hover:bg-[#f5faf7]",onClick:()=>{u||ae||e()},disabled:u||ae,children:"Zatvori"}),c.jsxs("button",{type:"submit",className:"btn-natural btn-natural-primary inline-flex items-center justify-center gap-2 px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-60",disabled:!ke,children:[u&&c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/80 border-t-transparent"}),u?"Importiram...":"Importiraj CSV"]})]})]})]})}function tE({title:t,align:e="center",className:n="",lockTranslation:r=!1}){return c.jsx("h1",{className:`mb-3 max-w-[1180px] break-words text-3xl font-extrabold uppercase leading-tight text-[#2f5f3e] sm:text-[2rem] md:text-[2.2rem] lg:text-[2.25rem] ${e==="left"?"text-left":"mx-auto text-center"} ${r?"notranslate":""} ${n}`.trim(),translate:r?"no":void 0,children:ut(t)})}function fL({message:t="UÄitavam sadržaj stranice..."}){return c.jsx("section",{className:"app-enter py-2",children:c.jsxs("div",{className:"relative overflow-hidden rounded-lg border border-[#c9ddd1] bg-[#f8fcfa] p-6 shadow-[0_16px_36px_-30px_rgba(40,90,62,0.55)] md:p-8",children:[c.jsxs("div",{className:"pointer-events-none absolute inset-0 opacity-60",children:[c.jsx("div",{className:"absolute -left-24 top-0 h-full w-40 -skew-x-12 animate-pulse bg-[#dceee3]/60"}),c.jsx("div",{className:"absolute left-1/3 top-0 h-full w-28 -skew-x-12 animate-pulse bg-[#e8f4ee]/70 [animation-delay:220ms]"}),c.jsx("div",{className:"absolute right-10 top-0 h-full w-24 -skew-x-12 animate-pulse bg-[#d8ecdf]/55 [animation-delay:420ms]"})]}),c.jsxs("div",{className:"relative",children:[c.jsxs("div",{className:"inline-flex items-center gap-3 rounded-lg border border-[#c4dacd] bg-white/85 px-4 py-2 text-[#2f5f3e] shadow-sm",children:[c.jsx("span",{className:"h-5 w-5 animate-spin rounded-full border-2 border-[#2f5f3e]/30 border-t-[#2f5f3e]"}),c.jsx("span",{className:"text-sm font-semibold",children:t})]}),c.jsx("div",{className:"mt-5 grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:Array.from({length:3}).map((e,n)=>c.jsxs("div",{className:"rounded-lg border border-[#d2e4da] bg-white/90 p-4 shadow-[0_8px_20px_-16px_rgba(37,88,58,0.6)]",children:[c.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-[#dfede4]"}),c.jsx("div",{className:"mt-3 h-3 w-5/6 animate-pulse rounded bg-[#e8f3ed]"}),c.jsx("div",{className:"mt-2 h-3 w-4/6 animate-pulse rounded bg-[#e8f3ed]"}),c.jsx("div",{className:"mt-5 h-9 w-28 animate-pulse rounded-full bg-[#d8ecdf]"})]},`page-loader-card-${n}`))})]})]})})}function Eg(t){return{imageFileName:String(t.imageFileName||"").trim(),title:String(t.title||"").trim(),kicker:String(t.kicker||"").trim(),alt:String(t.alt||"").trim()}}function pL(t,e){return t.imageFileName===e.imageFileName&&t.title===e.title&&t.kicker===e.kicker&&t.alt===e.alt}function mL({open:t,imageFileName:e,title:n,kicker:r,alt:i,saving:s=!1,errorMessage:o="",onImageSelect:a,onResetImageToDefault:l,onTitleChange:u,onKickerChange:d,onAltChange:f,onClose:p,onSave:m}){const[g,y]=h.useState(!1),[j,x]=h.useState(()=>Eg({imageFileName:"",title:"",kicker:"",alt:""})),k=h.useRef(null),N=h.useMemo(()=>Eg({imageFileName:e,title:n,kicker:r,alt:i}),[i,e,r,n]),C=h.useMemo(()=>!pL(j,N),[N,j]),w=h.useCallback(()=>
201{if(!s){if(!C){p();return}y(!0)}},[C,p,s]);return h.useEffect(()=>{t&&(x(Eg({imageFileName:e,title:n,kicker:r,alt:i})),y(!1))},[i,e,r,t,n]),c.jsxs(c.Fragment,{children:[c.jsxs(Ju,{open:t,onRequestClose:w,closeOnOverlayClick:!1,disableClose:s,closeConfirmOpen:g,initialFocusRef:k,labelledBy:"hero-editor-title",describedBy:"hero-editor-description",zIndexClassName:"z-[500]",rootClassName:"flex items-start justify-center overflow-y-auto p-3 md:items-center md:p-6",overlayClassName:"bg-black/60 backdrop-blur-[2px]",panelClassName:"my-3 flex w-full max-w-[720px] max-h-[calc(100dvh-1.5rem)] flex-col overflow-hidden rounded-2xl border border-white/20 bg-white shadow-[0_24px_64px_rgba(0,0,0,0.35)] md:my-0 md:max-h-[calc(100dvh-3rem)]",children:[c.jsx("p",{id:"hero-editor-description",className:"sr-only",children:"Uredi naslov, dodatni tekst i sliku hero sekcije."}),c.jsxs("div",{className:"flex items-center justify-between border-b border-[#e1ece6] px-4 py-3 md:px-6 md:py-4",children:[c.jsx("h3",{id:"hero-editor-title",className:"m-0 text-base font-bold text-[#244e33]",children:"Uredi hero"}),c.jsx("button",{ref:k,className:"bg-transparent text-3xl font-black leading-none text-[#244e33] transition-colors hover:text-[#b42318] disabled:cursor-not-allowed disabled:opacity-55",type:"button",onClick:w,"aria-label":"Zatvori hero editor",disabled:s,children:"Ã"})]}),c.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto p-4 md:p-6",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm font-semibold text-[#2f5f3e]",children:"Slika"}),c.jsxs("label",{className:"flex h-11 cursor-pointer items-center rounded-lg border border-[#c7d9cf] bg-white px-3 text-sm text-[#244e33] outline-none transition hover:border-[#9bbca9] disabled:cursor-not-allowed disabled:opacity-55",children:[c.jsx("input",{type:"file",accept:"image/*",className:"hidden",disabled:s,onChange:E=>{var V;const D=(V=E.target.files)==null?void 0:V[0];if(!D)return;const L=new FileReader;L.onload=()=>{const te=typeof L.result=="string"?L.result:"";a(te,D.name)},L.readAsDataURL(D)}}),"Odaberi sliku s raÄunala"]}),c.jsx("input",{value:e,readOnly:!0,placeholder:"Naziv odabrane datoteke",className:"h-11 rounded-lg border border-[#c7d9cf] bg-white px-3 text-sm text-[#244e33] outline-none"}),c.jsx("input",{value:i,onChange:E=>f(E.target.value),placeholder:"Alt tekst (opcionalno)",className:"h-11 rounded-lg border border-[#c7d9cf] bg-white px-3 text-sm text-[#244e33] outline-none focus:border-[#3f7a4f]",disabled:s})]}),c.jsxs("label",{className:"block text-sm font-semibold text-[#2f5f3e]",children:["Naslov",c.jsx("input",{type:"text",value:n,onChange:E=>u(E.target.value),className:"mt-2 w-full rounded-md border border-[#d0ddd8] px-3 py-2 text-sm text-[#1f3f2b]",disabled:s})]}),c.jsxs("label",{className:"block text-sm font-semibold text-[#2f5f3e]",children:["Dodatni tekst u hero sekciji (opcionalno)",c.jsx("input",{type:"text",value:r,onChange:E=>d(E.target.value),className:"mt-2 w-full rounded-md border border-[#d0ddd8] px-3 py-2 text-sm text-[#1f3f2b]",disabled:s})]}),s&&c.jsxs("p",{className:"m-0 flex items-center gap-2 text-sm font-semibold text-[#355843]","aria-live":"polite",children:[c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[#5f8d72] border-t-transparent"}),"Spremam promjene..."]}),o&&c.jsx("p",{className:"m-0 rounded-md border border-[#f0c9c9] bg-[#fff4f4] px-3 py-2 text-sm font-semibold text-[#b42318]","aria-live":"polite",children:o})]}),c.jsxs("div",{className:"sticky bottom-0 mt-auto flex flex-wrap items-center justify-between gap-2 border-t border-[#e1ece6] bg-white/95 px-4 py-3 backdrop-blur md:px-6 md:py-4",children:[c.jsx("button",{type:"button",className:"rounded-full border-2 border-[#cbdcd3] bg-white px-4 py-2 text-sm font-semibold text-[#2f5f3e] transition hover:border-[#9bbca9] hover:bg-[#f6fbf8] disabled:cursor-not-allowed disabled:opacity-55",onClick:l,disabled:s,children:"Vrati defaultnu sliku"}),c.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[c.jsx("button",{type:"button",className:"rounded-full border-2 border-[#cbdcd3] bg-white px-4 py-2 text-sm font-semibold text-[#2f5f3e] disabled:cursor-not-allowed disabled:opacity-55",onClick:w,disabled:s,children:"Odustani"}),c.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 rounded-full border-2 border-[#2f8f4b] bg-[#2f8f4b] px-4 py-2 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-
201px hover:border-[#8ccb9d] hover:bg-[#dff7e5] hover:text-[#1f5a31] disabled:cursor-not-allowed disabled:opacity-55",onClick:m,disabled:s,children:[s&&c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/80 border-t-transparent"}),s?"Spremam...":"Spremi"]})]})]})]}),c.jsx(vr,{open:g,title:"Zatvoriti bez spremanja?",description:"Unesene promjene hero sekcije neÄe biti spremljene.",confirmLabel:"Zatvori bez spremanja",cancelLabel:"Nastavi ureÄivanje",onConfirm:()=>{y(!1),p()},onCancel:()=>y(!1)})]})}function Cl({message:t}){return c.jsxs("section",{className:"mx-auto w-full max-w-[1320px] overflow-hidden rounded-lg border border-[#b7d4c3] bg-[#f3faf6] shadow-[0_10px_24px_rgba(39,95,63,0.08)]",children:[c.jsx("div",{className:"border-b border-[#cfe3d8] bg-[#dcece3] px-4 py-2.5 md:px-5",children:c.jsx("p",{className:"text-sm font-bold uppercase text-[#2f5f3e]",children:"Status podataka"})}),c.jsxs("div",{className:"flex items-start gap-3 px-4 py-4 md:px-5 md:py-5",children:[c.jsx("span",{className:"mt-0.5 inline-flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full bg-[#376d44] text-sm font-bold text-white",children:"i"}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"text-base font-semibold leading-tight text-[#244e33] md:text-lg",children:"Podaci trenutno nisu dostupni"}),c.jsx("p",{className:"text-base leading-7 text-[#31563d]",children:ut(t)})]})]})]})}function Uj(t){return String(t).padStart(2,"0")}function Tg(t,e,n){const r=new Date(n,e-1,t);return Number.isNaN(r.getTime())?"":`${r.toLocaleDateString("hr-HR",{weekday:"long"})}, ${Uj(t)}.${Uj(e)}.${n}.`}function hL(t){const e=String(t||"").trim();if(!e)return"";const n=e.replace(/^objavljeno:\s*/i,"").trim(),r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(r){const o=Number(r[1]),a=Number(r[2]),l=Number(r[3]);return Tg(l,a,o)||n}const i=/^(\d{1,2})\s*[.\-/]\s*(\d{1,2})\s*[.\-/]\s*(\d{4})\.?$/.exec(n);if(i){const o=Number(i[1]),a=Number(i[2]),l=Number(i[3]);return Tg(o,a,l)||n}const s=new Date(n);return Number.isNaN(s.getTime())?n:Tg(s.getDate(),s.getMonth()+1,s.getFullYear())||n}function Sx(t){const e=hL(t);return e?`Objavljeno: ${e}`:""}function gL({item:t,onOpenNews:e,isAdmin:n=!1,onEditNews:r,onDeleteNews:i,onMoveNews:s,canMoveUp:o=!1,canMoveDown:a=!1,onArchiveNews:l}){const u=ui(Br)||Br,d=ui((t.image||Br).trim())||u,[f,p]=h.useState(d),m=Sx(t.date);return h.useEffect(()=>{p(d)},[d]),c.jsxs("article",{className:"app-card app-enter relative mx-auto flex h-full w-[88%] max-w-[520px] flex-col rounded-md p-3 text-left sm:p-4",children:[c.jsx("div",{className:"overflow-hidden rounded-md border border-[#d9e6de] bg-[#f8fbf9]",style:{aspectRatio:"16 / 8"},children:c.jsx("img",{src:f,alt:ut(t.title),loading:"lazy",decoding:"async",onError:()=>{f!==u&&p(u)},className:"h-full w-full bg-white object-contain p-2 md:p-3"})}),c.jsx("h2",{className:"mb-0 mt-3 break-words text-lg font-semibold leading-tight text-[#2f5f3e] [overflow-wrap:anywhere] md:text-xl",children:ut(t.title)}),c.jsx("p",{className:"mb-0 mt-3 text-sm text-[#4c4c4c]",children:m||t.date}),c.jsx("p",{className:"mb-0 mt-2 break-words text-sm leading-6 text-[#2f5f3e] [overflow-wrap:anywhere] md:text-base",children:ut(t.summary)}),c.jsxs("div",{className:"mt-auto flex flex-col gap-3 pt-5 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",children:[c.jsx("div",{className:"flex flex-wrap items-center justify-start gap-2",children:n&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"btn-natural btn-natural-dark px-3 py-1.5 text-xs font-extrabold uppercase",onClick:()=>r==null?void 0:r(t.id),children:"Uredi"}),c.jsx("button",{type:"button",className:"btn-natural btn-natural-danger px-3 py-1.5 text-xs font-extrabold uppercase",onClick:()=>i==null?void 0:i(t.id),children:"ObriÅ¡i"}),c.jsx("button",{type:"button",disabled:!o,className:"btn-natural border border-[#3f4f46] bg-transparent px-3 py-1.5 text-xs font-extrabold uppercase text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35] disabled:cursor-not-allowed disabled:opacity-45",onClick:()=>s==null?void 0:s(t.id,"up"),children:"Gore"}),c.jsx("button",{type:"button",disabled:!a,className:"btn-natural border border-[#3f4f46] bg-transparent px-3 py-1.5 text-xs font-extrabold uppercase text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35] disabled:cursor-not-allowed disabled:opacity-45",onClick:()=>s==null?void 0:s(t.id,"down"),children:"Dolje"}),c.jsx("button",{type:"button",className:"btn-natural border border-[#3f4f46] bg-transparent px-3 py-1.5 text-xs font-extrabold uppercase text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35]",onClick:()=>l==null?void 0:l(t.id),children:"Arhiviraj"})]})}),c.jsx("button",{className:"btn-natural btn-natural-primary w-full px-4 py-2 text-sm font-semibold sm:w-auto",onClick:()=>e(t.id),children:"VIÅ E"})]})]})}function nE(t){const e=String(t||"").trim();if(!e)return"";const n=e.split("#")[0].split("?")[0].replace(/\\/g,"/").trim();if(!n)return"";try{return new URL(n,"https://hkisdt.hr").pathname.replace(/\/{2,}/g,"/").toLowerCase()}catch{return n.replace(/\/{2,}/g,"/").toLowerCase()}}const bL=nE(Br),Nx=String.raw`(?:https?:\/\/[^\s<>'"[\]{}]+|\/?(?:cdn|podaci|dokumenti|api\/web\/dokumenti|web\/dokumenti)\/[^\s<>'"[\]{}]+)`,xL=new RegExp(String.raw`\bLink(?:ovi)?\s*:\s*(?:${Nx}(?:\s*,\s*${Nx})*)\.?`,"gi"),vL=new RegExp(Nx,"gi");function Hj(t){const e=nE(t);return e?e!==bL:!1}function yL(t){return String(t??"").replace(/\u00A0/g," ").replace(/\r\n/g,` 202`).replace(/\r/g,` 203`).replace(/[ \t]+/g," ").trim()}function Vj(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>typeof e=="string"?e:String((e==null?void 0:e.text)||"")).join(" "):""}function Ag(t){let e=String(t||"");return e?(e=e.replace(xL," "),e=e.replace(vL," "),e=e.replace(/\s+\./g,"."),e=e.replace(/\s+,/g,","),e=e.replace(/\(\s+\)/g,""),e=e.replace(/[ \t]{2,}/g," "),yL(e)):""}function kL(t,e){const n=[];if(Array.isArray(e)&&e.length>0)for(const s of e){if(s.type==="paragraph"){const o=Ag(Vj(s.text));o&&n.push(o)}else if(s.type==="list")for(const o of s.items){const a=Ag(Vj(o));if(a&&n.push(a),n.length>=4)break}if(n.length>=4)break}const i=(t.body.length?t.body:[t.summary]).map(s=>
203Ag(s)).filter(Boolean);return(n.length>0?n:i).slice(0,4)}function jL(t,e){if(Array.isArray(e)&&e.length>0){const r=e.filter(i=>!(i.type==="publishedDate"||i.type==="heading"&&i.level==="article"||i.type==="image"));if(r.length>0)return r}return kL(t,e).map((r,i)=>({id:`archive-preview-${t.id}-p-${i}`,type:"paragraph",text:r}))}function Kj(t){if(!t)return;const e=String(t.createdBy||"").trim()||null,n=String(t.createdAt||"").trim()||null,r=String(t.updatedBy||"").trim()||null,i=String(t.updatedAt||"").trim()||null;if(!(!e&&!r))return{createdBy:e,createdAt:n,updatedBy:r||e,updatedAt:i||n}}const Jp="bez-datuma",wL=["sijeÄanj","veljaÄa","ožujak","travanj","svibanj","lipanj","srpanj","kolovoz","rujan","listopad","studeni","prosinac"];function rE(t){return String(t).padStart(2,"0")}function Mg(t,e,n){if(!Number.isFinite(t)||!Number.isFinite(e)||!Number.isFinite(n)||t<1900||e<1||e>12||n<1||n>31)return null;const r=new Date(t,e-1,n);return Number.isNaN(r.getTime())||r.getFullYear()!==t||r.getMonth()!==e-1||r.getDate()!==n?null:{year:t,month:e,day:n,time:r.getTime()}}function iE(t){const e=String(t||"").replace(/^objavljeno:\s*/i,"").trim();if(!e)return null;const n=e.match(/(\d{4})-(\d{2})-(\d{2})/);if(n)return Mg(Number(n[1]),Number(n[2]),Number(n[3]));const r=e.match(/(\d{1,2})\s*[.\-/]\s*(\d{1,2})\s*[.\-/]\s*(\d{4})\.?/);if(r)return Mg(Number(r[3]),Number(r[2]),Number(r[1]));const i=new Date(e);return Number.isNaN(i.getTime())?null:Mg(i.getFullYear(),i.getMonth()+1,i.getDate())}function Wj(t){const e=iE(t.date);return e?{yearKey:String(e.year),monthKey:`${e.year}-${rE(e.month)}`}:{yearKey:Jp,monthKey:Jp}}function SL(t){const e=new Map,n=new Map;t.forEach(i=>{const s=iE(i.date),o=s?String(s.year):Jp,a=s?`${s.year}-${rE(s.month)}`:Jp,l=s?String(s.year):"Bez datuma",u=s?wL[s.month-1]:"Bez datuma",d=s?s.year:Number.NEGATIVE_INFINITY,f=s?s.month:Number.NEGATIVE_INFINITY;let p=e.get(o);p||(p={key:o,label:l,count:0,yearSort:d,months:[]},e.set(o,p));let m=p.months.find(g=>g.key===a);m||(m={key:a,label:u,count:0,monthSort:f,items:[]},p.months.push(m)),p.count+=1,m.count+=1,m.items.push(i),n.set(i.id,(s==null?void 0:s.time)??0)});const r=Array.from(e.values()).sort((i,s)=>s.yearSort-i.yearSort||s.label.localeCompare(i.label,"hr"));return r.forEach(i=>{i.months.sort((s,o)=>o.monthSort-s.monthSort||o.label.localeCompare(s.label,"hr")),i.months.forEach(s=>{s.items.sort((o,a)=>(n.get(a.id)??0)-(n.get(o.id)??0)||a.id-o.id)})}),r}function NL({sectionTitle:t="Vijesti",selectedNews:e,selectedNewsBlocks:n,visibleNews:r,archivedNews:i,archivedNewsBlocksById:s={},hasMoreNews:o,onOpenNews:a,onLoadMore:l,onBackToList:u,isAdmin:d=!1,onEditNews:f,onDeleteNews:p,onMoveNews:m,onReorderNews:g,onArchiveNews:y,onUnarchiveNews:j,onAddNews:x,onEnsureNewsDetailLoaded:k,archiveOpenRequestId:N=0,archiveOpenTargetNewsId:C=null,hasRouteArticleContent:w=!1}){const[E,D]=h.useState(null),[L,V]=h.useState(null),[te,ae]=h.useState(!1),[ke,ge]=h.useState(null),[Se,me]=h.useState(null),[H,P]=h.useState(null),[z,Y]=h.useState(null),[Q,O]=h.useState(null),[U,$]=h.useState(!1),J=h.useRef(null);J.current||(J.current=Ll());const ie=h.useMemo(()=>SL(i),[i]),oe=ie.find(S=>S.key===Se)??ie[0]??null,be=(oe==null?void 0:oe.months.find(S=>S.key===H))??null,Ee=h.useMemo(()=>oe?be?be.items:oe.months.flatMap(S=>S.items):[],[be,oe]),le=oe?be?`${be.label} ${oe.label}`:oe.label:"Arhiva",Me=S=>(e==null?void 0:e.id)===S?e:r.find(I=>I.id===S)??i.find(I=>I.id===S)??null,_=E?Me(E):null,ce=L?Me(L):null,de=ke?i.find(S=>S.id===ke)??null:null,De=de?s[de.id]??null:null,Oe=de?jL(de,De):[],He=Kj(de),ot=ui(String((de==null?void 0:de.image)||"").trim()),Ge=de?Hj(ot):!1;function Te(S){const I=Wj(S);me(I.yearKey),P(I.monthKey),ge(S.id)}function Ke(S){var I;me(S.key),P(null),ge(((I=S.months.flatMap(K=>K.items)[0])==null?void 0:I.id)??null)}function Ne(S){var I;P(S.key),ge(((I=S.items[0])==null?void 0:I.id)??null)}function _e(){var S;oe&&(P(null),ge(((S=oe.months.flatMap(I=>I.items)[0])==null?void 0:S.id)??null))}const We=S=>{var G;ae(!0);const I=S?i.find(re=>re.id===S)??null:null;if(I){Te(I);return}const K=ke?i.find(re=>re.id===ke)??null:null;if(K){const re=Wj(K);me(re.yearKey),P(re.monthKey),ge(K.id);return}const X=ie[0]??null;me((X==null?void 0:X.key)??null),P(null),ge(((G=X==null?void 0:X.months.flatMap(re=>re.items)[0])==null?void 0:G.id)??null)};h.useEffect(()=>{if(!te)return;const S=Dl(),I=K=>{K.key==="Escape"&&ae(!1)};return window.addEventListener("keydown",I),()=>{S(),window.removeEventListener("keydown",I)}},[te]),h.useEffect(()=>{te||ge(null)},[te]),h.useEffect(()=>{if(te){if(!ie.length){me(null),P(null);return}oe&&Se&&oe.key!==Se&&(me(oe.key),P(null)),H&&!be&&P(null)}},[te,ie,be,H,oe,Se]),h.useEffect(()=>{if(te){if(!Ee.length){ke!==null&&ge(null);return}ke&&Ee.some(S=>S.id===ke)||ge(Ee[0].id)}},[te,ke,Ee]),h.useEffect(()=>{te&&ke&&k&&k(ke)},[te,ke,k]),h.useEffect(()=>{N&&We(C)},[N,C]),h.useEffect(()=>()=>{var S;(S=J.current)==null||S.stop()},[]);function tt(){var S;Y(null),O(null),(S=J.current)==null||S.stop()}function at(S,I){!d||!g||U||(Y(S),I.dataTransfer.effectAllowed="move",I.dataTransfer.setData("text/plain",String(S)))}function Ut(S,I){var G;
203if(!d||!g||U)return;(G=J.current)==null||G.update(I.clientY);const K=I.dataTransfer.getData("text/plain"),X=Number(K||z||0);!X||X===S||(I.preventDefault(),I.dataTransfer.dropEffect="move",O(S))}async function vt(S,I){if(!d||!g||U)return;I.preventDefault();const K=I.dataTransfer.getData("text/plain"),X=Number(K||z||0);if(!X||X===S){tt();return}$(!0);try{await Promise.resolve(g(X,S))}finally{$(!1),tt()}}const b=e?(()=>{const S=[{id:`news-${e.id}-date`,type:"publishedDate",date:e.date},{id:`news-${e.id}-title`,type:"heading",level:"article",text:e.title},...e.body.map((I,K)=>({id:`news-${e.id}-p-${K}`,type:"paragraph",text:I}))];return Hj(e.image)&&S.push({id:`news-${e.id}-img-1`,type:"image",src:e.image,alt:e.title}),S})():[],T=Kj(e);return c.jsxs("section",{children:[!e&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative mb-5 mt-6 md:mt-7",children:[c.jsx(tE,{title:t,className:"mb-0 mt-0",align:"center"}),d&&c.jsx("div",{className:"mt-3 flex items-center justify-center gap-2 md:absolute md:right-0 md:top-1/2 md:mt-0 md:-translate-y-1/2",children:c.jsx("button",{type:"button",className:"btn-natural btn-natural-primary px-4 py-2 text-sm font-semibold hover:-translate-y-[2px]",onClick:x,children:"Dodaj Älanak"})})]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 sm:gap-5 md:gap-6 lg:grid-cols-3 xl:grid-cols-4 [&>*]:h-full",children:r.map((S,I)=>c.jsx("div",{id:Fn({kind:"news",itemId:S.id}),className:`flex h-full flex-col gap-3 rounded-lg transition ${z===S.id?"opacity-60":""} ${Q===S.id&&z!==S.id?"ring-2 ring-[#4f8a63]/35 ring-offset-2 ring-offset-[#f5f9f6]":""}`,draggable:d&&!!g&&!U,onDragStart:K=>at(S.id,K),onDragOver:K=>Ut(S.id,K),onDrop:K=>{vt(S.id,K)},onDragEnd:tt,children:c.jsx(gL,{item:S,onOpenNews:a,isAdmin:d,onEditNews:f,onDeleteNews:()=>D(S.id),onMoveNews:m,canMoveUp:I>0,canMoveDown:I<r.length-1||o,onArchiveNews:()=>V(S.id)})},S.id))}),r.length===0&&!w&&c.jsx("div",{className:"mt-4",children:c.jsx(Cl,{message:"Sadržaj za ovu kategoriju trenutno nije dostupan."})}),o&&c.jsx("div",{className:"mt-6 flex justify-center",children:c.jsx("button",{className:"btn-natural btn-natural-primary w-full px-4 py-2 text-sm font-semibold sm:w-auto",onClick:l,children:"UÄitaj viÅ¡e"})})]}),e&&c.jsxs("article",{children:[c.jsxs("div",{className:"mx-auto mb-3 flex w-full max-w-[1320px] flex-col gap-2 px-1 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between sm:px-2 md:px-4",children:[c.jsx("button",{className:"btn-natural btn-natural-primary inline-flex w-full items-center justify-center gap-2 px-4 py-2 text-sm font-semibold sm:w-auto",onClick:u,children:"Natrag na vijesti"}),d&&c.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 sm:w-auto",children:[c.jsx("button",{type:"button",className:"btn-natural border border-[#cfdad4] bg-white px-4 py-2 text-sm font-semibold text-[#2d5a44] hover:border-[#8bbda0] hover:bg-[#edf7ef] sm:w-auto",onClick:()=>V(e.id),children:"Arhiviraj Älanak"}),c.jsx("button",{type:"button",className:"btn-natural btn-natural-danger px-4 py-2 text-sm font-semibold sm:w-auto",onClick:()=>D(e.id),children:"ObriÅ¡i Älanak"})]})]}),c.jsx("div",{className:"text-left",children:c.jsx(In,{blocks:Array.isArray(n)&&n.length>0?n:b,audit:d?T:void 0})})]}),c.jsx(vr,{open:d&&!!_,title:"Obrisati vijest?",description:_?`Vijest "${ut(_.title)}" bit Äe trajno uklonjena s kartica i iz detaljnog prikaza.`:"Odabrana vijest bit Äe trajno uklonjena.",confirmLabel:"ObriÅ¡i vijest",cancelLabel:"Odustani",onCancel:()=>D(null),onConfirm:()=>{_&&(p==null||p(_.id),D(null))}}),c.jsx(vr,{open:d&&!!ce,title:"Arhivirati vijest?",description:ce?`Vijest "${ut(ce.title)}" Äe biti maknuta iz javnog prikaza i prebaÄena u arhivu.`:"Odabrana vijest Äe biti prebaÄena u arhivu.",confirmLabel:"Arhiviraj vijest",cancelLabel:"Odustani",onCancel:()=>V(null),onConfirm:()=>{ce&&(y==null||y(ce.id),V(null))}}),te&&go.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[360] flex items-start justify-center p-2 sm:p-3 md:items-center md:p-4",children:[c.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top,rgba(24,38,30,0.45),rgba(10,16,12,0.82))] backdrop-blur-[2px]",onClick:()=>ae(!1)}),c.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"archive-news-title",className:"relative z-[1] my-2 flex w-full max-w-[1120px] max-h-[calc(100dvh-1rem)] flex-col overflow-hidden rounded-lg border border-[#d7e4dd] bg-[#fdfefd] shadow-[0_28px_80px_rgba(9,24,16,0.45)] sm:max-h-[calc(100dvh-1.5rem)] md:my-0 md:max-h-[calc(100dvh-2rem)]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-[#dde9e2] bg-[linear-gradient(180deg,#ffffff_0%,#f3f8f5_100%)] px-4 py-3 sm:px-5 sm:py-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"m-0 text-[11px] font-semibold uppercase text-[#5a7f67]",children:"Upravljanje vijestima"}),c.jsx("h3",{id:"archive-news-title",className:"m-0 mt-1 text-lg font-black leading-tight text-[#1f5131]",children:"Arhiva vijesti"}),c.jsxs("div",{className:"mt-2 hidden flex-wrap items-center gap-2 sm:flex",children:[c.jsxs("span",{className:"rounded-full border border-[#cbe0d3] bg-white px-2.5 py-1 text-[11px] font-semibold text-[#2f6a49]",children:[i.length," arhiviranih"]}
203),c.jsx("span",{className:"text-xs text-[#5f7267]",children:"Odaberi Älanak lijevo za brzi pregled desno."})]})]}),c.jsx("button",{type:"button","aria-label":"Zatvori arhivu",className:"grid h-10 w-10 place-items-center rounded-lg border border-[#cad9d1] bg-white text-lg font-bold leading-none text-[#365a46] shadow-sm transition hover:bg-[#f1f7f3]",onClick:()=>ae(!1),children:"X"})]}),c.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-hidden p-3 sm:gap-4 sm:p-4 md:p-5 lg:grid-cols-[minmax(0,0.95fr)_minmax(0,1.05fr)]",children:[c.jsxs("aside",{className:"flex h-full min-h-0 flex-col rounded-lg border border-[#dce7e0] bg-white/80 p-3",children:[c.jsx("p",{className:"m-0 text-sm text-[#4a5d52]",children:"Arhivirane vijesti nisu na glavnoj listi, dostupne su u arhivi."}),ie.length>0&&c.jsxs("div",{className:"mt-3 grid gap-3 border-y border-[#e5eee8] py-3 sm:grid-cols-2",children:[c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"block text-[11px] font-semibold uppercase text-[#5a7f67]",children:"Godina"}),c.jsx("select",{className:"mt-1.5 w-full rounded-lg border border-[#cfe0d6] bg-white px-3 py-2 text-sm font-bold text-[#245d3b] shadow-sm outline-none transition focus:border-[#75a889] focus:ring-2 focus:ring-[#dcefe4]",value:(oe==null?void 0:oe.key)??"",onChange:S=>{const I=ie.find(K=>K.key===S.target.value);I&&Ke(I)},children:ie.map(S=>c.jsxs("option",{value:S.key,children:[S.label," (",S.count,")"]},`archive-year-option-${S.key}`))})]}),c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"block text-[11px] font-semibold uppercase text-[#5a7f67]",children:"Mjesec"}),c.jsxs("select",{className:"mt-1.5 w-full rounded-lg border border-[#cfe0d6] bg-white px-3 py-2 text-sm font-bold text-[#245d3b] shadow-sm outline-none transition focus:border-[#75a889] focus:ring-2 focus:ring-[#dcefe4]",value:(be==null?void 0:be.key)??"all",disabled:!oe,onChange:S=>{if(S.target.value==="all"){_e();return}const I=oe==null?void 0:oe.months.find(K=>K.key===S.target.value);I&&Ne(I)},children:[oe&&c.jsxs("option",{value:"all",children:["Svi mjeseci (",oe.count,")"]}),oe==null?void 0:oe.months.map(S=>c.jsxs("option",{value:S.key,children:[S.label," (",S.count,")"]},`archive-month-option-${S.key}`))]})]})]}),ie.length>0&&c.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[c.jsx("p",{className:"m-0 text-sm font-bold text-[#2f5f3e]",children:le}),c.jsx("span",{className:"shrink-0 rounded-full border border-[#d7e5dd] bg-white px-2.5 py-1 text-[11px] font-semibold text-[#557162]",children:Ee.length})]}),c.jsx("div",{className:"mt-3 min-h-0 flex-1 space-y-2 overflow-y-auto pr-1",children:i.length===0?c.jsx("div",{className:"rounded-lg border border-[#e1ebe5] bg-[#f8fbf9] px-4 py-3 text-sm text-[#66796e]",children:"Trenutno nema arhiviranih vijesti."}):Ee.map(S=>c.jsxs("div",{className:`rounded-lg border p-3 transition ${ke===S.id?"border-[#8bbda0] bg-[#ecf7f0] shadow-[0_8px_18px_rgba(22,66,40,0.08)]":"border-[#e3ece6] bg-white hover:border-[#bdd4c6] hover:bg-[#f8fcf9]"}`,role:"button",tabIndex:0,onClick:()=>ge(S.id),onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),ge(S.id))},children:[c.jsx("p",{className:"m-0 text-sm font-semibold leading-snug text-[#2f5f3e]",children:ut(S.title)}),c.jsx("p",{className:"m-0 mt-1 text-xs text-[#6d7e74]",children:Sx(S.date)||S.date}),d&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-end gap-2",children:[c.jsx("button",{type:"button",className:"btn-natural btn-natural-primary px-3 py-1.5 text-xs font-semibold",onClick:I=>{I.stopPropagation(),j==null||j(S.id)},children:"Odarhiviraj"}),c.jsx("button",{type:"button",className:"btn-natural btn-natural-danger px-3 py-1.5 text-xs font-semibold",onClick:I=>{I.stopPropagation(),D(S.id)},children:"Trajno obriÅ¡i"})]})]},`archived-modal-${S.id}`))})]}),c.jsx("article",{className:"h-full min-h-0 overflow-y-auto rounded-lg border border-[#dce7e0] bg-white p-3 sm:p-4 md:p-5",children:de?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"m-0 inline-flex rounded-full border border-[#d7e6dc] bg-[#f4faf6] px-2.5 py-1 text-[11px] font-semibold uppercase text-[#4f7a62]",children:"Pregled arhiviranog Älanka"}),c.jsx("h4",{className:"m-0 mt-3 text-xl font-bold leading-tight text-[#1f5131] md:text-2xl",children:ut(de.title)}),c.jsx("p",{className:"m-0 mt-1 text-sm text-[#6d7e74]",children:Sx(de.date)||de.date}),Ge&&c.jsx("img",{src:ot,alt:ut(de.title),loading:"lazy",decoding:"async",className:"mt-4 h-[170px] w-full rounded-lg border border-[#d9e6de] bg-[#f8fbf9] object-contain p-2 sm:h-[190px] md:h-[220px] md:p-3"}),c.jsx("div",{className:"mt-4",children:c.jsx(In,{blocks:Oe,audit:d?He:void 0})}),d&&c.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-2 border-t border-[#e8efeb] pt-4",children:[c.jsx("button",{type:"button",className:"btn-natural btn-natural-primary px-4 py-2 text-sm font-semibold",onClick:()=>j==null?void 0:j(de.id),children:"Odarhiviraj ovaj Älanak"}),c.jsx("button",{type:"button",className:"btn-natural btn-natural-danger px-4 py-2 text-sm font-semibold",onClick:()=>D(de.id),children:"Trajno obriÅ¡i ovaj Älanak"})]})]}):c.jsx("div",{className:"rounded-lg border border-dashed border-[#cfddd5] bg-[#fbfdfc] px-4 py-6 text-sm text-[#6a7d72]",children:"Odaberi arhivirani Älanak za pregled."})})]})]})]}),document.body)]})}function sE(t,e){const r=t.replace(/\s+/g," ").trim().split(" ").filter(
203Boolean).slice(0,e).join(" ");return r?`${r}...`:"..."}function CL(t){if(!t)return;const e=String(t.createdBy||"").trim()||null,n=String(t.createdAt||"").trim()||null,r=String(t.updatedBy||"").trim()||null,i=String(t.updatedAt||"").trim()||null;if(!(!e&&!r))return{createdBy:e,createdAt:n,updatedBy:r||e,updatedAt:i||n}}function EL({items:t,detailBlocksById:e={},pageSize:n,defaultCardImage:r,isAdmin:i=!1,onEditProject:s,onDeleteProject:o,onArchiveProject:a,onReorderProject:l,hasRouteArticleContent:u=!1,searchTargetId:d=null,selectedProjectId:f,onSelectProject:p,visibleProjectsCount:m,hasMoreProjects:g=!1,onVisibleProjectsCountChange:y}){const[j,x]=h.useState(Math.max(4,n)),[k,N]=h.useState(null),[C,w]=h.useState(null),[E,D]=h.useState(null),[L,V]=h.useState(null),[te,ae]=h.useState(null),[ke,ge]=h.useState(!1),Se=h.useRef(null);Se.current||(Se.current=Ll());const me=Number.isFinite(m)?Number(m):j,H=f!==void 0?f:k,P=p??N,z=le=>{const Me=typeof le=="function"?le(me):le,_=Number.isFinite(Me)?Math.max(0,Math.floor(Me)):me;if(y){y(_);return}x(_)},Y=h.useMemo(()=>t.slice(0,me),[t,me]),Q=me<t.length||g,O=h.useMemo(()=>t.find(le=>le.id===H)??null,[t,H]),U=h.useMemo(()=>t.find(le=>le.id===C)??null,[t,C]),$=h.useMemo(()=>t.find(le=>le.id===E)??null,[t,E]),J=h.useMemo(()=>O?e[O.id]??null:null,[e,O]);h.useEffect(()=>{if(!d)return;const le=t.findIndex(Me=>Fn({kind:"project",itemId:Me.id})===d);le<0||z(Me=>Math.max(Me,le+1))},[t,d]),h.useEffect(()=>()=>{var le;(le=Se.current)==null||le.stop()},[]);function ie(){var le;V(null),ae(null),(le=Se.current)==null||le.stop()}function oe(le,Me){!i||!l||ke||(V(le),Me.dataTransfer.effectAllowed="move",Me.dataTransfer.setData("text/plain",String(le)))}function be(le,Me){var de;if(!i||!l||ke)return;(de=Se.current)==null||de.update(Me.clientY);const _=Me.dataTransfer.getData("text/plain"),ce=Number(_||L||0);!ce||ce===le||(Me.preventDefault(),Me.dataTransfer.dropEffect="move",ae(le))}async function Ee(le,Me){if(!i||!l||ke)return;Me.preventDefault();const _=Me.dataTransfer.getData("text/plain"),ce=Number(_||L||0);if(!ce||ce===le){ie();return}ge(!0);try{await Promise.resolve(l(ce,le))}finally{ge(!1),ie()}}if(O){const le=ut(O.title),Me=[{id:`projekt-${O.id}-title`,type:"heading",level:"article",text:le},...O.body.map((de,De)=>({id:`projekt-${O.id}-p-${De}`,type:"paragraph",text:ut(de)})),{id:`projekt-${O.id}-img`,type:"image",src:O.image||r,alt:le}],_=Array.isArray(J)&&J.length>0?J:Me,ce=CL(O);return c.jsx("section",{children:c.jsxs("article",{children:[c.jsx(In,{blocks:_,audit:i?ce:void 0}),c.jsx("div",{className:"mt-6 flex justify-start",children:c.jsx("button",{className:"btn-natural btn-natural-primary inline-flex w-full items-center justify-center gap-2 px-4 py-2 text-sm font-semibold sm:w-auto",onClick:()=>P(null),children:"Natrag na projekte"})})]})})}return t.length===0&&!u?c.jsx(Cl,{message:"Sadržaj za ovu kategoriju trenutno nije dostupan."}):c.jsxs("section",{children:[c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 sm:gap-5 md:gap-6 lg:grid-cols-3 xl:grid-cols-4 [&>*]:h-full",children:Y.map(le=>c.jsxs("article",{id:Fn({kind:"project",itemId:le.id}),className:`app-card app-enter relative mx-auto flex h-full w-[88%] max-w-[520px] flex-col rounded-md p-3 text-center transition sm:p-4 md:text-left ${L===le.id?"opacity-60":""} ${te===le.id&&L!==le.id?"ring-2 ring-[#4f8a63]/35 ring-offset-2 ring-offset-[#f5f9f6]":""}`,draggable:i&&!!l&&!ke,onDragStart:Me=>oe(le.id,Me),onDragOver:Me=>be(le.id,Me),onDrop:Me=>{Ee(le.id,Me)},onDragEnd:ie,children:[(()=>{const Me=ui(r.trim())||r,_=ui((le.image||Me).trim())||Me;return c.jsx("div",{className:"overflow-hidden rounded-md border border-[#d9e6de] bg-[#f8fbf9]",style:{aspectRatio:"16 / 8"},children:c.jsx("img",{src:_,alt:ut(le.title),loading:"lazy",decoding:"async",className:"h-full w-full bg-white object-contain p-2 md:p-3",onError:ce=>{const de=ce.currentTarget;de.dataset.fallbackApplied!=="1"&&(de.dataset.fallbackApplied="1",de.src=Me)}})})})(),c.jsx("h2",{className:"mb-0 mt-3 text-lg font-semibold leading-tight text-[#2f5f3e] md:text-xl",children:ut(le.title)}),c.jsx("p",{className:"mb-0 mt-2 text-sm leading-6 text-[#2f5f3e] md:text-base",children:ut(sE(le.body[0]??"",30))}),c.jsxs("div",{className:"mt-auto flex flex-col gap-3 pt-5 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between",children:[c.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2 md:justify-start",children:i&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"btn-natural btn-natural-dark px-3 py-1.5 text-xs font-extrabold uppercase",onClick:()=>s==null?void 0:s(le.id),children:"Uredi"}),c.jsx("button",{type:"button",className:"btn-natural btn-natural-danger px-3 py-1.5 text-xs font-extrabold uppercase",onClick:()=>w(le.id),children:"ObriÅ¡i"}),c.jsx("button",{type:"button",className:"btn-natural border border-[#3f4f46] bg-transparent px-3 py-1.5 text-xs font-extrabold uppercase text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35]",onClick:()=>D(le.id),children:"Arhiviraj"})]})}),c.jsx("button",{className:"btn-natural btn-natural-primary w-full px-4 py-2 text-sm font-semibold sm:w-auto",onClick:()=>P(le.id),children:"VIÅ E"})]})]},le.id))}),Q&&c.jsx("div",{className:"mt-6 flex justify-center",children:c.jsx("button",{className:"btn-natural btn-natural-primary w-full px-4 py-2 text-sm font-semibold sm:w-auto",onClick:()=>{z(le=>le+n)},children:"UÄitaj viÅ¡e"})}),c.jsx(vr,{open:i&&!!U,title:"Obrisati projekt?",description:U?`Projekt "${ut(U.title)}" bit Äe trajno uklonjen s kartica i iz detaljnog prikaza.`:"Odabrani projekt bit Äe trajno uklonjen.",confirmLabel:"ObriÅ¡i projekt",cancelLabel:"Odustani",onCancel:()=>w(null),onConfirm:()=>{U&&(o==null||o(U.id),w(null))}}),c.jsx(vr,{open:i&&!!$,title:"Arhivirati projekt?",description:$?`Projekt "${ut($.title)}" bit Äe maknut iz javnog prikaza i premjeÅ¡ten u arhivu.`:"Odabrani projekt bit Äe premjeÅ¡ten u arhivu.",confirmLabel:"Arhiviraj projekt",cancelLabel:"Odustani",onCancel:()=>D(null),onConfirm:()=>{$&&(Promise.resolve(a==null?void 0:a($.id)),D(null))}})]})}function Gj(t){const e=String(t||"").trim();if(!e)return null;const n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat("hr-HR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(n)}function TL(t){const e=ts(t.createdBy)||ut(String(t.createdBy||"").trim()),n=ts(t.updatedBy)||ut(String(t.updatedBy||"").trim());if(!!!(e||n))return null;const i=e||"Nepoznato",s=n||i||"Nepoznato",o=Gj(t.createdAt),a=Gj(t.updatedAt);if(!!!(o||a))return null;const u=Date.parse(String(t.createdAt||"")),d=Date.parse(String(t.updatedAt||"")),f=Number.isFinite(u)&&Number.isFinite(d),p=!!(n&&e&&n!==e);return(f?Math.abs(d-u)>1e3||p:!!(a&&o&&a!==o)||p)?{label:"Posljednje ažurirao/la",by:s,at:a||o||""}:{label:"Dodao/la",by:i||s||"Nepoznato",at:o||a||""}}function AL({items:t,pageSize:e,isAdmin:n=!1,onEditPrezentacija:r,onDeletePrezentacija:i,onArchivePrezentacija:s,onMovePrezentacija:o,onReorderPrezentacija:a,visibleCount:l,hasMorePrezentacije:u=!1,onVisibleCountChange:d,hasRouteArticleContent:f=!1,searchTargetId:p=null}){const[m,g]=h.useState(e),y=Number.isFinite(l)?Number(l):m,j=O=>{const U=typeof O=="function"?O(y):O,$=Number.isFinite(U)?Math.max(0,Math.floor(U)):y;if(d){d($);return}g($)},[x,k]=h.useState(null),[N,C]=h.useState(null),[w,E]=h.useState(null),[D,L]=h.useState(null),[V,te]=h.useState(!1),ae=h.useRef(null);ae.current||(ae.current=Ll());const ke=h.useMemo(()=>t.slice(0,y),[t,y]),ge=y<t.length||u,Se=t.length>0,me=h.useMemo(()=>x?t.find(O=>O.id===x)??null:null,[x,t]),H=h.useMemo(()=>N?t.find(O=>O.id===N)??null:null,[N,t]);h.useEffect(()=>{if(!p)return;const O=t.findIndex(U=>Fn({kind:"prezentacija",itemId:U.id})===p);O<0||j(U=>Math.max(U,O+1))},[t,p]),h.useEffect(()=>()=>{var O;(O=ae.current)==null||O.stop()},[]);function P(){var O;E(null),L(null),(O=ae.current)==null||O.stop()}function z(O,U){!n||!a||V||(E(O),U.dataTransfer.effectAllowed="move",U.dataTransfer.setData("text/plain",String(O)))}function Y(O,U){var ie;if(!n||!a||V)return;(ie=ae.current)==null||ie.update(U.clientY);const $=U.dataTransfer.getData("text/plain"),J=Number($||w||0);!J||J===O||(U.preventDefault(),U.dataTransfer.dropEffect="move",L(O))}async function Q(O,U){if(!n||!a||V)return;U.preventDefault();const $=U.dataTransfer.getData("text/plain"),J=Number($||w||0);if(!J||J===O){P();return}te(!0);try{await Promise.resolve(a(J,O))}finally{te(!1),P()}}return c.jsxs("div",{children:[!Se&&!f&&c.jsx(Cl,{message:"Sadržaj za ovu kategoriju trenutno nije dostupan."}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 sm:gap-5 md:gap-6 xl:grid-cols-4 [&>*]:h-full",children:ke.map((O,U)=>{const $=TL(O),J=ui(O.pptUrl),ie=Number(O.documentSizeBytes||0)>0&&Number(O.documentSizeBytes||0)<1e3&&String(J||"").startsWith("/web/dokumenti/uploads/mediji/");return c.jsxs("article",{id:Fn({kind:"prezentacija",itemId:O.id}),className:`app-card app-enter relative flex h-full flex-col rounded-md p-3 transition sm:p-4 ${w===O.id?"opacity-60":""} ${D===O.id&&w!==O.id?"ring-2 ring-[#4f8a63]/35 ring-offset-2 ring-offset-[#f5f9f6]":""}`,draggable:n&&!!a&&!V,onDragStart:oe=>z(O.id,oe),onDragOver:oe=>Y(O.id,oe),onDrop:oe=>{Q(O.id,oe)},onDragEnd:P,children:[c.jsxs("div",{className:"flex flex-1 flex-col items-center text-center",children:[c.jsx("h2",{className:"mb-0 mt-3 break-words text-lg font-semibold leading-tight text-[#2f5f3e] [overflow-wrap:anywhere] md:text-xl",children:ut(O.title)}),O.date&&c.jsx("p",{className:"mb-0 mt-3 text-sm text-[#4c4c4c]",children:O.date}),c.jsxs("p",{className:"mb-0 mt-2 break-words text-sm leading-6 text-[#2f5f3e] [overflow-wrap:anywhere] md:text-base",children:[c.jsx("span",{className:"font-semibold",children:"Autor/i:"})," ",ut(O.author||"Nisu navedeni")]}),n&&$&&c.jsxs("p",{className:"mb-0 mt-3 border-t border-[#b6ccc2] pt-2 text-[0.79rem] leading-relaxed text-[#5b7768]",children:[ut($.label),": ",c.jsx("span",{className:"font-semibold text-[#2a5a3d]",children:ut($.by)}),$.at?`, ${$.at}
203`:""]})]}),c.jsxs("div",{className:"mt-auto flex w-full flex-col items-center gap-2 pt-5",children:[n&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[c.jsx("button",{type:"button",className:"btn-natural btn-natural-dark px-3 py-1.5 text-xs font-extrabold uppercase",onClick:()=>r==null?void 0:r(O.id),children:"Uredi"}),c.jsx("button",{type:"button",className:"btn-natural btn-natural-danger px-3 py-1.5 text-xs font-extrabold uppercase",onClick:()=>k(O.id),children:"ObriÅ¡i"}),c.jsx("button",{type:"button",className:"btn-natural border border-[#3f4f46] bg-transparent px-3 py-1.5 text-xs font-extrabold uppercase text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35]",onClick:()=>C(O.id),children:"Arhiviraj"})]}),c.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[c.jsx("button",{type:"button",disabled:U===0,className:"btn-natural border border-[#3f4f46] bg-transparent px-3 py-1.5 text-xs font-extrabold uppercase text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35] disabled:cursor-not-allowed disabled:opacity-45",onClick:()=>o==null?void 0:o(O.id,"up"),children:"Gore"}),c.jsx("button",{type:"button",disabled:U===ke.length-1&&!ge,className:"btn-natural border border-[#3f4f46] bg-transparent px-3 py-1.5 text-xs font-extrabold uppercase text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35] disabled:cursor-not-allowed disabled:opacity-45",onClick:()=>o==null?void 0:o(O.id,"down"),children:"Dolje"})]})]}),ie?c.jsxs("div",{className:"w-full rounded-md border border-[#f0c9c9] bg-[#fff4f4] px-3 py-2 text-center text-xs font-semibold text-[#b42318]",children:["Datoteka trenutno nije dostupna za preuzimanje.",n?" Uredi prezentaciju i ponovno uÄitaj dokument.":""]}):c.jsx("a",{href:J,target:"_blank",rel:"noopener noreferrer",className:"btn-natural btn-natural-primary inline-flex w-full items-center justify-center px-4 py-2 text-center text-sm font-semibold sm:w-auto",children:"PREZENTACIJA"})]})]},O.id)})}),ge&&c.jsx("div",{className:"mt-6 flex justify-center",children:c.jsx("button",{className:"btn-natural btn-natural-primary w-full px-4 py-2 text-sm font-semibold sm:w-auto",onClick:()=>{j(O=>O+e)},children:"UÄitaj viÅ¡e"})}),c.jsx(vr,{open:n&&!!me,title:"Obrisati prezentaciju?",description:me?`Prezentacija "${ut(me.title)}" bit Äe trajno uklonjena.`:"Odabrana prezentacija bit Äe trajno uklonjena.",confirmLabel:"ObriÅ¡i prezentaciju",cancelLabel:"Odustani",onCancel:()=>k(null),onConfirm:()=>{me&&(i==null||i(me.id),k(null))}}),c.jsx(vr,{open:n&&!!H,title:"Arhivirati prezentaciju?",description:H?`Prezentacija "${ut(H.title)}" bit Äe maknuta iz javnog prikaza i premjeÅ¡tena u arhivu.`:"Odabrana prezentacija bit Äe premjeÅ¡tena u arhivu.",confirmLabel:"Arhiviraj prezentaciju",cancelLabel:"Odustani",onCancel:()=>C(null),onConfirm:()=>{H&&(Promise.resolve(s==null?void 0:s(H.id)),C(null))}})]})}function Zu({items:t,activeId:e,onChange:n,className:r=""}){return c.jsx("div",{className:`mx-auto grid w-full max-w-[780px] grid-cols-1 overflow-hidden rounded-2xl border border-[#376d44] bg-white sm:grid-cols-2 ${r}`.trim(),children:t.map(i=>c.jsx("button",{onClick:()=>n(i.id),className:`min-h-12 px-3 py-2.5 text-sm font-semibold leading-snug ${e===i.id?"bg-[#376d44] text-white":"bg-white text-[#2f5f3e] hover:bg-[#edf5f1]"}`,children:ut(i.label)},i.id))})}function ML({introBlocks:t,activeTab:e,onTabChange:n,tabBlocks:r,subnavArticles:i}){return c.jsxs("article",{className:"mx-auto w-full max-w-[1320px] space-y-5 md:space-y-6",children:[c.jsx(In,{blocks:t}),c.jsx(Zu,{items:[{id:"temeljni",label:"Temeljni akti"},{id:"provedbeni",label:"Provedbeni akti"}],activeId:e,onChange:n}),i??c.jsx(In,{blocks:r[e]??[]})]})}function IL({introBlocks:t,activeTab:e,onTabChange:n,tabBlocks:r,subnavArticles:i}){return c.jsxs("article",{className:"mx-auto w-full max-w-[1320px] space-y-5 md:space-y-6",children:[c.jsx(In,{blocks:t}),c.jsx(Zu,{items:[{id:"sumarstvo",label:"Razred inzenjera sumarstva"},{id:"drvo",label:"Razred inzenjera drvne tehnologije"}],activeId:e,onChange:n}),i??c.jsx(In,{blocks:r[e]??[]})]})}function zL({activeTab:t,onTabChange:e,zapisniciBlocks:n,izboriBlocks:r,subnavArticles:i}){return c.jsxs("article",{className:"mx-auto w-full max-w-[1320px] space-y-5 md:space-y-6",children:[c.jsx(Zu,{items:[{id:"zapisnici",label:"Zapisnici"},{id:"izbori",label:"Izbori"}],activeId:t,onChange:e}),i??c.jsx(In,{blocks:t==="zapisnici"?n:r})]})}const oE="hkisdt-export-cache:",PL=`${oE}v5:`,aE=5*60*1e3,DL=15*60*1e3;function lE(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{return null}}function cE(t,e=oE){const n=[];for(let r=0;r<t.length;r+=1){const i=t.key(r);i!=null&&i.startsWith(e)&&n.push(i)}return n}function OL(t,e=Date.now()){for(const n of cE(t)){const r=t.getItem(n);if(!r){t.removeItem(n);continue}try{const i=JSON.parse(r);(typeof i.expiresAt!="number"||i.expiresAt<=e)&&t.removeItem(n)}catch{t.removeItem(n)}}}function _L(t){for(const e of cE(t))t.removeItem(e)}function uE(t,e){const n=Object.entries(e||{}).filter(([,r])=>r!=null&&r!=="").sort(([r],[i])=>r.localeCompare(i)).map(([r,i])=>`${encodeURIComponent(r)}=${encodeURIComponent(String(i))}`);return`${PL}${t}${n.length>0?`?${n.join("&")}`:""}`}function LL(t,e){const n=lE();if(!n)return null;const r=uE(t,e),i=n.getItem(r);if(!i)return null;try{const s=JSON.parse(i);return typeof s.expiresAt!="number"||s.expiresAt<=Date.now()?(n.removeItem(r),null):s.value??null}catch{return n.removeItem(r),null}}function RL(t,e,n,r){const i=lE();if(!i)return;OL(i);const s=uE(t,e),o=JSON.stringify({expiresAt:Date.now()+r,value:n});try{i.setItem(s,o)}catch{_L(i);try{i.setItem(s,o)}catch{}}}async function ky(t,e,n,r={}){if(r.skipPersistentCache)return Hr(t,{query:e,skipMemoryCache:!0});const i=LL(t,e);if(i)return i;const s=await Hr(t,{query:e});return RL(t,e,s,n),s}function Zp(t="all"){return ky("/api/export/sifrarnici",{tip:t},DL)}function dE(t,e){return ky("/api/export/imenik",t,aE,e)}function fE(t,e){return ky("/api/export/licence",t,aE,e)}function qj(t,e){const n=String(t??"");return n.includes('"')||n.includes(e)||n.includes(` 204`)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}function $L(t,e,n={}){const r=n.delimiter||";",i=t.map(o=>qj(o,r)).join(r),s=e.map(o=>o.map(a=>qj(a,r)).join(r));return[i,...s].join(`\r 205`)}function pE(t,e,n,r){const s=`\uFEFF${$L(e,n,r)}`,o=new Blob([s],{type:"text/csv;charset=utf-8;"}),a=URL.createObjectURL(o),l=document.createElement("a");l.href=a,l.download=t,l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(a)}function mE({text:t="UÄitavanje rezultata...",rows:e=3}){return c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg bg-[#e8f3ed] px-3 py-2 text-sm font-semibold text-[#2f5f3e]",children:[c.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[#2f5f3e]/30 border-t-[#2f5f3e]"}),c.jsx("span",{children:t})]}),c.jsx("div",{className:"space-y-3",children:Array.from({length:e}).map((n,r)=>c.jsxs("div",{className:"animate-pulse rounded-lg border border-[#d2e4da] bg-white p-3",children:[c.jsx("div",{className:"h-4 w-1/2 roun
205ded bg-[#e2eee8]"}),c.jsx("div",{className:"mt-2 h-3 w-2/3 rounded bg-[#e8f3ed]"}),c.jsx("div",{className:"mt-2 h-3 w-3/4 rounded bg-[#e8f3ed]"}),c.jsx("div",{className:"mt-2 h-3 w-4/5 rounded bg-[#e8f3ed]"})]},`loader-row-${r}`))})]})}const cr="svi > odaberi",BL=[10,25,50,100],Ig=25,Jj=500,FL=200,UL=[{value:"default",label:"Po redoslijedu pretrage"},{value:"name-asc",label:"Prezime i ime A-Z"},{value:"name-desc",label:"Prezime i ime Z-A"},{value:"company-asc",label:"Tvrtka A-Z"},{value:"county-asc",label:"Županija A-Z"}],HL={Ã:"Å¡","Ã":"ž",è:"Å ",Ã:"Ž","â":"Ä","â":"Ä","â¨":"Ä",Φ:"Ä",µ:"Ä","â¡":"Ä"};function yt(t){const e=String(t||"");if(!e)return"";let n="";for(const r of e)n+=HL[r]??r;return n}function VL(t){return t==="DRVARI"?"imenik_drvari.csv":"imenik_sumari.csv"}function KL(t){const e=yt(t.ime);return[yt(t.prezime),e].filter(Boolean).join(" ").trim()||yt(t.ime_prezime)}function Cs(t){const e=yt(t.ime).trim(),r=[yt(t.prezime).trim(),e].filter(Boolean).join(" ").trim();if(r)return r;const i=yt(t.ime_prezime).trim(),s=i.split(/\s+/).filter(Boolean);return s.length<2?i:[s[s.length-1],s.slice(0,-1).join(" ")].join(" ")}function Zj(t){const e=(t.smjerovi||[]).map(r=>yt(r).trim()).filter(Boolean).join(", ")||yt(t.strucna_titula),n=yt(t.broj_upisa);return[e,n?`br.up. ${n}`:""].filter(Boolean).join(", ")}function Yj(t){const e=yt(t.tvrtka),n=yt(t.adresa);return[e,n].filter(Boolean).join(", ")}function WL(t){return t==="name-asc"?{sort:"prezime",dir:"ASC"}:t==="name-desc"?{sort:"prezime",dir:"DESC"}:t==="company-asc"?{sort:"tvrtka",dir:"ASC"}:t==="county-asc"?{sort:"zupanija",dir:"ASC"}:{sort:"prezime",dir:"ASC"}}async function GL(t){const e=[];for(let n=1;n<=FL;n+=1){const r=await dE({izvor_grana:t,aktivni:!0,page:n,limit:Jj},{skipPersistentCache:!0}),i=Array.isArray(r.items)?r.items:[];e.push(...i);const s=Number(r.total||0);if(i.length<Jj||s>0&&e.length>=s)break}return e}function qL({izvorGrana:t}){const e="h-10 w-full min-w-0 rounded-lg border border-[#bbcec3] bg-white px-3 text-[#244e33] outline-none focus:border-[#3f7a4f]",n="h-9 w-full min-w-0 rounded-lg border border-[#bbcec3] bg-white px-2 text-sm text-[#244e33] outline-none focus:border-[#3f7a4f]",[r,i]=h.useState(cr),[s,o]=h.useState(cr),[a,l]=h.useState(""),[u,d]=h.useState(""),[f,p]=h.useState(""),[m,g]=h.useState([]),[y,j]=h.useState([]),[x,k]=h.useState([]),[N,C]=h.useState(0),[w,E]=h.useState(!1),[D,L]=h.useState(""),[V,te]=h.useState(!1),[ae,ke]=h.useState(null),[ge,Se]=h.useState(1),[me,H]=h.useState(Ig),[P,z]=h.useState("default"),[Y,Q]=h.useState(!1);h.useEffect(()=>{let _=!0;return(async()=>{const[de,De]=await Promise.allSettled([Zp("smjerovi"),Zp("zupanije")]);if(!_)return;const Oe=de.status==="fulfilled"&&Array.isArray(de.value)?de.value:[],He=De.status==="fulfilled"&&Array.isArray(De.value)?De.value:[];if(g(Oe),j(He),de.status==="rejected"||De.status==="rejected"){const Ge=Oe.length>0||He.length>0;L(Ge?"Neki Å¡ifrarnici trenutno nisu dostupni.":"Å ifrarnici trenutno nisu dostupni.")}else L("")})(),()=>{_=!1}},[]),h.useEffect(()=>{i(cr),o(cr),l(""),d(""),p(""),k([]),C(0),te(!1),ke(null),Se(1),H(Ig),z("default"),L("")},[t]);const O=h.useMemo(()=>{const _=m.filter(ce=>!t||ce.izvor_grana===t);return[{value:cr,label:cr},..._.map(ce=>({value:ce.naziv_smjera,label:yt(ce.naziv_smjera)}))]},[t,m]);h.useEffect(()=>{O.some(_=>_.value===r)||i(cr)},[O,r]);const U=h.useMemo(()=>[{value:cr,label:cr},...y.map(_=>({value:_.naziv_zupanije,label:yt(_.naziv_zupanije)}))],[y]),$=(_,ce)=>String(_||"").localeCompare(String(ce||""),"hr",{sensitivity:"variant",numeric:!0}),J=h.useMemo(()=>{if(P==="default")return x;const _=[...x];return P==="name-asc"?(_.sort((ce,de)=>$(Cs(ce),Cs(de))),_):P==="name-desc"?(_.sort((ce,de)=>$(Cs(de),Cs(ce))),_):P==="company-asc"?(_.sort((ce,de)=>$(ce.tvrtka,de.tvrtka)||$(Cs(ce),Cs(de))),_):(_.sort((ce,de)=>$(ce.zupanija,de.zupanija)||$(Cs(ce),Cs(de))),_)},[x,P]);async function ie(_,ce,de,De){if(w)return;E(!0),L(""),te(!0);const Oe=ce?1:ge+1,He=de??me,ot=De??P;try{const Ge=await dE({..._,...WL(ot),page:Oe,limit:He});k(Te=>ce?Ge.items:[...Te,...Ge.items]),C(Number(Ge.total||0)),Se(Oe),ke(_)}catch(Ge){L(Ge instanceof Error?Ge.message:"Pretraživanje nije uspjelo.")}finally{E(!1)}}function oe(){return{izvor_grana:t,aktivni:!0,smjer:r!==cr?r:void 0,zupanija:s!==cr?s:void 0,sjediste:a.trim()||void 0,prezime:u.trim()||void 0,tvrtka:f.trim()||void 0}}function be(){i(cr),o(cr),l(""),d(""),p(""),k([]),C(0),te(!1),ke(null),Se(1),H(Ig),z("default"),L("")}function Ee(_){const ce=Number(_);!Number.isFinite(ce)||ce<=0||(H(ce),ae&&ie(ae,!0,ce))}function le(_){const ce=_;z(ce),ae&&ie(ae,!0,void 0,ce)}async function Me(){if(!Y){Q(!0),L("");try{const _=await GL(t);if(_.length===0){L("Nema podataka za CSV preuzimanje.");return}const ce=["IME","PREZIME","SMJER","BR_UPISA","TVRTKA","ADRESA","POSTA","MJESTO","TELEFON"],de=_.map(De=>{var _e;const Oe=De.raw||{},He=yt(De.ime||String(Oe.ime??"").trim()),ot=yt(De.prezime||String(Oe.prezime??"").trim()),Ge=yt(String(Oe.adresa_tvrtke??"").trim()),Te=yt(String(Oe.postanski_broj_tvrtke??"").trim()),Ke=yt(String(Oe.mjesto_tvrtke??"").trim()),Ne=yt(((_e=String(De.adresa||"").split(",")[0])==null?void 0:_e.trim())||"");return[He,ot,(De.smjerovi||[]).map(We=>yt(We)).join(", "),yt(De.broj_upisa||""),yt(De.tvrtka||""),Ge||Ne,Te,Ke,yt(De.telefon||"")]});pE(VL(t),ce,de)}catch(_){L(_ instanceof Error?_.message:"Preuzimanje CSV-a nije uspjelo.")}finally{Q(!1)}}}return c.jsx("section",{className:"mx-auto w-full max-w-[1320px] overflow-x-hidden rounded-lg border border-[#d5e5dc] bg-[#f7fbf9] p-4 md:p-5",children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsx("h3",{className:"text-lg font-bold uppercase text-[#2f5f3e]",children:"Pretraživanje"}),c.jsxs("div",{className:"grid min-w-0 gap-3 lg:grid-cols-[180px_minmax(0,1fr)] lg:items-center",children:[c.jsx("label",{className:"font-semibold text-[#355f43]",children:"StruÄni smjer:"}),c.jsx("select",{value:r,onChange:_=>i(_.target.value),className:e,children:O.map(_=>c.jsx("option",{value:_.value,children:_.label},`smjer-${_.value}`))}),c.jsx("label",{className:"font-semibold text-[#355f43]",children:"Županija:"}),c.jsx("select",{value:s,onChange:_=>o(_.target.value),className:e,children:U.map(_=>c.jsx("option",{value:_.value,children:_.label},`zup-${_.value}`))}),c.jsx("label",{className:"font-semibold text-[#355f43]",children:"SjediÅ¡te:"}),c.jsx("input",{value:a,onChange:_=>l(_.target.value),className:e}),c.jsx("label",{className:"font-semibold text-[#355f43]",children:"Prezime:"}),c.jsx("input",{value:u,onChange:_=>d(_.target.value),className:e}),c.jsx("label",{className:"font-semibold text-[#355f43]",children:"Tvrtka:"}),c.jsx("input",{value:f,onChange:_=>p(_.target.value),className:e})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",disabled:w,onClick:()=>void ie(oe(),!0),className:"w-full rounded-lg bg-[#376d44] px-4 py-2 text-sm font-bold uppercase text-white transition hover:bg-[#2f5f3e] disabled:cursor-not-allowed disabled:opacity-70 sm:w-auto",children:w?"Tražim...":"Traži"}),c.jsx("button",{type:"button",onClick:be,className:"w-full rounded-lg border border-[#9db8aa] bg-white px-4 py-2 text-sm font-bold uppercase text-[#2f5f3e] transition hover:bg-[#edf5f1] sm:w-auto",children:"Nova pretraga"})]})]}),c.jsxs("div",{className:"space-y-3 border-t border-[#d7e7de] pt-4",children:[c.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[c.jsx("label",{className:"text-sm font-semibold text-[#355f43]",children:"Prikaži:"}),c.jsx("select",{value:me,disabled:w,onChange:_=>Ee(_.target.value),className:`${n} disabled:cursor-not-allowed disabled:opacity-70 sm:w-auto`,children:BL.map(_=>c.jsx("option",{value:_,children:_},`imenik-limit-${_}`))}),c.jsx("span",{className:"text-sm text-[#4d6a59]",children:"rezultata"}),c.jsx("span",{className:"mx-1 hidden h-5 w-px bg-[#c9dbd0] md:inline-block"}),c.jsx("label",{className:"text-sm font-semibold text-[#355f43]",children:"Sortiraj:"}),c.jsx("select",{value:P,onChange:_=>le(_.target.value),className:`${n} sm:w-auto`,children:UL.map(_=>c.jsx("option",{value:_.value,children:_.label},`imenik-sort-${_.value}`))}),c.jsx("button",{type:"button",disabled:Y,onClick:()=>void Me(),className:"w-full rounded-lg border border-[#9db8aa] bg-white px-3 py-1.5 text-xs font-bold uppercase text-[#2f5f3e] transition hover:bg-[#edf5f1] disabled:cursor-not-allowed disabled:opacity-60 sm:ml-auto sm:w-auto",children:Y?"Priprema...":"Preuzmi CSV"})]}),w&&c.jsx(mE,{text:"DohvaÄam imenik...",rows:3}),!!D&&c.jsx("p",{className:"text-sm font-semibold text-[#9a2a2a]",children:D}),V&&!w&&x.length===0&&!D&&c.jsx("p",{className:"text-sm font-semibold text-[#2f5f3e]",children:"Nema rezultata za zadane kriterije."}),x.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-sm font-semibold text-[#2f5f3e]",children:["Prikazano ",x.length," od ukupno ",N,"."]}),c.jsx("div",{className:"space-y-3",children:J.map(_=>c.jsxs("article",{className:"rounded-lg border border-[#d2e4da] bg-white p-3",children:[c.jsx("p",{className:"m-0 break-words text-base font-bold text-[#234f34] [overflow-wrap:anywhere]",children:KL(_)}),Zj(_)&&c.jsx("p",{className:"m-0 mt-1 break-words text-sm text-[#355f43] [overflow-wrap:anywhere]",children:Zj(_)}),Yj(_)&&c.jsx("p",{className:"m-0 mt-1 break-words text-sm text-[#355f43] [overflow-wrap:anywhere]",children:Yj(_)}),yt(_.telefon)&&c.jsxs("p",{className:"m-0 mt-1 break-words text-sm text-[#355f43] [overflow-wrap:anywhere]",children:["Telefon: ",yt(_.telefon)]}),yt(_.email)&&c.jsx("p",{className:"m-0 mt-1 break-words text-sm text-[#355f43] [overflow-wrap:anywhere]",children:yt(_.email)})]},_.inzenjer_id))}),x.length<N&&ae&&c.jsx("div",{className:"pt-1",children:c.jsx("button",{type:"button",disabled:w,onClick:()=>void ie(ae,!1),className:"w-full rounded-lg bg-[#376d44] px-4 py-2 text-sm font-bold uppercase text-white transition hover:bg-[#2f5f3e] disabled:cursor-not-allowed disabled:opacity-70 sm:w-auto",children:w?"UÄitavam...":"UÄitaj joÅ¡"})})]})]})]})})}function hE(t){return t==="upisnik-licencija"?"licence":t}function gE(t,e){var i;if(!t)return null;const n=hE(e),r=(i=t.by_target)==null?void 0:i[n];if(r!=null&&r.imported_at)return r;if(t.imported_at){if(t.target===n)return t;if(t.target==="all")return{...t,target:n};if(t.target==="imenik"&&(n==="sumari"||n==="drvari"))return{...t,target:n}}return null}function JL(){return Hr("/api/web/export-import-status",{auth:!0})}function ZL(t){const e=hE(t);return Ol("/api/web/export-import",{auth:!0,body:{target:e}})}function YL(t){const e=String(t||"").trim();if(!e)return"Nije dostupno";const n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat("hr-HR",{dateStyle:"medium",timeStyle:"short"}).format(n)}function QL({activeTab:t,onTabChange:e,tabBlocks:n,subnavArticles:r,isAdmin:i=!1,exportImportStatus:s=null,exportImportStatusLoading:o=!1,exportImportStatusError:a="",exportImportRunning:l=!1,exportImportRunMessage:u="",onPullExport:d}){const f=t==="sumarstvo"?"SUMARI":"DRVARI",p=t==="sumarstvo"?"sumari":"drvari",m=t==="sumarstvo"?"OvlaÅ¡teni inženjeri Å¡umarstva":"OvlaÅ¡teni inženjeri drvne tehnologije",g=o||l||!d,y=gE(s,p);return c.jsxs("article",{className:"mx-auto w-full max-w-[1320px] overflow-x-hidden px-1 sm:px-2 space-y-5 md:space-y-6",children:[c.jsx(Zu,{items:[{id:"sumarstvo",label:"OvlaÅ¡teni inženjeri Å¡umarstva"},{id:"drvo",label:"OvlaÅ¡teni inženjeri drvne tehnologije"}],activeId:t,onChange:e}),r??c.jsx(In,{blocks:n[t]??[]}),i&&c.jsxs("div",{className:"rounded-lg border border-[#d8e7dd] bg-[#f7fbf9] p-4",children:[c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"m-0 text-sm font-bold text-[#2f5f3e]",children:"Status exporta"}),c.jsx("p",{className:"m-0 mt-1 text-xs text-[#4f6e5e]",children:m})]}),c.jsxs("button",{type:"button",className:"btn-natural btn-natural-primary inline-flex min-h-10 items-center justify-center gap-2 px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-60",onClick:()=>{d==null||d(p)}
205,disabled:g,children:[l&&c.jsx("span",{className:"h-4 w-4 rounded-full border-2 border-white/80 border-t-transparent animate-spin"}),l?"PovlaÄim export...":"Povuci export"]})]}),o&&c.jsx("p",{className:"m-0 mt-2 text-sm text-[#355843]",children:"UÄitavam..."}),!o&&a&&c.jsx("p",{className:"m-0 mt-2 text-sm font-semibold text-[#b42318]",children:a}),!o&&!a&&u&&c.jsx("p",{className:"m-0 mt-2 text-sm font-semibold text-[#25633d]","aria-live":"polite",children:u}),!o&&!a&&c.jsx("div",{className:"mt-2 space-y-1 text-sm text-[#355843]",children:c.jsxs("p",{className:"m-0",children:[c.jsx("span",{className:"font-semibold",children:"Posljednje povlaÄenje exporta:"})," ",y?YL(y.imported_at):"JoÅ¡ nije povuÄeno"]})})]}),c.jsx(qL,{izvorGrana:f})]})}const Es="svi > odaberi",XL=[10,25,50,100],Qj=25,Xj=500,eR=200,tR=[{value:"default",label:"Po redoslijedu pretrage"},{value:"holder-asc",label:"Nositelj A-Z"},{value:"holder-desc",label:"Nositelj Z-A"},{value:"license-asc",label:"Broj licence uzlazno"},{value:"license-desc",label:"Broj licence silazno"},{value:"expiry-asc",label:"Vrijedi do (najskorije prvo)"},{value:"expiry-desc",label:"Vrijedi do (najkasnije prvo)"}];function nR(t){return t==="holder-asc"?{sort:"naziv",dir:"ASC"}:t==="holder-desc"?{sort:"naziv",dir:"DESC"}:t==="license-asc"?{sort:"broj",dir:"ASC"}:t==="license-desc"?{sort:"broj",dir:"DESC"}:t==="expiry-asc"?{sort:"istek",dir:"ASC"}:t==="expiry-desc"?{sort:"istek",dir:"DESC"}:{sort:"broj",dir:"ASC"}}async function rR(t){const e=[],n=t==="sumarstvo-lovstvo"?"sumarstvo-lovstvo":void 0;for(let r=1;r<=eR;r+=1){const i=await fE({aktivne:!0,podrucje:n,page:r,limit:Xj},{skipPersistentCache:!0}),s=Array.isArray(i.items)?i.items:[];e.push(...s);const o=Number(i.total||0);if(s.length<Xj||o>0&&e.length>=o)break}return e}function iR({podrucje:t}){const e="h-10 w-full min-w-0 rounded-lg border border-[#bbcec3] bg-white px-3 text-[#244e33] outline-none focus:border-[#3f7a4f]",n="h-9 w-full min-w-0 rounded-lg border border-[#bbcec3] bg-white px-2 text-sm text-[#244e33] outline-none focus:border-[#3f7a4f]",[r,i]=h.useState(Es),[s,o]=h.useState(""),[a,l]=h.useState(""),[u,d]=h.useState(Es),[f,p]=h.useState([]),[m,g]=h.useState([]),[y,j]=h.useState([]),[x,k]=h.useState(0),[N,C]=h.useState(!1),[w,E]=h.useState(""),[D,L]=h.useState(!1),[V,te]=h.useState(null),[ae,ke]=h.useState(1),[ge,Se]=h.useState(Qj),[me,H]=h.useState("default"),[P,z]=h.useState(!1);h.useEffect(()=>{let _=!0;return(async()=>{const[de,De]=await Promise.allSettled([Zp("zupanije"),Zp("vrste-radova")]);if(!_)return;const Oe=de.status==="fulfilled"&&Array.isArray(de.value)?de.value:[],He=De.status==="fulfilled"&&Array.isArray(De.value)?De.value:[];if(p(Oe),g(He),de.status==="rejected"||De.status==="rejected"){const Ge=Oe.length>0||He.length>0;E(Ge?"Neki Å¡ifrarnici trenutno nisu dostupni.":"Å ifrarnici trenutno nisu dostupni.")}else E("")})(),()=>{_=!1}},[]);const Y=h.useMemo(()=>[Es,...f.map(_=>_.naziv_zupanije)],[f]),Q=h.useMemo(()=>[Es,...m.map(_=>_.naziv_vrste_rada)],[m]),O=(_,ce)=>String(_||"").localeCompare(String(ce||""),"hr",{sensitivity:"variant",numeric:!0}),U=_=>{if(!_)return Number.NaN;const ce=new Date(_).getTime();return Number.isNaN(ce)?Number.NaN:ce},$=(_,ce)=>{const de=U(_),De=U(ce);return Number.isNaN(de)&&Number.isNaN(De)?0:Number.isNaN(de)?1:Number.isNaN(De)?-1:de-De},J=h.useMemo(()=>{if(me==="default")return y;const _=[...y];return me==="holder-asc"?(_.sort((ce,de)=>O(ce.nositelj,de.nositelj)),_):me==="holder-desc"?(_.sort((ce,de)=>O(de.nositelj,ce.nositelj)),_):me==="license-asc"?(_.sort((ce,de)=>O(ce.broj_licence,de.broj_licence)),_):me==="license-desc"?(_.sort((ce,de)=>O(de.broj_licence,ce.broj_licence)),_):me==="expiry-asc"?(_.sort((ce,de)=>$(ce.datum_isteka,de.datum_isteka)||O(ce.nositelj,de.nositelj)),_):(_.sort((ce,de)=>$(de.datum_isteka,ce.datum_isteka)||O(ce.nositelj,de.nositelj)),_)},[y,me]);async function ie(_,ce,de,De){if(N)return;C(!0),E(""),L(!0);const Oe=ce?1:ae+1,He=de??ge,ot=De??me;try{const Ge=await fE({..._,...nR(ot),page:Oe,limit:He});j(Te=>ce?Ge.items:[...Te,...Ge.items]),k(Number(Ge.total||0)),ke(Oe),te(_)}catch(Ge){E(Ge instanceof Error?Ge.message:"Pretraživanje nije uspjelo.")}finally{C(!1)}}function oe(){return{aktivne:!0,naziv:a.trim()||void 0,zupanija:r!==Es?r:void 0,sjediste:s.trim()||void 0,vrsta_rada:u!==Es?u:void 0,podrucje:t||void 0}}function be(){i(Es),o(""),l(""),d(Es),j([]),k(0),L(!1),te(null),ke(1),Se(Qj),H("default"),E("")}function Ee(_){const ce=Number(_);!Number.isFinite(ce)||ce<=0||(Se(ce),V&&ie(V,!0,ce))}function le(_){const ce=_;H(ce),V&&ie(V,!0,void 0,ce)}
205function Me(){P||(z(!0),E(""),(async()=>{try{const _=await rR(t);if(_.length===0){E("Nema podataka za CSV preuzimanje.");return}const ce=["Tvrtka","Broj licence","Adresa","PoÅ¡ta","Mjesto","Telefon"],de=_.map(De=>{var Ke;const Oe=De.raw||{},He=String(Oe.adresa??"").trim(),ot=String(Oe.postanski_broj??"").trim(),Ge=String(Oe.mjesto??"").trim(),Te=((Ke=String(De.adresa||"").split(",")[0])==null?void 0:Ke.trim())||"";return[De.nositelj||"",De.broj_licence||"",He||Te,ot,Ge,De.telefon||""]});pE("licence.csv",ce,de)}catch(_){E(_ instanceof Error?_.message:"Preuzimanje CSV-a nije uspjelo.")}finally{z(!1)}})())}return c.jsx("section",{className:"mx-auto w-full max-w-[1320px] overflow-x-hidden rounded-lg border border-[#d5e5dc] bg-[#f7fbf9] p-4 md:p-5",children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsx("h3",{className:"text-lg font-bold uppercase text-[#2f5f3e]",children:"Pretraživanje"}),c.jsxs("div",{className:"grid min-w-0 gap-3 lg:grid-cols-[180px_minmax(0,1fr)] lg:items-center",children:[c.jsx("label",{className:"font-semibold text-[#355f43]",children:"Županija:"}),c.jsx("select",{value:r,onChange:_=>i(_.target.value),className:e,children:Y.map(_=>c.jsx("option",{value:_,children:_},`det-zup-${_}`))}),c.jsx("label",{className:"font-semibold text-[#355f43]",children:"SjediÅ¡te:"}),c.jsx("input",{value:s,onChange:_=>o(_.target.value),className:e}),c.jsx("label",{className:"font-semibold text-[#355f43]",children:"Naziv:"}),c.jsx("input",{value:a,onChange:_=>l(_.target.value),placeholder:"Unesite naziv",className:e}),c.jsx("label",{className:"font-semibold text-[#355f43]",children:"Vrsta rada:"}),c.jsx("select",{value:u,onChange:_=>d(_.target.value),className:e,children:Q.map(_=>c.jsx("option",{value:_,children:_},`det-vr-${_}`))})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",disabled:N,onClick:()=>void ie(oe(),!0),className:"w-full rounded-lg bg-[#376d44] px-4 py-2 text-sm font-bold uppercase text-white transition hover:bg-[#2f5f3e] disabled:cursor-not-allowed disabled:opacity-70 sm:w-auto",children:N?"Tražim...":"Traži"}),c.jsx("button",{type:"button",onClick:be,className:"w-full rounded-lg border border-[#9db8aa] bg-white px-4 py-2 text-sm font-bold uppercase text-[#2f5f3e] transition hover:bg-[#edf5f1] sm:w-auto",children:"Nova pretraga"})]})]}),c.jsxs("div",{className:"space-y-3 border-t border-[#d7e7de] pt-4",children:[c.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[c.jsx("label",{className:"text-sm font-semibold text-[#355f43]",children:"Prikaži:"}),c.jsx("select",{value:ge,disabled:N,onChange:_=>Ee(_.target.value),className:`${n} disabled:cursor-not-allowed disabled:opacity-70 sm:w-auto`,children:XL.map(_=>c.jsx("option",{value:_,children:_},`licence-limit-${_}`))}),c.jsx("span",{className:"text-sm text-[#4d6a59]",children:"rezultata"}),c.jsx("span",{className:"mx-1 hidden h-5 w-px bg-[#c9dbd0] md:inline-block"}),c.jsx("label",{className:"text-sm font-semibold text-[#355f43]",children:"Sortiraj:"}),c.jsx("select",{value:me,onChange:_=>le(_.target.value),className:`${n} sm:w-auto`,children:tR.map(_=>c.jsx("option",{value:_.value,children:_.label},`licence-sort-${_.value}`))}),c.jsx("button",{type:"button",disabled:P,onClick:Me,className:"w-full rounded-lg border border-[#9db8aa] bg-white px-3 py-1.5 text-xs font-bold uppercase text-[#2f5f3e] transition hover:bg-[#edf5f1] disabled:cursor-not-allowed disabled:opacity-60 sm:ml-auto sm:w-auto",children:P?"Priprema...":"Preuzmi CSV"})]}),N&&c.jsx(mE,{text:"DohvaÄam licence...",rows:3}),!!w&&c.jsx("p",{className:"text-sm font-semibold text-[#9a2a2a]",children:w}),D&&!N&&y.length===0&&!w&&c.jsx("p",{className:"text-sm font-semibold text-[#2f5f3e]",children:"Nema rezultata za zadane kriterije."}),y.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-sm font-semibold text-[#2f5f3e]",children:["Prikazano ",y.length," od ukupno ",x,"."]}),c.jsx("div",{className:"space-y-3",children:J.map(_=>c.jsxs("article",{className:"rounded-lg border border-[#d2e4da] bg-white p-3",children:[c.jsx("p",{className:"m-0 break-words text-base font-bold text-[#234f34] [overflow-wrap:anywhere]",children:_.nositelj||"-"}),c.jsxs("p",{className:"m-0 mt-1 break-words text-sm text-[#355f43] [overflow-wrap:anywhere]",children:["Broj licence: ",_.broj_licence||"-"]}),c.jsx("p",{className:"m-0 mt-1 break-words text-sm text-[#355f43] [overflow-wrap:anywhere]",children:_.adresa||"-"}),_.telefon&&c.jsxs("p",{className:"m-0 mt-1 break-words text-sm text-[#355f43] [overflow-wrap:anywhere]",children:["Telefon: ",_.telefon]})]},_.licenca_id))}),y.length<x&&V&&c.jsx("div",{className:"pt-1",children:c.jsx("button",{type:"button",disabled:N,onClick:()=>void ie(V,!1),className:"w-full rounded-lg bg-[#376d44] px-4 py-2 text-sm font-bold uppercase text-white transition hover:bg-[#2f5f3e] disabled:cursor-not-allowed disabled:opacity-70 sm:w-auto",children:N?"UÄitavam...":"UÄitaj joÅ¡"})})]})]})]})})}function sR(t){const e=String(t||"").trim();if(!e)return"Nije dostupno";const n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat("hr-HR",{dateStyle:"medium",timeStyle:"short"}).format(n)}function oR({activeTab:t,onTabChange:e,tabBlocks:n,subnavArticles:r,isAdmin:i=!1,exportImportStatus:s=null,exportImportStatusLoading:o=!1,exportImportStatusError:a="",exportImportRunning:l=!1,exportImportRunMessage:u="",onPullExport:d}){const f=t==="sumarstvo-lovstvo"?"sumarstvo-lovstvo":"drvna-tehnologija",p=t==="sumarstvo-lovstvo",m=i&&t==="sumarstvo-lovstvo",g=o||l||!d,y=gE(s,"upisnik-licencija");return c.jsxs("article",{className:"mx-auto w-full max-w-[1320px] overflow-x-hidden px-1 sm:px-2 space-y-5 md:space-y-6",children:[c.jsx(Zu,{items:[{id:"sumarstvo-lovstvo",label:"PodruÄje Å¡umarstva / lovstvo"},{id:"drvna-tehnologija",label:"PodruÄje drvne tehnologije"}],activeId:t,onChange:e}),r??c.jsx(In,{blocks:n[t]??[]}),m&&c.jsxs("div",{className:"rounded-lg border border-[#d8e7dd] bg-[#f7fbf9] p-4",children:[c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"m-0 text-sm font-bold text-[#2f5f3e]",children:"Status exporta"}),c.jsx("p",{className:"m-0 mt-1 text-xs text-[#4f6e5e]",children:"Upisnik licencija"})]}),c.jsxs("button",{type:"button",className:"btn-natural btn-natural-primary inline-flex min-h-10 items-center justify-center gap-2 px-4 py-2 text-sm font-semibold disabled:cursor-not-allowed disabled:opacity-60",onClick:()=>{d==null||d("upisnik-licencija")}
205,disabled:g,children:[l&&c.jsx("span",{className:"h-4 w-4 rounded-full border-2 border-white/80 border-t-transparent animate-spin"}),l?"PovlaÄim export...":"Povuci export"]})]}),o&&c.jsx("p",{className:"m-0 mt-2 text-sm text-[#355843]",children:"UÄitavam..."}),!o&&a&&c.jsx("p",{className:"m-0 mt-2 text-sm font-semibold text-[#b42318]",children:a}),!o&&!a&&u&&c.jsx("p",{className:"m-0 mt-2 text-sm font-semibold text-[#25633d]","aria-live":"polite",children:u}),!o&&!a&&c.jsx("div",{className:"mt-2 space-y-1 text-sm text-[#355843]",children:c.jsxs("p",{className:"m-0",children:[c.jsx("span",{className:"font-semibold",children:"Posljednje povlaÄenje exporta:"})," ",y?sR(y.imported_at):"JoÅ¡ nije povuÄeno"]})})]}),p&&c.jsx(iR,{podrucje:f})]})}function Ar(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function e1(t){const e=String(t||"").trim();if(!e)return Number.MAX_SAFE_INTEGER;const r=e.replace(/\s+/g,"").match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})\.?$/);if(r){const s=Number(r[1]),o=Number(r[2]),a=Number(r[3]),l=Date.UTC(a,o-1,s);if(Number.isFinite(l))return l}const i=Date.parse(e);return Number.isFinite(i)?i:Number.MAX_SAFE_INTEGER}function aR({profile:t}){const e=h.useMemo(()=>[...t.pointsEntries].sort((r,i)=>{const s=e1(r.date)-e1(i.date);return s!==0?s:String(r.title||"").localeCompare(String(i.title||""),"hr",{sensitivity:"base"})}),[t.pointsEntries]);function n(){if(typeof window>"u")return;const r=window.open("","_blank","width=1000,height=760");if(!r)return;const i=`${window.location.origin}/assets/logo.svg`,s=t.pointsPeriods.map(d=>`<p>Ukupan broj bodova za razdoblje od ${Ar(d.from)} do ${Ar(d.to)}: ${Ar(String(d.total))}</p>`).join(""),o=e.map(d=>`<tr> 206 <td>${Ar(d.title)}</td> 207 <td>${Ar(d.date)}</td> 208 <td>${Ar(String(d.points))}</td> 209 <td>${Ar(String(d.legalPoints))}</td> 210 </tr>`).join(""),a=`<!doctype html> 211<html lang="hr"> 212<head> 213 <meta charset="utf-8" /> 214 <title>Profil Älana - ${Ar(t.fullName)}</title> 215 <style> 216 body { font-family: Arial, sans-serif; margin: 24px; color: #1f2937; } 217 .logo-wrap { margin: 0 0 16px; } 218 .logo-wrap img { display: block; max-width: 260px; height: auto; } 219 h1 { margin: 0 0 8px; font-size: 24px; } 220 .meta { margin: 0 0 20px; color: #374151; font-weight: 600; } 221 .periods p { margin: 0 0 6px; } 222 table { width: 100%; border-collapse: collapse; margin-top: 18px; } 223 th, td { border: 1px solid #d1d5db; padding: 8px 10px; text-align: left; font-size: 13px; } 224 th { background: #f3f4f6; } 225 @media print { 226 body { margin: 12mm; } 227 } 228 </style> 229</head> 230<body> 231 <div class="logo-wrap"> 232 <img src="${Ar(i)}" alt="HKISDT" /> 233 </div> 234 <h1>${Ar(t.fullName)}</h1> 235 <p class="meta">${Ar(t.memberCode)} | Älan od ${Ar(t.memberSince)}</p> 236 <section class="periods">${s}</section> 237 <table> 238 <thead> 239 <tr> 240 <th>DogaÄaj</th> 241 <th>Datum</th> 242 <th>Bodovi</th> 243 <th>Bodovi zakon</th> 244 </tr> 245 </thead> 246 <tbody>${o}</tbody> 247 </table> 248</body> 249</html>`;try{r.document.open(),r.document.write(a),r.document.close();try{r.history.replaceState({},"","/print/profil-clana")}catch{}}catch{r.close();return}let l=!1;const u=()=>{l||(l=!0,!r.closed&&(r.focus(),r.print()))};r.addEventListener("load",u,{once:!0}),window.setTimeout(u,350)}return c.jsxs("section",{className:"mx-auto w-full max-w-[1320px] space-y-5 px-1 sm:px-2 md:space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 rounded-lg border border-[#d7e7de] bg-[#f8fcfa] p-4 sm:p-5",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"m-0 break-words text-2xl font-bold text-[#2f5f3e] md:text-3xl",children:[t.fullName," ",c.jsx("span",{className:"block text-xs font-semibold text-[#5b7a68] sm:inline sm:text-sm",children:t.memberCode})]}),c.jsxs("p",{className:"mt-1 text-sm font-semibold text-[#2f5f3e] sm:text-[0.95rem]",children:["Älan od ",t.memberSince]})]}),c.jsx("button",{type:"button",onClick:n,className:"rounded-lg border border-[#9db8aa] bg-white px-4 py-2 text-sm font-bold uppercase text-[#2f5f3e] transition hover:bg-[#edf5f1]",children:"Ispis"})]}),c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"space-y-1 rounded-lg border border-[#d7e7de] bg-white p-4 text-sm font-semibold text-[#2f5f3e] sm:p-5",children:t.pointsPeriods.map(r=>c.jsxs("p",{className:"m-0 leading-relaxed",children:["Ukupan broj bodova za razdoblje od ",r.from," do ",r.to,": ",r.total]},`${r.from}-${r.to}`))}),c.jsx("div",{className:"space-y-3 lg:hidden",children:e.map(r=>c.jsxs("article",{className:"rounded-lg border border-[#c7ddd1] bg-white p-4 shadow-[0_6px_16px_rgba(24,54,39,0.07)]",children:[c.jsx("p",{className:"m-0 text-sm font-bold text-[#2f5f3e]",children:r.title}),c.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs font-semibold text-[#416853]",children:[c.jsxs("div",{className:"rounded-lg bg-[#f2f7f4] px-2.5 py-2",children:[c.jsx("p",{className:"m-0 text-[0.68rem] uppercase text-[#5b7a68]",children:"Datum"}),c.jsx("p",{className:"m-0 mt-1 text-sm text-[#2f5f3e]",children:r.date})]}),c.jsxs("div",{className:"rounded-lg bg-[#f2f7f4] px-2.5 py-2",children:[c.jsx("p",{className:"m-0 text-[0.68rem] uppercase text-[#5b7a68]",children:"Bodovi"}),c.jsx("p",{className:"m-0 mt-1 text-sm text-[#2f5f3e]",children:r.points})]}),c.jsxs("div",{className:"col-span-2 rounded-lg bg-[#f2f7f4] px-2.5 py-2",children:[c.jsx("p",{className:"m-0 text-[0.68rem] uppercase text-[#5b7a68]",children:"Bodovi zakon"}),c.jsx("p",{className:"m-0 mt-1 text-sm text-[#2f5f3e]",children:r.legalPoints})]})]})]},`${r.title}-${r.date}`))}),c.jsxs("div",{className:"hidden overflow-hidden rounded-lg border border-[#2f5f3e]/40 lg:block",children:[c.jsxs("div",{className:"grid grid-cols-[2.2fr_1fr_0.8fr_1fr] bg-[#2f5f3e] text-sm font-semibold text-white",children:[c.jsx("div",{className:"min-w-0 px-4 py-3 text-center",children:"DogaÄaj"}),c.jsx("div",{className:"min-w-0 px-4 py-3 text-center",children:"Datum"}),c.jsx("div",{className:"min-w-0 px-4 py-3 text-center",children:"Bodovi"}),c.jsx("div",{className:"min-w-0 px-4 py-3 text-center",children:"Bodovi zakon"})]}),e.map(r=>c.jsxs("div",{className:"grid grid-cols-[2.2fr_1fr_0.8fr_1fr] border-t border-[#2f5f3e]/30 text-sm",children:[c.jsx("div",{className:"min-w-0 break-words px-4 py-3 text-center font-semibold text-[#2f5f3e] [overflow-wrap:anywhere]",children:r.title}),c.jsx("div",{className:"min-w-0 break-words px-4 py-3 text-center font-semibold text-[#2f5f3e] [overflow-wrap:anywhere]",children:r.date}),c.jsx("div",{className:"min-w-0 break-words px-4 py-3 text-center font-semibold text-[#2f5f3e] [overflow-wrap:anywhere]",children:r.points}),c.jsx("div",{className:"min-w-0 break-words px-4 py-3 text-center font-semibold text-[#2f5f3e] [overflow-wrap:anywhere]",children:r.legalPoints})]},`${r.title}-${r.date}`))]})]})]})}function lR(){const[t,e]=h.useState(()=>Hb());h.useEffect(()=>Pv(r=>{e(!!(r!=null&&r.externalServices))}),[]);
249function n(){zv()}return c.jsxs("section",{className:"mx-auto w-full max-w-[1320px] rounded-lg border border-[#d7e7de] bg-[#f7fbf9] p-4 shadow-sm sm:p-5 md:p-8",children:[c.jsxs("div",{className:"mb-6 text-center md:mb-8",children:[c.jsx("h2",{className:"text-2xl font-extrabold text-[#1f4630] md:text-3xl",children:"Radno vrijeme"}),c.jsx("p",{className:"mt-1 text-lg text-[#31563d]",children:"pon - pet: 07 - 15 h"})]}),c.jsxs("div",{className:"grid gap-5 md:gap-6 lg:grid-cols-2",children:[c.jsxs("article",{className:"rounded-lg border border-[#d0ddd8] bg-white p-4 shadow-[0_6px_18px_rgba(0,0,0,0.06)] sm:p-5 md:p-6",children:[c.jsx("h3",{className:"mb-5 text-xl font-bold text-[#2f5f3e]",children:"Kontakti"}),c.jsxs("div",{className:"space-y-4 text-base text-[#31563d] md:text-lg",children:[c.jsx("p",{className:"leading-relaxed",children:"Tel: +385 1 376 5501, +385 1 376 5502"}),c.jsx("p",{className:"leading-relaxed",children:"Fax: +385 1 376 5504"}),c.jsxs("p",{className:"leading-relaxed",children:["E-mail:"," ",c.jsx("a",{href:"mailto:[email protected]",className:"rounded-[4px] px-1 py-[1px] font-semibold text-[#1f5b3a] underline decoration-[#2a7a4c] decoration-2 underline-offset-[4px] transition duration-200 hover:text-[#16442c] hover:decoration-[#16442c] hover:underline-offset-[6px] hover:shadow-[inset_0_-0.52em_0_rgba(85,196,130,0.22)]",children:"[email protected]"})]})]})]}),c.jsxs("article",{className:"rounded-lg border border-[#d0ddd8] bg-white p-4 shadow-[0_6px_18px_rgba(0,0,0,0.06)] sm:p-5 md:p-6",children:[c.jsx("h3",{className:"mb-5 text-xl font-bold text-[#2f5f3e]",children:"Lokacija"}),c.jsxs("div",{className:"grid gap-4",children:[t?c.jsx("div",{className:"overflow-hidden rounded-lg border border-[#cfe0d8]",children:c.jsx("iframe",{src:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2781.0331337181265!2d15.958811676644611!3d45.81059481025963!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4765d6e6e9ea27ab%3A0x6d9ec578c05deac7!2zSEtJxaBEVA!5e0!3m2!1shr!2shr!4v1771443338374!5m2!1shr!2shr",width:"600",height:"450",style:{border:0},allowFullScreen:!0,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",className:"h-[220px] w-full sm:h-[250px] md:h-[300px]"})}):c.jsxs("div",{className:"flex h-[220px] w-full flex-col items-center justify-center rounded-lg border border-dashed border-[#aac6b7] bg-[#f5faf7] p-4 text-center sm:h-[250px] md:h-[300px]",children:[c.jsx("p",{className:"m-0 max-w-[460px] text-sm leading-6 text-[#2f5f3e]",children:"Karta je privremeno skrivena dok ne dopustiÅ¡ vanjske usluge (Google Maps)."}),c.jsx("button",{type:"button",className:"btn-natural mt-3 rounded-md bg-[#2f7d4c] px-3 py-2 text-sm font-semibold text-white hover:bg-[#276a40]",onClick:n,children:"OmoguÄi kartu"})]}),c.jsxs("p",{className:"text-center text-base leading-relaxed text-[#31563d] md:text-lg",children:["Prilaz Gjure DeželiÄa 63",c.jsx("br",{}),"10000 Zagreb"]})]})]})]})]})}function cR(){return c.jsx("section",{className:"mx-auto w-full max-w-[920px] px-1 sm:px-2",children:c.jsxs("div",{className:"overflow-hidden rounded-lg border border-[#c9ddd0] bg-white shadow-[0_18px_45px_rgba(31,51,40,0.11)]",children:[c.jsx("div",{className:"border-b border-[#d8e7dd] bg-[#eef7f1] px-5 py-3",children:c.jsx("p",{className:"m-0 text-xs font-extrabold uppercase tracking-[0.04em] text-[#2f5f3e]",children:"Status datoteke"})}),c.jsxs("div",{className:"px-5 py-7 sm:px-7 sm:py-8",children:[c.jsx("span",{className:"mb-4 inline-flex h-11 w-11 items-center justify-center rounded-full bg-[#2f5f3e] text-xl font-extrabold text-white",children:"i"}),c.jsx("h2",{className:"m-0 text-2xl font-extrabold leading-tight text-[#183322] sm:text-3xl",children:"Datoteka nije pronaÄena"}),c.jsx("p",{className:"mt-3 max-w-[62ch] text-base leading-7 text-[#395746]",children:"Tražena datoteka viÅ¡e nije dostupna na CDN-u ili poveznica ne vodi na postojeÄu datoteku."}),c.jsx("p",{className:"mt-5 max-w-[62ch] border-l-4 border-[#6ea77d] bg-[#f4faf6] px-4 py-3 text-base font-semibold leading-7 text-[#2b4c37]",children:"Ako mislite da je ovo pogreÅ¡ka, ponovno uÄitajte datoteku kroz administraciju i spremite sadržaj."})]})]})})}function uR({route:t,newsSectionTitle:e="Vijesti",isAdminLoggedIn:n,exportImportStatus:r,exportImportStatusLoading:i,exportImportStatusError:s,exportImportRunning:o,exportImportRunMessage:a,onPullExportImport:l,selectedNews:u,selectedNewsBlocks:d,visibleNews:f,archivedNews:p,archivedNewsBlocksById:m,hasMoreNews:g,onOpenNews:y,onLoadMore:j,onBackToList:x,onEditNews:k,onDeleteNews:N,onMoveNews:C,onReorderNews:w,onArchiveNews:E,onUnarchiveNews:D,onAddNews:L,onEnsureNewsDetailLoa
249ded:V,newsArchiveOpenRequestId:te,newsArchiveTargetNewsId:ae,aktiTab:ke,onAktiTabChange:ge,aktiIntroBlocks:Se,aktiTabBlocks:me,obrasciTab:H,onObrasciTabChange:P,obrasciIntroBlocks:z,obrasciTabBlocks:Y,imenikTab:Q,onImenikTabChange:O,imenikTabBlocks:U,upisnikLicencijaTab:$,onUpisnikLicencijaTabChange:J,upisnikLicencijaTabBlocks:ie,operativneTab:oe,onOperativneTabChange:be,operativneZapisniciBlocks:Ee,operativneIzboriBlocks:le,projectsCardItems:Me,projectDetailBlocksById:_,selectedProjectId:ce,visibleProjectsCount:de,hasMoreProjects:De,onOpenProject:Oe,onBackToProjects:He,onVisibleProjectsCountChange:ot,prezentacijeItems:Ge,visiblePrezentacijeCount:Te,hasMorePrezentacije:Ke,onVisiblePrezentacijeCountChange:Ne,onEditProject:_e,onDeleteProject:We,onArchiveProject:tt,onReorderProject:at,onEditPrezentacija:Ut,onDeletePrezentacija:vt,onArchivePrezentacija:b,onMovePrezentacija:T,onReorderPrezentacija:S,onAddPrezentacija:I,adminArticlesSection:K,renderEditableArticles:X,renderSubnavArticles:G,isMemberLoggedIn:re,activeMember:pe,hasRouteArticleContent:ue,defaultCardImage:Ve,searchTargetId:Fe}){return t==="vijesti"?c.jsxs(c.Fragment,{children:[c.jsx(NL,{sectionTitle:e,selectedNews:u,selectedNewsBlocks:d,visibleNews:f,archivedNews:p,archivedNewsBlocksById:m,hasMoreNews:g,onOpenNews:y,onLoadMore:j,onBackToList:x,isAdmin:n,onEditNews:k,onDeleteNews:N,onMoveNews:C,onReorderNews:w,onArchiveNews:E,onUnarchiveNews:D,onAddNews:L,onEnsureNewsDetailLoaded:V,archiveOpenRequestId:te,archiveOpenTargetNewsId:ae,hasRouteArticleContent:ue}),K]}):t==="o-komori"?c.jsxs(c.Fragment,{children:[X(t),K]}):t==="struktura-komore"?c.jsxs(c.Fragment,{children:[X(t),K]}):t==="akti-komore"?c.jsxs(c.Fragment,{children:[c.jsx(ML,{introBlocks:Se,activeTab:ke,onTabChange:ge,tabBlocks:me,subnavArticles:G(t,ke)}),X(t),K]}):t==="obrasci"?c.jsxs(c.Fragment,{children:[c.jsx(IL,{introBlocks:z,activeTab:H,onTabChange:P,tabBlocks:Y,subnavArticles:G(t,H)}),X(t),K]}):t==="operativne-informacije"?c.jsxs(c.Fragment,{children:[c.jsx(zL,{activeTab:oe,onTabChange:be,zapisniciBlocks:Ee,izboriBlocks:le,subnavArticles:G(t,oe)}),X(t),K]}):t==="imenik"?c.jsxs(c.Fragment,{children:[c.jsx(QL,{activeTab:Q,onTabChange:O,tabBlocks:U,subnavArticles:G(t,Q),isAdmin:n,exportImportStatus:r,exportImportStatusLoading:i,exportImportStatusError:s,exportImportRunning:o,exportImportRunMessage:a,onPullExport:l}),X(t),K]}):t==="upisnik-licencija"?c.jsxs(c.Fragment,{children:[X(t),c.jsx(oR,{activeTab:$,onTabChange:J,tabBlocks:ie,subnavArticles:G(t,$),isAdmin:n,exportImportStatus:r,exportImportStatusLoading:i,exportImportStatusError:s,exportImportRunning:o,exportImportRunMessage:a,onPullExport:l}),K]}):t==="projekti"?c.jsxs(c.Fragment,{children:[X(t),K,c.jsx(EL,{items:Me,detailBlocksById:_,pageSize:4,defaultCardImage:Ve,selectedProjectId:ce,onSelectProject:et=>{if(et){Oe(et);return}He()},visibleProjectsCount:de,hasMoreProjects:De,onVisibleProjectsCountChange:ot,isAdmin:n,onEditProject:_e,onDeleteProject:We,onArchiveProject:tt,onReorderProject:at,hasRouteArticleContent:ue,searchTargetId:Fe})]}):t==="strucno-dogadaji"?c.jsxs(c.Fragment,{children:[X(t),K]}):t==="strucno-prezentacije"?c.jsxs(c.Fragment,{children:[X(t),K,c.jsx(AL,{items:Ge,pageSize:4,visibleCount:Te,hasMorePrezentacije:Ke,onVisibleCountChange:Ne,isAdmin:n,onAddPrezentacija:I,onEditPrezentacija:Ut,onDeletePrezentacija:vt,onArchivePrezentacija:b,onMovePrezentacija:T,onReorderPrezentacija:S,hasRouteArticleContent:ue,searchTargetId:Fe})]}):t==="profil-clana"?!re||!pe?c.jsx(Cl,{message:"Prijavite se za pristup profilu clana."}):c.jsx(aR,{profile:pe.profile}):t==="kontakti"?c.jsx(lR,{}):t==="datoteka-nije-pronadena"?c.jsx(cR,{}):c.jsxs(c.Fragment,{children:[X(t),K]})}async function dR(t,e){const n=await Ol("/api/auth/login",{body:{prijava:t,lozinka:e}});return n!=null&&n.token&&BM(String(n.token)),n}function fR(){return Hr("/api/auth/me",{auth:!0})}function t1(){tN()}const pR="hkisdt_admin_logged_in",mR="hkisdt_member_logged_in",hR="hkisdt_member_user_id";function Xd(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?String(t):new Intl.DateTimeFormat("hr-HR").format(e)}function gR(t){return{fullName:String((t==null?void 0:t.puno_ime)||""),memberCode:String((t==null?void 0:t.oznaka_clana)||""),memberSince:Xd(t==null?void 0:t.clan_od),pointsPeriods:Array.isArray(t==null?void 0:t.razdoblja)?t.razdoblja.map(e=>({from:Xd(e==null?void 0:e.datum_od),to:Xd(e==null?void 0:e.datum_do),total:Number((e==null?void 0:e.ukupno_bodova)||0)}
249)):[],pointsEntries:Array.isArray(t==null?void 0:t.stavke)?t.stavke.map(e=>({title:String((e==null?void 0:e.naziv_dogadaja)||""),date:Xd(e==null?void 0:e.datum_dogadaja),points:Number((e==null?void 0:e.bodovi)||0),legalPoints:Number((e==null?void 0:e.bodovi_zakon)||0)})):[]}}function bR(t,e){return t instanceof Error&&t.message.trim()?t.message:e}function xR({onAdminLogin:t,onMemberLogin:e,onMemberLogout:n}){const[r,i]=h.useState(""),[s,o]=h.useState(""),[a,l]=h.useState(""),[u,d]=h.useState(!1),[f,p]=h.useState(!1),[m,g]=h.useState(null),[y,j]=h.useState(null);function x(){tN(),typeof window<"u"&&(window.localStorage.removeItem(pR),window.localStorage.removeItem(mR),window.localStorage.removeItem(hR)),d(!1),p(!1),g(null),j(null)}async function k(E){try{const D=await j4(E&&E>0?E:void 0);return gR(D)}catch{return null}}h.useEffect(()=>{let E=!0;return(async()=>{var L;if(!eN()){x();return}try{const V=await fR();if(!E)return;if(V.uloga==="admin"){d(!0),p(!1),g(null),j(ts(V.korisnicko_ime||V.email));return}const te=await k(((L=V.clan)==null?void 0:L.clan_id)??null);if(!E)return;d(!1),p(!0),g(te),j(null)}catch{if(!E)return;x()}})(),()=>{E=!1}},[]);async function N(E){E.preventDefault();const D=r.trim(),L=s.trim();if(!D||!L){l("Potrebni su korisnicko ime i lozinka.");return}try{const V=await dR(D,L);if(V.user.uloga==="admin"){d(!0),p(!1),g(null),j(ts(V.user.korisnicko_ime||V.user.email)),l(""),i(""),o(""),t();return}const te=await k(V.user.clan_id);d(!1),p(!0),g(te),j(null),l(""),i(""),o(""),e()}catch(V){x(),l(bR(V,"Neispravni prijavni podaci."))}}function C(){t1(),x(),l("")}function w(){t1(),x(),n()}return{loginEmail:r,loginPassword:s,loginError:a,setLoginEmail:i,setLoginPassword:o,setLoginError:l,isAdminLoggedIn:u,activeAdminDisplayName:y,isMemberLoggedIn:f,activeMember:m?{profile:m}:null,handleProfileLogin:N,handleAdminLogout:C,handleMemberLogout:w}}const Yp="__base__",Cx="db-unos-",Qo="__vijest__:",Xo="__projekt__:";function ur(t,e=""){return typeof t=="string"?t:t==null?e:String(t)}function Ts(t){return ur(t).trim()||void 0}function vR(t){return typeof t=="string"||Array.isArray(t)?t:ur(t)}function Tf(t){return`${Cx}${Number(t||0)}`}function Gs(t){const e=String(t||"");if(!e.startsWith(Cx))return null;const n=Number(e.slice(Cx.length));return Number.isFinite(n)&&n>0?n:null}function Oc(t){return`${Qo}${Number(t||0)}`}function yR(t){const e=String(t||"").trim();if(!e.startsWith(Qo))return null;const n=Number(e.slice(Qo.length));return Number.isFinite(n)&&n>0?n:null}function $a(t){return`${Xo}${Number(t||0)}`}function kR(t){const e=String(t||"").trim();if(!e.startsWith(Xo))return null;const n=Number(e.slice(Xo.length));return Number.isFinite(n)&&n>0?n:null}function $u(t){return[...Array.isArray(t.blokovi)?t.blokovi:[]].sort((r,i)=>Number(r.redoslijed||0)-Number(i.redoslijed||0)).map((r,i)=>{const s=r.blok_id?`db-blok-${r.blok_id}`:`db-blok-${i+1}`,o=r.payload&&typeof r.payload=="object"?r.payload:{};if(r.tip_bloka==="heading")return{id:s,type:"heading",text:ur(o.text).trim()||"Bez naslova",level:o.level==="article"||o.level==="section"?o.level:void 0,accent:!!o.accent};if(r.tip_bloka==="paragraph")return{id:s,type:"paragraph",text:vR(o.text)};if(r.tip_bloka==="list"){const a=Array.isArray(o.items)?o.items:[];return{id:s,type:"list",items:a,ordered:!!o.ordered}}if(r.tip_bloka==="image")return{id:s,type:"image",src:ur(o.src),alt:ur(o.alt),fileName:Ts(o.fileName)??Ts(o.file_name)??Ts(o.naziv_datoteke),caption:ur(o.caption)};if(r.tip_bloka==="published_date")return{id:s,type:"publishedDate",date:ur(o.date),useToday:!!o.useToday,resolvedDate:ur(o.resolvedDate)};if(r.tip_bloka==="documents"){const a=Array.isArray(o.items)?o.items:[];return{id:s,type:"documents",title:ur(o.title),items:a.map(l=>{const u=l;return{label:Ts(u.label)??Ts(u.naziv)??Ts(u.title)??Ts(u.fileName)??Ts(u.file_name)??"Dokument",pdfUrl:ur(u.pdfUrl??u.pdf_url),wordUrl:ur(u.wordUrl??u.word_url),pptUrl:ur(u.pptUrl??u.ppt_url),excelUrl:ur(u.excelUrl??u.excel_url)}})}}return null}).filter(r=>!!r)}function Vo(t){return t.map((e,n)=>{const r=(n+1)*10;return e.type==="heading"?{tip_bloka:"heading",redoslijed:r,payload:{text:e.text,level:e.level,accent:!!e.accent}}:e.type==="paragraph"?{tip_bloka:"paragraph",redoslijed:r,payload:{text:e.text}}:e.type==="list"?{tip_bloka:"list",redoslijed:r,payload:{items:e.items,ordered:!!e.ordered}}:e.type==="image"?{tip_bloka:"image",redoslijed:r,payload:{src:e.src,alt:e.alt,fileName:e.fileName,caption:e.caption}}:e.type==="publishedDate"?{tip_bloka:"published_date",redoslijed:r,payload:{date:e.date,useToday:!!e.useToday,resolvedDate:e.resolvedDate}}:{tip_bloka:"documents",redoslijed:r,payload:{title:e.title,items:e.items}}})}const jR=["licenciranje","cekici","popratnice","racunalne-baze","strucno","strucno-dogadaji","strucno-prezentacije","projekti"];function wR(t){return String(t.status||"").trim().toLowerCase()==="arhivirano"}function Da(t){return jf(t).filter(e=>!wR(e))}function zg(t){return jR.includes(t)}function SR({route:t,isAdminLoggedIn:e,isAdminEditorDisabled:n,adminArticlesByRoute:r,setAdminArticlesByRoute:i,routeArticleOverrides:s,setRouteArticleOverrides:o,subnavArticleOverrides:a,setSubnavArticleOverrides:l,getBaseRouteArticles:u,getSubnavBaseSections:d,getEmptyNoticeMessage:f,setAdminExternalDraftBlocks:p,setAdminExternalDraftRequestId:m,setAdminEditorMode:g,setAdminEditTarget:y,setAdminPageEditContext:j,setAdminRouteEditContext:x,setSubnavDraftContext:k,setAdminEditorModalOpen:N,onDeleteRouteArticle:C,onDeleteSubnavArticle:w,onArchiveRouteArticle:E,onArchiveSubnavArticle:D}){const[L,V]=h.useState(null),[te,ae]=h.useState(null),[ke,ge]=h.useState(!1),[Se,me]=h.useState(!1),[H,P]=h.useState(""),[z,Y]=h.useState(!1),[Q,O]=h.useState(null),[U,$]=h.useState(null),[J,ie]=h.useState(null),oe=h.useRef(null);oe.current||(oe.current=Ll());const be=r[t]??[],Ee=Da(be),le=["akti-komore","obrasci","operativne-informacije","imenik","upisnik-licencija","projekti","strucno-prezentacije","vijesti","kontakti"];h.useEffect(()=>()=>{var b;(b=oe.current)==null||b.stop()},[]);function Me(b,T,S){const I=b.findIndex(re=>re.id===T),K=b.findIndex(re=>re.id===S);if(I<0||K<0||I===K)return{next:b,moved:!1};const X=[...b],[G]=X.splice(I,1);return X.splice(K,0,G),{next:X,moved:!0}}async function _(b){const T=b.map((S,I)=>{const K=Gs(S.id);return K?{unosId:K,redoslijed:(b.length-I)*10}:null}).filter(S=>!!S);T.length!==0&&await Promise.all(T.map(S=>li(S.unosId,{redoslijed:S.redoslijed})))}async function ce(b,T,S){if(z)return;const I=Da(r[b]??[]),K=Me(I,T,S);if(K.moved){P(""),Y(!0),i(X=>({...X,[b]:K.next}));try{await _(K.next)}catch(X){console.error("Drag&drop promjena redoslijeda Älanaka nije uspjela:",X),i(G=>({...G,[b]:I})),P("Spremanje novog redoslijeda nije uspjelo. PokuÅ¡aj ponovno.")}finally{Y(!1)}}}async function de(b,T,S){if(z)return;const I=u(b),K=Da(s[b]??I),X=Me(K,T,S);if(X.moved){P(""),Y(!0),o(G=>({...G,[b]:X.next}));try{await _(X.next)}catch(G){console.error("Drag&drop promjena redoslijeda base Älanaka nije uspjela:",G),o(re=>({...re,[b]:K})),P("Spremanje novog redoslijeda nije uspjelo. PokuÅ¡aj ponovno.")}finally{Y(!1)}}}async function De(b,T,S,I){var re;if(z)return;const K=d(b,T),X=Da(((re=a[b])==null?void 0:re[T])??K),G=Me(X,S,I);if(G.moved){P(""),Y(!0),l(pe=>({...pe,[b]:{...pe[b]??{},[T]:G.next}}));try{await _(G.next)}catch(pe){console.error("Drag&drop promjena redoslijeda podnav Älanaka nije uspjela:",pe),l(ue=>({...ue,[b]:{...ue[b]??{},[T]:X}}
249)),P("Spremanje novog redoslijeda nije uspjelo. PokuÅ¡aj ponovno.")}finally{Y(!1)}}}function Oe(){var b;O(null),$(null),ie(null),(b=oe.current)==null||b.stop()}function He(b,T,S){!e||n||z||(O(b),ie(T),S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",b))}function ot(b,T,S){var K;if(!e||n||z||J!==T)return;(K=oe.current)==null||K.update(S.clientY);const I=S.dataTransfer.getData("text/plain")||Q;!I||I===b||(S.preventDefault(),S.dataTransfer.dropEffect="move",$(b))}async function Ge(b,T,S,I){if(!e||n||z)return;if(I.preventDefault(),J!==S){Oe();return}const K=I.dataTransfer.getData("text/plain")||Q;if(!K||K===T){Oe();return}try{await ce(b,K,T)}finally{Oe()}}async function Te(b,T,S,I){if(!e||n||z)return;if(I.preventDefault(),J!==S){Oe();return}const K=I.dataTransfer.getData("text/plain")||Q;if(!K||K===T){Oe();return}try{await de(b,K,T)}finally{Oe()}}async function Ke(b,T,S,I,K){if(!e||n||z)return;if(K.preventDefault(),J!==I){Oe();return}const X=K.dataTransfer.getData("text/plain")||Q;if(!X||X===S){Oe();return}try{await De(b,T,X,S)}finally{Oe()}}function Ne(b){for(const T of b.blocks)if(T.type==="heading"&&T.text.trim().length>0||T.type==="paragraph"&&typeof T.text=="string"&&T.text.trim().length>0)return T.text.trim();return"odabrani Älanak"}async function _e(){var T;if(!L||ke)return;const b=L;ge(!0);try{if(b.scope==="admin")C?await C(b.route,b.entryId,"admin"):i(S=>({...S,[b.route]:kf(S[b.route]??[],b.entryId)}));else if(b.scope==="base")if(C)await C(b.route,b.entryId,"base");else{const S=u(b.route),I=s[b.route]??S;o(K=>({...K,[b.route]:kf(I,b.entryId)}))}else if(w)await w(b.route,b.tabId,b.entryId);else{const S=d(b.route,b.tabId),I=((T=a[b.route])==null?void 0:T[b.tabId])??S;l(K=>({...K,[b.route]:{...K[b.route]??{},[b.tabId]:kf(I,b.entryId)}}))}V(null)}finally{ge(!1)}}async function We(){var T;if(!te||Se)return;const b=te;me(!0);try{if(b.scope==="admin")E?await E(b.route,b.entryId,"admin"):i(S=>({...S,[b.route]:(S[b.route]??[]).filter(I=>I.id!==b.entryId)}));else if(b.scope==="base")if(E)await E(b.route,b.entryId,"base");else{const S=u(b.route),I=s[b.route]??S;o(K=>({...K,[b.route]:I.filter(X=>X.id!==b.entryId)}))}else if(D)await D(b.route,b.tabId,b.entryId);else{const S=d(b.route,b.tabId),I=((T=a[b.route])==null?void 0:T[b.tabId])??S;l(K=>({...K,[b.route]:{...K[b.route]??{},[b.tabId]:I.filter(X=>X.id!==b.entryId)}}))}ae(null)}finally{me(!1)}}const tt=c.jsxs(c.Fragment,{children:[c.jsx(vr,{open:!!L,title:"Obrisati Älanak?",description:L?`Älanak "${L.articleTitle}" bit Äe trajno obrisan. Ova radnja se ne može poniÅ¡titi.`:"Odabrani Älanak bit Äe trajno obrisan.",confirmLabel:ke?"Brisanje...":"ObriÅ¡i Älanak",cancelLabel:"Odustani",onCancel:()=>{ke||V(null)},onConfirm:()=>{_e()}}),c.jsx(vr,{open:!!te,title:"Arhivirati Älanak?",description:te?`Älanak "${te.articleTitle}" bit Äe maknut iz javnog prikaza i premjeÅ¡ten u arhivu.`:"Odabrani Älanak bit Äe premjeÅ¡ten u arhivu.",confirmLabel:Se?"Arhiviranje...":"Arhiviraj Älanak",cancelLabel:"Odustani",onCancel:()=>{Se||ae(null)},onConfirm:()=>{We()}})]});function at(){if(Ee.length===0)return null;const b=`admin:${t}`;return c.jsxs("div",{className:"space-y-8",children:[H&&c.jsx("div",{className:"rounded-lg border border-[#e2b8b8] bg-[#fff6f6] px-3 py-2 text-sm font-semibold text-[#8b1e1e]",children:H}),Ee.map((T,S)=>c.jsxs("section",{id:Fn({kind:"article",route:t,entryId:T.id}),className:`${e?"rounded-xl border border-[#d4e2db] bg-white p-3":""} transition ${Q===T.id?"opacity-60":""} ${J===b&&U===T.id&&Q!==T.id?"ring-2 ring-[#4f8a63]/35":""}`,draggable:e&&!n&&!z,onDragStart:I=>He(T.id,b,I),onDragOver:I=>ot(T.id,b,I),onDrop:I=>{Ge(t,T.id,b,I)},onDragEnd:Oe,children:[c.jsx(In,{blocks:T.blocks,audit:e?T.audit:void 0}),e&&!n&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-end gap-2 border-t border-[#edf3ef] pt-2",children:[c.jsx("button",{type:"button",onClick:()=>{p(T.blocks),m(Date.now()),g("edit"),y(null),j(null),k(null),x({route:t,entryId:T.id}),N(!0)},className:"rounded-md border border-[#111111] bg-[#111111] px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-white hover:text-[#111111]",children:"Uredi Älanak"}),c.jsx("button",{type:"button",onClick:()=>V({scope:"admin",route:t,entryId:T.id,articleTitle:Ne(T)}),className:"rounded-md border border-[#c81e1e] bg-[#c81e1e] px-3 py-1.5 text-xs font-semibold text-white transition hover:border-[#e8a9a9] hover:bg-[#ffe8e8] hover:text-[#8b1e1e]",children:"ObriÅ¡i Älanak"}),zg(t)&&c.jsx("button",{type:"button",onClick:()=>ae({scope:"admin",route:t,entryId:T.id,articleTitle:Ne(T)}),className:"rounded-md border border-[#3f4f46] bg-white px-3 py-1.5 text-xs font-semibold text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35]",children:"Arhiviraj Älanak"})]})]},`admin-route-article-${t}-${T.id}`))]})}function Ut(b){const T=u(b),S=s[b]??T,I=Da(S),K=I.length>0||Ee.length>0,X=!le.includes(b),G=`base:${b}`;return c.jsxs(c.Fragment,{children:[H&&c.jsx("div",{className:"mb-3 rounded-lg border border-[#e2b8b8] bg-[#fff6f6] px-3 py-2 text-sm font-semibold text-[#8b1e1e]",children:H}),X&&!K&&c.jsx(Cl,{message:f(b)}),I.length>0&&c.jsx("div",{className:"space-y-8",children:I.map((re,pe)=>c.jsxs("section",{id:Fn({kind:"article",route:b,entryId:re.id}),className:`${e?"rounded-xl border border-[#d4e2db] bg-white p-3":""} transition ${Q===re.id?"opacity-60":""} ${J===G&&U===re.id&&Q!==re.id?"ring-2 ring-[#4f8a63]/35":""}`,draggable:e&&!n&&!z,onDragStart:ue=>He(re.id,G,ue),onDragOver:ue=>ot(re.id,G,ue),onDrop:ue=>{Te(b,re.id,G,ue)},onDragEnd:Oe,children:[c.jsx(In,{blocks:re.blocks,audit:e?re.audit:void 0}),e&&!n&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-end gap-2 border-t border-[#edf3ef] pt-2",children:[c.jsx("button",{type:"button",onClick:()=>{p(re.blocks),m(Date.now()),g("edit"),y(null),x(null),k(null),j({route:b,entryId:re.id}),N(!0)},className:"rounded-md border border-[#111111] bg-[#111111] px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-white hover:text-[#111111]",children:"Uredi Älanak"}),c.jsx("button",{type:"button",onClick:()=>V({scope:"base",route:b,entryId:re.id,articleTitle:Ne(re)}),className:"rounded-md border border-[#c81e1e] bg-[#c81e1e] px-3 py-1.5 text-xs font-semibold text-white transition hover:border-[#e8a9a9] hover:bg-[#ffe8e8] hover:text-[#8b1e1e]",children:"ObriÅ¡i Älanak"}),zg(b)&&c.jsx("button",{type:"button",onClick:()=>ae({scope:"base",route:b,entryId:re.id,articleTitle:Ne(re)}),className:"rounded-md border border-[#3f4f46] bg-white px-3 py-1.5 text-xs font-semibold text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35]",children:"Arhiviraj Älanak"})]})]},`base-route-article-${b}-${re.id}`))})]})}function vt(b,T){var pe;const S=d(b,T),I=((pe=a[b])==null?void 0:pe[T])??S,K=Da(I),X=K.length>0,G=b==="upisnik-licencija"&&T==="drvna-tehnologija",re=`subnav:${b}:${T}`;return c.jsxs("div",{className:"space-y-4",children:[H&&c.jsx("div",{className:"rounded-lg border border-[#e2b8b8] bg-[#fff6f6] px-3 py-2 text-sm font-semibold text-[#8b1e1e]",children:H}),e&&!n&&c.jsx("div",{className:"flex justify-end",children:c.jsx("button",{type:"button",className:"rounded-full border-2 border-[#2f8f4b] bg-[#2f8f4b] px-4 py-2 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-
249px hover:border-[#8ccb9d] hover:bg-[#dff7e5] hover:text-[#1f5a31]",onClick:()=>{p([]),m(Date.now()),g("add"),y(null),j(null),x(null),k({route:b,tabId:T,entryId:null}),N(!0)},children:"Dodaj Älanak"})}),!X&&!G&&c.jsx(Cl,{message:f(b,T)}),K.map((ue,Ve)=>c.jsxs("section",{id:Fn({kind:"subnav",route:b,tabId:T,entryId:ue.id}),className:`${e?"rounded-xl border border-[#d4e2db] bg-white p-3":""} transition ${Q===ue.id?"opacity-60":""} ${J===re&&U===ue.id&&Q!==ue.id?"ring-2 ring-[#4f8a63]/35":""}`,draggable:e&&!n&&!z,onDragStart:Fe=>He(ue.id,re,Fe),onDragOver:Fe=>ot(ue.id,re,Fe),onDrop:Fe=>{Ke(b,T,ue.id,re,Fe)},onDragEnd:Oe,children:[c.jsx(In,{blocks:ue.blocks,audit:e?ue.audit:void 0}),e&&!n&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-end gap-2 border-t border-[#edf3ef] pt-2",children:[c.jsx("button",{type:"button",onClick:()=>{p(ue.blocks),m(Date.now()),g("edit"),y(null),j(null),x(null),k({route:b,tabId:T,entryId:ue.id}),N(!0)},className:"rounded-md border border-[#111111] bg-[#111111] px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-white hover:text-[#111111]",children:"Uredi Älanak"}),c.jsx("button",{type:"button",onClick:()=>V({scope:"subnav",route:b,tabId:T,entryId:ue.id,articleTitle:Ne(ue)}),className:"rounded-md border border-[#c81e1e] bg-[#c81e1e] px-3 py-1.5 text-xs font-semibold text-white transition hover:border-[#e8a9a9] hover:bg-[#ffe8e8] hover:text-[#8b1e1e]",children:"ObriÅ¡i Älanak"}),zg(b)&&c.jsx("button",{type:"button",onClick:()=>ae({scope:"subnav",route:b,tabId:T,entryId:ue.id,articleTitle:Ne(ue)}),className:"rounded-md border border-[#3f4f46] bg-white px-3 py-1.5 text-xs font-semibold text-[#2f5f3e] transition hover:border-[#2f8f4b] hover:bg-[#edf7ef] hover:text-[#225b35]",children:"Arhiviraj Älanak"})]})]},`subnav-article-${b}-${T}-${ue.id}`))]})}return{adminArticlesSection:at(),renderEditableArticles:Ut,renderSubnavArticles:vt,adminArticlesForCurrentRoute:Ee,deleteConfirmModal:tt}}const Xa="/assets/sume-2.jpg";function bE(t){return t.replace(/-/g," ").toUpperCase()}function Qn(t){return ut(String(t||"").trim())}function NR(t){const e=I4[t],n=Qn(bE(t));return e?{image:String(e.image||"").trim()||Xa,title:Qn(e.title)||n,kicker:Qn(e.kicker)||void 0,alt:void 0}:{image:Xa,title:n,kicker:void 0,alt:void 0}}function Pg(t){const e=String(t||"").trim();if(!e||e.startsWith("data:"))return"";const r=e.split(/[?#]/)[0].split("/").pop()||"";if(!r)return"";try{return decodeURIComponent(r)}catch{return r}}function CR(t){return t instanceof Error&&t.message.trim()?t.message.trim():"Spremanje hero postavki nije uspjelo. PokuÅ¡aj ponovno."}function ER({route:t}){const[e,n]=h.useState({}),[r,i]=h.useState({}),[s,o]=h.useState({}),[a,l]=h.useState({}),[u,d]=h.useState(!1),[f,p]=h.useState(""),[m,g]=h.useState(""),[y,j]=h.useState(""),[x,k]=h.useState(""),[N,C]=h.useState(""),[w,E]=h.useState(!1),[D,L]=h.useState(""),V=h.useMemo(()=>NR(t),[t]),te=!!s[t],ae=a[t]??e[t]??V;h.useEffect(()=>{if(te)return;let me=!0;return(async()=>{try{const P=await x4(t);if(!me)return;const z=Array.isArray(P)&&P[0]?P[0]:null,Y=(z==null?void 0:z.medij_id)==null?null:Number(z.medij_id||0)||null;n(Q=>({...Q,[t]:z?{image:z.medij_url||V.image||"",title:Qn(z.naslov||V.title||""),kicker:Qn(z.kicker)||void 0,alt:Qn(z.alt_tekst)||void 0}:V})),i(Q=>({...Q,[t]:Y}))}catch{if(!me)return;n(P=>({...P,[t]:V})),i(P=>({...P,[t]:null}))}finally{me&&o(P=>({...P,[t]:!0}))}})(),()=>{me=!1}},[te,t,V]);function ke(){p(ae.image),g(Qn(ae.title)),j(Qn(ae.kicker)),k(Pg(ae.image)),C(Qn(ae.alt)),L(""),d(!0)}function ge(){w||(d(!1),L(""))}async function Se(){if(w)return;const me=Qn(bE(t)),H=Qn(m)||Qn(ae.title)||me,P=Qn(y),z=f.trim()||ae.image||V.image,Y=Qn(N);L(""),E(!0);try{let Q=z,O=r[t]??null;const U=String(ae.image||"").trim(),$=!!z&&z!==U;if(z===Xa)O=null,Q=Xa;else if(z.startsWith("data:")){const Ee=await Gp({putanja_ili_url:z,naziv_datoteke:x.trim()||void 0,alt_tekst:Y||void 0}),le=Number((Ee==null?void 0:Ee.medij_id)||0);if(!Number.isFinite(le)||le<=0)throw new Error("Spremanje hero slike nije uspjelo (medij_id nije vraÄen).");O=le,Q=String((Ee==null?void 0:Ee.putanja_ili_url)||"").trim()||z}else if($){const Ee=await Gp({putanja_ili_url:z,naziv_datoteke:x.trim()||Pg(z)||void 0,alt_tekst:Y||void 0}),le=Number((Ee==null?void 0:Ee.medij_id)||0);Number.isFinite(le)&&le>0&&(O=le,Q=String((Ee==null?void 0:Ee.putanja_ili_url)||"").trim()||z)}const ie=await v4({route_slug:t,naslov:H,kicker:P||null,medij_id:O,alt_tekst:Y||null,aktivno:1}),be=String((ie==null?void 0:ie.medij_url)||"").trim()||Q||V.image;l(Ee=>({...Ee,[t]:{image:be,title:H,kicker:P||void 0,alt:Y||void 0}})),i(Ee=>({...Ee,[t]:(ie==null?void 0:ie.medij_id)==null?O:Number(ie.medij_id||0)||null})),d(!1)}catch(Q){L(CR(Q))}finally{E(!1)}}return{heroConfig:ae,heroLoadedForRoute:te,heroEditorOpen:u,heroSaving:w,heroSaveError:D,heroDraftFileName:x,heroDraftTitle:m,heroDraftKicker:y,heroDraftAlt:N,setHeroDraftTitle:g,setHeroDraftKicker:j,setHeroDraftAlt:C,onImageSelect:(me,H)=>{p(me),k(H)},onResetImageToDefault:()=>
249{p(Xa),k(Pg(Xa)||"sume-2.jpg")},openHeroEditor:ke,closeHeroEditor:ge,saveHero:Se}}function TR(){const[t,e]=h.useState({}),[n,r]=h.useState(null),[i,s]=h.useState(0),[o,a]=h.useState(!1),[l,u]=h.useState("add"),[d,f]=h.useState(null),[p,m]=h.useState(null),[g,y]=h.useState(null),[j,x]=h.useState(null);function k(D){y(null),m(null),x(null),r(D),s(L=>L+1),u("edit"),a(!0)}function N(){r([]),s(D=>D+1),u("add"),f(null),m(null),y(null),x(null),a(!0)}function C(D,L=[]){r(L),s(V=>V+1),u("add"),f({type:D,id:0}),m(null),y(null),x(null),a(!0)}function w(D){r([]),s(L=>L+1),u("add"),f(null),m(null),y({route:D,entryId:""}),x(null),a(!0)}function E(){a(!1),u("add"),f(null),m(null),y(null),x(null),r(null)}return{adminArticlesByRoute:t,setAdminArticlesByRoute:e,adminExternalDraftBlocks:n,setAdminExternalDraftBlocks:r,adminExternalDraftRequestId:i,setAdminExternalDraftRequestId:s,adminEditorModalOpen:o,setAdminEditorModalOpen:a,adminEditorMode:l,setAdminEditorMode:u,adminEditTarget:d,setAdminEditTarget:f,adminPageEditContext:p,setAdminPageEditContext:m,adminRouteEditContext:g,setAdminRouteEditContext:y,subnavDraftContext:j,setSubnavDraftContext:x,openAdminDraft:k,openAdminAdd:N,openAdminAddForTarget:C,openAdminAddForRoute:w,closeAdminEditor:E}}const AR=30,ei=1e9,Ex=2e9,xE=19e8,MR=2147e6,Dg=200,Og=20,n1=Dr,r1=4,i1=16,IR=["/assets/hero image.jpg","/assets/sume-2.jpg"],_g=/\b(https?:\/\/[^\s<>'"[\]{}]+|\/?(?:cdn|podaci|dokumenti|api\/web\/dokumenti|web\/dokumenti)\/[^\s<>'"[\]{}]+)/gi,zR=/^https?:\/{3,}(?=(?:cdn|podaci|dokumenti|api\/web\/dokumenti|web\/dokumenti)(?:\/|$))/i;function Le(t,e=""){return t==null?e:String(t).trim()||e}function el(t,e=""){return ut(Le(t,e))}function vE(t){if(t==null||String(t).trim()==="")return"";const e=String(t).trim(),n=new Date(e);return Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat("hr-HR").format(n)}function s1(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`}function Qp(t){const e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(t||"").trim());if(!e)return"";const[,n,r,i]=e;return`${i}.${r}.${n}.`}function Tx(t){const e=Ii(t);return e?Qp(e):Yt(t)}function Rl(t){return ut(String(t??"")).replace(/\u00A0/g," ").replace(/\r\n/g,` 250`).replace(/\r/g,` 251`).split(` 252`).map(r=>r.replace(/[ \t]+/g," ").trim()).filter((r,i,s)=>r.length>0||i>0&&i<s.length-1).join(` 253`).replace(/\n{3,}/g,` 254 255`).trim()}function o1(t){return ut(String(t??"")).replace(/\u00A0/g," ").replace(/\r\n/g,` 256`).replace(/\r/g,` 257`).replace(/[ \t]+/g," ").replace(/[ \t]*\n[ \t]*/g,` 258`).replace(/\n{3,}/g,` 259 260`)}function Yt(t){return Rl(t).replace(/\s+/g," ").trim()}function a1(t){try{return decodeURIComponent(t)}catch{return t}}function ua(t){const e=Le(t);if(!e)return"";const n=e.split("#")[0].split("?")[0].replace(/\\/g,"/").trim();if(!n)return"";try{const r=new URL(n,"https://hkisdt.hr");return a1(r.pathname).replace(/\/{2,}/g,"/").toLowerCase()}catch{return a1(n).replace(/\/{2,}/g,"/").toLowerCase()}}const PR=ua(Br),DR=ua(au),OR=IR.map(t=>ua(t)).filter(Boolean);function Lm(t){const e=ua(t);return e?e===PR:!1}function jy(t){const e=ua(t);return e?e===DR||OR.includes(e):!1}function _R(t,e,n,r){const i=Yt(e);if(i)return i;const s=Yt(n||r[0]||"");if(!s)return`Vijest #${t}`;const o=s.split(" ").filter(Boolean);return o.length<=10?s:`${o.slice(0,10).join(" ")}...`}function Ii(t){if(t instanceof Date&&!Number.isNaN(t.getTime()))return s1(t);const e=String(t||"").trim();if(!e)return;const n=e.match(/(\d{4})-(\d{2})-(\d{2})/);if(n){const s=Number(n[1]),o=Number(n[2]),a=Number(n[3]);if(s>1900&&o>=1&&o<=12&&a>=1&&a<=31)return`${s}-${String(o).padStart(2,"0")}-${String(a).padStart(2,"0")}`}const r=e.match(/(\d{1,2})\s*[.\-/]\s*(\d{1,2})\s*[.\-/]\s*(\d{4})\.?/);if(r){const s=Number(r[1]),o=Number(r[2]),a=Number(r[3]);if(s>=1&&s<=31&&o>=1&&o<=12&&a>1900)return`${a}-${String(o).padStart(2,"0")}-${String(s).padStart(2,"0")}`}const i=new Date(e);if(!Number.isNaN(i.getTime()))return s1(i)}function LR(t){const e=Ii(t);if(!e)return ei;const n=new Date(`${e}T00:00:00`);if(Number.isNaN(n.getTime()))return ei;const r=Math.floor(n.getTime()/1e3);return!Number.isFinite(r)||r<=0?ei:Math.min(r,xE-1)}function l1(t){const e=Math.max(0,Math.floor(Number(t||0)));return Ex-e*10}function Ax(t){const e=Number(t||0);return!Number.isFinite(e)||e<=0?!1:e>=xE}function RR(t){if(!Array.isArray(t)||t.length===0)return Ex+10;let e=0;for(const r of t){const i=Number(r.sortOrder||0);Number.isFinite(i)&&i>e&&(e=i)}const n=Math.max(Ex+10,e+10);return Math.min(n,MR)}function yE(t){return Array.isArray(t)?t.map(e=>
260Rl(e)).filter(Boolean):[]}function _c(t){return t.map(e=>Rl(e)).filter(Boolean)}function si(t){const e=Number(t||0);return Number.isFinite(e)?e:0}function Mx(t){const e=String(t||"").trim();if(!e||e.startsWith("data:"))return"";const r=e.split("?")[0].split("/").pop()||"";try{return decodeURIComponent(r).trim()}catch{return r.trim()}}function wy(t){const e=String(t||"").trim().toLowerCase();return e==="arhivirano"?"arhivirano":e==="nacrt"?"nacrt":"objavljeno"}function $R(t){return wy(t)}function c1(t,e,n){const r=t.findIndex(a=>a.id===e);if(r<0)return{next:t,moved:!1};const i=n==="up"?r-1:r+1;if(i<0||i>=t.length)return{next:t,moved:!1};const s=[...t],[o]=s.splice(r,1);return s.splice(i,0,o),{next:s,moved:!0}}function Lg(t,e,n){const r=t.findIndex(a=>a.id===e),i=t.findIndex(a=>a.id===n);if(r<0||i<0||r===i)return{next:t,moved:!1};const s=[...t],[o]=s.splice(r,1);return s.splice(i,0,o),{next:s,moved:!0}}function BR(t){if(!Array.isArray(t)||t.length===0)return"";const e=t.find(n=>n.type==="image");return(e==null?void 0:e.type)==="image"?Le(e.src):""}function FR(t,e){const n=ua(t);if(!n)return!1;const r=ua(e);return r?n!==r:!0}function UR(t,e,n){const r=Le(t);if(FR(r,n))return r;const i=BR(e);return i||r||n}function HR(t){let e=String(t||"").trim();for(;e&&".,;:!?".includes(e[e.length-1]);)e=e.slice(0,-1);for(;e.endsWith(")")&&e.split(")").length-1>e.split("(").length-1;)e=e.slice(0,-1);for(;e.endsWith("]")&&e.split("]").length-1>e.split("[").length-1;)e=e.slice(0,-1);for(;e.endsWith("}")&&e.split("}").length-1>e.split("{").length-1;)e=e.slice(0,-1);return e}function tl(t){const e=HR(String(t||"").replace(/\\/g,"/").replace(zR,"/"));return e?/^(https?:\/\/|\/)/i.test(e)?e:/^(cdn|podaci|dokumenti|api\/|web\/)/i.test(e)?`/${e}`:e:""}function u1(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>typeof e=="string"?e:String((e==null?void 0:e.text)||"")).join(" "):""}function Ix(t){const e=String(t||"");if(!e)return[];const n=[];_g.lastIndex=0;let r=_g.exec(e);for(;r;){const i=tl(r[0]);i&&n.push(i),r=_g.exec(e)}return n}function VR(t){const e=[];return t.forEach(n=>{if(n.type==="paragraph"){e.push(...Ix(u1(n.text)));return}n.type==="list"&&n.items.forEach(r=>e.push(...Ix(u1(r))))}),Array.from(new Set(e))}function KR(t){const e=String(t||"").toLowerCase().split("?")[0].split("#")[0];return e.endsWith(".doc")||e.endsWith(".docx")?"wordUrl":e.endsWith(".pdf")?"pdfUrl":e.endsWith(".ppt")||e.endsWith(".pptx")?"pptUrl":e.endsWith(".xls")||e.endsWith(".xlsx")?"excelUrl":null}function WR(t){const e=String(t||"").trim();if(!e)return"";const r=e.split("?")[0].split("#")[0].split("/").pop()||"";let i=r;try{i=decodeURIComponent(r)}catch{i=r}const s=i.replace(/\.[^.]+$/,"").replace(/[_-]+/g," ").trim();return Yt(s)}function kE(t,e){const n=Array.from(new Set(e.map(o=>tl(o)).filter(Boolean)));if(n.length===0)return null;const r=new Map;let i=1;n.forEach(o=>{const a=KR(o);if(!a)return;const l=WR(o)||`Dokument ${i++}`,u=l.toLowerCase(),d=r.get(u)||{label:l};if(d[a]){const f=`${u}-${i++}`;r.set(f,{label:`${l} (${i-1})`,[a]:o});return}r.set(u,{...d,[a]:o})});const s=Array.from(r.values()).filter(o=>!!(o.wordUrl||o.pdfUrl||o.pptUrl||o.excelUrl));return s.length===0?null:{id:t,type:"documents",title:"",items:s}}function GR(t){if(!Array.isArray(t)||t.length===0)return"";const e=t.find(n=>n.type==="publishedDate");return!e||e.type!=="publishedDate"?"":e.useToday?Tx(new Date):Tx(e.date||e.resolvedDate||"")}function d1(t){if(typeof t=="string")return Rl(t);if(!Array.isArray(t))return"";const e=t.map(n=>{if(typeof n=="string"){const o=o1(n),a=o.replace(/\n/g,"").trim().length>0,l=o.includes(` 261`);return!a&&!l?null:o}const r=o1(n==null?void 0:n.text),i=r.replace(/\n/g,"").trim().length>0,s=r.includes(` 262`);return!i&&!s?null:{...n,text:r}}).filter(n=>n!==null);return e.length>0?e:""}function Af(t){const e=[],r=Ii(t.date)||Yt(t.date);r&&e.push({id:`news-${t.id}-date`,type:"publishedDate",date:r}),e.push({id:`news-${t.id}-title`,type:"heading",level:"article",text:Yt(t.title)||`Vijest #${t.id}`});const i=_c(t.body),s=i.length?i:[Rl(t.summary)].filter(Boolean);
262s.forEach((l,u)=>{e.push({id:`news-${t.id}-p-${u}`,type:"paragraph",text:l})});const o=kE(`news-${t.id}-docs`,Ix([t.summary,...s].join(` 263`)));o&&e.push(o);const a=Le(t.image);return a&&!Lm(a)&&e.push({id:`news-${t.id}-img`,type:"image",src:a,alt:Yt(t.title)||`Vijest ${t.id}`}),e}function qR(t,e){const n=Af(t);if(!Array.isArray(e)||e.length===0)return n;let r=null,i=null;const s=[];for(const d of e){if(d.type==="publishedDate"){const p=Ii(d.date||d.resolvedDate||t.date)||Yt(d.date||d.resolvedDate||t.date),m={...d,date:d.useToday?void 0:p||Yt(t.date)||void 0};r?s.push(m):r=m;continue}if(d.type==="heading"){const f={...d,text:Yt(d.text||t.title)||t.title,level:d.level==="section"||d.level==="article"?d.level:void 0},p=f.level==="article",m=(i==null?void 0:i.level)==="article";i?p&&!m?(s.push(i),i=f):s.push(f):i=f;continue}if(d.type==="image"){const f=Le(d.src,t.image||Br);if(!f||Lm(f))continue;const p={...d,src:f,alt:Yt(d.alt||t.title)||t.title};s.push(p);continue}if(d.type==="paragraph"){const f=d1(d.text);(typeof f!="string"||(typeof f=="string"?f:""))&&s.push({...d,text:f});continue}if(d.type==="list"){const f=d.items.map(p=>d1(p)).filter(Boolean);f.length>0&&s.push({...d,items:f});continue}if(d.type==="documents"){const f=(Array.isArray(d.items)?d.items:[]).map(p=>({label:Yt(p==null?void 0:p.label),wordUrl:tl(p==null?void 0:p.wordUrl),pdfUrl:tl(p==null?void 0:p.pdfUrl),pptUrl:tl(p==null?void 0:p.pptUrl),excelUrl:tl(p==null?void 0:p.excelUrl)})).filter(p=>p.label&&(p.wordUrl||p.pdfUrl||p.pptUrl||p.excelUrl));f.length>0&&s.push({...d,title:Yt(d.title||""),items:f});continue}s.push(d)}if(!r){const d=n.find(f=>f.type==="publishedDate");d&&d.type==="publishedDate"&&(r=d)}if(!i){const d=n.find(f=>f.type==="heading");d&&d.type==="heading"&&(i=d)}if(!s.some(d=>d.type==="paragraph"||d.type==="list"||d.type==="documents")){const d=n.filter(f=>f.type==="paragraph");s.push(...d)}if(!s.some(d=>d.type==="documents")){const d=VR(s),f=kE(`news-${t.id}-docs`,d);f&&s.push(f)}if(!s.some(d=>d.type==="image")){const d=n.find(f=>f.type==="image");d&&d.type==="image"&&s.push(d)}const u=[];return r&&u.push(r),i&&u.push(i),u.push(...s),u.length>0?u:n}function f1(t){return!Array.isArray(t)||t.length===0?[]:t.filter(e=>{if(e.type!=="image")return!0;const n=Le(e.src);return n?!Lm(n):!1})}function p1(t){return!Array.isArray(t)||t.length===0?[]:t.filter(e=>{if(e.type!=="image")return!0;const n=Le(e.src);return n?!jy(n):!1})}function ef(t,e){const n=si((t==null?void 0:t.vijest_id)??(t==null?void 0:t.id)),r=Le(t==null?void 0:t.slika_url),i=Number(t==null?void 0:t.redoslijed),s=Number.isFinite(i)?i:void 0,o=yE(t==null?void 0:t.odlomci),a=Yt(o[0]||(t==null?void 0:t.sazetak)||""),l=Yt(t==null?void 0:t.sazetak)||a,u=_R(n,t==null?void 0:t.naslov,l,o),d=o.length?o:[Rl(l||u)].filter(Boolean),f=Ii(t==null?void 0:t.datum_objave_tekst)||Ii(t==null?void 0:t.datum_objave),p=f?Qp(f):Yt(Le(t==null?void 0:t.datum_objave_tekst,vE(t==null?void 0:t.datum_objave))),m=e&&Le(t==null?void 0:t.kreirao_korisnicko_ime)||null,g=e&&Le(t==null?void 0:t.azurirao_korisnicko_ime,Le(t==null?void 0:t.kreirao_korisnicko_ime))||null,y=e&&Le(t==null?void 0:t.kreirano_u)||null,j=e&&Le(t==null?void 0:t.azurirano_u,Le(t==null?void 0:t.kreirano_u))||null;return{id:n,title:u,summary:l||u,date:p,image:r||Br,cardImage:r||void 0,sortOrder:s,body:d,status:$R(t==null?void 0:t.status_vijesti),createdBy:m,createdAt:y,updatedBy:g,updatedAt:j}}function m1(t){const e=Ii(t==null?void 0:t.datum_objave)||Ii(t==null?void 0:t.datum_objave_tekst);if(!e)return 0;const n=new Date(`${e}T00:00:00`);return Number.isNaN(n.getTime())?0:n.getTime()}function Rg(t,e){const n=si((t==null?void 0:t.projekt_id)??(t==null?void 0:t.id)),r=Le(t==null?void 0:t.slika_url),i=r&&!jy(r)?r:"",s=yE(t==null?void 0:t.odlomci),o=el(t==null?void 0:t.sazetak,s[0]||""),a=e&&Le(t==null?void 0:t.kreirao_korisnicko_ime)||null,l=e&&Le(t==null?void 0:t.azurirao_korisnicko_ime,Le(t==null?void 0:t.kreirao_korisnicko_ime))||null,u=e&&Le(t==null?void 0:t.kreirano_u)||null,d=e&&Le(t==null?void 0:t.azurirano_u,Le(t==null?void 0:t.kreirano_u))||null;return{id:n,title:el(t==null?void 0:t.naslov,"Bez naslova"),summary:o,image:i||au,cardImage:i||void 0,body:s.length?s:[o].filter(
263Boolean),status:wy(t==null?void 0:t.status_projekta),createdBy:a,createdAt:u,updatedBy:l,updatedAt:d}}function $g(t,e){const n=si((t==null?void 0:t.prezentacija_id)??(t==null?void 0:t.id)),r=el(t==null?void 0:t.autor,el(t==null?void 0:t.opis)),i=Le((t==null?void 0:t.ppt_url)??(t==null?void 0:t.dokument_url)??(t==null?void 0:t.putanja_ili_url),"#"),s=Le(t==null?void 0:t.ppt_naziv_datoteke,Mx(i)),o=Number((t==null?void 0:t.ppt_velicina_bajtova)??(t==null?void 0:t.dokument_velicina_bajtova)??(t==null?void 0:t.velicina_bajtova)),a=Number.isFinite(o)&&o>0?o:null,l=e&&Le(t==null?void 0:t.kreirao_korisnicko_ime)||null,u=e&&Le(t==null?void 0:t.azurirao_korisnicko_ime,Le(t==null?void 0:t.kreirao_korisnicko_ime))||null,d=e&&Le(t==null?void 0:t.kreirano_u)||null,f=e&&Le(t==null?void 0:t.azurirano_u,Le(t==null?void 0:t.kreirano_u))||null;return{id:n,title:el(t==null?void 0:t.naslov,"Bez naslova"),date:Le(t==null?void 0:t.datum_prikaz,vE(t==null?void 0:t.datum_prezentacije)),author:r,description:el(t==null?void 0:t.opis,r),pptUrl:i,documentName:s,documentSizeBytes:a,status:wy(t==null?void 0:t.status_prezentacije),createdBy:l,createdAt:d,updatedBy:u,updatedAt:f}}function JR(t){return[...t].sort((e,n)=>{const r=Number((e==null?void 0:e.redoslijed)||0),i=Number((n==null?void 0:n.redoslijed)||0),s=Ax(r),o=Ax(i);if(s&&o){const l=i-r;return l!==0?l:si((n==null?void 0:n.vijest_id)??(n==null?void 0:n.id))-si((e==null?void 0:e.vijest_id)??(e==null?void 0:e.id))}if(s!==o)return s?-1:1;const a=m1(n)-m1(e);return a!==0?a:si((n==null?void 0:n.vijest_id)??(n==null?void 0:n.id))-si((e==null?void 0:e.vijest_id)??(e==null?void 0:e.id))})}function ZR(t){const e=t?void 0:"objavljeno",[n,r]=h.useState(null),[i,s]=h.useState(Dr),[o,a]=h.useState([]),[l,u]=h.useState(!1),[d,f]=h.useState(!1),[p,m]=h.useState(1),[g,y]=h.useState({}),[j,x]=h.useState({}),[k,N]=h.useState({}),[C,w]=h.useState([]),[E,D]=h.useState(!1),[L,V]=h.useState(!1),[te,ae]=h.useState(1),[ke,ge]=h.useState({}),[Se,me]=h.useState({}),[H,P]=h.useState({}),[z,Y]=h.useState([]),[Q,O]=h.useState(!1),[U,$]=h.useState(!1),[J,ie]=h.useState(1),oe=h.useRef(null),be=h.useRef(null),Ee=h.useRef(null),le=h.useRef(!1),Me=h.useRef(1),_=h.useRef(0),ce=h.useRef(new Set),de=h.useRef(!1),De=h.useRef(1),Oe=h.useRef(0),He=h.useRef(new Set),ot=h.useRef(!1),Ge=h.useRef(1),Te=h.useRef(0),Ke=h.useRef(new Set);h.useEffect(()=>{le.current=d},[d]),h.useEffect(()=>{Me.current=p},[p]),h.useEffect(()=>{if(t){_.current=o.length;return}_.current=o.filter(R=>R.status==="objavljeno").length},[o,t]),h.useEffect(()=>{ce.current=new Set(o.map(R=>R.id))},[o]),h.useEffect(()=>{de.current=L},[L]),h.useEffect(()=>{De.current=te},[te]),h.useEffect(()=>{Oe.current=C.length},[C.length]),h.useEffect(()=>{He.current=new Set(C.map(R=>R.id))},[C]),h.useEffect(()=>{ot.current=U},[U]),h.useEffect(()=>{Ge.current=J},[J]),h.useEffect(()=>{Te.current=z.length},[z.length]),h.useEffect(()=>{Ke.current=new Set(z.map(R=>R.id))},[z]),h.useEffect(()=>{a([]),u(!1),f(!1),m(1),y({}),x({}),N({}),w([]),D(!1),V(!1),ae(1),ge({}),me({}),P({}),Y([]),O(!1),$(!1),ie(1),oe.current=null,be.current=null,Ee.current=null,le.current=!1,Me.current=1,_.current=0,ce.current=new Set,de.current=!1,De.current=1,Oe.current=0,He.current=new Set,ot.current=!1,Ge.current=1,Te.current=0,Ke.current=new Set},[t]);const Ne=h.useCallback(async(R,W)=>{const Z=await Dc("vijesti",{limit:W,page:R,sort:"redoslijed",dir:"desc",include_paragraphs:!1}),ee=Array.isArray(Z.items)?Z.items:[],xe=Number(Z.limit||W),fe=Number.isFinite(xe)&&xe>0?xe:W,Pe=ee.length>=fe;return{rows:ee,hasMore:Pe}},[]),_e=h.useCallback(async()=>{if(t)return!1;if(oe.current)return oe.current;const R=(async()=>{if(!le.current)return!1;const W=Me.current,{rows:Z,hasMore:ee}=await Ne(W,n1),xe=Z.map(fe=>ef(fe,t)).filter(fe=>fe.id>0);return a(fe=>{const Pe=new Set(fe.map(ct=>ct.id)),$e=xe.filter(ct=>!Pe.has(ct.id));return $e.length>0?[...fe,...$e]:fe}),f(ee),m(W+1),le.current=ee,Me.current=W+1,ee})();oe.current=R;try{return await R}finally{oe.current=null}},[Ne,t]),We=h.useCallback(async R=>{if(t)return;const W=Math.max(0,Math.floor(Number(R||0)));if(W<=0)return;let Z=0;for(;_.current<W&&le.current&&Z<100&&(Z+=1,!(!await _e()&&_.current<W)););},[t,_e]),tt=h.useCallback(async()=>
263{if(t){const ee=[];for(let fe=1;fe<=Og;fe+=1){const{rows:Pe,hasMore:$e}=await Ne(fe,Dg);if(ee.push(...Pe),!$e)break}const xe=JR(ee);a(xe.map(fe=>ef(fe,t)).filter(fe=>fe.id>0)),f(!1),m(1),le.current=!1,Me.current=1,u(!0);return}const{rows:R,hasMore:W}=await Ne(1,n1),Z=R.map(ee=>ef(ee,t)).filter(ee=>ee.id>0);a(Z),f(W),m(2),le.current=W,Me.current=2,u(!0)},[Ne,t]),at=h.useCallback(async R=>{const W=Number(R||0);if(!Number.isFinite(W)||W<=0)return null;const Z=await ou({route_slug:"vijesti",tab:Oc(W),include_blocks:!0,sort:"redoslijed",dir:"desc",limit:1,page:1}),ee=Array.isArray(Z.items)?Z.items[0]:null,xe=ee?$u(ee):null,fe=Number((ee==null?void 0:ee.unos_id)||0);return y(Pe=>{const $e={...Pe};return xe&&xe.length>0?$e[W]=xe:delete $e[W],$e}),N(Pe=>{const $e={...Pe};return fe>0?$e[W]=fe:delete $e[W],$e}),x(Pe=>({...Pe,[W]:!0})),xe},[]),Ut=h.useCallback(async(R,W)=>{const Z=await Dc("projekti",{limit:W,page:R,sort:"redoslijed",dir:"desc",include_paragraphs:!1,status:e}),ee=Array.isArray(Z.items)?Z.items:[],xe=Number(Z.limit||W),fe=Number.isFinite(xe)&&xe>0?xe:W,Pe=ee.length>=fe;return{rows:ee,hasMore:Pe}},[e]),vt=h.useCallback(async()=>{if(t)return!1;if(be.current)return be.current;const R=(async()=>{if(!de.current)return!1;const W=De.current,{rows:Z,hasMore:ee}=await Ut(W,r1),xe=Z.map(fe=>Rg(fe,t)).filter(fe=>fe.id>0);return w(fe=>{const Pe=new Set(fe.map(ct=>ct.id)),$e=xe.filter(ct=>!Pe.has(ct.id));return $e.length>0?[...fe,...$e]:fe}),V(ee),ae(W+1),de.current=ee,De.current=W+1,ee})();be.current=R;try{return await R}finally{be.current=null}},[Ut,t]),b=h.useCallback(async R=>{if(t)return;const W=Math.max(0,Math.floor(Number(R||0)));if(W<=0)return;let Z=0;for(;Oe.current<W&&de.current&&Z<100&&(Z+=1,!(!await vt()&&Oe.current<W)););},[t,vt]),T=h.useCallback(async()=>{if(t){const Z=[];for(let ee=1;ee<=Og;ee+=1){const{rows:xe,hasMore:fe}=await Ut(ee,Dg);if(Z.push(...xe),!fe)break}w(Z.map(ee=>Rg(ee,t)).filter(ee=>ee.id>0)),V(!1),ae(1),de.current=!1,De.current=1,D(!0);return}const{rows:R,hasMore:W}=await Ut(1,r1);w(R.map(Z=>Rg(Z,t)).filter(Z=>Z.id>0)),V(W),ae(2),de.current=W,De.current=2,D(!0)},[Ut,t]),S=h.useCallback(async R=>{const W=Number(R||0);if(!Number.isFinite(W)||W<=0)return null;const Z=await ou({route_slug:"projekti",tab:$a(W),include_blocks:!0,status:e,sort:"redoslijed",dir:"desc",limit:1,page:1}),ee=Array.isArray(Z.items)?Z.items[0]:null,xe=ee?$u(ee):null,fe=Number((ee==null?void 0:ee.unos_id)||0);return ge(Pe=>{const $e={...Pe};return xe&&xe.length>0?$e[W]=xe:delete $e[W],$e}),P(Pe=>{const $e={...Pe};return fe>0?$e[W]=fe:delete $e[W],$e}),me(Pe=>({...Pe,[W]:!0})),xe},[e]),I=h.useCallback(async(R,W)=>{const Z=await Dc("prezentacije",{limit:W,page:R,sort:"redoslijed",dir:"desc",status:e}),ee=Array.isArray(Z.items)?Z.items:[],xe=Number(Z.limit||W),fe=Number.isFinite(xe)&&xe>0?xe:W,Pe=ee.length>=fe;return{rows:ee,hasMore:Pe}},[e]),K=h.useCallback(async()=>{if(t)return!1;if(Ee.current)return Ee.current;const R=(async()=>{if(!ot.current)return!1;const W=Ge.current,{rows:Z,hasMore:ee}=await I(W,i1),xe=Z.map(fe=>$g(fe,t)).filter(fe=>fe.id>0);return Y(fe=>{const Pe=new Set(fe.map(ct=>ct.id)),$e=xe.filter(ct=>!Pe.has(ct.id));return $e.length>0?[...fe,...$e]:fe}),$(ee),ie(W+1),ot.current=ee,Ge.current=W+1,ee})();Ee.current=R;try{return await R}finally{Ee.current=null}},[I,t]),X=h.useCallback(async R=>{if(t)return;const W=Math.max(0,Math.floor(Number(R||0)));if(W<=0)return;let Z=0;for(;Te.current<W&&ot.current&&Z<100&&(Z+=1,!(!await K()&&Te.current<W)););},[t,K]),G=h.useCallback(async()=>{if(t){const Z=[];for(let ee=1;ee<=Og;ee+=1){const{rows:xe,hasMore:fe}=await I(ee,Dg);if(Z.push(...xe),!fe)break}Y(Z.map(ee=>$g(ee,t)).filter(ee=>ee.id>0)),$(!1),ie(1),ot.current=!1,Ge.current=1,O(!0);return}const{rows:R,hasMore:W}=await I(1,i1);Y(R.map(Z=>$g(Z,t)).filter(Z=>Z.id>0)),$(W),ie(2),ot.current=W,Ge.current=2,O(!0)},[I,t]),re=h.useCallback(async(R=!1)=>{Q&&!R||await G()},[Q,G]),pe=h.useCallback(async(R=!1)=>{l&&!R||await tt()},[l,tt]),ue=h.useCallback(async()=>{if(await pe(),t)return;let R=0;for(;le.current&&R<100;)R+=1,await _e()},[pe,t,_e]),Ve=h.useCallback(async(R=!1)=>{E&&!R||await T()},[E,T]),Fe=h.useCallback(async()=>
263{if(await Ve(),t)return;let R=0;for(;de.current&&R<100;)R+=1,await vt()},[Ve,t,vt]),et=h.useCallback(async()=>{if(await re(),t)return;let R=0;for(;ot.current&&R<100;)R+=1,await K()},[re,t,K]),qe=h.useCallback(async R=>{const W=Number(R||0);if(!Number.isFinite(W)||W<=0)return!1;if(await pe(),ce.current.has(W))return!0;if(t)return!1;let Z=0;for(;!ce.current.has(W)&&le.current&&Z<100;)Z+=1,await _e();return ce.current.has(W)},[pe,t,_e]),jn=h.useCallback(async R=>{const W=Number(R||0);if(!Number.isFinite(W)||W<=0)return!1;if(await Ve(),He.current.has(W))return!0;if(t)return!1;let Z=0;for(;!He.current.has(W)&&de.current&&Z<100;)Z+=1,await vt();return He.current.has(W)},[Ve,t,vt]),wn=h.useCallback(async R=>{const W=Number(R||0);if(!Number.isFinite(W)||W<=0)return!1;if(await re(),Ke.current.has(W))return!0;if(t)return!1;let Z=0;for(;!Ke.current.has(W)&&ot.current&&Z<100;)Z+=1,await K();return Ke.current.has(W)},[re,t,K]),Sn=h.useCallback(async(R,W=!1)=>{const Z=Number(R||0);if(!Number.isFinite(Z)||Z<=0)return null;if(!W&&j[Z]){const fe=g[Z];if(Array.isArray(fe)&&fe.length>0)return fe;const Pe=o.find($e=>$e.id===Z);return Pe?Af(Pe):null}const ee=await at(Z);if(Array.isArray(ee)&&ee.length>0)return ee;const xe=await Wr(Z);return xe?(a(fe=>{const Pe=fe.findIndex(ct=>ct.id===Z);if(Pe<0)return[...fe,xe];const $e=[...fe];return $e[Pe]=xe,$e}),Af(xe)):null},[o,j,g,at]),Ye=h.useCallback(async(R,W=!1)=>{const Z=Number(R||0);return!Number.isFinite(Z)||Z<=0?null:!W&&Se[Z]?ke[Z]??null:S(Z)},[Se,ke,S]),Ht=h.useMemo(()=>{const R={},W=new Map;o.forEach(ee=>{ee.id>0&&W.set(ee.id,ee)});const Z=new Set;return Object.entries(g).forEach(([ee,xe])=>{const fe=Number(ee);if(!Number.isFinite(fe)||fe<=0)return;const Pe=W.get(fe);Pe&&(R[fe]=qR(Pe,xe),Z.add(fe))}),o.forEach(ee=>{Z.has(ee.id)||(R[ee.id]=Af(ee))}),R},[o,g]),_t=h.useMemo(()=>o.map(R=>({...R,date:GR(Ht[R.id])||Tx(R.date),image:UR(R.cardImage??R.image,Ht[R.id],Br),summary:sE(Yt(R.body[0]??R.summary??""),AR)})),[o,Ht]),it=h.useMemo(()=>t?_t.filter(R=>R.status!=="arhivirano"):_t.filter(R=>R.status==="objavljeno"),[_t,t]),Qe=h.useMemo(()=>_t.filter(R=>R.status==="arhivirano"),[_t]),On=h.useMemo(()=>t?C.filter(R=>R.status!=="arhivirano"):C.filter(R=>R.status==="objavljeno"),[t,C]),wr=h.useMemo(()=>C.filter(R=>R.status==="arhivirano"),[C]),en=h.useMemo(()=>t?z.filter(R=>R.status!=="arhivirano"):z.filter(R=>R.status==="objavljeno"),[t,z]),tn=h.useMemo(()=>z.filter(R=>R.status==="arhivirano"),[z]),yo=h.useMemo(()=>it.find(R=>R.id===n)??null,[it,n]),Nn=h.useMemo(()=>it.slice(0,i),[it,i]),Vr=i<it.length||d;h.useEffect(()=>{l&&We(i)},[l,i,We]);function Wn(){r(null),s(Dr)}function zi(){s(R=>{const W=R+Dr;return We(W),W})}function nn(R){const W=Number(R||0);if(W<=0)return!1;const Z=it.findIndex(xe=>xe.id===W);if(Z<0)return We(i+Dr),!1;const ee=Math.max(Dr,Z+1);return s(xe=>xe>=ee?xe:(We(ee),ee)),!0}function Kr(R){const W=Number(R||0);if(!Number.isFinite(W)||W<=0)return;const Z=Math.max(Dr,Math.floor(W));s(ee=>ee>=Z?ee:(We(Z),Z))}async function Sr(R,W){const Z=String(R||"").trim();if(!Z||Z==="#"||jy(Z)||Lm(Z))return null;const ee=String(W||"").trim(),xe=await Gp({putanja_ili_url:Z,naziv_datoteke:ee||void 0}),fe=si(xe==null?void 0:xe.medij_id);if(fe<=0)throw new Error("Spremanje slike nije uspjelo (medij_id nije vraÄen).");return fe}async function Wr(R){const W=Number(R||0);if(!Number.isFinite(W)||W<=0)return null;const Z=await Dc("vijesti",{id:W,include_paragraphs:!0,limit:1,page:1}),ee=Array.isArray(Z.items)?Z.items[0]:null;if(!ee)return null;const xe=ef(ee,t);return xe.id>0?xe:null}async function Gr(R,W){const Z=_c(Array.isArray(R.body)?R.body:[]),ee=Le(R.summary,Z[0]||""),xe=Le(R.title,"Bez naslova"),fe=await Sr(Le(R.image)),Pe=Le(R.date),$e=Ii(Pe),ct=$e?Qp($e):Yt(Pe),_n=await bg("vijesti",{naslov:xe,sazetak:ee,datum_objave:$e,datum_objave_tekst:ct||null,naslovna_slika_medij_id:fe||null,status_vijesti:"objavljeno",redoslijed:RR(o),odlomci:Z.length?Z:[ee].filter(Boolean)}),gt=si(_n==null?void 0:_n.id),Gn=Array.isArray(W)?f1(W):[];return gt>0&&Gn.length>0&&await Ho({route_slug:"vijesti",kljuc_taba:Oc(gt),status_unosa:"objavljeno",redoslijed:ei,blokovi:Vo(Gn)}),await Promise.all([tt(),gt>0?at(gt):Promise.resolve(null)]),gt}async function Jt(R,W,Z){const ee=o.find(Vt=>Vt.id===R)??await Wr(R);if(!ee)throw new Error("Vijest nije pronaÄena za ureÄivanje.");const xe=_c(Array.isArray(W.body)?W.body:ee.body),fe=Le(W.summary,xe[0]||ee.summary),Pe=Le(W.date,ee.date),ct=Object.prototype.hasOwnProperty.call(W,"image")?Le(W.image,""):Le(ee.image),_n=await Sr(ct),gt=Ii(Pe),Gn=gt?Qp(gt):Yt(Pe),Nr=Ax(ee.sortOrder)?void 0:LR(gt||Pe||new Date);await pn("vijesti",R,{naslov:Le(W.title,ee.title),sazetak:fe,datum_objave:gt,datum_objave_tekst:Gn||null,naslovna_slika_medij_id:_n||null,odlomci:xe.length?xe:[fe].filter(
263Boolean),...typeof Nr=="number"?{redoslijed:Nr}:{}});const sn=Array.isArray(Z)?f1(Z):[];if(sn.length>0){const Vt=Number(k[R]||0),Cr=Vo(sn);Vt>0?await li(Vt,{kljuc_taba:Oc(R),redoslijed:ei,blokovi:Cr,zamijeni_blokove:!0}):await Ho({route_slug:"vijesti",kljuc_taba:Oc(R),status_unosa:"objavljeno",redoslijed:ei,blokovi:Cr})}return await Promise.all([tt(),at(R)]),!0}async function rn(R){const W=o.find(Z=>Z.id===R);return!W||W.status==="arhivirano"?!1:(await pn("vijesti",R,{status_vijesti:"arhivirano"}),await tt(),n===R&&r(null),!0)}async function Pi(R){const W=o.find(Z=>Z.id===R);return!W||W.status!=="arhivirano"?!1:(await pn("vijesti",R,{status_vijesti:"objavljeno"}),await tt(),!0)}async function or(R){await xg("vijesti",R);const W=Number(k[R]||0);if(W>0)try{await Wp(W)}catch{}return await tt(),y(Z=>{const ee={...Z};return delete ee[R],ee}),N(Z=>{const ee={...Z};return delete ee[R],ee}),x(Z=>{const ee={...Z};return delete ee[R],ee}),n===R&&r(null),!0}async function cs(R,W){const Z=o.filter(xe=>xe.status!=="arhivirano"),ee=c1(Z,R,W);return ee.moved?(await Promise.all(ee.next.map((xe,fe)=>pn("vijesti",xe.id,{redoslijed:l1(fe)}))),await tt(),!0):!1}async function di(R,W){const Z=o.filter(xe=>xe.status!=="arhivirano"),ee=Lg(Z,R,W);return ee.moved?(await Promise.all(ee.next.map((xe,fe)=>pn("vijesti",xe.id,{redoslijed:l1(fe)}))),await tt(),!0):!1}async function ko(R,W){const Z=Number(R||0);if(!Number.isFinite(Z)||Z<=0)return;const ee=await ou({route_slug:"projekti",tab:$a(Z),include_blocks:!1,sort:"redoslijed",dir:"desc",limit:1,page:1}),xe=Array.isArray(ee.items)?ee.items[0]:null,fe=Number((xe==null?void 0:xe.unos_id)||0);fe<=0||await li(fe,{status_unosa:W})}async function us(R,W){const Z=_c(Array.isArray(R.body)?R.body:[]),ee=Le(R.summary,Z[0]||""),xe=await Sr(Le(R.image)),fe=Le(R.title,"Bez naslova"),Pe=await bg("projekti",{naslov:fe,sazetak:ee,naslovna_slika_medij_id:xe||null,status_projekta:"objavljeno",redoslijed:ei,odlomci:Z.length?Z:[ee].filter(Boolean)}),$e=si(Pe==null?void 0:Pe.id),ct=Array.isArray(W)?p1(W):[];return $e>0&&ct.length>0&&await Ho({route_slug:"projekti",kljuc_taba:$a($e),status_unosa:"objavljeno",redoslijed:ei,blokovi:Vo(ct)}),await Promise.all([T(),$e>0?S($e):Promise.resolve(null)]),$e}async function ga(R,W,Z){const ee=C.find(gt=>gt.id===R);if(!ee)return!1;const xe=_c(Array.isArray(W.body)?W.body:ee.body),fe=Le(W.summary,xe[0]||ee.summary),$e=Object.prototype.hasOwnProperty.call(W,"image")?Le(W.image,""):Le(ee.image),ct=await Sr($e);await pn("projekti",R,{naslov:Le(W.title,ee.title),sazetak:fe,naslovna_slika_medij_id:ct||null,odlomci:xe.length?xe:[fe].filter(Boolean)});const _n=Array.isArray(Z)?p1(Z):[];if(_n.length>0){const gt=Number(H[R]||0),Gn=Vo(_n);gt>0?await li(gt,{kljuc_taba:$a(R),redoslijed:ei,blokovi:Gn,zamijeni_blokove:!0}):await Ho({route_slug:"projekti",kljuc_taba:$a(R),status_unosa:"objavljeno",redoslijed:ei,blokovi:Gn})}return await Promise.all([T(),S(R)]),!0}async function ds(R){const W=C.find(Z=>Z.id===R);if(!W||W.status==="arhivirano")return!1;await pn("projekti",R,{status_projekta:"arhivirano"});try{await ko(R,"arhivirano")}catch(Z){console.error("Arhiviranje detaljnog sadržaja projekta nije uspjelo:",Z)}return await T(),!0}async function $l(R){const W=C.find(Z=>Z.id===R);if(!W||W.status!=="arhivirano")return!1;await pn("projekti",R,{status_projekta:"objavljeno"});try{await ko(R,"objavljeno")}catch(Z){console.error("Odarhiviranje detaljnog sadržaja projekta nije uspjelo:",Z)}return await Promise.all([T(),S(R)]),!0}async function jo(R){await xg("projekti",R);const W=Number(H[R]||0);if(W>0)try{await Wp(W)}catch{}return await T(),ge(Z=>{const ee={...Z};return delete ee[R],ee}),P(Z=>{const ee={...Z};return delete ee[R],ee}),me(Z=>{const ee={...Z};return delete ee[R],ee}),!0}async function Je(R,W){const Z=Lg(On,R,W);return Z.moved?(await Promise.all(Z.next.map((ee,xe,fe)=>pn("projekti",ee.id,{redoslijed:(fe.length-xe)*10}))),await T(),!0):!1}async function Bl(R){const W=Le(R.pptUrl),Z=Le(R.documentName,Mx(W)),ee=await Sr(W,Z),xe=Le(R.author,Le(R.description)),fe=await bg("prezentacije",{naslov:Le(R.title,"Bez naslova"),datum_prikaz:Le(R.date),autor:xe,opis:xe,ppt_medij_id:ee||null,status_prezentacije:"objavljeno",redoslijed:ei});return await G(),si(fe==null?void 0:fe.id)}async function Fl(R,W){const Z=z.find($e=>$e.id===R);if(!Z)return!1;const ee=Le(W.pptUrl,Z.pptUrl),xe=Le(W.documentName,Z.documentName||Mx(ee)),fe=Le(W.author,Le(W.description,Z.author||Z.description||"")),Pe=await Sr(ee,xe);return await pn("prezentacije",R,{naslov:Le(W.title,Z.title),datum_prikaz:Le(W.date,Z.date),autor:fe,opis:fe,ppt_medij_id:Pe||null}),await G(),!0}async function ba(R){const W=z.find(Z=>Z.id===R);return!W||W.status==="arhivirano"?!1:(await pn("prezentacije",R,{status_prezentacije:"arhivirano"}),await G(),!0)}async function Ul(R){const W=z.find(Z=>Z.id===R);return!W||W.status!=="arhivirano"?!1:(await pn("prezentacije",R,{status_prezentacije:"objavljeno"}),await G(),!0)}async function xa(R){return await xg("prezentacije",R),await G(),!0}async function fs(R,W){const Z=c1(en,R,W);return Z.moved?(await Promise.all(Z.next.map((ee,xe,fe)=>pn("prezentacije",ee.id,{redoslijed:(fe.length-xe)*10}))),await G(),!0):!1}async function qr(R,W){const Z=Lg(en,R,W);return Z.moved?(await Promise.all(Z.next.map((ee,xe,fe)=>pn("prezentacije",ee.id,{redoslijed:(fe.length-xe)*10}))),await G(),!0):!1}return{newsCardItems:it,archivedNewsItems:Qe,newsDetailBlocksById:Ht,newsCardsLoaded:l,projectsCardItems:On,archivedProjectItems:wr,projectCardsLoaded:E,hasMoreProjectPages:L,projectDetailBlocksById:ke,prezentacijeItems:en,archivedPrezentacijeItems:tn,prezentacijeCardsLoaded:Q,hasMorePrezentacijePages:U,selectedNewsId:n,selectedNews:yo,visibleNews:Nn,hasMoreNews:Vr,setSelectedNewsId:r,ensureNewsCardsLoaded:pe,ensureAllNewsCardsLoaded:ue,ensureNewsItemLo
263aded:qe,ensureProjectCardsLoaded:Ve,ensureAllProjectCardsLoaded:Fe,ensureProjectCardsCountLoaded:b,ensureProjectItemLoaded:jn,ensurePrezentacijeCardsLoaded:re,ensureAllPrezentacijeCardsLoaded:et,ensurePrezentacijeCardsCountLoaded:X,ensurePrezentacijaItemLoaded:wn,ensureNewsDetailLoaded:Sn,ensureProjectDetailLoaded:Ye,loadMoreNews:zi,ensureNewsVisibleById:nn,ensureNewsVisibleCount:Kr,resetNewsList:Wn,createNewsCard:Gr,archiveNewsCard:rn,unarchiveNewsCard:Pi,deleteNewsCard:or,moveNewsCard:cs,reorderNewsCard:di,updateNewsCard:Jt,createProjectCard:us,archiveProjectCard:ds,unarchiveProjectCard:$l,deleteProjectCard:jo,updateProjectCard:ga,reorderProjectCard:Je,createPrezentacijaCard:Bl,archivePrezentacijaCard:ba,unarchivePrezentacijaCard:Ul,deletePrezentacijaCard:xa,updatePrezentacijaCard:Fl,movePrezentacijaCard:fs,reorderPrezentacijaCard:qr}}function YR(t){return[]}function QR(t,e){return[]}function XR(t,e){const n=QR();return!n||n.length===0?[]:[{id:`subnav-${t}-${e}-0`,blocks:n}]}function e$(t,e){return t==="akti-komore"?e==="temeljni"?"Temeljni akti":"Provedbeni akti":t==="obrasci"?e==="sumarstvo"?"Razred inženjera Å¡umarstva":"Razred inženjera drvne tehnologije":t==="imenik"?e==="sumarstvo"?"OvlaÅ¡teni inženjeri Å¡umarstva":"OvlaÅ¡teni inženjeri drvne tehnologije":t==="upisnik-licencija"?e==="drvna-tehnologija"?"PodruÄje drvne tehnologije":"PodruÄje Å¡umarstva / lovstvo":t==="operativne-informacije"?e==="zapisnici"?"Zapisnici":"Izbori":e}function t$(t,e){return"Sadržaj za ovu kategoriju trenutno nije dostupan."}function n$(){return{getBaseRouteArticles:YR,getSubnavBaseSections:XR,getSubnavLabel:e$,getEmptyNoticeMessage:t$,subnavTabIdsByRoute:{"akti-komore":["temeljni","provedbeni"],obrasci:["sumarstvo","drvo"],imenik:["sumarstvo","drvo"],"upisnik-licencija":["sumarstvo-lovstvo","drvna-tehnologija"],"operativne-informacije":["zapisnici","izbori"]},aktiIntroBlocks:[],aktiTabBlocks:{},obrasciIntroBlocks:[],obrasciTabBlocks:{},imenikTabBlocks:{},upisnikLicencijaIntroBlocks:[],upisnikLicencijaTabBlocks:{},operativneZapisniciBlocks:[],operativneIzboriBlocks:[]}}function h1(t){const e=String(t||"").trim();if(!e)return"";const n=e.split("#")[0].split("?")[0].replace(/\\/g,"/").trim();if(!n)return"";try{return new URL(n,"https://hkisdt.hr").pathname.replace(/\/{2,}/g,"/").toLowerCase()}catch{return n.replace(/\/{2,}/g,"/").toLowerCase()}}function jE(t,e){const n=h1(t);if(!n)return!1;const r=h1(e);return r?n!==r:!0}function r$({items:t,id:e,defaultImage:n=""}){const r=t.find(s=>s.id===e);if(!r)return[];const i=[{id:`admin-news-${r.id}-date`,type:"publishedDate",date:r.date},{id:`admin-news-${r.id}-title`,type:"heading",level:"article",text:r.title},...r.body.map((s,o)=>({id:`admin-news-${r.id}-p-${o}`,type:"paragraph",text:s}))];return jE(r.image,n)&&i.push({id:`admin-news-${r.id}-img`,type:"image",src:r.image,alt:r.title}),i}function i$({items:t,id:e,defaultImage:n=""}){const r=t.find(s=>s.id===e);if(!r)return[];const i=[{id:`admin-project-${r.id}-title`,type:"heading",level:"article",text:r.title},...r.body.map((s,o)=>({id:`admin-project-${r.id}-p-${o}`,type:"paragraph",text:s}))];return jE(r.image,n)&&i.push({id:`admin-project-${r.id}-img`,type:"image",src:r.image,alt:r.title}),i}function s$({items:t,id:e}){const n=t.find(i=>i.id===e);return n?[...n.date.trim()?[{id:`admin-prezentacija-${n.id}-date`,type:"publishedDate",date:n.date}]:[],{id:`admin-prezentacija-${n.id}-title`,type:"heading",level:"article",text:n.title},{id:`admin-prezentacija-${n.id}-p`,type:"paragraph",text:n.author?`Autor/i: ${n.author}`:"Autor/i:"},{id:`admin-prezentacija-${n.id}-doc`,type:"documents",items:[{label:"Prezentacija za preuzimanje",pptUrl:n.pptUrl}]}]:[]}function o$({route:t,pageTitleByRoute:e,getSubnavLabel:n,getBaseRouteArticles:r,getSubnavBaseSections:i,adminEditTarget:s,adminPageEditContext:o,adminRouteEditContext:a,subnavDraftContext:l,activeAdminDisplayName:u,routeArticleOverrides:d,subnavArticleOverrides:f,adminArticlesByRoute:p,defaultCardImage:m,defaultNewsImage:g,newsCardItems:y,newsDetailBlocksById:j,ensureNewsDetailLoaded:x,projectsCardItems:k,projectDetailBlocksById:N,ensureProjectDetailLoa
263ded:C,prezentacijeItems:w,createNewsCard:E,updateNewsCard:D,createProjectCard:L,updateProjectCard:V,createPrezentacijaCard:te,updatePrezentacijaCard:ae,setRouteArticleOverrides:ke,setSubnavArticleOverrides:ge,setAdminArticlesByRoute:Se,setAdminEditorModalOpen:me,setAdminEditorMode:H,setAdminEditTarget:P,setAdminPageEditContext:z,setAdminRouteEditContext:Y,setSubnavDraftContext:Q,setAdminExternalDraftBlocks:O,openAdminDraft:U}){const $=String(u||"").trim()||null,J=1e9;function ie(Ne,_e){return _e<0?J:(Ne.length-_e)*10}function oe(Ne){return String(Ne||"").replace(/^autor(?:\/i|i)?\s*:\s*/i,"").trim()}function be(Ne){const _e=String(Ne||"").trim();if(!_e)return"";const We=_e.split("#")[0].split("?")[0].replace(/\\/g,"/").trim();if(!We)return"";try{return new URL(We,"https://hkisdt.hr").pathname.replace(/\/{2,}/g,"/").toLowerCase()}catch{return We.replace(/\/{2,}/g,"/").toLowerCase()}}const Ee=be(g),le=be(m),Me=["/assets/hero image.jpg","/assets/sume-2.jpg"].map(Ne=>be(Ne)).filter(Boolean);function _(Ne){return!Array.isArray(Ne)||Ne.length===0?[]:Ee?Ne.filter(_e=>_e.type!=="image"?!0:be(_e.src)!==Ee):Ne}function ce(Ne){return!Array.isArray(Ne)||Ne.length===0?[]:!le&&Me.length===0?Ne:Ne.filter(_e=>{if(_e.type!=="image")return!0;const We=be(_e.src);return We?We!==le&&!Me.includes(We):!1})}function de(Ne){return{createdBy:$,createdAt:Ne,updatedBy:$,updatedAt:Ne}}function De(Ne,_e){const We=(Ne==null?void 0:Ne.createdBy)??$,tt=(Ne==null?void 0:Ne.createdAt)??_e,at=$??(Ne==null?void 0:Ne.updatedBy)??We??null;return{createdBy:We,createdAt:tt,updatedBy:at,updatedAt:_e}}function Oe(Ne,_e,We,tt){return Ne.map(at=>at.id===_e?{...at,blocks:We,audit:De(at.audit,tt)}:at)}async function He(Ne){P({type:"news",id:Ne});let _e=null;try{const We=await x(Ne);Array.isArray(We)&&We.length>0&&(_e=We)}catch(We){console.error("Dohvat detalja vijesti za ureÄivanje nije uspio:",We)}if((!Array.isArray(_e)||_e.length===0)&&Array.isArray(j[Ne])&&(_e=j[Ne]),Array.isArray(_e)&&_e.length>0){U(_(_e));return}U(_(r$({items:y,id:Ne,defaultImage:g})))}async function ot(Ne){P({type:"project",id:Ne});let _e=N[Ne];if(!Array.isArray(_e)||_e.length===0)try{const We=await C(Ne);Array.isArray(We)&&We.length>0&&(_e=We)}catch(We){console.error("Dohvat detalja projekta za ureÄivanje nije uspio:",We)}if(Array.isArray(_e)&&_e.length>0){U(ce(_e));return}U(ce(i$({items:k,id:Ne,defaultImage:m})))}function Ge(Ne){P({type:"prezentacija",id:Ne}),U(s$({items:w,id:Ne}))}async function Te(Ne,_e){var b;const We=(s==null?void 0:s.type)==="news"?_(Ne):(s==null?void 0:s.type)==="project"?ce(Ne):Ne,tt=q4(We),Ut=String((_e==null?void 0:_e.cardImageSrc)||"").trim()||tt.image,vt=new Date().toISOString();try{if((s==null?void 0:s.type)==="news"){const T={title:tt.title,date:tt.date,body:tt.paragraphs.length>0?tt.paragraphs:void 0,image:Ut};if(s.id>0){if(!await D(s.id,T,We))throw new Error("Vijest nije ažurirana.")}else await E(T,We)}if((s==null?void 0:s.type)==="project"){const T={title:tt.title,body:tt.paragraphs.length>0?tt.paragraphs:void 0,image:Ut,summary:tt.paragraphs[0]};if(s.id>0){if(!await V(s.id,T,We))throw new Error("Projekt nije ažuriran.")}else await L(T,We)}if((s==null?void 0:s.type)==="prezentacija"){const T=oe(tt.paragraphs[0]??""),S={title:tt.title,date:tt.date,author:T,description:T,pptUrl:tt.pptDocumentUrl};if(s.id>0){if(!await ae(s.id,S))throw new Error("Prezentacija nije ažurirana.")}else await te(S)}if(o){const T=o.route,S=r(T),I=d[T]??S,K=I.findIndex(ue=>ue.id===o.entryId),X=Vo(Ne),G=Gs(o.entryId),re=G?ie(I,K):J;let pe;if(G)await li(G,{kljuc_taba:Yp,redoslijed:re,blokovi:X,zamijeni_blokove:!0}),pe=Oe(I,o.entryId,Ne,vt);else{const ue=await Ho({route_slug:T,kljuc_taba:Yp,status_unosa:"objavljeno",redoslijed:re,blokovi:X}),Ve={id:Tf(ue.unos_id),blocks:Ne,audit:de(vt)};pe=I.some(Fe=>Fe.id===o.entryId)?I.map(Fe=>Fe.id===o.entryId?Ve:Fe):[Ve,...I]}ke(ue=>({...ue,[T]:pe}))}if(a){const T=a.route,S=r(T),I=d[T]??S,K=I.findIndex(ue=>ue.id===a.entryId),X=Vo(Ne),G=Gs(a.entryId),re=G?ie(I,K):J;let pe;if(G)await li(G,{kljuc_taba:null,redoslijed:re,blokovi:X,zamijeni_blokove:!0}),pe=Oe(I,a.entryId,Ne,vt);else{const ue=await Ho({route_slug:T,kljuc_taba:null,status_unosa:"objavljeno",redoslijed:re,blokovi:X}),Ve={id:Tf(ue.unos_id),blocks:Ne,audit:de(vt)};pe=K>=0?I.map(Fe=>Fe.id===a.entryId?Ve:Fe):[Ve,...I]}ke(ue=>({...ue,[T]:pe}))}if(l){const T=l.route,S=l.tabId,I=i(T,S),K=((b=f[T])==null?void 0:b[S])??I,X=l.entryId,G=X?K.findIndex(Fe=>Fe.id===X):-1,re=Vo(Ne),pe=X?Gs(X):null,ue=pe?ie(K,G):J;let Ve;if(pe)await li(pe,{kljuc_taba:S,redoslijed:ue,blokovi:re,zamijeni_blokove:!0}),Ve=Oe(K,X,Ne,vt);else{const Fe=await Ho({route_slug:T,kljuc_taba:S,status_unosa:"objavljeno",redoslijed:ue,blokovi:re}),et={id:Tf(Fe.unos_id),blocks:Ne,audit:de(vt)};X?Ve=G>=0?K.map(qe=>qe.id===X?et:qe):[et,...K]:Ve=[et,...K]}ge(Fe=>({...Fe,[T]:{...Fe[T]??{},[S]:Ve}}))}me(!1),H("add"),P(null),z(null),Y(null),Q(null),O(null)}catch(T){throw console.error("Spremanje sadržaja nije uspjelo:",T),T}}return{adminModalTitle:h.useMemo(()=>l?`UreÄivanje sadržaja: ${e[l.route]??l.route} / ${n(l.route,l.tabId)}`:`UreÄivanje sadržaja: ${e[t]??t}`,[n,e,t,l]),handleEditNewsFromCard:He,handleEditProjectFromCard:ot,handleEditPrezentacijaFromCard:Ge,handleExternalDraftPublish:Te}}const a$=["vijesti","pristup-informacijama","osiguranje-clanova","zastita-osobnih-podataka","uvjeti-koristenja","pravila-privatnosti","o-komori","struktura-komore","akti-komore","zakoni-propisi","operativne-informacije","operativne-zapisnici","operativne-izbori","e-savjetovanje","natjecaji-burza-rada","izdanja-komore","ispiti","upis","licenciranje","cekici","popratnice","racunalne-baze","imenik","upisnik-licencija","obrasci","strucno","strucno-dogadaji","strucno-prezentacije","projekti","kontakti","profil-clana","datoteka-nije-pronadena"],l$=new Set(a$);function El(t){const e=String(t||"").trim();return l$.has(e)?e:null}const c$="https://hkisdt.hr";function u$(t){return String(t||"").replace(/\/+$/,"")}function d$(t){const e=String(t||"").trim();if(!e)return"";try{const n=new URL(e);return`${n.protocol}//${n.host}`}catch{return""}}function f$(){const t=d$("");return t||(typeof window<"u"&&String(window.location.origin||"").trim()?window.location.origin:c$)}function p$(t="/"){const e=u$(f$()),n=String(t||"/").trim()||"/";try{return new URL(n,`${e}/`).toString()}catch{return n}}const mr={fontSize:100,highContrast:!1,reduceMotion:!1,dyslexicFont:!1,readableFont:!1,fontWeight:!1,textAlign:"default",linkHighlight:!1,largeCursor:!1,textToSpeech:!1,readingGuide:!1,focusMask:!1,textSpacing:!1,hideImages:!1,darkMode:!1,lightContrast:!1,monochrome:!1,muteSounds:!1,highlightTitles:!1,highlightAll:!1,textMagnifier:!1,focusHighlight:!1,largerClickTargets:!1,interactiveHighlight:!1,reduceTransparency:!1,tableMode:!1,keyboardShortcuts:!1,keyboardNavigation:!1,pageAnnouncements:!0,formErrorSummary:!1,highlightColor:"orange",saturation:100,brightness:100,lineHeight:150,visionImpairedMode:!1,seizureSafeProfileMode:!1,adhdFriendlyMode:!1,blindnessMode:!1,epilepsySafeMode:!1},Sy="accessibility-settings",m$=new Set(["default","left","center","right"]),g1=["visionImpairedMode","seizureSafeProfileMode","adhdFriendlyMode","blindnessMode","epilepsySafeMode"],h$={visionImpairedMode:{fontSize:140,readableFont:!0,brightness:115,highContrast:!0,focusHighlight:!0,pageAnnouncements:!0},seizureSafeProfileMode:{reduceMotion:!0,monochrome:!0},adhdFriendlyMode:{reduceMotion:!0,focusMask:!0,saturation:85,reduceTransparency:!0},blindnessMode:{textToSpeech:!0,highContrast:!0,brightness:120,keyboardNavigation:!0,focusHighlight:!0,pageAnnouncements:!0},epilepsySafeMode:{reduceMotion:!0,monochrome:!0,muteSounds:!0}},b1={hr:"hr-HR",en:"en-US",de:"de-DE"},x1={hr:{toolbar:{triggerLabel:"Otvori alat za pristupaÄnost",triggerTitle:"PristupaÄnost",title:"Alat za pristupaÄnost",close:"Zatvori",autosave:"Postavke se automatski spremaju lokalno u pregledniku i primjenjuju na sve stranice.",poweredBy:"powered by",quickPresetsTitle:"Brze prilagodbe",profilesTitle:"Profili pristupaÄnosti",demoHint:"Zadržite miÅ¡ kratko iznad opcije u alatu za pristupaÄnost da se prikaže mali preview pokraj kursora."},tabs:{visual:"Vizualno",profiles:"Profili",reading:"Äitanje",n
263avigation:"Navigacija"},actions:{reset:"Vrati na zadane postavke",readPage:"ProÄitaj stranicu",readSelection:"ProÄitaj oznaÄeni tekst",stop:"Zaustavi"},states:{enabled:"ukljuÄen",disabled:"iskljuÄen"},messages:{toolbarOpened:"Otvoren je alat za pristupaÄnost",toolbarClosed:"Zatvoren je alat za pristupaÄnost",navigationOpened:"Otvorena navigacija",searchFocused:"Fokus na pretragu",pageOpened:"Otvorena stranica: {title}",settingsRestored:"Sve postavke su vraÄene na zadane vrijednosti",noSelectedText:"Nije oznaÄen tekst za Äitanje",readingSelectedText:"Äitanje oznaÄenog teksta",presetApplied:"Primijenjen preset: {label}",keyboardNavigationEmpty:"Nema dostupnih elemenata za {label}",keyboardNavigationJump:"Skok na {label}: {text}"},controls:{fontSize:{label:"VeliÄina teksta",description:"PoveÄava ili smanjuje veliÄinu teksta u sadržaju"},saturation:{label:"ZasiÄenost boja",description:"PodeÅ¡ava intenzitet boja sadržaja"},brightness:{label:"Svjetlina",description:"PodeÅ¡ava ukupnu svjetlinu sadržaja"},highContrast:{label:"Visoki kontrast",description:"PojaÄava razliku izmeÄu teksta i pozadine"},darkMode:{label:"Tamni naÄin",description:"Tamna pozadina za smanjenje naprezanja oÄiju"},lightContrast:{label:"Svijetli kontrast",description:"Svijetla kontrastna tema za mirniji prikaz"},monochrome:{label:"Monokromatski prikaz",description:"Uklanja boje i prikazuje sadržaj u sivim tonovima"},hideImages:{label:"Sakrij slike",description:"Snažnije uklanja slike, SVG-ove i pozadinske slike"},highlightTitles:{label:"Istakni naslove",description:"NaglaÅ¡ava naslove i hijerarhiju stranice"},highlightAll:{label:"Istakni blokove",description:"PojaÄava glavne blokove i odjeljke sadržaja"},muteSounds:{label:"UtiÅ¡aj medije",description:"UtiÅ¡ava audio i video sadržaj stranice"},reduceMotion:{label:"Smanji animacije",description:"Uklanja pokrete i animacije"},reduceTransparency:{label:"Smanji transparenciju",description:"Uklanja blur i prozirne slojeve"},readableFont:{label:"Äitljiviji font",description:"Standardni font optimiziran za lakÅ¡e Äitanje"},dyslexicFont:{label:"Font za disleksiju",description:"LakÅ¡e Äitljiv font za osobe s disleksijom"},fontWeight:{label:"Podebljan tekst",description:"PojaÄava debljinu teksta u sadržaju"},textAlign:{label:"Poravnanje teksta",description:"Mijenja poravnanje odlomaka i tekstualnih blokova"},textAlignOptions:{default:"Zadano",left:"Lijevo",center:"Centrirano",right:"Desno"},textSpacing:{label:"PoveÄaj razmak teksta",description:"Dodaje viÅ¡e prostora izmeÄu slova i rijeÄi"},lineHeight:{label:"Visina reda",description:"PoveÄava razmak izmeÄu redova teksta"},readingGuide:{label:"VodiÄ za Äitanje",description:"Žuta traka prati kursor za lakÅ¡e Äitanje"},focusMask:{label:"Maska za fokus",description:"Zatamnjuje ostatak stranice oko aktivnog podruÄja"},textMagnifier:{label:"PoveÄalo teksta",description:"Prikazuje uveÄani tekst elementa ispod kursora ili fokusa"},textToSpeech:{label:"Äitanje teksta",description:"Glasovno Äitanje elemenata i sadržaja"},largeCursor:{label:"Veliki pokazivaÄ",description:"PoveÄava kursor miÅ¡a"},focusHighlight:{label:"Isticanje fokusa",description:"Vidljiviji obrub fokusiranih elemenata"},linkHighlight:{label:"Istakni linkove",description:"NaglaÅ¡ava sve linkove na stranici"},highlightColor:{label:"Boja highlighta",description:"Odabir boje za fokus i isticanje linkova"},interactiveHighlight:{label:"Istakni interaktivne elemente",description:"OznaÄava gumbe, linkove i polja i bez hovera"},largerClickTargets:{label:"VeÄi klikabilni elementi",description:"PoveÄava aktivnu povrÅ¡inu gumba i linkova"},tableMode:{label:"A11y naÄin za tablice",description:"PojaÄava kontrast redova i poboljÅ¡ava tablice"},formErrorSummary:{label:"Sažetak greÅ¡aka u formi",description:"Na vrh formi dodaje listu greÅ¡aka i skok na polje"},pageAnnouncements:{label:"Najava promjene stranice",description:"ARIA najava kod promjene stranice"},keyboardNavigation:{label:"Navigacija po tipovima",description:"H, F, B, L i G skaÄu na naslove, forme, gumbe, linkove i grafike"},keyboardShortcuts:{label:"Globalne tipkovniÄke preÄice",description:"Alt+A toolbar, Alt+
263M meni, Alt+S pretraga"},keyboardNavigationTypes:{heading:"naslove",form:"forme",button:"gumbe",link:"linkove",graphic:"grafike"}},presets:{vision:{label:"Slabovidnost",description:"VeÄi tekst, fokus i kontrast"},dyslexia:{label:"Disleksija",description:"Font, razmak i smanjene smetnje"},motor:{label:"Motorika",description:"VeÄi ciljevi, jaÄi hover/fokus i kursor"},reading:{label:"Äitanje",description:"VodiÄ Äitanja i smanjena vizualna buka"}},profiles:{visionImpairedMode:{label:"PojaÄana Äitljivost",description:"VeÄi tekst, snažniji kontrast i jasniji fokus"},seizureSafeProfileMode:{label:"Mirniji prikaz",description:"Smanjuje animacije i vizualne podražaje"},adhdFriendlyMode:{label:"Fokusirani prikaz",description:"Smanjuje distrakcije i drži sadržaj u prvom planu"},blindnessMode:{label:"Glasovno voÄenje",description:"PojaÄava Äitanje naglas, kontrast i navigaciju tipkovnicom"},epilepsySafeMode:{label:"Sigurniji prikaz",description:"Smanjuje pokret, boje i zvuÄne smetnje"}},navigationHelp:{title:"TipkovniÄke preÄice",forward:"Navigacija naprijed",backward:"Navigacija nazad",activate:"Aktivacija elementa",close:"Zatvaranje dijaloga",toolbar:"Otvori/zatvori alat",menu:"Otvori meni",search:"Fokus na pretragu"},preview:{fallback:"Preview efekta na tipiÄne UI elemente."}},en:{toolbar:{triggerLabel:"Open accessibility toolbar",triggerTitle:"Accessibility",title:"Accessibility Toolbar",close:"Close",autosave:"Settings are automatically saved locally in the browser and applied across all pages.",poweredBy:"powered by",quickPresetsTitle:"Quick adjustments",profilesTitle:"Accessibility profiles",demoHint:"Hover over an option in the accessibility toolbar for a moment to see a small preview next to the cursor."},tabs:{visual:"Visual",profiles:"Profiles",reading:"Reading",navigation:"Navigation"},actions:{reset:"Restore default settings",readPage:"Read page",readSelection:"Read selected text",stop:"Stop"},states:{enabled:"enabled",disabled:"disabled"},messages:{toolbarOpened:"Accessibility toolbar opened",toolbarClosed:"Accessibility toolbar closed",navigationOpened:"Navigation opened",searchFocused:"Search focused",pageOpened:"Opened page: {title}",settingsRestored:"All settings were restored to defaults",noSelectedText:"No text selected for reading",readingSelectedText:"Reading selected text",presetApplied:"Preset applied: {label}",keyboardNavigationEmpty:"No available elements for {label}",keyboardNavigationJump:"Jumped to {label}: {text}"},controls:{fontSize:{label:"Text size",description:"Increases or decreases content text size"},saturation:{label:"Color saturation",description:"Adjusts the intensity of page colors"},brightness:{label:"Brightness",description:"Adjusts overall content brightness"},highContrast:{label:"High contrast",description:"Strengthens contrast between text and background"},darkMode:{label:"Dark mode",description:"Dark background to reduce eye strain"},lightContrast:{label:"Light contrast",description:"A softer light contrast theme"},monochrome:{label:"Monochrome view",description:"Removes color and shows the page in grayscale"},hideImages:{label:"Hide images",description:"More strongly removes images, SVGs and background images"},highlightTitles:{label:"Highlight headings",description:"Emphasizes headings and page hierarchy"},highlightAll:{label:"Highlight blocks",description:"Emphasizes key content blocks and sections"},muteSounds:{label:"Mute media",description:"Mutes page audio and video media"},reduceMotion:{label:"Reduce motion",description:"Removes movement and animation"},reduceTransparency:{label:"Reduce transparency",description:"Removes blur and transparent layers"},readableFont:{label:"Readable font",description:"A cleaner standard font for easier reading"},dyslexicFont:{label:"Dyslexia font",description:"A font tuned for easier reading"},fontWeight:{label:"Heavier text",description:"Strengthens text weight inside content areas"},textAlign:{label:"Text alignment",description:"Changes paragraph and content block alignment"},textAlignOptions:{default:"Default",left:"Left",center:"Center",right:"Right"},textSpacing:{label:"Increase text spacing",description:"Adds more space between letters and words"},lineHeight:{label:"Line height",description:"Increases spacing between lines of text"},readingGuide:{label:"Reading guide",description:"A yellow guide follows the cursor for easier reading"},focusMask:{label:"Focus mask",description:"Dims the rest of the page around the active area"},textMagnifier:{label:"Text magnifier",description:"Shows enlarged text from the element under the cursor or focus"},textToSpeech:{label:"Text to speech",description:"Reads content and elements aloud"},largeCursor:{label:"Large cursor",description:"Enlarges the mouse
263cursor"},focusHighlight:{label:"Focus highlight",description:"Makes focused elements easier to see"},linkHighlight:{label:"Highlight links",description:"Emphasizes all links on the page"},highlightColor:{label:"Highlight color",description:"Chooses the color used for focus and link highlighting"},interactiveHighlight:{label:"Highlight interactive elements",description:"Marks buttons, links and fields even without hover"},largerClickTargets:{label:"Larger click targets",description:"Increases the active surface of buttons and links"},tableMode:{label:"Accessible tables",description:"Improves row contrast and table readability"},formErrorSummary:{label:"Form error summary",description:"Adds a list of form errors with quick jumps to fields"},pageAnnouncements:{label:"Page change announcements",description:"Uses an ARIA live region when the page changes"},keyboardNavigation:{label:"Type navigation",description:"H, F, B, L and G jump between headings, forms, buttons, links and graphics"},keyboardShortcuts:{label:"Global keyboard shortcuts",description:"Alt+A toolbar, Alt+M menu, Alt+S search"},keyboardNavigationTypes:{heading:"headings",form:"forms",button:"buttons",link:"links",graphic:"graphics"}},presets:{vision:{label:"Low vision",description:"Larger text, focus and contrast"},dyslexia:{label:"Dyslexia",description:"Font, spacing and fewer distractions"},motor:{label:"Motor",description:"Larger targets, stronger hover/focus and cursor"},reading:{label:"Reading",description:"Reading guide and reduced visual noise"}},profiles:{visionImpairedMode:{label:"Clarity mode",description:"Larger text, stronger contrast and clearer focus"},seizureSafeProfileMode:{label:"Calm view",description:"Reduces animation and visual stimulation"},adhdFriendlyMode:{label:"Focus mode",description:"Reduces distractions and keeps content in the foreground"},blindnessMode:{label:"Audio guidance",description:"Strengthens text-to-speech, contrast and keyboard navigation"},epilepsySafeMode:{label:"Safe view",description:"Reduces motion, color intensity and sound distractions"}},navigationHelp:{title:"Keyboard shortcuts",forward:"Move forward",backward:"Move backward",activate:"Activate element",close:"Close dialog",toolbar:"Open/close toolbar",menu:"Open menu",search:"Focus search"},preview:{fallback:"Preview of the effect on common UI elements."}}},Bg={orange:{label:"NaranÄasta",linkColor:"#ea580c",linkUnderline:"#f97316",linkTint:"rgba(249, 115, 22, 0.18)",linkHoverBg:"rgba(249, 115, 22, 0.14)",linkHoverInset:"rgba(249, 115, 22, 0.2)",focusColor:"#ff6b00",focusGlow:"rgba(255, 107, 0, 0.3)",focusHoverGlow:"rgba(255, 107, 0, 0.18)",focusInset:"rgba(255, 107, 0, 0.85)",focusInsetStrong:"rgba(255, 107, 0, 0.9)",interactiveBg:"rgba(255, 107, 0, 0.08)",interactiveBorder:"rgba(255, 107, 0, 0.45)"},blue:{label:"Plava",linkColor:"#1d4ed8",linkUnderline:"#2563eb",linkTint:"rgba(59, 130, 246, 0.2)",linkHoverBg:"rgba(59, 130, 246, 0.14)",linkHoverInset:"rgba(59, 130, 246, 0.2)",focusColor:"#2563eb",focusGlow:"rgba(37, 99, 235, 0.3)",focusHoverGlow:"rgba(37, 99, 235, 0.18)",focusInset:"rgba(37, 99, 235, 0.85)",focusInsetStrong:"rgba(37, 99, 235, 0.9)",interactiveBg:"rgba(37, 99, 235, 0.08)",interactiveBorder:"rgba(37, 99, 235, 0.42)"},green:{label:"Zelena",linkColor:"#15803d",linkUnderline:"#16a34a",linkTint:"rgba(34, 197, 94, 0.2)",linkHoverBg:"rgba(34, 197, 94, 0.14)",linkHoverInset:"rgba(34, 197, 94, 0.2)",focusColor:"#16a34a",focusGlow:"rgba(22, 163, 74, 0.3)",focusHoverGlow:"rgba(22, 163, 74, 0.18)",focusInset:"rgba(22, 163, 74, 0.85)",focusInsetStrong:"rgba(22, 163, 74, 0.9)",interactiveBg:"rgba(22, 163, 74, 0.08)",interactiveBorder:"rgba(22, 163, 74, 0.42)"}},g$=[{id:"visionImpairedMode",label:"PojaÄana Äitljivost",description:"VeÄi tekst, snažniji kontrast i jasniji fokus",patch:{visionImpairedMode:!0}},{id:"seizureSafeProfileMode",label:"Mirniji prikaz",description:"Smanjuje animacije i vizualne podražaje",patch:{seizureSafeProfileMode:!0}},{id:"adhdFriendlyMode",label:"Fokusirani prikaz",description:"Smanjuje distrakcije i drži sadržaj u prvom planu",patch:{adhdFriendlyMode:!0}},{id:"blindnessMode",label:"Glasovno voÄenje",description:"PojaÄava Äitanje naglas, kontrast i navigaciju tipkovnicom",patch:{blindnessMode:!0}},{id:"epilepsySafeMode",label:"Sigurniji prikaz",description:"Smanjuje pokret, boje i zvuÄne smetnje",patch:{epilepsySafeMode:!0}}
263],b$=[{id:"vision",label:"Slabovidnost",description:"VeÄi tekst, fokus i kontrast",patch:{fontSize:130,highContrast:!0,focusHighlight:!0,linkHighlight:!0,pageAnnouncements:!0,largerClickTargets:!0,tableMode:!0}},{id:"dyslexia",label:"Disleksija",description:"Font, razmak i smanjene smetnje",patch:{dyslexicFont:!0,textSpacing:!0,lineHeight:190,reduceMotion:!0,hideImages:!1,focusHighlight:!0}},{id:"motor",label:"Motorika",description:"VeÄi ciljevi, jaÄi hover/fokus, kursor",patch:{largerClickTargets:!0,interactiveHighlight:!0,focusHighlight:!0,largeCursor:!0,reduceMotion:!0,keyboardShortcuts:!0}},{id:"reading",label:"Äitanje",description:"VodiÄ Äitanja i smanjena vizualna buka",patch:{readingGuide:!0,focusMask:!1,reduceTransparency:!0,textSpacing:!0,lineHeight:180,linkHighlight:!0}}],Xp=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),em=(t,e="hr")=>typeof t!="string"?e:t.trim().toLowerCase().replace(/_/g,"-").split("-")[0]||e,v1=()=>{var n;const t=typeof document<"u"?em(((n=document.documentElement)==null?void 0:n.lang)||"",""):"";return t||(typeof navigator<"u"?em(navigator.language||"",""):"")||"hr"},x$=t=>{const e=em(t);return b1[e]||b1.en},v$=(t,e={})=>String(t).replace(/\{(\w+)\}/g,(n,r)=>String(e[r]??"")),y$=(t,e,n="")=>
263{const r=String(e).split("."),i=[x1[em(t)],x1.hr].filter(Boolean);for(const s of i){let o=s;for(const a of r){if(!o||typeof o=="string"){o=void 0;break}o=o[a]}if(typeof o=="string")return o}return n||e},wE=t=>{const e=String(t||"");return m$.has(e)?e:mr.textAlign},Mf=(t,e)=>{if(!Xp(e))return{};const n={...e},r=Object.keys(n).filter(s=>g1.includes(s)&&n[s]===!0),i=r[r.length-1];return i?(g1.forEach(s=>{n[s]=s===i}),{...h$[i],...n}):n},Ny=(t,e={})=>{const n={...mr,...Xp(t)?t:{}},r=Xp(e)?e:{};return n.textAlign=wE(n.textAlign),n.darkMode&&n.lightContrast&&(r.lightContrast===!0&&r.darkMode!==!0?n.darkMode=!1:n.lightContrast=!1),n.dyslexicFont&&(n.readableFont=!1),n},If=(t=mr,e={})=>{const n=Mf(t,e),r={...mr,...Xp(t)?t:{},...n};return Ny(r,n)},k$=()=>{if(typeof window>"u")return{...mr};try{const t=window.localStorage.getItem(Sy);if(!t)return{...mr};const e=JSON.parse(t);return If(mr,e)}catch{return{...mr}}},y1=t=>{if(!(typeof window>"u"))try{const e=Ny(t);window.localStorage.setItem(Sy,JSON.stringify(e))}catch{return}},j$=()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem(Sy)}catch{return}},zx=()=>{var t,e;typeof document>"u"||((t=document.getElementById("a11y-text-magnifier"))==null||t.remove(),(e=document.getElementById("a11y-text-magnifier-lens"))==null||e.remove(),document.querySelectorAll("[data-a11y-magnified='true']").forEach(n=>{n.removeAttribute("data-a11y-magnified")}))},SE=()=>{typeof document>"u"||document.querySelectorAll(".a11y-speech-highlight, [data-a11y-speech-highlight='true']").forEach(t=>{t.classList.remove("a11y-speech-highlight"),t.removeAttribute("data-a11y-speech-highlight")})},Px=()=>{typeof document>"u"||document.querySelectorAll(".a11y-keyboard-navigation-target, [data-a11y-keyboard-navigation-target='true']").forEach(t=>{t instanceof HTMLElement&&(t.classList.remove("a11y-keyboard-navigation-target"),t.removeAttribute("data-a11y-keyboard-navigation-target"),t.dataset.a11yKeyboardNavTabindex!==void 0&&(t.dataset.a11yKeyboardNavTabindex===""?t.removeAttribute("tabindex"):t.setAttribute("tabindex",t.dataset.a11yKeyboardNavTabindex),delete t.dataset.a11yKeyboardNavTabindex))})},Lc=t=>{typeof document>"u"||document.querySelectorAll("audio, video").forEach(e=>{if(e instanceof HTMLMediaElement){if(t){e.dataset.a11yMutedByWidget||(e.dataset.a11yMutedByWidget="true",e.dataset.a11yOriginalMuted=String(e.muted)),e.muted=!0;return}e.dataset.a11yMutedByWidget==="true"&&(e.muted=e.dataset.a11yOriginalMuted==="true",delete e.dataset.a11yMutedByWidget,delete e.dataset.a11yOriginalMuted)}})},tf=(t,e,n)=>{t instanceof HTMLElement&&t.dataset[n]===void 0&&(t.dataset[n]=t.style.getPropertyValue(e)||"__a11y_empty__")},nf=(t,e,n)=>{if(!(t instanceof HTMLElement))return;const r=t.dataset[n];r!==void 0&&(r==="__a11y_empty__"?t.style.removeProperty(e):t.style.setProperty(e,r),delete t.dataset[n])},Dx=()=>{typeof document>"u"||document.querySelectorAll(".a11y-preview-scope [data-a11y-hidden-image='true']").forEach(t=>{t instanceof HTMLElement&&(nf(t,"display","a11yOriginalDisplay"),nf(t,"visibility","a11yOriginalVisibility"),nf(t,"opacity","a11yOriginalOpacity"),nf(t,"background-image","a11yOriginalBackgroundImage"),t.removeAttribute("data-a11y-hidden-image"))})},w$=t=>{if(typeof document>"u"||(Dx(),!t))return;const e=document.querySelector(".a11y-preview-scope");e instanceof HTMLElement&&(e.querySelectorAll("img, svg").forEach(n=>{n instanceof HTMLElement&&(n.closest(".accessibility-toolbar-modal")||n.closest("[data-a11y-toolbar-trigger='true']")||(tf(n,"display","a11yOriginalDisplay"),tf(n,"visibility","a11yOriginalVisibility"),tf(n,"opacity","a11yOriginalOpacity"),n.dataset.a11yHiddenImage="true",n.style.setProperty("display","none","important"),n.style.setProperty("visibility","hidden","important"),n.style.setProperty("opacity","0","important")))}),e.querySelectorAll("*").forEach(n=>{if(!(n instanceof HTMLElement)||n.closest(".accessibility-toolbar-modal")||n.closest("[data-a11y-toolbar-trigger='true']"))return;const r=window.getComputedStyle(n).backgroundImage;
263!r||r==="none"||(tf(n,"background-image","a11yOriginalBackgroundImage"),n.dataset.a11yHiddenImage="true",n.style.setProperty("background-image","none","important"))}))},Fg=t=>{const e=Ny(t);e.textMagnifier||zx(),e.textToSpeech||SE(),e.keyboardNavigation||Px(),Lc(!!e.muteSounds)},S$=t=>{const e=[];return t.monochrome&&e.push("grayscale(1)"),t.saturation!==100&&e.push(`saturate(${t.saturation}%)`),t.brightness!==100&&e.push(`brightness(${t.brightness}%)`),t.highContrast&&e.push("contrast(1.5)"),!t.highContrast&&t.lightContrast&&e.push("contrast(1.1)"),e.join(" ")||"none"},k1=t=>{const e=wE(t);return e==="default"?"inherit":e};function N$(){const[t,e]=h.useState(!1),[n,r]=h.useState(mr),[i,s]=h.useState(()=>v1()),[o,a]=h.useState(!1),[l,u]=h.useState("visual"),[d,f]=h.useState(null),p=h.useRef(null),m=h.useRef({path:"",title:""}),g=h.useRef(null),y=h.useRef(null),j=h.useRef(null),x=h.useRef({x:0,y:0}),k=h.useRef(null),N=h.useRef(null),C=h.useRef(null),w=h.useCallback((b,T="",S=null)=>{const I=y$(i,b,T);return S?v$(I,S):I},[i]),E=h.useCallback(b=>{const T=String(b||"").trim();if(!T)return;let S=document.getElementById("a11y-live-region");S||(S=document.createElement("div"),S.id="a11y-live-region",S.setAttribute("aria-live","polite"),S.setAttribute("aria-atomic","true"),S.style.cssText="position:fixed;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;",document.body.appendChild(S)),S.textContent="",p.current&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{S.textContent=T},20)},[]),D=h.useCallback((b,{speakMessage:T}={})=>{r(S=>{var K;const I=If(S,b);return(K=g.current)==null||K.call(g,I),y1(I),T&&E(T),I})},[E]),L=h.useCallback(b=>b!=null&&b.id?w(`presets.${b.id}.label`,b.label||b.id):"",[w]),V=h.useCallback(b=>b!=null&&b.id?w(`presets.${b.id}.description`,b.description||""):"",[w]),te=h.useCallback(b=>b!=null&&b.id?w(`profiles.${b.id}.label`,b.label||b.id):"",[w]),ae=h.useCallback(b=>b!=null&&b.id?w(`profiles.${b.id}.description`,b.description||""):"",[w]),ke=h.useCallback(b=>{const T=b==null?void 0:b.highlightColor;return T?Bg[T]:Bg.orange},[]),ge=h.useCallback(b=>b instanceof HTMLElement&&!!(b.closest(".accessibility-toolbar-modal")||b.closest("[data-a11y-toolbar-trigger='true']")||b.closest("#a11y-text-magnifier")),[]),Se=h.useCallback(b=>{if(!(b instanceof HTMLElement))return!1;const T=window.getComputedStyle(b),S=b.getBoundingClientRect();return T.display!=="none"&&T.visibility!=="hidden"&&S.width>0&&S.height>0},[]),me=h.useCallback(b=>{if(!(b instanceof HTMLElement))return!1;const T=b.tagName;return b.isContentEditable||T==="INPUT"||T==="TEXTAREA"||T==="SELECT"},[]),H=h.useCallback((b,T=280)=>{const S=String(b||"").replace(/\s+/g," ").trim();return S?S.length<=T?S:`${S.slice(0,T-1).trim()}...`:""},[]),P=h.useCallback(b=>{var G,re,pe,ue,Ve;if(!(b instanceof HTMLElement))return"";const T=b.getAttribute("aria-labelledby")||"";if(T){const Fe=T.split(/\s+/).map(et=>{var qe;return((qe=document.getElementById(et))==null?void 0:qe.textContent)||""}).join(" ").trim();if(Fe)return Fe}const S=(G=b.getAttribute("aria-label"))==null?void 0:G.trim();if(S)return S;const I=(re=b.getAttribute("title"))==null?void 0:re.trim();if(I)return I;const K=b.getAttribute("id");if(K){const Fe=document.querySelector(`label[for="${K}"]`),et=(pe=Fe==null?void 0:Fe.textContent)==null?void 0:pe.trim();if(et)return et.replace(/[:*]\s*$/,"")}const X=(Ve=(ue=b.closest("label"))==null?void 0:ue.textContent)==null?void 0:Ve.trim();return X?X.replace(/[:*]\s*$/,""):""},[]),z=h.useCallback((b,T=280)=>{if(!(b instanceof HTMLElement)||ge(b)||!Se(b))return"";if(b instanceof HTMLImageElement)return H(b.alt||P(b)||"Slika",T);if(b.tagName==="SVG"||b.getAttribute("role")==="img")return H(P(b)||"Grafika",T);if(b instanceof HTMLInputElement){const K=String(b.type||"text").toLowerCase();return["hidden","password"].includes(K)?H(P(b)||"Polje za unos",T):["button","submit","reset"].includes(K)?H(b.value||P(b)||"Gumb",T):["checkbox","radio"].includes(K)?H(P(b)||b.value||"Odabir",T):H(P(b)||b.placeholder||b.value||"Polje za unos",T)}if(b instanceof HTMLTextAreaElement||b instanceof HTMLSelectElement)return H(P(b)||b.getAttribute("placeholder")||b.value||"Polje obrasca",T);const S=P(b);if(S)return H(S,T);const I=H(b.innerText||b.textContent||"",T);return!I||b.querySelectorAll("*").length>18&&I.length>180?"":I},[H,P,ge,Se]),Y=h.useCallback((b,T=280)=>{let S=b instanceof HTMLElement?b:null,I=0;for(;S&&I<6;){if(ge(S))return null;const K=z(S,T);if(K)return{element:S,text:K};S=S.parentElement,I+=1}return null},[z,ge]),Q=h.useCallback(()=>{k.current=null,SE()},[]),O=h.useCallback(b=>{Q(),!(!(b instanceof HTMLElement)||ge(b))&&(b.classList.add("a11y-speech-highlight"),b.setAttribute("data-a11y-speech-highlight","true"),k.current=b)},[Q,ge]),U=h.useCallback(()=>{Px(),N.current=null},[]),$=h.useCallback(b=>{!(b instanceof HTMLElement)||ge(b)||(U(),b.matches('a[href], button, input, textarea, select, summary, [tabindex]:not
263([tabindex="-1"])')||(b.dataset.a11yKeyboardNavTabindex=b.getAttribute("tabindex")||"",b.setAttribute("tabindex","-1")),b.classList.add("a11y-keyboard-navigation-target"),b.setAttribute("data-a11y-keyboard-navigation-target","true"),N.current=b,b.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),window.requestAnimationFrame(()=>{b.focus({preventScroll:!0})}))},[U,ge]),J=h.useCallback(b=>{const T=document.querySelector(".a11y-preview-scope");if(!(T instanceof HTMLElement))return;const S=Number(b)/100,I=S-1,K=["h1","h2","h3","h4","h5","h6","p","li","td","th","small","blockquote","figcaption","dt","dd","a","button","label","input","textarea","select","span"].join(", "),X=G=>{if(!(G instanceof HTMLElement))return S;if(G.closest(".accessibility-toolbar-modal")||G.closest("[data-a11y-toolbar-trigger='true']")||G.closest("[data-no-a11y-scale='true']"))return 1;if(G.closest("header nav")||G.closest("footer nav")||G.closest("[role='navigation']"))return 1+I*.25;if(G.closest("button, [role='button'], input, textarea, select, label"))return 1+I*.45;if(G.closest("a"))return 1+I*.4;const re=G.tagName;return["P","LI","TD","TH","BLOCKQUOTE","FIGCAPTION","DT","DD"].includes(re)?S:["H1","H2","H3","H4","H5","H6"].includes(re)?1+I*.8:re==="SMALL"?1+I*.7:re==="SPAN"?1+I*.55:1+I*.6};T.querySelectorAll(K).forEach(G=>{if(!(G instanceof HTMLElement))return;const re=window.getComputedStyle(G);G.dataset.a11yBaseFontSize||(G.dataset.a11yBaseFontSize=re.fontSize);const pe=parseFloat(G.dataset.a11yBaseFontSize||re.fontSize);if(!Number.isFinite(pe))return;const ue=X(G);if(Math.abs(ue-1)<.001){G.style.removeProperty("font-size");return}G.style.setProperty("font-size",`${pe*ue}px`,"important")})},[]),ie=h.useCallback(()=>{y.current&&window.clearTimeout(y.current),j.current&&window.clearTimeout(j.current),y.current=null,j.current=null},[]),oe=h.useCallback((b,T=!1)=>{!b||!Number.isFinite(b.x)||!Number.isFinite(b.y)||(x.current={x:b.x,y:b.y},T&&f(S=>S&&{...S,x:b.x,y:b.y}))},[]),be=h.useCallback(b=>{if(!(b instanceof HTMLElement))return x.current;const T=b.getBoundingClientRect();return{x:Math.round(T.left+Math.min(Math.max(T.width/2,24),220)),y:Math.round(T.top+6)}},[]),Ee=h.useCallback((b,T=650,S=null)=>{ie(),y.current=window.setTimeout(()=>{const I=S||x.current||{x:24,y:24};f({label:(b==null?void 0:b.label)||"Opcija",description:(b==null?void 0:b.description)||"",icon:(b==null?void 0:b.icon)||"fa-eye",kind:(b==null?void 0:b.kind)||"toggle",settingKey:(b==null?void 0:b.settingKey)||"",meta:(b==null?void 0:b.meta)??null,x:I.x,y:I.y})},T)},[ie]),le=h.useCallback((b=140)=>{y.current&&(window.clearTimeout(y.current),y.current=null),j.current&&window.clearTimeout(j.current),j.current=window.setTimeout(()=>{f(null)},b)},[]),Me=h.useCallback((b,T)=>{const S={x:b.clientX,y:b.clientY};oe(S,!1),f(I=>I&&null),Ee(T,650,S)},[Ee,oe]),_=h.useCallback((b,T={})=>{if(!n.textToSpeech||!("speechSynthesis"in window))return;const S=H(b,4e3);if(!S)return;const{sourceElement:I=null,interrupt:K=!1}=T;if(K&&window.speechSynthesis.speaking)window.speechSynthesis.cancel(),Q(),a(!1);else if(o||window.speechSynthesis.speaking)return;const X=new SpeechSynthesisUtterance(S);X.lang=x$(i),X.rate=.9,X.onstart=()=>{I instanceof HTMLElement&&O(I),a(!0)},X.onend=()=>{Q(),a(!1)},X.onerror=()=>{Q(),a(!1)},window.speechSynthesis.speak(X)},[Q,H,O,i,n.textToSpeech,o]),ce=h.useCallback((b,T={})=>{b&&(E(b),_(b,{interrupt:!0,...T}))},[E,_]);h.useEffect(()=>{var T;const b=k$();if(r(b),(T=g.current)==null||T.call(g,b),!document.querySelector("link[data-fa]")){const S=document.createElement("link");S.rel="stylesheet",S.href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css",S.setAttribute("data-fa","true"),document.head.appendChild(S)}},[]),h.useEffect(()=>{if(typeof document>"u")return;const b=()=>{s(S=>{const I=v1();return S===I?S:I})};b();const T=new MutationObserver(b);return T.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),window.addEventListener("languagechange",b),()=>{T.disconnect(),window.removeEventListener("languagechange",b)}},[]),h.useEffect(()=>{t||f(null)},[t]),h.useEffect(()=>()=>{var b,T,S;Fg(mr),Dx(),Px(),(b=document.getElementById("reading-guide"))==null||b.remove(),(T=document.getElementById("focus-mask"))==null||T.remove(),(S=document.getElementById("focus-mask-style"))==null||S.remove()},[]),h.useEffect(()=>{const b=document.querySelector(".a11y-preview-scope");if(!(b instanceof HTMLElement))return;const T=()=>{J(n.fontSize)};T();const S=new MutationObserver(()=>{T()});return S.observe(b,{childList:!0,subtree:!0}),()=>{S.disconnect()}},[J,n.fontSize]),h.useEffect(()=>{var T;if(typeof document>"u")return;if((T=C.current)==null||T.disconnect(),C.current=null,!n.muteSounds){Lc(!1);return}Lc(!0);const b=new MutationObserver(()=>{Lc(!0)});return b.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["autoplay","src","muted"]}),C.current=b,()=>{b.disconnect(),C.current===b&&(C.current=null),Lc(!1)}},[n.muteSounds]),h.useEffect(()=>{if(!n.textMagnifier){zx();return}let b=document.getElementById("a11y-text-magnifier");b instanceof HTMLDivElement||(b=document.createElement("div"),b.id="a11y-text-magnifier",b.setAttribute("aria-hidden","true"),b.style.cssText=` 264 position: fixed; 265 left: 0; 266 top: 0; 267 max-width: min(420px, calc(100vw - 24px)); 268 padding: 0.85rem 1rem; 269 border-radius: 1rem; 270 background: rgba(15, 23, 42, 0.94); 271 color: #ffffff; 272 font-size: 1.125rem; 273 font-weight: 700; 274 line-height: 1.5; 275 box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28); 276 pointer-events: none; 277 z-index: 1001; 278 opacity: 0; 279 transform: translate3d(0, 0, 0) scale(0.98); 280 transform-origin: top left; 281 transition: opacity 160ms ease, transform 160ms ease; 282 white-space: normal; 283 `,document.body.appendChild(b));let T=null;const S=()=>{T instanceof HTMLElement&&T.removeAttribute("data-a11y-magnified"),T=null,b&&(b.style.opacity="0",b.style.transform="translate3d(0, 0, 0) scale(0.98)")},I=(re,pe)=>{const ue=Y(re,180);if(!ue||!(b instanceof HTMLDivElement)){S();return}T instanceof HTMLElement&&T!==ue.element&&T.removeAttribute("data-a11y-magnified"),T=ue.element,T.setAttribute("data-a11y-magnified","true"),b.textContent=ue.text;const Ve=window.innerWidth,Fe=window.innerHeight,et=Math.min(Math.max(12,pe.x+18),Math.max(12,Ve-320)),qe=Math.min(Math.max(12,pe.y+18),Math.max(12,Fe-120));b.style.left=`${et}px`,b.style.top=`${qe}px`,b.style.opacity="1",b.style.transform="translate3d(0, 0, 0) scale(1)"},K=re=>{const pe=re.target instanceof HTMLElement?re.target:null;if(!pe||ge(pe)){S();return}I(pe,{x:re.clientX,y:re.clientY})},X=re=>{const pe=re.target instanceof HTMLElement?re.target:null;if(!pe||ge(pe)){S();return}const ue=pe.getBoundingClientRect();I(pe,{x:Math.round(ue.left+Math.min(Math.max(ue.width*.5,24),220)),y:Math.round(ue.top+ue.height)})},G=()=>{S()};return document.addEventListener("mousemove",K,!0),document.addEventListener("focusin",X,!0),window.addEventListener("blur",G),document.addEventListener("scroll",G,!0),()=>{document.removeEventListener("mousemove",K,!0),document.removeEventListener("focusin",X,!0),window.removeEventListener("blur",G),document.removeEventListener("scroll",G,!0),S(),zx()}},[Y,ge,n.textMagnifier]),h.useEffect(()=>{if(!n.textToSpeech){Q(),"speechSynthesis"in window&&window.speechSynthesis.cancel(),a(!1);return}let b,T=null;const S=K=>{const X=Y(K.target,320);!X||X.element===T||(T=X.element,window.clearTimeout(b),b=window.setTimeout(()=>{window.speechSynthesis.speaking||_(X.text,{sourceElement:X.element})},800))},I=K=>{const X=Y(K.target,320);X&&_(X.text,{sourceElement:X.element,interrupt:!0})};return document.addEventListener("mouseover",S),document.addEventListener("click",I,!0),()=>{document.removeEventListener("mouseover",S),document.removeEventListener("click",I,!0),window.clearTimeout(b)}},[Q,Y,n.textToSpeech,_]),h.useEffect(()=>{if(!n.readingGuide){const S=document.getElementById("reading-guide");S&&S.remove();return}let b=document.getElementById("reading-guide");b||(b=document.createElement("div"),b.id="reading-guide",b.style.cssText=` 284 position: fixed; 285 left: 0; 286 right: 0; 287 height: 40px; 288 background: linear-gradient(to bottom, transparent 0%, rgba(255,255,0,0.3) 45%, rgba(255,255,0,0.3) 55%, transparent 100%); 289 pointer-events: none; 290 z-index: 9999; 291 transition: top 0.05s ease-out; 292 `,document.body.appendChild(b));const T=S=>{b&&(b.style.top=`${S.clientY-20}px`)};return document.addEventListener("mousemove",T),()=>{document.removeEventListener("mousemove",T),b==null||b.remove()}},[n.readingGuide]),h.useEffect(()=>{if(!n.focusMask){const S=document.getElementById("focus-mask");S&&S.remove();return}let b=document.getElementById("focus-mask");if(!b){b=document.createElement("div"),b.id="focus-mask",b.innerHTML=` 293 <div class="focus-mask-top"></div> 294 <div class="focus-mask-bottom"></div> 295 `,b.style.cssText=` 296 position: fixed; 297 inset: 0; 298 pointer-events: none; 299 z-index: 9998; 300 `;const S=document.createElement("style");S.id="focus-mask-style",S.textContent=` 301 #focus-mask .focus-mask-top, 302 #focus-mask .focus-mask-bottom { 303 position: fixed; 304 left: 0; 305 right: 0; 306 background: rgba(0,0,0,0.7); 307 transition: all 0.05s ease-out; 308 } 309 #focus-mask .focus-mask-top { top: 0; height: 0; } 310 #focus-mask .focus-mask-bottom { bottom: 0; height: 100%; } 311 `,document.head.appendChild(S),document.body.appendChild(b)}const T=S=>{const I=b==null?void 0:b.querySelector(".focus-mask-top"),K=b==null?void 0:b.querySelector(".focus-mask-bottom");I instanceof HTMLElement&&K instanceof HTMLElement&&(I.style.height=`${Math.max(0,S.clientY-150/2)}px`,K.style.top=`${S.clientY+150/2}px`,K.style.height=`${window.innerHeight-S.clientY-150/2}px`)};return document.addEventListener("mousemove",T),()=>{document.removeEventListener("mousemove",T),b==null||b.remove();const S=document.getElementById("focus-mask-style");S&&S.remove()}},[n.focusMask]),h.useEffect(()=>{const b=document.getElementById("a11y-skip-link");b&&b.remove()},[]),h.useEffect(()=>{m.current={path:`${window.location.pathname}${window.location.search}${window.location.hash}`,title:document.title||""};const b=window.setInterval(()=>{const T={path:`${window.location.pathname}${window.location.search}${window.location.hash}`,title:document.title||""};
311if((T.path!==m.current.path||T.title!==m.current.title)&&(m.current=T,n.pageAnnouncements)){const I=(T.title||"").trim()||T.path;E(w("messages.pageOpened","Otvorena stranica: {title}",{title:I}))}},500);return()=>window.clearInterval(b)},[E,n.pageAnnouncements,w]),h.useEffect(()=>()=>{p.current&&window.clearTimeout(p.current),ie()},[ie]),h.useEffect(()=>(t?document.body.setAttribute("data-a11y-panel-open","true"):(document.body.removeAttribute("data-a11y-panel-open"),ie(),f(null)),()=>{document.body.removeAttribute("data-a11y-panel-open")}),[ie,t]),h.useEffect(()=>{if(!n.keyboardShortcuts)return;const b=S=>{if(!S||!(S instanceof HTMLElement))return!1;const I=S.tagName;return S.isContentEditable||I==="INPUT"||I==="TEXTAREA"||I==="SELECT"},T=S=>{if(!S.altKey||S.ctrlKey||S.metaKey)return;const I=String(S.key||"").toLowerCase();if(!(b(document.activeElement)&&!["a","m","s"].includes(I))){if(I==="a"){S.preventDefault(),e(X=>{const G=!X;return E(G?"Otvoren alat za pristupaÄnost":"Zatvoren alat za pristupaÄnost"),G});return}if(I==="m"){const X=document.querySelector('button[aria-controls="menu"]');X instanceof HTMLElement&&(S.preventDefault(),X.click(),E(w("messages.navigationOpened","Otvorena navigacija")));return}if(I==="s"){const X=document.querySelector('input[aria-label*="Pretra"]')||document.querySelector('input[placeholder*="Pretra"]');X instanceof HTMLElement&&(S.preventDefault(),X.focus(),E(w("messages.searchFocused","Fokus na pretragu")));return}}};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[E,n.keyboardShortcuts,w]),h.useEffect(()=>{if(!n.keyboardNavigation){U();return}const b={h:{selector:"h1, h2, h3, h4, h5, h6",label:w("controls.keyboardNavigationTypes.heading","headings")},f:{selector:"input:not([type='hidden']):not([disabled]), textarea:not([disabled]), select:not([disabled]), [contenteditable='true'], [role='textbox']",label:w("controls.keyboardNavigationTypes.form","forms")},b:{selector:"button:not([disabled]), [role='button'], a[role='button'], input[type='button']:not([disabled]), input[type='submit']:not([disabled]), input[type='reset']:not([disabled]), summary, [aria-controls], [aria-expanded], [data-a11y-toggle-button='true']",label:w("controls.keyboardNavigationTypes.button","buttons")},l:{selector:"a[href], area[href], [role='link']",label:w("controls.keyboardNavigationTypes.link","links")},g:{selector:"img, svg, [role='img']",label:w("controls.keyboardNavigationTypes.graphic","graphics")}},T=I=>{const K=document.querySelector(".a11y-preview-scope")||document.body;return Array.from(K.querySelectorAll(I)).filter(X=>!(X instanceof HTMLElement)||X.getAttribute("aria-hidden")==="true"||(X instanceof HTMLInputElement||X instanceof HTMLButtonElement||X instanceof HTMLSelectElement||X instanceof HTMLTextAreaElement)&&X.disabled?!1:Se(X)&&!ge(X))},S=I=>{if(I.altKey||I.ctrlKey||I.metaKey)return;const K=String(I.key||"").toLowerCase(),X=b[K];if(!X||me(document.activeElement)||ge(document.activeElement))return;const G=T(X.selector);if(!G.length){E(w("messages.keyboardNavigationEmpty","No available elements for {label}",{label:X.label}));return}I.preventDefault();const re=N.current instanceof HTMLElement?N.current:document.activeElement,pe=G.findIndex(Fe=>Fe===re||re instanceof Node&&Fe.contains(re)),ue=G[(pe+1+G.length)%G.length],Ve=z(ue,120)||ue.tagName.toLowerCase();$(ue),E(w("messages.keyboardNavigationJump","Jumped to {label}: {text}",{label:X.label,text:Ve}))};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S),U()}},[E,U,$,z,ge,me,Se,n.keyboardNavigation,w]),h.useEffect(()=>{const b=()=>{document.querySelectorAll(".a11y-form-error-summary").forEach(pe=>pe.remove())};if(!n.formErrorSummary){b();return}const T=pe=>{if(!(pe instanceof HTMLElement))return!1;const ue=pe.getBoundingClientRect(),Ve=window.getComputedStyle(pe);return Ve.display!=="none"&&Ve.visibility!=="hidden"&&ue.width>0&&ue.height>0},S=pe=>{var qe,jn;if(!(pe instanceof HTMLElement))return"Polje";const ue=pe.getAttribute("aria-label");if(ue)return ue.trim();const Ve=pe.getAttribute("id");if(Ve){const wn=document.querySelector(`label[for="${Ve}"]`),Sn=(qe=wn==null?void 0:wn.textContent)==null?void 0:qe.trim();if(Sn)return Sn.replace(/[:*]\s*$/,"")}const Fe=pe.closest("label"),et=(jn=Fe==null?void 0:Fe.textContent)==null?void 0:jn.trim();return et?et.replace(/[:*]\s*$/,""):pe.getAttribute("name")||pe.getAttribute("placeholder")||"Polje"},I=pe=>pe instanceof HTMLInputElement||pe instanceof HTMLSelectElement||pe instanceof HTMLTextAreaElement;let K=null;const X=()=>{b(),Array.from(document.querySelectorAll("form")).filter(T).forEach(ue=>{if(!(ue instanceof HTMLElement))return;const Ve=Array.from(ue.querySelectorAll("input, select, textarea")).filter(Ye=>{if(!I(Ye)||!T(Ye)||Ye.hasAttribute("disabled"))return!1;const Ht=Ye.getAttribute("aria-invalid")==="true",_t=!Ye.checkValidity();return Ht||_t}),Fe=Array.from(ue.querySelectorAll("[role='alert'], .text-red-500, .text-red-600, .text-red-700")).filter(T).map(Ye=>{var Ht;return(Ht=Ye.textContent)==null?void 0:Ht.trim()}).filter(Ye=>!!Ye),et=[],qe=new Set;if(Ve.forEach(Ye=>{const Ht=S(Ye),_t=Ye.validationMessage.trim(),it=_t?`${Ht}: ${_t}`:`${Ht}: provjerite unos`;qe.has(it)||(qe.add(it),et.push({type:"field",text:it,field:Ye}))}),Fe.forEach(Ye=>{qe.has(Ye)||(qe.add(Ye),et.push({type:"text",text:Ye}))}),!et.length)return;const jn=document.createElement("div");jn.className="a11y-form-error-summary",jn.setAttribute("role","alert");const wn=document.createElement("div");wn.className="a11y-form-error-summary-title",wn.textContent=`Sažetak greÅ¡aka (${et.length})`,jn.appendChild(wn);const Sn=document.createElement("ul");if(Sn.className="a11y-form-error-summary-list",et.slice(0,12).forEach(Ye=>{const Ht=document.createElement("li");if(Ye.type==="field"&&Ye.field instanceof HTMLElement){const _t=document.createElement("button");_t.type="button",_t.className="a11y-form-error-summary-link",_t.textContent=Ye.text,_t.addEventListener("click",()=>{const it=Ye.field.closest("details");it instanceof HTMLDetailsElement&&(it.open=!0),Ye.field.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"}),window.requestAnimationFrame(()=>{Ye.field.focus({preventScroll:!0})})}),Ht.appendChild(_t)}else Ht.textContent=Ye.text;Sn.appendChild(Ht)}),et.length>12){const Ye=document.createElement("li");Ye.textContent=`... i joÅ¡ ${et.length-12} stavki`,Sn.appendChild(Ye)}jn.appendChild(Sn),ue.prepend(jn)})},G=()=>{K&&window.clearTimeout(K),K=window.setTimeout(X,120)};G(),document.addEventListener("input",G,!0),document.addEventListener("change",G,!0),document.addEventListener("submit",G,!0);const re=new MutationObserver(G);return re.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-invalid","class","style"]}),()=>{K&&window.clearTimeout(K),re.disconnect(),document.removeEventListener("input",G,!0),document.removeEventListener("change",G,!0),document.removeEventListener("submit",G,!0),b()}},[n.formErrorSummary]);const de=b=>{const T=document.documentElement;T.style.fontSize="100%",J(b.fontSize);const S=(pe,ue)=>{ue?T.classList.add(pe):T.classList.remove(pe)};S("high-contrast",b.highContrast),S("reduce-motion",b.reduceMotion),S("dyslexic-font",b.dyslexicFont),S("link-highlight",b.linkHighlight),S("large-cursor",b.largeCursor),S("text-spacing",b.textSpacing),S("hide-images",b.hideImages),S("dark-mode",b.darkMode),S("focus-highlight",b.focusHighlight),S("larger-click-targets",b.largerClickTargets),S("interactive-highlight",b.interactiveHighlight),S("reduce-transparency",b.reduceTransparency),S("table-mode",b.tableMode),S("form-error-summary-enabled",b.formErrorSummary),S("readable-font",b.readableFont),S("font-weight",b.fontWeight),S("light-contrast",b.lightContrast),S("monochrome",b.monochrome),S("mute-sounds",b.muteSounds),S("highlight-titles",b.highlightTitles),S("highlight-all",b.highlightAll),S("text-magnifier",b.textMagnifier),S("keyboard-navigation",b.keyboardNavigation),S("vision-impaired-mode",b.visionImpairedMode),S("seizure-safe-profile-mode",b.seizureSafeProfileMode),S("adhd-friendly-mode",b.adhdFriendlyMode),S("blindness-mode",b.blindnessMode),S("epilepsy-safe-mode",b.epilepsySafeMode),Fg(b),w$(!!b.hideImages),T.style.setProperty("--saturation",`${b.saturation}%`),T.style.setProperty("--brightness",`${b.brightness}%`),T.style.setProperty("--line-height",`${b.lineHeight}%`),T.style.setProperty("--a11y-text-align",String(k1(b.textAlign)));const I=ke(b),K=S$(b),X=k1(b.textAlign),G=b.textAlign==="default"?"":` 312 html .a11y-preview-scope :where(h1, h2, h3, h4, h5, h6, p, li, td, th, blockquote, figcaption, dt, dd, div, span) { 313 text-align: ${X} !important; 314 } 315 `;let re=document.getElementById("accessibility-dynamic-styles");re||(re=document.createElement("style"),re.id="accessibility-dynamic-styles",document.head.appendChild(re)),re.textContent=` 316 /* Vizualni filteri */ 317 html .a11y-preview-scope { 318 filter: ${K} !important; 319 } 320 ${G} 321 html .a11y-preview-scope :where(p, li, td, th, blockquote, figcaption, dt, dd) { 322 line-height: var(--line-height) !important; 323 } 324 325 /* Tamni naÄin */ 326 html.dark-mode { background: #121212 !important; } 327 html.dark-mode .a11y-preview-scope { background: #121212 !important; color: #ffffff !important; } 328 html.dark-mode .a11y-preview-scope, html.dark-mode .a11y-preview-scope * { border-color: #444 !important; } 329 html.dark-mode .a11y-preview-scope h1, html.dark-mode .a11y-preview-scope h2, html.dark-mode .a11y-preview-scope h3, html.dark-mode .a11y-preview-scope h4, html.dark-mode .a11y-preview-scope h5, html.dark-mode .a11y-preview-scope h6 { color: #ffffff !important; } 330 html.dark-mode .a11y-preview-scope p, html.dark-mode .a11y-preview-scope span, html.dark-mode .a11y-preview-scope li, html.dark-mode .a11y-preview-scope td, html.dark-mode .a11y-preview-scope th, html.dark-mode .a11y-preview-scope label { color: #e
3300e0e0 !important; } 331 html.dark-mode .a11y-preview-scope div { background-color: transparent; color: #e0e0e0 !important; } 332 html.dark-mode .a11y-preview-scope a { color: #90caf9 !important; } 333 html.dark-mode .a11y-preview-scope a:hover { color: #bbdefb !important; } 334 html.dark-mode .a11y-preview-scope input, html.dark-mode .a11y-preview-scope textarea, html.dark-mode .a11y-preview-scope select { background: #2a2a2a !important; color: #ffffff !important; border-color: #555 !important; } 335 html.dark-mode .a11y-preview-scope input[type="range"] { background: transparent !important; } 336 html.dark-mode .a11y-preview-scope input[type="range"]::-webkit-slider-runnable-track { background: #555 !important; height: 6px !important; border-radius: 3px !important; } 337 html.dark-mode .a11y-preview-scope input[type="range"]::-webkit-slider-thumb { background: #fff !important; border: 2px solid #fff !important; width: 18px !important; height: 18px !important; border-radius: 50% !important; -webkit-appearance: none !important; margin-top: -6px !important; } 338 html.dark-mode .a11y-preview-scope input[type="range"]::-moz-range-track { background: #555 !important; height: 6px !important; border-radius: 3px !important; } 339 html.dark-mode .a11y-preview-scope input[type="range"]::-moz-range-thumb { background: #fff !important; border: 2px solid #fff !important; width: 18px !important; height: 18px !important; border-radius: 50% !important; } 340 html.dark-mode .a11y-preview-scope input::placeholder, html.dark-mode .a11y-preview-scope textarea::placeholder { color: #888 !important; } 341 html.dark-mode .a11y-preview-scope button { background: #333 !important; color: #ffffff !important; } 342 html.dark-mode .a11y-preview-scope .bg-white, html.dark-mode .a11y-preview-scope [class*="bg-white"] { background: #2a2a2a !important; } 343 html.dark-mode .a11y-preview-scope .bg-gray-50, html.dark-mode .a11y-preview-scope .bg-gray-100, html.dark-mode .a11y-preview-scope .bg-gray-200 { background: #252525 !important; } 344 html.dark-mode .a11y-preview-scope .bg-blue-50, html.dark-mode .a11y-preview-scope .bg-blue-100 { background: #1a237e !important; } 345 html.dark-mode .a11y-preview-scope .bg-slate-50, html.dark-mode .a11y-preview-scope .bg-slate-100, html.dark-mode .a11y-preview-scope .bg-slate-200, html.dark-mode .a11y-preview-scope .bg-slate-300, html.dark-mode .a11y-preview-scope .bg-slate-800, html.dark-mode .a11y-preview-scope .bg-slate-900 { background: #1a1a1a !important; } 346 html.dark-mode .a11y-preview-scope [class*="bg-gradient"] { background: #1e1e1e !important; } 347 html.dark-mode .a11y-preview-scope .text-gray-400, html.dark-mode .a11y-preview-scope .text-gray-500, html.dark-mode .a11y-preview-scope .text-gray-600, html.dark-mode .a11y-preview-scope .text-gray-700, html.dark-mode .a11y-preview-scope .text-gray-800, html.dark-mode .a11y-preview-scope .text-gray-900 { color: #e0e0e0 !important; } 348 html.dark-mode .a11y-preview-scope .text-blue-600, html.dark-mode .a11y-preview-scope .text-blue-700 { color: #90caf9 !important; } 349 html.dark-mode .a11y-preview-scope .shadow-md, html.dark-mode .a11y-preview-scope .shadow-lg, html.dark-mode .a11y-preview-scope .shadow-xl, html.dark-mode .a11y-preview-scope [class*="shadow"] { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important; } 350 html.dark-mode .a11y-preview-scope header, html.dark-mode .a11y-preview-scope nav, html.dark-mode .a11y-preview-scope footer, html.dark-mode .a11y-preview-scope section, html.dark-mode .a11y-preview-scope article, html.dark-mode .a11y-preview-scope aside, html.dark-mode .a11y-preview-scope main { background: #1e1e1e !important; color: #e0e0e0 !important; } 351 html.dark-mode .a11y-preview-scope [class*="from-"], html.dark-mode .a11y-preview-scope [class*="to-"] { --tw-gradient-from: #1e1e1e !important; --tw-gradient-to: #121212 !important; } 352 html.dark-mode .a11y-preview-scope .border-gray-200, html.dark-mode .a11y-preview-scope .border-gray-300, html.dark-mode .a11y-preview-scope .border-l-4 { border-color: #555 !important; } 353 html.dark-mode .a11y-preview-scope kbd { background: #333 !important; color: #fff !important; border-color: #555 !important; } 354 html.dark-mode .a11y-preview-scope [class*="rounded"] { background-color: #2a2a2a !important; } 355 html.dark-mode .a11y-preview-scope [class*="rounded"] [class*="rounded"] { background-color: transparent !important; } 356 html.dark-mode .a11y-preview-scope [class*="card"], html.dark-mode .a11y-preview-scope [class*="Card"] { background: #2a2a2a !important; } 357 html.dark-mode .a11y-preview-scope [style*="background: white"], html.dark-mode .a11y-preview-scope [style*="background-color: white"], html.dark-mode .a11y-preview-scope [style*="background:#fff"], html.dark-mode .a11y-preview-scope [style*="background: #fff"], html.dark-mode .a11y-preview-scope [style*="background-color:#fff"], html.dark-mode .a11y-preview-scope [style*="background-color: #fff"], html.dark-mode .a11y-preview-scope [style*="background: rgb(255"], html.dark-mode .a11y-preview-scope [style*="background-color: rgb(255"] { background: #2a2a2a !important; } 358 359 html .accessibility-toolbar-modal, 360 html .accessibility-toolbar-modal *,
361 html [data-a11y-toolbar-trigger="true"] { 362 filter: none !important; 363 letter-spacing: normal !important; 364 word-spacing: normal !important; 365 text-transform: none !important; 366 } 367 /* Accessibility Toolbar - uvijek svijetao bez obzira na dark mode */ 368 html.dark-mode .accessibility-toolbar-modal { background: #ffffff !important; } 369 html.dark-mode .accessibility-toolbar-modal p, 370 html.dark-mode .accessibility-toolbar-modal span, 371 html.dark-mode .accessibility-toolbar-modal h1, 372 html.dark-mode .accessibility-toolbar-modal h2, 373 html.dark-mode .accessibility-toolbar-modal h3, 374 html.dark-mode .accessibility-toolbar-modal label { color: inherit !important; } 375 html.dark-mode .accessibility-toolbar-modal .bg-gray-50 { background: #f9fafb !important; } 376 html.dark-mode .accessibility-toolbar-modal .bg-gray-100 { background: #f3f4f6 !important; } 377 html.dark-mode .accessibility-toolbar-modal .bg-gray-200 { background: #e5e7eb !important; } 378 html.dark-mode .accessibility-toolbar-modal .bg-gray-300 { background: #d1d5db !important; } 379 html.dark-mode .accessibility-toolbar-modal .bg-white { background: #ffffff !important; } 380 html.dark-mode .accessibility-toolbar-modal .text-gray-400 { color: #9ca3af !important; } 381 html.dark-mode .accessibility-toolbar-modal .text-gray-500 { color: #6b7280 !important; } 382 html.dark-mode .accessibility-toolbar-modal .text-gray-600 { color: #4b5563 !important; } 383 html.dark-mode .accessibility-toolbar-modal .text-gray-700 { color: #374151 !important; } 384 html.dark-mode .accessibility-toolbar-modal .text-gray-800 { color: #1f2937 !important; } 385 html.dark-mode .accessibility-toolbar-modal .text-gray-900 { color: #111827 !important; } 386 html.dark-mode .accessibility-toolbar-modal .border-gray-200 { border-color: #e5e7eb !important; } 387 html.dark-mode .accessibility-toolbar-modal .border-gray-300 { border-color: #d1d5db !important; } 388 html.dark-mode .accessibility-toolbar-modal .border-transparent { border-color: transparent !important; } 389 html.dark-mode .accessibility-toolbar-modal .border-2 { border-width: 2px !important; } 390 html.dark-mode .accessibility-toolbar-modal .bg-blue-50 { background: #eff6ff !important; } 391 html.dark-mode .accessibility-toolbar-modal .border-blue-200 { border-color: #bfdbfe !important; } 392 html.dark-mode .accessibility-toolbar-modal .text-blue-600 { color: #2563eb !important; } 393 html.dark-mode .accessibility-toolbar-modal .bg-gray-900 { background: #111827 !important; } 394 html.dark-mode .accessibility-toolbar-modal .border-gray-900 { border-color: #111827 !important; } 395 html.dark-mode .accessibility-toolbar-modal input[type="range"] { background: transparent !important; } 396 html.dark-mode .accessibility-toolbar-modal input[type="range"]::-webkit-slider-runnable-track { background: #e5e7eb !important; } 397 html.dark-mode .accessibility-toolbar-modal input[type="range"]::-webkit-slider-thumb { background: #111827 !important; border: 2px solid #111827 !important; } 398 html.dark-mode .accessibility-toolbar-modal input[type="range"]::-moz-range-track { background: #e5e7eb !important; } 399 html.dark-mode .accessibility-toolbar-modal input[type="range"]::-moz-range-thumb { background: #111827 !important; border: 2px solid #111827 !important; } 400 401 /* Kontrastni modovi */ 402 html.high-contrast .a11y-preview-scope { 403 background: #fff !important; 404 color: #111827 !important; 405 } 406 html.high-contrast .a11y-preview-scope img { filter: contrast(1.2) !important; } 407 html.light-contrast .a11y-preview-scope { 408 background: #fcfcfd !important; 409 color: #0f172a !important; 410 } 411 html.light-contrast .a11y-preview-scope :where(section, article, aside, main, .card, [class*="card"], [class*="surface"], [class*="panel"]) { 412 background-color: #ffffff !important; 413 border-color: rgba(15, 23, 42, 0.12) !important; 414 box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important; 415 } 416 html.light-contrast .a11y-preview-scope :where(a) { color: #0f4c81 !important; } 417 html.light-contrast .a11y-preview-scope :where(button, input, textarea, select) { 418 background-color: #ffffff !important; 419 color: #0f172a !important; 420 border-color: rgba(15, 23, 42, 0.2) !important; 421 } 422 423 html.readable-font:not(.dyslexic-font) .a11y-preview-scope, 424 html.readable-font:not(.dyslexic-font) .a11y-preview-scope :where(h1, h2, h3, h4, h5, h6, p, li, a, span, label, td, th, blockquote, figcaption, dt, dd, small) { 425 font-family: Arial, Helvetica, sans-serif !important; 426 letter-spacing: 0.01em !important; 427 } 428 html.font-weight .a11y-preview-scope :where(h1, h2, h3, h4, h5, h6) { font-weight: 700 !important; } 429 html.font-weight .a11y-preview-scope :where(p, li, a, span, label, td, th, blockquote, figcaption, dt, dd, small) { font-weight: 600 !important; } 430 html.highlight-titles .a11y-preview-scope :where(h1, h2, h3, h4, h5, h6) { 431 color: ${I.focusColor} !important; 432 text-decoration: underline !important; 433 text-decoration-color: ${I.linkUnderline} !important; 434 text-decoration-thickness: 3px !important; 435 text-underline-offset: 5px !important; 436 } 437 html.highlight-all .a11y-preview-scope :where(section, article, aside, main, blockquote, table, form, .card, [class*="card"], [class*="surface"], [class*="panel"], [class*="section"]) { 438 box-shadow: inset 0 0 0 1px ${I.interactiveBorder} !important; 439 background-image: linear-gradient(${I.interactiveBg}, ${I.interactiveBg}) !important; 440 background-clip: padding-box !important; 441 border-radius: inherit; 442 } 443 444 /* Font za disleksiju - OpenDyslexic */ 445 @font-face { 446 font-family: 'OpenDyslexic'; 447 src: url('https://cdn.jsdelivr.net/npm/[email protected]/woff/OpenDyslexic-Regular.woff') format('woff'); 448 font-weight: normal; 449 font-style: normal; 450 } 451 @font-face { 452 font-family: 'OpenDyslexic'; 453 src: url('https://cdn.jsdelivr.net/npm/[email protected]/woff/OpenDyslexic-Bold.woff') format('woff'); 454 font-weight: bold; 455 font-style: normal; 456 } 457 html.dyslexic-font .a11y-preview-scope, html.dyslexic-font .a11y-preview-scope * { font-family: 'OpenDyslexic', Arial, sans-serif !important; } 458 html.dyslexic-font .a11y-preview-scope { word-spacing: 0.2em; letter-spacing: 0.05em; } 459 460 /* Smanji animacije */ 461 html.reduce-motion .a11y-preview-scope *, html.reduce-motion .a11y-preview-scope *::before, html.reduce-motion .a11y-preview-scope *::after { 462 animation-duration: 0.001ms !important; 463 animation-iteration-count: 1 !important; 464 transition-duration: 0.001ms !important; 465 scroll-behavior: auto !important; 466 } 467 468 /* Isticanje linkova */ 469 html.link-highlight .a11y-preview-scope a { 470 background: linear-gradient(to bottom, transparent 62%, ${I.linkTint} 62%) !important; 471 text-decoration: underline !important; 472 text-decoration-color: ${I.linkUnderline} !important; 473 text-decoration-thickness: 2px !important; 474 text-underline-offset: 4px !important; 475 border-radius: 3px !important; 476 color: ${I.linkColor} !important; 477 } 478 html.link-highlight .a11y-preview-scope a:hover, 479 html.link-highlight .a11y-preview-scope a:focus-visible { 480 background: ${I.linkHoverBg} !important; 481 box-shadow: inset 0 -0.45em 0 ${I.linkHoverInset} !important; 482 color: ${I.linkColor} !important; 483 } 484
485 /* Veliki kursor */ 486 html.large-cursor .a11y-preview-scope, html.large-cursor .a11y-preview-scope * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1' d='M5 3l14 9-7 2-3 7z'/%3E%3C/svg%3E") 0 0, auto !important; } 487 html.large-cursor .a11y-preview-scope a, html.large-cursor .a11y-preview-scope button, html.large-cursor .a11y-preview-scope [role="button"], html.large-cursor .a11y-preview-scope input[type="submit"], html.large-cursor .a11y-preview-scope input[type="button"] { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1' d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z'/%3E%3Ccircle cx='12' cy='12' r='4' fill='%23ff6b00'/%3E%3C/svg%3E") 12 12, pointer !important; } 488 489 /* Razmak teksta */ 490 html.text-spacing .a11y-preview-scope * { letter-spacing: 0.12em !important; word-spacing: 0.16em !important; } 491 492 /* Sakrij slike */ 493 html.hide-images .a11y-preview-scope img, 494 html.hide-images .a11y-preview-scope svg, 495 html.hide-images .a11y-preview-scope [data-a11y-hidden-image='true'] { 496 visibility: hidden !important; 497 } 498 html.hide-images .a11y-preview-scope [data-a11y-hidden-image='true'] { 499 background-image: none !important; 500 } 501 502 .a11y-speech-highlight { 503 outline: 4px solid ${I.focusColor} !important; 504 outline-offset: 3px !important; 505 box-shadow: inset 0 0 0 2px ${I.focusInset}, 0 0 0 8px ${I.focusGlow} !important; 506 border-radius: 0.5rem; 507 } 508 .a11y-keyboard-navigation-target { 509 outline: 4px solid ${I.focusColor} !important; 510 outline-offset: 4px !important; 511 box-shadow: inset 0 0 0 2px ${I.focusInsetStrong}, 0 0 0 8px ${I.focusGlow} !important; 512 border-radius: 0.5rem; 513 } 514 html.text-magnifier .a11y-preview-scope [data-a11y-magnified='true'] { 515 box-shadow: inset 0 0 0 1px ${I.interactiveBorder} !important; 516 background-image: linear-gradient(${I.interactiveBg}, ${I.interactiveBg}) !important; 517 background-clip: padding-box !important; 518 border-radius: 0.5rem; 519 } 520 521 /* Isticanje fokusa */ 522 html.focus-highlight .a11y-preview-scope :where( 523 a, 524 button, 525 input, 526 textarea, 527 select, 528 summary, 529 [role="button"], 530 [role="link"], 531 [tabindex]:not([tabindex="-1"]) 532 ):hover { 533 outline: 3px solid ${I.focusColor} !important; 534 outline-offset: 2px !important; 535 box-shadow: inset 0 0 0 2px ${I.focusInset}, 0 0 0 6px ${I.focusHoverGlow} !important; 536 } 537 html.focus-highlight .a11y-preview-scope :where( 538 .surface-lifted, 539 .glass, 540 .card, 541 [class*="card"], 542 [class*="panel"], 543 article, 544 section 545 ):hover { 546 outline: 3px solid ${I.focusColor} !important; 547 outline-offset: 2px !important; 548 box-shadow: inset 0 0 0 2px ${I.focusInset}, 0 0 0 6px ${I.focusHoverGlow} !important; 549 } 550 551 html.focus-highlight .a11y-preview-scope :where( 552 a, 553 button, 554 input, 555 textarea, 556 select, 557 summary, 558 [role="button"], 559 [role="link"], 560 [tabindex]:not([tabindex="-1"]) 561 ):focus, 562 html.focus-highlight .a11y-preview-scope :where( 563 a, 564 button, 565 input, 566 textarea, 567 select, 568 summary, 569 [role="button"], 570 [role="link"], 571 [tabindex]:not([tabindex="-1"]) 572 ):focus-visible { 573 outline: 4px solid ${I.focusColor} !important; 574 outline-offset: 3px !important; 575 box-shadow: inset 0 0 0 2px ${I.focusInsetStrong}, 0 0 0 2px rgba(255, 255, 255, 0.35), 0 0 0 8px ${I.focusGlow} !important; 576 } 577 578 /* VeÄi klikabilni elementi */ 579 html.larger-click-targets .a11y-preview-scope :where(button, [role="button"], [role="link"], a, summary, input[type="button"], input[type="submit"]) { 580 min-height: 44px !important; 581 min-width: 44px !important; 582 } 583 html.larger-click-targets .a11y-preview-scope :where(input[type="checkbox"], input[type="radio"]) { 584 transform: scale(1.18) !important; 585 margin: 0.18rem !important; 586 } 587 html.larger-click-targets .a11y-preview-scope :where(label, .cursor-pointer) { 588 min-height: 44px !important; 589 } 590 591 /* Isticanje interaktivnih elemenata */ 592 html.interactive-highlight .a11y-preview-scope :where(a, button, input, select, textarea, summary, [role="button"], [role="link"]) { 593 box-shadow: inset 0 0 0 1px ${I.interactiveBorder} !important; 594 background-image: linear-gradient(${I.interactiveBg}, ${I.interactiveBg}) !important; 595 background-clip: padding-box !important; 596 outline: 2px solid ${I.interactiveBorder} !important; 597 outline-offset: 1px !important; 598 } 599 html.interactive-highlight .a11y-preview-scope :where(a, button, input, select, textarea, summary, [role="button"], [role="link"]):hover { 600 box-shadow: inset 0 0 0 2px ${I.interactiveBorder}, 0 0 0 2px ${I.focusHoverGlow} !important; 601 outline-color: ${I.focusColor} !important; 602 } 603 604 /* Smanji transparenciju / blur */ 605 html.reduce-transparency .a11y-preview-scope [class*="backdrop-blur"], 606 html.reduce-transparency .a11y-preview-scope .backdrop-blur, 607 html.reduce-transparency .a11y-preview-scope .backdrop-blur-sm, 608 html.reduce-transparency .a11y-preview-scope .backdrop-blur-md, 609 html.reduce-transparency .a11y-preview-scope .backdrop-blur-lg { 610 backdrop-filter: none !important; 611 -webkit-backdrop-filter: none !important; 612 } 613 html.reduce-transparency .a11y-preview-scope [class*="bg-white/"] { background-color: rgba(255,255,255,0.98) !important; } 614 html.reduce-transparency .a11y-preview-scope [class*="bg-black/"] { background-color: rgba(0,0,0,0.86) !important; } 615 html.reduce-transparency .a11y-preview-scope [class*="bg-slate-"][class*="/"] { opacity: 1 !important; } 616 617 /* A11y naÄin za tablice */ 618 html.table-mode .a11y-preview-scope table { border-collapse: separate !important; border-spacing: 0 !important; } 619 html.table-mode .a11y-preview-scope thead th { position: sticky !important; top: 0 !important; z-index: 3 !important; } 620 html.table-mode .a11y-preview-scope tbody tr:nth-child(even) td { background-color: rgba(148, 163,
620184, 0.06) !important; } 621 html.table-mode tbody tr:hover td { background-color: rgba(59, 130, 246, 0.12) !important; } 622 html.table-mode td, html.table-mode th { border-bottom: 1px solid rgba(148, 163, 184, 0.35) !important; } 623 html.table-mode [class*="overflow-x-auto"] { scrollbar-gutter: stable both-edges; } 624 625 /* Sažetak greÅ¡aka u formi */ 626 .a11y-form-error-summary { 627 margin: 0 0 1rem 0; 628 padding: 0.9rem 1rem; 629 border: 2px solid ${I.interactiveBorder}; 630 background: ${I.interactiveBg}; 631 border-radius: 0.75rem; 632 } 633 .a11y-form-error-summary-title { 634 font-weight: 700; 635 margin-bottom: 0.4rem; 636 color: inherit; 637 } 638 .a11y-form-error-summary-list { 639 margin: 0; 640 padding-left: 1rem; 641 } 642 .a11y-form-error-summary-link { 643 background: transparent; 644 border: none; 645 padding: 0; 646 color: ${I.linkColor}; 647 text-decoration: underline; 648 cursor: pointer; 649 text-align: left; 650 } 651 `};g.current=de;const De=(b,T)=>{D({[b]:T})},Oe=()=>{"speechSynthesis"in window&&(window.speechSynthesis.cancel(),Q(),a(!1))},He=()=>{r(mr),de(mr),j$(),u("visual"),f(null),Oe();const b=document.getElementById("reading-guide");b&&b.remove();const T=document.getElementById("focus-mask");T&&T.remove();const S=document.getElementById("focus-mask-style");S&&S.remove(),document.querySelectorAll(".a11y-form-error-summary").forEach(I=>I.remove()),Fg(mr),Dx(),ce(w("messages.settingsRestored","Sve postavke su vraÄene na zadane vrijednosti"))},ot=()=>{const b=document.querySelector(".a11y-preview-scope")||document.body,T=b instanceof HTMLElement?b.innerText:document.body.innerText;_(T,{sourceElement:b instanceof HTMLElement?b:null,interrupt:!0})},Ge=()=>{var T,S,I,K,X;const b=((X=(I=(S=(T=window.getSelection)==null?void 0:T.call(window))==null?void 0:S.toString)==null?void 0:(K=I.call(S)).trim)==null?void 0:X.call(K))||"";if(!b){ce(w("messages.noSelectedText","Nije oznaÄen tekst za Äitanje"));return}_(b.slice(0,4e3),{interrupt:!0}),E(w("messages.readingSelectedText","Äitanje oznaÄenog teksta"))},Te=b=>{if(!(b!=null&&b.patch))return;const T=If(n,b.patch),S=L(b)||te(b)||b.label;r(T),de(T),y1(T),ce(w("messages.presetApplied","Primijenjen preset: {label}",{label:S}))},Ke=({settingKey:b,icon:T,label:S,description:I,onMessage:K,offMessage:X})=>{const G=!!n[b];return c.jsxs("button",{type:"button","aria-pressed":G,"aria-describedby":"a11y-demo-hint","data-a11y-toggle-button":"true",onMouseEnter:re=>{oe({x:re.clientX,y:re.clientY},!1),Ee({label:S,description:I,icon:T,kind:"toggle",settingKey:b})},onMouseMove:re=>Me(re,{label:S,description:I,icon:T,kind:"toggle",settingKey:b}),onMouseLeave:()=>le(),onFocus:re=>Ee({label:S,description:I,icon:T,kind:"toggle",settingKey:b},120,be(re.currentTarget)),onBlur:()=>le(0),onClick:()=>{const re=!G,pe=!!If(n,{[b]:re})[b],ue=`${S} ${w("states.enabled","ukljuÄen")}`,Ve=`${S} ${w("states.disabled","iskljuÄen")}`;De(b,re),_(pe?K||ue:X||Ve)},className:`w-full flex items-center justify-between rounded-xl p-3.5 transition-all ${G?"bg-gray-100 border-2 border-gray-900":"bg-gray-50 border-2 border-transparent hover:bg-gray-100"}`,children:[c.jsxs("div",{className:"flex items-center gap-3 text-left",children:[c.jsx("div",{"data-a11y-toggle-icon":"true",className:`h-9 w-9 rounded-lg flex items-center justify-center ${G?"bg-gray-900 text-white":"bg-white text-gray-600"}`,children:c.jsx("i",{className:`fa-solid ${T}`})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[15px] font-semibold text-gray-800",children:S}),c.jsx("div",{className:"text-[13px] leading-5 text-gray-600",children:I})]})]}),c.jsx("div",{"data-a11y-toggle-track":"true",className:`w-12 h-6 rounded-full transition-colors relative ${G?"bg-gray-900":"bg-gray-300"}`,children:c.jsx("div",{"data-a11y-toggle-thumb":"true",className:`absolute top-0.5 w-5 h-5 bg-white rounded-full transition-transform ${G?"translate-x-6":"translate-x-0.5"}`})})]})},Ne=({label:b,icon:T,value:S,min:I,max:K,step:X,unit:G,settingKey:re})=>c.jsxs("div",{className:"rounded-xl bg-gray-50 p-3.5 hover:bg-gray-100 transition-colors",onMouseEnter:pe=>{oe({x:pe.clientX,y:pe.clientY},!1),Ee({label:b,description:`PodeÅ¡avanje: ${b}`,icon:T,kind:"slider",settingKey:re})},onMouseMove:pe=>Me(pe,{label:b,description:`PodeÅ¡avanje: ${b}`,icon:T,kind:"slider",settingKey:re}),onMouseLeave:()=>le(),onFocus:pe=>Ee({label:b,description:`PodeÅ¡avanje: ${b}`,icon:T,kind:"slider",settingKey:re},120,be(pe.currentTarget)),onBlur:()=>
651le(0),tabIndex:-1,children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("i",{className:`fa-solid ${T} text-gray-900`}),c.jsx("span",{className:"text-[15px] font-semibold text-gray-800",children:b})]}),c.jsxs("span",{className:"text-[13px] font-medium text-gray-900",children:[S,G]})]}),c.jsx("input",{type:"range",min:I,max:K,step:X,value:S,onChange:pe=>{const ue=parseInt(pe.target.value,10);De(re,ue)},className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-gray-900"}),c.jsxs("div",{className:"mt-1 flex justify-between text-[11px] text-gray-500",children:[c.jsxs("span",{children:[I,G]}),c.jsxs("span",{children:[K,G]})]})]}),_e=({label:b,description:T,icon:S,value:I,settingKey:K,options:X})=>c.jsxs("div",{className:"rounded-xl bg-gray-50 p-3.5 hover:bg-gray-100 transition-colors",onMouseEnter:G=>{oe({x:G.clientX,y:G.clientY},!1),Ee({label:b,description:T,icon:S,kind:"select",settingKey:K})},onMouseMove:G=>Me(G,{label:b,description:T,icon:S,kind:"select",settingKey:K}),onMouseLeave:()=>le(),onFocus:G=>Ee({label:b,description:T,icon:S,kind:"select",settingKey:K},120,be(G.currentTarget)),onBlur:()=>le(0),tabIndex:-1,children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx("i",{className:`fa-solid ${S} text-gray-900`}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[15px] font-semibold text-gray-800",children:b}),c.jsx("div",{className:"text-[13px] leading-5 text-gray-600",children:T})]})]}),c.jsx("div",{className:"grid grid-cols-2 gap-2",children:X.map(G=>{const re=I===G.value;return c.jsx("button",{type:"button","aria-pressed":re,className:`rounded-lg border px-3 py-2 text-[13px] font-medium transition-colors ${re?"border-gray-900 bg-gray-900 text-white":"border-gray-300 bg-white text-gray-700 hover:bg-gray-100"}`,onClick:()=>{De(K,G.value),ce(`${b}: ${G.label}`)},children:G.label},G.value)})})]}),We=[{id:"profiles",label:w("tabs.profiles","Profili"),icon:"fa-layer-group"},{id:"visual",label:w("tabs.visual","Vizualno"),icon:"fa-eye"},{id:"reading",label:w("tabs.reading","Äitanje"),icon:"fa-book-open"},{id:"navigation",label:w("tabs.navigation","Navigacija"),icon:"fa-compass"}],tt=[{value:"default",label:w("controls.textAlignOptions.default","Zadano")},{value:"left",label:w("controls.textAlignOptions.left","Lijevo")},{value:"center",label:w("controls.textAlignOptions.center","Centrirano")},{value:"right",label:w("controls.textAlignOptions.right","Desno")}],at=ke(n),Ut=()=>{var K,X;if(!d)return null;const b=d.settingKey,T={color:at.linkColor,textDecoration:"underline",textDecorationColor:at.linkUnderline,textDecorationThickness:"2px",textUnderlineOffset:"4px",background:`linear-gradient(to bottom, transparent 62%, ${at.linkTint} 62%)`,borderRadius:"3px",padding:"0 2px"},S={outline:`3px solid ${at.focusColor}`,outlineOffset:"2px",boxShadow:`inset 0 0 0 2px ${at.focusInset}, 0 0 0 5px ${at.focusHoverGlow}`},I={boxShadow:`inset 0 0 0 1px ${at.interactiveBorder}`,backgroundImage:`linear-gradient(${at.interactiveBg}, ${at.interactiveBg})`,backgroundClip:"padding-box"};if(b==="highlightColor")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsxs("div",{className:"text-[11px] text-slate-600",children:["Boja highlighta: ",at.label]}),c.jsxs("div",{className:"rounded-md border border-slate-200 p-2 bg-slate-50 space-y-2",children:[c.jsx("a",{href:"#demo-highlight-color",onClick:G=>G.preventDefault(),style:T,className:"text-xs",children:"Primjer istaknutog linka"}),c.jsx("button",{type:"button",className:"w-full px-2.5 py-1.5 rounded-md bg-white text-slate-800 text-xs border border-slate-300 text-left",style:S,children:"Fokus / hover obrub u odabranoj boji"})]})]});if(b==="linkHighlight")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Kako izgleda istaknuti link"}),c.jsxs("div",{className:"rounded-md border border-slate-200 p-2 bg-slate-50 text-xs text-slate-700",children:["Tekst sa"," ",c.jsx("a",{href:"#demo-link-highlight",onClick:G=>G.preventDefault(),style:T,children:"istaknutim linkom"}),"."]}),c.jsx("button",{type:"button",className:"px-2.5 py-1.5 rounded-md bg-white text-slate-800 text-xs border border-slate-300",children:"ObiÄan gumb (usporedba)"})]});if(b==="focusHighlight")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Preview fokusa / hover obruba"}),c.jsx("button",{type:"button",className:"w-full px-2.5 py-1.5 rounded-md bg-white text-slate-800 text-xs border border-slate-300 text-left",style:S,children:"Fokusirani gumb"}),c.jsx("input",{type:"text",readOnly:!0,value:"Fokusirani input",className:"w-full px-2 py-1.5 rounded-md border border-slate-300 text-xs",style:S,"aria-label":"Fokusirani input preview"})]});if(b==="tableMode")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5",children:[c.jsx("div",{className:"text-[11px] text-slate-600 mb-2",children:"Tablica: kontrast redova + header"}),c.jsx("div",{className:"overflow-hidden rounded-md border border-slate-200",children:c.jsxs("table",{className:"w-full text-[11px] border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-100",children:[c.jsx("th",{className:"text-left px-2 py-1 border-b border-slate-300",children:"Red"}),c.jsx("th",{className:"text-left px-2 py-1 border-b border-slate-300",children:"Status"})]})}),c.jsxs("tbody",{children:[c.jsxs("tr",{style:{backgroundColor:"rgba(148, 163,
651184, 0.06)"},children:[c.jsx("td",{className:"px-2 py-1.5 border-b border-slate-200",children:"1"}),c.jsx("td",{className:"px-2 py-1.5 border-b border-slate-200",children:"Normalno"})]}),c.jsxs("tr",{style:{backgroundColor:"rgba(59, 130, 246, 0.12)"},children:[c.jsx("td",{className:"px-2 py-1.5",children:"2"}),c.jsx("td",{className:"px-2 py-1.5",children:"Hover preview"})]})]})]})})]});if(b==="interactiveHighlight"||b==="largerClickTargets"){const G=b==="largerClickTargets";return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:G?"VeÄa klikabilna povrÅ¡ina":"Istaknuti klikabilni elementi"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("button",{type:"button",className:`rounded-md bg-white text-slate-800 text-xs border border-slate-300 ${G?"px-4 py-2.5 min-h-[44px]":"px-2.5 py-1.5"}`,style:G?void 0:I,children:"Gumb"}),c.jsx("a",{href:"#demo-clickable",onClick:re=>re.preventDefault(),className:`inline-flex items-center rounded-md text-xs border border-slate-300 text-slate-700 ${G?"px-4 py-2.5 min-h-[44px]":"px-2.5 py-1.5"}`,style:G?void 0:I,children:"Link"})]})]})}if(["fontSize","textSpacing","lineHeight","dyslexicFont","readableFont","fontWeight","textAlign"].includes(b)){const G=b==="textAlign"&&n.textAlign!=="default"?n.textAlign:"left",re=b==="dyslexicFont"?"OpenDyslexic, Arial, sans-serif":b==="readableFont"?"Arial, Helvetica, sans-serif":void 0;return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5",children:[c.jsx("div",{className:"text-[11px] text-slate-600 mb-2",children:"\\u010citljivost teksta"}),c.jsxs("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-2 space-y-1.5",children:[c.jsx("div",{className:"text-[11px] font-semibold text-slate-800",style:{textAlign:G},children:"Primjer naslova za pregled \\u010ditljivosti"}),c.jsx("p",{className:"text-slate-700",style:{fontSize:b==="fontSize"?`${Math.max(12,Math.min(18,Math.round(n.fontSize/8)))}px`:"12px",lineHeight:b==="lineHeight"?n.lineHeight/100:1.55,letterSpacing:b==="textSpacing"?"0.08em":b==="readableFont"?"0.01em":void 0,wordSpacing:b==="textSpacing"?"0.12em":void 0,fontFamily:re,fontWeight:b==="fontWeight"?600:void 0,textAlign:G},children:"Ovo je preview teksta za brzu procjenu \\u010ditljivosti, razmaka i poravnanja sadr\\u017eaja."})]})]})}if(b==="saturation"||b==="brightness"||b==="monochrome"){const G=Math.max(40,Math.min(180,n.saturation||100)),re=Math.max(50,Math.min(150,n.brightness||100)),pe=[];b==="monochrome"&&pe.push("grayscale(1)"),b==="saturation"&&pe.push(`saturate(${G}%)`),b==="brightness"&&pe.push(`brightness(${re}%)`);const ue=b==="brightness"?`Svjetlina (${re}%)`:b==="monochrome"?"Monokromatski prikaz":`ZasiÄenost boja (${G}%)`;return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:ue}),c.jsxs("div",{className:"rounded-md border border-slate-200 p-2 bg-slate-50",style:{filter:pe.join(" ")||"none"},children:[c.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[c.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500"}),c.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500"}),c.jsx("span",{className:"h-3 w-3 rounded-full bg-blue-500"}),c.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-400"})]}),c.jsx("div",{className:"text-[11px] text-slate-700",children:"Primjer boja i status oznaka"})]})]})}if(b==="highContrast"||b==="darkMode"||b==="lightContrast"){const G=b==="darkMode",re=b==="lightContrast";return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:G?"Preview tamnog naÄina":re?"Preview svijetlog kontrasta":"Preview visokog kontrasta"}),c.jsxs("div",{className:"rounded-md border p-2",style:G?{background:"#111827",borderColor:"#374151",color:"#f9fafb"}:re?{background:"#ffffff",borderColor:"#cbd5e1",color:"#0f172a",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.08)"}:{background:"#000000",borderColor:"#ffffff",color:"#ffffff"},children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("div",{className:"text-[11px] font-semibold",children:"Naslov kartice"}),c.jsx("button",{type:"button",className:"rounded px-2 py-1 text-[10px]",style:G?{background:"#1d4ed8",color:"#ffffff"}:re?{background:"#e2e8f0",color:"#0f172a",fontWeight:600}:{background:"#ffff00",color:"#000000",fontWeight:700},children:"Akcija"})]}),c.jsx("a",{href:"#demo-theme-preview",onClick:pe=>pe.preventDefault(),className:"inline-block mt-1.5 text-[11px] underline",style:G?{color:"#93c5fd"}:re?{color:"#0f4c81"}:{color:"#00ffff"},children:"Primjer linka"})]})]})}if(b==="hideImages")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Sakrij slike / prikazi zamjenu"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsxs("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-2",children:[c.jsx("div",{className:"h-10 rounded bg-gradient-to-r from-sky-200 via-indigo-200 to-pink-200"}),c.jsx("div",{className:"text-[10px] text-slate-600 mt-1",children:"Slika vidljiva"})]}),c.jsxs("div",{className:"rounded-md border border-dashed border-slate-300 bg-white p-2 flex flex-col justify-center",children:[c.jsx("div",{className:"text-[10px] text-slate-700 font-medium",children:"Slika skrivena"}),c.jsx("div",{className:"text-[10px] text-slate-500",children:"[alt tekst / placeholder]"})]})]})]});if(b==="reduceMotion")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Smanjenje animacija"}),c.jsxs("div",{className:"rounded-md border border-slate-200 p-2 bg-slate-50 space-y-1.5",children:[c.jsxs("div",{className:"flex items-center justify-between text-[10px] text-slate-600",children:[c.jsx("span",{children:"Prijelazi / hover efekti"}),c.jsx("span",{className:"rounded bg-emerald-100 text-emerald-700 px-1.5 py-0.5",children:"blazi"})]}),c.jsx("div",{className:"h-1.5 rounded bg-slate-200 overflow-hidden",children:c.jsx("div",{className:"h-full w-1/3 rounded bg-slate-400"})}),c.jsx("div",{className:"text-[10px] text-slate-500",children:"Manje pomaka i treperenja u UI-ju"})]})]});if(b==="reduceTransparency")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Smanji blur / prozirnost"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsx("div",{className:"rounded-md border border-slate-200 p-2 bg-[linear-gradient(135deg,#e2e8f0,#cbd5e1)]",children:c.jsx("div",{className:"rounded border border-white/70 bg-white/60 backdrop-blur-sm p-1.5 text-[10px] text-slate-800",children:"Prozirni sloj"})}),c.jsx("div",{className:"rounded-md border border-slate-200 p-2 bg-[linear-gradient(135deg,#e2e8f0,#cbd5e1)]",children:c.jsx("div",{className:"rounded border border-slate-300 bg-white p-1.5 text-[10px] text-slate-800",children:"Cvrsti sloj"})})]})]});if(b==="readingGuide")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"VodiÄ za Äitanje"}),c.jsxs("div",{className:"rounded-md border border-slate-200 bg-white p-2 relative overflow-hidden",children:[c.jsxs("div",{className:"space-y-1 text-[10px] text-slate-500",children:[c.jsx("div",{children:"Lorem ipsum dolor sit amet"}),c.jsx("div",{children:"consectetur adipiscing elit"}),c.jsx("div",{children:"sed do eiusmod tempor"})]}),c.jsx("div",{className:"absolute left-1 right-1 top-[50%] -translate-y-1/2 h-5 rounded bg-amber-100/80 border border-amber-200"})]})]});if(b==="focusMask")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Maska fokusa (priguÅ¡ena okolina)"}),c.jsxs("div",{className:"rounded-md border border-slate-200 p-2 bg-slate-900/90 relative overflow-hidden h-16",children:[c.jsx("div",{className:"absolute inset-0 bg-black/35"}),c.jsx("div",{className:"absolute left-3 right-3 top-1/2 -translate-y-1/2 roun
651ded-md bg-white text-slate-900 px-2 py-1.5 text-[11px] font-medium shadow",children:"Aktivni element"})]})]});if(b==="textToSpeech")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Äitanje teksta (TTS)"}),c.jsxs("div",{className:"rounded-md border border-slate-200 p-2 bg-slate-50 space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 rounded-full bg-slate-900 text-white flex items-center justify-center text-[10px]",children:c.jsx("i",{className:"fa-solid fa-volume-high","aria-hidden":"true"})}),c.jsx("div",{className:"text-[11px] text-slate-700",children:"Hover i klik Äitaju element, a aktivni element se vizualno oznaÄava."})]}),c.jsx("div",{className:"rounded border border-amber-200 bg-amber-50 px-2 py-1 text-[10px] text-amber-800",children:"Trenutno Äitani element dobiva obrub tijekom govora."})]})]});if(b==="muteSounds")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"UtiÅ¡avanje audio i video sadržaja"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] text-slate-700",children:[c.jsxs("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-2 space-y-1",children:[c.jsx("div",{className:"font-medium",children:"Video"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("i",{className:"fa-solid fa-volume-high"}),c.jsx("span",{children:"Zvuk ukljuÄen"})]})]}),c.jsxs("div",{className:"rounded-md border border-slate-200 bg-slate-900 p-2 text-white space-y-1",children:[c.jsx("div",{className:"font-medium",children:"Video"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("i",{className:"fa-solid fa-volume-xmark"}),c.jsx("span",{children:"Zvuk utiÅ¡an"})]})]})]})]});if(b==="textMagnifier")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"PoveÄalo teksta uz kursor ili fokus"}),c.jsxs("div",{className:"relative rounded-md border border-slate-200 bg-slate-50 p-2",children:[c.jsx("div",{className:"text-[10px] text-slate-600",children:"Element ispod kursora"}),c.jsx("div",{className:"mt-1 text-[11px] text-slate-800 font-medium",children:"Kontaktirajte nas za viÅ¡e informacija"}),c.jsx("div",{className:"absolute right-2 top-2 rounded-xl bg-slate-900 px-3 py-2 text-[12px] font-semibold text-white shadow-lg",children:"Kontaktirajte nas za viÅ¡e informacija"})]})]});if(b==="keyboardNavigation")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Skokovi po vrstama elemenata"}),c.jsx("div",{className:"grid grid-cols-5 gap-1.5 text-[10px] text-slate-700",children:[["H","Naslovi"],["F","Forme"],["B","Gumbi"],["L","Linkovi"],["G","Grafike"]].map(([G,re])=>c.jsxs("div",{className:"rounded border border-slate-200 bg-slate-50 px-1.5 py-2 text-center",children:[c.jsx("kbd",{className:"rounded border border-slate-300 bg-white px-1.5 py-0.5 font-semibold text-slate-800",children:G}),c.jsx("div",{className:"mt-1 truncate",children:re})]},G))})]});if(b==="largeCursor")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Veliki pokazivaÄ"}),c.jsxs("div",{className:"rounded-md border border-slate-200 p-2 bg-slate-50 h-16 relative",children:[c.jsx("div",{className:"absolute left-3 top-2 text-slate-400 text-[10px]",children:"Standard"}),c.jsx("div",{className:"absolute left-6 top-7 text-slate-700 text-sm",children:"â"}),c.jsx("div",{className:"absolute right-3 top-2 text-slate-400 text-[10px]",children:"PoveÄan"}),c.jsx("div",{className:"absolute right-7 top-5 text-slate-900 text-2xl leading-none",children:"â"})]})]});if(b==="highlightTitles"||b==="highlightAll"){const G=b==="highlightAll";return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:G?"Isticanje sadržajnih blokova":"Isticanje naslova"}),c.jsxs("div",{className:"rounded-md border border-slate-200 bg-slate-50 p-2 space-y-2",style:G?I:void 0,children:[c.jsx("div",{className:"text-[11px] font-semibold",style:G?void 0:{color:at.focusColor,textDecoration:"underline",textDecorationColor:at.linkUnderline,textUnderlineOffset:"4px"},children:"Naslov odjeljka"}),c.jsx("div",{className:"text-[10px] text-slate-600",children:"Kratak opis sadr\\u017eaja koji pokazuje kako isticanje izgleda u stvarnom bloku."})]})]})}if(b==="formErrorSummary")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Sažetak greÅ¡aka u formi"}),c.jsxs("div",{className:"rounded-md border border-red-200 bg-red-50 p-2",children:[c.jsx("div",{className:"text-[11px] font-semibold text-red-700 mb-1",children:"Molimo ispravite polja:"}),c.jsxs("ul",{className:"text-[10px] text-red-700 list-disc pl-4 space-y-0.5",children:[c.jsx("li",{children:"Email nije ispravan"}),c.jsx("li",{children:"Lozinka je prekratka"})]})]})]});if(b==="pageAnnouncements")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"Najava promjene stranice (screen reader)"}),c.jsxs("div",{className:"rounded-md border border-sky-200 bg-sky-50 p-2 text-[11px] text-sky-800",children:[c.jsx("div",{className:"font-medium",children:"ARIA live status"}),c.jsx("div",{className:"mt-1",children:"Otvorena stranica: Profil korisnika"})]})]});if(b==="keyboardShortcuts")return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsx("div",{className:"text-[11px] text-slate-600",children:"TipkovniÄke preÄice"}),c.jsx("div",{className:"grid grid-cols-2 gap-1.5 text-[10px] text-slate-700",children:[["Alt+A","A11y alat"],["Alt+M","Meni"],["Alt+S","Pretraga"]].map(([G,re])=>c.jsxs("div",{className:"rounded border border-slate-200 bg-slate-50 px-1.5 py-1 flex items-center justify-between gap-2",children:[c.jsx("kbd",{className:"rounded border border-slate-300 bg-white px-1 py-0.5 text-[10px] font-semibold text-slate-700",children:G}),c.jsx("span",{className:"truncate",children:re})]},G))})]});if(b==="presetPreview"){const G=((K=d==null?void 0:d.meta)==null?void 0:K.patch)||{},re=((X=d==null?void 0:d.meta)==null?void 0:X.presetLabel)||(d==null?void 0:d.label)||"Preset",pe={fontSize:"Veci tekst",highContrast:"Visoki kontrast",focusHighlight:"Isticanje fokusa",linkHighlight:"Isticanje linkova",pageAnnouncements:"Najava stranice",largerClickTargets:"Veci klik",tableMode:"A11y tablice",dyslexicFont:"Dyslexic font",textSpacing:"Razmak teksta",lineHeight:"Visina reda",reduceMotion:"Manje animacija",interactiveHighlight:"Interaktivni elementi",largeCursor:"Veliki kurs
651or",keyboardShortcuts:"TipkovniÄke preÄice",keyboardNavigation:"Navigacija po tipovima",readableFont:"Äitljiviji font",fontWeight:"Podebljan tekst",brightness:"Svjetlina",monochrome:"Monokromatski prikaz",muteSounds:"UtiÅ¡aj medije",textMagnifier:"PoveÄalo teksta",focusMask:"Maska fokusa",textToSpeech:"Äitanje teksta"},ue=Object.entries(G),Ve=ue.filter(([,et])=>et===!0).map(([et])=>pe[et]||et),Fe=ue.filter(([et,qe])=>qe!==!0&&qe!==!1).map(([et,qe])=>`${pe[et]||et}: ${qe}`);return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsxs("div",{className:"text-[11px] text-slate-600",children:["Preset preview: ",re]}),c.jsxs("div",{className:"rounded-md border border-slate-200 p-2 bg-slate-50",children:[c.jsx("div",{className:"text-[11px] text-slate-700 mb-1.5",children:"Å to Äe se ukljuÄiti"}),c.jsxs("div",{className:"flex flex-wrap gap-1",children:[Ve.slice(0,5).map(et=>c.jsx("span",{className:"inline-flex items-center rounded-full bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-medium",children:et},et)),Ve.length>5&&c.jsxs("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-700 px-2 py-0.5 text-[10px]",children:["+",Ve.length-5," joÅ¡"]}),!Ve.length&&c.jsx("span",{className:"text-[10px] text-slate-500",children:"Nema ukljuÄivanja toggle opcija"})]}),Fe.length>0&&c.jsxs("div",{className:"mt-2 text-[10px] text-slate-600",children:["Podesavanja: ",Fe.slice(0,2).join(", ")]})]})]})}return c.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-2.5 space-y-2",children:[c.jsxs("p",{className:"text-xs text-slate-700 leading-relaxed",children:["Primjer teksta i"," ",c.jsx("a",{href:"#demo-mini-link",onClick:G=>G.preventDefault(),style:T,children:"linka"}),"."]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",className:"px-2.5 py-1.5 rounded-md bg-slate-900 text-white text-xs font-medium",children:"Gumb"}),c.jsx("input",{type:"text",readOnly:!0,value:"Input",className:"min-w-0 flex-1 px-2 py-1.5 rounded-md border border-slate-300 text-xs","aria-label":"Demo input"})]})]})},vt=(()=>{if(!d)return null;const b=typeof window<"u"?window.innerWidth:1024,T=typeof window<"u"?window.innerHeight:768,S=340,I=290,K=Number(d==null?void 0:d.x)||24,X=Number(d==null?void 0:d.y)||24,G=X>220,re=Math.max(12,Math.min(K+14,b-S-12)),pe=G?X-12:X+18,ue=G?Math.max(12,pe-I):Math.min(pe,T-I-12);return{left:re,top:ue,width:S,maxWidth:"calc(100vw - 24px)"}})();return typeof document>"u"?null:go.createPortal(c.jsxs(c.Fragment,{children:[c.jsx("button",{"data-a11y-toolbar-trigger":"true",onClick:()=>{e(!t),t||_(w("messages.toolbarOpened","Otvoren je alat za pristupaÄnost"))},className:"fixed bottom-6 right-6 z-[999] w-14 h-14 bg-gray-900 hover:bg-black text-white rounded-full shadow-2xl flex items-center justify-center transition-all hover:scale-110 focus:outline-none focus:ring-4 focus:ring-gray-700 lg:bottom-8 lg:right-8","aria-label":w("toolbar.triggerLabel","Otvori alat za pristupaÄnost"),title:w("toolbar.triggerTitle","PristupaÄnost"),children:c.jsx("i",{className:"fa-solid fa-universal-access text-2xl"})}),t&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-[998] bg-black/20 backdrop-blur-[1px] lg:hidden",onClick:()=>{e(!1),ce(w("messages.toolbarClosed","Zatvoren je alat za pristupaÄnost"))},"aria-hidden":"true"}),c.jsxs("aside",{className:"fixed top-0 right-0 z-[999] h-screen w-full max-w-[440px] border-l border-gray-200 bg-white shadow-2xl overflow-hidden accessibility-toolbar-modal lg:top-4 lg:right-4 lg:h-[calc(100vh-2rem)] lg:max-w-[368px] lg:rounded-2xl lg:border lg:border-gray-200",role:"complementary","aria-labelledby":"accessibility-title","aria-modal":"false",children:[c.jsxs("div",{className:"bg-gradient-to-r from-gray-900 to-black px-5 py-4 flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-9 h-9 bg-white rounded-lg flex items-center justify-center",children:c.jsx("i",{className:"fa-solid fa-universal-access text-gray-900 text-lg"})}),c.jsx("h2",{id:"accessibility-title",className:"text-lg font-bold text-white",children:w("toolbar.title","Alat za pristupaÄnost")})]}),c.jsx("button",{onClick:()=>{e(!1),ce(w("messages.toolbarClosed","Zatvoren je alat za pristupaÄnost"))},className:"w-8 h-8 flex items-center justify-center text-white hover:bg-white/10 rounded-lg transition-colors","aria-label":w("toolbar.close","Zatvori"),children:c.jsx("i",{className:"fa-solid fa-times text-lg"})})]}),c.jsx("div",{className:"grid grid-cols-2 border-b border-gray-200",children:We.map(b=>c.jsxs("button",{onClick:()=>u(b.id),className:`min-w-0 py-2.5 px-3 text-sm flex items-center justify-center gap-2 font-medium transition-colors ${l===b.id?"text-gray-900 border-b-2 border-gray-900 bg-gray-100":"text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:[c.jsx("i",{className:`fa-solid ${b.icon}`}),b.label]},b.id))}),c.jsxs("div",{className:"p-5 space-y-3.5 overflow-y-auto h-[calc(100vh-214px)] lg:h-[c
651alc(100vh-244px)]",children:[c.jsx("p",{id:"a11y-demo-hint",className:"sr-only",children:w("toolbar.demoHint","Zadržite miÅ¡ kratko iznad opcije u alatu za pristupaÄnost da se prikaže mali preview pokraj kursora.")}),l==="profiles"&&c.jsx("div",{children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("i",{className:"fa-solid fa-wand-magic-sparkles text-slate-700 mt-1"}),c.jsxs("div",{className:"w-full",children:[c.jsx("div",{className:"mb-2.5 text-[13px] font-semibold text-gray-800",children:w("toolbar.quickPresetsTitle","Brze prilagodbe")}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:b$.map(b=>c.jsxs("button",{type:"button","aria-describedby":"a11y-demo-hint",onMouseEnter:T=>{oe({x:T.clientX,y:T.clientY},!1),Ee({label:L(b),description:V(b),icon:"fa-wand-magic-sparkles",kind:"preset",settingKey:"presetPreview",meta:{patch:b.patch,presetLabel:L(b)}})},onMouseMove:T=>Me(T,{label:L(b),description:V(b),icon:"fa-wand-magic-sparkles",kind:"preset",settingKey:"presetPreview",meta:{patch:b.patch,presetLabel:L(b)}}),onMouseLeave:()=>le(),onFocus:T=>Ee({label:L(b),description:V(b),icon:"fa-wand-magic-sparkles",kind:"preset",settingKey:"presetPreview",meta:{patch:b.patch,presetLabel:L(b)}},120,be(T.currentTarget)),onBlur:()=>le(0),onClick:()=>Te(b),className:"text-left rounded-xl border border-slate-200 bg-white hover:bg-slate-100 px-3.5 py-3 shadow-sm transition-colors",children:[c.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:L(b)}),c.jsx("div",{className:"mt-0.5 text-[11px] leading-4 text-gray-600",children:V(b)})]},b.id))}),c.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-200",children:[c.jsx("div",{className:"mb-2.5 text-[13px] font-semibold text-gray-800",children:w("toolbar.profilesTitle","Profili pristupaÄnosti")}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:g$.map(b=>c.jsxs("button",{type:"button","aria-describedby":"a11y-demo-hint",onMouseEnter:T=>{oe({x:T.clientX,y:T.clientY},!1),Ee({label:te(b),description:ae(b),icon:"fa-sliders",kind:"preset",settingKey:"presetPreview",meta:{patch:Mf(n,b.patch),presetLabel:te(b)}})},onMouseMove:T=>Me(T,{label:te(b),description:ae(b),icon:"fa-sliders",kind:"preset",settingKey:"presetPreview",meta:{patch:Mf(n,b.patch),presetLabel:te(b)}}),onMouseLeave:()=>le(),onFocus:T=>Ee({label:te(b),description:ae(b),icon:"fa-sliders",kind:"preset",settingKey:"presetPreview",meta:{patch:Mf(n,b.patch),presetLabel:te(b)}},120,be(T.currentTarget)),onBlur:()=>le(0),onClick:()=>Te(b),className:"text-left rounded-xl border border-slate-200 bg-white hover:bg-slate-100 px-3.5 py-3 shadow-sm transition-colors",children:[c.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:te(b)}),c.jsx("div",{className:"mt-0.5 text-[11px] leading-4 text-gray-600",children:ae(b)})]},b.id))})]})]})]})}),l==="visual"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pt-1 pb-1",children:c.jsx("div",{className:"text-sm font-bold uppercase text-gray-700",children:"Osnovna Äitljivost"})}),c.jsx(Ne,{label:w("controls.fontSize.label","VeliÄina teksta"),icon:"fa-text-height",value:n.fontSize,min:80,max:200,step:10,unit:"%",settingKey:"fontSize"}),c.jsx(Ne,{label:w("controls.brightness.label","Svjetlina"),icon:"fa-sun",value:n.brightness,min:50,max:150,step:10,unit:"%",settingKey:"brightness"}),c.jsx(Ne,{label:w("controls.saturation.label","ZasiÄenost boja"),icon:"fa-palette",value:n.saturation,min:0,max:200,step:10,unit:"%",settingKey:"saturation"}),c.jsx(Ke,{settingKey:"highContrast",icon:"fa-adjust",label:w("controls.highContrast.label","Visoki kontrast"),description:w("controls.highContrast.description","PojaÄava razliku izmeÄu teksta i pozadine")}),c.jsx(Ke,{settingKey:"lightContrast",icon:"fa-sun",label:w("controls.lightContrast.label","Svijetli kontrast"),description:w("controls.lightContrast.description","Svijetla kontrastna tema za mirniji prikaz")}),c.jsx(Ke,{settingKey:"darkMode",icon:"fa-moon",label:w("controls.darkMode.label","Tamni naÄin"),description:w("controls.darkMode.description","Tamna pozadina za smanjenje naprezanja oÄiju")}),c.jsx(Ke,{settingKey:"monochrome",icon:"fa-circle-half-stroke",label:w("controls.monochrome.label","Monokromatski prikaz"),description:w("controls.monochrome.description","Uklanja boje i prikazuje sadržaj u sivim tonovima")}),c.jsx("div",{className:"h-px bg-gray-200 my-2"}),c.jsx("div",{className:"pt-1 pb-1",children:c.jsx("div",{className:"text-sm font-bold uppercase text-gray-700",children:"Smanjenje smetnji"})}),c.jsx(Ke,{settingKey:"reduceMotion",icon:"fa-ban",label:w("controls.reduceMotion.label","Smanji animacije"),description:w("controls.reduceMotion.description","Uklanja pokrete i animacije")}),c.jsx(Ke,{settingKey:"reduceTransparency",icon:"fa-droplet-slash",label:w("controls.reduceTransparency.label","Smanji transparenciju"),description:w("controls.reduceTransparency.description","Uklanja blur i prozirne slojeve")}),c.jsx(Ke,{settingKey:"hideImages",icon:"fa-image",label:w("controls.hideImages.label","Sakrij slike"),description:w("controls.hideImages.description","Snažnije uklanja slike, SVG-ove i pozadinske slike"),onMessage:"Slike su skrivene",offMessage:"Slike su vidljive"}),c.jsx(Ke,{settingKey:"muteSounds",icon:"fa-volume-xmark",label:w("controls.muteSounds.label","UtiÅ¡aj medije"),description:w("controls.muteSounds.description","UtiÅ¡ava audio i video sadržaj stranice")}),c.jsx("div",{className:"h-px bg-gray-200 my-2"}),c.jsx("div",{className:"pt-1 pb-1",children:c.jsx("div",{className:"text-sm font-bold uppercase text-gray-700",children:"Isticanje sadržaja"})}),c.jsx(Ke,{settingKey:"highlightTitles",icon:"fa-heading",label:w("controls.highlightTitles.label","Istakni naslove"),description:w("controls.highlightTitles.description","NaglaÅ¡ava naslove i hijerarhiju stranice")}),c.jsx(Ke,{settingKey:"highlightAll",icon:"fa-highlighter",label:w("controls.highlightAll.label","Istakni blokove"),description:w("controls.highlightAll.description","PojaÄava glavne blokove i odjeljke sadržaja")}),c.jsx(Ke,{settingKey:"focusHighlight",icon:"fa-bullseye",label:w("controls.focusHighlight.label","Isticanje fokusa"),description:w("controls.focusHighlight.description","Vidljiviji obrub fokusiranih elemenata")}),c.jsx(Ke,{settingKey:"linkHighlight",icon:"fa-link",label:w("controls.linkHighlight.label","Istakni linkove"),description:w("controls.linkHighlight.description","NaglaÅ¡ava sve linkove na stranici")}),c.jsx("div",{className:"p-4 bg-gray-50 rounded-lg border border-gray-200",onMouseEnter:b=>{oe({x:b.clientX,y:b.clientY},!1),Ee({label:"Boja highlighta",description:"Preview boje za linkove i fokus obrub",icon:"fa-palette",kind:"select",settingKey:"highlightColor"})},onMouseMove:b=>Me(b,{label:"Boja highlighta",description:"Preview boje za linkove i fokus obrub",icon:"fa-palette",kind:"select",settingKey:"highlightColor"}),onMouseLeave:()=>le(),onFocus:b=>Ee({label:"Boja highlighta",description:"Preview boje za linkove i fokus obrub",icon:"fa-palette",kind:"select",settingKey:"highlightColor"},120,be(b.currentTarget)),onBlur:()=>le(0),children:c.jsxs("div",{className:"flex items-center justify-between gap-3 mb-2",children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-semibold text-gray-800",children:"Boja highlighta"}),c.jsx("div",{className:"text-sm text-gray-600",children:w("controls.highlightColor.description","Odabir boje za fokus i isticanje linkova")})]}),c.jsx("select",{"aria-describedby":"a11y-demo-hint",value:n.highlightColor,onChange:b=>De("highlightColor",b.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm bg-white",children:Object.entries(Bg).map(([b,T])=>c.jsx("option",{value:b,children:T.label},b))})]})}),c.jsx("div",{className:"h-px bg-gray-200 my-2"}),c.jsx("div",{className:"pt-1 pb-1",children:c.jsx("div",{className:"text-sm font-bold uppercase text-gray-700",children:"Interakcija"})}),c.jsx(Ke,{settingKey:"interactiveHighlight",icon:"fa-hand-pointer",label:w("controls.interactiveHighlight.label","Istakni interaktivne elemente"),description:w("controls.interactiveHighlight.description","OznaÄava gumbe, linkove i polja i bez hovera")}),c.jsx(Ke,{settingKey:"largerClickTargets",icon:"fa-expand",label:w("controls.largerClickTargets.label","VeÄi klikabilni elementi"),description:w("controls.largerClickTargets.description","PoveÄava aktivnu povrÅ¡inu gumba i linkova")}),c.jsx(Ke,{settingKey:"largeCursor",icon:"fa-arrow-pointer",label:w("controls.largeCursor.label","Veliki pokazivaÄ"),description:w("controls.largeCursor.description","PoveÄava kursor miÅ¡a")}),c.jsx("div",{className:"h-px bg-gray-200 my-2"}),c.jsx("div",{className:"pt-1 pb-1",children:c.jsx("div",{className:"text-sm font-bold uppercase text-gray-700",children:"Dodatno"})}),c.jsx(Ke,{settingKey:"tableMode",icon:"fa-table-cells",label:w("controls.tableMode.label","A11y naÄin za tablice"),description:w("controls.tableMode.description","PojaÄava kontrast redova i poboljÅ¡ava tablice")}),c.jsx(Ke,{settingKey:"formErrorSummary",icon:"fa-circle-exclamation",label:w("controls.formErrorSummary.label","Sažetak greÅ¡aka u formi"),description:w("controls.formErrorSummary.description","Na vrh formi dodaje listu greÅ
651¡aka i skok na polje")})]}),l==="reading"&&c.jsxs(c.Fragment,{children:[c.jsx(Ke,{settingKey:"readableFont",icon:"fa-font",label:w("controls.readableFont.label","Äitljiviji font"),description:w("controls.readableFont.description","Standardni font optimiziran za lakÅ¡e Äitanje")}),c.jsx(Ke,{settingKey:"dyslexicFont",icon:"fa-font",label:w("controls.dyslexicFont.label","Font za disleksiju"),description:w("controls.dyslexicFont.description","LakÅ¡e Äitljiv font za osobe s disleksijom")}),c.jsx(Ke,{settingKey:"fontWeight",icon:"fa-bold",label:w("controls.fontWeight.label","Podebljan tekst"),description:w("controls.fontWeight.description","PojaÄava debljinu teksta u sadržaju")}),c.jsx(_e,{label:w("controls.textAlign.label","Poravnanje teksta"),description:w("controls.textAlign.description","Mijenja poravnanje odlomaka i tekstualnih blokova"),icon:"fa-align-left",value:n.textAlign,settingKey:"textAlign",options:tt}),c.jsx(Ke,{settingKey:"textSpacing",icon:"fa-text-width",label:w("controls.textSpacing.label","PoveÄaj razmak teksta"),description:w("controls.textSpacing.description","Dodaje viÅ¡e prostora izmeÄu slova i rijeÄi")}),c.jsx(Ne,{label:w("controls.lineHeight.label","Visina reda"),icon:"fa-arrows-up-down",value:n.lineHeight,min:100,max:250,step:10,unit:"%",settingKey:"lineHeight"}),c.jsx(Ke,{settingKey:"readingGuide",icon:"fa-grip-lines",label:w("controls.readingGuide.label","VodiÄ za Äitanje"),description:w("controls.readingGuide.description","Žuta traka prati kursor za lakÅ¡e Äitanje")}),c.jsx(Ke,{settingKey:"focusMask",icon:"fa-eye-slash",label:w("controls.focusMask.label","Maska za fokus"),description:w("controls.focusMask.description","Zatamnjuje ostatak stranice oko aktivnog podruÄja")}),c.jsx(Ke,{settingKey:"textMagnifier",icon:"fa-magnifying-glass-plus",label:w("controls.textMagnifier.label","PoveÄalo teksta"),description:w("controls.textMagnifier.description","Prikazuje uveÄani tekst elementa ispod kursora ili fokusa")}),c.jsx(Ke,{settingKey:"textToSpeech",icon:o?"fa-volume-high":"fa-volume-up",label:w("controls.textToSpeech.label","Äitanje teksta"),description:w("controls.textToSpeech.description","Glasovno Äitanje elemenata i sadržaja")}),n.textToSpeech&&c.jsxs("div",{className:"flex flex-col gap-2 sm:gap-3",children:[c.jsxs("button",{type:"button",onClick:ot,disabled:o,className:"w-full bg-gray-900 hover:bg-black disabled:opacity-50 text-white min-h-[44px] px-4 py-2.5 rounded-xl font-semibold text-sm transition-colors flex items-center justify-center gap-2",children:[c.jsx("i",{className:"fa-solid fa-play"}),w("actions.readPage","ProÄitaj stranicu")]}),c.jsxs("button",{type:"button",onClick:Ge,disabled:o,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white min-h-[44px] px-4 py-2.5 rounded-xl font-semibold text-sm transition-colors flex items-center justify-center gap-2",children:[c.jsx("i",{className:"fa-solid fa-i-cursor"}),w("actions.readSelection","ProÄitaj oznaÄeni tekst")]}),o&&c.jsxs("button",{type:"button",onClick:Oe,className:"w-full bg-red-600 hover:bg-red-700 text-white min-h-[44px] px-4 py-2.5 rounded-xl font-semibold text-sm transition-colors flex items-center justify-center gap-2",children:[c.jsx("i",{className:"fa-solid fa-stop"}),w("actions.stop","Zaustavi")]})]})]}),l==="navigation"&&c.jsxs(c.Fragment,{children:[c.jsx(Ke,{settingKey:"pageAnnouncements",icon:"fa-bullhorn",label:w("controls.pageAnnouncements.label","Najava promjene stranice"),description:w("controls.pageAnnouncements.description","ARIA najava kod promjene stranice")}),c.jsx(Ke,{settingKey:"keyboardNavigation",icon:"fa-road",label:w("controls.keyboardNavigation.label","Navigacija po tipovima"),description:w("controls.keyboardNavigation.description","H, F, B, L i G skaÄu na naslove, forme, gumbe, linkove i grafike")}),c.jsx(Ke,{settingKey:"keyboardShortcuts",icon:"fa-keyboard",label:w("controls.keyboardShortcuts.label","Globalne tipkovniÄke preÄice"),description:w("controls.keyboardShortcuts.description","Alt+A toolbar, Alt+M meni, Alt+S pretraga")}),c.jsx("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("i",{className:"fa-solid fa-keyboard text-blue-600 mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-semibold text-gray-800 mb
651-2",children:"TipkovniÄke preÄice"}),c.jsxs("div",{className:"text-sm text-gray-600 space-y-1",children:[c.jsxs("div",{children:[c.jsx("kbd",{className:"px-2 py-0.5 bg-white rounded border text-xs",children:"Tab"})," - ",w("navigationHelp.forward","Navigacija naprijed")]}),c.jsxs("div",{children:[c.jsx("kbd",{className:"px-2 py-0.5 bg-white rounded border text-xs",children:"Shift + Tab"})," - ",w("navigationHelp.backward","Navigacija nazad")]}),c.jsxs("div",{children:[c.jsx("kbd",{className:"px-2 py-0.5 bg-white rounded border text-xs",children:"Enter"})," - ",w("navigationHelp.activate","Aktivacija elementa")]}),c.jsxs("div",{children:[c.jsx("kbd",{className:"px-2 py-0.5 bg-white rounded border text-xs",children:"Esc"})," - ",w("navigationHelp.close","Zatvaranje dijaloga")]}),c.jsxs("div",{children:[c.jsx("kbd",{className:"px-2 py-0.5 bg-white rounded border text-xs",children:"Alt + A"})," - ",w("navigationHelp.toolbar","Otvori/zatvori alat")]}),c.jsxs("div",{children:[c.jsx("kbd",{className:"px-2 py-0.5 bg-white rounded border text-xs",children:"Alt + M"})," - ",w("navigationHelp.menu","Otvori meni")]}),c.jsxs("div",{children:[c.jsx("kbd",{className:"px-2 py-0.5 bg-white rounded border text-xs",children:"Alt + S"})," - ",w("navigationHelp.search","Fokus na pretragu")]})]})]})]})})]}),c.jsx("div",{className:"pt-4 border-t border-gray-200 space-y-3",children:c.jsxs("button",{onClick:He,className:"w-full bg-gray-200 hover:bg-gray-300 text-gray-800 py-3 rounded-lg font-semibold transition-colors flex items-center justify-center gap-2",children:[c.jsx("i",{className:"fa-solid fa-rotate-left"}),w("actions.reset","Vrati na zadane postavke")]})}),c.jsx("div",{className:"text-xs text-gray-500 text-center",children:w("toolbar.autosave","Postavke se automatski spremaju lokalno u pregledniku i primjenjuju na sve stranice")}),c.jsxs("div",{className:"pt-3 mt-3 border-t border-gray-200 text-center",children:[c.jsxs("span",{className:"text-xs text-gray-400",children:[w("toolbar.poweredBy","powered by")," "]}),c.jsx("a",{href:p$("/"),target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-500 hover:text-gray-700 hover:underline mt-1 inline-block",children:"SIADUS"})]})]})]}),d&&vt&&c.jsx("div",{className:"fixed z-[1002] pointer-events-none",style:vt,role:"status","aria-live":"polite",children:c.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white/95 backdrop-blur-sm shadow-2xl p-3",children:[c.jsxs("div",{className:"flex items-start gap-2.5 mb-2",children:[c.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-900 text-white flex items-center justify-center shrink-0",children:c.jsx("i",{className:`fa-solid ${d.icon||"fa-eye"}`,"aria-hidden":"true"})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-xs font-semibold text-slate-900 truncate",children:d.label}),c.jsx("div",{className:"text-[11px] text-slate-600 leading-snug",children:d.description||w("preview.fallback","Preview efekta na tipiÄne UI elemente.")})]})]}),Ut()]})})]})]}),document.body)}const Yu="data-seo-managed",C$="hr_HR",E$="en_US";function gn(t){return String(t??"").replace(/\s+/g," ").trim()}function Ox(t,e){const n=gn(t);return n.length<=e?n:`${n.slice(0,Math.max(0,e-1)).trim()}...`}function rf(t,e){const n=gn(e);let r=document.head.querySelector(`meta[name="${t}"]`);r||(r=document.createElement("meta"),r.setAttribute("name",t),document.head.appendChild(r)),r.setAttribute("content",n),r.setAttribute(Yu,"true")}function T$(t){const e=document.head.querySelector(`meta[name="${t}"]`);e&&e.remove()}function yi(t,e){const n=gn(e);let r=document.head.querySelector(`meta[property="${t}"]`);r||(r=document.createElement("meta"),r.setAttribute("property",t),document.head.appendChild(r)),r.setAttribute("content",n),r.setAttribute(Yu,"true")}function sf(t){const e=document.head.querySelector(`meta[property="${t}"]`);e&&e.remove()}function A$(t){let e=document.head.querySelector('link[rel="canonical"]');e||(e=document.createElement("link"),e.setAttribute("rel","canonical"),document.head.appendChild(e)),e.setAttribute("href",gn(t)),e.setAttribute(Yu,"true")}function M$(){document.head.querySelectorAll(`script[type="application/ld+json"][${Yu}
651="true"]`).forEach(e=>e.remove())}function I$(t){for(const e of t)if(!(!e||typeof e!="object"))try{const n=document.createElement("script");n.setAttribute("type","application/ld+json"),n.setAttribute(Yu,"true"),n.text=JSON.stringify(e),document.head.appendChild(n)}catch{}}function As(t,e){const n=String(t||"").trim(),r=String(e||"").trim();if(!n)return r;if(!r)return n;try{return new URL(n,r).toString()}catch{return n}}function j1(t){return typeof t=="string"?gn(t):Array.isArray(t)?gn(t.map(e=>typeof e=="string"?e:String((e==null?void 0:e.text)||"")).join(" ")):""}function Ug(t,e=240){if(!Array.isArray(t)||t.length===0)return"";const n=[];for(const r of t){if(r.type==="heading"){const i=gn(r.text);i&&n.push(i)}else if(r.type==="paragraph"){const i=j1(r.text);i&&n.push(i)}else if(r.type==="list")for(const i of r.items){const s=j1(i);s&&n.push(s)}else if(r.type==="documents")for(const i of r.items){const s=gn(i.label);s&&n.push(s)}if(gn(n.join(" ")).length>=e)break}return Ox(n.join(" "),e)}function z$(t){if(typeof document>"u")return;const e=Ox(t.title||"",110),n=Ox(t.description||"",280),r=gn(t.canonicalUrl),i=gn(t.siteName),s=gn(t.imageUrl||""),o=gn(t.imageAlt||e),a=gn(t.robots||"index,follow,max-image-preview:large,max-snippet:-1,max-video-preview:-1"),l=t.type==="article"?"article":"website",u=(t.lang||"hr").toLowerCase()==="en"?E$:C$,d=Array.isArray(t.keywords)?t.keywords.map(m=>gn(m)).filter(Boolean).join(", "):"";document.title=e,t.lang&&document.documentElement.setAttribute("lang",t.lang),A$(r),rf("description",n),rf("robots",a),rf("googlebot",a),d?rf("keywords",d):T$("keywords"),yi("og:type",l),yi("og:title",e),yi("og:description",n),yi("og:url",r),i&&yi("og:site_name",i),yi("og:locale",u),s?(yi("og:image",s),yi("og:image:alt",o)):(sf("og:image"),sf("og:image:alt"));const f=gn(t.publishedTime||""),p=gn(t.modifiedTime||"");f?yi("article:published_time",f):sf("article:published_time"),p?yi("article:modified_time",p):sf("article:modified_time"),M$(),Array.isArray(t.jsonLd)&&t.jsonLd.length>0&&I$(t.jsonLd)}function P$(){const t=yM(),[e,n]=h.useState(!1),[r,i]=h.useState(!1),s=h.useMemo(()=>t==null,[t]);h.useEffect(()=>{e&&i(!!(t!=null&&t.externalServices))},[t,e]),h.useEffect(()=>vM(()=>{i(!!(t!=null&&t.externalServices)),n(!0)}),[t]);const o=()=>{_h(!0),n(!1)},a=()=>{_h(!1),n(!1)},l=()=>{_h(r),n(!1)};return c.jsxs(c.Fragment,{children:[s&&c.jsxs("div",{className:"fixed inset-x-0 bottom-0 z-[650] border-t border-[#cadad1] bg-white/95 px-4 py-4 shadow-[0_-10px_30px_rgba(7,22,14,0.16)] backdrop-blur",children:[c.jsx("button",{type:"button","aria-label":"Zatvori banner i odbij nenužne kolaÄiÄe",className:"btn-natural absolute right-4 top-3 grid h-8 w-8 place-items-center rounded-full border border-[#b7c9bf] bg-white text-base font-bold text-[#234b34] hover:bg-[#eef5f1]",onClick:a,children:"Ã"}),c.jsxs("div",{className:"mx-auto flex w-full max-w-[1320px] flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[c.jsx("p",{className:"m-0 text-sm leading-6 text-[#234b34] md:pr-6",children:"Koristimo nužne kolaÄiÄe za rad stranice. Google Translate i Google Maps uÄitavaju se samo uz privolu."}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("button",{type:"button",className:"btn-natural rounded-md border border-[#96b6a5] bg-white px-3 py-2 text-sm font-semibold text-[#234b34] hover:bg-[#eef5f1]",onClick:()=>n(!0),children:"Postavke"}),c.jsx("button",{type:"button",className:"btn-natural rounded-md border border-[#bccdc4] bg-[#edf4f0] px-3 py-2 text-sm font-semibold text-[#234b34] hover:bg-[#e3eee8]",onClick:a,children:"Odbij nenužne"}),c.jsx("button",{type:"button",className:"btn-natural rounded-md bg-[#2f7d4c] px-3 py-2 text-sm font-semibold text-white hover:bg-[#276a40]",onClick:o,children:"Prihvati sve"})]})]})]}),e&&c.jsx("div",{className:"fixed inset-0 z-[700] flex items-center justify-center bg-black/45 px-4",role:"dialog","aria-modal":"true",children:c.jsxs("div",{className:"w-full max-w-[560px] rounded-lg border border-[#caded2] bg-white p-5 shadow-[0_25px_55px_rgba(3,12,8,0.35)]",children:[c.jsx("h3",{className:"m-0 text-xl font-black text-[#1f5131]",children:"Postavke kolaÄiÄa"}),c.jsx("p",{className:"mb-4 mt-2 text-sm leading-6 text-[#365d47]",children:"Nužni kolaÄiÄi su uvijek ukljuÄeni. Vanjske usluge ukljuÄuju Google Translate i Google Maps."}),c.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-[#d0e0d7] bg-[#f7fbf9] p-3",children:[c.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 accent-[#2f7d4c]",checked:r,onChange:u=>i(u.target.checked)}),c.jsx("span",{className:"text-sm leading-6 text-[#234b34]",children:"Dozvoli vanjske usluge (Google Translate i Google Maps)."})]}),c.jsxs("div",{className:"mt-5 flex flex-wrap justify-end gap-2",children:[c.jsx("button",{type:"button",className:"btn-natural rounded-md border border-[#b7c9bf] bg-white px-3 py-2 text-sm font-semibold text-[#234b34] hover:bg-[#eef5f1]",onClick:()=>n(!1),children:"Zatvori"}),c.jsx("button",{type:"button",className:"btn-natural rounded-md bg-[#2f7d4c] px-3 py-2 text-sm font-semibold text-white hover:bg-[#276a40]",onClick:l,children:"Spremi odabir"})]})]})})]})}function Tl(t){const e=Number(t);if(!Number.isFinite(e))return;const n=Math.floor(e);if(!(n<=0))return n}function D$(t){const e=String(t||"").trim();if(!e)return"";try{return decodeURIComponent(e)}catch{return e}}function NE(t){const e=String(t||"").trim();if(!e)return"/";const n=e.replace(/\/{2,}/g,"/");return n.startsWith("/")?n:`/${n}`}function O$(t){return NE(t).split("/").map(e=>
651D$(e)).filter(Boolean)}function tm(t){return String(t||"").trim().toLowerCase().replace(/[^a-z0-9-]+/g,"-").replace(/^-+|-+$/g,"")}function _$(t,e){const n=tm(e);return(t==="obrasci"||t==="imenik")&&n==="drvna-tehnologija"?"drvo":n}function L$(t,e){const n=tm(e);return(t==="obrasci"||t==="imenik")&&n==="drvo"?"drvna-tehnologija":n}function Ci(t,e,n){const r=_$(t,e);if(r)return n.includes(r)?r:void 0}function w1(t){const e=String(t||"").trim().toLowerCase();return e?e.replace(/[Ä]/g,"d").replace(/[ÄÄ]/g,"c").replace(/[ž]/g,"z").replace(/[Å¡]/g,"s").replace(/[^\w\s-]/g," ").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-"):""}function R$(t,e,n){const r=O$(t);if(r.length===0)return{route:e,view:e==="vijesti"?"news-list":e==="projekti"?"project-list":void 0};const i=tm(r[0]);if(i==="vijesti"){const l=Tl(r[1]);return l?{route:"vijesti",view:"news-detail",newsId:l,scrollNewsId:l}:{route:"vijesti",view:"news-list"}}if(i==="projekti"){const l=Tl(r[1]);return l?{route:"projekti",view:"project-detail",projectId:l,scrollProjectId:l}:{route:"projekti",view:"project-list"}}const s=El(i);if(!s)return null;const o={route:s},a=tm(r[1]);if(s==="akti-komore"){const l=Ci(s,a,n.aktiTabs);l&&(o.aktiTab=l)}else if(s==="obrasci"){const l=Ci(s,a,n.obrasciTabs);l&&(o.obrasciTab=l)}else if(s==="imenik"){const l=Ci(s,a,n.imenikTabs);l&&(o.imenikTab=l)}else if(s==="upisnik-licencija"){const l=Ci(s,a,n.upisnikTabs);l&&(o.upisnikLicencijaTab=l)}else if(s==="operativne-informacije"){const l=Ci(s,a,n.operativneTabs);l&&(o.operativneTab=l)}return o}function S1(t,e,n){const r=new URLSearchParams(String(t||"")),i=El(r.get("route")||"")??e,s={route:i},o=r.get("tab");if(i==="akti-komore"){const a=Ci(i,o,n.aktiTabs);a&&(s.aktiTab=a)}else if(i==="obrasci"){const a=Ci(i,o,n.obrasciTabs);a&&(s.obrasciTab=a)}else if(i==="imenik"){const a=Ci(i,o,n.imenikTabs);a&&(s.imenikTab=a)}else if(i==="upisnik-licencija"){const a=Ci(i,o,n.upisnikTabs);a&&(s.upisnikLicencijaTab=a)}else if(i==="operativne-informacije"){const a=Ci(i,o,n.operativneTabs);a&&(s.operativneTab=a)}if(i==="vijesti"){const a=String(r.get("view")||"").trim().toLowerCase(),l=Tl(r.get("newsId"));a==="news-detail"&&l?(s.view="news-detail",s.newsId=l,s.scrollNewsId=l):s.view="news-list"}else if(i==="projekti"){const a=String(r.get("view")||"").trim().toLowerCase(),l=Tl(r.get("projectId"));a==="project-detail"&&l?(s.view="project-detail",s.projectId=l,s.scrollProjectId=l):s.view="project-list"}return s}function $$(t){const e=t.defaultRoute??"vijesti",n={aktiTabs:t.aktiTabs,obrasciTabs:t.obrasciTabs,imenikTabs:t.imenikTabs,upisnikTabs:t.upisnikTabs,operativneTabs:t.operativneTabs},r=NE(t.pathname),i=new URLSearchParams(String(t.search||"")),s=i.has("route")||i.has("view")||i.has("newsId")||i.has("projectId")||i.has("tab");if((r==="/"||r==="")&&s)return{state:S1(t.search,e,n),legacyQuery:!0};const o=R$(r,e,n);return o?{state:o,legacyQuery:!1}:s?{state:S1(t.search,e,n),legacyQuery:!0}:{state:{route:e,view:e==="vijesti"?"news-list":e==="projekti"?"project-list":void 0},legacyQuery:!1}}function kc(t,e,n){const r=L$(e,n);return r?`${t}/${r}`:t}function Rc(t){const e=t.route??"vijesti",n=t.preferNewsRoot!==!1;if(e==="vijesti"){const i=Tl(t.newsId);if(t.view==="news-detail"&&i){const s=`/vijesti/${i}`,o=w1(t.newsSlug||"");return o?`${s}/${o}`:s}return n?"/":"/vijesti"}if(e==="projekti"){const i=Tl(t.projectId);if(t.view==="project-detail"&&i){const s=`/projekti/${i}`,o=w1(t.projectSlug||"");return o?`${s}/${o}`:s}return"/projekti"}const r=`/${e}`;return e==="akti-komore"?kc(r,e,t.aktiTab):e==="obrasci"?kc(r,e,t.obrasciTab):e==="imenik"?kc(r,e,t.imenikTab):e==="upisnik-licencija"?kc(r,e,t.upisnikLicencijaTab):e==="operativne-informacije"?kc(r,e,t.operativneTab):r}const B$=["profil-clana","kontakti","datoteka-nije-pronadena"],F$=["akti-komore","obrasci","imenik","upisnik-licencija","operativne-informacije"],U$=["temeljni","provedbeni"],H$=["sumarstvo","drvo"],V$=["sumarstvo","drvo"],K$=["drvna-tehnologija","sumarstvo-lovstvo"],W$=["zapisnici","izbori"];function G$(t,e){const n=$$({pathname:t,search:e,defaultRoute:"vijesti",aktiTabs:U$,obrasciTabs:H$,imenikTabs:V$,upisnikTabs:K$,operativneTabs:W$});return{state:{route:n.state.route??"vijesti",view:n.state.view,newsId:n.state.newsId,scrollNewsId:n.state.scrollNewsId,projectId:n.state.projectId,scrollProjectId:n.state.scrollProjectId,aktiTab:n.state.aktiTab,obrasciTab:n.state.obrasciTab,imenikTab:n.state.imenikTab,upisnikLicencijaTab:n.state.upisnikLicencijaTab,operativneTab:n.state.operativneTab},legacyQuery:n.legacyQuery}}function N1(t,e){return Rc({route:t.route??"vijesti",view:t.view,newsId:t.newsId,projectId:t.projectId,aktiTab:t.aktiTab,obrasciTab:t.obrasciTab,imenikTab:t.imenikTab,upisnikLicencijaTab:t.upisnikLicencijaTab,operativneTab:t.operativneTab,newsSlug:(e==null?void 0:e.newsSlug)??null,projectSlug:(e==null?void 0:e.projectSlug)??null,preferNewsRoot:!0})}function C1(t){return!t||typeof t!="object"?!1:!!t.__hkisdt_app}function _x(t,e){return String(t??"").trim()||e}function q$(t){return t.trim().toLowerCase()==="projekt"?"Projekti":t}function E1(t){const e=String(t||"").trim();if(!e)return"";const n=e.split("#")[0].split("?")[0].replace(/\\/g,"/").trim();if(!n)return"";try{return new URL(n,"https://hkisdt.hr").pathname.replace(/\/{2,}/g,"/").toLowerCase()}catch{return n.replace(/\/{2,}/g,"/").toLowerCase()}}function CE(t){var i;const e=El(t.slug),n=(Array.isArray(t.djeca)?t.djeca:[]).map(CE).filter(s=>!!s),r=e??((i=n[0])==null?void 0:i.route)??null;return r?{id:`db-nav-${t.stavka_id}`,label:q$(_x(t.oznaka,qp[r]??r)),route:r,children:n.length>0?n:void 0}:null}function J$(t){const e=[];for(const n of Array.isArray(t)?t:[]){const r=CE(n);if(!r)continue;const i={id:r.id,label:r.label,route:r.route};r.children&&r.children.length>0&&(i.children=r.children),e.push(i)}return e}function Z$(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function Cy(t){const e=String(t||"").trim();if(!e)return"";if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const n=e.match(/^(\d{1,2})\.\s*(\d{1,2})\.\s*(\d{4})\.?$/);if(n){const i=Number(n[1]),s=Number(n[2]),o=Number(n[3]);if(i>=1&&i<=31&&s>=1&&s<=12&&o>=1900)return`${o}-${String(s).padStart(2,"0")}-${String(i).padStart(2,"0")}`}const r=new Date(e);return Number.isNaN(r.getTime())?"":r.toISOString().slice(0,10)}function Lx(t){const e=String(t||"").trim();if(!e)return"";const n=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);return n?`${n[3]}. ${n[2]}. ${n[1]}.`:e}function jc(t,e){return t instanceof Error&&t.message.trim()?t.message.trim():e}function Mn(t){return String(t??"").replace(/\s+/g," ").trim()}function nl(t){return typeof t=="string"||!Array.isArray(t)?Mn(t):Mn(t.map(e=>typeof e=="string"?e:!e||typeof e!="object"?"":String(e.text??"")).join(" "))}function EE(t){return Array.isArray(t)?t.map(e=>
651Mn(e)).filter(Boolean):[]}function Al(t,e=14){const n=Mn(t).split(" ").filter(Boolean);return n.length<=e?n.join(" "):`${n.slice(0,e).join(" ")}...`}function Ey(t){const e=String(t??"").trim();if(!e)return"";const n=e.match(/(\d{4})-(\d{2})-(\d{2})/);if(n)return Lx(`${n[1]}-${n[2]}-${n[3]}`);const r=Cy(e);if(r)return Lx(r);const i=new Date(e);return Number.isNaN(i.getTime())?e:new Intl.DateTimeFormat("hr-HR",{day:"2-digit",month:"2-digit",year:"numeric"}).format(i)}function Rm(...t){for(const e of t){const n=String(e??"").trim();if(!n)continue;const r=Cy(n);if(r){const s=Date.parse(`${r}T00:00:00`);if(Number.isFinite(s))return s}const i=Date.parse(n);if(Number.isFinite(i))return i}return 0}function Y$(t,e){const n=t.find(s=>s.type==="heading"&&Mn(s.text));if((n==null?void 0:n.type)==="heading")return Mn(n.text);const r=t.find(s=>s.type==="paragraph"&&nl(s.text));if((r==null?void 0:r.type)==="paragraph")return Al(nl(r.text));const i=t.find(s=>s.type==="list"&&s.items.some(o=>nl(o)));if((i==null?void 0:i.type)==="list"){const s=i.items.map(nl).find(Boolean);if(s)return Al(s)}return e}function Q$(t){for(const e of t){if(e.type==="paragraph"){const n=nl(e.text);if(n)return Al(n,32)}if(e.type==="list"){const n=e.items.map(nl).find(Boolean);if(n)return Al(n,32)}}return""}function X$(t){const e=Number((t==null?void 0:t.vijest_id)??(t==null?void 0:t.id)??0);return Number.isFinite(e)&&e>0?e:0}function eB(t){const e=Number((t==null?void 0:t.projekt_id)??(t==null?void 0:t.id)??0);return Number.isFinite(e)&&e>0?e:0}function T1(t,e,n){const r={};for(const i of Array.isArray(t)?t:[]){const s=n(i.kljuc_taba);if(!s||!e.has(s)||r[s])continue;const o=$u(i);o.length>0&&(r[s]=o)}return r}function tB(t,e={}){const n=Number((t==null?void 0:t.vijest_id)??(t==null?void 0:t.id)??0);if(!Number.isFinite(n)||n<=0)return null;const r=EE(t==null?void 0:t.odlomci),i=Mn(t==null?void 0:t.sazetak),s=Mn(t==null?void 0:t.naslov)||Al(r[0]||i)||`Vijest #${n}`,o=e[n]??[];return{id:`news-${n}`,kind:"news",sourceId:n,title:s,subtitle:"Vijesti",date:Ey((t==null?void 0:t.datum_objave_tekst)||(t==null?void 0:t.datum_objave)),body:r.length>0?r:[i].filter(Boolean),blocks:o.length>0?o:void 0,route:"vijesti",sortValue:Rm(t==null?void 0:t.datum_objave,t==null?void 0:t.datum_objave_tekst,t==null?void 0:t.azurirano_u,t==null?void 0:t.kreirano_u)}}function nB(t,e={}){const n=Number((t==null?void 0:t.projekt_id)??(t==null?void 0:t.id)??0);if(!Number.isFinite(n)||n<=0)return null;const r=EE(t==null?void 0:t.odlomci),i=Mn(t==null?void 0:t.sazetak),s=Mn(t==null?void 0:t.naslov)||Al(r[0]||i)||`Projekt #${n}`,o=e[n]??[];return{id:`project-${n}`,kind:"project",sourceId:n,title:s,subtitle:"Projekti",body:r.length>0?r:[i].filter(Boolean),blocks:o.length>0?o:void 0,route:"projekti",sortValue:Rm(t==null?void 0:t.azurirano_u,t==null?void 0:t.kreirano_u)}}function rB(t){const e=Number((t==null?void 0:t.prezentacija_id)??(t==null?void 0:t.id)??0);if(!Number.isFinite(e)||e<=0)return null;const n=Mn((t==null?void 0:t.ppt_url)??(t==null?void 0:t.dokument_url)??(t==null?void 0:t.putanja_ili_url)),r=Mn((t==null?void 0:t.autor)||(t==null?void 0:t.opis)),i=Mn(t==null?void 0:t.opis),s=Mn(t==null?void 0:t.naslov)||Mn(t==null?void 0:t.ppt_naziv_datoteke)||`Prezentacija #${e}`;return{id:`prezentacija-${e}`,kind:"prezentacija",sourceId:e,title:s,subtitle:r?`Autor/i: ${r}`:"Prezentacije",date:Ey((t==null?void 0:t.datum_prikaz)||(t==null?void 0:t.datum_prezentacije)),body:[r?`Autor/i: ${r}`:"",i&&i!==r?i:""].filter(Boolean),route:"strucno-prezentacije",url:n&&n!=="#"?ui(n):"",sortValue:Rm(t==null?void 0:t.datum_prezentacije,t==null?void 0:t.datum_prikaz,t==null?void 0:t.azurirano_u,t==null?void 0:t.kreirano_u)}}function iB(t,e,n){const r=El(t.route_slug);if(!r)return null;const i=String(t.kljuc_taba||"").trim();if(i.startsWith(Qo)||i.startsWith(Xo))return null;const s=e[r]||qp[r]||r,o=i&&i!==Yp?n(r,i):"",a=o?`${s} / ${o}`:s,l=$u(t),u=Q$(l);return{id:`article-${t.unos_id}`,kind:"article",unosId:t.unos_id,title:Y$(l,s),subtitle:a,date:Ey(t.objavljeno_u||t.azurirano_u),route:r,blocks:l,body:u?[u]:[],sortValue:Rm(t.objavljeno_u,t.azurirano_u,t.kreirano_u)}}async function Hg(t){const e=[];for(let r=1;r<=50;r+=1){const i=await Dc(t,{status:"arhivirano",include_paragraphs:!0,limit:200,page:r,sort:"redoslijed",dir:"desc"}),s=Array.isArray(i.items)?i.items:[];e.push(...s);const o=Number(i.limit||200),a=Number.isFinite(o)&&o>0?o:200;if(s.length<a)break}return e}async function A1(t,e,n){const r=await ou({route_slug:t,tab:e,include_blocks:!1,sort:"redoslijed",dir:"desc",limit:1,page:1}),i=Array.isArray(r.items)?r.items[0]:null,s=Number((i==null?void 0:i.unos_id)||0);s>0&&await li(s,{status_unosa:n}
651)}function sB(t){return[...t].sort((e,n)=>{const r=Number(n.sortValue||0)-Number(e.sortValue||0);return r!==0?r:e.title.localeCompare(n.title,"hr",{sensitivity:"base"})})}const Io="Hrvatska komora inženjera Å¡umarstva i drvne tehnologije",Vg="HKIÅ DT",oB="Službene stranice Hrvatske komore inženjera Å¡umarstva i drvne tehnologije: vijesti, projekti, obrasci, imenici i struÄno usavrÅ¡avanje.",aB=["HKIÅ DT","Hrvatska komora inženjera Å¡umarstva i drvne tehnologije","inženjeri Å¡umarstva","drvna tehnologija","vijesti","projekti","struÄno usavrÅ¡avanje","licenciranje","obrasci","imenik"],lB=new Set(["profil-clana","datoteka-nije-pronadena"]),Kg={vijesti:"Najnovije vijesti i obavijesti Hrvatske komore inženjera Å¡umarstva i drvne tehnologije.","o-komori":"Informacije o Hrvatskoj komori inženjera Å¡umarstva i drvne tehnologije.","struktura-komore":"Organizacijska struktura i tijela Hrvatske komore inženjera Å¡umarstva i drvne tehnologije.","akti-komore":"Temeljni i provedbeni akti Komore dostupni za pregled i preuzimanje.","zakoni-propisi":"Relevantni zakoni i propisi za podruÄje Å¡umarstva i drvne tehnologije.","operativne-informacije":"Operativne informacije, zapisnici i izbori Komore.","e-savjetovanje":"Savjetovanja i ukljuÄivanje struke u zakonodavne i operativne procese.","natjecaji-burza-rada":"NatjeÄaji i burza rada za Älanove i struÄnjake.","izdanja-komore":"Publikacije i izdanja Hrvatske komore inženjera Å¡umarstva i drvne tehnologije.",ispiti:"Informacije o struÄnim ispitima.",upis:"Informacije o upisu i uvjetima za kandidate.",licenciranje:"Postupci i uvjeti licenciranja ovlaÅ¡tenih inženjera.",cekici:"Informacije vezane uz ÄekiÄe i identifikacijske oznake.",popratnice:"Informacije o popratnicama i pripadajuÄim obrascima.","racunalne-baze":"RaÄunalne baze i digitalni alati dostupni Älanstvu.",imenik:"Imenik ovlaÅ¡tenih inženjera Å¡umarstva i drvne tehnologije.","upisnik-licencija":"Upisnik licenci i provjera statusa licenci.",obrasci:"Službeni obrasci za preuzimanje i uporabu.",strucno:"Pravilnik i program struÄnog usavrÅ¡avanja.","strucno-dogadaji":"Najave i informacije o struÄnim dogaÄanjima.","strucno-prezentacije":"Arhiva struÄnih prezentacija i materijala za preuzimanje.",projekti:"Projekti Hrvatske komore inženjera Å¡umarstva i drvne tehnologije.",kontakti:"Kontakt podaci Hrvatske komore inženjera Å¡umarstva i drvne tehnologije."};function cB(t){const e=String(t||"").trim();if(!e)return"";try{const n=new URL(e);return`${n.protocol}//${n.host}`}catch{return""}}function uB(t){return/^https?:\/\//i.test(String(t||"").trim())}function Ms(t){const e=String(t||"").trim();if(!e)return;const n=new Date(e);if(!Number.isNaN(n.getTime()))return n.toISOString()}function dB(){const{lang:n}=QS(),[r,i]=h.useState("vijesti"),[s,o]=h.useState(!1),[a,l]=h.useState(0),[u,d]=h.useState(null),[f,p]=h.useState(!1),[m,g]=h.useState([]),[y,j]=h.useState(!1),[x,k]=h.useState(""),[N,C]=h.useState(null),[w,E]=h.useState(null),[D,L]=h.useState(null),[V,te]=h.useState(null),[ae,ke]=h.useState(4),[ge,Se]=h.useState(4),[me,H]=h.useState(!1),[P,z]=h.useState(!1),[Y,Q]=h.useState(!1),[O,U]=h.useState(null),[$,J]=h.useState(!1),[ie,oe]=h.useState(""),[be,Ee]=h.useState([]),[le,Me]=h.useState({}),[_,ce]=h.useState({}),[de,De]=h.useState(null),[Oe,He]=h.useState(!1),[ot,Ge]=h.useState(""),[Te,Ke]=h.useState(!1),[Ne,_e]=h.useState(""),{loginEmail:We,loginPassword:tt,loginError:at,setLoginEmail:Ut,setLoginPassword:vt,setLoginError:b,isAdminLoggedIn:T,activeAdminDisplayName:S,isMemberLoggedIn:I,activeMember:K,handleProfileLogin:X,handleAdminLogout:G,handleMemberLogout:re}=xR({onAdminLogin:()=>{z(!1)},onMemberLogin:()=>{z(!1),i("profil-clana")},onMemberLogout:()=>{i("vijesti")}}),pe=h.useRef(r);h.useEffect(()=>{const A=pe.current;pe.current=r,I&&r!=="profil-clana"&&A==="profil-clana"&&re()},[I,r,re]);const{newsCardItems:ue,archivedNewsItems:Ve,newsDetailBlocksById:Fe,newsCardsLoaded:et,projectsCardItems:qe,projectCardsLoaded:jn,hasMoreProjectPages:wn,projectDetailBlocksById:Sn,prezentacijeItems:Ye,prezentacijeCardsLoaded:Ht,hasMorePrezentacijePages:_t,selectedNewsId:it,selectedNews:Qe,visibleNews:On,hasMoreNews:wr,setSelectedNewsId:en,ensureNewsCardsLoaded:tn,ensureAllNewsCardsLoaded:yo,ensureNewsItemLo
651aded:Nn,ensureProjectCardsLoaded:Vr,ensureAllProjectCardsLoaded:Wn,ensureProjectCardsCountLoaded:zi,ensureProjectItemLoaded:nn,ensurePrezentacijeCardsLoaded:Kr,ensureAllPrezentacijeCardsLoaded:Sr,ensurePrezentacijeCardsCountLoaded:Wr,ensurePrezentacijaItemLoaded:Gr,ensureNewsDetailLoaded:Jt,ensureProjectDetailLoaded:rn,loadMoreNews:Pi,ensureNewsVisibleById:or,ensureNewsVisibleCount:cs,resetNewsList:di,createNewsCard:ko,archiveNewsCard:us,unarchiveNewsCard:ga,deleteNewsCard:ds,moveNewsCard:$l,reorderNewsCard:jo,updateNewsCard:Je,createProjectCard:Bl,archiveProjectCard:Fl,deleteProjectCard:ba,updateProjectCard:Ul,reorderProjectCard:xa,createPrezentacijaCard:fs,archivePrezentacijaCard:qr,deletePrezentacijaCard:R,updatePrezentacijaCard:W,movePrezentacijaCard:Z,reorderPrezentacijaCard:ee}=ZR(T);h.useEffect(()=>{T||Q(!1)},[T]);const xe=h.useCallback(async A=>{He(!0),Ge("");try{const B=await JL();if(!A())return;De(B)}catch(B){if(!A())return;De(null),Ge(jc(B,"NeuspjeÅ¡no uÄitavanje export audita."))}finally{if(!A())return;He(!1)}},[]);h.useEffect(()=>{let A=!0;return T?(xe(()=>A),()=>{A=!1}):(De(null),He(!1),Ge(""),Ke(!1),_e(""),()=>{A=!1})},[T,xe]);const fe=h.useCallback(async A=>{if(!Te){Ke(!0),Ge(""),_e("");try{const B=await ZL(A);De(B),_e("Export je uspjeÅ¡no povuÄen.")}catch(B){Ge(jc(B,"PovlaÄenje exporta nije uspjelo.")),_e("")}finally{Ke(!1)}}},[Te]),[Pe,$e]=h.useState("temeljni"),[ct,_n]=h.useState("sumarstvo"),[gt,Gn]=h.useState("sumarstvo"),[Ln,Nr]=h.useState("sumarstvo-lovstvo"),[sn,Vt]=h.useState("zapisnici"),{adminArticlesByRoute:Cr,setAdminArticlesByRoute:Di,adminExternalDraftBlocks:$m,setAdminExternalDraftBlocks:Qu,adminExternalDraftRequestId:Bm,setAdminExternalDraftRequestId:Fm,adminEditorModalOpen:Hl,setAdminEditorModalOpen:Xu,adminEditorMode:Um,setAdminEditorMode:va,adminEditTarget:St,setAdminEditTarget:Vl,adminPageEditContext:fi,setAdminPageEditContext:Kl,adminRouteEditContext:Oi,setAdminRouteEditContext:Jr,subnavDraftContext:pi,setSubnavDraftContext:mi,openAdminDraft:Wl,openAdminAddForTarget:Gl,openAdminAddForRoute:Hm,closeAdminEditor:Vm}=TR(),[ar,ps]=h.useState({}),[hi,_i]=h.useState({}),{getBaseRouteArticles:qn,getSubnavBaseSections:gi,getSubnavLabel:ms,getEmptyNoticeMessage:ed,subnavTabIdsByRoute:wo,aktiIntroBlocks:So,aktiTabBlocks:Km,obrasciIntroBlocks:Wm,obrasciTabBlocks:Gm,imenikTabBlocks:td,upisnikLicencijaTabBlocks:Li,operativneZapisniciBlocks:No,operativneIzboriBlocks:nd}=n$(),rd=h.useMemo(()=>be.length>0?be:A4,[be]),Er=h.useMemo(()=>({...qp,...le}),[le]),hs=h.useCallback(async()=>{j(!0),k("");try{const[A,B,ne,we,Ie,Re,st,pt]=await Promise.all([Hg("vijesti"),Hg("projekti"),Hg("prezentacije"),za({status:"arhivirano",include_blocks:!0,exclude_tab_prefix:[Qo,Xo],sort:"azurirano_u",dir:"desc"},{pageSize:100,maxPages:50}),za({route_slug:"vijesti",status:"arhivirano",include_blocks:!0,sort:"azurirano_u",dir:"desc"},{pageSize:100,maxPages:50}),za({route_slug:"vijesti",status:"objavljeno",include_blocks:!0,sort:"azurirano_u",dir:"desc"},{pageSize:100,maxPages:50}),za({route_slug:"projekti",status:"arhivirano",include_blocks:!0,sort:"azurirano_u",dir:"desc"},{pageSize:100,maxPages:50}),za({route_slug:"projekti",status:"objavljeno",include_blocks:!0,sort:"azurirano_u",dir:"desc"},{pageSize:100,maxPages:50})]),jt=new Set(A.map(X$).filter(mt=>mt>0)),ys=new Set(B.map(eB).filter(mt=>mt>0)),xi=T1([...Ie,...Re],jt,yR),Ta=T1([...st,...pt],ys,kR),fn=[...A.map(mt=>tB(mt,xi)),...B.map(mt=>nB(mt,Ta)),...ne.map(rB),...we.map(mt=>iB(mt,Er,ms))].filter(mt=>!!mt);g(sB(fn))}catch(A){console.error("Dohvat arhive nije uspio:",A),k(jc(A,"Arhiva se trenutno ne može uÄitati.")),g([])}finally{j(!1)}},[Er,ms]);h.useEffect(()=>{let A=!0;return(async()=>{const[B,ne,we]=await Promise.allSettled([g4(),b4(!0),y4()]);if(A){if(B.status==="fulfilled"){const Ie=J$(B.value);Ie.length>0&&Ee(Ie)}else console.error("Dohvat navigacije nije uspio:",B.reason);if(ne.status==="fulfilled"){const Ie={};for(const Re of Array.isArray(ne.value)?ne.value:[]){const st=El(Re==null?void 0:Re.slug);if(!st)continue;const pt=_x(Re==null?void 0:Re.naziv_hr,_x(Re==null?void 0:Re.naziv_en,""));pt&&(Ie[st]=pt)}Object.keys(Ie).length>0&&Me(Re=>({...Re,...Ie}))}else console.error("Dohvat ruta nije uspio:",ne.reason);if(we.status==="fulfilled"){const Ie={};for(const Re of Array.isArray(we.value)?we.value:[]){const st=String((Re==null?void 0:Re.kljuc)||"").trim();st&&(Ie[st]=Z$(Re==null?void 0:Re.vrijednost_json))}Object.keys(Ie).length>0&&ce(Ie)}else console.error("Dohvat postavki nije uspio:",we.reason)}})(),()=>{A=!1}},[]);const ql=h.useRef({}),ya=h.useRef({}),Jl=h.useRef(0),id=T?"admin":"public",[sd,ka]=h.useState({}),[qm,ja]=h.useState({}),lr=h.useCallback(async(A,B=!1)=>{const ne=`${id}:${A}`,we=Jl.current;if(!B&&ql.current[ne]){ka(Re=>Re[A]?Re:{...Re,[A]:!0});return}if(!B){const Re=ya.current[ne];if(Re){await Re;return}}ja(Re=>({...Re,[A]:!0}));const Ie=(async()=>{try{const Re=await za({route_slug:A,include_blocks:!0,exclude_tab_prefix:[Qo,Xo],status:T?void 0:"objavljeno",sort:"redoslijed",dir:"desc"},{pageSize:100,maxPages:20}),st=[],pt={};for(const jt of Re){const ys=El(jt.route_slug);
651if(!ys||ys!==A||String(jt.status_unosa||"").trim().toLowerCase()==="arhivirano")continue;const xi=ts(jt.kreirao_korisnicko_ime)??null,Ta=ts(jt.azurirao_korisnicko_ime)??ts(jt.kreirao_korisnicko_ime)??null,fn=T&&(xi||Ta)?{createdBy:xi,createdAt:jt.kreirano_u??null,updatedBy:Ta,updatedAt:jt.azurirano_u??jt.kreirano_u??null}:void 0,mt={id:Tf(jt.unos_id),blocks:$u(jt),status:jt.status_unosa,...fn?{audit:fn}:{}},on=String(jt.kljuc_taba||"").trim();if(ys==="vijesti"&&on.startsWith(Qo)||ys==="projekti"&&on.startsWith(Xo))continue;if(on===Yp||!on){st.push(mt);continue}const ks=pt[on]??[];pt[on]=[...ks,mt]}if(Jl.current!==we)return;ps(jt=>({...jt,[A]:st})),_i(jt=>({...jt,[A]:pt})),ql.current[ne]=!0,ka(jt=>({...jt,[A]:!0}))}catch(Re){console.error(`Dohvat web sadrzaja za rutu "${A}" nije uspio:`,Re),ka(st=>({...st,[A]:!0}))}finally{ja(Re=>({...Re,[A]:!1})),delete ya.current[ne]}})();ya.current[ne]=Ie,await Ie},[T,id]),Zl=h.useCallback(async A=>{if(!(!T||N)){C(A.id),k("");try{if(A.kind==="news"&&A.sourceId){await pn("vijesti",A.sourceId,{status_vijesti:"objavljeno"});try{await A1("vijesti",Oc(A.sourceId),"objavljeno")}catch(B){console.error("Odarhiviranje detalja vijesti nije uspjelo:",B)}await Promise.all([tn(!0),Jt(A.sourceId,!0)])}else if(A.kind==="project"&&A.sourceId){await pn("projekti",A.sourceId,{status_projekta:"objavljeno"});try{await A1("projekti",$a(A.sourceId),"objavljeno")}catch(B){console.error("Odarhiviranje detalja projekta nije uspjelo:",B)}await Promise.all([Vr(!0),rn(A.sourceId,!0)])}else A.kind==="prezentacija"&&A.sourceId?(await pn("prezentacije",A.sourceId,{status_prezentacije:"objavljeno"}),await Kr(!0)):A.kind==="article"&&A.unosId&&(await li(A.unosId,{status_unosa:"objavljeno"}),A.route&&await lr(A.route,!0));await hs()}catch(B){console.error("Odarhiviranje iz arhive nije uspjelo:",B),k(jc(B,"Odarhiviranje nije uspjelo."))}finally{C(null)}}},[tn,Jt,Kr,Vr,rn,N,T,hs,lr]);h.useEffect(()=>{Jl.current+=1,ql.current={},ya.current={},ka({}),ja({}),Di({}),ps({}),_i({})},[T,Di]),h.useEffect(()=>{lr(r)},[r,lr]),h.useEffect(()=>{if(r==="vijesti"){tn();return}if(r==="projekti"){Vr();return}r==="strucno-prezentacije"&&Kr()},[r,tn,Vr,Kr]),h.useEffect(()=>{r==="vijesti"&&it&&Jt(it)},[r,it,Jt]),h.useEffect(()=>{r==="projekti"&&V&&rn(V)},[r,V,rn]);const{heroConfig:gs,heroLoadedForRoute:bi,heroEditorOpen:od,heroSaving:Yl,heroSaveError:Jm,heroDraftFileName:Zm,heroDraftTitle:Ym,heroDraftKicker:Qm,heroDraftAlt:Xm,setHeroDraftTitle:ad,setHeroDraftKicker:Ql,setHeroDraftAlt:eh,onImageSelect:ld,onResetImageToDefault:th,openHeroEditor:cd,closeHeroEditor:Co,saveHero:ud}=ER({route:r}),Xl=r!=="profil-clana"&&r!=="pristup-informacijama"&&r!=="osiguranje-clanova"&&r!=="zastita-osobnih-podataka"&&r!=="uvjeti-koristenja"&&r!=="pravila-privatnosti",Ri=r==="projekti"&&n==="en",wa=r==="o-komori"&&n==="en",$i=Ri||wa,dd=Ri?"PROJECTS":wa?"ABOUT THE CHAMBER":gs.title,ec=bi?dd:"",nh=bi?gs.kicker:void 0,fd=Ri?"Projects":wa?"About the chamber":gs.alt,Zr=Ri?"Projects":wa?"About the chamber":r==="ispiti"?"StruÄni ispiti":Er[r],bs=B$.includes(r),{adminArticlesSection:tc,renderEditableArticles:rh,renderSubnavArticles:ih,adminArticlesForCurrentRoute:sh,deleteConfirmModal:oh}=SR({route:r,isAdminLoggedIn:T,isAdminEditorDisabled:bs,adminArticlesByRoute:Cr,setAdminArticlesByRoute:Di,routeArticleOverrides:ar,setRouteArticleOverrides:ps,subnavArticleOverrides:hi,setSubnavArticleOverrides:_i,getBaseRouteArticles:qn,getSubnavBaseSections:gi,getEmptyNoticeMessage:ed,setAdminExternalDraftBlocks:Qu,setAdminExternalDraftRequestId:Fm,setAdminEditorMode:va,setAdminEditTarget:Vl,setAdminPageEditContext:Kl,setAdminRouteEditContext:Jr,setSubnavDraftContext:mi,setAdminEditorModalOpen:Xu,onDeleteRouteArticle:async(A,B,ne)=>{const we=Gs(B);if(we)try{await Wp(we)}catch(st){console.error("Brisanje sadržaja nije uspjelo:",st);return}if(ne==="admin"){Di(st=>({...st,[A]:(st[A]??[]).filter(pt=>pt.id!==B)}));return}const Ie=qn(A),Re=ar[A]??Ie;ps(st=>({...st,[A]:Re.filter(pt=>pt.id!==B)}))},onDeleteSubnavArticle:async(A,B,ne)=>{var st;const we=Gs(ne);if(we)try{await Wp(we)}catch(pt){console.error("Brisanje podnav sadržaja nije uspjelo:",pt);return}const Ie=gi(A,B),Re=((st=hi[A])==null?void 0:st[B])??Ie;_i(pt=>({...pt,[A]:{...pt[A]??{},[B]:Re.filter(jt=>jt.id!==ne)}}))},onArchiveRouteArticle:async(A,B,ne)=>{const we=Gs(B);if(we)try{await li(we,{status_unosa:"arhivirano"})}catch(st){console.error("Arhiviranje sadržaja nije uspjelo:",st);return}if(ne==="admin"){Di(st=>({...st,[A]:(st[A]??[]).filter(pt=>
651pt.id!==B)}));return}const Ie=qn(A),Re=ar[A]??Ie;ps(st=>({...st,[A]:Re.filter(pt=>pt.id!==B)}))},onArchiveSubnavArticle:async(A,B,ne)=>{var st;const we=Gs(ne);if(we)try{await li(we,{status_unosa:"arhivirano"})}catch(pt){console.error("Arhiviranje podnav sadržaja nije uspjelo:",pt);return}const Ie=gi(A,B),Re=((st=hi[A])==null?void 0:st[B])??Ie;_i(pt=>({...pt,[A]:{...pt[A]??{},[B]:Re.filter(jt=>jt.id!==ne)}}))}}),{adminModalTitle:ah,handleEditNewsFromCard:Bi,handleEditProjectFromCard:nc,handleExternalDraftPublish:Sa}=o$({route:r,pageTitleByRoute:Er,getSubnavLabel:ms,getBaseRouteArticles:qn,getSubnavBaseSections:gi,adminEditTarget:St,adminPageEditContext:fi,adminRouteEditContext:Oi,subnavDraftContext:pi,activeAdminDisplayName:S,routeArticleOverrides:ar,subnavArticleOverrides:hi,adminArticlesByRoute:Cr,defaultCardImage:au,defaultNewsImage:Br,newsCardItems:ue,newsDetailBlocksById:Fe,ensureNewsDetailLoaded:Jt,projectsCardItems:qe,projectDetailBlocksById:Sn,ensureProjectDetailLoaded:rn,prezentacijeItems:Ye,createNewsCard:ko,updateNewsCard:Je,createProjectCard:Bl,updateProjectCard:Ul,createPrezentacijaCard:fs,updatePrezentacijaCard:W,setRouteArticleOverrides:ps,setSubnavArticleOverrides:_i,setAdminArticlesByRoute:Di,setAdminEditorModalOpen:Xu,setAdminEditorMode:va,setAdminEditTarget:Vl,setAdminPageEditContext:Kl,setAdminRouteEditContext:Jr,setSubnavDraftContext:mi,setAdminExternalDraftBlocks:Qu,openAdminDraft:Wl}),rc=h.useCallback(async(A,B)=>{const ne=new Set([r]),we=(St==null?void 0:St.type)??null;fi!=null&&fi.route&&ne.add(fi.route),Oi!=null&&Oi.route&&ne.add(Oi.route),pi!=null&&pi.route&&ne.add(pi.route),we==="news"&&ne.add("vijesti"),we==="project"&&ne.add("projekti"),we==="prezentacija"&&ne.add("strucno-prezentacije"),await Sa(A,B);const Ie=[];for(const Re of ne)Ie.push(lr(Re,!0));ne.has("vijesti")&&Ie.push(tn(!0)),ne.has("projekti")&&Ie.push(Vr(!0)),ne.has("strucno-prezentacije")&&Ie.push(Kr(!0)),Ie.length>0&&await Promise.allSettled(Ie)},[St,fi,Oi,pi,r,Sa,lr,tn,Vr,Kr]),ic=h.useMemo(()=>{const A=(B,ne)=>{const we=E1(B);if(!we)return!1;const Ie=E1(ne);return!Ie||we!==Ie};if((St==null?void 0:St.type)==="news"){const B=ue.find(we=>we.id===St.id)??null,ne=String((B==null?void 0:B.cardImage)||"").trim();return{enabled:!0,initialImageSrc:A(ne,Br)?ne:null}}if((St==null?void 0:St.type)==="project"){const B=qe.find(we=>we.id===St.id)??null,ne=String((B==null?void 0:B.cardImage)||"").trim();return{enabled:!0,initialImageSrc:A(ne,au)?ne:null}}return{enabled:!1,initialImageSrc:null}},[St,ue,qe]),sc=h.useMemo(()=>Object.keys(Er),[Er]);h.useEffect(()=>{me&&(async()=>await Promise.allSettled([yo(),Wn(),Sr(),hs(),...sc.map(A=>lr(A))]))()},[me,sc,lr,hs,yo,Wn,Sr]);const pd=h.useMemo(()=>Y4({pageTitleByRoute:Er,getBaseRouteArticles:qn,getSubnavBaseSections:gi,getSubnavLabel:ms,subnavTabIdsByRoute:wo,routeArticleOverrides:ar,subnavArticleOverrides:hi,adminArticlesByRoute:Cr,newsCardItems:ue,archivedNewsItems:Ve,archivedItems:m,projectsCardItems:qe,prezentacijeItems:Ye}),[Cr,Ve,m,qn,gi,ms,ue,Er,Ye,qe,ar,hi,wo]),md=h.useMemo(()=>{const A=ar[r]??qn(r),B=jf(A).some(we=>String(we.status||"").trim().toLowerCase()!=="arhivirano"),ne=jf(Cr[r]??[]).some(we=>String(we.status||"").trim().toLowerCase()!=="arhivirano");return B||ne},[Cr,qn,r,ar]),v=sd[r]===!0,M=qm[r]===!0,q=(!v||M||!(r==="vijesti"?et:r==="projekti"?jn:r==="strucno-prezentacije"?Ht:!0))&&!me,se=Zr?`UÄitavam: ${Zr}`:"UÄitavam sadržaj stranice...",Ce=h.useMemo(()=>it?Fe[it]??null:null,[Fe,it]),je=h.useMemo(()=>V?qe.find(A=>A.id===V)??null:null,[qe,V]),dt=h.useMemo(()=>V?Sn[V]??null:null,[Sn,V]),ht=h.useMemo(()=>r==="akti-komore"?Pe:r==="obrasci"?ct:r==="imenik"?gt:r==="upisnik-licencija"?Ln:r==="operativne-informacije"?sn:"",[r,Pe,ct,gt,Ln,sn]),Mt=h.useMemo(()=>{var A,B,ne,we,Ie,Re,st;if(r==="vijesti"&&(Ce!=null&&Ce.length))return Ce;if(r==="projekti"&&(dt!=null&&dt.length))return dt;if(r==="strucno-prezentacije")return((B=(A=ar[r])==null?void 0:A[0])==null?void 0:B.blocks)??((ne=qn(r)[0])==null?void 0:ne.blocks)??[];if(ht){const pt=((we=hi[r])==null?void 0:we[ht])??gi(r,ht);if(pt.length>0)return pt[0].blocks}return((Re=(Ie=ar[r])==null?void 0:Ie[0])==null?void 0:Re.blocks)??((st=qn(r)[0])==null?void 0:st.blocks)??[]},[r,ht,Ce,dt,ar,hi,qn,gi]),Xe=h.useMemo(()=>{const A=cB("");return A||(typeof window<"u"&&String(window.location.origin||"").trim()?window.location.origin:"https://hkisdt.hr")},[]),Nt=h.useMemo(()=>Zr||Er[r]||qp[r]||"Vijesti",[Zr,Er,r]),Yr=h.useMemo(()=>Rc({route:r,view:r==="vijesti"?"news-list":r==="projekti"?"project-list":void 0,aktiTab:r==="akti-komore"?Pe:void 0,obrasciTab:r==="obrasci"?ct:void 0,imenikTab:r==="imenik"?gt
651:void 0,upisnikLicencijaTab:r==="upisnik-licencija"?Ln:void 0,operativneTab:r==="operativne-informacije"?sn:void 0,preferNewsRoot:!0}),[r,Pe,ct,gt,Ln,sn]),xs=h.useMemo(()=>Rc({route:r,view:r==="vijesti"?it?"news-detail":"news-list":r==="projekti"?V?"project-detail":"project-list":void 0,newsId:it??void 0,projectId:V??void 0,aktiTab:r==="akti-komore"?Pe:void 0,obrasciTab:r==="obrasci"?ct:void 0,imenikTab:r==="imenik"?gt:void 0,upisnikLicencijaTab:r==="upisnik-licencija"?Ln:void 0,operativneTab:r==="operativne-informacije"?sn:void 0,newsSlug:Oy(it??void 0),projectSlug:_y(V??void 0),preferNewsRoot:!0}),[r,it,V,Pe,ct,gt,Ln,sn,Qe==null?void 0:Qe.title,je==null?void 0:je.title,ue.length,qe.length,Ve.length]),Jn=h.useMemo(()=>As(xs,Xe),[xs,Xe]),vs=h.useMemo(()=>r==="vijesti"&&Qe?Ug(Ce,260)||Qe.summary||Kg.vijesti:r==="projekti"&&je?Ug(dt,260)||je.summary||Kg.projekti:Ug(Mt,260)||Kg[r]||oB,[r,Qe,Ce,je,dt,Mt]),hd=h.useMemo(()=>r==="vijesti"&&Qe?`${Qe.title} | Vijesti | ${Vg}`:r==="projekti"&&je?`${je.title} | Projekti | ${Vg}`:`${Nt} | ${Vg}`,[r,Qe,je,Nt]),oc=h.useMemo(()=>{const A=(r==="vijesti"&&Qe?Qe.image:null)||(r==="projekti"&&je?je.image:null)||gs.image||"/assets/logo.svg",B=ui(A);return As(B,Xe)},[r,Qe,je,gs.image,Xe]),Ay=h.useMemo(()=>lB.has(r)?"noindex,nofollow,noarchive":"index,follow,max-image-preview:large,max-snippet:-1,max-video-preview:-1",[r]),My=h.useMemo(()=>{const A=String(r||"").replace(/-/g," ");return Array.from(new Set([...aB,Nt,A])).filter(Boolean)},[r,Nt]),Eo=h.useMemo(()=>{if(r==="vijesti"&&Qe)return Ms(Qe.createdAt)||Ms(Qe.updatedAt);if(r==="projekti"&&je)return Ms(je.createdAt)||Ms(je.updatedAt)},[r,Qe,je]),To=h.useMemo(()=>{if(r==="vijesti"&&Qe)return Ms(Qe.updatedAt)||Ms(Qe.createdAt);if(r==="projekti"&&je)return Ms(je.updatedAt)||Ms(je.createdAt)},[r,Qe,je]),Iy=h.useMemo(()=>{const A=As("/",Xe),B=String(_.footer_address||"").trim().replace(/\bDezelica\b/gi,"DeželiÄa"),ne=String(_.footer_email||"").trim(),we=_.footer_phone_lines??_.footer_phone,Re=(Array.isArray(we)?we:[we]).flatMap(mt=>String(mt||"").split(/\r?\n|;/g)).map(mt=>mt.trim()).filter(Boolean)[0]||"",st=[String(_.footer_linkedin_url||"").trim()||"https://linkedin.com/in/hkisdt"].filter(mt=>uB(mt)),pt=Re||ne?{"@type":"ContactPoint",...Re?{telephone:Re}:{},...ne?{email:ne}:{},contactType:"customer support",areaServed:"HR",availableLanguage:["hr","en"]}:null,jt={"@context":"https://schema.org","@type":"Organization","@id":`${A}#organization`,name:Io,url:A,logo:As("/assets/logo.svg",Xe),...ne?{email:ne}:{},...B?{address:{"@type":"PostalAddress",streetAddress:B,addressCountry:"HR"}}:{},...pt?{contactPoint:[pt]}:{},...st.length>0?{sameAs:st}:{}},ys={"@context":"https://schema.org","@type":"WebSite","@id":`${A}#website`,name:Io,url:A,inLanguage:n==="en"?"en":"hr"},xi=[{name:"Pocetna",item:A}];r!=="vijesti"?xi.push({name:Nt,item:As(Yr,Xe)}):Qe||xi.push({name:"Vijesti",item:Jn}),r==="vijesti"&&Qe&&xi.push({name:Qe.title,item:Jn}),r==="projekti"&&je&&xi.push({name:je.title,item:Jn});const Ta={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:xi.map((mt,on)=>({"@type":"ListItem",position:on+1,name:mt.name,item:mt.item}))},fn=[jt,ys,Ta];if(r==="vijesti"&&Qe)return fn.push({"@context":"https://schema.org","@type":"NewsArticle",headline:Qe.title,description:vs,image:[oc],mainEntityOfPage:Jn,inLanguage:n==="en"?"en":"hr",...Eo?{datePublished:Eo}:{},...To?{dateModified:To}:{},author:{"@type":"Organization",name:Io},publisher:{"@type":"Organization",name:Io,logo:{"@type":"ImageObject",url:As("/assets/logo.svg",Xe)}}}),fn;if(r==="projekti"&&je)return fn.push({"@context":"https://schema.org","@type":"Article",headline:je.title,description:vs,image:[oc],mainEntityOfPage:Jn,inLanguage:n==="en"?"en":"hr",...Eo?{datePublished:Eo}:{},...To?{dateModified:To}:{},author:{"@type":"Organization",name:Io},publisher:{"@type":"Organization",name:Io}}),fn;if(r==="vijesti"&&!Qe){const mt=ue.filter(on=>{const ks=String(on.status||"").trim().toLowerCase();return!ks||ks==="objavljeno"});return mt.length>0&&(fn.push({"@context":"https://schema.org","@type":"CollectionPage",name:Nt,description:vs,url:Jn,inLanguage:n==="en"?"en":"hr"}),fn.push({"@context":"https://schema.org","@type":"ItemList",name:"Vijesti",itemListOrder:"https://schema.org/ItemListOrderDe
651scending",numberOfItems:Math.min(mt.length,20),itemListElement:mt.slice(0,20).map((on,ks)=>({"@type":"ListItem",position:ks+1,name:on.title,url:As(Rc({route:"vijesti",view:"news-detail",newsId:on.id,newsSlug:on.title,preferNewsRoot:!0}),Xe)}))})),fn}if(r==="projekti"&&!je){const mt=qe;return mt.length>0&&(fn.push({"@context":"https://schema.org","@type":"CollectionPage",name:Nt,description:vs,url:Jn,inLanguage:n==="en"?"en":"hr"}),fn.push({"@context":"https://schema.org","@type":"ItemList",name:"Projekti",itemListOrder:"https://schema.org/ItemListOrderDescending",numberOfItems:Math.min(mt.length,20),itemListElement:mt.slice(0,20).map((on,ks)=>({"@type":"ListItem",position:ks+1,name:on.title,url:As(Rc({route:"projekti",view:"project-detail",projectId:on.id,projectSlug:on.title,preferNewsRoot:!0}),Xe)}))})),fn}return fn.push({"@context":"https://schema.org","@type":"WebPage",name:hd,description:vs,url:Jn,inLanguage:n==="en"?"en":"hr"}),fn},[Xe,_,n,r,Nt,Qe,je,ue,qe,Jn,Yr,vs,oc,Eo,To,hd]);h.useEffect(()=>{z$({lang:n,title:hd,description:vs,canonicalUrl:Jn,robots:Ay,siteName:Io,imageUrl:oc,imageAlt:Nt,type:r==="vijesti"&&Qe||r==="projekti"&&je?"article":"website",keywords:My,publishedTime:Eo,modifiedTime:To,jsonLd:Iy})},[n,r,Qe,je,hd,vs,Jn,Ay,oc,Nt,My,Eo,To,Iy]),h.useEffect(()=>{if(!(!V||qe.some(B=>B.id===V))){if(wn){nn(V);return}te(null)}},[qe,V,wn,nn]),h.useEffect(()=>{ke(A=>A<4?4:A)},[qe.length]),h.useEffect(()=>{r==="projekti"&&zi(ae)},[r,ae,zi]),h.useEffect(()=>{r==="strucno-prezentacije"&&Wr(ge)},[r,ge,Wr]),h.useEffect(()=>{Se(A=>A<4?4:A)},[Ye.length]),h.useEffect(()=>{const A=String(D||"").match(/search-news-(\d+)/);if(!A)return;const B=Number(A[1]);!Number.isFinite(B)||B<=0||(async()=>(await Nn(B),or(B)))()},[D,ue.length,Nn,or]),h.useEffect(()=>{const A=String(D||"").match(/search-project-(\d+)/);if(!A)return;const B=Number(A[1]);!Number.isFinite(B)||B<=0||(async()=>(await nn(B),lh(B)))()},[D,qe.length,nn]),h.useEffect(()=>{const A=String(D||"").match(/search-prezentacija-(\d+)/);if(!A)return;const B=Number(A[1]);!Number.isFinite(B)||B<=0||(async()=>(await Gr(B),gd(B)))()},[D,Ye.length,Gr]),h.useEffect(()=>{if(!D)return;let A=0,B=0,ne=0;const we=80,Ie=()=>{const Re=document.getElementById(D);if(Re){Re.scrollIntoView({behavior:"smooth",block:"start"}),L(null);return}if(ne+=1,ne>=we){L(null);return}A=window.requestAnimationFrame(Ie)};return B=window.setTimeout(()=>{A=window.requestAnimationFrame(Ie)},50),()=>{window.clearTimeout(B),window.cancelAnimationFrame(A)}},[D,r,Pe,ct,gt,Ln,sn,On.length,qe.length,Ye.length]);const Ao=h.useMemo(()=>O!=null&&O.itemId?Ye.find(A=>A.id===O.itemId)??null:null,[Ye,O]),TE=h.useMemo(()=>(O==null?void 0:O.mode)==="edit"&&Ao?{title:Ao.title,author:Ao.author,date:Cy(Ao.date),documentUrl:Ao.pptUrl,documentName:Ao.documentName}:{},[O,Ao]);function zy(){oe(""),U({mode:"create",itemId:null})}function AE(A){oe(""),U({mode:"edit",itemId:A})}async function ME(A){if(!O)return;const B={title:A.title,author:A.author,description:A.author,date:Lx(A.date),pptUrl:A.documentUrl,documentName:A.documentName};oe(""),J(!0);try{if(O.mode==="edit"&&O.itemId){if(!await W(O.itemId,B))throw new Error("Prezentacija za ureÄivanje nije pronaÄena.")}else if(!await fs(B))throw new Error("Spremanje prezentacije nije uspjelo.");oe(""),U(null)}catch(ne){console.error("Spremanje prezentacije nije uspjelo:",ne),oe(jc(ne,"Spremanje prezentacije nije uspjelo. PokuÅ¡aj ponovno."))}finally{J(!1)}}function lh(A){const B=Number(A||0);if(B<=0)return!1;const ne=qe.findIndex(Ie=>Ie.id===B);if(ne<0)return zi(ae+4),!1;const we=Math.max(4,ne+1);return ke(Ie=>Ie>=we?Ie:(zi(we),we)),!0}function IE(A){const B=Number(A||0);if(!Number.isFinite(B)||B<=0)return;const ne=Math.max(4,Math.floor(B));ke(we=>we>=ne?we:(zi(ne),ne))}function gd(A){const B=Number(A||0);if(B<=0)return!1;const ne=Ye.findIndex(Ie=>Ie.id===B);if(ne<0)return Gr(B),Wr(ge+4),!1;const we=Math.max(4,ne+1);return Se(Ie=>Ie>=we?Ie:(Wr(we),we)),!0}function Py(A){const B=Number(A||0);if(!Number.isFinite(B)||B<=0)return;const ne=Math.max(4,Math.floor(B));Se(we=>we>=ne?we:(Wr(ne),ne))}
651function Dy(A={}){const B=A.route??r;return{__hkisdt_app:!0,route:B,aktiTab:Pe,obrasciTab:ct,imenikTab:gt,upisnikLicencijaTab:Ln,operativneTab:sn,view:B==="vijesti"?it?"news-detail":"news-list":B==="projekti"?V?"project-detail":"project-list":void 0,newsId:it??void 0,scrollNewsId:it??void 0,visibleNewsCount:Math.max(Dr,On.length),projectId:V??void 0,scrollProjectId:V??void 0,visibleProjectCount:Math.max(4,ae),visiblePrezentacijeCount:Math.max(4,ge),searchTargetId:D??null,...A}}function Oy(A){const B=Number(A||0);if(!Number.isFinite(B)||B<=0)return null;if(Qe&&Qe.id===B)return Qe.title;const ne=ue.find(Ie=>Ie.id===B);if(ne!=null&&ne.title)return ne.title;const we=Ve.find(Ie=>Ie.id===B);return we!=null&&we.title?we.title:null}function _y(A){const B=Number(A||0);if(!Number.isFinite(B)||B<=0)return null;if(je&&je.id===B)return je.title;const ne=qe.find(we=>we.id===B);return ne!=null&&ne.title?ne.title:null}function Ly(A){return N1(A,{newsSlug:Oy(A.newsId),projectSlug:_y(A.projectId)})}function bd(A={}){if(typeof window>"u")return;const B=Dy(A);window.history.replaceState(B,"",Ly(B))}function Zn(A={}){if(typeof window>"u")return;const B=Dy(A);window.history.pushState(B,"",Ly(B))}function Na(A,B=!0){const ne=Number(A||0);ne<=0||((async()=>(await Nn(ne),or(ne)))(),Jt(ne),i("vijesti"),te(null),d(null),L(null),B&&(bd({route:"vijesti",view:"news-list",newsId:void 0,scrollNewsId:ne,visibleNewsCount:Math.max(Dr,On.length),searchTargetId:null}),Zn({route:"vijesti",view:"news-detail",newsId:ne,scrollNewsId:ne,searchTargetId:null})),en(ne))}function Ca(A,B,ne=!1){tn(),i("vijesti"),te(null),d(null),en(null),typeof B=="number"&&Number.isFinite(B)&&B>0&&cs(B);const we=Number(A||0);if(we>0){(async()=>(await Nn(we),or(we)))();const Ie=Fn({kind:"news",itemId:we});L(Ie),ne&&Zn({route:"vijesti",view:"news-list",newsId:void 0,scrollNewsId:we,visibleNewsCount:Math.max(Dr,On.length),searchTargetId:Ie});return}L(null),ne&&Zn({route:"vijesti",view:"news-list",newsId:void 0,scrollNewsId:void 0,searchTargetId:null})}function ac(A,B=!0){const ne=Number(A||0);ne<=0||((async()=>(await nn(ne),lh(ne)))(),rn(ne),i("projekti"),en(null),d(null),L(null),B&&(bd({route:"projekti",view:"project-list",projectId:void 0,scrollProjectId:ne,visibleProjectCount:Math.max(4,ae),searchTargetId:null}),Zn({route:"projekti",view:"project-detail",projectId:ne,scrollProjectId:ne,searchTargetId:null})),te(ne))}function Ea(A,B,ne=!1){Vr(),i("projekti"),en(null),d(null),te(null),typeof B=="number"&&Number.isFinite(B)&&B>0&&IE(B);const we=Number(A||0);if(we>0){(async()=>(await nn(we),lh(we)))();const Ie=Fn({kind:"project",itemId:we});L(Ie),ne&&Zn({route:"projekti",view:"project-list",projectId:void 0,scrollProjectId:we,visibleProjectCount:Math.max(4,ae),searchTargetId:Ie});return}L(null),ne&&Zn({route:"projekti",view:"project-list",projectId:void 0,scrollProjectId:void 0,searchTargetId:null})}function zE(A,B=!0){$e(A),B&&Zn({route:"akti-komore",aktiTab:A})}function PE(A,B=!0){_n(A),B&&Zn({route:"obrasci",obrasciTab:A})}function DE(A,B=!0){Gn(A),B&&Zn({route:"imenik",imenikTab:A})}function OE(A,B=!0){Nr(A),B&&Zn({route:"upisnik-licencija",upisnikLicencijaTab:A})}function _E(A,B=!0){Vt(A),B&&Zn({route:"operativne-informacije",operativneTab:A})}h.useEffect(()=>{if(s)return;if(typeof window>"u"){o(!0);return}const A=G$(window.location.pathname,window.location.search),B=A.state;if(A.legacyQuery){const we=N1({route:B.route??"vijesti",aktiTab:B.aktiTab,obrasciTab:B.obrasciTab,imenikTab:B.imenikTab,upisnikLicencijaTab:B.upisnikLicencijaTab,operativneTab:B.operativneTab,view:B.view,newsId:B.newsId,scrollNewsId:B.scrollNewsId,projectId:B.projectId,scrollProjectId:B.scrollProjectId}),Ie=`${window.location.pathname}${window.location.search}`;we&&Ie!==we&&window.history.replaceState(window.history.state,"",we)}const ne=B.route??"vijesti";if(B.aktiTab&&$e(B.aktiTab),B.obrasciTab&&_n(B.obrasciTab),B.imenikTab&&Gn(B.imenikTab),B.upisnikLicencijaTab&&Nr(B.upisnikLicencijaTab),B.operativneTab&&Vt(B.operativneTab),ne==="vijesti"){B.view==="news-detail"&&B.newsId?Na(B.newsId,!1):Ca(B.scrollNewsId??null,B.visibleNewsCount,!1),o(!0);return}if(ne==="projekti"){B.view==="project-detail"&&B.projectId?ac(B.projectId,!1):Ea(B.scrollProjectId??null,B.visibleProjectCount,!1),o(!0);return}i(ne),en(null),te(null),d(null),L(null),o(!0)},[s,Na,Ca,ac,Ea]),h.useEffect(()=>{s&&bd()},[s,r,Pe,ct,gt,Ln,sn,it,On.length,V,ae,ge,D,Qe==null?void 0:Qe.title,je==null?void 0:je.title,ue.length,qe.length,Ve.length]),h.useEffect(()=>{const A=B=>{const ne=C1(B.state)?B.state:null;if(!ne)return;const we=ne.route??"vijesti";if(i(we),ne.aktiTab&&$e(ne.aktiTab),ne.obrasciTab&&_n(ne.obrasciTab),ne.imenikTab&&Gn(ne.imenikTab),ne.upisnikLicencijaTab&&Nr(ne.upisnikLicencijaTab),ne.operativneTab&&Vt(ne.operativneTab),we==="vijesti"){if(ne.view==="news-detail"&&ne.newsId){Na(ne.newsId,!1);return}
651Ca(ne.scrollNewsId??null,ne.visibleNewsCount,!1);return}if(en(null),d(null),we==="projekti"){if(ne.view==="project-detail"&&ne.projectId){ac(ne.projectId,!1);return}Ea(ne.scrollProjectId??null,ne.visibleProjectCount,!1);return}if(te(null),we==="strucno-prezentacije"){Py(ne.visiblePrezentacijeCount??4);const Ie=String(ne.searchTargetId||"").match(/search-prezentacija-(\d+)/);if(Ie){const Re=Number(Ie[1]);(async()=>(await Gr(Re),gd(Re)))()}}L(ne.searchTargetId??null)};return window.addEventListener("popstate",A),()=>{window.removeEventListener("popstate",A)}},[Na,Ca,ac,Ea,Gr,gd,Py]);function ch(A,B=!0){if(B&&Zn({route:A,view:A==="vijesti"?"news-list":A==="projekti"?"project-list":void 0,newsId:void 0,scrollNewsId:void 0,visibleNewsCount:A==="vijesti"?Dr:void 0,projectId:void 0,scrollProjectId:void 0,visibleProjectCount:A==="projekti"?4:void 0,visiblePrezentacijeCount:A==="strucno-prezentacije"?4:void 0,searchTargetId:null}),i(A),L(null),d(null),A==="upisnik-licencija"&&Nr("sumarstvo-lovstvo"),A==="vijesti"){te(null),di();return}if(A==="projekti"){en(null),ke(4),te(null);return}if(A==="strucno-prezentacije"){en(null),te(null),Se(4);return}en(null),te(null)}function LE(){p(!0),E(null),k(""),hs()}function RE(){zv()}function $E(A){if(H(!1),L(null),A.kind==="archive"&&A.archiveItemId){E(A.archiveItemId),p(!0),k(""),hs();return}if(A.route==="vijesti"&&A.newsId){if(A.newsArchived){Ca(null,void 0,!0),d(A.newsId),l(Date.now()),yo();return}Na(A.newsId,!0);return}if(A.route==="projekti"&&A.kind==="project"){const B=String(A.targetId||"").match(/search-project-(\d+)/);if(B){Ea(Number(B[1]),void 0,!0);return}}if(A.route==="strucno-prezentacije"&&A.kind==="prezentacija"){const B=String(A.targetId||"").match(/search-prezentacija-(\d+)/),ne=B?Number(B[1]):0,we=Math.max(4,ge);i("strucno-prezentacije"),en(null),te(null),d(null),Se(Ie=>Math.max(Ie,we)),L(A.targetId??null),ne>0&&(async()=>(await Gr(ne),gd(ne)))(),Zn({route:"strucno-prezentacije",visiblePrezentacijeCount:we,searchTargetId:A.targetId??null});return}i(A.route),en(null),te(null),d(null),L(A.targetId??null),A.route==="akti-komore"&&A.tabId&&$e(A.tabId),A.route==="obrasci"&&A.tabId&&_n(A.tabId),A.route==="imenik"&&A.tabId&&Gn(A.tabId),A.route==="upisnik-licencija"&&A.tabId&&Nr(A.tabId),A.route==="operativne-informacije"&&A.tabId&&Vt(A.tabId),Zn({route:A.route,searchTargetId:A.targetId??null,aktiTab:A.route==="akti-komore"&&A.tabId?A.tabId:Pe,obrasciTab:A.route==="obrasci"&&A.tabId?A.tabId:ct,imenikTab:A.route==="imenik"&&A.tabId?A.tabId:gt,upisnikLicencijaTab:A.route==="upisnik-licencija"&&A.tabId?A.tabId:Ln,operativneTab:A.route==="operativne-informacije"&&A.tabId?A.tabId:sn})}function BE(){if(r==="vijesti"){Gl("news");return}if(r==="projekti"){Gl("project");return}Hm(r)}return c.jsxs("div",{className:"a11y-preview-scope flex min-h-screen w-full max-w-[100vw] flex-col overflow-x-hidden bg-white",children:[c.jsx(LM,{navItems:rd,route:r,goTo:ch,onOpenEkomoraImport:()=>Q(!0),onOpenSearch:()=>H(!0),onOpenProfile:()=>{if(I){ch("profil-clana",!0);return}z(!0)},profileOpen:P,isAdmin:T,onLogout:()=>{Q(!1),G()},isMember:I,onMemberLogout:re}),c.jsxs("main",{className:"app-enter w-full max-w-[100vw] flex-1 overflow-x-hidden px-3 pb-8 sm:px-4 md:px-6 md:pb-10 lg:px-8",children:[Xl&&c.jsx("div",{className:"-mx-3 sm:-mx-4 md:-mx-6 lg:-mx-8",children:c.jsx(i3,{...gs,title:ec,kicker:nh,alt:fd,lockTitleTranslation:$i,isAdmin:T&&!bs,onEdit:cd})}),r!=="vijesti"&&r!=="profil-clana"&&Zr&&c.jsxs("div",{className:"relative mb-4 mt-4 md:mt-5",children:[c.jsx(tE,{title:Zr,className:"mb-0 mt-0",align:"center",lockTranslation:$i}),T&&!bs&&!F$.includes(r)&&c.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-center gap-2 md:absolute md:right-0 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:justify-end",children:[c.jsx("button",{type:"button",className:"btn-natural btn-natural-primary px-4 py-2 text-sm font-semibold",onClick:BE,children:"Dodaj Älanak"}),r==="strucno-prezentacije"&&c.jsx("button",{type:"button",className:"btn-natural btn-natural-primary px-4 py-2 text-sm font-semibold",onClick:zy,children:"Dodaj prezentaciju"})]})]}),q?c.jsx(fL,{message:se}):c.jsx(uR,{route:r,newsSectionTitle:Zr||"Vijesti",isAdminLoggedIn:T,exportImportStatus:de,exportImportStatusLoading:Oe,exportImportStatusError:ot,exportImportRunning:Te,exportImportRunMessage:Ne,onPullExportImport:fe,selectedNews:Qe,selectedNewsBlocks:Ce,visibleNews:On,archivedNews:Ve,archivedNewsBlocksById:Fe,hasMoreNews:wr,onOpenNews:A=>{Na(A,!0)},onLoadMore:Pi,onBackToList:()=>{const A=it;
651if(A){const ne={...C1(window.history.state)?window.history.state:{},__hkisdt_app:!0,route:"vijesti",view:"news-list",scrollNewsId:A,visibleNewsCount:Math.max(Dr,On.length)};window.history.replaceState(ne,"")}Ca(A)},onEditNews:Bi,onDeleteNews:ds,onMoveNews:$l,onReorderNews:jo,onArchiveNews:us,onUnarchiveNews:ga,onAddNews:()=>Gl("news"),onEnsureNewsDetailLoaded:Jt,newsArchiveOpenRequestId:a,newsArchiveTargetNewsId:u,aktiTab:Pe,onAktiTabChange:A=>zE(A),aktiIntroBlocks:So,aktiTabBlocks:Km,obrasciTab:ct,onObrasciTabChange:A=>PE(A),obrasciIntroBlocks:Wm,obrasciTabBlocks:Gm,imenikTab:gt,onImenikTabChange:A=>DE(A),imenikTabBlocks:td,upisnikLicencijaTab:Ln,onUpisnikLicencijaTabChange:A=>OE(A),upisnikLicencijaTabBlocks:Li,operativneTab:sn,onOperativneTabChange:A=>_E(A),operativneZapisniciBlocks:No,operativneIzboriBlocks:nd,projectsCardItems:qe,projectDetailBlocksById:Sn,selectedProjectId:V,visibleProjectsCount:ae,hasMoreProjects:wn,onOpenProject:A=>ac(A,!0),onBackToProjects:()=>{const A=V;A&&bd({route:"projekti",view:"project-list",projectId:void 0,scrollProjectId:A,visibleProjectCount:Math.max(4,ae),searchTargetId:Fn({kind:"project",itemId:A})}),Ea(A,void 0,!1)},onVisibleProjectsCountChange:ke,prezentacijeItems:Ye,visiblePrezentacijeCount:ge,hasMorePrezentacije:_t,onVisiblePrezentacijeCountChange:Se,onEditProject:nc,onDeleteProject:ba,onArchiveProject:Fl,onReorderProject:xa,onEditPrezentacija:AE,onDeletePrezentacija:R,onArchivePrezentacija:qr,onMovePrezentacija:Z,onReorderPrezentacija:ee,onAddPrezentacija:zy,adminArticlesSection:tc,renderEditableArticles:rh,renderSubnavArticles:ih,isMemberLoggedIn:I,activeMember:K,hasRouteArticleContent:md,defaultCardImage:au,searchTargetId:D})]}),c.jsx(X4,{open:me,onClose:()=>H(!1),results:pd,onSelectResult:$E}),oh,c.jsx(s3,{open:P,loginEmail:We,loginPassword:tt,loginError:at,onEmailChange:A=>{Ut(A),at&&b("")},onPasswordChange:vt,onClose:()=>{z(!1),b("")},onSubmit:X}),T&&!bs&&c.jsx(G4,{open:Hl,title:ah,articles:sh,externalDraftBlocks:$m,externalDraftRequestId:Bm,publishButtonLabel:Um==="edit"?"Pohrani promjene u Älanku":"Spremi novi Älanak",onExternalDraftPublish:St||fi||Oi||pi?rc:void 0,enableCardImageSelection:ic.enabled,initialCardImageSrc:ic.initialImageSrc,activeAdminDisplayName:S,onClose:Vm,onArticlesChange:A=>Di(B=>({...B,[r]:jf(A)}))}),T&&!bs&&c.jsx(mL,{open:od,imageFileName:Zm,title:Ym,kicker:Qm,alt:Xm,saving:Yl,errorMessage:Jm,onImageSelect:ld,onResetImageToDefault:th,onTitleChange:ad,onKickerChange:Ql,onAltChange:eh,onClose:Co,onSave:ud}),T&&c.jsx(dL,{open:Y,onClose:()=>{Y&&Q(!1)}}),T&&c.jsx(iL,{open:!!O,mode:(O==null?void 0:O.mode)??"create",initialValue:TE,saving:$,submitError:ie,onClose:()=>{$||(oe(""),U(null))},onSubmit:ME}),c.jsx(nL,{open:f,items:m,targetItemId:w,loading:y,error:x,isAdmin:T,restoringId:N,onClose:()=>{p(!1),E(null)},onRestore:Zl}),c.jsx(P$,{}),c.jsx(N$,{}),c.jsx(hM,{goTo:ch,onOpenArchive:LE,onOpenCookieSettings:RE,settings:_})]})}const M1="hkisdt:app-remount";function fB(){const[t,e]=h.useState(0),[n,r]=h.useState(!0);return h.useEffect(()=>{const i=()=>{r(!1),window.requestAnimationFrame(()=>{e(s=>s+1),r(!0)})};return window.addEventListener(M1,i),()=>{window.removeEventListener(M1,i)}},[]),n?c.jsx(AM,{children:c.jsx(dB,{})},`i18n-${t}`):null}Wg.createRoot(document.getElementById("root")).render(c.jsx(ao.StrictMode,{children:c.jsx(fB,{})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.