retold-remote 0.0.13 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/retold-remote.css +75 -0
- package/docs/_sidebar.md +2 -0
- package/docs/ultravisor-configuration.md +212 -0
- package/docs/ultravisor-integration.md +140 -0
- package/package.json +121 -96
- package/source/cli/RetoldRemote-Server-Setup.js +26 -0
- package/source/providers/Pict-Provider-GalleryNavigation.js +11 -3
- package/source/providers/keyboard-handlers/KeyHandler-AudioExplorer.js +5 -0
- package/source/providers/keyboard-handlers/KeyHandler-VideoExplorer.js +16 -0
- package/source/server/RetoldRemote-AudioWaveformService.js +101 -23
- package/source/server/RetoldRemote-EbookService.js +119 -6
- package/source/server/RetoldRemote-ImageService.js +254 -2
- package/source/server/RetoldRemote-MediaService.js +274 -37
- package/source/server/RetoldRemote-ToolDetector.js +27 -3
- package/source/server/RetoldRemote-UltravisorDispatcher.js +599 -0
- package/source/server/RetoldRemote-VideoFrameService.js +309 -77
- package/source/views/PictView-Remote-AudioExplorer.js +28 -14
- package/source/views/PictView-Remote-ImageExplorer.js +31 -11
- package/source/views/PictView-Remote-VLCSetup.js +22 -12
- package/source/views/PictView-Remote-VideoExplorer.js +29 -14
- package/web-application/css/retold-remote.css +75 -0
- package/web-application/docs/_sidebar.md +2 -0
- package/web-application/docs/ultravisor-configuration.md +212 -0
- package/web-application/docs/ultravisor-integration.md +140 -0
- package/web-application/js/pict.min.js +2 -2
- package/web-application/js/pict.min.js.map +1 -1
- package/web-application/retold-remote.js +4763 -4238
- package/web-application/retold-remote.js.map +1 -1
- package/web-application/retold-remote.min.js +16 -16
- package/web-application/retold-remote.min.js.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).retoldRemote=t()}}(function(){return function t(e,i,o){function n(s,a){if(!i[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(r)return r(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var c=i[s]={exports:{}};e[s][0].call(c.exports,function(t){return n(e[s][1][t]||t)},c,c.exports,t,e,i,o)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<o.length;s++)n(o[s]);return n}({1:[function(t,e,i){},{}],2:[function(t,e,i){arguments[4][1][0].apply(i,arguments)},{dup:1}],3:[function(t,e,i){var o=t("function-bind"),n=t("./functionApply"),r=t("./functionCall"),s=t("./reflectApply");e.exports=s||o.call(r,n)},{"./functionApply":4,"./functionCall":5,"./reflectApply":7,"function-bind":22}],4:[function(t,e,i){e.exports=Function.prototype.apply},{}],5:[function(t,e,i){e.exports=Function.prototype.call},{}],6:[function(t,e,i){var o=t("function-bind"),n=t("es-errors/type"),r=t("./functionCall"),s=t("./actualApply");e.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new n("a function is required");return s(o,r,t)}},{"./actualApply":3,"./functionCall":5,"es-errors/type":16,"function-bind":22}],7:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],8:[function(t,e,i){var o=t("get-intrinsic"),n=t("call-bind-apply-helpers"),r=n([o("%String.prototype.indexOf%")]);e.exports=function(t,e){var i=o(t,!!e);return"function"==typeof i&&r(t,".prototype.")>-1?n([i]):i}},{"call-bind-apply-helpers":6,"get-intrinsic":23}],9:[function(t,e,i){var o,n=t("call-bind-apply-helpers"),r=t("gopd");try{o=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var s=!!o&&r&&r(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?n([s.get]):"function"==typeof l&&function(t){return l(null==t?t:a(t))}},{"call-bind-apply-helpers":6,gopd:28}],10:[function(t,e,i){var o=Object.defineProperty||!1;if(o)try{o({},"a",{value:1})}catch(t){o=!1}e.exports=o},{}],11:[function(t,e,i){e.exports=EvalError},{}],12:[function(t,e,i){e.exports=Error},{}],13:[function(t,e,i){e.exports=RangeError},{}],14:[function(t,e,i){e.exports=ReferenceError},{}],15:[function(t,e,i){e.exports=SyntaxError},{}],16:[function(t,e,i){e.exports=TypeError},{}],17:[function(t,e,i){e.exports=URIError},{}],18:[function(t,e,i){e.exports=Object},{}],19:[function(t,e,i){e.exports={name:"fable-serviceproviderbase",version:"3.0.19",description:"Simple base classes for fable services.",main:"source/Fable-ServiceProviderBase.js",scripts:{start:"node source/Fable-ServiceProviderBase.js",test:"npx quack test",tests:"npx quack test -g",coverage:"npx quack coverage",build:"npx quack build",types:"tsc -p ./tsconfig.build.json",check:"tsc -p . --noEmit"},types:"types/source/Fable-ServiceProviderBase.d.ts",mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},repository:{type:"git",url:"https://github.com/stevenvelozo/fable-serviceproviderbase.git"},keywords:["entity","behavior"],author:"Steven Velozo <steven@velozo.com> (http://velozo.com/)",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/fable-serviceproviderbase/issues"},homepage:"https://github.com/stevenvelozo/fable-serviceproviderbase",devDependencies:{"@types/mocha":"^10.0.10",fable:"^3.1.62",quackage:"^1.0.58",typescript:"^5.9.3"}}},{}],20:[function(t,e,i){const o=t("../package.json");class n{constructor(t,e,i){this.fable,this.UUID,this.options,this.services,this.servicesMap,"object"==typeof t&&t.isFable?this.connectFable(t):this.fable=!1,this._PackageFableServiceProvider=o,this.fable?(this.UUID=t.getUUID(),this.options="object"==typeof e?e:{}):(this.options="object"!=typeof t||t.isFable?"object"==typeof e?e:{}:t,this.UUID=`CORE-SVC-${Math.floor(89999*Math.random()+1e4)}`),this.serviceType=`Unknown-${this.UUID}`,this.Hash="string"==typeof i?i:this.fable||"string"!=typeof e?`${this.UUID}`:e}connectFable(t){if("object"!=typeof t||!t.isFable){let e=`Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof t}].}`;return console.log(e),new Error(e)}return this.fable||(this.fable=t),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}static isFableService=!0}e.exports=n,e.exports.CoreServiceProviderBase=n},{"../package.json":19}],21:[function(t,e,i){var o=Object.prototype.toString,n=Math.max,r=function(t,e){for(var i=[],o=0;o<t.length;o+=1)i[o]=t[o];for(var n=0;n<e.length;n+=1)i[n+t.length]=e[n];return i};e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==o.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var i,s=function(t,e){for(var i=[],o=e||0,n=0;o<t.length;o+=1,n+=1)i[n]=t[o];return i}(arguments,1),a=n(0,e.length-s.length),l=[],d=0;d<a;d++)l[d]="$"+d;if(i=Function("binder","return function ("+function(t,e){for(var i="",o=0;o<t.length;o+=1)i+=t[o],o+1<t.length&&(i+=e);return i}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var o=e.apply(this,r(s,arguments));return Object(o)===o?o:this}return e.apply(t,r(s,arguments))}),e.prototype){var c=function(){};c.prototype=e.prototype,i.prototype=new c,c.prototype=null}return i}},{}],22:[function(t,e,i){var o=t("./implementation");e.exports=Function.prototype.bind||o},{"./implementation":21}],23:[function(t,e,i){var o,n=t("es-object-atoms"),r=t("es-errors"),s=t("es-errors/eval"),a=t("es-errors/range"),l=t("es-errors/ref"),d=t("es-errors/syntax"),c=t("es-errors/type"),p=t("es-errors/uri"),h=t("math-intrinsics/abs"),u=t("math-intrinsics/floor"),m=t("math-intrinsics/max"),f=t("math-intrinsics/min"),g=t("math-intrinsics/pow"),v=t("math-intrinsics/round"),b=t("math-intrinsics/sign"),y=Function,w=function(t){try{return y('"use strict"; return ('+t+").constructor;")()}catch(t){}},C=t("gopd"),x=t("es-define-property"),A=function(){throw new c},R=C?function(){try{return A}catch(t){try{return C(arguments,"callee").get}catch(t){return A}}}():A,E=t("has-symbols")(),D=t("get-proto"),S=t("get-proto/Object.getPrototypeOf"),T=t("get-proto/Reflect.getPrototypeOf"),F=t("call-bind-apply-helpers/functionApply"),_=t("call-bind-apply-helpers/functionCall"),P={},k="undefined"!=typeof Uint8Array&&D?D(Uint8Array):o,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":E&&D?D([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?o:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?o:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&D?D(D([][Symbol.iterator]())):o,"%JSON%":"object"==typeof JSON?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&D?D((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&D?D((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&D?D(""[Symbol.iterator]()):o,"%Symbol%":E?Symbol:o,"%SyntaxError%":d,"%ThrowTypeError%":R,"%TypedArray%":k,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet,"%Function.prototype.call%":_,"%Function.prototype.apply%":F,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":S,"%Math.abs%":h,"%Math.floor%":u,"%Math.max%":m,"%Math.min%":f,"%Math.pow%":g,"%Math.round%":v,"%Math.sign%":b,"%Reflect.getPrototypeOf%":T};if(D)try{null.error}catch(t){var L=D(D(t));I["%Error.prototype%"]=L}var M=function t(e){var i;if("%AsyncFunction%"===e)i=w("async function () {}");else if("%GeneratorFunction%"===e)i=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=w("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(i=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&D&&(i=D(n.prototype))}return I[e]=i,i},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},V=t("function-bind"),H=t("hasown"),N=V.call(_,Array.prototype.concat),j=V.call(F,Array.prototype.splice),O=V.call(_,String.prototype.replace),U=V.call(_,String.prototype.slice),z=V.call(_,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,W=function(t,e){var i,o=t;if(H(B,o)&&(o="%"+(i=B[o])[0]+"%"),H(I,o)){var n=I[o];if(n===P&&(n=M(o)),void 0===n&&!e)throw new c("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:o,value:n}}throw new d("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new d("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=U(t,0,1),i=U(t,-1);if("%"===e&&"%"!==i)throw new d("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new d("invalid intrinsic syntax, expected opening `%`");var o=[];return O(t,$,function(t,e,i,n){o[o.length]=i?O(n,G,"$1"):e||t}),o}(t),o=i.length>0?i[0]:"",n=W("%"+o+"%",e),r=n.name,s=n.value,a=!1,l=n.alias;l&&(o=l[0],j(i,N([0,1],l)));for(var p=1,h=!0;p<i.length;p+=1){var u=i[p],m=U(u,0,1),f=U(u,-1);if(('"'===m||"'"===m||"`"===m||'"'===f||"'"===f||"`"===f)&&m!==f)throw new d("property names with quotes must have matching quotes");if("constructor"!==u&&h||(a=!0),H(I,r="%"+(o+="."+u)+"%"))s=I[r];else if(null!=s){if(!(u in s)){if(!e)throw new c("base intrinsic for "+t+" exists, but the property is not available.");return}if(C&&p+1>=i.length){var g=C(s,u);s=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:s[u]}else h=H(s,u),s=s[u];h&&!a&&(I[r]=s)}}return s}},{"call-bind-apply-helpers/functionApply":4,"call-bind-apply-helpers/functionCall":5,"es-define-property":10,"es-errors":12,"es-errors/eval":11,"es-errors/range":13,"es-errors/ref":14,"es-errors/syntax":15,"es-errors/type":16,"es-errors/uri":17,"es-object-atoms":18,"function-bind":22,"get-proto":26,"get-proto/Object.getPrototypeOf":24,"get-proto/Reflect.getPrototypeOf":25,gopd:28,"has-symbols":29,hasown:31,"math-intrinsics/abs":33,"math-intrinsics/floor":34,"math-intrinsics/max":36,"math-intrinsics/min":37,"math-intrinsics/pow":38,"math-intrinsics/round":39,"math-intrinsics/sign":40}],24:[function(t,e,i){var o=t("es-object-atoms");e.exports=o.getPrototypeOf||null},{"es-object-atoms":18}],25:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],26:[function(t,e,i){var o=t("./Reflect.getPrototypeOf"),n=t("./Object.getPrototypeOf"),r=t("dunder-proto/get");e.exports=o?function(t){return o(t)}:n?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return n(t)}:r?function(t){return r(t)}:null},{"./Object.getPrototypeOf":24,"./Reflect.getPrototypeOf":25,"dunder-proto/get":9}],27:[function(t,e,i){e.exports=Object.getOwnPropertyDescriptor},{}],28:[function(t,e,i){var o=t("./gOPD");if(o)try{o([],"length")}catch(t){o=null}e.exports=o},{"./gOPD":27}],29:[function(t,e,i){var o="undefined"!=typeof Symbol&&Symbol,n=t("./shams");e.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"==typeof o("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},{"./shams":30}],30:[function(t,e,i){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var o in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},{}],31:[function(t,e,i){var o=Function.prototype.call,n=Object.prototype.hasOwnProperty,r=t("function-bind");e.exports=r.call(o,n)},{"function-bind":22}],32:[function(t,e,i){!function(){var t,o,n,r,s,a,l,d,c,p,h,u,m,f,g,v,b,y,w,C,x,A,R,E,D,S,T,F,_,P,k,I=function(t){var e=new I.Builder;return e.pipeline.add(I.trimmer,I.stopWordFilter,I.stemmer),e.searchPipeline.add(I.stemmer),t.call(e,e),e.build()};I.version="2.3.9",
|
|
1
|
+
"use strict";!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).retoldRemote=t()}}(function(){return function t(e,i,o){function n(s,a){if(!i[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(r)return r(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var c=i[s]={exports:{}};e[s][0].call(c.exports,function(t){return n(e[s][1][t]||t)},c,c.exports,t,e,i,o)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<o.length;s++)n(o[s]);return n}({1:[function(t,e,i){},{}],2:[function(t,e,i){arguments[4][1][0].apply(i,arguments)},{dup:1}],3:[function(t,e,i){var o=t("function-bind"),n=t("./functionApply"),r=t("./functionCall"),s=t("./reflectApply");e.exports=s||o.call(r,n)},{"./functionApply":4,"./functionCall":5,"./reflectApply":7,"function-bind":22}],4:[function(t,e,i){e.exports=Function.prototype.apply},{}],5:[function(t,e,i){e.exports=Function.prototype.call},{}],6:[function(t,e,i){var o=t("function-bind"),n=t("es-errors/type"),r=t("./functionCall"),s=t("./actualApply");e.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new n("a function is required");return s(o,r,t)}},{"./actualApply":3,"./functionCall":5,"es-errors/type":16,"function-bind":22}],7:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],8:[function(t,e,i){var o=t("get-intrinsic"),n=t("call-bind-apply-helpers"),r=n([o("%String.prototype.indexOf%")]);e.exports=function(t,e){var i=o(t,!!e);return"function"==typeof i&&r(t,".prototype.")>-1?n([i]):i}},{"call-bind-apply-helpers":6,"get-intrinsic":23}],9:[function(t,e,i){var o,n=t("call-bind-apply-helpers"),r=t("gopd");try{o=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var s=!!o&&r&&r(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?n([s.get]):"function"==typeof l&&function(t){return l(null==t?t:a(t))}},{"call-bind-apply-helpers":6,gopd:28}],10:[function(t,e,i){var o=Object.defineProperty||!1;if(o)try{o({},"a",{value:1})}catch(t){o=!1}e.exports=o},{}],11:[function(t,e,i){e.exports=EvalError},{}],12:[function(t,e,i){e.exports=Error},{}],13:[function(t,e,i){e.exports=RangeError},{}],14:[function(t,e,i){e.exports=ReferenceError},{}],15:[function(t,e,i){e.exports=SyntaxError},{}],16:[function(t,e,i){e.exports=TypeError},{}],17:[function(t,e,i){e.exports=URIError},{}],18:[function(t,e,i){e.exports=Object},{}],19:[function(t,e,i){e.exports={name:"fable-serviceproviderbase",version:"3.0.19",description:"Simple base classes for fable services.",main:"source/Fable-ServiceProviderBase.js",scripts:{start:"node source/Fable-ServiceProviderBase.js",test:"npx quack test",tests:"npx quack test -g",coverage:"npx quack coverage",build:"npx quack build",types:"tsc -p ./tsconfig.build.json",check:"tsc -p . --noEmit"},types:"types/source/Fable-ServiceProviderBase.d.ts",mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},repository:{type:"git",url:"https://github.com/stevenvelozo/fable-serviceproviderbase.git"},keywords:["entity","behavior"],author:"Steven Velozo <steven@velozo.com> (http://velozo.com/)",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/fable-serviceproviderbase/issues"},homepage:"https://github.com/stevenvelozo/fable-serviceproviderbase",devDependencies:{"@types/mocha":"^10.0.10",fable:"^3.1.62",quackage:"^1.0.58",typescript:"^5.9.3"}}},{}],20:[function(t,e,i){const o=t("../package.json");class n{constructor(t,e,i){this.fable,this.UUID,this.options,this.services,this.servicesMap,"object"==typeof t&&t.isFable?this.connectFable(t):this.fable=!1,this._PackageFableServiceProvider=o,this.fable?(this.UUID=t.getUUID(),this.options="object"==typeof e?e:{}):(this.options="object"!=typeof t||t.isFable?"object"==typeof e?e:{}:t,this.UUID=`CORE-SVC-${Math.floor(89999*Math.random()+1e4)}`),this.serviceType=`Unknown-${this.UUID}`,this.Hash="string"==typeof i?i:this.fable||"string"!=typeof e?`${this.UUID}`:e}connectFable(t){if("object"!=typeof t||!t.isFable){let e=`Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof t}].}`;return console.log(e),new Error(e)}return this.fable||(this.fable=t),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}static isFableService=!0}e.exports=n,e.exports.CoreServiceProviderBase=n},{"../package.json":19}],21:[function(t,e,i){var o=Object.prototype.toString,n=Math.max,r=function(t,e){for(var i=[],o=0;o<t.length;o+=1)i[o]=t[o];for(var n=0;n<e.length;n+=1)i[n+t.length]=e[n];return i};e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==o.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var i,s=function(t,e){for(var i=[],o=e||0,n=0;o<t.length;o+=1,n+=1)i[n]=t[o];return i}(arguments,1),a=n(0,e.length-s.length),l=[],d=0;d<a;d++)l[d]="$"+d;if(i=Function("binder","return function ("+function(t,e){for(var i="",o=0;o<t.length;o+=1)i+=t[o],o+1<t.length&&(i+=e);return i}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var o=e.apply(this,r(s,arguments));return Object(o)===o?o:this}return e.apply(t,r(s,arguments))}),e.prototype){var c=function(){};c.prototype=e.prototype,i.prototype=new c,c.prototype=null}return i}},{}],22:[function(t,e,i){var o=t("./implementation");e.exports=Function.prototype.bind||o},{"./implementation":21}],23:[function(t,e,i){var o,n=t("es-object-atoms"),r=t("es-errors"),s=t("es-errors/eval"),a=t("es-errors/range"),l=t("es-errors/ref"),d=t("es-errors/syntax"),c=t("es-errors/type"),p=t("es-errors/uri"),h=t("math-intrinsics/abs"),u=t("math-intrinsics/floor"),m=t("math-intrinsics/max"),f=t("math-intrinsics/min"),g=t("math-intrinsics/pow"),v=t("math-intrinsics/round"),b=t("math-intrinsics/sign"),w=Function,y=function(t){try{return w('"use strict"; return ('+t+").constructor;")()}catch(t){}},C=t("gopd"),x=t("es-define-property"),A=function(){throw new c},R=C?function(){try{return A}catch(t){try{return C(arguments,"callee").get}catch(t){return A}}}():A,D=t("has-symbols")(),E=t("get-proto"),S=t("get-proto/Object.getPrototypeOf"),T=t("get-proto/Reflect.getPrototypeOf"),F=t("call-bind-apply-helpers/functionApply"),P=t("call-bind-apply-helpers/functionCall"),_={},k="undefined"!=typeof Uint8Array&&E?E(Uint8Array):o,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?o:ArrayBuffer,"%ArrayIteratorPrototype%":D&&E?E([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%Atomics%":"undefined"==typeof Atomics?o:Atomics,"%BigInt%":"undefined"==typeof BigInt?o:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?o:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?o:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?o:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?o:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?o:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":_,"%Int8Array%":"undefined"==typeof Int8Array?o:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?o:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D&&E?E(E([][Symbol.iterator]())):o,"%JSON%":"object"==typeof JSON?JSON:o,"%Map%":"undefined"==typeof Map?o:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&D&&E?E((new Map)[Symbol.iterator]()):o,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?o:Promise,"%Proxy%":"undefined"==typeof Proxy?o:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?o:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?o:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&D&&E?E((new Set)[Symbol.iterator]()):o,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D&&E?E(""[Symbol.iterator]()):o,"%Symbol%":D?Symbol:o,"%SyntaxError%":d,"%ThrowTypeError%":R,"%TypedArray%":k,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?o:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?o:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?o:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?o:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?o:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?o:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?o:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":F,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":S,"%Math.abs%":h,"%Math.floor%":u,"%Math.max%":m,"%Math.min%":f,"%Math.pow%":g,"%Math.round%":v,"%Math.sign%":b,"%Reflect.getPrototypeOf%":T};if(E)try{null.error}catch(t){var L=E(E(t));I["%Error.prototype%"]=L}var M=function t(e){var i;if("%AsyncFunction%"===e)i=y("async function () {}");else if("%GeneratorFunction%"===e)i=y("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=y("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(i=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&E&&(i=E(n.prototype))}return I[e]=i,i},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},V=t("function-bind"),H=t("hasown"),N=V.call(P,Array.prototype.concat),j=V.call(F,Array.prototype.splice),O=V.call(P,String.prototype.replace),U=V.call(P,String.prototype.slice),z=V.call(P,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,W=function(t,e){var i,o=t;if(H(B,o)&&(o="%"+(i=B[o])[0]+"%"),H(I,o)){var n=I[o];if(n===_&&(n=M(o)),void 0===n&&!e)throw new c("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:o,value:n}}throw new d("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,t))throw new d("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=U(t,0,1),i=U(t,-1);if("%"===e&&"%"!==i)throw new d("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new d("invalid intrinsic syntax, expected opening `%`");var o=[];return O(t,$,function(t,e,i,n){o[o.length]=i?O(n,G,"$1"):e||t}),o}(t),o=i.length>0?i[0]:"",n=W("%"+o+"%",e),r=n.name,s=n.value,a=!1,l=n.alias;l&&(o=l[0],j(i,N([0,1],l)));for(var p=1,h=!0;p<i.length;p+=1){var u=i[p],m=U(u,0,1),f=U(u,-1);if(('"'===m||"'"===m||"`"===m||'"'===f||"'"===f||"`"===f)&&m!==f)throw new d("property names with quotes must have matching quotes");if("constructor"!==u&&h||(a=!0),H(I,r="%"+(o+="."+u)+"%"))s=I[r];else if(null!=s){if(!(u in s)){if(!e)throw new c("base intrinsic for "+t+" exists, but the property is not available.");return}if(C&&p+1>=i.length){var g=C(s,u);s=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:s[u]}else h=H(s,u),s=s[u];h&&!a&&(I[r]=s)}}return s}},{"call-bind-apply-helpers/functionApply":4,"call-bind-apply-helpers/functionCall":5,"es-define-property":10,"es-errors":12,"es-errors/eval":11,"es-errors/range":13,"es-errors/ref":14,"es-errors/syntax":15,"es-errors/type":16,"es-errors/uri":17,"es-object-atoms":18,"function-bind":22,"get-proto":26,"get-proto/Object.getPrototypeOf":24,"get-proto/Reflect.getPrototypeOf":25,gopd:28,"has-symbols":29,hasown:31,"math-intrinsics/abs":33,"math-intrinsics/floor":34,"math-intrinsics/max":36,"math-intrinsics/min":37,"math-intrinsics/pow":38,"math-intrinsics/round":39,"math-intrinsics/sign":40}],24:[function(t,e,i){var o=t("es-object-atoms");e.exports=o.getPrototypeOf||null},{"es-object-atoms":18}],25:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],26:[function(t,e,i){var o=t("./Reflect.getPrototypeOf"),n=t("./Object.getPrototypeOf"),r=t("dunder-proto/get");e.exports=o?function(t){return o(t)}:n?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return n(t)}:r?function(t){return r(t)}:null},{"./Object.getPrototypeOf":24,"./Reflect.getPrototypeOf":25,"dunder-proto/get":9}],27:[function(t,e,i){e.exports=Object.getOwnPropertyDescriptor},{}],28:[function(t,e,i){var o=t("./gOPD");if(o)try{o([],"length")}catch(t){o=null}e.exports=o},{"./gOPD":27}],29:[function(t,e,i){var o="undefined"!=typeof Symbol&&Symbol,n=t("./shams");e.exports=function(){return"function"==typeof o&&("function"==typeof Symbol&&("symbol"==typeof o("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},{"./shams":30}],30:[function(t,e,i){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var o in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},{}],31:[function(t,e,i){var o=Function.prototype.call,n=Object.prototype.hasOwnProperty,r=t("function-bind");e.exports=r.call(o,n)},{"function-bind":22}],32:[function(t,e,i){!function(){var t,o,n,r,s,a,l,d,c,p,h,u,m,f,g,v,b,w,y,C,x,A,R,D,E,S,T,F,P,_,k,I=function(t){var e=new I.Builder;return e.pipeline.add(I.trimmer,I.stopWordFilter,I.stemmer),e.searchPipeline.add(I.stemmer),t.call(e,e),e.build()};I.version="2.3.9",
|
|
2
2
|
/*!
|
|
3
3
|
* lunr.utils
|
|
4
4
|
* Copyright (C) 2020 Oliver Nightingale
|
|
@@ -29,7 +29,7 @@ I.Vector=function(t){this._magnitude=0,this.elements=t||[]},I.Vector.prototype.p
|
|
|
29
29
|
* Copyright (C) 2020 Oliver Nightingale
|
|
30
30
|
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
|
31
31
|
*/
|
|
32
|
-
I.stemmer=(t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},o={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},a="^("+(r="[^aeiou][^aeiouy]*")+")?"+(s=(n="[aeiouy]")+"[aeiou]*")+r+"("+s+")?$",l="^("+r+")?"+s+r+s+r,d="^("+r+")?"+n,c=new RegExp("^("+r+")?"+s+r),p=new RegExp(l),h=new RegExp(a),u=new RegExp(d),m=/^(.+?)(ss|i)es$/,f=/^(.+?)([^s])s$/,g=/^(.+?)eed$/,v=/^(.+?)(ed|ing)$/,b=/.$/,
|
|
32
|
+
I.stemmer=(t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},o={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},a="^("+(r="[^aeiou][^aeiouy]*")+")?"+(s=(n="[aeiouy]")+"[aeiou]*")+r+"("+s+")?$",l="^("+r+")?"+s+r+s+r,d="^("+r+")?"+n,c=new RegExp("^("+r+")?"+s+r),p=new RegExp(l),h=new RegExp(a),u=new RegExp(d),m=/^(.+?)(ss|i)es$/,f=/^(.+?)([^s])s$/,g=/^(.+?)eed$/,v=/^(.+?)(ed|ing)$/,b=/.$/,w=/(at|bl|iz)$/,y=new RegExp("([^aeiouylsz])\\1$"),C=new RegExp("^"+r+n+"[^aeiouwxy]$"),x=/^(.+?[^aeiou])y$/,A=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,R=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,D=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,E=/^(.+?)(s|t)(ion)$/,S=/^(.+?)e$/,T=/ll$/,F=new RegExp("^"+r+n+"[^aeiouwxy]$"),P=function(e){var i,n,r,s,a,l,d;if(e.length<3)return e;if("y"==(r=e.substr(0,1))&&(e=r.toUpperCase()+e.substr(1)),a=f,(s=m).test(e)?e=e.replace(s,"$1$2"):a.test(e)&&(e=e.replace(a,"$1$2")),a=v,(s=g).test(e)){var P=s.exec(e);(s=c).test(P[1])&&(s=b,e=e.replace(s,""))}else a.test(e)&&(i=(P=a.exec(e))[1],(a=u).test(i)&&(l=y,d=C,(a=w).test(e=i)?e+="e":l.test(e)?(s=b,e=e.replace(s,"")):d.test(e)&&(e+="e")));return(s=x).test(e)&&(e=(i=(P=s.exec(e))[1])+"i"),(s=A).test(e)&&(i=(P=s.exec(e))[1],n=P[2],(s=c).test(i)&&(e=i+t[n])),(s=R).test(e)&&(i=(P=s.exec(e))[1],n=P[2],(s=c).test(i)&&(e=i+o[n])),a=E,(s=D).test(e)?(i=(P=s.exec(e))[1],(s=p).test(i)&&(e=i)):a.test(e)&&(i=(P=a.exec(e))[1]+P[2],(a=p).test(i)&&(e=i)),(s=S).test(e)&&(i=(P=s.exec(e))[1],a=h,l=F,((s=p).test(i)||a.test(i)&&!l.test(i))&&(e=i)),a=p,(s=T).test(e)&&a.test(e)&&(s=b,e=e.replace(s,"")),"y"==r&&(e=r.toLowerCase()+e.substr(1)),e},function(t){return t.update(P)}),I.Pipeline.registerFunction(I.stemmer,"stemmer"),
|
|
33
33
|
/*!
|
|
34
34
|
* lunr.stopWordFilter
|
|
35
35
|
* Copyright (C) 2020 Oliver Nightingale
|
|
@@ -49,12 +49,12 @@ I.TokenSet=function(){this.final=!1,this.edges={},this.id=I.TokenSet._nextId,I.T
|
|
|
49
49
|
* lunr.Index
|
|
50
50
|
* Copyright (C) 2020 Oliver Nightingale
|
|
51
51
|
*/
|
|
52
|
-
I.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},I.Index.prototype.search=function(t){return this.query(function(e){new I.QueryParser(t,e).parse()})},I.Index.prototype.query=function(t){for(var e=new I.Query(this.fields),i=Object.create(null),o=Object.create(null),n=Object.create(null),r=Object.create(null),s=Object.create(null),a=0;a<this.fields.length;a++)o[this.fields[a]]=new I.Vector;t.call(e,e);for(a=0;a<e.clauses.length;a++){var l=e.clauses[a],d=null,c=I.Set.empty;d=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var p=0;p<d.length;p++){var h=d[p];l.term=h;var u=I.TokenSet.fromClause(l),m=this.tokenSet.intersect(u).toArray();if(0===m.length&&l.presence===I.Query.presence.REQUIRED){for(var f=0;f<l.fields.length;f++){r[
|
|
52
|
+
I.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},I.Index.prototype.search=function(t){return this.query(function(e){new I.QueryParser(t,e).parse()})},I.Index.prototype.query=function(t){for(var e=new I.Query(this.fields),i=Object.create(null),o=Object.create(null),n=Object.create(null),r=Object.create(null),s=Object.create(null),a=0;a<this.fields.length;a++)o[this.fields[a]]=new I.Vector;t.call(e,e);for(a=0;a<e.clauses.length;a++){var l=e.clauses[a],d=null,c=I.Set.empty;d=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var p=0;p<d.length;p++){var h=d[p];l.term=h;var u=I.TokenSet.fromClause(l),m=this.tokenSet.intersect(u).toArray();if(0===m.length&&l.presence===I.Query.presence.REQUIRED){for(var f=0;f<l.fields.length;f++){r[_=l.fields[f]]=I.Set.empty}break}for(var g=0;g<m.length;g++){var v=m[g],b=this.invertedIndex[v],w=b._index;for(f=0;f<l.fields.length;f++){var y=b[_=l.fields[f]],C=Object.keys(y),x=v+"/"+_,A=new I.Set(C);if(l.presence==I.Query.presence.REQUIRED&&(c=c.union(A),void 0===r[_]&&(r[_]=I.Set.complete)),l.presence!=I.Query.presence.PROHIBITED){if(o[_].upsert(w,l.boost,function(t,e){return t+e}),!n[x]){for(var R=0;R<C.length;R++){var D,E=C[R],S=new I.FieldRef(E,_),T=y[E];void 0===(D=i[S])?i[S]=new I.MatchData(v,_,T):D.add(v,_,T)}n[x]=!0}}else void 0===s[_]&&(s[_]=I.Set.empty),s[_]=s[_].union(A)}}}if(l.presence===I.Query.presence.REQUIRED)for(f=0;f<l.fields.length;f++){r[_=l.fields[f]]=r[_].intersect(c)}}var F=I.Set.complete,P=I.Set.empty;for(a=0;a<this.fields.length;a++){var _;r[_=this.fields[a]]&&(F=F.intersect(r[_])),s[_]&&(P=P.union(s[_]))}var k=Object.keys(i),L=[],M=Object.create(null);if(e.isNegated()){k=Object.keys(this.fieldVectors);for(a=0;a<k.length;a++){S=k[a];var B=I.FieldRef.fromString(S);i[S]=new I.MatchData}}for(a=0;a<k.length;a++){var V=(B=I.FieldRef.fromString(k[a])).docRef;if(F.contains(V)&&!P.contains(V)){var H,N=this.fieldVectors[B],j=o[B.fieldName].similarity(N);if(void 0!==(H=M[V]))H.score+=j,H.matchData.combine(i[B]);else{var O={ref:V,score:j,matchData:i[B]};M[V]=O,L.push(O)}}}return L.sort(function(t,e){return e.score-t.score})},I.Index.prototype.toJSON=function(){var t=Object.keys(this.invertedIndex).sort().map(function(t){return[t,this.invertedIndex[t]]},this),e=Object.keys(this.fieldVectors).map(function(t){return[t,this.fieldVectors[t].toJSON()]},this);return{version:I.version,fields:this.fields,fieldVectors:e,invertedIndex:t,pipeline:this.pipeline.toJSON()}},I.Index.load=function(t){var e={},i={},o=t.fieldVectors,n=Object.create(null),r=t.invertedIndex,s=new I.TokenSet.Builder,a=I.Pipeline.load(t.pipeline);t.version!=I.version&&I.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+I.version+"' does not match serialized index '"+t.version+"'");for(var l=0;l<o.length;l++){var d=(p=o[l])[0],c=p[1];i[d]=new I.Vector(c)}for(l=0;l<r.length;l++){var p,h=(p=r[l])[0],u=p[1];s.insert(h),n[h]=u}return s.finish(),e.fields=t.fields,e.fieldVectors=i,e.invertedIndex=n,e.tokenSet=s.root,e.pipeline=a,new I.Index(e)},
|
|
53
53
|
/*!
|
|
54
54
|
* lunr.Builder
|
|
55
55
|
* Copyright (C) 2020 Oliver Nightingale
|
|
56
56
|
*/
|
|
57
|
-
I.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=I.tokenizer,this.pipeline=new I.Pipeline,this.searchPipeline=new I.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},I.Builder.prototype.ref=function(t){this._ref=t},I.Builder.prototype.field=function(t,e){if(/\//.test(t))throw new RangeError("Field '"+t+"' contains illegal character '/'");this._fields[t]=e||{}},I.Builder.prototype.b=function(t){this._b=t<0?0:t>1?1:t},I.Builder.prototype.k1=function(t){this._k1=t},I.Builder.prototype.add=function(t,e){var i=t[this._ref],o=Object.keys(this._fields);this._documents[i]=e||{},this.documentCount+=1;for(var n=0;n<o.length;n++){var r=o[n],s=this._fields[r].extractor,a=s?s(t):t[r],l=this.tokenizer(a,{fields:[r]}),d=this.pipeline.run(l),c=new I.FieldRef(i,r),p=Object.create(null);this.fieldTermFrequencies[c]=p,this.fieldLengths[c]=0,this.fieldLengths[c]+=d.length;for(var h=0;h<d.length;h++){var u=d[h];if(null==p[u]&&(p[u]=0),p[u]+=1,null==this.invertedIndex[u]){var m=Object.create(null);m._index=this.termIndex,this.termIndex+=1;for(var f=0;f<o.length;f++)m[o[f]]=Object.create(null);this.invertedIndex[u]=m}null==this.invertedIndex[u][r][i]&&(this.invertedIndex[u][r][i]=Object.create(null));for(var g=0;g<this.metadataWhitelist.length;g++){var v=this.metadataWhitelist[g],b=u.metadata[v];null==this.invertedIndex[u][r][i][v]&&(this.invertedIndex[u][r][i][v]=[]),this.invertedIndex[u][r][i][v].push(b)}}}},I.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),e=t.length,i={},o={},n=0;n<e;n++){var r=I.FieldRef.fromString(t[n]),s=r.fieldName;o[s]||(o[s]=0),o[s]+=1,i[s]||(i[s]=0),i[s]+=this.fieldLengths[r]}var a=Object.keys(this._fields);for(n=0;n<a.length;n++){var l=a[n];i[l]=i[l]/o[l]}this.averageFieldLength=i},I.Builder.prototype.createFieldVectors=function(){for(var t={},e=Object.keys(this.fieldTermFrequencies),i=e.length,o=Object.create(null),n=0;n<i;n++){for(var r=I.FieldRef.fromString(e[n]),s=r.fieldName,a=this.fieldLengths[r],l=new I.Vector,d=this.fieldTermFrequencies[r],c=Object.keys(d),p=c.length,h=this._fields[s].boost||1,u=this._documents[r.docRef].boost||1,m=0;m<p;m++){var f,g,v,b=c[m],y=d[b],w=this.invertedIndex[b]._index;void 0===o[b]?(f=I.idf(this.invertedIndex[b],this.documentCount),o[b]=f):f=o[b],g=f*((this._k1+1)*y)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[s]))+y),g*=h,g*=u,v=Math.round(1e3*g)/1e3,l.insert(w,v)}t[r]=l}this.fieldVectors=t},I.Builder.prototype.createTokenSet=function(){this.tokenSet=I.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},I.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new I.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},I.Builder.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},I.MatchData=function(t,e,i){for(var o=Object.create(null),n=Object.keys(i||{}),r=0;r<n.length;r++){var s=n[r];o[s]=i[s].slice()}this.metadata=Object.create(null),void 0!==t&&(this.metadata[t]=Object.create(null),this.metadata[t][e]=o)},I.MatchData.prototype.combine=function(t){for(var e=Object.keys(t.metadata),i=0;i<e.length;i++){var o=e[i],n=Object.keys(t.metadata[o]);null==this.metadata[o]&&(this.metadata[o]=Object.create(null));for(var r=0;r<n.length;r++){var s=n[r],a=Object.keys(t.metadata[o][s]);null==this.metadata[o][s]&&(this.metadata[o][s]=Object.create(null));for(var l=0;l<a.length;l++){var d=a[l];null==this.metadata[o][s][d]?this.metadata[o][s][d]=t.metadata[o][s][d]:this.metadata[o][s][d]=this.metadata[o][s][d].concat(t.metadata[o][s][d])}}}},I.MatchData.prototype.add=function(t,e,i){if(!(t in this.metadata))return this.metadata[t]=Object.create(null),void(this.metadata[t][e]=i);if(e in this.metadata[t])for(var o=Object.keys(i),n=0;n<o.length;n++){var r=o[n];r in this.metadata[t][e]?this.metadata[t][e][r]=this.metadata[t][e][r].concat(i[r]):this.metadata[t][e][r]=i[r]}else this.metadata[t][e]=i},I.Query=function(t){this.clauses=[],this.allFields=t},I.Query.wildcard=new String("*"),I.Query.wildcard.NONE=0,I.Query.wildcard.LEADING=1,I.Query.wildcard.TRAILING=2,I.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},I.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=I.Query.wildcard.NONE),t.wildcard&I.Query.wildcard.LEADING&&t.term.charAt(0)!=I.Query.wildcard&&(t.term="*"+t.term),t.wildcard&I.Query.wildcard.TRAILING&&t.term.slice(-1)!=I.Query.wildcard&&(t.term=t.term+"*"),"presence"in t||(t.presence=I.Query.presence.OPTIONAL),this.clauses.push(t),this},I.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=I.Query.presence.PROHIBITED)return!1;return!0},I.Query.prototype.term=function(t,e){if(Array.isArray(t))return t.forEach(function(t){this.term(t,I.utils.clone(e))},this),this;var i=e||{};return i.term=t.toString(),this.clause(i),this},I.QueryParseError=function(t,e,i){this.name="QueryParseError",this.message=t,this.start=e,this.end=i},I.QueryParseError.prototype=new Error,I.QueryLexer=function(t){this.lexemes=[],this.str=t,this.length=t.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},I.QueryLexer.prototype.run=function(){for(var t=I.QueryLexer.lexText;t;)t=t(this)},I.QueryLexer.prototype.sliceString=function(){for(var t=[],e=this.start,i=this.pos,o=0;o<this.escapeCharPositions.length;o++)i=this.escapeCharPositions[o],t.push(this.str.slice(e,i)),e=i+1;return t.push(this.str.slice(e,this.pos)),this.escapeCharPositions.length=0,t.join("")},I.QueryLexer.prototype.emit=function(t){this.lexemes.push({type:t,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},I.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},I.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return I.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},I.QueryLexer.prototype.width=function(){return this.pos-this.start},I.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},I.QueryLexer.prototype.backup=function(){this.pos-=1},I.QueryLexer.prototype.acceptDigitRun=function(){var t,e;do{e=(t=this.next()).charCodeAt(0)}while(e>47&&e<58);t!=I.QueryLexer.EOS&&this.backup()},I.QueryLexer.prototype.more=function(){return this.pos<this.length},I.QueryLexer.EOS="EOS",I.QueryLexer.FIELD="FIELD",I.QueryLexer.TERM="TERM",I.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",I.QueryLexer.BOOST="BOOST",I.QueryLexer.PRESENCE="PRESENCE",I.QueryLexer.lexField=function(t){return t.backup(),t.emit(I.QueryLexer.FIELD),t.ignore(),I.QueryLexer.lexText},I.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(I.QueryLexer.TERM)),t.ignore(),t.more())return I.QueryLexer.lexText},I.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(I.QueryLexer.EDIT_DISTANCE),I.QueryLexer.lexText},I.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(I.QueryLexer.BOOST),I.QueryLexer.lexText},I.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(I.QueryLexer.TERM)},I.QueryLexer.termSeparator=I.tokenizer.separator,I.QueryLexer.lexText=function(t){for(;;){var e=t.next();if(e==I.QueryLexer.EOS)return I.QueryLexer.lexEOS;if(92!=e.charCodeAt(0)){if(":"==e)return I.QueryLexer.lexField;if("~"==e)return t.backup(),t.width()>0&&t.emit(I.QueryLexer.TERM),I.QueryLexer.lexEditDistance;if("^"==e)return t.backup(),t.width()>0&&t.emit(I.QueryLexer.TERM),I.QueryLexer.lexBoost;if("+"==e&&1===t.width())return t.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if("-"==e&&1===t.width())return t.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if(e.match(I.QueryLexer.termSeparator))return I.QueryLexer.lexTerm}else t.escapeCharacter()}},I.QueryParser=function(t,e){this.lexer=new I.QueryLexer(t),this.query=e,this.currentClause={},this.lexemeIdx=0},I.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=I.QueryParser.parseClause;t;)t=t(this);return this.query},I.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},I.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},I.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},I.QueryParser.parseClause=function(t){var e=t.peekLexeme();if(null!=e)switch(e.type){case I.QueryLexer.PRESENCE:return I.QueryParser.parsePresence;case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+e.type;throw e.str.length>=1&&(i+=" with value '"+e.str+"'"),new I.QueryParseError(i,e.start,e.end)}},I.QueryParser.parsePresence=function(t){var e=t.consumeLexeme();if(null!=e){switch(e.str){case"-":t.currentClause.presence=I.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=I.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+e.str+"'";throw new I.QueryParseError(i,e.start,e.end)}var o=t.peekLexeme();if(null==o){i="expecting term or field, found nothing";throw new I.QueryParseError(i,e.start,e.end)}switch(o.type){case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:i="expecting term or field, found '"+o.type+"'";throw new I.QueryParseError(i,o.start,o.end)}}},I.QueryParser.parseField=function(t){var e=t.consumeLexeme();if(null!=e){if(-1==t.query.allFields.indexOf(e.str)){var i=t.query.allFields.map(function(t){return"'"+t+"'"}).join(", "),o="unrecognised field '"+e.str+"', possible fields: "+i;throw new I.QueryParseError(o,e.start,e.end)}t.currentClause.fields=[e.str];var n=t.peekLexeme();if(null==n){o="expecting term, found nothing";throw new I.QueryParseError(o,e.start,e.end)}if(n.type===I.QueryLexer.TERM)return I.QueryParser.parseTerm;o="expecting term, found '"+n.type+"'";throw new I.QueryParseError(o,n.start,n.end)}},I.QueryParser.parseTerm=function(t){var e=t.consumeLexeme();if(null!=e){t.currentClause.term=e.str.toLowerCase(),-1!=e.str.indexOf("*")&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(null!=i)switch(i.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:var o="Unexpected lexeme type '"+i.type+"'";throw new I.QueryParseError(o,i.start,i.end)}else t.nextClause()}},I.QueryParser.parseEditDistance=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var o="edit distance must be numeric";throw new I.QueryParseError(o,e.start,e.end)}t.currentClause.editDistance=i;var n=t.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:o="Unexpected lexeme type '"+n.type+"'";throw new I.QueryParseError(o,n.start,n.end)}else t.nextClause()}},I.QueryParser.parseBoost=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var o="boost must be numeric";throw new I.QueryParseError(o,e.start,e.end)}t.currentClause.boost=i;var n=t.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:o="Unexpected lexeme type '"+n.type+"'";throw new I.QueryParseError(o,n.start,n.end)}else t.nextClause()}},P=this,k=function(){return I},"object"==typeof i?e.exports=k():P.lunr=k()}()},{}],33:[function(t,e,i){e.exports=Math.abs},{}],34:[function(t,e,i){e.exports=Math.floor},{}],35:[function(t,e,i){e.exports=Number.isNaN||function(t){return t!=t}},{}],36:[function(t,e,i){e.exports=Math.max},{}],37:[function(t,e,i){e.exports=Math.min},{}],38:[function(t,e,i){e.exports=Math.pow},{}],39:[function(t,e,i){e.exports=Math.round},{}],40:[function(t,e,i){var o=t("./isNaN");e.exports=function(t){return o(t)||0===t?t:t<0?-1:1}},{"./isNaN":35}],41:[function(t,e,i){(function(i){(function(){var o="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=o&&n&&"function"==typeof n.get?n.get:null,s=o&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,d=a&&l&&"function"==typeof l.get?l.get:null,c=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,u="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,f=Object.prototype.toString,g=Function.prototype.toString,v=String.prototype.match,b=String.prototype.slice,y=String.prototype.replace,w=String.prototype.toUpperCase,C=String.prototype.toLowerCase,x=RegExp.prototype.test,A=Array.prototype.concat,R=Array.prototype.join,E=Array.prototype.slice,D=Math.floor,S="function"==typeof BigInt?BigInt.prototype.valueOf:null,T=Object.getOwnPropertySymbols,F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,_="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===_||"symbol")?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function L(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||x.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var o=t<0?-D(-t):D(t);if(o!==t){var n=String(o),r=b.call(e,n.length+1);return y.call(n,i,"$&_")+"."+y.call(y.call(r,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(e,i,"$&_")}var M=t("./util.inspect"),B=M.custom,V=G(B)?B:null,H={__proto__:null,double:'"',single:"'"},N={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function j(t,e,i){var o=i.quoteStyle||e,n=H[o];return n+t+n}function O(t){return y.call(String(t),/"/g,""")}function U(t){return!P||!("object"==typeof t&&(P in t||void 0!==t[P]))}function z(t){return"[object Array]"===K(t)&&U(t)}function $(t){return"[object RegExp]"===K(t)&&U(t)}function G(t){if(_)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!F)return!1;try{return F.call(t),!0}catch(t){}return!1}e.exports=function t(e,o,n,a){var l=o||{};if(q(l,"quoteStyle")&&!q(H,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=!q(l,"customInspect")||l.customInspect;if("boolean"!=typeof f&&"symbol"!==f)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return X(e,l);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var x=String(e);return w?L(e,x):x}if("bigint"==typeof e){var D=String(e)+"n";return w?L(e,D):D}var T=void 0===l.depth?5:l.depth;if(void 0===n&&(n=0),n>=T&&T>0&&"object"==typeof e)return z(e)?"[Array]":"[Object]";var B=function(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=R.call(Array(t.indent+1)," ")}return{base:i,prev:R.call(Array(e+1),i)}}(l,n);if(void 0===a)a=[];else if(Q(a,e)>=0)return"[Circular]";function N(e,i,o){if(i&&(a=E.call(a)).push(i),o){var r={depth:l.depth};return q(l,"quoteStyle")&&(r.quoteStyle=l.quoteStyle),t(e,r,n+1,a)}return t(e,l,n+1,a)}if("function"==typeof e&&!$(e)){var W=function(t){if(t.name)return t.name;var e=v.call(g.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),J=it(e,N);return"[Function"+(W?": "+W:" (anonymous)")+"]"+(J.length>0?" { "+R.call(J,", ")+" }":"")}if(G(e)){var ot=_?y.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):F.call(e);return"object"!=typeof e||_?ot:Z(ot)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var nt="<"+C.call(String(e.nodeName)),rt=e.attributes||[],st=0;st<rt.length;st++)nt+=" "+rt[st].name+"="+j(O(rt[st].value),"double",l);return nt+=">",e.childNodes&&e.childNodes.length&&(nt+="..."),nt+="</"+C.call(String(e.nodeName))+">"}if(z(e)){if(0===e.length)return"[]";var at=it(e,N);return B&&!function(t){for(var e=0;e<t.length;e++)if(Q(t[e],"\n")>=0)return!1;return!0}(at)?"["+et(at,B)+"]":"[ "+R.call(at,", ")+" ]"}if(function(t){return"[object Error]"===K(t)&&U(t)}(e)){var lt=it(e,N);return"cause"in Error.prototype||!("cause"in e)||k.call(e,"cause")?0===lt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+R.call(lt,", ")+" }":"{ ["+String(e)+"] "+R.call(A.call("[cause]: "+N(e.cause),lt),", ")+" }"}if("object"==typeof e&&f){if(V&&"function"==typeof e[V]&&M)return M(e,{depth:T-n});if("symbol"!==f&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!r||!t||"object"!=typeof t)return!1;try{r.call(t);try{d.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var dt=[];return s&&s.call(e,function(t,i){dt.push(N(i,e,!0)+" => "+N(t,e))}),tt("Map",r.call(e),dt,B)}if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{d.call(t);try{r.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return c&&c.call(e,function(t){ct.push(N(t,e))}),tt("Set",d.call(e),ct,B)}if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{return u.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return"[object Number]"===K(t)&&U(t)}(e))return Z(N(Number(e)));if(function(t){if(!t||"object"!=typeof t||!S)return!1;try{return S.call(t),!0}catch(t){}return!1}(e))return Z(N(S.call(e)));if(function(t){return"[object Boolean]"===K(t)&&U(t)}(e))return Z(m.call(e));if(function(t){return"[object String]"===K(t)&&U(t)}(e))return Z(N(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==i&&e===i)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===K(t)&&U(t)}(e)&&!$(e)){var pt=it(e,N),ht=I?I(e)===Object.prototype:e instanceof Object||e.constructor===Object,ut=e instanceof Object?"":"null prototype",mt=!ht&&P&&Object(e)===e&&P in e?b.call(K(e),8,-1):ut?"Object":"",ft=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(mt||ut?"["+R.call(A.call([],mt||[],ut||[]),": ")+"] ":"");return 0===pt.length?ft+"{}":B?ft+"{"+et(pt,B)+"}":ft+"{ "+R.call(pt,", ")+" }"}return String(e)};var W=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return W.call(t,e)}function K(t){return f.call(t)}function Q(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,o=t.length;i<o;i++)if(t[i]===e)return i;return-1}function X(t,e){if(t.length>e.maxStringLength){var i=t.length-e.maxStringLength,o="... "+i+" more character"+(i>1?"s":"");return X(b.call(t,0,e.maxStringLength),e)+o}var n=N[e.quoteStyle||"single"];return n.lastIndex=0,j(y.call(y.call(t,n,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function tt(t,e,i,o){return t+" ("+e+") {"+(o?et(i,o):R.call(i,", "))+"}"}function et(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+R.call(t,","+i)+"\n"+e.prev}function it(t,e){var i=z(t),o=[];if(i){o.length=t.length;for(var n=0;n<t.length;n++)o[n]=q(t,n)?e(t[n],t):""}var r,s="function"==typeof T?T(t):[];if(_){r={};for(var a=0;a<s.length;a++)r["$"+s[a]]=s[a]}for(var l in t)q(t,l)&&(i&&String(Number(l))===l&&l<t.length||_&&r["$"+l]instanceof Symbol||(x.call(/[^\w$]/,l)?o.push(e(l,t)+": "+e(t[l],t)):o.push(l+": "+e(t[l],t))));if("function"==typeof T)for(var d=0;d<s.length;d++)k.call(t,s[d])&&o.push("["+e(s[d])+"]: "+e(t[s[d]],t));return o}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util.inspect":1}],42:[function(t,e,i){(function(t){(function(){function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function o(t,e){for(var i,o="",n=0,r=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)i=t.charCodeAt(a);else{if(47===i)break;i=47}if(47===i){if(r===a-1||1===s);else if(r!==a-1&&2===s){if(o.length<2||2!==n||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var l=o.lastIndexOf("/");if(l!==o.length-1){-1===l?(o="",n=0):n=(o=o.slice(0,l)).length-1-o.lastIndexOf("/"),r=a,s=0;continue}}else if(2===o.length||1===o.length){o="",n=0,r=a,s=0;continue}e&&(o.length>0?o+="/..":o="..",n=2)}else o.length>0?o+="/"+t.slice(r+1,a):o=t.slice(r+1,a),n=a-r-1;r=a,s=0}else 46===i&&-1!==s?++s:s=-1}return o}var n={resolve:function(){for(var e,n="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=t.cwd()),a=e),i(a),0!==a.length&&(n=a+"/"+n,r=47===a.charCodeAt(0))}return n=o(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var o=arguments[e];i(o),o.length>0&&(void 0===t?t=o:t+="/"+o)}return void 0===t?".":n.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=n.resolve(t))===(e=n.resolve(e)))return"";for(var o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var r=t.length,s=r-o,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var l=e.length-a,d=s<l?s:l,c=-1,p=0;p<=d;++p){if(p===d){if(l>d){if(47===e.charCodeAt(a+p))return e.slice(a+p+1);if(0===p)return e.slice(a+p)}else s>d&&(47===t.charCodeAt(o+p)?c=p:0===p&&(c=0));break}var h=t.charCodeAt(o+p);if(h!==e.charCodeAt(a+p))break;47===h&&(c=p)}var u="";for(p=o+c+1;p<=r;++p)p!==r&&47!==t.charCodeAt(p)||(0===u.length?u+="..":u+="/..");return u.length>0?u+e.slice(a+c):(a+=c,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),o=47===e,n=-1,r=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!r){n=s;break}}else r=!1;return-1===n?o?"/":".":o&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var o,n=0,r=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(o=t.length-1;o>=0;--o){var d=t.charCodeAt(o);if(47===d){if(!s){n=o+1;break}}else-1===l&&(s=!1,l=o+1),a>=0&&(d===e.charCodeAt(a)?-1===--a&&(r=o):(a=-1,r=l))}return n===r?r=l:-1===r&&(r=t.length),t.slice(n,r)}for(o=t.length-1;o>=0;--o)if(47===t.charCodeAt(o)){if(!s){n=o+1;break}}else-1===r&&(s=!1,r=o+1);return-1===r?"":t.slice(n,r)},extname:function(t){i(t);for(var e=-1,o=0,n=-1,r=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(47!==l)-1===n&&(r=!1,n=a+1),46===l?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!r){o=a+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===o+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var i=e.dir||e.root,o=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+o:i+t+o:o}("/",t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var o,n=t.charCodeAt(0),r=47===n;r?(e.root="/",o=1):o=0;for(var s=-1,a=0,l=-1,d=!0,c=t.length-1,p=0;c>=o;--c)if(47!==(n=t.charCodeAt(c)))-1===l&&(d=!1,l=c+1),46===n?-1===s?s=c:1!==p&&(p=1):-1!==s&&(p=-1);else if(!d){a=c+1;break}return-1===s||-1===l||0===p||1===p&&s===l-1&&s===a+1?-1!==l&&(e.base=e.name=0===a&&r?t.slice(1,l):t.slice(a,l)):(0===a&&r?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(a,s),e.base=t.slice(a,l)),e.ext=t.slice(s,l)),a>0?e.dir=t.slice(0,a-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n}).call(this)}).call(this,t("_process"))},{_process:77}],43:[function(t,e,i){e.exports={name:"pict-application",version:"1.0.33",description:"Application base class for a pict view-based application",main:"source/Pict-Application.js",scripts:{test:"npx quack test",start:"node source/Pict-Application.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-application-image:local","docker-dev-run":'docker run -it -d --name pict-application-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-application" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-application-image:local',"docker-dev-shell":"docker exec -it pict-application-dev /bin/bash",tests:"npx quack test -g",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Application.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-application.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-application/issues"},homepage:"https://github.com/stevenvelozo/pict-application#readme",devDependencies:{"@eslint/js":"^9.28.0","browser-env":"^3.3.0",eslint:"^9.28.0",pict:"^1.0.348","pict-provider":"^1.0.10","pict-view":"^1.0.66",quackage:"^1.0.58",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{"fable-serviceproviderbase":"^3.0.19"}}},{}],44:[function(t,e,i){const o=t("fable-serviceproviderbase"),n=t("../package.json"),r={Name:"DefaultPictApplication",MainViewportViewIdentifier:"Default-View",MainViewportRenderableHash:!1,MainViewportDestinationAddress:!1,MainViewportDefaultDataAddress:!1,AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!0,AutoRenderViewsAfterInitialize:!1,AutoLoginAfterInitialize:!1,AutoLoadDataAfterLogin:!1,ConfigurationOnlyViews:[],Manifests:{},IdentifierAddressPrefix:"PICT-"};e.exports=class extends o{constructor(t,e,i){let o="object"==typeof t.settings.PictApplicationConfiguration?t.settings.PictApplicationConfiguration:{};super(t,Object.assign({},JSON.parse(JSON.stringify(r)),o,e),i),this.options,this.log,this.fable,this.UUID,this.Hash,this.servicesMap,this.serviceType="PictApplication",this._Package=n,this.pict=this.fable,this.AppData=this.fable.AppData,this.Bundle=this.fable.Bundle,this.initializeTimestamp,this.lastSolvedTimestamp,this.lastLoginTimestamp,this.lastMarshalFromViewsTimestamp,this.lastMarshalToViewsTimestamp,this.lastAutoRenderTimestamp,this.lastLoadDataTimestamp;let s=Object.keys(this.options.Manifests);if(s.length>0)for(let t=0;t<s.length;t++){let e=s[t];this.fable.instantiateServiceProvider("Manifest",this.options.Manifests[e],e)}}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onPreSolve:`),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSolve:`),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSolve:`),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing solve() function...`);let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let o=this.pict.providers[t[i]];o.options.AutoSolveWithApp&&e.push(o)}e.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<e.length;t++)e[t].solve(e[t]);this.onBeforeSolve();let i=Object.keys(this.pict.views),o=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&o.push(e)}o.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<o.length;t++)o[t].solve();return this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),!0}solveAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");e.anticipate(this.onBeforeSolveAsync.bind(this));let i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${t}`,t)});let o=Object.keys(this.pict.providers),n=[];for(let t=0;t<o.length;t++){let e=this.pict.providers[o[t]];e.options.AutoSolveWithApp&&n.push(e)}n.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<n.length;t++)e.anticipate(n[t].solveAsync.bind(n[t]));let r=Object.keys(this.pict.views),s=[];for(let t=0;t<r.length;t++){let e=this.pict.views[r[t]];e.options.AutoSolveWithApp&&s.push(e)}s.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<s.length;t++)e.anticipate(s[t].solveAsync.bind(s[t]));e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync() complete.`),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSolve:`),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoginAsync:`),t()}onLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoginAsync:`),t()}loginAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeLoginAsync.bind(this)),e.anticipate(this.onLoginAsync.bind(this)),e.anticipate(this.onAfterLoginAsync.bind(this)),this.options.AutoLoadDataAfterLogin&&e.anticipate(t=>{if(!this.isLoggedIn())return t();this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto loading data after login...`),this.loadDataAsync(e=>{t(e)})}),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync() complete.`),this.lastLoginTimestamp=this.fable.log.getTimeStamp(),i(t)))}isLoggedIn(){return!0}onAfterLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoginAsync:`),t()}onBeforeLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoadDataAsync:`),t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoadDataAsync:`),t()}loadDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeLoadDataAsync.bind(this));let o=Object.keys(this.pict.providers),n=[];for(let t=0;t<o.length;t++){let e=this.pict.providers[o[t]];e.options.AutoLoadDataWithApp&&n.push(e)}n.sort((t,e)=>t.options.AutoLoadDataOrdinal-e.options.AutoLoadDataOrdinal);for(const t of n)e.anticipate(t.onBeforeLoadDataAsync.bind(t));e.anticipate(this.onLoadDataAsync.bind(this));for(const t of n)e.anticipate(t.onLoadDataAsync.bind(t));e.anticipate(this.onAfterLoadDataAsync.bind(this));for(const t of n)e.anticipate(t.onAfterLoadDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync() complete.`),this.lastLoadDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoadDataAsync:`),t()}onBeforeSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSaveDataAsync:`),t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSaveDataAsync:`),t()}saveDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeSaveDataAsync.bind(this));let o=Object.keys(this.pict.providers),n=[];for(let t=0;t<o.length;t++){let e=this.pict.providers[o[t]];e.options.AutoSaveDataWithApp&&n.push(e)}n.sort((t,e)=>t.options.AutoSaveDataOrdinal-e.options.AutoSaveDataOrdinal);for(const t of n)e.anticipate(t.onBeforeSaveDataAsync.bind(t));e.anticipate(this.onSaveDataAsync.bind(this));for(const t of n)e.anticipate(t.onSaveDataAsync.bind(t));e.anticipate(this.onAfterSaveDataAsync.bind(this));for(const t of n)e.anticipate(t.onAfterSaveDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync() complete.`),this.lastSaveDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSaveDataAsync:`),t()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize:`),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize called but initialization is already completed. Aborting.`),!1;{if(this.onBeforeInitialize(),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${e}`),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}this.onInitialize();let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let o=this.pict.providers[t[i]];o.options.AutoInitialize&&e.push(o)}e.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<e.length;t++)e[t].initialize();let i=Object.keys(this.pict.views),o=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&o.push(e)}o.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<o.length;t++)o[t].initialize();return this.onAfterInitialize(),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving after initialization...`),this.solve()),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering after initialization...`),this.render()),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.onCompletionOfInitialize(),!0}}initializeAsync(t){this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync:`);let e="function"==typeof t&&t;if(e||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Auto Callback Error: ${t}`,t)}),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} async initialize called but initialization is already completed. Aborting.`),this.onCompletionOfInitializeAsync(e);{let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");if(this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning initialization...`),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${e}`),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}t.anticipate(this.onBeforeInitializeAsync.bind(this)),t.anticipate(this.onInitializeAsync.bind(this));let i=Object.keys(this.pict.providers),o=[];for(let t=0;t<i.length;t++){let e=this.pict.providers[i[t]];e.options.AutoInitialize&&o.push(e)}o.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<o.length;e++)t.anticipate(o[e].initializeAsync.bind(o[e]));let n=Object.keys(this.pict.views),r=[];for(let t=0;t<n.length;t++){let e=this.pict.views[n[t]];e.options.AutoInitialize&&r.push(e)}r.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<r.length;e++){let i=r[e];t.anticipate(i.initializeAsync.bind(i))}t.anticipate(this.onAfterInitializeAsync.bind(this)),this.options.AutoLoginAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto login (asynchronously) after initialization...`),t.anticipate(this.loginAsync.bind(this))),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving (asynchronously) after initialization...`),t.anticipate(this.solveAsync.bind(this))),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering (asynchronously) after initialization...`),t.anticipate(this.renderMainViewportAsync.bind(this))),t.wait(t=>(t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Error: ${t.message||t}`,{stack:t.stack}),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialization complete.`),e()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onCompletionOfInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onCompletionOfInitialize:`),!0}onCompletionOfInitializeAsync(t){return this.onCompletionOfInitialize(),t()}onBeforeMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalFromViews:`),!0}onBeforeMarshalFromViewsAsync(t){return this.onBeforeMarshalFromViews(),t()}onMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalFromViews:`),!0}onMarshalFromViewsAsync(t){return this.onMarshalFromViews(),t()}marshalFromViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalFromViews() function...`),this.onBeforeMarshalFromViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let o=this.pict.views[t[i]];e.push(o)}for(let t=0;t<e.length;t++)e[t].marshalFromView();return this.onMarshalFromViews(),this.onAfterMarshalFromViews(),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalFromViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalFromViewsAsync.bind(this));let o=Object.keys(this.pict.views),n=[];for(let t=0;t<o.length;t++){let e=this.pict.views[o[t]];n.push(e)}for(let t=0;t<n.length;t++)e.anticipate(n[t].marshalFromViewAsync.bind(n[t]));e.anticipate(this.onMarshalFromViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync() complete.`),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalFromViews:`),!0}onAfterMarshalFromViewsAsync(t){return this.onAfterMarshalFromViews(),t()}onBeforeMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalToViews:`),!0}onBeforeMarshalToViewsAsync(t){return this.onBeforeMarshalToViews(),t()}onMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalToViews:`),!0}onMarshalToViewsAsync(t){return this.onMarshalToViews(),t()}marshalToViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalToViews() function...`),this.onBeforeMarshalToViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let o=this.pict.views[t[i]];e.push(o)}for(let t=0;t<e.length;t++)e[t].marshalToView();return this.onMarshalToViews(),this.onAfterMarshalToViews(),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalToViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalToViewsAsync.bind(this));let o=Object.keys(this.pict.views),n=[];for(let t=0;t<o.length;t++){let e=this.pict.views[o[t]];n.push(e)}for(let t=0;t<n.length;t++)e.anticipate(n[t].marshalToViewAsync.bind(n[t]));e.anticipate(this.onMarshalToViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync() complete.`),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalToViews:`),!0}onAfterMarshalToViewsAsync(t){return this.onAfterMarshalToViews(),t()}onBeforeRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeRender:`),!0}onBeforeRenderAsync(t){return this.onBeforeRender(),t()}render(t,e,i,o){let n="string"!=typeof t?this.options.MainViewportViewIdentifier:t,r="string"!=typeof e?this.options.MainViewportRenderableHash:e,s="string"!=typeof i?this.options.MainViewportDestinationAddress:i,a="string"!=typeof o?this.options.MainViewportDefaultDataAddress:o;this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${r}] Destination[${s}] TemplateDataAddress[${a}] render:`),this.onBeforeRender();let l="string"==typeof n&&this.servicesMap.PictView[n];return l?(this.onRender(),l.render(r,s,a),this.onAfterRender(),!0):(this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not render from View ${n} because it is not a valid view.`),!1)}onRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onRender:`),!0}onRenderAsync(t){return this.onRender(),t()}renderAsync(t,e,i,o,n){let r="string"!=typeof t?this.options.MainViewportViewIdentifier:t,s="string"!=typeof e?this.options.MainViewportRenderableHash:e,a="string"!=typeof i?this.options.MainViewportDestinationAddress:i,l="string"!=typeof o?this.options.MainViewportDefaultDataAddress:o,d="function"==typeof n?n:"function"==typeof o?o:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof t&&t;d||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),d=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${t}`,t)}),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${s}] Destination[${a}] TemplateDataAddress[${l}] renderAsync:`);let c=this.fable.newAnticipate();c.anticipate(this.onBeforeRenderAsync.bind(this));let p="string"==typeof r&&this.servicesMap.PictView[r];if(!p){let t=`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not asynchronously render from View ${r} because it is not a valid view.`;return this.pict.LogNoisiness>3&&this.log.error(t),d(new Error(t))}return c.anticipate(this.onRenderAsync.bind(this)),c.anticipate(t=>{p.renderAsync.call(p,s,a,l,t)}),c.anticipate(this.onAfterRenderAsync.bind(this)),c.wait(d)}onAfterRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterRender:`),!0}onAfterRenderAsync(t){return this.onAfterRender(),t()}renderMainViewport(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewport:`),this.render()}renderMainViewportAsync(t){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewportAsync:`),this.renderAsync(t)}renderAutoViews(){this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViews...`);let t=Object.keys(this.pict.views);t.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let e=0;e<t.length;e++){let i=this.pict.views[t[e]];i.options.AutoRender&&i.render()}this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`)}renderAutoViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync Auto Callback Error: ${t}`,t)}),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViewsAsync...`);let o=Object.keys(this.pict.views);o.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let t=0;t<o.length;t++){let i=this.pict.views[o[t]];i.options.AutoRender&&e.anticipate(i.renderAsync.bind(i))}e.wait(t=>(this.lastAutoRenderTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`),i(t)))}get isPictApplication(){return!0}}},{"../package.json":43,"fable-serviceproviderbase":20}],45:[function(t,e,i){e.exports={name:"pict-provider",version:"1.0.12",description:"Pict Provider Base Class",main:"source/Pict-Provider.js",scripts:{start:"node source/Pict-Provider.js",test:"npx quack test",tests:"npx quack test -g",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-provider-image:local","docker-dev-run":'docker run -it -d --name pict-provider-dev -p 24125:8080 -p 30027:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-provider" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-provider-image:local',"docker-dev-shell":"docker exec -it pict-provider-dev /bin/bash",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Provider.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-provider.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-provider/issues"},homepage:"https://github.com/stevenvelozo/pict-provider#readme",devDependencies:{"@eslint/js":"^9.39.1",eslint:"^9.39.1",pict:"^1.0.351",quackage:"^1.0.58",typescript:"^5.9.3"},dependencies:{"fable-serviceproviderbase":"^3.0.19"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]}}},{}],46:[function(t,e,i){const o=t("fable-serviceproviderbase"),n=t("../package.json"),r={ProviderIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoLoadDataWithApp:!0,AutoLoadDataOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,Manifests:{},Templates:[]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),i),this.fable,this.pict,this.log,this.options,this.UUID,this.Hash,this.options.ProviderIdentifier||(this.options.ProviderIdentifier=`AutoProviderID-${this.fable.getUUID()}`),this.serviceType="PictProvider",this._Package=n,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1;for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];e.hasOwnProperty("Postfix")&&e.hasOwnProperty("Template")?(e.Source||(e.Source=`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} options object.`),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} could not load Default Template ${t} in the options array.`,e)}}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow PROVIDER [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initialize:`),this.initializeTimestamp?(this.log.warn(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initialize called but initialization is already completed. Aborting.`),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow PROVIDER [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initializeAsync:`),this.initializeTimestamp)return this.log.warn(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} async initialize called but initialization is already completed. Aborting.`),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} beginning initialization...`),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(this.initializeTimestamp=this.pict.log.getTimeStamp(),e?this.log.error(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initialization failed: ${e.message||e}`,{Stack:e.stack}):this.pict.LogNoisiness>0&&this.log.info(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initialization complete.`),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onPreRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onPreRender:`),!0}onPreRenderAsync(t){return this.onPreRender(),t()}render(){return this.onPreRender()}renderAsync(t){return this.onPreRender(),t()}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onPreSolve:`),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}solve(){return this.onPreSolve()}solveAsync(t){return this.onPreSolve(),t()}onBeforeLoadDataAsync(t){return t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onLoadDataAsync:`),t()}onAfterLoadDataAsync(t){return t()}onBeforeSaveDataAsync(t){return t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onSaveDataAsync:`),t()}onAfterSaveDataAsync(t){return t()}}},{"../package.json":45,"fable-serviceproviderbase":20}],47:[function(t,e,i){const o={javascript:{tokenizer:/(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2|(`(?:[^`\\]|\\.)*?`)|(\/(?![/*])(?:\\.|\[(?:\\.|[^\]])*\]|[^/\\\n])+\/[gimsuvy]*)/g,keywords:/\b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|from|function|get|if|import|in|instanceof|let|new|of|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/g,builtins:/\b(true|false|null|undefined|NaN|Infinity|console|window|document|Math|JSON|Array|Object|String|Number|Boolean|Date|RegExp|Map|Set|Promise|Error|Symbol|parseInt|parseFloat|require|module|exports)\b/g,numbers:/\b(\d+\.?\d*(?:e[+-]?\d+)?|0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+)\b/g},json:{tokenizer:/(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|("(?:[^"\\]|\\.)*")/g,keywords:/\b(true|false|null)\b/g,numbers:/-?\b\d+\.?\d*(?:e[+-]?\d+)?\b/g},html:{tokenizer:/(<!--[\s\S]*?-->)|(["'])(?:(?!\2|\\).|\\.)*?\2|(<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*\/?>)/g,tagGroupIndex:3},css:{tokenizer:/(\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2/g,selectors:/([.#]?[a-zA-Z_][\w-]*(?:\s*[>+~]\s*[.#]?[a-zA-Z_][\w-]*)*)\s*\{/g,properties:/\b([a-zA-Z-]+)\s*:/g,numbers:/\b(\d+\.?\d*)(px|em|rem|%|vh|vw|s|ms|deg|fr)?\b/g,keywords:/\b(important|inherit|initial|unset|none|auto|block|inline|flex|grid)\b/g},sql:{tokenizer:/(--[^\n]*|\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2/g,keywords:/\b(SELECT|FROM|WHERE|AND|OR|INSERT|INTO|VALUES|UPDATE|SET|DELETE|CREATE|TABLE|DROP|ALTER|ADD|COLUMN|INDEX|JOIN|LEFT|RIGHT|INNER|OUTER|ON|AS|ORDER|BY|GROUP|HAVING|LIMIT|OFFSET|UNION|ALL|DISTINCT|COUNT|SUM|AVG|MIN|MAX|NOT|NULL|IS|IN|BETWEEN|LIKE|EXISTS|CASE|WHEN|THEN|ELSE|END|PRIMARY|KEY|FOREIGN|REFERENCES|CONSTRAINT|DEFAULT|CHECK|UNIQUE|CASCADE|GRANT|REVOKE|COMMIT|ROLLBACK|BEGIN|TRANSACTION|INT|VARCHAR|DATETIME|AUTO_INCREMENT|CURRENT_TIMESTAMP)\b/gi,numbers:/\b\d+\.?\d*\b/g}};function n(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function r(t,e){let i=t;return e.selectors&&(e.selectors.lastIndex=0,i=i.replace(e.selectors,'<span class="function-name">$1</span>{')),e.properties&&(e.properties.lastIndex=0,i=i.replace(e.properties,'<span class="property">$1</span>:')),e.keywords&&(e.keywords.lastIndex=0,i=i.replace(e.keywords,'<span class="keyword">$1</span>')),e.builtins&&(e.builtins.lastIndex=0,i=i.replace(e.builtins,'<span class="keyword">$1</span>')),e.numbers&&(e.numbers.lastIndex=0,i=i.replace(e.numbers,t=>`<span class="number">${t}</span>`)),i}function s(t){let e="",i=t,o=i.match(/^(<\/?)([a-zA-Z][a-zA-Z0-9-]*)/);if(!o)return n(t);e+=n(o[1]),e+='<span class="tag">'+n(o[2])+"</span>",i=i.substring(o[0].length);let r,s=/^(\s+)([a-zA-Z-]+)(?:(\s*=\s*)(["'])([^"']*?)\4)?/;for(;null!==(r=i.match(s));)e+=r[1],e+='<span class="attr-name">'+n(r[2])+"</span>",r[3]&&(e+=n(r[3]),e+='<span class="attr-value">'+n(r[4])+n(r[5])+n(r[4])+"</span>"),i=i.substring(r[0].length);return e+=n(i),e}o.js=o.javascript,o.htm=o.html,e.exports=function(t){return function(e){let i=e.textContent,a="string"==typeof t?t.toLowerCase():"javascript",l=o[a];if(!l)return void(e.innerHTML=n(i));if(!l.tokenizer)return void(e.innerHTML=r(n(i),l));let d,c="",p=0,h=l.tagGroupIndex||0;for(l.tokenizer.lastIndex=0;null!==(d=l.tokenizer.exec(i));){if(d.index>p){c+=r(n(i.substring(p,d.index)),l)}let t=d[0];d[1]?c+=`<span class="comment">${n(t)}</span>`:h>0&&d[h]?c+=s(t):c+=`<span class="string">${n(t)}</span>`,p=l.tokenizer.lastIndex}if(p<i.length){c+=r(n(i.substring(p)),l)}e.innerHTML=c}},e.exports.LanguageDefinitions=o},{}],48:[function(t,e,i){e.exports={RenderOnLoad:!0,DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#CodeEditor-Container-Div",Templates:[{Hash:"CodeEditor-Container",Template:"\x3c!-- CodeEditor-Container Rendering Soon --\x3e"}],Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#CodeEditor-Container-Div"}],TargetElementAddress:"#CodeEditor-Container-Div",CodeDataAddress:!1,Language:"javascript",ReadOnly:!1,Tab:"\t",IndentOn:/[({[]$/,MoveToNewLine:/^[)}\]]/,AddClosing:!0,CatchTab:!0,LineNumbers:!0,DefaultCode:"// Enter your code here\n",CSS:".pict-code-editor-wrap\n{\n\tdisplay: flex;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\tborder: 1px solid #D0D0D0;\n\tborder-radius: 4px;\n\toverflow: auto;\n}\n.pict-code-editor-wrap .pict-code-line-numbers\n{\n\tposition: sticky;\n\tleft: 0;\n\twidth: 40px;\n\tmin-width: 40px;\n\tpadding: 10px 0;\n\ttext-align: right;\n\tbackground: #F5F5F5;\n\tborder-right: 1px solid #D0D0D0;\n\tcolor: #999;\n\tfont-size: 13px;\n\tline-height: 1.5;\n\tuser-select: none;\n\tpointer-events: none;\n\tbox-sizing: border-box;\n\tz-index: 1;\n}\n.pict-code-editor-wrap .pict-code-line-numbers span\n{\n\tdisplay: block;\n\tpadding: 0 8px 0 0;\n}\n.pict-code-editor-wrap .pict-code-editor\n{\n\tmargin: 0;\n\tpadding: 10px 10px 10px 8px;\n\tmin-height: 100px;\n\tflex: 1;\n\tmin-width: 0;\n\toutline: none;\n\ttab-size: 4;\n\twhite-space: pre;\n\toverflow-wrap: normal;\n\tcolor: #383A42;\n\tbackground: #FAFAFA;\n\tcaret-color: #526FFF;\n\tborder-radius: 0 4px 4px 0;\n}\n.pict-code-editor-wrap .pict-code-editor.pict-code-no-line-numbers\n{\n\tpadding-left: 10px;\n\tborder-radius: 4px;\n}\n.pict-code-editor-wrap .pict-code-editor .keyword { color: #A626A4; }\n.pict-code-editor-wrap .pict-code-editor .string { color: #50A14F; }\n.pict-code-editor-wrap .pict-code-editor .number { color: #986801; }\n.pict-code-editor-wrap .pict-code-editor .comment { color: #A0A1A7; font-style: italic; }\n.pict-code-editor-wrap .pict-code-editor .operator { color: #0184BC; }\n.pict-code-editor-wrap .pict-code-editor .punctuation { color: #383A42; }\n.pict-code-editor-wrap .pict-code-editor .function-name { color: #4078F2; }\n.pict-code-editor-wrap .pict-code-editor .property { color: #E45649; }\n.pict-code-editor-wrap .pict-code-editor .tag { color: #E45649; }\n.pict-code-editor-wrap .pict-code-editor .attr-name { color: #986801; }\n.pict-code-editor-wrap .pict-code-editor .attr-value { color: #50A14F; }\n"}},{}],49:[function(t,e,i){const o=t("pict-view"),n=t("./Pict-Code-Highlighter.js"),r=t("./Pict-Section-Code-DefaultConfiguration.js");e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this.codeJar=null,this._highlightFunction=null,this._language=this.options.Language||"javascript"}onBeforeInitialize(){return super.onBeforeInitialize(),this._codeJarPrototype=null,this.targetElement=!1,this._highlightFunction=n(this._language),super.onBeforeInitialize()}connectCodeJarPrototype(t){if("function"!=typeof t)return"undefined"!=typeof window&&"function"==typeof window.CodeJar?(this.log.trace("PICT-Code Found CodeJar in window.CodeJar."),void(this._codeJarPrototype=window.CodeJar)):(this.log.error("PICT-Code No CodeJar prototype found. Include codejar via script tag or call connectCodeJarPrototype(CodeJar) explicitly."),!1);this._codeJarPrototype=t}onAfterRender(t){return this.pict.CSSMap.injectCSS(),this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeJarPrototype||this.connectCodeJarPrototype(),!this._codeJarPrototype)return this.log.error("PICT-Code Cannot initialize editor; no CodeJar prototype available."),!1;if(this.codeJar)return this.log.error("PICT-Code editor is already initialized!"),!1;let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error(`PICT-Code Could not find target element [${this.options.TargetElementAddress}]!`),this.targetElement=!1,!1;this.targetElement=t[0],this._buildEditorDOM();let e=this._resolveCodeContent(),i={};this.options.Tab&&(i.tab=this.options.Tab),this.options.IndentOn&&(i.indentOn=this.options.IndentOn),this.options.MoveToNewLine&&(i.moveToNewLine=this.options.MoveToNewLine),void 0!==this.options.AddClosing&&(i.addClosing=this.options.AddClosing),void 0!==this.options.CatchTab&&(i.catchTab=this.options.CatchTab),this.customConfigureEditorOptions(i);let o=this._editorElement;this.codeJar=this._codeJarPrototype(o,this._highlightFunction,i),this._resetEditorWrapStyles(),e&&this.codeJar.updateCode(e),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)}),this._updateLineNumbers(),this.options.ReadOnly&&o.setAttribute("contenteditable","false")}_buildEditorDOM(){this.targetElement.innerHTML="";let t=document.createElement("div");if(t.className="pict-code-editor-wrap",this.options.LineNumbers){let e=document.createElement("div");e.className="pict-code-line-numbers",t.appendChild(e),this._lineNumbersElement=e}let e=document.createElement("div");e.className="pict-code-editor language-"+this._language,this.options.LineNumbers||(e.className+=" pict-code-no-line-numbers"),t.appendChild(e),this.targetElement.appendChild(t),this._editorElement=e,this._wrapElement=t}_updateLineNumbers(){if(!this.options.LineNumbers||!this._lineNumbersElement||!this._editorElement)return;let t=(this._editorElement.textContent||"").split("\n").length,e="";for(let i=1;i<=t;i++)e+=`<span>${i}</span>`;this._lineNumbersElement.innerHTML=e}_resetEditorWrapStyles(){this._editorElement&&(this._editorElement.style.whiteSpace="pre",this._editorElement.style.overflowWrap="normal")}_resolveCodeContent(){if(this.options.CodeDataAddress){const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.CodeDataAddress);if("string"==typeof e)return e;this.log.warn(`PICT-Code Address [${this.options.CodeDataAddress}] did not return a string; it was ${typeof e}.`)}return this.options.DefaultCode||""}customConfigureEditorOptions(t){}onCodeChange(t){if(this.options.CodeDataAddress){const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.CodeDataAddress,t)}}getCode(){return this.codeJar?this.codeJar.toString():(this.log.warn("PICT-Code getCode called before editor initialized."),"")}setCode(t){this.codeJar?(this.codeJar.updateCode(t),this._updateLineNumbers()):this.log.warn("PICT-Code setCode called before editor initialized.")}setLanguage(t){if(this._language=t,this._highlightFunction=n(t),this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this._resetEditorWrapStyles(),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}setHighlightFunction(t){if("function"==typeof t){if(this._highlightFunction=t,this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this._resetEditorWrapStyles(),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}else this.log.error("PICT-Code setHighlightFunction requires a function.")}setReadOnly(t){this.options.ReadOnly=t,this._editorElement&&this._editorElement.setAttribute("contenteditable",t?"false":"true")}destroy(){this.codeJar&&(this.codeJar.destroy(),this.codeJar=null)}marshalToView(){if(super.marshalToView(),this.codeJar&&this.options.CodeDataAddress){let t=this._resolveCodeContent();"string"==typeof t&&(this.codeJar.updateCode(t),this._updateLineNumbers())}}marshalFromView(){super.marshalFromView(),this.codeJar&&this.options.CodeDataAddress&&this.onCodeChange(this.codeJar.toString())}},e.exports.default_configuration=r,e.exports.createHighlighter=n},{"./Pict-Code-Highlighter.js":47,"./Pict-Section-Code-DefaultConfiguration.js":48,"pict-view":76}],50:[function(t,e,i){e.exports=t("./views/Pict-View-Content.js"),e.exports.PictContentProvider=t("./providers/Pict-Provider-Content.js")},{"./providers/Pict-Provider-Content.js":51,"./views/Pict-View-Content.js":52}],51:[function(t,e,i){const o=t("pict-provider"),n=t("pict-section-code").createHighlighter;e.exports=class extends o{constructor(t,e,i){super(t,e,i)}highlightCode(t,e){if(!t)return"";let i={textContent:t,innerHTML:""};return n(e)(i),i.innerHTML}generateLineNumbers(t){if(!t)return"<span>1</span>";let e=t.split("\n").length,i="";for(let t=1;t<=e;t++)i+="<span>"+t+"</span>";return i}parseMarkdown(t,e,i){if(!t)return"";let o=t.split("\n"),n=[],r=!1,s=0,a="",l=[],d=!1,c="",p=!1,h=[],u=!1,m=[],f=[],g=()=>{f.length>0&&(n.push("<p>"+f.map(t=>this.parseInline(t,e,i)).join(" ")+"</p>"),f=[])};for(let t=0;t<o.length;t++){let v=o[t];if(!r&&v.trim().match(/^\$\$/)){u?(n.push('<div class="pict-content-katex-display">'+m.join("\n")+"</div>"),u=!1,m=[]):(g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),p&&(n.push("<blockquote>"+this.parseMarkdown(h.join("\n"),e,i)+"</blockquote>"),p=!1,h=[]),u=!0);continue}if(u){m.push(v);continue}let b=v.match(/^(`{3,})/);if(b){let t=b[1].length;if(r){if(t>=s&&v.trim()===b[1]){if("mermaid"===a)n.push('<pre class="mermaid">'+l.join("\n")+"</pre>");else{let t=l.join("\n"),e=this.highlightCode(t,a),i=this.generateLineNumbers(t);n.push('<div class="pict-content-code-wrap"><div class="pict-content-code-line-numbers">'+i+'</div><pre><code class="language-'+this.escapeHTML(a)+'">'+e+"</code></pre></div>")}r=!1,s=0,a="",l=[];continue}l.push(v);continue}g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),p&&(n.push("<blockquote>"+this.parseMarkdown(h.join("\n"),e,i)+"</blockquote>"),p=!1,h=[]),s=t,a=v.replace(/^`{3,}/,"").trim(),r=!0;continue}if(r){l.push(v);continue}if(v.match(/^>\s?/)){p||(g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),p=!0,h=[]),h.push(v.replace(/^>\s?/,""));continue}if(p&&(n.push("<blockquote>"+this.parseMarkdown(h.join("\n"),e,i)+"</blockquote>"),p=!1,h=[]),v.match(/^(-{3,}|\*{3,}|_{3,})\s*$/)){g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),n.push("<hr>");continue}let y=v.match(/^(#{1,6})\s+(.+)/);if(y){g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1);let t=y[1].length,o=this.parseInline(y[2],e,i),r=y[2].toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-");n.push("<h"+t+' id="'+r+'">'+o+"</h"+t+">");continue}let w=v.match(/^(\s*)[-*+]\s+(.*)/);if(w){g(),d&&"ul"===c||(d&&n.push("ul"===c?"</ul>":"</ol>"),n.push("<ul>"),d=!0,c="ul"),n.push("<li>"+this.parseInline(w[2],e,i)+"</li>");continue}let C=v.match(/^(\s*)\d+\.\s+(.*)/);if(C)g(),d&&"ol"===c||(d&&n.push("ul"===c?"</ul>":"</ol>"),n.push("<ol>"),d=!0,c="ol"),n.push("<li>"+this.parseInline(C[2],e,i)+"</li>");else if(d&&""!==v.trim()&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),""!==v.trim()){if(v.match(/^\|/)&&t+1<o.length&&o[t+1].match(/^\|[\s-:|]+\|/)){g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1);let r="<table>",s=v.split("|").filter(t=>""!==t.trim());r+="<thead><tr>";for(let t=0;t<s.length;t++)r+="<th>"+this.parseInline(s[t].trim(),e,i)+"</th>";for(r+="</tr></thead>",t++,r+="<tbody>";t+1<o.length&&o[t+1].match(/^\|/);){t++;let n=o[t].split("|").filter(t=>""!==t.trim());r+="<tr>";for(let t=0;t<n.length;t++)r+="<td>"+this.parseInline(n[t].trim(),e,i)+"</td>";r+="</tr>"}r+="</tbody></table>",n.push(r);continue}f.push(v)}else g()}if(g(),d&&n.push("ul"===c?"</ul>":"</ol>"),p&&n.push("<blockquote>"+this.parseMarkdown(h.join("\n"),e,i)+"</blockquote>"),r){let t=l.join("\n"),e=this.highlightCode(t,a),i=this.generateLineNumbers(t);n.push('<div class="pict-content-code-wrap"><div class="pict-content-code-line-numbers">'+i+"</div><pre><code>"+e+"</code></pre></div>")}return n.join("\n")}parseInline(t,e,i){if(!t)return"";let o=t,n=[];return o=o.replace(/`([^`]+)`/g,(t,e)=>{let i=n.length;return n.push("<code>"+e+"</code>"),"\0CODEINLINE"+i+"\0"}),o=o.replace(/\$([^\$\s][^\$]*?[^\$\s])\$/g,'<span class="pict-content-katex-inline">$1</span>'),o=o.replace(/\$([^\$\s])\$/g,'<span class="pict-content-katex-inline">$1</span>'),o=o.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(t,e,o)=>{let n=o;if("function"==typeof i){let t=i(o,e);t&&(n=t)}return'<img src="'+n+'" alt="'+e+'">'}),o=o.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,i,o)=>{if("function"==typeof e){let t=e(o,i);if(t){let e=t.target?' target="'+t.target+'"':"",o=t.rel?' rel="'+t.rel+'"':"";return'<a href="'+t.href+'"'+e+o+">"+i+"</a>"}}return o.match(/^https?:\/\//)?'<a href="'+o+'" target="_blank" rel="noopener">'+i+"</a>":'<a href="'+o+'">'+i+"</a>"}),o=o.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),o=o.replace(/__([^_]+)__/g,"<strong>$1</strong>"),o=o.replace(/\*([^*]+)\*/g,"<em>$1</em>"),o=o.replace(/_([^_]+)_/g,"<em>$1</em>"),o=o.replace(/\x00CODEINLINE(\d+)\x00/g,(t,e)=>n[parseInt(e)]),o}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration={ProviderIdentifier:"Pict-Content",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":46,"pict-section-code":49}],52:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-Content",DefaultRenderable:"Pict-Content-Display",DefaultDestinationAddress:"#Pict-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-content-code-wrap {\n\t\t\tposition: relative;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: auto;\n\t\t\tmargin: 1em 0;\n\t\t\tbackground: #3D3229;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 40px;\n\t\t\tpadding: 1.25em 0;\n\t\t\ttext-align: right;\n\t\t\tbackground: #342A22;\n\t\t\tborder-right: 1px solid #4A3F35;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 13px;\n\t\t\tline-height: 1.5;\n\t\t\tuser-select: none;\n\t\t\tpointer-events: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers span {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0 8px 0 0;\n\t\t}\n\t\t.pict-content-code-wrap pre {\n\t\t\tmargin: 0;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em 1.25em 1.25em 52px;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content-code-wrap pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.pict-content-code-wrap .keyword { color: #C678DD; }\n\t\t.pict-content-code-wrap .string { color: #98C379; }\n\t\t.pict-content-code-wrap .number { color: #D19A66; }\n\t\t.pict-content-code-wrap .comment { color: #7F848E; font-style: italic; }\n\t\t.pict-content-code-wrap .operator { color: #56B6C2; }\n\t\t.pict-content-code-wrap .punctuation { color: #E8E0D4; }\n\t\t.pict-content-code-wrap .function-name { color: #61AFEF; }\n\t\t.pict-content-code-wrap .property { color: #E06C75; }\n\t\t.pict-content-code-wrap .tag { color: #E06C75; }\n\t\t.pict-content-code-wrap .attr-name { color: #D19A66; }\n\t\t.pict-content-code-wrap .attr-value { color: #98C379; }\n\t\t.pict-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid #2E7D74;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t",Templates:[{Hash:"Pict-Content-Template",Template:'\n<div class="pict-content" id="Pict-Content-Body">\n\t<div class="pict-content-loading">Loading content...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Pict-Content-Display",TemplateHash:"Pict-Content-Template",DestinationAddress:"#Pict-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}displayContent(t,e){let i=e||"Pict-Content-Body";this.pict.ContentAssignment.assignContent("#"+i,t);let o=document.getElementById(i);o&&o.parentElement&&(o.parentElement.scrollTop=0),this.renderMermaidDiagrams(i),this.renderKaTeXEquations(i)}renderMermaidDiagrams(t){if("undefined"==typeof mermaid)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let o=i.querySelectorAll("pre.mermaid");if(!(o.length<1))try{mermaid.run({nodes:o})}catch(t){this.log.error("Mermaid rendering error: "+t.message)}}renderKaTeXEquations(t){if("undefined"==typeof katex)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let o=i.querySelectorAll(".pict-content-katex-inline");for(let t=0;t<o.length;t++)try{katex.render(o[t].textContent,o[t],{throwOnError:!1,displayMode:!1})}catch(t){this.log.warn("KaTeX inline error: "+t.message)}let n=i.querySelectorAll(".pict-content-katex-display");for(let t=0;t<n.length;t++)try{katex.render(n[t].textContent,n[t],{throwOnError:!1,displayMode:!0})}catch(t){this.log.warn("KaTeX display error: "+t.message)}}showLoading(t,e){let i=e||"Pict-Content-Body",o=t||"Loading content...";this.pict.ContentAssignment.assignContent("#"+i,'<div class="pict-content-loading">'+o+"</div>")}},e.exports.default_configuration=n},{"pict-view":76}],53:[function(t,e,i){e.exports={ViewIdentifier:"Pict-FileBrowser",DefaultRenderable:"FileBrowser-Container",DefaultDestinationAddress:"#Pict-FileBrowser-Container",AutoRender:!1,StateAddresses:{Layout:"AppData.PictFileBrowser.Layout",RootLocation:"AppData.PictFileBrowser.RootLocation",CurrentLocation:"AppData.PictFileBrowser.CurrentLocation",CurrentFile:"AppData.PictFileBrowser.CurrentFile"},DefaultState:{Layout:"browser-detail",RootLocation:"/",CurrentLocation:"",CurrentFile:null},FileListAddress:"AppData.PictFileBrowser.FileList",FolderTreeAddress:"AppData.PictFileBrowser.FolderTree",ChildFolderCacheAddress:"AppData.PictFileBrowser.ChildFolderCache",Templates:[{Hash:"FileBrowser-Container-Template",Template:'\n<div class="pict-filebrowser" id="Pict-FileBrowser-Wrap">\n\t<div class="pict-filebrowser-browse-pane" id="Pict-FileBrowser-BrowsePane"></div>\n\t<div class="pict-filebrowser-main-pane">\n\t\t<div class="pict-filebrowser-list-pane" id="Pict-FileBrowser-ListPane"></div>\n\t\t<div class="pict-filebrowser-view-pane" id="Pict-FileBrowser-ViewPane"></div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"FileBrowser-Container",TemplateHash:"FileBrowser-Container-Template",DestinationAddress:"#Pict-FileBrowser-Container",RenderMethod:"replace"}],CSS:"\n\t\t.pict-filebrowser {\n\t\t\tdisplay: flex;\n\t\t\theight: 100%;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n\t\t\tfont-size: 14px;\n\t\t\tcolor: #3D3229;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\toverflow: hidden;\n\t\t\tbackground: #FAFAF8;\n\t\t}\n\n\t\t.pict-filebrowser-browse-pane {\n\t\t\twidth: 240px;\n\t\t\tmin-width: 180px;\n\t\t\tborder-right: 1px solid #DDD6CA;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: #F5F0E8;\n\t\t\tflex-shrink: 0;\n\t\t}\n\n\t\t.pict-filebrowser-main-pane {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t.pict-filebrowser-list-pane {\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\n\t\t.pict-filebrowser-view-pane {\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: #FAFAF8;\n\t\t}\n\n\t\t/* --- Browsing: Tree --- */\n\t\t.pict-fb-tree {\n\t\t\tpadding: 8px 0;\n\t\t}\n\t\t.pict-fb-tree-node {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 4px 8px 4px 0;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-tree-node:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-tree-node.selected {\n\t\t\tbackground: #DDD6CA;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.pict-fb-tree-toggle {\n\t\t\tdisplay: inline-block;\n\t\t\twidth: 16px;\n\t\t\ttext-align: center;\n\t\t\tflex-shrink: 0;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 10px;\n\t\t}\n\t\t.pict-fb-tree-icon {\n\t\t\tmargin-right: 6px;\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 14px;\n\t\t}\n\t\t.pict-fb-tree-label {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.pict-fb-tree-children {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-fb-tree-children.expanded {\n\t\t\tdisplay: block;\n\t\t}\n\n\t\t/* --- Browsing: Search --- */\n\t\t.pict-fb-search {\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.pict-fb-search-input {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 6px 10px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 13px;\n\t\t\toutline: none;\n\t\t\tbackground: #fff;\n\t\t}\n\t\t.pict-fb-search-input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-fb-search-results {\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.pict-fb-search-result {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 5px 8px;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-fb-search-result:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-search-result-icon {\n\t\t\tmargin-right: 6px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-fb-search-result-name {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-search-result-path {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 11px;\n\t\t\tmargin-left: auto;\n\t\t\tpadding-left: 8px;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t/* --- Listing: Detail --- */\n\t\t.pict-fb-detail {\n\t\t\twidth: 100%;\n\t\t}\n\t\t.pict-fb-detail-header {\n\t\t\tdisplay: flex;\n\t\t\tpadding: 6px 12px;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 12px;\n\t\t\ttext-transform: uppercase;\n\t\t\tcolor: #8A7F72;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #F5F0E8;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-fb-detail-header-cell {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-fb-detail-header-cell:hover {\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-fb-detail-col-name {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-fb-detail-col-size {\n\t\t\twidth: 90px;\n\t\t\ttext-align: right;\n\t\t\tflex-shrink: 0;\n\t\t\tpadding-right: 12px;\n\t\t}\n\t\t.pict-fb-detail-col-modified {\n\t\t\twidth: 150px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-fb-detail-row {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 5px 12px;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 1px solid #F0ECE4;\n\t\t}\n\t\t.pict-fb-detail-row:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-fb-detail-row.selected {\n\t\t\tbackground: #E0EDE9;\n\t\t}\n\t\t.pict-fb-detail-icon {\n\t\t\tmargin-right: 8px;\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 16px;\n\t\t}\n\t\t.pict-fb-detail-name {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-detail-size {\n\t\t\twidth: 90px;\n\t\t\ttext-align: right;\n\t\t\tflex-shrink: 0;\n\t\t\tpadding-right: 12px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 12px;\n\t\t}\n\t\t.pict-fb-detail-modified {\n\t\t\twidth: 150px;\n\t\t\tflex-shrink: 0;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 12px;\n\t\t}\n\n\t\t/* --- Listing: Icons --- */\n\t\t.pict-fb-icons {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tpadding: 12px;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.pict-fb-icon-item {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\twidth: 96px;\n\t\t\tpadding: 10px 6px;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.pict-fb-icon-item:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-fb-icon-item.selected {\n\t\t\tbackground: #E0EDE9;\n\t\t}\n\t\t.pict-fb-icon-graphic {\n\t\t\tfont-size: 36px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.pict-fb-icon-label {\n\t\t\tfont-size: 12px;\n\t\t\tword-break: break-word;\n\t\t\tline-height: 1.3;\n\t\t\tmax-height: 2.6em;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\t/* --- Viewing: FileInfo --- */\n\t\t.pict-fb-fileinfo {\n\t\t\tpadding: 12px 16px;\n\t\t}\n\t\t.pict-fb-fileinfo-title {\n\t\t\tfont-size: 15px;\n\t\t\tfont-weight: 600;\n\t\t\tmargin-bottom: 8px;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-fb-fileinfo-table {\n\t\t\twidth: 100%;\n\t\t\tfont-size: 13px;\n\t\t}\n\t\t.pict-fb-fileinfo-table td {\n\t\t\tpadding: 3px 0;\n\t\t}\n\t\t.pict-fb-fileinfo-label {\n\t\t\tcolor: #8A7F72;\n\t\t\twidth: 100px;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-fb-fileinfo-value {\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-fb-fileinfo-none {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\n\t\t/* --- Viewing: Image --- */\n\t\t.pict-fb-image-viewer {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 16px;\n\t\t\tmin-height: 200px;\n\t\t}\n\t\t.pict-fb-image-viewer img {\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 500px;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t\tbox-shadow: 0 1px 3px rgba(0,0,0,0.1);\n\t\t}\n\t\t.pict-fb-image-viewer-none {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\n\t\t/* --- Breadcrumb / Location Bar --- */\n\t\t.pict-fb-breadcrumb {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 6px 12px;\n\t\t\tfont-size: 13px;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\toverflow-x: auto;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-breadcrumb-segment {\n\t\t\tcursor: pointer;\n\t\t\tcolor: #2E7D74;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-fb-breadcrumb-segment:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-breadcrumb-separator {\n\t\t\tmargin: 0 2px;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.pict-fb-breadcrumb-current {\n\t\t\tcolor: #3D3229;\n\t\t\tfont-weight: 500;\n\t\t\tpadding: 2px 4px;\n\t\t}\n\n\t\t/* --- Empty state --- */\n\t\t.pict-fb-empty {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 32px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\t"}},{}],54:[function(t,e,i){e.exports=t("./views/Pict-View-FileBrowser.js"),e.exports.PictFileBrowserBrowseProvider=t("./providers/Pict-Provider-FileBrowserBrowse.js"),e.exports.PictFileBrowserListProvider=t("./providers/Pict-Provider-FileBrowserList.js"),e.exports.PictFileBrowserViewProvider=t("./providers/Pict-Provider-FileBrowserView.js"),e.exports.PictFileBrowserLayoutProvider=t("./providers/Pict-Provider-FileBrowserLayout.js"),e.exports.PictFileBrowserIconProvider=t("./providers/Pict-Provider-FileBrowserIcons.js"),e.exports.PictViewBrowseTree=t("./views/Pict-View-FileBrowser-BrowseTree.js"),e.exports.PictViewBrowseSearch=t("./views/Pict-View-FileBrowser-BrowseSearch.js"),e.exports.PictViewListDetail=t("./views/Pict-View-FileBrowser-ListDetail.js"),e.exports.PictViewListIcons=t("./views/Pict-View-FileBrowser-ListIcons.js"),e.exports.PictViewFileInfo=t("./views/Pict-View-FileBrowser-ViewFileInfo.js"),e.exports.PictViewImageViewer=t("./views/Pict-View-FileBrowser-ViewImage.js"),e.exports.FileBrowserService=t("./services/Pict-Service-FileBrowser.js")},{"./providers/Pict-Provider-FileBrowserBrowse.js":55,"./providers/Pict-Provider-FileBrowserIcons.js":56,"./providers/Pict-Provider-FileBrowserLayout.js":57,"./providers/Pict-Provider-FileBrowserList.js":58,"./providers/Pict-Provider-FileBrowserView.js":59,"./services/Pict-Service-FileBrowser.js":60,"./views/Pict-View-FileBrowser-BrowseSearch.js":61,"./views/Pict-View-FileBrowser-BrowseTree.js":62,"./views/Pict-View-FileBrowser-ListDetail.js":63,"./views/Pict-View-FileBrowser-ListIcons.js":64,"./views/Pict-View-FileBrowser-ViewFileInfo.js":65,"./views/Pict-View-FileBrowser-ViewImage.js":66,"./views/Pict-View-FileBrowser.js":67}],55:[function(t,e,i){const o=t("pict-provider");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}getFolderTree(){let t=this.getFileBrowserOption("FolderTreeAddress","AppData.PictFileBrowser.FolderTree"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}flattenTree(t){let e=t||this.getFolderTree(),i=[],o=(t,e)=>{for(let n=0;n<t.length;n++){let r=t[n],s=e?e+"/"+r.Name:r.Name;i.push({Name:r.Name,Path:s}),Array.isArray(r.Children)&&r.Children.length>0&&o(r.Children,s)}};return o(e,""),i}getChildFolders(t){let e=this.getFileBrowserOption("ChildFolderCacheAddress","AppData.PictFileBrowser.ChildFolderCache"),i=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},e);if(!i||"object"!=typeof i)return null;let o=t||"_root_";return Array.isArray(i[o])?i[o]:null}setChildFolders(t,e){let i=this.getFileBrowserOption("ChildFolderCacheAddress","AppData.PictFileBrowser.ChildFolderCache"),o=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},i);o&&"object"==typeof o||(o={}),o[t||"_root_"]=Array.isArray(e)?e:[],this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,o)}searchFiles(t,e){if(!t||"string"!=typeof t)return[];let i=e||this.getFileList(),o=t.toLowerCase();return i.filter(t=>t.Name&&t.Name.toLowerCase().indexOf(o)>=0)}navigateToFolder(t){let e=this.getFileBrowserOption("StateAddresses",{}),i=e.CurrentLocation||"AppData.PictFileBrowser.CurrentLocation",o=e.CurrentFile||"AppData.PictFileBrowser.CurrentFile";this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,t||""),this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},o,null)}getFileList(){let t=this.getFileBrowserOption("FileListAddress","AppData.PictFileBrowser.FileList"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Browse",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":46}],56:[function(t,e,i){const o=t("pict-provider"),n={Primary:"#3D3229",Accent:"#2E7D74",Muted:"#8A7F72",Light:"#F5F0E8",WarmBeige:"#EAE3D8",TealTint:"#E0EDE9",Lavender:"#E8E0F0",AmberTint:"#F0E8D0"},r={folder:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 9H20.8" stroke="'+n.Primary+'" stroke-width="1" opacity="0.3" /></svg>',"folder-open":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 10.2L5.8 17.8C6 18.4 6.6 18.9 7.2 18.9H19.8L22.1 11.2C22.3 10.6 21.8 10 21.2 10H5.2C4.6 10 4 10.4 3.8 11" stroke="'+n.Primary+'" stroke-width="1.5" fill="'+n.Light+'" stroke-linecap="round" stroke-linejoin="round" opacity="0.7" /></svg>',file:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-text":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="12.8" x2="15.9" y2="12.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="15.8" x2="15.9" y2="15.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="18.8" x2="12.2" y2="18.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>',"file-code":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M8.5 13.2L6.8 15.1L8.6 16.8" stroke="'+n.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><path d="M15.5 13.2L17.2 15.1L15.4 16.8" stroke="'+n.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><line x1="12.8" y1="12" x2="11.2" y2="18" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>',"file-image":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><rect x="3.1" y="3.2" width="17.8" height="17.7" rx="2" fill="'+n.Lavender+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="8.3" cy="8.7" r="1.8" fill="'+n.Accent+'" /><path d="M20.8 15.2L15.9 10.1L5.2 20.8" stroke="'+n.Primary+'" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-pdf":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="#F0DDDD" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><text x="8.2" y="16.8" font-family="sans-serif" font-weight="700" font-size="6.5" fill="#C04040" letter-spacing="-0.3">PDF</text></svg>',"file-spreadsheet":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.TealTint+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="7.2" y="11.1" width="9.8" height="7.8" rx="0.5" fill="none" stroke="'+n.Accent+'" stroke-width="1.2" /><line x1="7.2" y1="13.7" x2="17" y2="13.7" stroke="'+n.Accent+'" stroke-width="1" /><line x1="7.2" y1="16.3" x2="17" y2="16.3" stroke="'+n.Accent+'" stroke-width="1" /><line x1="10.9" y1="11.1" x2="10.9" y2="18.9" stroke="'+n.Accent+'" stroke-width="1" /></svg>',"file-archive":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="8.8" y="11.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /><rect x="8.8" y="14.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /><rect x="8.8" y="17.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /></svg>',"file-audio":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.AmberTint+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="10.2" cy="16.8" r="2.1" fill="none" stroke="'+n.Accent+'" stroke-width="1.5" /><path d="M12.2 16.8V11.2L16.1 10.1" stroke="'+n.Accent+'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="15.3" r="1.4" fill="none" stroke="'+n.Accent+'" stroke-width="1.2" /></svg>',"file-video":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Lavender+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M9.8 12.2V18.2L15.8 15.2L9.8 12.2Z" fill="'+n.Accent+'" stroke="'+n.Accent+'" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-web":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.9" fill="'+n.TealTint+'" stroke="'+n.Primary+'" stroke-width="1.8" /><ellipse cx="12" cy="12" rx="4.1" ry="8.9" fill="none" stroke="'+n.Primary+'" stroke-width="1.2" /><line x1="3.1" y1="12" x2="20.9" y2="12" stroke="'+n.Primary+'" stroke-width="1" /><path d="M4.8 7.8C7 8.5 9.4 8.9 12 8.9C14.6 8.9 17 8.5 19.2 7.8" stroke="'+n.Primary+'" stroke-width="1" fill="none" /><path d="M4.8 16.2C7 15.5 9.4 15.1 12 15.1C14.6 15.1 17 15.5 19.2 16.2" stroke="'+n.Primary+'" stroke-width="1" fill="none" /></svg>',"file-config":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="12" cy="15" r="2.8" fill="none" stroke="'+n.Muted+'" stroke-width="1.5" /><line x1="12" y1="11" x2="12" y2="12.2" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="12" y1="17.8" x2="12" y2="19" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="13.2" x2="15.8" y2="12.6" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="17" x2="9.2" y2="16.4" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="16.8" x2="15.8" y2="17.4" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="13" x2="9.2" y2="13.6" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /></svg>',home:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M3.1 9.6L12 3.1L20.9 9.6V19.9C20.9 20.5 20.5 21 19.9 20.9H4.1C3.5 21 3 20.5 3.1 19.9V9.6Z" fill="'+n.TealTint+'" stroke="'+n.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="9.2" y="14.1" width="5.6" height="6.9" rx="0.5" fill="'+n.Accent+'" /></svg>',"arrow-up":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12.1 19.1V5.1" stroke="'+n.Muted+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M5.2 11.9L12.1 5.1L18.9 11.9" stroke="'+n.Muted+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-right":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M9.2 6.1L14.8 12.1L9.1 17.9" stroke="'+n.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-down":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M6.1 9.2L12.1 14.8L17.9 9.1" stroke="'+n.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',search:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><circle cx="10.8" cy="10.8" r="6.8" stroke="'+n.Primary+'" stroke-width="1.8" /><line x1="15.9" y1="16.1" x2="20.8" y2="20.8" stroke="'+n.Primary+'" stroke-width="2" stroke-linecap="round" /></svg>',"sort-asc":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+n.Primary+'" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+n.Muted+'" opacity="0.35" /></svg>',"sort-desc":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+n.Muted+'" opacity="0.35" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+n.Primary+'" /></svg>'},s={".jpg":"file-image",".jpeg":"file-image",".png":"file-image",".gif":"file-image",".svg":"file-image",".webp":"file-image",".bmp":"file-image",".ico":"file-image",".txt":"file-text",".md":"file-text",".rtf":"file-text",".doc":"file-text",".docx":"file-text",".pdf":"file-pdf",".xls":"file-spreadsheet",".xlsx":"file-spreadsheet",".csv":"file-spreadsheet",".ods":"file-spreadsheet",".js":"file-code",".ts":"file-code",".jsx":"file-code",".tsx":"file-code",".py":"file-code",".rb":"file-code",".java":"file-code",".c":"file-code",".cpp":"file-code",".h":"file-code",".go":"file-code",".rs":"file-code",".swift":"file-code",".kt":"file-code",".scala":"file-code",".sh":"file-code",".bash":"file-code",".zsh":"file-code",".php":"file-code",".lua":"file-code",".r":"file-code",".sql":"file-code",".pl":"file-code",".html":"file-web",".htm":"file-web",".css":"file-web",".scss":"file-web",".less":"file-web",".xml":"file-web",".json":"file-config",".yaml":"file-config",".yml":"file-config",".toml":"file-config",".ini":"file-config",".env":"file-config",".conf":"file-config",".cfg":"file-config",".zip":"file-archive",".tar":"file-archive",".gz":"file-archive",".rar":"file-archive",".7z":"file-archive",".bz2":"file-archive",".xz":"file-archive",".tgz":"file-archive",".mp3":"file-audio",".wav":"file-audio",".flac":"file-audio",".ogg":"file-audio",".aac":"file-audio",".wma":"file-audio",".m4a":"file-audio",".mp4":"file-video",".avi":"file-video",".mov":"file-video",".mkv":"file-video",".webm":"file-video",".wmv":"file-video",".flv":"file-video",".m4v":"file-video"};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._icons=Object.assign({},r),this._extensionMap=Object.assign({},s),this._cssInjected=!1}getIcon(t,e){let i=e||16,o=this._icons[t];return"function"==typeof o?o(i):""}getIconForEntry(t,e){if(!t)return"";if(t.Icon&&"string"==typeof t.Icon&&0===t.Icon.indexOf("<svg"))return t.Icon;let i=e||16;if("folder"===t.Type)return this.getIcon("folder",i);let o=(t.Extension||"").toLowerCase();return o&&this._extensionMap[o]?this.getIcon(this._extensionMap[o],i):this.getIcon("file",i)}getUIIcon(t,e){return this.getIcon(t,e||16)}registerIcon(t,e){return!(!t||"function"!=typeof e)&&(this._icons[t]=e,!0)}registerExtension(t,e){return!(!t||!e)&&(this._extensionMap[t.toLowerCase()]=e,!0)}getIconNames(){return Object.keys(this._icons)}getExtensionMap(){return Object.assign({},this._extensionMap)}injectCSS(){this._cssInjected||this.pict&&this.pict.CSSMap&&(this.pict.CSSMap.addCSS("PictFileBrowserIcons",".pict-fb-svg-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }\n.pict-fb-svg-icon svg { display: block; }\n.pict-fb-tree-icon svg { width: 16px; height: 16px; }\n.pict-fb-detail-icon svg { width: 16px; height: 16px; }\n.pict-fb-icon-graphic svg { width: 36px; height: 36px; }\n.pict-fb-tree-toggle svg { width: 10px; height: 10px; }\n"),this._cssInjected=!0)}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Icons",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.BuiltInIcons=r,e.exports.ExtensionMap=s,e.exports.Colors=n},{"pict-provider":46}],57:[function(t,e,i){const o=t("pict-provider"),n={"list-only":{Key:"list-only",Label:"List Only",Description:"Full-width file list",Panes:["list"],PaneCount:1,CSSClass:"pict-fb-layout-list-only"},"tree-list":{Key:"tree-list",Label:"Tree + List",Description:"Folder tree on the left, file list on the right",Panes:["browse","list"],PaneCount:2,CSSClass:"pict-fb-layout-tree-list"},"list-detail":{Key:"list-detail",Label:"List + Detail",Description:"File list on top, file details on the bottom",Panes:["list","view"],PaneCount:2,CSSClass:"pict-fb-layout-list-detail"},"tree-detail":{Key:"tree-detail",Label:"Tree + Detail",Description:"Folder tree on the left, file details on the right",Panes:["browse","view"],PaneCount:2,CSSClass:"pict-fb-layout-tree-detail"},"browser-detail":{Key:"browser-detail",Label:"Browser",Description:"Folder tree on the left, file list top-right, details bottom-right",Panes:["browse","list","view"],PaneCount:3,CSSClass:"pict-fb-layout-browser-detail"},"browser-columns":{Key:"browser-columns",Label:"Columns",Description:"Three-column layout: folder tree, file list, and file details side-by-side",Panes:["browse","list","view"],PaneCount:3,CSSClass:"pict-fb-layout-browser-columns"}};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.layouts=JSON.parse(JSON.stringify(n))}getLayouts(){return this.layouts}getLayoutList(){let t=[];for(let e in this.layouts)t.push(this.layouts[e]);return t.sort((t,e)=>t.PaneCount!==e.PaneCount?t.PaneCount-e.PaneCount:t.Key.localeCompare(e.Key)),t}getLayout(t){return this.layouts[t]||null}getCurrentLayoutKey(){let t=this.getFileBrowserOption("StateAddresses",{}).Layout||"AppData.PictFileBrowser.Layout";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||"browser-detail"}getCurrentLayout(){let t=this.getCurrentLayoutKey();return this.layouts[t]||this.layouts["browser-detail"]}setLayout(t){if(!this.layouts[t])return!1;let e=this.getFileBrowserOption("StateAddresses",{}).Layout||"AppData.PictFileBrowser.Layout";return this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},e,t),!0}isPaneVisible(t){return this.getCurrentLayout().Panes.indexOf(t)>=0}registerLayout(t){return!(!t||!t.Key)&&(this.layouts[t.Key]=t,!0)}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Layout",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.BuiltInLayouts=n},{"pict-provider":46}],58:[function(t,e,i){const o=t("pict-provider");e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.sortField="Name",this.sortAscending=!0}getFileList(){let t=this.getFileBrowserOption("FileListAddress","AppData.PictFileBrowser.FileList"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}getSortedFileList(t){let e=(t||this.getFileList()).slice(),i=this.sortField,o=this.sortAscending;return e.sort((t,e)=>{let n="folder"===t.Type?0:1,r="folder"===e.Type?0:1;if(n!==r)return n-r;let s=t[i],a=e[i];if(null==s&&null==a)return 0;if(null==s)return 1;if(null==a)return-1;let l=0;return l="string"==typeof s?s.localeCompare(a):s<a?-1:s>a?1:0,o?l:-l}),e}setSortField(t){this.sortField===t?this.sortAscending=!this.sortAscending:(this.sortField=t,this.sortAscending=!0)}selectFile(t){let e=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},e,t||null)}getSelectedFile(){let t=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||null}openEntry(t){if(t)if("folder"===t.Type){let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){let i=this.getFileBrowserOption("StateAddresses",{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation",o=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},i)||"",n=o?o+"/"+t.Name:t.Name;e.navigateToFolder(n)}}else this.selectFile(t)}formatFileSize(t){return null==t||isNaN(t)?"--":t<1024?t+" B":t<1048576?(t/1024).toFixed(1)+" KB":t<1073741824?(t/1048576).toFixed(1)+" MB":(t/1073741824).toFixed(1)+" GB"}formatDate(t){if(!t)return"--";try{let e=new Date(t);return isNaN(e.getTime())?"--":e.toLocaleDateString()+" "+e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return"--"}}getEntryIcon(t){if(!t)return"";if(t.Icon)return t.Icon;let e=this.pict.providers["Pict-FileBrowser-Icons"];if(e)return e.getIconForEntry(t,16);if("folder"===t.Type)return"📁";switch((t.Extension||"").toLowerCase()){case".jpg":case".jpeg":case".png":case".gif":case".svg":case".webp":case".bmp":return"🖼";case".pdf":default:return"📄";case".doc":case".docx":case".txt":case".md":case".rtf":return"📃";case".xls":case".xlsx":case".csv":return"📊";case".zip":case".tar":case".gz":case".rar":case".7z":return"📦";case".js":case".ts":case".py":case".rb":case".java":case".c":case".cpp":case".go":case".rs":return"💻";case".html":case".css":case".json":case".xml":case".yaml":case".yml":return"🌐";case".mp3":case".wav":case".flac":case".ogg":case".aac":return"🎵";case".mp4":case".avi":case".mov":case".mkv":case".webm":return"🎥"}}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-List",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":46}],59:[function(t,e,i){const o=t("pict-provider");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}getCurrentFile(){let t=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||null}isImage(t){let e=t||this.getCurrentFile();if(!e)return!1;if(e.MimeType&&0===e.MimeType.indexOf("image/"))return!0;let i=(e.Extension||"").toLowerCase();return[".jpg",".jpeg",".png",".gif",".svg",".webp",".bmp",".ico",".tiff",".tif"].indexOf(i)>=0}getImageURL(t){let e=t||this.getCurrentFile();return e&&(e.URL||e.ThumbnailURL)||null}getFileTypeDescription(t){let e=t||this.getCurrentFile();if(!e)return"Unknown";if("folder"===e.Type)return"Folder";let i=(e.Extension||"").toLowerCase();switch(i){case".jpg":case".jpeg":return"JPEG Image";case".png":return"PNG Image";case".gif":return"GIF Image";case".svg":return"SVG Image";case".webp":return"WebP Image";case".bmp":return"Bitmap Image";case".pdf":return"PDF Document";case".doc":case".docx":return"Word Document";case".xls":case".xlsx":return"Excel Spreadsheet";case".csv":return"CSV File";case".txt":return"Text File";case".md":return"Markdown File";case".html":return"HTML File";case".css":return"CSS Stylesheet";case".js":return"JavaScript File";case".ts":return"TypeScript File";case".json":return"JSON File";case".xml":return"XML File";case".yaml":case".yml":return"YAML File";case".py":return"Python Script";case".rb":return"Ruby Script";case".java":return"Java File";case".c":return"C Source File";case".cpp":return"C++ Source File";case".go":return"Go Source File";case".rs":return"Rust Source File";case".zip":return"ZIP Archive";case".tar":return"TAR Archive";case".gz":return"GZip Archive";case".rar":return"RAR Archive";case".mp3":return"MP3 Audio";case".wav":return"WAV Audio";case".mp4":return"MP4 Video";case".avi":return"AVI Video";case".mov":return"QuickTime Video";default:return i?i.substring(1).toUpperCase()+" File":"File"}}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-View",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":46}],60:[function(t,e,i){(function(i){(function(){
|
|
57
|
+
I.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=I.tokenizer,this.pipeline=new I.Pipeline,this.searchPipeline=new I.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},I.Builder.prototype.ref=function(t){this._ref=t},I.Builder.prototype.field=function(t,e){if(/\//.test(t))throw new RangeError("Field '"+t+"' contains illegal character '/'");this._fields[t]=e||{}},I.Builder.prototype.b=function(t){this._b=t<0?0:t>1?1:t},I.Builder.prototype.k1=function(t){this._k1=t},I.Builder.prototype.add=function(t,e){var i=t[this._ref],o=Object.keys(this._fields);this._documents[i]=e||{},this.documentCount+=1;for(var n=0;n<o.length;n++){var r=o[n],s=this._fields[r].extractor,a=s?s(t):t[r],l=this.tokenizer(a,{fields:[r]}),d=this.pipeline.run(l),c=new I.FieldRef(i,r),p=Object.create(null);this.fieldTermFrequencies[c]=p,this.fieldLengths[c]=0,this.fieldLengths[c]+=d.length;for(var h=0;h<d.length;h++){var u=d[h];if(null==p[u]&&(p[u]=0),p[u]+=1,null==this.invertedIndex[u]){var m=Object.create(null);m._index=this.termIndex,this.termIndex+=1;for(var f=0;f<o.length;f++)m[o[f]]=Object.create(null);this.invertedIndex[u]=m}null==this.invertedIndex[u][r][i]&&(this.invertedIndex[u][r][i]=Object.create(null));for(var g=0;g<this.metadataWhitelist.length;g++){var v=this.metadataWhitelist[g],b=u.metadata[v];null==this.invertedIndex[u][r][i][v]&&(this.invertedIndex[u][r][i][v]=[]),this.invertedIndex[u][r][i][v].push(b)}}}},I.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),e=t.length,i={},o={},n=0;n<e;n++){var r=I.FieldRef.fromString(t[n]),s=r.fieldName;o[s]||(o[s]=0),o[s]+=1,i[s]||(i[s]=0),i[s]+=this.fieldLengths[r]}var a=Object.keys(this._fields);for(n=0;n<a.length;n++){var l=a[n];i[l]=i[l]/o[l]}this.averageFieldLength=i},I.Builder.prototype.createFieldVectors=function(){for(var t={},e=Object.keys(this.fieldTermFrequencies),i=e.length,o=Object.create(null),n=0;n<i;n++){for(var r=I.FieldRef.fromString(e[n]),s=r.fieldName,a=this.fieldLengths[r],l=new I.Vector,d=this.fieldTermFrequencies[r],c=Object.keys(d),p=c.length,h=this._fields[s].boost||1,u=this._documents[r.docRef].boost||1,m=0;m<p;m++){var f,g,v,b=c[m],w=d[b],y=this.invertedIndex[b]._index;void 0===o[b]?(f=I.idf(this.invertedIndex[b],this.documentCount),o[b]=f):f=o[b],g=f*((this._k1+1)*w)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[s]))+w),g*=h,g*=u,v=Math.round(1e3*g)/1e3,l.insert(y,v)}t[r]=l}this.fieldVectors=t},I.Builder.prototype.createTokenSet=function(){this.tokenSet=I.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},I.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new I.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},I.Builder.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},I.MatchData=function(t,e,i){for(var o=Object.create(null),n=Object.keys(i||{}),r=0;r<n.length;r++){var s=n[r];o[s]=i[s].slice()}this.metadata=Object.create(null),void 0!==t&&(this.metadata[t]=Object.create(null),this.metadata[t][e]=o)},I.MatchData.prototype.combine=function(t){for(var e=Object.keys(t.metadata),i=0;i<e.length;i++){var o=e[i],n=Object.keys(t.metadata[o]);null==this.metadata[o]&&(this.metadata[o]=Object.create(null));for(var r=0;r<n.length;r++){var s=n[r],a=Object.keys(t.metadata[o][s]);null==this.metadata[o][s]&&(this.metadata[o][s]=Object.create(null));for(var l=0;l<a.length;l++){var d=a[l];null==this.metadata[o][s][d]?this.metadata[o][s][d]=t.metadata[o][s][d]:this.metadata[o][s][d]=this.metadata[o][s][d].concat(t.metadata[o][s][d])}}}},I.MatchData.prototype.add=function(t,e,i){if(!(t in this.metadata))return this.metadata[t]=Object.create(null),void(this.metadata[t][e]=i);if(e in this.metadata[t])for(var o=Object.keys(i),n=0;n<o.length;n++){var r=o[n];r in this.metadata[t][e]?this.metadata[t][e][r]=this.metadata[t][e][r].concat(i[r]):this.metadata[t][e][r]=i[r]}else this.metadata[t][e]=i},I.Query=function(t){this.clauses=[],this.allFields=t},I.Query.wildcard=new String("*"),I.Query.wildcard.NONE=0,I.Query.wildcard.LEADING=1,I.Query.wildcard.TRAILING=2,I.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},I.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=I.Query.wildcard.NONE),t.wildcard&I.Query.wildcard.LEADING&&t.term.charAt(0)!=I.Query.wildcard&&(t.term="*"+t.term),t.wildcard&I.Query.wildcard.TRAILING&&t.term.slice(-1)!=I.Query.wildcard&&(t.term=t.term+"*"),"presence"in t||(t.presence=I.Query.presence.OPTIONAL),this.clauses.push(t),this},I.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=I.Query.presence.PROHIBITED)return!1;return!0},I.Query.prototype.term=function(t,e){if(Array.isArray(t))return t.forEach(function(t){this.term(t,I.utils.clone(e))},this),this;var i=e||{};return i.term=t.toString(),this.clause(i),this},I.QueryParseError=function(t,e,i){this.name="QueryParseError",this.message=t,this.start=e,this.end=i},I.QueryParseError.prototype=new Error,I.QueryLexer=function(t){this.lexemes=[],this.str=t,this.length=t.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},I.QueryLexer.prototype.run=function(){for(var t=I.QueryLexer.lexText;t;)t=t(this)},I.QueryLexer.prototype.sliceString=function(){for(var t=[],e=this.start,i=this.pos,o=0;o<this.escapeCharPositions.length;o++)i=this.escapeCharPositions[o],t.push(this.str.slice(e,i)),e=i+1;return t.push(this.str.slice(e,this.pos)),this.escapeCharPositions.length=0,t.join("")},I.QueryLexer.prototype.emit=function(t){this.lexemes.push({type:t,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},I.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},I.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return I.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},I.QueryLexer.prototype.width=function(){return this.pos-this.start},I.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},I.QueryLexer.prototype.backup=function(){this.pos-=1},I.QueryLexer.prototype.acceptDigitRun=function(){var t,e;do{e=(t=this.next()).charCodeAt(0)}while(e>47&&e<58);t!=I.QueryLexer.EOS&&this.backup()},I.QueryLexer.prototype.more=function(){return this.pos<this.length},I.QueryLexer.EOS="EOS",I.QueryLexer.FIELD="FIELD",I.QueryLexer.TERM="TERM",I.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",I.QueryLexer.BOOST="BOOST",I.QueryLexer.PRESENCE="PRESENCE",I.QueryLexer.lexField=function(t){return t.backup(),t.emit(I.QueryLexer.FIELD),t.ignore(),I.QueryLexer.lexText},I.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(I.QueryLexer.TERM)),t.ignore(),t.more())return I.QueryLexer.lexText},I.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(I.QueryLexer.EDIT_DISTANCE),I.QueryLexer.lexText},I.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(I.QueryLexer.BOOST),I.QueryLexer.lexText},I.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(I.QueryLexer.TERM)},I.QueryLexer.termSeparator=I.tokenizer.separator,I.QueryLexer.lexText=function(t){for(;;){var e=t.next();if(e==I.QueryLexer.EOS)return I.QueryLexer.lexEOS;if(92!=e.charCodeAt(0)){if(":"==e)return I.QueryLexer.lexField;if("~"==e)return t.backup(),t.width()>0&&t.emit(I.QueryLexer.TERM),I.QueryLexer.lexEditDistance;if("^"==e)return t.backup(),t.width()>0&&t.emit(I.QueryLexer.TERM),I.QueryLexer.lexBoost;if("+"==e&&1===t.width())return t.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if("-"==e&&1===t.width())return t.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if(e.match(I.QueryLexer.termSeparator))return I.QueryLexer.lexTerm}else t.escapeCharacter()}},I.QueryParser=function(t,e){this.lexer=new I.QueryLexer(t),this.query=e,this.currentClause={},this.lexemeIdx=0},I.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=I.QueryParser.parseClause;t;)t=t(this);return this.query},I.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},I.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},I.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},I.QueryParser.parseClause=function(t){var e=t.peekLexeme();if(null!=e)switch(e.type){case I.QueryLexer.PRESENCE:return I.QueryParser.parsePresence;case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+e.type;throw e.str.length>=1&&(i+=" with value '"+e.str+"'"),new I.QueryParseError(i,e.start,e.end)}},I.QueryParser.parsePresence=function(t){var e=t.consumeLexeme();if(null!=e){switch(e.str){case"-":t.currentClause.presence=I.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=I.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+e.str+"'";throw new I.QueryParseError(i,e.start,e.end)}var o=t.peekLexeme();if(null==o){i="expecting term or field, found nothing";throw new I.QueryParseError(i,e.start,e.end)}switch(o.type){case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:i="expecting term or field, found '"+o.type+"'";throw new I.QueryParseError(i,o.start,o.end)}}},I.QueryParser.parseField=function(t){var e=t.consumeLexeme();if(null!=e){if(-1==t.query.allFields.indexOf(e.str)){var i=t.query.allFields.map(function(t){return"'"+t+"'"}).join(", "),o="unrecognised field '"+e.str+"', possible fields: "+i;throw new I.QueryParseError(o,e.start,e.end)}t.currentClause.fields=[e.str];var n=t.peekLexeme();if(null==n){o="expecting term, found nothing";throw new I.QueryParseError(o,e.start,e.end)}if(n.type===I.QueryLexer.TERM)return I.QueryParser.parseTerm;o="expecting term, found '"+n.type+"'";throw new I.QueryParseError(o,n.start,n.end)}},I.QueryParser.parseTerm=function(t){var e=t.consumeLexeme();if(null!=e){t.currentClause.term=e.str.toLowerCase(),-1!=e.str.indexOf("*")&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(null!=i)switch(i.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:var o="Unexpected lexeme type '"+i.type+"'";throw new I.QueryParseError(o,i.start,i.end)}else t.nextClause()}},I.QueryParser.parseEditDistance=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var o="edit distance must be numeric";throw new I.QueryParseError(o,e.start,e.end)}t.currentClause.editDistance=i;var n=t.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:o="Unexpected lexeme type '"+n.type+"'";throw new I.QueryParseError(o,n.start,n.end)}else t.nextClause()}},I.QueryParser.parseBoost=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var o="boost must be numeric";throw new I.QueryParseError(o,e.start,e.end)}t.currentClause.boost=i;var n=t.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:o="Unexpected lexeme type '"+n.type+"'";throw new I.QueryParseError(o,n.start,n.end)}else t.nextClause()}},_=this,k=function(){return I},"object"==typeof i?e.exports=k():_.lunr=k()}()},{}],33:[function(t,e,i){e.exports=Math.abs},{}],34:[function(t,e,i){e.exports=Math.floor},{}],35:[function(t,e,i){e.exports=Number.isNaN||function(t){return t!=t}},{}],36:[function(t,e,i){e.exports=Math.max},{}],37:[function(t,e,i){e.exports=Math.min},{}],38:[function(t,e,i){e.exports=Math.pow},{}],39:[function(t,e,i){e.exports=Math.round},{}],40:[function(t,e,i){var o=t("./isNaN");e.exports=function(t){return o(t)||0===t?t:t<0?-1:1}},{"./isNaN":35}],41:[function(t,e,i){(function(i){(function(){var o="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=o&&n&&"function"==typeof n.get?n.get:null,s=o&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,d=a&&l&&"function"==typeof l.get?l.get:null,c=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,u="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,f=Object.prototype.toString,g=Function.prototype.toString,v=String.prototype.match,b=String.prototype.slice,w=String.prototype.replace,y=String.prototype.toUpperCase,C=String.prototype.toLowerCase,x=RegExp.prototype.test,A=Array.prototype.concat,R=Array.prototype.join,D=Array.prototype.slice,E=Math.floor,S="function"==typeof BigInt?BigInt.prototype.valueOf:null,T=Object.getOwnPropertySymbols,F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,_="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===P||"symbol")?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function L(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||x.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var o=t<0?-E(-t):E(t);if(o!==t){var n=String(o),r=b.call(e,n.length+1);return w.call(n,i,"$&_")+"."+w.call(w.call(r,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(e,i,"$&_")}var M=t("./util.inspect"),B=M.custom,V=G(B)?B:null,H={__proto__:null,double:'"',single:"'"},N={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function j(t,e,i){var o=i.quoteStyle||e,n=H[o];return n+t+n}function O(t){return w.call(String(t),/"/g,""")}function U(t){return!_||!("object"==typeof t&&(_ in t||void 0!==t[_]))}function z(t){return"[object Array]"===K(t)&&U(t)}function $(t){return"[object RegExp]"===K(t)&&U(t)}function G(t){if(P)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!F)return!1;try{return F.call(t),!0}catch(t){}return!1}e.exports=function t(e,o,n,a){var l=o||{};if(q(l,"quoteStyle")&&!q(H,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=!q(l,"customInspect")||l.customInspect;if("boolean"!=typeof f&&"symbol"!==f)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var y=l.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return X(e,l);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var x=String(e);return y?L(e,x):x}if("bigint"==typeof e){var E=String(e)+"n";return y?L(e,E):E}var T=void 0===l.depth?5:l.depth;if(void 0===n&&(n=0),n>=T&&T>0&&"object"==typeof e)return z(e)?"[Array]":"[Object]";var B=function(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=R.call(Array(t.indent+1)," ")}return{base:i,prev:R.call(Array(e+1),i)}}(l,n);if(void 0===a)a=[];else if(Q(a,e)>=0)return"[Circular]";function N(e,i,o){if(i&&(a=D.call(a)).push(i),o){var r={depth:l.depth};return q(l,"quoteStyle")&&(r.quoteStyle=l.quoteStyle),t(e,r,n+1,a)}return t(e,l,n+1,a)}if("function"==typeof e&&!$(e)){var W=function(t){if(t.name)return t.name;var e=v.call(g.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),J=it(e,N);return"[Function"+(W?": "+W:" (anonymous)")+"]"+(J.length>0?" { "+R.call(J,", ")+" }":"")}if(G(e)){var ot=P?w.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):F.call(e);return"object"!=typeof e||P?ot:Z(ot)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var nt="<"+C.call(String(e.nodeName)),rt=e.attributes||[],st=0;st<rt.length;st++)nt+=" "+rt[st].name+"="+j(O(rt[st].value),"double",l);return nt+=">",e.childNodes&&e.childNodes.length&&(nt+="..."),nt+="</"+C.call(String(e.nodeName))+">"}if(z(e)){if(0===e.length)return"[]";var at=it(e,N);return B&&!function(t){for(var e=0;e<t.length;e++)if(Q(t[e],"\n")>=0)return!1;return!0}(at)?"["+et(at,B)+"]":"[ "+R.call(at,", ")+" ]"}if(function(t){return"[object Error]"===K(t)&&U(t)}(e)){var lt=it(e,N);return"cause"in Error.prototype||!("cause"in e)||k.call(e,"cause")?0===lt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+R.call(lt,", ")+" }":"{ ["+String(e)+"] "+R.call(A.call("[cause]: "+N(e.cause),lt),", ")+" }"}if("object"==typeof e&&f){if(V&&"function"==typeof e[V]&&M)return M(e,{depth:T-n});if("symbol"!==f&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!r||!t||"object"!=typeof t)return!1;try{r.call(t);try{d.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var dt=[];return s&&s.call(e,function(t,i){dt.push(N(i,e,!0)+" => "+N(t,e))}),tt("Map",r.call(e),dt,B)}if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{d.call(t);try{r.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return c&&c.call(e,function(t){ct.push(N(t,e))}),tt("Set",d.call(e),ct,B)}if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{return u.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return"[object Number]"===K(t)&&U(t)}(e))return Z(N(Number(e)));if(function(t){if(!t||"object"!=typeof t||!S)return!1;try{return S.call(t),!0}catch(t){}return!1}(e))return Z(N(S.call(e)));if(function(t){return"[object Boolean]"===K(t)&&U(t)}(e))return Z(m.call(e));if(function(t){return"[object String]"===K(t)&&U(t)}(e))return Z(N(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==i&&e===i)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===K(t)&&U(t)}(e)&&!$(e)){var pt=it(e,N),ht=I?I(e)===Object.prototype:e instanceof Object||e.constructor===Object,ut=e instanceof Object?"":"null prototype",mt=!ht&&_&&Object(e)===e&&_ in e?b.call(K(e),8,-1):ut?"Object":"",ft=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(mt||ut?"["+R.call(A.call([],mt||[],ut||[]),": ")+"] ":"");return 0===pt.length?ft+"{}":B?ft+"{"+et(pt,B)+"}":ft+"{ "+R.call(pt,", ")+" }"}return String(e)};var W=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return W.call(t,e)}function K(t){return f.call(t)}function Q(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,o=t.length;i<o;i++)if(t[i]===e)return i;return-1}function X(t,e){if(t.length>e.maxStringLength){var i=t.length-e.maxStringLength,o="... "+i+" more character"+(i>1?"s":"");return X(b.call(t,0,e.maxStringLength),e)+o}var n=N[e.quoteStyle||"single"];return n.lastIndex=0,j(w.call(w.call(t,n,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+y.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function tt(t,e,i,o){return t+" ("+e+") {"+(o?et(i,o):R.call(i,", "))+"}"}function et(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+R.call(t,","+i)+"\n"+e.prev}function it(t,e){var i=z(t),o=[];if(i){o.length=t.length;for(var n=0;n<t.length;n++)o[n]=q(t,n)?e(t[n],t):""}var r,s="function"==typeof T?T(t):[];if(P){r={};for(var a=0;a<s.length;a++)r["$"+s[a]]=s[a]}for(var l in t)q(t,l)&&(i&&String(Number(l))===l&&l<t.length||P&&r["$"+l]instanceof Symbol||(x.call(/[^\w$]/,l)?o.push(e(l,t)+": "+e(t[l],t)):o.push(l+": "+e(t[l],t))));if("function"==typeof T)for(var d=0;d<s.length;d++)k.call(t,s[d])&&o.push("["+e(s[d])+"]: "+e(t[s[d]],t));return o}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util.inspect":1}],42:[function(t,e,i){(function(t){(function(){function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function o(t,e){for(var i,o="",n=0,r=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)i=t.charCodeAt(a);else{if(47===i)break;i=47}if(47===i){if(r===a-1||1===s);else if(r!==a-1&&2===s){if(o.length<2||2!==n||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var l=o.lastIndexOf("/");if(l!==o.length-1){-1===l?(o="",n=0):n=(o=o.slice(0,l)).length-1-o.lastIndexOf("/"),r=a,s=0;continue}}else if(2===o.length||1===o.length){o="",n=0,r=a,s=0;continue}e&&(o.length>0?o+="/..":o="..",n=2)}else o.length>0?o+="/"+t.slice(r+1,a):o=t.slice(r+1,a),n=a-r-1;r=a,s=0}else 46===i&&-1!==s?++s:s=-1}return o}var n={resolve:function(){for(var e,n="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=t.cwd()),a=e),i(a),0!==a.length&&(n=a+"/"+n,r=47===a.charCodeAt(0))}return n=o(n,!r),r?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var o=arguments[e];i(o),o.length>0&&(void 0===t?t=o:t+="/"+o)}return void 0===t?".":n.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=n.resolve(t))===(e=n.resolve(e)))return"";for(var o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var r=t.length,s=r-o,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var l=e.length-a,d=s<l?s:l,c=-1,p=0;p<=d;++p){if(p===d){if(l>d){if(47===e.charCodeAt(a+p))return e.slice(a+p+1);if(0===p)return e.slice(a+p)}else s>d&&(47===t.charCodeAt(o+p)?c=p:0===p&&(c=0));break}var h=t.charCodeAt(o+p);if(h!==e.charCodeAt(a+p))break;47===h&&(c=p)}var u="";for(p=o+c+1;p<=r;++p)p!==r&&47!==t.charCodeAt(p)||(0===u.length?u+="..":u+="/..");return u.length>0?u+e.slice(a+c):(a+=c,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),o=47===e,n=-1,r=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!r){n=s;break}}else r=!1;return-1===n?o?"/":".":o&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var o,n=0,r=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(o=t.length-1;o>=0;--o){var d=t.charCodeAt(o);if(47===d){if(!s){n=o+1;break}}else-1===l&&(s=!1,l=o+1),a>=0&&(d===e.charCodeAt(a)?-1===--a&&(r=o):(a=-1,r=l))}return n===r?r=l:-1===r&&(r=t.length),t.slice(n,r)}for(o=t.length-1;o>=0;--o)if(47===t.charCodeAt(o)){if(!s){n=o+1;break}}else-1===r&&(s=!1,r=o+1);return-1===r?"":t.slice(n,r)},extname:function(t){i(t);for(var e=-1,o=0,n=-1,r=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(47!==l)-1===n&&(r=!1,n=a+1),46===l?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!r){o=a+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===o+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var i=e.dir||e.root,o=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+o:i+t+o:o}("/",t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var o,n=t.charCodeAt(0),r=47===n;r?(e.root="/",o=1):o=0;for(var s=-1,a=0,l=-1,d=!0,c=t.length-1,p=0;c>=o;--c)if(47!==(n=t.charCodeAt(c)))-1===l&&(d=!1,l=c+1),46===n?-1===s?s=c:1!==p&&(p=1):-1!==s&&(p=-1);else if(!d){a=c+1;break}return-1===s||-1===l||0===p||1===p&&s===l-1&&s===a+1?-1!==l&&(e.base=e.name=0===a&&r?t.slice(1,l):t.slice(a,l)):(0===a&&r?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(a,s),e.base=t.slice(a,l)),e.ext=t.slice(s,l)),a>0?e.dir=t.slice(0,a-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n}).call(this)}).call(this,t("_process"))},{_process:89}],43:[function(t,e,i){e.exports={name:"pict-application",version:"1.0.33",description:"Application base class for a pict view-based application",main:"source/Pict-Application.js",scripts:{test:"npx quack test",start:"node source/Pict-Application.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-application-image:local","docker-dev-run":'docker run -it -d --name pict-application-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-application" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-application-image:local',"docker-dev-shell":"docker exec -it pict-application-dev /bin/bash",tests:"npx quack test -g",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Application.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-application.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-application/issues"},homepage:"https://github.com/stevenvelozo/pict-application#readme",devDependencies:{"@eslint/js":"^9.28.0","browser-env":"^3.3.0",eslint:"^9.28.0",pict:"^1.0.348","pict-provider":"^1.0.10","pict-view":"^1.0.66",quackage:"^1.0.58",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{"fable-serviceproviderbase":"^3.0.19"}}},{}],44:[function(t,e,i){const o=t("fable-serviceproviderbase"),n=t("../package.json"),r={Name:"DefaultPictApplication",MainViewportViewIdentifier:"Default-View",MainViewportRenderableHash:!1,MainViewportDestinationAddress:!1,MainViewportDefaultDataAddress:!1,AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!0,AutoRenderViewsAfterInitialize:!1,AutoLoginAfterInitialize:!1,AutoLoadDataAfterLogin:!1,ConfigurationOnlyViews:[],Manifests:{},IdentifierAddressPrefix:"PICT-"};e.exports=class extends o{constructor(t,e,i){let o="object"==typeof t.settings.PictApplicationConfiguration?t.settings.PictApplicationConfiguration:{};super(t,Object.assign({},JSON.parse(JSON.stringify(r)),o,e),i),this.options,this.log,this.fable,this.UUID,this.Hash,this.servicesMap,this.serviceType="PictApplication",this._Package=n,this.pict=this.fable,this.AppData=this.fable.AppData,this.Bundle=this.fable.Bundle,this.initializeTimestamp,this.lastSolvedTimestamp,this.lastLoginTimestamp,this.lastMarshalFromViewsTimestamp,this.lastMarshalToViewsTimestamp,this.lastAutoRenderTimestamp,this.lastLoadDataTimestamp;let s=Object.keys(this.options.Manifests);if(s.length>0)for(let t=0;t<s.length;t++){let e=s[t];this.fable.instantiateServiceProvider("Manifest",this.options.Manifests[e],e)}}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onPreSolve:`),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSolve:`),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSolve:`),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing solve() function...`);let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let o=this.pict.providers[t[i]];o.options.AutoSolveWithApp&&e.push(o)}e.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<e.length;t++)e[t].solve(e[t]);this.onBeforeSolve();let i=Object.keys(this.pict.views),o=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&o.push(e)}o.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<o.length;t++)o[t].solve();return this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),!0}solveAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");e.anticipate(this.onBeforeSolveAsync.bind(this));let i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${t}`,t)});let o=Object.keys(this.pict.providers),n=[];for(let t=0;t<o.length;t++){let e=this.pict.providers[o[t]];e.options.AutoSolveWithApp&&n.push(e)}n.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<n.length;t++)e.anticipate(n[t].solveAsync.bind(n[t]));let r=Object.keys(this.pict.views),s=[];for(let t=0;t<r.length;t++){let e=this.pict.views[r[t]];e.options.AutoSolveWithApp&&s.push(e)}s.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<s.length;t++)e.anticipate(s[t].solveAsync.bind(s[t]));e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync() complete.`),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSolve:`),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoginAsync:`),t()}onLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoginAsync:`),t()}loginAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeLoginAsync.bind(this)),e.anticipate(this.onLoginAsync.bind(this)),e.anticipate(this.onAfterLoginAsync.bind(this)),this.options.AutoLoadDataAfterLogin&&e.anticipate(t=>{if(!this.isLoggedIn())return t();this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto loading data after login...`),this.loadDataAsync(e=>{t(e)})}),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync() complete.`),this.lastLoginTimestamp=this.fable.log.getTimeStamp(),i(t)))}isLoggedIn(){return!0}onAfterLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoginAsync:`),t()}onBeforeLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoadDataAsync:`),t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoadDataAsync:`),t()}loadDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeLoadDataAsync.bind(this));let o=Object.keys(this.pict.providers),n=[];for(let t=0;t<o.length;t++){let e=this.pict.providers[o[t]];e.options.AutoLoadDataWithApp&&n.push(e)}n.sort((t,e)=>t.options.AutoLoadDataOrdinal-e.options.AutoLoadDataOrdinal);for(const t of n)e.anticipate(t.onBeforeLoadDataAsync.bind(t));e.anticipate(this.onLoadDataAsync.bind(this));for(const t of n)e.anticipate(t.onLoadDataAsync.bind(t));e.anticipate(this.onAfterLoadDataAsync.bind(this));for(const t of n)e.anticipate(t.onAfterLoadDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync() complete.`),this.lastLoadDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoadDataAsync:`),t()}onBeforeSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSaveDataAsync:`),t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSaveDataAsync:`),t()}saveDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeSaveDataAsync.bind(this));let o=Object.keys(this.pict.providers),n=[];for(let t=0;t<o.length;t++){let e=this.pict.providers[o[t]];e.options.AutoSaveDataWithApp&&n.push(e)}n.sort((t,e)=>t.options.AutoSaveDataOrdinal-e.options.AutoSaveDataOrdinal);for(const t of n)e.anticipate(t.onBeforeSaveDataAsync.bind(t));e.anticipate(this.onSaveDataAsync.bind(this));for(const t of n)e.anticipate(t.onSaveDataAsync.bind(t));e.anticipate(this.onAfterSaveDataAsync.bind(this));for(const t of n)e.anticipate(t.onAfterSaveDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync() complete.`),this.lastSaveDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSaveDataAsync:`),t()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize:`),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize called but initialization is already completed. Aborting.`),!1;{if(this.onBeforeInitialize(),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${e}`),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}this.onInitialize();let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let o=this.pict.providers[t[i]];o.options.AutoInitialize&&e.push(o)}e.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<e.length;t++)e[t].initialize();let i=Object.keys(this.pict.views),o=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&o.push(e)}o.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<o.length;t++)o[t].initialize();return this.onAfterInitialize(),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving after initialization...`),this.solve()),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering after initialization...`),this.render()),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.onCompletionOfInitialize(),!0}}initializeAsync(t){this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync:`);let e="function"==typeof t&&t;if(e||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Auto Callback Error: ${t}`,t)}),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} async initialize called but initialization is already completed. Aborting.`),this.onCompletionOfInitializeAsync(e);{let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");if(this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning initialization...`),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${e}`),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}t.anticipate(this.onBeforeInitializeAsync.bind(this)),t.anticipate(this.onInitializeAsync.bind(this));let i=Object.keys(this.pict.providers),o=[];for(let t=0;t<i.length;t++){let e=this.pict.providers[i[t]];e.options.AutoInitialize&&o.push(e)}o.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<o.length;e++)t.anticipate(o[e].initializeAsync.bind(o[e]));let n=Object.keys(this.pict.views),r=[];for(let t=0;t<n.length;t++){let e=this.pict.views[n[t]];e.options.AutoInitialize&&r.push(e)}r.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<r.length;e++){let i=r[e];t.anticipate(i.initializeAsync.bind(i))}t.anticipate(this.onAfterInitializeAsync.bind(this)),this.options.AutoLoginAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto login (asynchronously) after initialization...`),t.anticipate(this.loginAsync.bind(this))),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving (asynchronously) after initialization...`),t.anticipate(this.solveAsync.bind(this))),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering (asynchronously) after initialization...`),t.anticipate(this.renderMainViewportAsync.bind(this))),t.wait(t=>(t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Error: ${t.message||t}`,{stack:t.stack}),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialization complete.`),e()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onCompletionOfInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onCompletionOfInitialize:`),!0}onCompletionOfInitializeAsync(t){return this.onCompletionOfInitialize(),t()}onBeforeMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalFromViews:`),!0}onBeforeMarshalFromViewsAsync(t){return this.onBeforeMarshalFromViews(),t()}onMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalFromViews:`),!0}onMarshalFromViewsAsync(t){return this.onMarshalFromViews(),t()}marshalFromViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalFromViews() function...`),this.onBeforeMarshalFromViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let o=this.pict.views[t[i]];e.push(o)}for(let t=0;t<e.length;t++)e[t].marshalFromView();return this.onMarshalFromViews(),this.onAfterMarshalFromViews(),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalFromViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalFromViewsAsync.bind(this));let o=Object.keys(this.pict.views),n=[];for(let t=0;t<o.length;t++){let e=this.pict.views[o[t]];n.push(e)}for(let t=0;t<n.length;t++)e.anticipate(n[t].marshalFromViewAsync.bind(n[t]));e.anticipate(this.onMarshalFromViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync() complete.`),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalFromViews:`),!0}onAfterMarshalFromViewsAsync(t){return this.onAfterMarshalFromViews(),t()}onBeforeMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalToViews:`),!0}onBeforeMarshalToViewsAsync(t){return this.onBeforeMarshalToViews(),t()}onMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalToViews:`),!0}onMarshalToViewsAsync(t){return this.onMarshalToViews(),t()}marshalToViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalToViews() function...`),this.onBeforeMarshalToViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let o=this.pict.views[t[i]];e.push(o)}for(let t=0;t<e.length;t++)e[t].marshalToView();return this.onMarshalToViews(),this.onAfterMarshalToViews(),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalToViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalToViewsAsync.bind(this));let o=Object.keys(this.pict.views),n=[];for(let t=0;t<o.length;t++){let e=this.pict.views[o[t]];n.push(e)}for(let t=0;t<n.length;t++)e.anticipate(n[t].marshalToViewAsync.bind(n[t]));e.anticipate(this.onMarshalToViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync() complete.`),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalToViews:`),!0}onAfterMarshalToViewsAsync(t){return this.onAfterMarshalToViews(),t()}onBeforeRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeRender:`),!0}onBeforeRenderAsync(t){return this.onBeforeRender(),t()}render(t,e,i,o){let n="string"!=typeof t?this.options.MainViewportViewIdentifier:t,r="string"!=typeof e?this.options.MainViewportRenderableHash:e,s="string"!=typeof i?this.options.MainViewportDestinationAddress:i,a="string"!=typeof o?this.options.MainViewportDefaultDataAddress:o;this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${r}] Destination[${s}] TemplateDataAddress[${a}] render:`),this.onBeforeRender();let l="string"==typeof n&&this.servicesMap.PictView[n];return l?(this.onRender(),l.render(r,s,a),this.onAfterRender(),!0):(this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not render from View ${n} because it is not a valid view.`),!1)}onRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onRender:`),!0}onRenderAsync(t){return this.onRender(),t()}renderAsync(t,e,i,o,n){let r="string"!=typeof t?this.options.MainViewportViewIdentifier:t,s="string"!=typeof e?this.options.MainViewportRenderableHash:e,a="string"!=typeof i?this.options.MainViewportDestinationAddress:i,l="string"!=typeof o?this.options.MainViewportDefaultDataAddress:o,d="function"==typeof n?n:"function"==typeof o?o:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof t&&t;d||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),d=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${t}`,t)}),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${s}] Destination[${a}] TemplateDataAddress[${l}] renderAsync:`);let c=this.fable.newAnticipate();c.anticipate(this.onBeforeRenderAsync.bind(this));let p="string"==typeof r&&this.servicesMap.PictView[r];if(!p){let t=`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not asynchronously render from View ${r} because it is not a valid view.`;return this.pict.LogNoisiness>3&&this.log.error(t),d(new Error(t))}return c.anticipate(this.onRenderAsync.bind(this)),c.anticipate(t=>{p.renderAsync.call(p,s,a,l,t)}),c.anticipate(this.onAfterRenderAsync.bind(this)),c.wait(d)}onAfterRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterRender:`),!0}onAfterRenderAsync(t){return this.onAfterRender(),t()}renderMainViewport(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewport:`),this.render()}renderMainViewportAsync(t){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewportAsync:`),this.renderAsync(t)}renderAutoViews(){this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViews...`);let t=Object.keys(this.pict.views);t.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let e=0;e<t.length;e++){let i=this.pict.views[t[e]];i.options.AutoRender&&i.render()}this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`)}renderAutoViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync Auto Callback Error: ${t}`,t)}),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViewsAsync...`);let o=Object.keys(this.pict.views);o.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let t=0;t<o.length;t++){let i=this.pict.views[o[t]];i.options.AutoRender&&e.anticipate(i.renderAsync.bind(i))}e.wait(t=>(this.lastAutoRenderTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`),i(t)))}get isPictApplication(){return!0}}},{"../package.json":43,"fable-serviceproviderbase":20}],45:[function(t,e,i){e.exports={Name:"Pict Docuserve",Hash:"Docuserve",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"Docuserve-Pict-Application"}}},{}],46:[function(t,e,i){const o=t("pict-application"),n=t("./providers/Pict-Provider-Docuserve-Documentation.js"),r=t("./views/PictView-Docuserve-Layout.js"),s=t("./views/PictView-Docuserve-TopBar.js"),a=t("./views/PictView-Docuserve-Sidebar.js"),l=t("./views/PictView-Docuserve-Splash.js"),d=t("./views/PictView-Docuserve-Content.js"),c=t("./views/PictView-Docuserve-Search.js");e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.pict.addProvider("Docuserve-Documentation",n.default_configuration,n),this.pict.addView("Docuserve-Layout",r.default_configuration,r),this.pict.addView("Docuserve-TopBar",s.default_configuration,s),this.pict.addView("Docuserve-Sidebar",a.default_configuration,a),this.pict.addView("Docuserve-Splash",l.default_configuration,l),this.pict.addView("Docuserve-Content",d.default_configuration,d),this.pict.addView("Docuserve-Search",c.default_configuration,c)}onAfterInitializeAsync(t){this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"",CatalogURL:"retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve;return e.CoverLoaded&&e.Cover&&e.Cover.Title?document.title=e.Cover.Title.replace(/<[^>]*>/g,""):e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(document.title=e.TopBar.Brand.replace(/<[^>]*>/g,"")),this.pict.views["Docuserve-Layout"].render(),super.onAfterInitializeAsync(t)})}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t||"Home"===t)return void this.showView("Docuserve-Splash");let e=t.split("/");if("search"===e[0]){let t=decodeURIComponent(e.slice(1).join("/"));return void this.navigateToSearch(t)}if("page"===e[0]&&e.length>=2){let t=e.slice(1).join("/");return void this.navigateToPage(t)}if("doc"===e[0]&&e.length>=3){let t=e[1],i=e[2];if(e.length>=4){let o=e.slice(3).join("/");this.navigateToModulePath(t,i,o)}else this.navigateToModule(t,i);return}this.navigateToPage(t)}navigateTo(t){window.location.hash=t}showView(t){t in this.pict.views&&(this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",this.pict.views[t].render(),this.pict.views["Docuserve-Sidebar"].clearModuleNav(),this.pict.views["Docuserve-Sidebar"].renderSidebarGroups())}navigateToModule(t,e){this.navigateToModulePath(t,e,"README.md")}navigateToModulePath(t,e,i){let o=this.pict.providers["Docuserve-Documentation"],n=this.pict.views["Docuserve-Content"],r=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup=t,this.pict.AppData.Docuserve.CurrentModule=e,this.pict.AppData.Docuserve.CurrentPath=i,n.render(),n.showLoading(),r.renderSidebarGroups(),r.renderModuleNav(t,e);let s=o.resolveDocumentURL(t,e,i||"README.md");if(!s)return void n.displayContent(o.getErrorPageHTML(t+"/"+e));let a=i||"README.md";o.fetchDocument(s,(i,r)=>{if(!i)return void n.displayContent(r);let s=t+"/"+e+"/"+a;o.fetchLocalDocument(s,(t,e)=>{n.displayContent(e)},t,e,a)},t,e,a)}navigateToPage(t){let e=this.pict.providers["Docuserve-Documentation"],i=this.pict.views["Docuserve-Content"],o=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath=t,i.render(),i.showLoading(),o.clearModuleNav(),o.renderSidebarGroups();let n=t;n.match(/\.md$/)||(n+=".md"),e.fetchLocalDocument(n,(t,e)=>{i.displayContent(e)})}navigateToSearch(t){let e=this.pict.views["Docuserve-Sidebar"],i=this.pict.views["Docuserve-Search"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",e.clearModuleNav(),e.renderSidebarGroups(),i.render(),i.showSearch(t||"")}},e.exports.default_configuration=t("./Pict-Application-Docuserve-Configuration.json")},{"./Pict-Application-Docuserve-Configuration.json":45,"./providers/Pict-Provider-Docuserve-Documentation.js":47,"./views/PictView-Docuserve-Content.js":48,"./views/PictView-Docuserve-Layout.js":49,"./views/PictView-Docuserve-Search.js":50,"./views/PictView-Docuserve-Sidebar.js":51,"./views/PictView-Docuserve-Splash.js":52,"./views/PictView-Docuserve-TopBar.js":53,"pict-application":44}],47:[function(t,e,i){const o=t("pict-provider"),n=t("lunr"),r=t("pict-section-content").PictContentProvider;e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._Catalog=null,this._ContentCache={},this._ContentProvider=this.pict.addProvider("Pict-Content",r.default_configuration,r)}_createLinkResolver(t,e,i){return(o,n)=>{if(o.match(/^\//)||o.match(/^[^:]+\.md/)){return{href:this.convertDocLink(o,t,e,i)}}let r=this.resolveGitHubURLToRoute(o);return r?{href:r}:null}}_createImageResolver(t){let e="";if(t){let i=t.lastIndexOf("/");i>=0&&(e=t.substring(0,i+1))}return(t,i)=>t.match(/^https?:\/\//)||t.match(/^data:/)||t.match(/^\//)?t:e+t}loadCatalog(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.CatalogURL||"retold-catalog.json",o=()=>{let t=5,i=()=>{if(t--,t<=0){if(this.pict.AppData.Docuserve.SidebarGroups&&!(this.pict.AppData.Docuserve.SidebarGroups.length<1))return e();this.autoDiscoverSidebar(e)}};this.loadCover(i),this.loadSidebar(i),this.loadTopbar(i),this.loadErrorPage(i),this.loadKeywordIndex(i)};fetch(i).then(t=>t.ok?t.json():(this.log.info(`Docuserve: No catalog at [${i}]; running in standalone mode.`),null)).then(t=>{t&&(this._Catalog=t,this.pict.AppData.Docuserve.Catalog=t,this.pict.AppData.Docuserve.CatalogLoaded=!0,this.buildSidebarData(t)),o()}).catch(t=>{this.log.info(`Docuserve: Catalog load error (${t}); continuing in standalone mode.`),o()})}autoDiscoverSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"README.md").then(t=>t.ok?t.text():null).then(t=>{if(t){let e=t.match(/^#+\s+(.+)/m),i=e?e[1].trim():"Docs";this.pict.AppData.Docuserve.SidebarGroups=[{Name:i,Key:"docs",Route:"#/page/README",Modules:[]}],this.pict.AppData.Docuserve.CoverLoaded||(this.pict.AppData.Docuserve.Cover={Title:i,Tagline:"",Description:"",Highlights:[],Actions:[{Text:"Read the Docs",Href:"README.md"}]},this.pict.AppData.Docuserve.CoverLoaded=!0)}else this.log.info("Docuserve: No README.md found; sidebar will be empty.");return e()}).catch(t=>(this.log.info(`Docuserve: README.md discovery failed (${t}).`),e()))}loadCover(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_cover.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.Cover=this.parseCover(t),this.pict.AppData.Docuserve.CoverLoaded=!0,e()):(this.log.info("Docuserve: No _cover.md found; splash will use catalog data."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _cover.md: ${t}`),e()))}parseCover(t){let e={Title:"",Tagline:"",Description:"",Highlights:[],Actions:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let o=i[t].trim();if(!o)continue;let n=o.match(/^#+\s+(.+)/);if(n){e.Title=n[1].trim();continue}let r=o.match(/^>\s*(.*)/);if(r){e.Tagline=r[1].trim();continue}let s=o.match(/^[-*+]\s+(.*)/);if(s){let t=s[1],i=t.match(/^\*\*([^*]+)\*\*\s*[-—:]\s*(.*)/);i?e.Highlights.push({Label:i[1].trim(),Text:i[2].trim()}):e.Highlights.push({Label:"",Text:t.trim()});continue}let a=o.match(/^\[([^\]]+)\]\(([^)]+)\)\s*$/);a?e.Actions.push({Text:a[1].trim(),Href:a[2].trim()}):e.Description?e.Description+=" "+o:e.Description=o}return e}loadSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_sidebar.md").then(t=>t.ok?t.text():null).then(t=>{if(!t)return this.log.info("Docuserve: No _sidebar.md found; sidebar will use catalog data."),e();let i=this.parseSidebarMarkdown(t);return i&&i.length>0&&(this.pict.AppData.Docuserve.SidebarGroups=i,this.pict.AppData.Docuserve.SidebarLoaded=!0),e()}).catch(t=>(this.log.warn(`Docuserve: Error loading _sidebar.md: ${t}`),e()))}loadTopbar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_topbar.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.TopBar=this.parseTopbar(t),this.pict.AppData.Docuserve.TopBarLoaded=!0,e()):(this.log.info("Docuserve: No _topbar.md found; top bar will use defaults."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _topbar.md: ${t}`),e()))}parseTopbar(t){let e={Brand:"",NavLinks:[],ExternalLinks:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let o=i[t].trim();if(!o)continue;let n=o.match(/^#+\s+(.+)/);if(n){e.Brand=n[1].trim();continue}let r=o.match(/^[-*+]\s+(.*)/);if(r){let t=r[1].trim().match(/^\[([^\]]+)\]\(([^)]+)\)/);if(t){let i=t[1].trim(),o=t[2].trim();if(o.match(/^https?:\/\//))e.ExternalLinks.push({Text:i,Href:o});else{let t=this.convertSidebarLink(o);e.NavLinks.push({Text:i,Href:t})}}continue}}return e}loadErrorPage(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"errorpage.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.ErrorPageHTML=this._ContentProvider.parseMarkdown(t),this.pict.AppData.Docuserve.ErrorPageLoaded=!0,e()):(this.log.info("Docuserve: No errorpage.md found; errors will use default page."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading errorpage.md: ${t}`),e()))}loadKeywordIndex(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"retold-keyword-index.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!t.LunrIndex||!t.Documents)return this.log.info("Docuserve: No keyword index found; search will be unavailable."),e();try{this._LunrIndex=n.Index.load(t.LunrIndex),this._KeywordDocuments=t.Documents,this.pict.AppData.Docuserve.KeywordIndexLoaded=!0,this.pict.AppData.Docuserve.KeywordDocumentCount=t.DocumentCount||0,this.log.info(`Docuserve: Keyword index loaded (${t.DocumentCount||0} documents).`)}catch(t){this.log.warn(`Docuserve: Error hydrating lunr index: ${t}`)}return e()}).catch(t=>(this.log.warn(`Docuserve: Error loading keyword index: ${t}`),e()))}isModuleInCatalog(t,e){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let i=0;i<this._Catalog.Groups.length;i++){let o=this._Catalog.Groups[i];if(o.Key===t)for(let t=0;t<o.Modules.length;t++){if(o.Modules[t].Name===e)return!0}}return!1}findModuleGroupKey(t){if(!this._Catalog||!this._Catalog.Groups)return null;for(let e=0;e<this._Catalog.Groups.length;e++){let i=this._Catalog.Groups[e];for(let e=0;e<i.Modules.length;e++)if(i.Modules[e].Name===t)return i.Key}return null}isGroupInCatalog(t){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let e=0;e<this._Catalog.Groups.length;e++)if(this._Catalog.Groups[e].Key===t)return!0;return!1}search(t){if(!(this._LunrIndex&&this._KeywordDocuments&&t&&t.trim()))return[];let e=[];try{let i=this._LunrIndex.search(t);for(let t=0;t<i.length;t++){let o=i[t].ref,n=i[t].score,r=this._KeywordDocuments[o];if(!r)continue;let s=o.split("/"),a="";if(s.length>=2){let t=s[0],e=s[1];a=this.isModuleInCatalog(t,e)?"#/doc/"+o:"#/page/"+o}e.push({Key:o,Title:r.Title||o,Group:r.Group||"",Module:r.Module||"",DocPath:r.DocPath||"",Score:n,Route:a})}}catch(t){this.log.warn(`Docuserve: Search error: ${t}`)}return e}getErrorPageHTML(t){let e=t||"unknown";return this.pict.AppData.Docuserve.ErrorPageLoaded&&this.pict.AppData.Docuserve.ErrorPageHTML?this.pict.AppData.Docuserve.ErrorPageHTML.replace(/\{\{path\}\}/g,this._ContentProvider.escapeHTML(e)):'<div class="docuserve-not-found"><h2>Page Not Found</h2><p>The document <code>'+this._ContentProvider.escapeHTML(e)+'</code> could not be loaded.</p><p><a href="#/Home">Return to the home page</a></p></div>'}parseSidebarMarkdown(t){let e=[],i=null,o=t.split("\n");for(let t=0;t<o.length;t++){let n=o[t];if(!n.trim())continue;let r=n.match(/^(\s*)/),s=r?r[1].length:0,a=n.trim().match(/^[-*+]\s+(.*)/);if(!a)continue;let l=a[1].trim(),d=l.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(s<2)if(d){let t=d[1].trim(),o=d[2].trim();i={Name:t,Key:this.deriveGroupKey(t,o),Route:this.convertSidebarLink(o),Modules:[]},e.push(i)}else{let t=l,o=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");i={Name:t,Key:o,Route:"",Modules:[]},e.push(i)}else if(i)if(d){let t=d[1].trim(),e=d[2].trim(),o=this.convertSidebarLink(e);i.Modules.push({Name:t,HasDocs:!0,Group:i.Key,Route:o})}else i.Modules.push({Name:l,HasDocs:!1,Group:i.Key,Route:""})}return e}convertSidebarLink(t){if(!t)return"";if("/"===t)return"#/Home";if(t.match(/^#[^/]/)){let t=this.pict.AppData.Docuserve.SidebarGroups;if(t)for(let e=0;e<t.length;e++){let i=t[e].Modules;if(i)for(let t=0;t<i.length;t++)if(i[t].HasDocs&&i[t].Route&&"#/Home"!==i[t].Route)return i[t].Route;if(t[e].Route&&"#/Home"!==t[e].Route)return t[e].Route}return"#/Home"}let e=t.replace(/^\//,"").replace(/\/$/,"");if(!e)return"#/Home";let i=e.split("/");if(i.length>=2){if(this.isGroupInCatalog(i[0])&&this.isModuleInCatalog(i[0],i[1]))return"#/doc/"+e;let t=this.findModuleGroupKey(i[1]);if(t){let e=i.slice(2).join("/");return e?"#/doc/"+t+"/"+i[1]+"/"+e:"#/doc/"+t+"/"+i[1]}}return e.match(/\.md$/)?"#/page/"+e.replace(/\.md$/,""):"#/page/"+e}deriveGroupKey(t,e){if(e&&"/"!==e){let t=e.replace(/^\//,"").replace(/\.md$/,"").replace(/\/$/,"");if(t&&!t.includes("/"))return t.toLowerCase()}return t.split(/[\s—\-:]+/)[0].toLowerCase().replace(/[^a-z0-9]/g,"")}buildSidebarData(t){let e=[];for(let i=0;i<t.Groups.length;i++){let o=t.Groups[i],n={Name:o.Name,Key:o.Key,Description:o.Description,Modules:[]};for(let t=0;t<o.Modules.length;t++){let e=o.Modules[t];n.Modules.push({Name:e.Name,HasDocs:e.HasDocs,Group:o.Key,Route:"#/doc/"+o.Key+"/"+e.Name})}e.push(n)}this.pict.AppData.Docuserve.SidebarGroups=e}resolveDocumentURL(t,e,i){if(!this._Catalog)return null;let o=this._Catalog.GitHubOrg||"stevenvelozo",n=this._Catalog.DefaultBranch||"master";for(let r=0;r<this._Catalog.Groups.length;r++){let s=this._Catalog.Groups[r];if(s.Key===t)for(let t=0;t<s.Modules.length;t++){let r=s.Modules[t];if(r.Name!==e)continue;let a=r.Branch||n,l=i||"README.md";return"https://raw.githubusercontent.com/"+o+"/"+r.Repo+"/"+a+"/docs/"+l}}return null}resolveGitHubURLToRoute(t){if(!this._Catalog||!this._Catalog.Groups||!t)return null;let e=t.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)/);if(!e)return null;let i=e[1],o=e[2];if(i!==this._Catalog.GitHubOrg)return null;for(let t=0;t<this._Catalog.Groups.length;t++){let e=this._Catalog.Groups[t];for(let t=0;t<e.Modules.length;t++){let i=e.Modules[t];if(i.Repo===o)return"#/doc/"+e.Key+"/"+i.Name}}return null}resolveGitHubPagesURL(t,e){if(!this._Catalog||!this._Catalog.Groups)return null;let i=this._Catalog.GitHubOrg||"stevenvelozo";for(let o=0;o<this._Catalog.Groups.length;o++){let n=this._Catalog.Groups[o];if(n.Key===t)for(let t=0;t<n.Modules.length;t++){let o=n.Modules[t];if(o.Name===e)return o.HasDocs?"https://"+i+".github.io/"+o.Repo+"/":null}}return null}getModuleSidebar(t,e){if(!this._Catalog)return null;for(let i=0;i<this._Catalog.Groups.length;i++){let o=this._Catalog.Groups[i];if(o.Key===t)for(let t=0;t<o.Modules.length;t++){let i=o.Modules[t];if(i.Name===e)return i.Sidebar||null}}return null}fetchDocument(t,e,i,o,n){let r="function"==typeof e?e:()=>{};return t?this._ContentCache[t]?r(null,this._ContentCache[t]):void fetch(t).then(t=>t.ok?t.text():null).then(e=>{if(!e)return r("Document not found",this.getErrorPageHTML(t));let s=this._ContentProvider.parseMarkdown(e,this._createLinkResolver(i,o,n),this._createImageResolver(t));return this._ContentCache[t]=s,r(null,s)}).catch(e=>(this.log.warn(`Docuserve: Error fetching document [${t}]: ${e}`),r(e,this.getErrorPageHTML(t)))):r("No URL provided","")}fetchLocalDocument(t,e,i,o,n){let r=(this.pict.AppData.Docuserve.DocsBaseURL||"")+t;this.fetchDocument(r,e,i,o,n)}convertDocLink(t,e,i,o){let n=t.replace(/^\.\//,"");n=n.replace(/^\//,"");let r=n.split("/");if(r.length>=2&&this.isGroupInCatalog(r[0])&&this.isModuleInCatalog(r[0],r[1]))return"#/doc/"+n;if(e&&i){let t="";if(o){let e=o.split("/");e.length>1&&(e.pop(),t=e.join("/")+"/")}return"#/doc/"+e+"/"+i+"/"+t+n}if(n.match(/\.md$/)){return"#/page/"+n.replace(/\.md$/,"")}return"#/page/"+n}},e.exports.default_configuration={ProviderIdentifier:"Docuserve-Documentation",AutoInitialize:!0,AutoInitializeOrdinal:0}},{lunr:32,"pict-provider":55,"pict-section-content":59}],48:[function(t,e,i){const o=t("pict-section-content"),n={ViewIdentifier:"Docuserve-Content",DefaultRenderable:"Docuserve-Content-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content-code-wrap {\n\t\t\tposition: relative;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: auto;\n\t\t\tmargin: 1em 0;\n\t\t\tbackground: #3D3229;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 40px;\n\t\t\tpadding: 1.25em 0;\n\t\t\ttext-align: right;\n\t\t\tbackground: #342A22;\n\t\t\tborder-right: 1px solid #4A3F35;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 13px;\n\t\t\tline-height: 1.5;\n\t\t\tuser-select: none;\n\t\t\tpointer-events: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers span {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0 8px 0 0;\n\t\t}\n\t\t.pict-content-code-wrap pre {\n\t\t\tmargin: 0;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em 1.25em 1.25em 52px;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content-code-wrap pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.pict-content-code-wrap .keyword { color: #C678DD; }\n\t\t.pict-content-code-wrap .string { color: #98C379; }\n\t\t.pict-content-code-wrap .number { color: #D19A66; }\n\t\t.pict-content-code-wrap .comment { color: #7F848E; font-style: italic; }\n\t\t.pict-content-code-wrap .operator { color: #56B6C2; }\n\t\t.pict-content-code-wrap .punctuation { color: #E8E0D4; }\n\t\t.pict-content-code-wrap .function-name { color: #61AFEF; }\n\t\t.pict-content-code-wrap .property { color: #E06C75; }\n\t\t.pict-content-code-wrap .tag { color: #E06C75; }\n\t\t.pict-content-code-wrap .attr-name { color: #D19A66; }\n\t\t.pict-content-code-wrap .attr-value { color: #98C379; }\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid #2E7D74;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t\t.docuserve-module-external-link {\n\t\t\tpadding: 0.5em 0;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-align: right;\n\t\t}\n\t\t.docuserve-module-external-link a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.docuserve-module-external-link a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-not-found {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.docuserve-not-found h2 {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.5em;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.docuserve-not-found code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Content-Template",Template:'\n<div class="pict-content" id="Docuserve-Content-Body">\n\t<div class="pict-content-loading">Loading documentation...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Content-Display",TemplateHash:"Docuserve-Content-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}displayContent(t){let e=t,i=this.pict.AppData.Docuserve.CurrentGroup,o=this.pict.AppData.Docuserve.CurrentModule;if(i&&o){let t=this.pict.providers["Docuserve-Documentation"];if(t){let n=t.resolveGitHubPagesURL(i,o);n&&(e='<div class="docuserve-module-external-link"><a href="'+n+'" target="_blank" rel="noopener">↗ View '+o+" documentation site</a></div>"+e)}}super.displayContent(e,"Docuserve-Content-Body")}showLoading(){super.showLoading("Loading documentation...","Docuserve-Content-Body")}},e.exports.default_configuration=n},{"pict-section-content":59}],49:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-Layout",DefaultRenderable:"Docuserve-Layout-Shell",DefaultDestinationAddress:"#Docuserve-Application-Container",AutoRender:!1,CSS:"\n\t\t#Docuserve-Application-Container {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t#Docuserve-TopBar-Container {\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.docuserve-body {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#Docuserve-Sidebar-Container {\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 280px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground-color: #F5F0E8;\n\t\t}\n\t\t#Docuserve-Content-Container {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow-y: auto;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Layout-Shell-Template",Template:'\n<div id="Docuserve-TopBar-Container"></div>\n<div class="docuserve-body">\n\t<div id="Docuserve-Sidebar-Container"></div>\n\t<div id="Docuserve-Content-Container"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Layout-Shell",TemplateHash:"Docuserve-Layout-Shell-Template",DestinationAddress:"#Docuserve-Application-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,o){if(this.pict.views["Docuserve-TopBar"].render(),this.pict.views["Docuserve-Sidebar"].render(),this.pict.views["Docuserve-Splash"].render(),this.pict.CSSMap.injectCSS(),this.pict.PictApplication.resolveHash(),!this._HashChangeListenerBound){this._HashChangeListenerBound=!0;let t=this;window.addEventListener("hashchange",()=>{t.pict.PictApplication.resolveHash()})}return super.onAfterRender(t,e,i,o)}},e.exports.default_configuration=n},{"pict-view":88}],50:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-Search",DefaultRenderable:"Docuserve-Search-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-search {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.docuserve-search-header {\n\t\t\tmargin-bottom: 1.5em;\n\t\t}\n\t\t.docuserve-search-header h1 {\n\t\t\tfont-size: 1.75em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin: 0 0 0.75em 0;\n\t\t}\n\t\t.docuserve-search-input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.75em 1em;\n\t\t\tfont-size: 1.1em;\n\t\t\tborder: 2px solid #D4CCBE;\n\t\t\tborder-radius: 6px;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t\ttransition: border-color 0.15s;\n\t\t}\n\t\t.docuserve-search-input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-search-status {\n\t\t\tmargin-top: 0.75em;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.docuserve-search-results {\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.docuserve-search-result {\n\t\t\tdisplay: block;\n\t\t\tpadding: 1em 1.25em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder: 1px solid #EAE3D8;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: inherit;\n\t\t\ttransition: border-color 0.15s, box-shadow 0.15s;\n\t\t}\n\t\t.docuserve-search-result:hover {\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 2px 8px rgba(46, 125, 116, 0.1);\n\t\t}\n\t\t.docuserve-search-result-title {\n\t\t\tfont-size: 1.05em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #2E7D74;\n\t\t\tmargin-bottom: 0.25em;\n\t\t}\n\t\t.docuserve-search-result-breadcrumb {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 0.2em;\n\t\t}\n\t\t.docuserve-search-result-path {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #A39889;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.docuserve-search-empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Search-Template",Template:'\n<div class="docuserve-search">\n\t<div class="docuserve-search-header">\n\t\t<h1>Search Documentation</h1>\n\t\t<input type="text" class="docuserve-search-input" id="Docuserve-Search-Input" placeholder="Search across all modules...">\n\t\t<div id="Docuserve-Search-Status" class="docuserve-search-status"></div>\n\t</div>\n\t<div id="Docuserve-Search-Results" class="docuserve-search-results"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Search-Display",TemplateHash:"Docuserve-Search-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._SearchDebounceTimer=null}onAfterRender(t,e,i,o){let n=document.getElementById("Docuserve-Search-Input");return n&&n.addEventListener("input",()=>{this._SearchDebounceTimer&&clearTimeout(this._SearchDebounceTimer),this._SearchDebounceTimer=setTimeout(()=>{this.performSearch(n.value)},250)}),super.onAfterRender(t,e,i,o)}showSearch(t){let e=document.getElementById("Docuserve-Search-Input");if(e&&(e.value=t||"",e.focus()),t&&t.trim())this.performSearch(t);else{let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let i=document.getElementById("Docuserve-Content-Container");i&&(i.scrollTop=0)}performSearch(t){if(!t||!t.trim()){let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let e=this.pict.providers["Docuserve-Documentation"].search(t);if(0===e.length)return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status","No results found for '"+this.escapeHTML(t)+"'."),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","");this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e.length+" result"+(1!==e.length?"s":"")+" for '"+this.escapeHTML(t)+"'");let i="";for(let t=0;t<e.length;t++){let o=e[t],n="";o.Group&&o.Module&&(n=o.Group+" › "+o.Module),i+='<a class="docuserve-search-result" href="'+o.Route+'">',i+='<div class="docuserve-search-result-title">'+this.escapeHTML(o.Title)+"</div>",n&&(i+='<div class="docuserve-search-result-breadcrumb">'+n+"</div>"),o.DocPath&&(i+='<div class="docuserve-search-result-path">'+this.escapeHTML(o.DocPath)+"</div>"),i+="</a>"}this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results",i)}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration=n},{"pict-view":88}],51:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-Sidebar",DefaultRenderable:"Docuserve-Sidebar-Content",DefaultDestinationAddress:"#Docuserve-Sidebar-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-sidebar {\n\t\t\tborder-right: 1px solid #DDD6CA;\n\t\t\tpadding: 1em 0;\n\t\t\tpadding-top: 0;\n\t\t\tmin-height: 100%;\n\t\t\tposition: relative;\n\t\t}\n\t\t.docuserve-sidebar-header {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: flex-end;\n\t\t\tpadding: 0.4em 0.5em 0;\n\t\t}\n\t\t.docuserve-sidebar-close {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.2em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.2em 0.4em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-sidebar-close:hover {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search {\n\t\t\tpadding: 0 1em 1em 1em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tborder: 1px solid #D4CCBE;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.85em;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.docuserve-sidebar-search input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-results {\n\t\t\tmargin-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-results a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tcolor: #423D37;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\tborder-radius: 3px;\n\t\t\ttransition: background-color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-result-title {\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover .docuserve-sidebar-search-result-title {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-result-meta {\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.docuserve-sidebar-search-all {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\tborder-top: 1px solid #EAE3D8;\n\t\t\tmargin-top: 0.25em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-all:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-sidebar-home {\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t}\n\t\t.docuserve-sidebar-home a {\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.docuserve-sidebar-home a:hover {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-group {\n\t\t\tmargin-top: 0.25em;\n\t\t}\n\t\t.docuserve-sidebar-group-title {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t}\n\t\t.docuserve-sidebar-group-title:hover {\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground-color: #EAE3D8;\n\t\t}\n\t\ta.docuserve-sidebar-group-title.active {\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground-color: #E0EDEB;\n\t\t}\n\t\t.docuserve-sidebar-modules {\n\t\t\tlist-style: none;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules li {\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-modules a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-modules a.active {\n\t\t\tcolor: #2E7D74;\n\t\t\tfont-weight: 600;\n\t\t\tbackground-color: #E0EDEB;\n\t\t}\n\t\t.docuserve-sidebar-modules .no-docs {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: #A39889;\n\t\t\tfont-size: 0.85em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav {\n\t\t\tborder-top: 1px solid #EAE3D8;\n\t\t\tmargin-top: 0.5em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav-section {\n\t\t\tpadding: 0.4em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.02em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.25em 1.25em 0.25em 2.25em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Sidebar-Template",Template:'\n<div class="docuserve-sidebar">\n\t<div class="docuserve-sidebar-header">\n\t\t<button class="docuserve-sidebar-close" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">×</button>\n\t</div>\n\t<div id="Docuserve-Sidebar-Search" class="docuserve-sidebar-search" style="display:none;">\n\t\t<input type="text" placeholder="Search docs..." id="Docuserve-Sidebar-Search-Input">\n\t\t<div id="Docuserve-Sidebar-Search-Results" class="docuserve-sidebar-search-results"></div>\n\t</div>\n\t<div class="docuserve-sidebar-home">\n\t\t<a onclick="{~P~}.PictApplication.navigateTo(\'/Home\')">Home</a>\n\t</div>\n\t<div id="Docuserve-Sidebar-Groups"></div>\n\t<div id="Docuserve-Sidebar-ModuleNav"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Sidebar-Content",TemplateHash:"Docuserve-Sidebar-Template",DestinationAddress:"#Docuserve-Sidebar-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._SidebarSearchDebounceTimer=null}onAfterRender(t,e,i,o){this.renderSidebarGroups();let n=document.getElementById("Docuserve-Sidebar-Search");if(n&&this.pict.AppData.Docuserve.KeywordIndexLoaded){n.style.display="";let t=document.getElementById("Docuserve-Sidebar-Search-Input");t&&t.addEventListener("input",()=>{this._SidebarSearchDebounceTimer&&clearTimeout(this._SidebarSearchDebounceTimer),this._SidebarSearchDebounceTimer=setTimeout(()=>{this.performSidebarSearch(t.value)},250)})}return super.onAfterRender(t,e,i,o)}renderSidebarGroups(){let t=this.pict.AppData.Docuserve.SidebarGroups;if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups","");let e="";for(let i=0;i<t.length;i++){let o=t[i];e+='<div class="docuserve-sidebar-group">';let n=o.Route||"";if(!n)for(let t=0;t<o.Modules.length;t++)if(o.Modules[t].HasDocs&&o.Modules[t].Route){n=o.Modules[t].Route;break}if(n){let t="",i=window.location.hash||"";this.pict.AppData.Docuserve.CurrentGroup!==o.Key&&i!==n||(t=" active"),e+='<a class="docuserve-sidebar-group-title'+t+'" href="'+n+'">'+this.escapeHTML(o.Name)+"</a>"}else e+='<div class="docuserve-sidebar-group-title">'+this.escapeHTML(o.Name)+"</div>";e+='<ul class="docuserve-sidebar-modules">';for(let t=0;t<o.Modules.length;t++){let i=o.Modules[t];if(i.HasDocs){let t="";this.pict.AppData.Docuserve.CurrentGroup===i.Group&&this.pict.AppData.Docuserve.CurrentModule===i.Name&&(t=' class="active"'),e+="<li><a"+t+' href="'+i.Route+'">'+this.escapeHTML(i.Name)+"</a></li>"}else e+='<li><span class="no-docs">'+this.escapeHTML(i.Name)+"</span></li>"}e+="</ul>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups",e)}renderModuleNav(t,e){let i=this.pict.providers["Docuserve-Documentation"];if(!i)return;let o=i.getModuleSidebar(t,e);if(!o)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","");let n="#/doc/"+t+"/"+e+"/",r='<div class="docuserve-sidebar-module-nav">';for(let t=0;t<o.length;t++){let e=o[t];if(e.Children){r+='<div class="docuserve-sidebar-module-nav-section">'+this.escapeHTML(e.Title)+"</div>";for(let t=0;t<e.Children.length;t++){let i=e.Children[t];i.Path&&(r+='<a href="'+n+i.Path+'">'+this.escapeHTML(i.Title)+"</a>")}}else e.Path&&(r+='<a href="'+n+e.Path+'">'+this.escapeHTML(e.Title)+"</a>")}r+="</div>",this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav",r)}performSidebarSearch(t){let e=document.getElementById("Docuserve-Sidebar-Search-Results");if(!e)return;if(!t||!t.trim())return void(e.innerHTML="");let i=this.pict.providers["Docuserve-Documentation"].search(t);if(0===i.length)return void(e.innerHTML='<div style="padding: 0.4em 0.5em; font-size: 0.82em; color: #8A7F72;">No results found.</div>');let o="";for(let t=0;t<i.length&&t<8;t++){let e=i[t],n="";e.Group&&e.Module&&(n=e.Group+" / "+e.Module),o+='<a href="'+e.Route+'">',o+='<div class="docuserve-sidebar-search-result-title">'+this.escapeHTML(e.Title)+"</div>",n&&(o+='<div class="docuserve-sidebar-search-result-meta">'+this.escapeHTML(n)+"</div>"),o+="</a>"}if(i.length>8){o+='<a class="docuserve-sidebar-search-all" href="#/search/'+encodeURIComponent(t)+'">See all '+i.length+" results</a>"}e.innerHTML=o}toggleSidebar(){this.pict.AppData.Docuserve.SidebarVisible=!this.pict.AppData.Docuserve.SidebarVisible;let t=document.getElementById("Docuserve-Sidebar-Container"),e=document.getElementById("Docuserve-TopBar-Toggle");this.pict.AppData.Docuserve.SidebarVisible?(t&&(t.style.display=""),e&&(e.style.display="none")):(t&&(t.style.display="none"),e&&(e.style.display="inline-block"))}clearModuleNav(){this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","")}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=n},{"pict-view":88}],52:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-Splash",DefaultRenderable:"Docuserve-Splash-Content",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-splash {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: calc(100vh - 56px);\n\t\t\tpadding: 3em 2em;\n\t\t\ttext-align: center;\n\t\t\tbackground: linear-gradient(135deg, #F5F0E8 0%, #E4EFED 100%);\n\t\t}\n\t\t.docuserve-splash h1 {\n\t\t\tfont-size: 3em;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin: 0 0 0.25em 0;\n\t\t}\n\t\t.docuserve-splash h1 small {\n\t\t\tfont-size: 0.4em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #7A7568;\n\t\t\tvertical-align: middle;\n\t\t\tmargin-left: 0.15em;\n\t\t}\n\t\t.docuserve-splash-tagline {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #7A7568;\n\t\t\tmargin-bottom: 1.5em;\n\t\t\tfont-style: italic;\n\t\t}\n\t\t.docuserve-splash-description {\n\t\t\tfont-size: 1em;\n\t\t\tcolor: #5E5549;\n\t\t\tmax-width: 600px;\n\t\t\tline-height: 1.7;\n\t\t\tmargin-bottom: 2em;\n\t\t}\n\t\t.docuserve-splash-highlights {\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\t\tgap: 1.25em;\n\t\t\tmax-width: 900px;\n\t\t\twidth: 100%;\n\t\t\tmargin-bottom: 2.5em;\n\t\t}\n\t\t.docuserve-splash-highlight-card {\n\t\t\tbackground: #fff;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 1.25em;\n\t\t\ttext-align: left;\n\t\t\ttransition: box-shadow 0.2s, border-color 0.2s;\n\t\t}\n\t\t.docuserve-splash-highlight-card:hover {\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-splash-highlight-card h3 {\n\t\t\tmargin: 0 0 0.5em 0;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.docuserve-splash-highlight-card p {\n\t\t\tmargin: 0;\n\t\t\tcolor: #7A7568;\n\t\t\tfont-size: 0.85em;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.docuserve-splash-actions {\n\t\t\tdisplay: flex;\n\t\t\tgap: 1em;\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.docuserve-splash-actions a {\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.7em 1.5em;\n\t\t\tborder-radius: 6px;\n\t\t\tfont-size: 0.95em;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-splash-actions .primary {\n\t\t\tbackground-color: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-splash-actions .primary:hover {\n\t\t\tbackground-color: #256861;\n\t\t}\n\t\t.docuserve-splash-actions .secondary {\n\t\t\tbackground-color: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\tborder: 2px solid #2E7D74;\n\t\t}\n\t\t.docuserve-splash-actions .secondary:hover {\n\t\t\tborder-color: #256861;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Splash-Template",Template:'\n<div class="docuserve-splash">\n\t<h1 id="Docuserve-Splash-Title"></h1>\n\t<div class="docuserve-splash-tagline" id="Docuserve-Splash-Tagline"></div>\n\t<div class="docuserve-splash-description" id="Docuserve-Splash-Description"></div>\n\t<div class="docuserve-splash-highlights" id="Docuserve-Splash-Highlights"></div>\n\t<div class="docuserve-splash-actions" id="Docuserve-Splash-Actions"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Splash-Content",TemplateHash:"Docuserve-Splash-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,o){let n=this.pict.AppData.Docuserve;return n.CoverLoaded&&n.Cover?this.renderFromCover(n.Cover):this.renderFromCatalog(n),super.onAfterRender(t,e,i,o)}renderFromCover(t){this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.sanitizeTitle(t.Title)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(t.Tagline)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description",this.escapeHTML(t.Description));let e="";for(let i=0;i<t.Highlights.length;i++){let o=t.Highlights[i];e+='<div class="docuserve-splash-highlight-card">',o.Label&&(e+="<h3>"+this.escapeHTML(o.Label)+"</h3>"),e+="<p>"+this.escapeHTML(o.Text)+"</p>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",e);let i="",o=this.pict.providers["Docuserve-Documentation"];for(let e=0;e<t.Actions.length;e++){let n=t.Actions[e],r=0===e?"primary":"secondary",s=n.Href;if(s.match(/^https?:\/\//))i+='<a class="'+r+'" href="'+this.escapeHTML(s)+'" target="_blank" rel="noopener">'+this.escapeHTML(n.Text)+"</a>";else{let t=o.convertSidebarLink(s);i+='<a class="'+r+'" href="'+this.escapeHTML(t)+'">'+this.escapeHTML(n.Text)+"</a>"}}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions",i)}renderFromCatalog(t){let e="Documentation",i="";t.CatalogLoaded&&t.Catalog&&t.Catalog.Name?e=t.Catalog.Name:t.TopBarLoaded&&t.TopBar&&t.TopBar.Brand?e=t.TopBar.Brand:"undefined"!=typeof document&&document.title&&(e=document.title),t.CatalogLoaded&&t.Catalog&&t.Catalog.Description&&(i=t.Catalog.Description),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.escapeHTML(e)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(i)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description","");let o="",n=t.SidebarGroups||[];for(let t=0;t<n.length;t++){let e=n[t];if(!e.Modules||e.Modules.length<1)continue;let i=e.Description||e.Modules.length+" modules";o+='<div class="docuserve-splash-highlight-card">',o+="<h3>"+this.escapeHTML(e.Name)+"</h3>",o+="<p>"+this.escapeHTML(i)+"</p>",o+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",o),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions","")}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/<small>/gi,"<small>").replace(/<\/small>/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=n},{"pict-view":88}],53:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-TopBar",DefaultRenderable:"Docuserve-TopBar-Content",DefaultDestinationAddress:"#Docuserve-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-topbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tbackground-color: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 0 1.5em;\n\t\t\theight: 56px;\n\t\t\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 100;\n\t\t}\n\t\t.docuserve-topbar-brand {\n\t\t\tfont-size: 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.02em;\n\t\t\tcolor: #E8E0D4;\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-brand small {\n\t\t\tfont-size: 0.65em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-left: 0.2em;\n\t\t}\n\t\t.docuserve-topbar-brand:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-nav {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.25em;\n\t\t}\n\t\t.docuserve-topbar-nav a {\n\t\t\tcolor: #B5AA9A;\n\t\t\ttext-decoration: none;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-nav a:hover {\n\t\t\tbackground-color: #524438;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-links {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t}\n\t\t.docuserve-topbar-links a {\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tborder-radius: 4px;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t}\n\t\t.docuserve-topbar-links a:hover {\n\t\t\tbackground-color: #524438;\n\t\t\tcolor: #E8E0D4;\n\t\t}\n\t\t.docuserve-topbar-toggle {\n\t\t\tdisplay: none;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #B5AA9A;\n\t\t\tfont-size: 1.3em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.3em 0.5em;\n\t\t\tmargin-left: 0.5em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-topbar-toggle:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-right {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-TopBar-Template",Template:'\n<div class="docuserve-topbar">\n\t<a id="Docuserve-TopBar-Brand" class="docuserve-topbar-brand" href="#/Home"></a>\n\t<div id="Docuserve-TopBar-Nav" class="docuserve-topbar-nav"></div>\n\t<div class="docuserve-topbar-right">\n\t\t<div id="Docuserve-TopBar-Links" class="docuserve-topbar-links"></div>\n\t\t<button id="Docuserve-TopBar-Toggle" class="docuserve-topbar-toggle" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">☰</button>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-TopBar-Content",TemplateHash:"Docuserve-TopBar-Template",DestinationAddress:"#Docuserve-TopBar-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,o){return this.renderTopBarContent(),super.onAfterRender(t,e,i,o)}renderTopBarContent(){let t=this.pict.AppData.Docuserve,e=document.getElementById("Docuserve-TopBar-Brand"),i=document.getElementById("Docuserve-TopBar-Nav"),o=document.getElementById("Docuserve-TopBar-Links");if(e&&i&&o)if(t.TopBarLoaded&&t.TopBar){let n=t.TopBar;e.innerHTML=this.sanitizeTitle(n.Brand||"Documentation");let r='<a href="#/Home">Home</a>';for(let t=0;t<n.NavLinks.length;t++){let e=n.NavLinks[t];r+='<a href="'+e.Href+'">'+this.escapeHTML(e.Text)+"</a>"}i.innerHTML=r;let s="";t.KeywordIndexLoaded&&(s+='<a href="#/search/">Search</a>');for(let t=0;t<n.ExternalLinks.length;t++){let e=n.ExternalLinks[t];s+='<a href="'+this.escapeHTML(e.Href)+'" target="_blank" rel="noopener">'+this.escapeHTML(e.Text)+"</a>"}o.innerHTML=s}else{let n="Documentation";t.CoverLoaded&&t.Cover&&t.Cover.Title?n=t.Cover.Title:t.CatalogLoaded&&t.Catalog&&t.Catalog.Name&&(n=t.Catalog.Name),e.innerHTML=this.sanitizeTitle(n),i.innerHTML='<a href="#/Home">Home</a>',o.innerHTML=t.KeywordIndexLoaded?'<a href="#/search/">Search</a>':""}}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/<small>/gi,"<small>").replace(/<\/small>/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration=n},{"pict-view":88}],54:[function(t,e,i){e.exports={name:"pict-provider",version:"1.0.12",description:"Pict Provider Base Class",main:"source/Pict-Provider.js",scripts:{start:"node source/Pict-Provider.js",test:"npx quack test",tests:"npx quack test -g",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-provider-image:local","docker-dev-run":'docker run -it -d --name pict-provider-dev -p 24125:8080 -p 30027:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-provider" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-provider-image:local',"docker-dev-shell":"docker exec -it pict-provider-dev /bin/bash",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Provider.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-provider.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-provider/issues"},homepage:"https://github.com/stevenvelozo/pict-provider#readme",devDependencies:{"@eslint/js":"^9.39.1",eslint:"^9.39.1",pict:"^1.0.351",quackage:"^1.0.58",typescript:"^5.9.3"},dependencies:{"fable-serviceproviderbase":"^3.0.19"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]}}},{}],55:[function(t,e,i){const o=t("fable-serviceproviderbase"),n=t("../package.json"),r={ProviderIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoLoadDataWithApp:!0,AutoLoadDataOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,Manifests:{},Templates:[]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),i),this.fable,this.pict,this.log,this.options,this.UUID,this.Hash,this.options.ProviderIdentifier||(this.options.ProviderIdentifier=`AutoProviderID-${this.fable.getUUID()}`),this.serviceType="PictProvider",this._Package=n,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1;for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];e.hasOwnProperty("Postfix")&&e.hasOwnProperty("Template")?(e.Source||(e.Source=`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} options object.`),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} could not load Default Template ${t} in the options array.`,e)}}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow PROVIDER [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initialize:`),this.initializeTimestamp?(this.log.warn(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initialize called but initialization is already completed. Aborting.`),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow PROVIDER [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initializeAsync:`),this.initializeTimestamp)return this.log.warn(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} async initialize called but initialization is already completed. Aborting.`),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} beginning initialization...`),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(this.initializeTimestamp=this.pict.log.getTimeStamp(),e?this.log.error(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initialization failed: ${e.message||e}`,{Stack:e.stack}):this.pict.LogNoisiness>0&&this.log.info(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} initialization complete.`),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onPreRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onPreRender:`),!0}onPreRenderAsync(t){return this.onPreRender(),t()}render(){return this.onPreRender()}renderAsync(t){return this.onPreRender(),t()}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onPreSolve:`),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}solve(){return this.onPreSolve()}solveAsync(t){return this.onPreSolve(),t()}onBeforeLoadDataAsync(t){return t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onLoadDataAsync:`),t()}onAfterLoadDataAsync(t){return t()}onBeforeSaveDataAsync(t){return t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictProvider [${this.UUID}]::[${this.Hash}] ${this.options.ProviderIdentifier} onSaveDataAsync:`),t()}onAfterSaveDataAsync(t){return t()}}},{"../package.json":54,"fable-serviceproviderbase":20}],56:[function(t,e,i){const o={javascript:{tokenizer:/(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2|(`(?:[^`\\]|\\.)*?`)|(\/(?![/*])(?:\\.|\[(?:\\.|[^\]])*\]|[^/\\\n])+\/[gimsuvy]*)/g,keywords:/\b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|from|function|get|if|import|in|instanceof|let|new|of|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/g,builtins:/\b(true|false|null|undefined|NaN|Infinity|console|window|document|Math|JSON|Array|Object|String|Number|Boolean|Date|RegExp|Map|Set|Promise|Error|Symbol|parseInt|parseFloat|require|module|exports)\b/g,numbers:/\b(\d+\.?\d*(?:e[+-]?\d+)?|0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+)\b/g},json:{tokenizer:/(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|("(?:[^"\\]|\\.)*")/g,keywords:/\b(true|false|null)\b/g,numbers:/-?\b\d+\.?\d*(?:e[+-]?\d+)?\b/g},html:{tokenizer:/(<!--[\s\S]*?-->)|(["'])(?:(?!\2|\\).|\\.)*?\2|(<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*\/?>)/g,tagGroupIndex:3},css:{tokenizer:/(\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2/g,selectors:/([.#]?[a-zA-Z_][\w-]*(?:\s*[>+~]\s*[.#]?[a-zA-Z_][\w-]*)*)\s*\{/g,properties:/\b([a-zA-Z-]+)\s*:/g,numbers:/\b(\d+\.?\d*)(px|em|rem|%|vh|vw|s|ms|deg|fr)?\b/g,keywords:/\b(important|inherit|initial|unset|none|auto|block|inline|flex|grid)\b/g},sql:{tokenizer:/(--[^\n]*|\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2/g,keywords:/\b(SELECT|FROM|WHERE|AND|OR|INSERT|INTO|VALUES|UPDATE|SET|DELETE|CREATE|TABLE|DROP|ALTER|ADD|COLUMN|INDEX|JOIN|LEFT|RIGHT|INNER|OUTER|ON|AS|ORDER|BY|GROUP|HAVING|LIMIT|OFFSET|UNION|ALL|DISTINCT|COUNT|SUM|AVG|MIN|MAX|NOT|NULL|IS|IN|BETWEEN|LIKE|EXISTS|CASE|WHEN|THEN|ELSE|END|PRIMARY|KEY|FOREIGN|REFERENCES|CONSTRAINT|DEFAULT|CHECK|UNIQUE|CASCADE|GRANT|REVOKE|COMMIT|ROLLBACK|BEGIN|TRANSACTION|INT|VARCHAR|DATETIME|AUTO_INCREMENT|CURRENT_TIMESTAMP)\b/gi,numbers:/\b\d+\.?\d*\b/g}};function n(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function r(t,e){let i=t;return e.selectors&&(e.selectors.lastIndex=0,i=i.replace(e.selectors,'<span class="function-name">$1</span>{')),e.properties&&(e.properties.lastIndex=0,i=i.replace(e.properties,'<span class="property">$1</span>:')),e.keywords&&(e.keywords.lastIndex=0,i=i.replace(e.keywords,'<span class="keyword">$1</span>')),e.builtins&&(e.builtins.lastIndex=0,i=i.replace(e.builtins,'<span class="keyword">$1</span>')),e.numbers&&(e.numbers.lastIndex=0,i=i.replace(e.numbers,t=>`<span class="number">${t}</span>`)),i}function s(t){let e="",i=t,o=i.match(/^(<\/?)([a-zA-Z][a-zA-Z0-9-]*)/);if(!o)return n(t);e+=n(o[1]),e+='<span class="tag">'+n(o[2])+"</span>",i=i.substring(o[0].length);let r,s=/^(\s+)([a-zA-Z-]+)(?:(\s*=\s*)(["'])([^"']*?)\4)?/;for(;null!==(r=i.match(s));)e+=r[1],e+='<span class="attr-name">'+n(r[2])+"</span>",r[3]&&(e+=n(r[3]),e+='<span class="attr-value">'+n(r[4])+n(r[5])+n(r[4])+"</span>"),i=i.substring(r[0].length);return e+=n(i),e}o.js=o.javascript,o.htm=o.html,e.exports=function(t){return function(e){let i=e.textContent,a="string"==typeof t?t.toLowerCase():"javascript",l=o[a];if(!l)return void(e.innerHTML=n(i));if(!l.tokenizer)return void(e.innerHTML=r(n(i),l));let d,c="",p=0,h=l.tagGroupIndex||0;for(l.tokenizer.lastIndex=0;null!==(d=l.tokenizer.exec(i));){if(d.index>p){c+=r(n(i.substring(p,d.index)),l)}let t=d[0];d[1]?c+=`<span class="comment">${n(t)}</span>`:h>0&&d[h]?c+=s(t):c+=`<span class="string">${n(t)}</span>`,p=l.tokenizer.lastIndex}if(p<i.length){c+=r(n(i.substring(p)),l)}e.innerHTML=c}},e.exports.LanguageDefinitions=o},{}],57:[function(t,e,i){e.exports={RenderOnLoad:!0,DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#CodeEditor-Container-Div",Templates:[{Hash:"CodeEditor-Container",Template:"\x3c!-- CodeEditor-Container Rendering Soon --\x3e"}],Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#CodeEditor-Container-Div"}],TargetElementAddress:"#CodeEditor-Container-Div",CodeDataAddress:!1,Language:"javascript",ReadOnly:!1,Tab:"\t",IndentOn:/[({[]$/,MoveToNewLine:/^[)}\]]/,AddClosing:!0,CatchTab:!0,LineNumbers:!0,DefaultCode:"// Enter your code here\n",CSS:".pict-code-editor-wrap\n{\n\tdisplay: flex;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\tborder: 1px solid #D0D0D0;\n\tborder-radius: 4px;\n\toverflow: hidden;\n}\n.pict-code-editor-wrap .pict-code-line-numbers\n{\n\twidth: 40px;\n\tmin-width: 40px;\n\tpadding: 10px 0;\n\ttext-align: right;\n\tbackground: #F5F5F5;\n\tborder-right: 1px solid #D0D0D0;\n\tcolor: #999;\n\tfont-size: 13px;\n\tline-height: 1.5;\n\tuser-select: none;\n\tpointer-events: none;\n\tbox-sizing: border-box;\n}\n.pict-code-editor-wrap .pict-code-line-numbers span\n{\n\tdisplay: block;\n\tpadding: 0 8px 0 0;\n}\n.pict-code-editor-wrap .pict-code-editor\n{\n\tmargin: 0;\n\tpadding: 10px 10px 10px 8px;\n\tmin-height: 100px;\n\tflex: 1;\n\tmin-width: 0;\n\toutline: none;\n\ttab-size: 4;\n\twhite-space: pre;\n\toverflow-wrap: normal;\n\tcolor: #383A42;\n\tbackground: #FAFAFA;\n\tcaret-color: #526FFF;\n\tborder-radius: 0 4px 4px 0;\n}\n.pict-code-editor-wrap .pict-code-editor.pict-code-no-line-numbers\n{\n\tpadding-left: 10px;\n\tborder-radius: 4px;\n}\n.pict-code-editor-wrap .pict-code-editor .keyword { color: #A626A4; }\n.pict-code-editor-wrap .pict-code-editor .string { color: #50A14F; }\n.pict-code-editor-wrap .pict-code-editor .number { color: #986801; }\n.pict-code-editor-wrap .pict-code-editor .comment { color: #A0A1A7; font-style: italic; }\n.pict-code-editor-wrap .pict-code-editor .operator { color: #0184BC; }\n.pict-code-editor-wrap .pict-code-editor .punctuation { color: #383A42; }\n.pict-code-editor-wrap .pict-code-editor .function-name { color: #4078F2; }\n.pict-code-editor-wrap .pict-code-editor .property { color: #E45649; }\n.pict-code-editor-wrap .pict-code-editor .tag { color: #E45649; }\n.pict-code-editor-wrap .pict-code-editor .attr-name { color: #986801; }\n.pict-code-editor-wrap .pict-code-editor .attr-value { color: #50A14F; }\n"}},{}],58:[function(t,e,i){const o=t("pict-view"),n=t("./Pict-Code-Highlighter.js"),r=t("./Pict-Section-Code-DefaultConfiguration.js");e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this.codeJar=null,this._highlightFunction=null,this._language=this.options.Language||"javascript"}onBeforeInitialize(){return super.onBeforeInitialize(),this._codeJarPrototype=null,this.targetElement=!1,this._highlightFunction=n(this._language),super.onBeforeInitialize()}connectCodeJarPrototype(t){if("function"!=typeof t)return"undefined"!=typeof window&&"function"==typeof window.CodeJar?(this.log.trace("PICT-Code Found CodeJar in window.CodeJar."),void(this._codeJarPrototype=window.CodeJar)):(this.log.error("PICT-Code No CodeJar prototype found. Include codejar via script tag or call connectCodeJarPrototype(CodeJar) explicitly."),!1);this._codeJarPrototype=t}onAfterRender(t){return this.pict.CSSMap.injectCSS(),this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeJarPrototype||this.connectCodeJarPrototype(),!this._codeJarPrototype)return this.log.error("PICT-Code Cannot initialize editor; no CodeJar prototype available."),!1;if(this.codeJar)return this.log.error("PICT-Code editor is already initialized!"),!1;let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error(`PICT-Code Could not find target element [${this.options.TargetElementAddress}]!`),this.targetElement=!1,!1;this.targetElement=t[0],this._buildEditorDOM();let e=this._resolveCodeContent(),i={};this.options.Tab&&(i.tab=this.options.Tab),this.options.IndentOn&&(i.indentOn=this.options.IndentOn),this.options.MoveToNewLine&&(i.moveToNewLine=this.options.MoveToNewLine),void 0!==this.options.AddClosing&&(i.addClosing=this.options.AddClosing),void 0!==this.options.CatchTab&&(i.catchTab=this.options.CatchTab),this.customConfigureEditorOptions(i);let o=this._editorElement;this.codeJar=this._codeJarPrototype(o,this._highlightFunction,i),this._resetEditorWrapStyles(),e&&this.codeJar.updateCode(e),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)}),this._updateLineNumbers(),this.options.ReadOnly&&o.setAttribute("contenteditable","false")}_buildEditorDOM(){this.targetElement.innerHTML="";let t=document.createElement("div");if(t.className="pict-code-editor-wrap",this.options.LineNumbers){let e=document.createElement("div");e.className="pict-code-line-numbers",t.appendChild(e),this._lineNumbersElement=e}let e=document.createElement("div");e.className="pict-code-editor language-"+this._language,this.options.LineNumbers||(e.className+=" pict-code-no-line-numbers"),t.appendChild(e),this.targetElement.appendChild(t),this._editorElement=e,this._wrapElement=t}_updateLineNumbers(){if(!this.options.LineNumbers||!this._lineNumbersElement||!this._editorElement)return;let t=(this._editorElement.textContent||"").split("\n").length,e="";for(let i=1;i<=t;i++)e+=`<span>${i}</span>`;this._lineNumbersElement.innerHTML=e}_resetEditorWrapStyles(){this._editorElement&&(this._editorElement.style.whiteSpace="pre",this._editorElement.style.overflowWrap="normal")}_resolveCodeContent(){if(this.options.CodeDataAddress){const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.CodeDataAddress);if("string"==typeof e)return e;this.log.warn(`PICT-Code Address [${this.options.CodeDataAddress}] did not return a string; it was ${typeof e}.`)}return this.options.DefaultCode||""}customConfigureEditorOptions(t){}onCodeChange(t){if(this.options.CodeDataAddress){const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.CodeDataAddress,t)}}getCode(){return this.codeJar?this.codeJar.toString():(this.log.warn("PICT-Code getCode called before editor initialized."),"")}setCode(t){this.codeJar?(this.codeJar.updateCode(t),this._updateLineNumbers()):this.log.warn("PICT-Code setCode called before editor initialized.")}setLanguage(t){if(this._language=t,this._highlightFunction=n(t),this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this._resetEditorWrapStyles(),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}setHighlightFunction(t){if("function"==typeof t){if(this._highlightFunction=t,this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this._resetEditorWrapStyles(),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}else this.log.error("PICT-Code setHighlightFunction requires a function.")}setReadOnly(t){this.options.ReadOnly=t,this._editorElement&&this._editorElement.setAttribute("contenteditable",t?"false":"true")}destroy(){this.codeJar&&(this.codeJar.destroy(),this.codeJar=null)}marshalToView(){if(super.marshalToView(),this.codeJar&&this.options.CodeDataAddress){let t=this._resolveCodeContent();"string"==typeof t&&(this.codeJar.updateCode(t),this._updateLineNumbers())}}marshalFromView(){super.marshalFromView(),this.codeJar&&this.options.CodeDataAddress&&this.onCodeChange(this.codeJar.toString())}},e.exports.default_configuration=r,e.exports.createHighlighter=n},{"./Pict-Code-Highlighter.js":56,"./Pict-Section-Code-DefaultConfiguration.js":57,"pict-view":88}],59:[function(t,e,i){e.exports=t("./views/Pict-View-Content.js"),e.exports.PictContentProvider=t("./providers/Pict-Provider-Content.js")},{"./providers/Pict-Provider-Content.js":60,"./views/Pict-View-Content.js":61}],60:[function(t,e,i){const o=t("pict-provider"),n=t("pict-section-code").createHighlighter;e.exports=class extends o{constructor(t,e,i){super(t,e,i)}highlightCode(t,e){if(!t)return"";let i={textContent:t,innerHTML:""};return n(e)(i),i.innerHTML}generateLineNumbers(t){if(!t)return"<span>1</span>";let e=t.split("\n").length,i="";for(let t=1;t<=e;t++)i+="<span>"+t+"</span>";return i}parseMarkdown(t,e,i){if(!t)return"";let o=t.split("\n"),n=[],r=!1,s=0,a="",l=[],d=!1,c="",p=!1,h=[],u=!1,m=[],f=[],g=()=>{f.length>0&&(n.push("<p>"+f.map(t=>this.parseInline(t,e,i)).join(" ")+"</p>"),f=[])};for(let t=0;t<o.length;t++){let v=o[t];if(!r&&v.trim().match(/^\$\$/)){u?(n.push('<div class="pict-content-katex-display">'+m.join("\n")+"</div>"),u=!1,m=[]):(g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),p&&(n.push("<blockquote>"+this.parseMarkdown(h.join("\n"),e,i)+"</blockquote>"),p=!1,h=[]),u=!0);continue}if(u){m.push(v);continue}let b=v.match(/^(`{3,})/);if(b){let t=b[1].length;if(r){if(t>=s&&v.trim()===b[1]){if("mermaid"===a)n.push('<pre class="mermaid">'+l.join("\n")+"</pre>");else{let t=l.join("\n"),e=this.highlightCode(t,a),i=this.generateLineNumbers(t);n.push('<div class="pict-content-code-wrap"><div class="pict-content-code-line-numbers">'+i+'</div><pre><code class="language-'+this.escapeHTML(a)+'">'+e+"</code></pre></div>")}r=!1,s=0,a="",l=[];continue}l.push(v);continue}g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),p&&(n.push("<blockquote>"+this.parseMarkdown(h.join("\n"),e,i)+"</blockquote>"),p=!1,h=[]),s=t,a=v.replace(/^`{3,}/,"").trim(),r=!0;continue}if(r){l.push(v);continue}if(v.match(/^>\s?/)){p||(g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),p=!0,h=[]),h.push(v.replace(/^>\s?/,""));continue}if(p&&(n.push("<blockquote>"+this.parseMarkdown(h.join("\n"),e,i)+"</blockquote>"),p=!1,h=[]),v.match(/^(-{3,}|\*{3,}|_{3,})\s*$/)){g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),n.push("<hr>");continue}let w=v.match(/^(#{1,6})\s+(.+)/);if(w){g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1);let t=w[1].length,o=this.parseInline(w[2],e,i),r=w[2].toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-");n.push("<h"+t+' id="'+r+'">'+o+"</h"+t+">");continue}let y=v.match(/^(\s*)[-*+]\s+(.*)/);if(y){g(),d&&"ul"===c||(d&&n.push("ul"===c?"</ul>":"</ol>"),n.push("<ul>"),d=!0,c="ul"),n.push("<li>"+this.parseInline(y[2],e,i)+"</li>");continue}let C=v.match(/^(\s*)\d+\.\s+(.*)/);if(C)g(),d&&"ol"===c||(d&&n.push("ul"===c?"</ul>":"</ol>"),n.push("<ol>"),d=!0,c="ol"),n.push("<li>"+this.parseInline(C[2],e,i)+"</li>");else if(d&&""!==v.trim()&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1),""!==v.trim()){if(v.match(/^\|/)&&t+1<o.length&&o[t+1].match(/^\|[\s-:|]+\|/)){g(),d&&(n.push("ul"===c?"</ul>":"</ol>"),d=!1);let r="<table>",s=v.split("|").filter(t=>""!==t.trim());r+="<thead><tr>";for(let t=0;t<s.length;t++)r+="<th>"+this.parseInline(s[t].trim(),e,i)+"</th>";for(r+="</tr></thead>",t++,r+="<tbody>";t+1<o.length&&o[t+1].match(/^\|/);){t++;let n=o[t].split("|").filter(t=>""!==t.trim());r+="<tr>";for(let t=0;t<n.length;t++)r+="<td>"+this.parseInline(n[t].trim(),e,i)+"</td>";r+="</tr>"}r+="</tbody></table>",n.push(r);continue}f.push(v)}else g()}if(g(),d&&n.push("ul"===c?"</ul>":"</ol>"),p&&n.push("<blockquote>"+this.parseMarkdown(h.join("\n"),e,i)+"</blockquote>"),r){let t=l.join("\n"),e=this.highlightCode(t,a),i=this.generateLineNumbers(t);n.push('<div class="pict-content-code-wrap"><div class="pict-content-code-line-numbers">'+i+"</div><pre><code>"+e+"</code></pre></div>")}return n.join("\n")}parseInline(t,e,i){if(!t)return"";let o=t,n=[];return o=o.replace(/`([^`]+)`/g,(t,e)=>{let i=n.length;return n.push("<code>"+e+"</code>"),"\0CODEINLINE"+i+"\0"}),o=o.replace(/\$([^\$\s][^\$]*?[^\$\s])\$/g,'<span class="pict-content-katex-inline">$1</span>'),o=o.replace(/\$([^\$\s])\$/g,'<span class="pict-content-katex-inline">$1</span>'),o=o.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(t,e,o)=>{let n=o;if("function"==typeof i){let t=i(o,e);t&&(n=t)}return'<img src="'+n+'" alt="'+e+'">'}),o=o.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,i,o)=>{if("function"==typeof e){let t=e(o,i);if(t){let e=t.target?' target="'+t.target+'"':"",o=t.rel?' rel="'+t.rel+'"':"";return'<a href="'+t.href+'"'+e+o+">"+i+"</a>"}}return o.match(/^https?:\/\//)?'<a href="'+o+'" target="_blank" rel="noopener">'+i+"</a>":'<a href="'+o+'">'+i+"</a>"}),o=o.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),o=o.replace(/__([^_]+)__/g,"<strong>$1</strong>"),o=o.replace(/\*([^*]+)\*/g,"<em>$1</em>"),o=o.replace(/_([^_]+)_/g,"<em>$1</em>"),o=o.replace(/\x00CODEINLINE(\d+)\x00/g,(t,e)=>n[parseInt(e)]),o}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration={ProviderIdentifier:"Pict-Content",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":55,"pict-section-code":58}],61:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-Content",DefaultRenderable:"Pict-Content-Display",DefaultDestinationAddress:"#Pict-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-content-code-wrap {\n\t\t\tposition: relative;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: auto;\n\t\t\tmargin: 1em 0;\n\t\t\tbackground: #3D3229;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 40px;\n\t\t\tpadding: 1.25em 0;\n\t\t\ttext-align: right;\n\t\t\tbackground: #342A22;\n\t\t\tborder-right: 1px solid #4A3F35;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 13px;\n\t\t\tline-height: 1.5;\n\t\t\tuser-select: none;\n\t\t\tpointer-events: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers span {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0 8px 0 0;\n\t\t}\n\t\t.pict-content-code-wrap pre {\n\t\t\tmargin: 0;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em 1.25em 1.25em 52px;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content-code-wrap pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.pict-content-code-wrap .keyword { color: #C678DD; }\n\t\t.pict-content-code-wrap .string { color: #98C379; }\n\t\t.pict-content-code-wrap .number { color: #D19A66; }\n\t\t.pict-content-code-wrap .comment { color: #7F848E; font-style: italic; }\n\t\t.pict-content-code-wrap .operator { color: #56B6C2; }\n\t\t.pict-content-code-wrap .punctuation { color: #E8E0D4; }\n\t\t.pict-content-code-wrap .function-name { color: #61AFEF; }\n\t\t.pict-content-code-wrap .property { color: #E06C75; }\n\t\t.pict-content-code-wrap .tag { color: #E06C75; }\n\t\t.pict-content-code-wrap .attr-name { color: #D19A66; }\n\t\t.pict-content-code-wrap .attr-value { color: #98C379; }\n\t\t.pict-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid #2E7D74;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t",Templates:[{Hash:"Pict-Content-Template",Template:'\n<div class="pict-content" id="Pict-Content-Body">\n\t<div class="pict-content-loading">Loading content...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Pict-Content-Display",TemplateHash:"Pict-Content-Template",DestinationAddress:"#Pict-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}displayContent(t,e){let i=e||"Pict-Content-Body";this.pict.ContentAssignment.assignContent("#"+i,t);let o=document.getElementById(i);o&&o.parentElement&&(o.parentElement.scrollTop=0),this.renderMermaidDiagrams(i),this.renderKaTeXEquations(i)}renderMermaidDiagrams(t){if("undefined"==typeof mermaid)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let o=i.querySelectorAll("pre.mermaid");if(!(o.length<1))try{mermaid.run({nodes:o})}catch(t){this.log.error("Mermaid rendering error: "+t.message)}}renderKaTeXEquations(t){if("undefined"==typeof katex)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let o=i.querySelectorAll(".pict-content-katex-inline");for(let t=0;t<o.length;t++)try{katex.render(o[t].textContent,o[t],{throwOnError:!1,displayMode:!1})}catch(t){this.log.warn("KaTeX inline error: "+t.message)}let n=i.querySelectorAll(".pict-content-katex-display");for(let t=0;t<n.length;t++)try{katex.render(n[t].textContent,n[t],{throwOnError:!1,displayMode:!0})}catch(t){this.log.warn("KaTeX display error: "+t.message)}}showLoading(t,e){let i=e||"Pict-Content-Body",o=t||"Loading content...";this.pict.ContentAssignment.assignContent("#"+i,'<div class="pict-content-loading">'+o+"</div>")}},e.exports.default_configuration=n},{"pict-view":88}],62:[function(t,e,i){e.exports={ViewIdentifier:"Pict-FileBrowser",DefaultRenderable:"FileBrowser-Container",DefaultDestinationAddress:"#Pict-FileBrowser-Container",AutoRender:!1,StateAddresses:{Layout:"AppData.PictFileBrowser.Layout",RootLocation:"AppData.PictFileBrowser.RootLocation",CurrentLocation:"AppData.PictFileBrowser.CurrentLocation",CurrentFile:"AppData.PictFileBrowser.CurrentFile"},DefaultState:{Layout:"browser-detail",RootLocation:"/",CurrentLocation:"",CurrentFile:null},FileListAddress:"AppData.PictFileBrowser.FileList",FolderTreeAddress:"AppData.PictFileBrowser.FolderTree",ChildFolderCacheAddress:"AppData.PictFileBrowser.ChildFolderCache",Templates:[{Hash:"FileBrowser-Container-Template",Template:'\n<div class="pict-filebrowser" id="Pict-FileBrowser-Wrap">\n\t<div class="pict-filebrowser-browse-pane" id="Pict-FileBrowser-BrowsePane"></div>\n\t<div class="pict-filebrowser-main-pane">\n\t\t<div class="pict-filebrowser-list-pane" id="Pict-FileBrowser-ListPane"></div>\n\t\t<div class="pict-filebrowser-view-pane" id="Pict-FileBrowser-ViewPane"></div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"FileBrowser-Container",TemplateHash:"FileBrowser-Container-Template",DestinationAddress:"#Pict-FileBrowser-Container",RenderMethod:"replace"}],CSS:"\n\t\t.pict-filebrowser {\n\t\t\tdisplay: flex;\n\t\t\theight: 100%;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n\t\t\tfont-size: 14px;\n\t\t\tcolor: #3D3229;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\toverflow: hidden;\n\t\t\tbackground: #FAFAF8;\n\t\t}\n\n\t\t.pict-filebrowser-browse-pane {\n\t\t\twidth: 240px;\n\t\t\tmin-width: 180px;\n\t\t\tborder-right: 1px solid #DDD6CA;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: #F5F0E8;\n\t\t\tflex-shrink: 0;\n\t\t}\n\n\t\t.pict-filebrowser-main-pane {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\n\t\t.pict-filebrowser-list-pane {\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\n\t\t.pict-filebrowser-view-pane {\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: #FAFAF8;\n\t\t}\n\n\t\t/* --- Browsing: Tree --- */\n\t\t.pict-fb-tree {\n\t\t\tpadding: 8px 0;\n\t\t}\n\t\t.pict-fb-tree-node {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 4px 8px 4px 0;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-tree-node:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-tree-node.selected {\n\t\t\tbackground: #DDD6CA;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.pict-fb-tree-toggle {\n\t\t\tdisplay: inline-block;\n\t\t\twidth: 16px;\n\t\t\ttext-align: center;\n\t\t\tflex-shrink: 0;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 10px;\n\t\t}\n\t\t.pict-fb-tree-icon {\n\t\t\tmargin-right: 6px;\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 14px;\n\t\t}\n\t\t.pict-fb-tree-label {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.pict-fb-tree-children {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-fb-tree-children.expanded {\n\t\t\tdisplay: block;\n\t\t}\n\n\t\t/* --- Browsing: Search --- */\n\t\t.pict-fb-search {\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.pict-fb-search-input {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 6px 10px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 13px;\n\t\t\toutline: none;\n\t\t\tbackground: #fff;\n\t\t}\n\t\t.pict-fb-search-input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-fb-search-results {\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.pict-fb-search-result {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 5px 8px;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-fb-search-result:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-search-result-icon {\n\t\t\tmargin-right: 6px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-fb-search-result-name {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-search-result-path {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 11px;\n\t\t\tmargin-left: auto;\n\t\t\tpadding-left: 8px;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t/* --- Listing: Detail --- */\n\t\t.pict-fb-detail {\n\t\t\twidth: 100%;\n\t\t}\n\t\t.pict-fb-detail-header {\n\t\t\tdisplay: flex;\n\t\t\tpadding: 6px 12px;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 12px;\n\t\t\ttext-transform: uppercase;\n\t\t\tcolor: #8A7F72;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #F5F0E8;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-fb-detail-header-cell {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-fb-detail-header-cell:hover {\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-fb-detail-col-name {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-fb-detail-col-size {\n\t\t\twidth: 90px;\n\t\t\ttext-align: right;\n\t\t\tflex-shrink: 0;\n\t\t\tpadding-right: 12px;\n\t\t}\n\t\t.pict-fb-detail-col-modified {\n\t\t\twidth: 150px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-fb-detail-row {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 5px 12px;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 1px solid #F0ECE4;\n\t\t}\n\t\t.pict-fb-detail-row:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-fb-detail-row.selected {\n\t\t\tbackground: #E0EDE9;\n\t\t}\n\t\t.pict-fb-detail-icon {\n\t\t\tmargin-right: 8px;\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 16px;\n\t\t}\n\t\t.pict-fb-detail-name {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-detail-size {\n\t\t\twidth: 90px;\n\t\t\ttext-align: right;\n\t\t\tflex-shrink: 0;\n\t\t\tpadding-right: 12px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 12px;\n\t\t}\n\t\t.pict-fb-detail-modified {\n\t\t\twidth: 150px;\n\t\t\tflex-shrink: 0;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 12px;\n\t\t}\n\n\t\t/* --- Listing: Icons --- */\n\t\t.pict-fb-icons {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tpadding: 12px;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.pict-fb-icon-item {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\twidth: 96px;\n\t\t\tpadding: 10px 6px;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.pict-fb-icon-item:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-fb-icon-item.selected {\n\t\t\tbackground: #E0EDE9;\n\t\t}\n\t\t.pict-fb-icon-graphic {\n\t\t\tfont-size: 36px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.pict-fb-icon-label {\n\t\t\tfont-size: 12px;\n\t\t\tword-break: break-word;\n\t\t\tline-height: 1.3;\n\t\t\tmax-height: 2.6em;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\t/* --- Viewing: FileInfo --- */\n\t\t.pict-fb-fileinfo {\n\t\t\tpadding: 12px 16px;\n\t\t}\n\t\t.pict-fb-fileinfo-title {\n\t\t\tfont-size: 15px;\n\t\t\tfont-weight: 600;\n\t\t\tmargin-bottom: 8px;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-fb-fileinfo-table {\n\t\t\twidth: 100%;\n\t\t\tfont-size: 13px;\n\t\t}\n\t\t.pict-fb-fileinfo-table td {\n\t\t\tpadding: 3px 0;\n\t\t}\n\t\t.pict-fb-fileinfo-label {\n\t\t\tcolor: #8A7F72;\n\t\t\twidth: 100px;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-fb-fileinfo-value {\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-fb-fileinfo-none {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\n\t\t/* --- Viewing: Image --- */\n\t\t.pict-fb-image-viewer {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 16px;\n\t\t\tmin-height: 200px;\n\t\t}\n\t\t.pict-fb-image-viewer img {\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 500px;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t\tbox-shadow: 0 1px 3px rgba(0,0,0,0.1);\n\t\t}\n\t\t.pict-fb-image-viewer-none {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\n\t\t/* --- Breadcrumb / Location Bar --- */\n\t\t.pict-fb-breadcrumb {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 6px 12px;\n\t\t\tfont-size: 13px;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\toverflow-x: auto;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-breadcrumb-segment {\n\t\t\tcursor: pointer;\n\t\t\tcolor: #2E7D74;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-fb-breadcrumb-segment:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-breadcrumb-separator {\n\t\t\tmargin: 0 2px;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.pict-fb-breadcrumb-current {\n\t\t\tcolor: #3D3229;\n\t\t\tfont-weight: 500;\n\t\t\tpadding: 2px 4px;\n\t\t}\n\n\t\t/* --- Empty state --- */\n\t\t.pict-fb-empty {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 32px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\t"}},{}],63:[function(t,e,i){e.exports=t("./views/Pict-View-FileBrowser.js"),e.exports.PictFileBrowserBrowseProvider=t("./providers/Pict-Provider-FileBrowserBrowse.js"),e.exports.PictFileBrowserListProvider=t("./providers/Pict-Provider-FileBrowserList.js"),e.exports.PictFileBrowserViewProvider=t("./providers/Pict-Provider-FileBrowserView.js"),e.exports.PictFileBrowserLayoutProvider=t("./providers/Pict-Provider-FileBrowserLayout.js"),e.exports.PictFileBrowserIconProvider=t("./providers/Pict-Provider-FileBrowserIcons.js"),e.exports.PictViewBrowseTree=t("./views/Pict-View-FileBrowser-BrowseTree.js"),e.exports.PictViewBrowseSearch=t("./views/Pict-View-FileBrowser-BrowseSearch.js"),e.exports.PictViewListDetail=t("./views/Pict-View-FileBrowser-ListDetail.js"),e.exports.PictViewListIcons=t("./views/Pict-View-FileBrowser-ListIcons.js"),e.exports.PictViewFileInfo=t("./views/Pict-View-FileBrowser-ViewFileInfo.js"),e.exports.PictViewImageViewer=t("./views/Pict-View-FileBrowser-ViewImage.js"),e.exports.FileBrowserService=t("./services/Pict-Service-FileBrowser.js")},{"./providers/Pict-Provider-FileBrowserBrowse.js":64,"./providers/Pict-Provider-FileBrowserIcons.js":65,"./providers/Pict-Provider-FileBrowserLayout.js":66,"./providers/Pict-Provider-FileBrowserList.js":67,"./providers/Pict-Provider-FileBrowserView.js":68,"./services/Pict-Service-FileBrowser.js":69,"./views/Pict-View-FileBrowser-BrowseSearch.js":70,"./views/Pict-View-FileBrowser-BrowseTree.js":71,"./views/Pict-View-FileBrowser-ListDetail.js":72,"./views/Pict-View-FileBrowser-ListIcons.js":73,"./views/Pict-View-FileBrowser-ViewFileInfo.js":74,"./views/Pict-View-FileBrowser-ViewImage.js":75,"./views/Pict-View-FileBrowser.js":76}],64:[function(t,e,i){const o=t("pict-provider");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}getFolderTree(){let t=this.getFileBrowserOption("FolderTreeAddress","AppData.PictFileBrowser.FolderTree"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}flattenTree(t){let e=t||this.getFolderTree(),i=[],o=(t,e)=>{for(let n=0;n<t.length;n++){let r=t[n],s=e?e+"/"+r.Name:r.Name;i.push({Name:r.Name,Path:s}),Array.isArray(r.Children)&&r.Children.length>0&&o(r.Children,s)}};return o(e,""),i}getChildFolders(t){let e=this.getFileBrowserOption("ChildFolderCacheAddress","AppData.PictFileBrowser.ChildFolderCache"),i=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},e);if(!i||"object"!=typeof i)return null;let o=t||"_root_";return Array.isArray(i[o])?i[o]:null}setChildFolders(t,e){let i=this.getFileBrowserOption("ChildFolderCacheAddress","AppData.PictFileBrowser.ChildFolderCache"),o=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},i);o&&"object"==typeof o||(o={}),o[t||"_root_"]=Array.isArray(e)?e:[],this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,o)}searchFiles(t,e){if(!t||"string"!=typeof t)return[];let i=e||this.getFileList(),o=t.toLowerCase();return i.filter(t=>t.Name&&t.Name.toLowerCase().indexOf(o)>=0)}navigateToFolder(t){let e=this.getFileBrowserOption("StateAddresses",{}),i=e.CurrentLocation||"AppData.PictFileBrowser.CurrentLocation",o=e.CurrentFile||"AppData.PictFileBrowser.CurrentFile";this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,t||""),this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},o,null)}getFileList(){let t=this.getFileBrowserOption("FileListAddress","AppData.PictFileBrowser.FileList"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Browse",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":55}],65:[function(t,e,i){const o=t("pict-provider"),n={Primary:"#3D3229",Accent:"#2E7D74",Muted:"#8A7F72",Light:"#F5F0E8",WarmBeige:"#EAE3D8",TealTint:"#E0EDE9",Lavender:"#E8E0F0",AmberTint:"#F0E8D0"},r={folder:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 9H20.8" stroke="'+n.Primary+'" stroke-width="1" opacity="0.3" /></svg>',"folder-open":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 10.2L5.8 17.8C6 18.4 6.6 18.9 7.2 18.9H19.8L22.1 11.2C22.3 10.6 21.8 10 21.2 10H5.2C4.6 10 4 10.4 3.8 11" stroke="'+n.Primary+'" stroke-width="1.5" fill="'+n.Light+'" stroke-linecap="round" stroke-linejoin="round" opacity="0.7" /></svg>',file:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-text":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="12.8" x2="15.9" y2="12.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="15.8" x2="15.9" y2="15.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="18.8" x2="12.2" y2="18.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>',"file-code":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M8.5 13.2L6.8 15.1L8.6 16.8" stroke="'+n.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><path d="M15.5 13.2L17.2 15.1L15.4 16.8" stroke="'+n.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><line x1="12.8" y1="12" x2="11.2" y2="18" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>',"file-image":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><rect x="3.1" y="3.2" width="17.8" height="17.7" rx="2" fill="'+n.Lavender+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="8.3" cy="8.7" r="1.8" fill="'+n.Accent+'" /><path d="M20.8 15.2L15.9 10.1L5.2 20.8" stroke="'+n.Primary+'" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-pdf":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="#F0DDDD" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><text x="8.2" y="16.8" font-family="sans-serif" font-weight="700" font-size="6.5" fill="#C04040" letter-spacing="-0.3">PDF</text></svg>',"file-spreadsheet":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.TealTint+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="7.2" y="11.1" width="9.8" height="7.8" rx="0.5" fill="none" stroke="'+n.Accent+'" stroke-width="1.2" /><line x1="7.2" y1="13.7" x2="17" y2="13.7" stroke="'+n.Accent+'" stroke-width="1" /><line x1="7.2" y1="16.3" x2="17" y2="16.3" stroke="'+n.Accent+'" stroke-width="1" /><line x1="10.9" y1="11.1" x2="10.9" y2="18.9" stroke="'+n.Accent+'" stroke-width="1" /></svg>',"file-archive":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="8.8" y="11.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /><rect x="8.8" y="14.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /><rect x="8.8" y="17.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /></svg>',"file-audio":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.AmberTint+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="10.2" cy="16.8" r="2.1" fill="none" stroke="'+n.Accent+'" stroke-width="1.5" /><path d="M12.2 16.8V11.2L16.1 10.1" stroke="'+n.Accent+'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="15.3" r="1.4" fill="none" stroke="'+n.Accent+'" stroke-width="1.2" /></svg>',"file-video":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Lavender+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M9.8 12.2V18.2L15.8 15.2L9.8 12.2Z" fill="'+n.Accent+'" stroke="'+n.Accent+'" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-web":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.9" fill="'+n.TealTint+'" stroke="'+n.Primary+'" stroke-width="1.8" /><ellipse cx="12" cy="12" rx="4.1" ry="8.9" fill="none" stroke="'+n.Primary+'" stroke-width="1.2" /><line x1="3.1" y1="12" x2="20.9" y2="12" stroke="'+n.Primary+'" stroke-width="1" /><path d="M4.8 7.8C7 8.5 9.4 8.9 12 8.9C14.6 8.9 17 8.5 19.2 7.8" stroke="'+n.Primary+'" stroke-width="1" fill="none" /><path d="M4.8 16.2C7 15.5 9.4 15.1 12 15.1C14.6 15.1 17 15.5 19.2 16.2" stroke="'+n.Primary+'" stroke-width="1" fill="none" /></svg>',"file-config":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="12" cy="15" r="2.8" fill="none" stroke="'+n.Muted+'" stroke-width="1.5" /><line x1="12" y1="11" x2="12" y2="12.2" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="12" y1="17.8" x2="12" y2="19" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="13.2" x2="15.8" y2="12.6" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="17" x2="9.2" y2="16.4" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="16.8" x2="15.8" y2="17.4" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="13" x2="9.2" y2="13.6" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /></svg>',home:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M3.1 9.6L12 3.1L20.9 9.6V19.9C20.9 20.5 20.5 21 19.9 20.9H4.1C3.5 21 3 20.5 3.1 19.9V9.6Z" fill="'+n.TealTint+'" stroke="'+n.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="9.2" y="14.1" width="5.6" height="6.9" rx="0.5" fill="'+n.Accent+'" /></svg>',"arrow-up":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12.1 19.1V5.1" stroke="'+n.Muted+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M5.2 11.9L12.1 5.1L18.9 11.9" stroke="'+n.Muted+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-right":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M9.2 6.1L14.8 12.1L9.1 17.9" stroke="'+n.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-down":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M6.1 9.2L12.1 14.8L17.9 9.1" stroke="'+n.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',search:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><circle cx="10.8" cy="10.8" r="6.8" stroke="'+n.Primary+'" stroke-width="1.8" /><line x1="15.9" y1="16.1" x2="20.8" y2="20.8" stroke="'+n.Primary+'" stroke-width="2" stroke-linecap="round" /></svg>',"sort-asc":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+n.Primary+'" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+n.Muted+'" opacity="0.35" /></svg>',"sort-desc":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+n.Muted+'" opacity="0.35" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+n.Primary+'" /></svg>'},s={".jpg":"file-image",".jpeg":"file-image",".png":"file-image",".gif":"file-image",".svg":"file-image",".webp":"file-image",".bmp":"file-image",".ico":"file-image",".txt":"file-text",".md":"file-text",".rtf":"file-text",".doc":"file-text",".docx":"file-text",".pdf":"file-pdf",".xls":"file-spreadsheet",".xlsx":"file-spreadsheet",".csv":"file-spreadsheet",".ods":"file-spreadsheet",".js":"file-code",".ts":"file-code",".jsx":"file-code",".tsx":"file-code",".py":"file-code",".rb":"file-code",".java":"file-code",".c":"file-code",".cpp":"file-code",".h":"file-code",".go":"file-code",".rs":"file-code",".swift":"file-code",".kt":"file-code",".scala":"file-code",".sh":"file-code",".bash":"file-code",".zsh":"file-code",".php":"file-code",".lua":"file-code",".r":"file-code",".sql":"file-code",".pl":"file-code",".html":"file-web",".htm":"file-web",".css":"file-web",".scss":"file-web",".less":"file-web",".xml":"file-web",".json":"file-config",".yaml":"file-config",".yml":"file-config",".toml":"file-config",".ini":"file-config",".env":"file-config",".conf":"file-config",".cfg":"file-config",".zip":"file-archive",".tar":"file-archive",".gz":"file-archive",".rar":"file-archive",".7z":"file-archive",".bz2":"file-archive",".xz":"file-archive",".tgz":"file-archive",".mp3":"file-audio",".wav":"file-audio",".flac":"file-audio",".ogg":"file-audio",".aac":"file-audio",".wma":"file-audio",".m4a":"file-audio",".mp4":"file-video",".avi":"file-video",".mov":"file-video",".mkv":"file-video",".webm":"file-video",".wmv":"file-video",".flv":"file-video",".m4v":"file-video"};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._icons=Object.assign({},r),this._extensionMap=Object.assign({},s),this._cssInjected=!1}getIcon(t,e){let i=e||16,o=this._icons[t];return"function"==typeof o?o(i):""}getIconForEntry(t,e){if(!t)return"";if(t.Icon&&"string"==typeof t.Icon&&0===t.Icon.indexOf("<svg"))return t.Icon;let i=e||16;if("folder"===t.Type)return this.getIcon("folder",i);let o=(t.Extension||"").toLowerCase();return o&&this._extensionMap[o]?this.getIcon(this._extensionMap[o],i):this.getIcon("file",i)}getUIIcon(t,e){return this.getIcon(t,e||16)}registerIcon(t,e){return!(!t||"function"!=typeof e)&&(this._icons[t]=e,!0)}registerExtension(t,e){return!(!t||!e)&&(this._extensionMap[t.toLowerCase()]=e,!0)}getIconNames(){return Object.keys(this._icons)}getExtensionMap(){return Object.assign({},this._extensionMap)}injectCSS(){this._cssInjected||this.pict&&this.pict.CSSMap&&(this.pict.CSSMap.addCSS("PictFileBrowserIcons",".pict-fb-svg-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }\n.pict-fb-svg-icon svg { display: block; }\n.pict-fb-tree-icon svg { width: 16px; height: 16px; }\n.pict-fb-detail-icon svg { width: 16px; height: 16px; }\n.pict-fb-icon-graphic svg { width: 36px; height: 36px; }\n.pict-fb-tree-toggle svg { width: 10px; height: 10px; }\n"),this._cssInjected=!0)}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Icons",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.BuiltInIcons=r,e.exports.ExtensionMap=s,e.exports.Colors=n},{"pict-provider":55}],66:[function(t,e,i){const o=t("pict-provider"),n={"list-only":{Key:"list-only",Label:"List Only",Description:"Full-width file list",Panes:["list"],PaneCount:1,CSSClass:"pict-fb-layout-list-only"},"tree-list":{Key:"tree-list",Label:"Tree + List",Description:"Folder tree on the left, file list on the right",Panes:["browse","list"],PaneCount:2,CSSClass:"pict-fb-layout-tree-list"},"list-detail":{Key:"list-detail",Label:"List + Detail",Description:"File list on top, file details on the bottom",Panes:["list","view"],PaneCount:2,CSSClass:"pict-fb-layout-list-detail"},"tree-detail":{Key:"tree-detail",Label:"Tree + Detail",Description:"Folder tree on the left, file details on the right",Panes:["browse","view"],PaneCount:2,CSSClass:"pict-fb-layout-tree-detail"},"browser-detail":{Key:"browser-detail",Label:"Browser",Description:"Folder tree on the left, file list top-right, details bottom-right",Panes:["browse","list","view"],PaneCount:3,CSSClass:"pict-fb-layout-browser-detail"},"browser-columns":{Key:"browser-columns",Label:"Columns",Description:"Three-column layout: folder tree, file list, and file details side-by-side",Panes:["browse","list","view"],PaneCount:3,CSSClass:"pict-fb-layout-browser-columns"}};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.layouts=JSON.parse(JSON.stringify(n))}getLayouts(){return this.layouts}getLayoutList(){let t=[];for(let e in this.layouts)t.push(this.layouts[e]);return t.sort((t,e)=>t.PaneCount!==e.PaneCount?t.PaneCount-e.PaneCount:t.Key.localeCompare(e.Key)),t}getLayout(t){return this.layouts[t]||null}getCurrentLayoutKey(){let t=this.getFileBrowserOption("StateAddresses",{}).Layout||"AppData.PictFileBrowser.Layout";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||"browser-detail"}getCurrentLayout(){let t=this.getCurrentLayoutKey();return this.layouts[t]||this.layouts["browser-detail"]}setLayout(t){if(!this.layouts[t])return!1;let e=this.getFileBrowserOption("StateAddresses",{}).Layout||"AppData.PictFileBrowser.Layout";return this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},e,t),!0}isPaneVisible(t){return this.getCurrentLayout().Panes.indexOf(t)>=0}registerLayout(t){return!(!t||!t.Key)&&(this.layouts[t.Key]=t,!0)}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Layout",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.BuiltInLayouts=n},{"pict-provider":55}],67:[function(t,e,i){const o=t("pict-provider");e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.sortField="Name",this.sortAscending=!0}getFileList(){let t=this.getFileBrowserOption("FileListAddress","AppData.PictFileBrowser.FileList"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}getSortedFileList(t){let e=(t||this.getFileList()).slice(),i=this.sortField,o=this.sortAscending;return e.sort((t,e)=>{let n="folder"===t.Type?0:1,r="folder"===e.Type?0:1;if(n!==r)return n-r;let s=t[i],a=e[i];if(null==s&&null==a)return 0;if(null==s)return 1;if(null==a)return-1;let l=0;return l="string"==typeof s?s.localeCompare(a):s<a?-1:s>a?1:0,o?l:-l}),e}setSortField(t){this.sortField===t?this.sortAscending=!this.sortAscending:(this.sortField=t,this.sortAscending=!0)}selectFile(t){let e=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},e,t||null)}getSelectedFile(){let t=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||null}openEntry(t){if(t)if("folder"===t.Type){let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){let i=this.getFileBrowserOption("StateAddresses",{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation",o=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},i)||"",n=o?o+"/"+t.Name:t.Name;e.navigateToFolder(n)}}else this.selectFile(t)}formatFileSize(t){return null==t||isNaN(t)?"--":t<1024?t+" B":t<1048576?(t/1024).toFixed(1)+" KB":t<1073741824?(t/1048576).toFixed(1)+" MB":(t/1073741824).toFixed(1)+" GB"}formatDate(t){if(!t)return"--";try{let e=new Date(t);return isNaN(e.getTime())?"--":e.toLocaleDateString()+" "+e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return"--"}}getEntryIcon(t){if(!t)return"";if(t.Icon)return t.Icon;let e=this.pict.providers["Pict-FileBrowser-Icons"];if(e)return e.getIconForEntry(t,16);if("folder"===t.Type)return"📁";switch((t.Extension||"").toLowerCase()){case".jpg":case".jpeg":case".png":case".gif":case".svg":case".webp":case".bmp":return"🖼";case".pdf":default:return"📄";case".doc":case".docx":case".txt":case".md":case".rtf":return"📃";case".xls":case".xlsx":case".csv":return"📊";case".zip":case".tar":case".gz":case".rar":case".7z":return"📦";case".js":case".ts":case".py":case".rb":case".java":case".c":case".cpp":case".go":case".rs":return"💻";case".html":case".css":case".json":case".xml":case".yaml":case".yml":return"🌐";case".mp3":case".wav":case".flac":case".ogg":case".aac":return"🎵";case".mp4":case".avi":case".mov":case".mkv":case".webm":return"🎥"}}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-List",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":55}],68:[function(t,e,i){const o=t("pict-provider");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}getCurrentFile(){let t=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||null}isImage(t){let e=t||this.getCurrentFile();if(!e)return!1;if(e.MimeType&&0===e.MimeType.indexOf("image/"))return!0;let i=(e.Extension||"").toLowerCase();return[".jpg",".jpeg",".png",".gif",".svg",".webp",".bmp",".ico",".tiff",".tif"].indexOf(i)>=0}getImageURL(t){let e=t||this.getCurrentFile();return e&&(e.URL||e.ThumbnailURL)||null}getFileTypeDescription(t){let e=t||this.getCurrentFile();if(!e)return"Unknown";if("folder"===e.Type)return"Folder";let i=(e.Extension||"").toLowerCase();switch(i){case".jpg":case".jpeg":return"JPEG Image";case".png":return"PNG Image";case".gif":return"GIF Image";case".svg":return"SVG Image";case".webp":return"WebP Image";case".bmp":return"Bitmap Image";case".pdf":return"PDF Document";case".doc":case".docx":return"Word Document";case".xls":case".xlsx":return"Excel Spreadsheet";case".csv":return"CSV File";case".txt":return"Text File";case".md":return"Markdown File";case".html":return"HTML File";case".css":return"CSS Stylesheet";case".js":return"JavaScript File";case".ts":return"TypeScript File";case".json":return"JSON File";case".xml":return"XML File";case".yaml":case".yml":return"YAML File";case".py":return"Python Script";case".rb":return"Ruby Script";case".java":return"Java File";case".c":return"C Source File";case".cpp":return"C++ Source File";case".go":return"Go Source File";case".rs":return"Rust Source File";case".zip":return"ZIP Archive";case".tar":return"TAR Archive";case".gz":return"GZip Archive";case".rar":return"RAR Archive";case".mp3":return"MP3 Audio";case".wav":return"WAV Audio";case".mp4":return"MP4 Video";case".avi":return"AVI Video";case".mov":return"QuickTime Video";default:return i?i.substring(1).toUpperCase()+" File":"File"}}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-View",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":55}],69:[function(t,e,i){(function(i){(function(){
|
|
58
58
|
/**
|
|
59
59
|
* Pict FileBrowser Service
|
|
60
60
|
*
|
|
@@ -85,7 +85,7 @@ I.Builder=function(){this._ref="id",this._fields=Object.create(null),this._docum
|
|
|
85
85
|
* @license MIT
|
|
86
86
|
* @author Steven Velozo <steven@velozo.com>
|
|
87
87
|
*/
|
|
88
|
-
const o=t("fable-serviceproviderbase"),n=t("path"),r=t("fs"),s=t("url"),a={BasePath:".",APIRoutePrefix:"/api/filebrowser",WebAppRoute:"/filebrowser/*",WebAppRouteStrip:"/filebrowser/",ServeWebApp:!0,IncludeHiddenFiles:!1,MaxTreeDepth:2};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.serviceType="PictFileBrowserService";for(let t in a)t in this.options||(this.options[t]=a[t]);this.basePath=n.resolve(this.options.BasePath)}connectRoutes(){if(!this.fable.Orator||!this.fable.Orator.serviceServer)return this.log.error("PictFileBrowserService: Orator service server is not available. Initialize Orator first."),!1;let t=this.fable.Orator.serviceServer,e=this.options.APIRoutePrefix;if(t.get(e+"/list",(t,e,i)=>{let o=this.parseQueryParams(t).path||"";this.listDirectory(o,(t,o)=>t?(e.send(400,{Error:t.message}),i()):(e.send(o),i()))}),t.get(e+"/tree",(t,e,i)=>{let o=this.parseQueryParams(t),n=this.options.MaxTreeDepth;o.depth&&(n=parseInt(o.depth)||this.options.MaxTreeDepth),this.buildFolderTree("",n,(t,o)=>t?(e.send(400,{Error:t.message}),i()):(e.send(o),i()))}),t.get(e+"/info",(t,e,i)=>{let o=this.parseQueryParams(t).path||"";this.getFileInfo(o,(t,o)=>t?(e.send(400,{Error:t.message}),i()):(e.send(o),i()))}),t.get(e+"/children",(t,e,i)=>{let o=this.parseQueryParams(t).path||"";this.listChildFolders(o,(t,o)=>t?(e.send(400,{Error:t.message}),i()):(e.send(o),i()))}),this.options.ServeWebApp){let t=n.join(i,"..","www");this.fable.Orator.addStaticRoute(t,"index.html",this.options.WebAppRoute,this.options.WebAppRouteStrip)}return this.log.info("PictFileBrowserService: Routes connected. Browsing path: "+this.basePath),!0}parseQueryParams(t){if(t.query&&"object"==typeof t.query)return t.query;return s.parse(t.url,!0).query||{}}resolveSafePath(t){let e=(t||"").replace(/\.\./g,"").replace(/\/\//g,"/"),i=n.resolve(this.basePath,e);return 0!==i.indexOf(this.basePath)?null:i}listDirectory(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(o,s)=>{if(o)return"ENOENT"===o.code?e(new Error("Path not found")):"ENOTDIR"===o.code?e(new Error("Path is not a directory")):e(o);let a=[],l=s.length;if(0===l)return e(null,a);for(let o=0;o<s.length;o++){let d=s[o],c=d.name;if(!this.options.IncludeHiddenFiles&&"."===c.charAt(0)){if(l--,0===l)return e(null,a);continue}let p=n.join(i,c),h=t?t+"/"+c:c;r.stat(p,((t,i,o)=>(r,s)=>{let d={Name:t,Path:i,Type:o?"folder":"file"};if(s&&!r&&(d.Size=s.size,d.Modified=s.mtime,d.Created=s.birthtime,o||(d.Extension=n.extname(t))),a.push(d),l--,0===l)return e(null,a)})(c,h,d.isDirectory()))}})}listChildFolders(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(o,s)=>{if(o)return"ENOENT"===o.code?e(new Error("Path not found")):"ENOTDIR"===o.code?e(new Error("Path is not a directory")):e(o);let a=[];for(let t=0;t<s.length;t++){if(!s[t].isDirectory())continue;let e=s[t].name;(this.options.IncludeHiddenFiles||"."!==e.charAt(0))&&a.push(e)}if(a.sort((t,e)=>t.localeCompare(e)),0===a.length)return e(null,[]);let l=[],d=a.length;for(let o=0;o<a.length;o++){let s=a[o],c=n.join(i,s),p=t?t+"/"+s:s;r.readdir(c,{withFileTypes:!0},((t,i)=>(o,n)=>{let r=!1;if(!o&&n)for(let t=0;t<n.length;t++)if(n[t].isDirectory()){let e=n[t].name;if(this.options.IncludeHiddenFiles||"."!==e.charAt(0)){r=!0;break}}if(l.push({Name:t,Path:i,HasChildren:r}),d--,0===d)return l.sort((t,e)=>t.Name.localeCompare(e.Name)),e(null,l)})(s,p))}})}buildFolderTree(t,e,i){let o=this.resolveSafePath(t);if(!o)return i(new Error("Invalid path"));this._buildTreeRecursive(o,t,e,0,i)}_buildTreeRecursive(t,e,i,o,s){if(i>0&&o>=i)return s(null,[]);r.readdir(t,{withFileTypes:!0},(r,a)=>{if(r)return s(null,[]);let l=[];for(let t=0;t<a.length;t++)if(a[t].isDirectory()){let e=a[t].name;if(!this.options.IncludeHiddenFiles&&"."===e.charAt(0))continue;l.push(e)}if(0===l.length)return s(null,[]);let d=[],c=l.length;for(let r=0;r<l.length;r++){let a=l[r],p=n.join(t,a),h=e?e+"/"+a:a;this._buildTreeRecursive(p,h,i,o+1,((t,e)=>(i,o)=>{if(d.push({Name:t,Path:e,Children:o||[]}),c--,0===c)return d.sort((t,e)=>t.Name.localeCompare(e.Name)),s(null,d)})(a,h))}})}getFileInfo(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.stat(i,(o,r)=>{if(o)return"ENOENT"===o.code?e(new Error("Path not found")):e(o);let s=n.basename(i),a={Name:s,Path:t||s,Type:r.isDirectory()?"folder":"file",Size:r.size,Modified:r.mtime,Created:r.birthtime};return r.isDirectory()||(a.Extension=n.extname(s)),e(null,a)})}},e.exports.default_configuration=a}).call(this)}).call(this,"/node_modules/pict-section-filebrowser/source/services")},{"fable-serviceproviderbase":20,fs:2,path:42,url:110}],61:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-BrowseSearch",DefaultRenderable:"BrowseSearch-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseSearch-Container-Template",Template:'\n<div class="pict-fb-search">\n\t<input type="text" class="pict-fb-search-input"\n\t\tid="Pict-FileBrowser-SearchInput"\n\t\tplaceholder="Search files..."\n\t\toninput="pict.views[\'{~D:Record.ViewHash~}\'].onSearchInput(this.value)" />\n\t<div class="pict-fb-search-results" id="Pict-FileBrowser-SearchResults"></div>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Result-Template",Template:'\n<div class="pict-fb-search-result" onclick="{~D:Record.ClickHandler~}">\n\t<span class="pict-fb-search-result-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-search-result-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-search-result-path">{~D:Record.Path~}</span>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"BrowseSearch-Container",TemplateHash:"FileBrowser-BrowseSearch-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i),this.lastQuery="",this.debounceTimer=null}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-BrowsePane",e),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onSearchInput(t){this.lastQuery=t||"",this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.performSearch(this.lastQuery)},150)}performSearch(t){let e="#Pict-FileBrowser-SearchResults";if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent(e,"");let i=this.pict.providers["Pict-FileBrowser-Browse"];if(!i)return;let o=i.searchFiles(t),n=this.pict.providers["Pict-FileBrowser-List"];if(0===o.length){let t=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Empty-Template",{Message:"No results found"});return void this.pict.ContentAssignment.assignContent(e,t)}let r="";for(let t=0;t<o.length&&t<50;t++){let e=o[t],i=n?n.getEntryIcon(e):"📄",s=e.Path||"",a={Name:e.Name,Path:s,Icon:i,ClickHandler:"pict.views['"+this.Hash+"'].selectResult("+t+")"};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Result-Template",a)}this.pict.ContentAssignment.assignContent(e,r),this._lastResults=o}selectResult(t){if(!this._lastResults||t>=this._lastResults.length)return;let e=this._lastResults[t],i=this.pict.providers["Pict-FileBrowser-List"];i&&i.openEntry(e)}},e.exports.default_configuration=n},{"pict-view":76}],62:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-BrowseTree",DefaultRenderable:"BrowseTree-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseTree-Container-Template",Template:'<div class="pict-fb-tree" id="Pict-FileBrowser-Tree"></div>'},{Hash:"FileBrowser-BrowseTree-Node-Template",Template:'\n<div class="pict-fb-tree-node{~D:Record.SelectedClass~}" style="padding-left: {~D:Record.Indent~}px;" data-path="{~D:Record.Path~}" onclick="{~D:Record.ClickHandler~}">\n\t<span class="{~D:Record.ToggleClass~}" onclick="{~D:Record.ToggleHandler~}">{~D:Record.ToggleIcon~}</span>\n\t<span class="pict-fb-tree-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-tree-label">{~D:Record.Name~}</span>\n</div>\n<div class="pict-fb-tree-children{~D:Record.ExpandedClass~}" id="Pict-FB-TreeChildren-{~D:Record.NodeID~}">\n{~D:Record.ChildrenHTML~}\n</div>\n'}],Renderables:[{RenderableHash:"BrowseTree-Container",TemplateHash:"FileBrowser-BrowseTree-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i),this.expandedPaths={}}onAfterRender(t){return this.rebuildTree(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildTree(){if(!this.pict.providers["Pict-FileBrowser-Browse"])return;let t=this.getCurrentLocation(),e=this.renderTreeLevel("",0,t);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Tree",e)}renderTreeLevel(t,e,i){let o=this.pict.providers["Pict-FileBrowser-Browse"];if(!o)return"";let n=o.getChildFolders(t);if(!n)return this.expandedPaths[t]?'<div class="pict-fb-tree-loading" style="padding-left: '+(24+16*e)+'px;">Loading...</div>':"";let r="";for(let t=0;t<n.length;t++){let s=n[t],a=s.Path,l=a.replace(/[^a-zA-Z0-9]/g,"_"),d=!!this.expandedPaths[a],c=a===i,p=o.getChildFolders(a),h=s.HasChildren||p&&p.length>0,u="";d&&(u=this.renderTreeLevel(a,e+1,i));let m=this.pict.providers["Pict-FileBrowser-Icons"],f=m?m.getIcon("folder",16):"📁",g="";h&&(g=m?d?m.getIcon("chevron-down",10):m.getIcon("chevron-right",10):d?"▾":"▸");let v={Name:s.Name,Path:a,NodeID:l,Indent:8+16*e,Icon:f,ToggleIcon:g,ToggleClass:h?"pict-fb-tree-toggle":"pict-fb-tree-toggle-empty",ToggleHandler:h?"event.stopPropagation(); pict.views['"+this.Hash+"'].toggleNode('"+a+"')":"",ClickHandler:"pict.views['"+this.Hash+"'].selectFolder('"+a+"')",SelectedClass:c?" selected":"",ExpandedClass:d?" expanded":"",ChildrenHTML:u};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseTree-Node-Template",v)}return r}toggleNode(t){if(this.expandedPaths[t]=!this.expandedPaths[t],this.expandedPaths[t]){let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t)}}this.rebuildTree()}onRequestChildren(t){}selectFolder(t){this.expandedPaths[t]=!0;let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t),e.navigateToFolder(t)}this.rebuildTree()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=n},{"pict-view":76}],63:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-ListDetail",DefaultRenderable:"ListDetail-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListDetail-Container-Template",Template:'\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Row-Template",Template:'\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'},{Hash:"FileBrowser-Breadcrumb-Segment-Template",Template:'<span class="pict-fb-breadcrumb-segment" onclick="{~D:Record.ClickHandler~}">{~D:Record.Label~}</span>'},{Hash:"FileBrowser-Breadcrumb-Separator-Template",Template:'<span class="pict-fb-breadcrumb-separator">/</span>'},{Hash:"FileBrowser-Breadcrumb-Current-Template",Template:'<span class="pict-fb-breadcrumb-current">{~D:Record.Label~}</span>'}],Renderables:[{RenderableHash:"ListDetail-Container",TemplateHash:"FileBrowser-ListDetail-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i),this._cachedFileList=[]}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ListPane",e),this.rebuildList(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildList(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",t)}let o="";for(let n=0;n<e.length;n++){let r=e[n],s=i&&i.Name===r.Name&&i.Path===r.Path,a={Index:n,Name:r.Name,Icon:t.getEntryIcon(r),SizeFormatted:"folder"===r.Type?"--":t.formatFileSize(r.Size),ModifiedFormatted:t.formatDate(r.Modified),SelectedClass:s?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+n+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+n+")"};o+=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Row-Template",a)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",o)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="",i=this.pict.providers["Pict-FileBrowser-Icons"],o=i?i.getIcon("home",16):"🏠";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:o,ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),o="";for(let t=0;t<i.length;t++)if(o=o?o+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let n=o;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+n+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Breadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildList()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildList(),this.rebuildBreadcrumb()}sortBy(t){let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.setSortField(t),this.rebuildList()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildList(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=n},{"pict-view":76}],64:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-ListIcons",DefaultRenderable:"ListIcons-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListIcons-Container-Template",Template:'\n<div id="Pict-FileBrowser-IconList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-IconBreadcrumb"></div>\n\t<div class="pict-fb-icons" id="Pict-FileBrowser-IconGrid"></div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Item-Template",Template:'\n<div class="pict-fb-icon-item{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<div class="pict-fb-icon-graphic">{~D:Record.Icon~}</div>\n\t<div class="pict-fb-icon-label">{~D:Record.Name~}</div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ListIcons-Container",TemplateHash:"FileBrowser-ListIcons-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i),this._cachedFileList=[]}onAfterRender(t){return this.rebuildGrid(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildGrid(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",t)}let o="";for(let n=0;n<e.length;n++){let r=e[n],s=i&&i.Name===r.Name&&i.Path===r.Path,a={Index:n,Name:r.Name,Icon:t.getEntryIcon(r),SelectedClass:s?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+n+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+n+")"};o+=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Item-Template",a)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",o)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:"🏠",ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),o="";for(let t=0;t<i.length;t++)if(o=o?o+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let n=o;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+n+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconBreadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildGrid()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildGrid(),this.rebuildBreadcrumb()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildGrid(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=n},{"pict-view":76}],65:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-ViewFileInfo",DefaultRenderable:"ViewFileInfo-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewFileInfo-Container-Template",Template:'<div class="pict-fb-fileinfo" id="Pict-FileBrowser-FileInfo"></div>'},{Hash:"FileBrowser-ViewFileInfo-Detail-Template",Template:'\n<div class="pict-fb-fileinfo-title">{~D:Record.Name~}</div>\n<table class="pict-fb-fileinfo-table">\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Type</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.TypeDescription~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Size</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.SizeFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Modified</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.ModifiedFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Extension</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Extension~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Path</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Path~}</td>\n\t</tr>\n</table>\n'},{Hash:"FileBrowser-ViewFileInfo-Empty-Template",Template:'<div class="pict-fb-fileinfo-none">No file selected</div>'}],Renderables:[{RenderableHash:"ViewFileInfo-Container",TemplateHash:"FileBrowser-ViewFileInfo-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i)}onAfterRender(t){return this.rebuildFileInfo(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildFileInfo(){let t=this.pict.providers["Pict-FileBrowser-View"],e=this.pict.providers["Pict-FileBrowser-List"],i=t?t.getCurrentFile():null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Empty-Template",{});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",t)}let o={Name:i.Name||"Unknown",TypeDescription:t?t.getFileTypeDescription(i):"File",SizeFormatted:e?e.formatFileSize(i.Size):i.Size||"--",ModifiedFormatted:e?e.formatDate(i.Modified):i.Modified||"--",Extension:i.Extension||"--",Path:i.Path||"--"},n=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Detail-Template",o);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",n)}},e.exports.default_configuration=n},{"pict-view":76}],66:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-ViewImage",DefaultRenderable:"ViewImage-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewImage-Container-Template",Template:'<div class="pict-fb-image-viewer" id="Pict-FileBrowser-ImageViewer"></div>'},{Hash:"FileBrowser-ViewImage-Display-Template",Template:'<img src="{~D:Record.ImageURL~}" alt="{~D:Record.Name~}" />'},{Hash:"FileBrowser-ViewImage-NoImage-Template",Template:'<div class="pict-fb-image-viewer-none">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ViewImage-Container",TemplateHash:"FileBrowser-ViewImage-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i)}onAfterRender(t){return this.rebuildImageView(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildImageView(){let t=this.pict.providers["Pict-FileBrowser-View"],e=t?t.getCurrentFile():null;if(!e){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No file selected"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}if(!(!!t&&t.isImage(e))){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"Selected file is not an image"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let i=t?t.getImageURL(e):null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No image URL available"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let o=this.pict.parseTemplateByHash("FileBrowser-ViewImage-Display-Template",{ImageURL:i,Name:e.Name||"Image"});this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",o)}},e.exports.default_configuration=n},{"pict-view":76}],67:[function(t,e,i){const o=t("pict-view"),n=t("../Pict-Section-FileBrowser-DefaultConfiguration.js"),r=t("../providers/Pict-Provider-FileBrowserBrowse.js"),s=t("../providers/Pict-Provider-FileBrowserList.js"),a=t("../providers/Pict-Provider-FileBrowserView.js"),l=t("../providers/Pict-Provider-FileBrowserLayout.js"),d=t("../providers/Pict-Provider-FileBrowserIcons.js");e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(n)),e),i),this.pict.providers["Pict-FileBrowser-Browse"]||this.pict.addProvider("Pict-FileBrowser-Browse",r.default_configuration,r),this.pict.providers["Pict-FileBrowser-List"]||this.pict.addProvider("Pict-FileBrowser-List",s.default_configuration,s),this.pict.providers["Pict-FileBrowser-View"]||this.pict.addProvider("Pict-FileBrowser-View",a.default_configuration,a),this.pict.providers["Pict-FileBrowser-Layout"]||this.pict.addProvider("Pict-FileBrowser-Layout",l.default_configuration,l),this.pict.providers["Pict-FileBrowser-Icons"]||this.pict.addProvider("Pict-FileBrowser-Icons",d.default_configuration,d),this.ensureDefaultState()}ensureDefaultState(){let t=this.options.DefaultState||{},e=this.options.StateAddresses||{},i={AppData:this.pict.AppData,Pict:this.pict};this.pict.AppData.PictFileBrowser||(this.pict.AppData.PictFileBrowser={});for(let o in e){let n=e[o],r=this.pict.manifest.getValueByHash(i,n);if(null==r){let e=t[o];void 0!==e&&this.pict.manifest.setValueByHash(i,n,e)}}this.pict.AppData.PictFileBrowser.FileList||(this.pict.AppData.PictFileBrowser.FileList=[]),this.pict.AppData.PictFileBrowser.FolderTree||(this.pict.AppData.PictFileBrowser.FolderTree=[])}onAfterRender(t){return this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}getState(t){let e=(this.options.StateAddresses||{})[t];if(e)return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},e)}setState(t,e){let i=(this.options.StateAddresses||{})[t];i&&this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,e)}},e.exports.default_configuration=n},{"../Pict-Section-FileBrowser-DefaultConfiguration.js":53,"../providers/Pict-Provider-FileBrowserBrowse.js":55,"../providers/Pict-Provider-FileBrowserIcons.js":56,"../providers/Pict-Provider-FileBrowserLayout.js":57,"../providers/Pict-Provider-FileBrowserList.js":58,"../providers/Pict-Provider-FileBrowserView.js":59,"pict-view":76}],68:[function(t,e,i){e.exports.attach=function(t){t._createEditorInContainer=function(e,i,o){let n=t._codeMirrorModules,r=[];r.push(n.EditorView.domEventHandlers({keydown:(e,o)=>(e.ctrlKey||e.metaKey)&&"b"===e.key?(e.preventDefault(),t.applyFormatting(i,"bold"),!0):(e.ctrlKey||e.metaKey)&&"i"===e.key?(e.preventDefault(),t.applyFormatting(i,"italic"),!0):(e.ctrlKey||e.metaKey)&&"e"===e.key?(e.preventDefault(),t.applyFormatting(i,"code"),!0):void 0,paste:(e,o)=>{let n=e.clipboardData&&e.clipboardData.items;if(!n)return!1;for(let o=0;o<n.length;o++)if(n[o].type.startsWith("image/")){e.preventDefault();let r=n[o].getAsFile();return r&&t._processImageFile(r,i),!0}return!1},drop:(e,o)=>{if(t._dragSourceIndex>=0)return!1;if(!e.dataTransfer||!e.dataTransfer.files||e.dataTransfer.files.length<1)return!1;let n=e.dataTransfer.files[0];if(n.type&&n.type.startsWith("image/")){e.preventDefault(),e.stopPropagation(),t._processImageFile(n,i);let r=o.dom.closest(".pict-mde-segment-editor");return r&&r.classList.remove("pict-mde-image-dragover"),!0}return!1}})),n.extensions&&Array.isArray(n.extensions)&&(r=r.concat(n.extensions)),r.push(n.EditorView.updateListener.of(e=>{e.docChanged&&t._onSegmentContentChange(i,e.state.doc.toString()),e.focusChanged&&(e.view.hasFocus?(t._setActiveSegment(i),t._updateSidebarPosition(i)):setTimeout(()=>{if(t._activeSegmentIndex===i){let e=document.getElementById(`PictMDE-Segment-${i}`);e&&!e.contains(document.activeElement)&&(t._clearActiveSegment(i),t._resetSidebarPosition(i))}},100)),e.selectionSet&&e.view.hasFocus&&t._updateSidebarPosition(i)}));let s=t._buildDataURICollapseExtension();s&&r.push(s),t.options.ReadOnly&&(r.push(n.EditorState.readOnly.of(!0)),r.push(n.EditorView.editable.of(!1))),r=t.customConfigureExtensions(r,i);let a=n.EditorState.create({doc:o||"",extensions:r}),l=new n.EditorView({state:a,parent:e});t._segmentEditors[i]=l,l.contentDOM.addEventListener("keydown",function(e){if("ArrowDown"!==e.key&&"ArrowUp"!==e.key)return;if(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)return;let o=l.state,n=o.selection.main.head,r=o.doc.lineAt(n),s=n-r.from;if("ArrowDown"===e.key){if(r.to<o.doc.length)return;let n=t._getOrderedSegmentIndices(),a=t._getLogicalIndex(i);if(a<0||a>=n.length-1)return;let l=n[a+1],d=t._segmentEditors[l];if(!d)return;e.preventDefault(),e.stopPropagation();let c=d.state.doc.line(1),p=Math.min(s,c.to-c.from);d.focus(),d.dispatch({selection:{anchor:c.from+p}}),t._setActiveSegment(l)}else if("ArrowUp"===e.key){if(r.number>1)return;let o=t._getOrderedSegmentIndices(),n=t._getLogicalIndex(i);if(n<=0)return;let a=o[n-1],l=t._segmentEditors[a];if(!l)return;e.preventDefault(),e.stopPropagation();let d=l.state.doc.line(l.state.doc.lines),c=Math.min(s,d.to-d.from);l.focus(),l.dispatch({selection:{anchor:d.from+c}}),t._setActiveSegment(a)}},!0),l.contentDOM.addEventListener("drop",function(e){if(t._dragSourceIndex>=0)return;if(!e.dataTransfer||!e.dataTransfer.files||e.dataTransfer.files.length<1)return;let o=e.dataTransfer.files[0];if(o.type&&o.type.startsWith("image/")){e.preventDefault(),e.stopPropagation(),t._processImageFile(o,i);let n=document.getElementById(`PictMDE-SegmentEditor-${i}`);n&&n.classList.remove("pict-mde-image-dragover")}},!0)},t._buildDataURICollapseExtension=function(){let e=t._codeMirrorModules;if(!(e&&e.Decoration&&e.ViewPlugin&&e.WidgetType))return null;let i=e.Decoration,o=e.ViewPlugin,n=e.WidgetType;class r extends n{constructor(t){super(),this.label=t}toDOM(){let t=document.createElement("span");return t.className="pict-mde-data-uri-collapsed",t.textContent=this.label,t.title="Data URI (click to expand in image preview below)",t}eq(t){return this.label===t.label}}function s(t){let e=[],o=t.state.doc;for(let n of t.visibleRanges){let t,s=n.from,a=n.to,l=o.sliceString(s,a),d=/!\[[^\]]*\]\(data:([^;]+);base64,/g;for(;null!==(t=d.exec(l));){let n=s+t.index+t[0].length,a=-1,l=n,d=o.length,c=Math.min(d,l+5242880),p=4096;for(let t=l;t<c;t+=p){let e=Math.min(t+p,c),i=o.sliceString(t,e).indexOf(")");if(i>=0){a=t+i;break}}if(a<0)continue;let h=a-n;if(h<200)continue;let u,m=Math.round(.75*h);u=m>=1048576?(m/1048576).toFixed(1)+"MB":m>=1024?Math.round(m/1024)+"KB":m+"B";t[1];let f=`…${u})`,g=i.replace({widget:new r(f)});e.push(g.range(n,a+1))}}return i.set(e,!0)}return o.fromClass(class{constructor(t){this.decorations=s(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=s(t.view))}},{decorations:t=>t.decorations})}}},{}],69:[function(t,e,i){e.exports.attach=function(t){t._wireSegmentDragEvents=function(e,i){let o=e.querySelector(".pict-mde-drag-handle");o&&(o.addEventListener("dragstart",o=>{t._dragSourceIndex=i,o.dataTransfer.effectAllowed="move",o.dataTransfer.setData("text/plain",String(i));let n=t._getContainerElement();n&&n.classList.add("pict-mde-dragging"),setTimeout(()=>{e.style.opacity="0.4"},0)}),o.addEventListener("dragend",()=>{e.style.opacity="",t._dragSourceIndex=-1,t._clearAllDropIndicators();let i=t._getContainerElement();i&&i.classList.remove("pict-mde-dragging")}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",t._clearAllDropIndicators();let o=e.getBoundingClientRect(),n=o.top+o.height/2;i.clientY<n?e.classList.add("pict-mde-drag-over-top"):e.classList.add("pict-mde-drag-over-bottom")}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||(e.classList.remove("pict-mde-drag-over-top"),e.classList.remove("pict-mde-drag-over-bottom"))}),e.addEventListener("drop",o=>{o.preventDefault();let n=e.classList.contains("pict-mde-drag-over-bottom");t._clearAllDropIndicators();let r=t._dragSourceIndex;r<0||r===i||t._reorderSegment(r,i,n)}))},t._clearAllDropIndicators=function(){let e=t._getContainerElement();if(!e)return;let i=e.querySelectorAll(".pict-mde-segment");for(let t=0;t<i.length;t++)i[t].classList.remove("pict-mde-drag-over-top"),i[t].classList.remove("pict-mde-drag-over-bottom")},t._reorderSegment=function(e,i,o){let n=t._getLogicalIndex(e),r=t._getLogicalIndex(i);if(n<0||r<0)return void t.log.warn(`PICT-MarkdownEditor _reorderSegment: could not resolve logical indices (from=${n}, to=${r}).`);if(n===r)return;t._marshalAllEditorsToData();let s=t._getSegmentsFromData();if(!s||s.length<2)return;let a=o?r+1:r;if(n<a&&a--,a===n)return;let l=s.splice(n,1)[0];s.splice(a,0,l),t._setSegmentsToData(s),t._reorderHiddenPreviewState(n,a),t._buildEditorUI()},t._reorderHiddenPreviewState=function(e,i){if(e===i)return;let o=Object.keys(t._hiddenPreviewSegments).map(t=>parseInt(t,10));if(0===o.length)return;let n=Math.max(...o,e,i),r=[];for(let e=0;e<=n;e++)r.push(!!t._hiddenPreviewSegments[e]);let s=r.splice(e,1)[0];r.splice(i,0,s),t._hiddenPreviewSegments={};for(let e=0;e<r.length;e++)r[e]&&(t._hiddenPreviewSegments[e]=!0)},t._swapHiddenPreviewState=function(e,i){let o=!!t._hiddenPreviewSegments[e];!!t._hiddenPreviewSegments[i]?t._hiddenPreviewSegments[e]=!0:delete t._hiddenPreviewSegments[e],o?t._hiddenPreviewSegments[i]=!0:delete t._hiddenPreviewSegments[i]},t._setActiveSegment=function(e){if(t._activeSegmentIndex>=0&&t._activeSegmentIndex!==e){let e=document.getElementById(`PictMDE-Segment-${t._activeSegmentIndex}`);e&&e.classList.remove("pict-mde-active")}t._activeSegmentIndex=e;let i=document.getElementById(`PictMDE-Segment-${e}`);i&&i.classList.add("pict-mde-active")},t._clearActiveSegment=function(e){t._activeSegmentIndex===e&&(t._activeSegmentIndex=-1);let i=document.getElementById(`PictMDE-Segment-${e}`);i&&i.classList.remove("pict-mde-active"),t._resetSidebarPosition(e)},t._updateSidebarPosition=function(e){let i=document.getElementById(`PictMDE-Segment-${e}`);if(!i)return;let o=i.querySelector(".pict-mde-quadrant-tr");if(!o)return;let n=t._segmentEditors[e];if(!n)return;let r=n.state.selection.main.head,s=n.coordsAtPos(r);if(!s)return void t._resetSidebarPosition(e);let a=i.getBoundingClientRect(),l=s.top-a.top,d=o.offsetHeight||0,c=i.offsetHeight||0,p=Math.max(0,c-d);l=Math.max(0,Math.min(l,p)),o.classList.add("pict-mde-sidebar-at-cursor"),o.style.setProperty("--pict-mde-sidebar-top",`${l}px`)},t._resetSidebarPosition=function(t){let e=document.getElementById(`PictMDE-Segment-${t}`);if(!e)return;let i=e.querySelector(".pict-mde-quadrant-tr");i&&(i.classList.remove("pict-mde-sidebar-at-cursor"),i.style.removeProperty("--pict-mde-sidebar-top"))}}},{}],70:[function(t,e,i){const o={bold:{wrap:"**"},italic:{wrap:"*"},code:{wrap:"`"},heading:{prefix:"# "},link:{before:"[",after:"](url)"}};e.exports.attach=function(t){t.applyFormatting=function(e,i){let n=t._segmentEditors[e];if(!n)return void t.log.warn(`PICT-MarkdownEditor applyFormatting: no editor for segment ${e}.`);let r=o[i];if(!r)return void t.log.warn(`PICT-MarkdownEditor applyFormatting: unknown format type "${i}".`);let s,a,l=n.state,d=l.selection.main,c=d.from,p=d.to,h=c!==p,u=h?l.sliceDoc(c,p):"";if(r.wrap){let t=r.wrap;if(h){let e=l.sliceDoc(Math.max(0,c-t.length),c),i=l.sliceDoc(p,Math.min(l.doc.length,p+t.length));if(e===t&&i===t)return s=[{from:c-t.length,to:c,insert:""},{from:p,to:p+t.length,insert:""}],a=c-t.length,void n.dispatch({changes:s,selection:{anchor:a,head:a+u.length}});s={from:c,to:p,insert:t+u+t},a=c+t.length,n.dispatch({changes:s,selection:{anchor:a,head:a+u.length}})}else{s={from:c,insert:t+t},a=c+t.length,n.dispatch({changes:s,selection:{anchor:a}})}}else if(r.prefix){let t=l.doc.lineAt(c);s=t.text.startsWith(r.prefix)?{from:t.from,to:t.from+r.prefix.length,insert:""}:{from:t.from,insert:r.prefix},n.dispatch({changes:s})}else if(r.before&&r.after)if(h){s={from:c,to:p,insert:r.before+u+r.after},a=c+r.before.length+u.length+2,n.dispatch({changes:s,selection:{anchor:a,head:a+3}})}else{s={from:c,insert:r.before+r.after},a=c+r.before.length,n.dispatch({changes:s,selection:{anchor:a}})}n.focus()}}},{}],71:[function(t,e,i){e.exports.attach=function(t){t.openImagePicker=function(e){let i=document.getElementById(`PictMDE-ImageInput-${e}`);i?(i.onchange=()=>{i.files&&i.files.length>0&&t._processImageFile(i.files[0],e),i.value=""},i.click()):t.log.warn(`PICT-MarkdownEditor openImagePicker: file input not found for segment ${e}.`)},t._processImageFile=function(e,i){if(!e||!e.type||!e.type.startsWith("image/"))return void t.log.warn(`PICT-MarkdownEditor _processImageFile: not an image file (type: ${e?e.type:"null"}).`);let o=e.name?e.name.replace(/\.[^.]+$/,""):"image";if(t.onImageUpload(e,i,(e,n)=>{e?t.log.error(`PICT-MarkdownEditor image upload error: ${e}`):n&&t._insertImageMarkdown(i,n,o)}))return;if("undefined"==typeof FileReader)return void t.log.error("PICT-MarkdownEditor _processImageFile: FileReader not available in this environment.");let n=new FileReader;n.onload=()=>{t._insertImageMarkdown(i,n.result,o)},n.onerror=()=>{t.log.error("PICT-MarkdownEditor _processImageFile: FileReader error.")},n.readAsDataURL(e)},t._insertImageMarkdown=function(e,i,o){let n=t._segmentEditors[e];if(!n)return void t.log.warn(`PICT-MarkdownEditor _insertImageMarkdown: no editor for segment ${e}.`);let r=``,s=n.state.selection.main.head;n.dispatch({changes:{from:s,insert:r},selection:{anchor:s+r.length}}),n.focus(),t._updateImagePreviews(e)},t._updateImagePreviews=function(e){let i=document.getElementById(`PictMDE-ImagePreview-${e}`);if(!i)return;let o=t._segmentEditors[e];if(!o)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let n,r=o.state.doc.toString(),s=/!\[([^\]]*)\]\(([^)]+)\)/g,a=[];for(;null!==(n=s.exec(r));)a.push({alt:n[1]||"image",url:n[2]});if(0===a.length)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let l="";for(let t=0;t<a.length;t++){let e=a[t].alt.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");l+=`<div class="pict-mde-image-preview-item"><img src="${a[t].url.replace(/&/g,"&").replace(/"/g,""")}" alt="${e}" /><span class="pict-mde-image-preview-label">${e}</span></div>`}i.innerHTML=l,i.classList.add("pict-mde-has-images")},t._wireImageDragEvents=function(e,i){e.addEventListener("dragover",i=>{t._dragSourceIndex>=0||!i.dataTransfer||!i.dataTransfer.types||i.dataTransfer.types.indexOf("Files")<0||(i.preventDefault(),i.dataTransfer.dropEffect="copy",e.classList.add("pict-mde-image-dragover"))}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||e.classList.remove("pict-mde-image-dragover")}),e.addEventListener("drop",o=>{if(e.classList.remove("pict-mde-image-dragover"),t._dragSourceIndex>=0)return;if(!o.dataTransfer||!o.dataTransfer.files||o.dataTransfer.files.length<1)return;let n=o.dataTransfer.files[0];n.type&&n.type.startsWith("image/")&&(o.preventDefault(),o.stopPropagation(),t._processImageFile(n,i))})}}},{}],72:[function(t,e,i){const o=t("pict-section-content").PictContentProvider;e.exports.attach=function(t){t._getContentProvider=function(){return t._contentProvider||(t._contentProvider=new o(t.fable,{},"Pict-Content-Provider-MDE")),t._contentProvider},t._updateRichPreviews=function(e){if(!t.options.EnableRichPreview)return;let i=document.getElementById(`PictMDE-RichPreview-${e}`);if(!i)return;let o=t._segmentEditors[e];if(!o)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let n=o.state.doc.toString();if(!n||0===n.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let r=t._getContentProvider().parseMarkdown(n);if(!r||0===r.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let s=`PictMDE-RichPreviewBody-${e}`;i.innerHTML=`<div class="pict-content" id="${s}">${r}</div>`,i.classList.add("pict-mde-has-rich-preview");let a=(t._richPreviewGenerations[e]||0)+1;t._richPreviewGenerations[e]=a,t._postRenderMermaid(s,e,a),t._postRenderKaTeX(s)},t._postRenderMermaid=function(e,i,o){if("undefined"==typeof mermaid)return;let n=document.getElementById(e);if(!n)return;let r=n.querySelectorAll("pre.mermaid");if(!(r.length<1))try{let e=mermaid.run({nodes:r});e&&"function"==typeof e.catch&&e.catch(e=>{(-1===i?t._renderedViewGeneration:t._richPreviewGenerations[i])===o&&t.log.warn(`PICT-MarkdownEditor mermaid render error: ${e.message||e}`)})}catch(e){t.log.warn(`PICT-MarkdownEditor mermaid render error: ${e.message||e}`)}},t._postRenderKaTeX=function(e){if("undefined"==typeof katex)return;let i=document.getElementById(e);if(!i)return;let o=i.querySelectorAll(".pict-content-katex-inline");for(let e=0;e<o.length;e++)try{katex.render(o[e].textContent,o[e],{throwOnError:!1,displayMode:!1})}catch(e){t.log.warn(`PICT-MarkdownEditor KaTeX inline error: ${e.message||e}`)}let n=i.querySelectorAll(".pict-content-katex-display");for(let e=0;e<n.length;e++)try{katex.render(n[e].textContent,n[e],{throwOnError:!1,displayMode:!0})}catch(e){t.log.warn(`PICT-MarkdownEditor KaTeX display error: ${e.message||e}`)}},t._escapeHTMLForPreview=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},t.toggleRenderedView=function(e){t._renderedViewActive="boolean"==typeof e?e:!t._renderedViewActive,t._renderedViewActive?t._renderRenderedView():t._restoreEditingView()},t._renderRenderedView=function(){let e=t._getContainerElement();if(!e)return;t._marshalAllEditorsToData();let i=t._getSegmentsFromData(),o="";if(i&&i.length>0){let t=[];for(let e=0;e<i.length;e++)t.push(i[e].Content||"");o=t.join("\n\n")}for(let e in t._segmentEditors)t._segmentEditors[e]&&t._segmentEditors[e].destroy();t._segmentEditors={};let n=t._getContentProvider().parseMarkdown(o),r="PictMDE-RenderedView";e.innerHTML=`<div class="pict-mde-rendered-view" id="${r}"><div class="pict-content">${n||""}</div></div>`,e.classList.add("pict-mde-rendered-mode"),t._renderedViewGeneration++;let s=t._renderedViewGeneration,a=e.querySelector(`#${r} .pict-content`);if(a){let e="PictMDE-RenderedViewContent";a.id=e,t._postRenderMermaid(e,-1,s),t._postRenderKaTeX(e)}},t._restoreEditingView=function(){let e=t._getContainerElement();e&&(e.classList.remove("pict-mde-rendered-mode"),t._buildEditorUI())}}},{"pict-section-content":50}],73:[function(t,e,i){e.exports={DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#MarkdownEditor-Container-Div",Templates:[{Hash:"MarkdownEditor-Container",Template:'<div class="pict-mde" id="PictMDE-Container"></div>'},{Hash:"MarkdownEditor-Segment",Template:'<div class="pict-mde-segment" id="PictMDE-Segment-{~D:Record.SegmentIndex~}" data-segment-index="{~D:Record.SegmentIndex~}">\n\t<div class="pict-mde-left-controls">\n\t\t<div class="pict-mde-quadrant-tl"></div>\n\t\t<div class="pict-mde-quadrant-bl"></div>\n\t</div>\n\t<div class="pict-mde-drag-handle" draggable="true" title="Drag to reorder"></div>\n\t<div class="pict-mde-segment-body">\n\t\t<div class="pict-mde-segment-editor" id="PictMDE-SegmentEditor-{~D:Record.SegmentIndex~}"></div>\n\t\t<div class="pict-mde-image-preview" id="PictMDE-ImagePreview-{~D:Record.SegmentIndex~}"></div>\n\t\t<div class="pict-mde-rich-preview" id="PictMDE-RichPreview-{~D:Record.SegmentIndex~}"></div>\n\t</div>\n\t<div class="pict-mde-sidebar" id="PictMDE-Sidebar-{~D:Record.SegmentIndex~}">\n\t\t<div class="pict-mde-quadrant-tr"></div>\n\t\t<div class="pict-mde-quadrant-br"></div>\n\t\t<input type="file" accept="image/*" class="pict-mde-image-input" id="PictMDE-ImageInput-{~D:Record.SegmentIndex~}" style="display:none" />\n\t</div>\n</div>'},{Hash:"MarkdownEditor-AddSegment",Template:'<div class="pict-mde-add-segment">\n\t<button type="button" class="pict-mde-btn-add" onclick="{~D:Record.ViewIdentifier~}.addSegment()">+ Add Segment</button>\n</div>'}],Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#MarkdownEditor-Container-Div"}],TargetElementAddress:"#MarkdownEditor-Container-Div",ContentDataAddress:!1,ReadOnly:!1,EnableRichPreview:!0,ButtonsTL:[{HTML:"×",Action:"removeSegment",Class:"pict-mde-btn-remove",Title:"Remove Segment"}],ButtonsBL:[{HTML:"↑",Action:"moveSegmentUp",Class:"pict-mde-btn-move",Title:"Move Up"},{HTML:"↓",Action:"moveSegmentDown",Class:"pict-mde-btn-move",Title:"Move Down"},{HTML:"⊞",Action:"toggleControls",Class:"pict-mde-btn-linenums",Title:"Toggle Controls"},{HTML:"◎",Action:"toggleSegmentPreview",Class:"pict-mde-btn-preview",Title:"Toggle Preview"}],ButtonsTR:[{HTML:"<b>B</b>",Action:"applyFormatting:bold",Class:"",Title:"Bold (Ctrl+B)"},{HTML:"<i>I</i>",Action:"applyFormatting:italic",Class:"",Title:"Italic (Ctrl+I)"},{HTML:"<code><></code>",Action:"applyFormatting:code",Class:"",Title:"Inline Code (Ctrl+E)"},{HTML:"#",Action:"applyFormatting:heading",Class:"",Title:"Heading"},{HTML:"[ ]",Action:"applyFormatting:link",Class:"",Title:"Link"},{HTML:"▣",Action:"openImagePicker",Class:"pict-mde-sidebar-btn-image",Title:"Insert Image"}],ButtonsBR:[],CSS:"\n/* ---- Container ---- */\n.pict-mde\n{\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\tfont-size: 14px;\n}\n\n/* ---- Segment row: left-controls | drag-handle | editor body | sidebar ---- */\n.pict-mde-segment\n{\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: stretch;\n\tmargin-bottom: 6px;\n\tmin-height: 48px;\n\ttransition: background-color 0.15s ease;\n}\n\n/* ---- Left controls column ---- */\n.pict-mde-left-controls\n{\n\tflex: 0 0 22px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 2px 0;\n}\n\n/* ---- Left-side quadrants ---- */\n.pict-mde-quadrant-tl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tposition: sticky;\n\ttop: 2px;\n\tz-index: 2;\n}\n.pict-mde-quadrant-bl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tposition: sticky;\n\tbottom: 2px;\n\tz-index: 2;\n}\n\n/* ---- Left-side buttons (shared base) ---- */\n.pict-mde-left-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 20px;\n\theight: 20px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tcolor: #888;\n\tline-height: 1;\n\tfont-family: inherit;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n}\n.pict-mde-segment:hover .pict-mde-left-btn,\n.pict-mde-segment.pict-mde-active .pict-mde-left-btn\n{\n\topacity: 1;\n}\n.pict-mde-left-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-btn-remove:hover\n{\n\tcolor: #CC3333;\n}\n.pict-mde-btn-linenums\n{\n\tfont-size: 11px;\n\tfont-weight: 600;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n/* Highlight when controls are active */\n.pict-mde.pict-mde-controls-on .pict-mde-btn-linenums\n{\n\tcolor: #4A90D9;\n}\n.pict-mde-btn-preview\n{\n\tfont-size: 11px;\n}\n/* Highlight the preview button when preview is visible (not hidden) */\n.pict-mde-segment:not(.pict-mde-preview-hidden) .pict-mde-btn-preview\n{\n\tcolor: #4A90D9;\n}\n/* Dim preview button when this segment's preview is individually hidden */\n.pict-mde-segment.pict-mde-preview-hidden .pict-mde-btn-preview\n{\n\tcolor: #CCC;\n}\n\n/* ---- Drag handle (simple grey bar) ---- */\n.pict-mde-drag-handle\n{\n\tflex: 0 0 8px;\n\tcursor: grab;\n\tbackground: #EDEDED;\n\ttransition: background-color 0.15s ease;\n\tuser-select: none;\n}\n.pict-mde-drag-handle:active\n{\n\tcursor: grabbing;\n}\n.pict-mde-drag-handle:hover\n{\n\tbackground: #C8C8C8;\n}\n\n/* ---- Editor body (middle column) ---- */\n.pict-mde-segment-body\n{\n\tflex: 1 1 0%;\n\tmin-width: 0;\n\toverflow: hidden;\n\tbackground: #FFFFFF;\n\ttransition: background-color 0.15s ease;\n}\n.pict-mde-segment-editor\n{\n\tmin-height: 48px;\n}\n\n/* ---- Image preview area below the editor ---- */\n.pict-mde-image-preview\n{\n\tdisplay: none;\n}\n.pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tborder-top: 1px solid #EDEDED;\n}\n.pict-mde-image-preview img\n{\n\tmax-width: 200px;\n\tmax-height: 150px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tobject-fit: contain;\n\tbackground: #F8F8F8;\n}\n.pict-mde-image-preview-item\n{\n\tposition: relative;\n\tdisplay: inline-block;\n}\n.pict-mde-image-preview-label\n{\n\tdisplay: block;\n\tfont-size: 10px;\n\tcolor: #999;\n\tmargin-top: 2px;\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* ---- Rich content preview area (rendered via pict-section-content) ---- */\n.pict-mde-rich-preview\n{\n\tdisplay: none;\n}\n.pict-mde-rich-preview.pict-mde-has-rich-preview\n{\n\tdisplay: block;\n\tborder-top: 1px solid #EDEDED;\n\tbackground: #FCFCFC;\n\toverflow: hidden;\n}\n/* Constrain images in the rich preview even if pict-section-content CSS loads late */\n.pict-mde-rich-preview img\n{\n\tmax-width: 100%;\n\theight: auto;\n}\n/* Global preview toggle: hide all previews when container has class */\n.pict-mde.pict-mde-previews-hidden .pict-mde-rich-preview.pict-mde-has-rich-preview,\n.pict-mde.pict-mde-previews-hidden .pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: none;\n}\n/* Per-segment preview toggle: hide previews for a specific segment */\n.pict-mde-segment.pict-mde-preview-hidden .pict-mde-rich-preview.pict-mde-has-rich-preview,\n.pict-mde-segment.pict-mde-preview-hidden .pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: none;\n}\n/* Constrain the pict-content inside the preview to fit the segment */\n.pict-mde-rich-preview .pict-content\n{\n\tpadding: 12px;\n\tmax-width: none;\n\tmargin: 0;\n\tfont-size: 13px;\n}\n/* Reduce heading sizes in the preview to be proportional */\n.pict-mde-rich-preview .pict-content h1\n{\n\tfont-size: 1.4em;\n\tmargin-top: 0;\n}\n.pict-mde-rich-preview .pict-content h2\n{\n\tfont-size: 1.2em;\n\tmargin-top: 0.75em;\n}\n.pict-mde-rich-preview .pict-content h3\n{\n\tfont-size: 1.1em;\n\tmargin-top: 0.6em;\n}\n\n/* ---- Rendered view (full document preview mode) ---- */\n.pict-mde-rendered-view\n{\n\tpadding: 16px 20px;\n\tbackground: #FFFFFF;\n\tmin-height: 120px;\n}\n.pict-mde-rendered-view .pict-content\n{\n\tmax-width: none;\n\tmargin: 0;\n}\n/* Hide the add-segment button in rendered mode */\n.pict-mde.pict-mde-rendered-mode .pict-mde-add-segment\n{\n\tdisplay: none;\n}\n\n/* Focused / active editor gets subtle warm background */\n.pict-mde-segment.pict-mde-active .pict-mde-segment-body\n{\n\tbackground: #FAFAF5;\n}\n.pict-mde-segment.pict-mde-active .pict-mde-drag-handle\n{\n\tbackground: #9CB4C8;\n}\n\n/* ---- Right sidebar column ---- */\n.pict-mde-sidebar\n{\n\tflex: 0 0 30px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tposition: relative;\n}\n\n/* ---- Right-side quadrants ---- */\n.pict-mde-quadrant-tr\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease, top 0.1s ease;\n\tposition: sticky;\n\ttop: 0;\n}\n.pict-mde-quadrant-br\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n\tposition: sticky;\n\tbottom: 0;\n}\n\n/* Active segment always shows its right-side quadrants */\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n/* When no segment is active, hovering shows both left + right controls */\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n\n/* ---- Controls-hidden mode: right quadrants show faintly on hover ---- */\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-br\n{\n\topacity: 0;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n\n/* When JS sets a cursor-relative offset, switch TR from sticky to absolute positioning */\n.pict-mde-quadrant-tr.pict-mde-sidebar-at-cursor\n{\n\tposition: absolute;\n\ttop: var(--pict-mde-sidebar-top, 0px);\n}\n\n/* ---- Right-side buttons (shared base) ---- */\n.pict-mde-sidebar-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 22px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tborder-radius: 3px;\n\tcolor: #666;\n\tline-height: 1;\n\tfont-family: inherit;\n}\n.pict-mde-sidebar-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-sidebar-btn b\n{\n\tfont-size: 13px;\n\tfont-weight: 700;\n}\n.pict-mde-sidebar-btn i\n{\n\tfont-size: 13px;\n\tfont-style: italic;\n}\n.pict-mde-sidebar-btn code\n{\n\tfont-size: 10px;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n\n/* ---- Add segment button ---- */\n.pict-mde-add-segment\n{\n\tmargin-top: 6px;\n\tpadding-left: 30px;\n}\n.pict-mde-btn-add\n{\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 7px;\n\tborder: 2px dashed #D0D0D0;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: #999;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\tcursor: pointer;\n\ttransition: all 0.15s ease;\n}\n.pict-mde-btn-add:hover\n{\n\tborder-color: #4A90D9;\n\tcolor: #4A90D9;\n\tbackground: rgba(74, 144, 217, 0.04);\n}\n\n/* ---- Image drag-over indicator ---- */\n.pict-mde-segment-editor.pict-mde-image-dragover\n{\n\toutline: 2px dashed #4A90D9;\n\toutline-offset: -2px;\n}\n\n/* ---- Drag-in-progress: prevent CodeMirror from intercepting drop events ---- */\n.pict-mde.pict-mde-dragging .pict-mde-segment-editor\n{\n\tpointer-events: none;\n}\n\n/* ---- Drop target indicators for drag reorder ---- */\n.pict-mde-segment.pict-mde-drag-over-top\n{\n\tbox-shadow: 0 -2px 0 0 #4A90D9;\n}\n.pict-mde-segment.pict-mde-drag-over-bottom\n{\n\tbox-shadow: 0 2px 0 0 #4A90D9;\n}\n\n/* ---- CodeMirror overrides inside segments ---- */\n.pict-mde-segment-editor .cm-editor\n{\n\tborder: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-scroller\n{\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.6;\n}\n.pict-mde-segment-editor .cm-editor.cm-focused\n{\n\toutline: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-content\n{\n\tpadding: 8px 12px;\n\tmin-height: 36px;\n}\n.pict-mde-segment-editor .cm-editor .cm-gutters\n{\n\tbackground: #F8F8F8;\n\tborder-right: 1px solid #E8E8E8;\n\tcolor: #BBB;\n}\n\n/* ---- Collapsed data URI widget ---- */\n.pict-mde-data-uri-collapsed\n{\n\tdisplay: inline;\n\tbackground: #F0F0F0;\n\tcolor: #888;\n\tfont-size: 11px;\n\tpadding: 1px 4px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n\tcursor: default;\n\twhite-space: nowrap;\n}\n\n/* ---- Line number / controls toggle: gutters hidden by default ---- */\n.pict-mde .cm-editor .cm-gutters\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-controls-on .cm-editor .cm-gutters\n{\n\tdisplay: flex;\n}\n\n/* ============================================\n RESPONSIVE: Tablet / Phone (max-width: 768px)\n ============================================ */\n@media (max-width: 768px)\n{\n\t/* Prevent any horizontal overflow in the editor */\n\t.pict-mde\n\t{\n\t\toverflow-x: hidden;\n\t\tmax-width: 100%;\n\t}\n\n\t/* Reduce the left controls column width */\n\t.pict-mde-left-controls\n\t{\n\t\tflex: 0 0 16px;\n\t}\n\t.pict-mde-left-btn\n\t{\n\t\twidth: 16px;\n\t\theight: 18px;\n\t\tfont-size: 10px;\n\t}\n\n\t/* Make left-side buttons always visible on touch (no hover) */\n\t.pict-mde-left-btn\n\t{\n\t\topacity: 0.6;\n\t}\n\n\t/* Narrow the drag handle */\n\t.pict-mde-drag-handle\n\t{\n\t\tflex: 0 0 5px;\n\t}\n\n\t/* Shrink the right sidebar column */\n\t.pict-mde-sidebar\n\t{\n\t\tflex: 0 0 24px;\n\t}\n\t.pict-mde-sidebar-btn\n\t{\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tfont-size: 11px;\n\t}\n\n\t/* Make right sidebar buttons always visible (touch devices) */\n\t.pict-mde-quadrant-tr,\n\t.pict-mde-quadrant-br\n\t{\n\t\topacity: 0.7;\n\t}\n\t.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n\t.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n\t{\n\t\topacity: 1;\n\t}\n\n\t/* Reduce CodeMirror content padding */\n\t.pict-mde-segment-editor .cm-editor .cm-content\n\t{\n\t\tpadding: 6px 6px;\n\t}\n\n\t/* Reduce font size slightly for more content on screen */\n\t.pict-mde-segment-editor .cm-editor .cm-scroller\n\t{\n\t\tfont-size: 13px;\n\t}\n\n\t/* Add segment button: reduce left margin */\n\t.pict-mde-add-segment\n\t{\n\t\tpadding-left: 21px;\n\t}\n\n\t/* Rich preview: less padding */\n\t.pict-mde-rich-preview .pict-content\n\t{\n\t\tpadding: 8px;\n\t\tfont-size: 12px;\n\t}\n\n\t/* Image previews: smaller max dimensions */\n\t.pict-mde-image-preview img\n\t{\n\t\tmax-width: 120px;\n\t\tmax-height: 100px;\n\t}\n\n\t/* Rendered view: less padding */\n\t.pict-mde-rendered-view\n\t{\n\t\tpadding: 10px 8px;\n\t}\n}\n\n/* ============================================\n RESPONSIVE: Small phone (max-width: 480px)\n ============================================ */\n@media (max-width: 480px)\n{\n\t/* Wrap segment so left controls flow to the top as a horizontal bar */\n\t.pict-mde-segment\n\t{\n\t\tflex-wrap: wrap;\n\t}\n\n\t/* Left controls become a horizontal toolbar at the top of the segment */\n\t.pict-mde-left-controls\n\t{\n\t\tflex: 0 0 100%;\n\t\tflex-direction: row;\n\t\tjustify-content: flex-start;\n\t\tgap: 2px;\n\t\tpadding: 3px 4px;\n\t\torder: -1;\n\t\tbackground: #F5F5F5;\n\t\tborder-bottom: 1px solid #EDEDED;\n\t}\n\t.pict-mde-left-btn\n\t{\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tfont-size: 12px;\n\t\topacity: 0.7;\n\t}\n\n\t/* Left quadrants flow horizontally */\n\t.pict-mde-quadrant-tl,\n\t.pict-mde-quadrant-bl\n\t{\n\t\tflex-direction: row;\n\t\tgap: 2px;\n\t\tposition: static;\n\t}\n\n\t/* Segment body: explicit basis so it fills the wrapped row */\n\t.pict-mde-segment-body\n\t{\n\t\tflex: 1 1 calc(100% - 20px);\n\t}\n\n\t/* Hide drag handle on very small screens */\n\t.pict-mde-drag-handle\n\t{\n\t\tdisplay: none;\n\t}\n\n\t/* Right sidebar: further shrink */\n\t.pict-mde-sidebar\n\t{\n\t\tflex: 0 0 20px;\n\t}\n\t.pict-mde-sidebar-btn\n\t{\n\t\twidth: 18px;\n\t\theight: 18px;\n\t\tfont-size: 10px;\n\t}\n\n\t/* Add segment: no left offset since controls are at top */\n\t.pict-mde-add-segment\n\t{\n\t\tpadding-left: 0;\n\t}\n\n\t/* Even tighter CodeMirror padding */\n\t.pict-mde-segment-editor .cm-editor .cm-content\n\t{\n\t\tpadding: 4px 4px;\n\t}\n}\n"}},{}],74:[function(t,e,i){const o=t("pict-view"),n=t("pict-section-content"),r=t("./Pict-Section-MarkdownEditor-DefaultConfiguration.js"),s=t("./Pict-MDE-Formatting.js"),a=t("./Pict-MDE-ImageHandling.js"),l=t("./Pict-MDE-DragAndReorder.js"),d=t("./Pict-MDE-RichPreview.js"),c=t("./Pict-MDE-CodeMirror.js");e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this._codeMirrorModules=null,this._segmentEditors={},this._segmentCounter=0,this._viewCallIdentifier=!1,this._activeSegmentIndex=-1,this._dragSourceIndex=-1,this._controlsVisible=!0,this._previewsVisible=!0,this._hiddenPreviewSegments={},this._imagePreviewTimers={},this._richPreviewTimers={},this._richPreviewGenerations={},this._contentProvider=null,this._renderedViewActive=!1,this._renderedViewGeneration=0,s.attach(this),a.attach(this),l.attach(this),d.attach(this),c.attach(this)}onBeforeInitialize(){return super.onBeforeInitialize(),this.targetElement=!1,super.onBeforeInitialize()}connectCodeMirrorModules(t){if(!t||"object"!=typeof t||"function"!=typeof t.EditorView||"function"!=typeof t.EditorState)return"undefined"!=typeof window&&window.CodeMirrorModules&&"function"==typeof window.CodeMirrorModules.EditorView?(this.log.trace("PICT-MarkdownEditor Found CodeMirror modules on window.CodeMirrorModules."),void(this._codeMirrorModules=window.CodeMirrorModules)):(this.log.error("PICT-MarkdownEditor No CodeMirror modules found. Provide them via connectCodeMirrorModules() or set window.CodeMirrorModules."),!1);this._codeMirrorModules=t}onAfterRender(t){return this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeMirrorModules||this.connectCodeMirrorModules(),!this._codeMirrorModules)return this.log.error("PICT-MarkdownEditor Cannot initialize; no CodeMirror modules available."),!1;if(this.options.EnableRichPreview){let t=n.default_configuration;t&&t.CSS&&this.pict.CSSMap.addCSS("Pict-Content-View",t.CSS)}let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error(`PICT-MarkdownEditor Could not find target element [${this.options.TargetElementAddress}]!`),this.targetElement=!1,!1;this.targetElement=t[0],this._viewCallIdentifier=this._resolveViewCallIdentifier(),this._buildEditorUI()}_resolveViewCallIdentifier(){let t=this.pict.views;for(let e in t)if(t[e]===this)return`_Pict.views.${e}`;return`_Pict.servicesMap.PictView['${this.Hash}']`}_getContainerElement(){if(this.targetElement){let t=this.targetElement.querySelector(".pict-mde");if(t)return t}return this.targetElement||null}_buildEditorUI(){let t=this._getContainerElement();t&&!t.classList.contains("pict-mde")&&t.classList.add("pict-mde");for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();t.innerHTML="",this._previewsVisible||t.classList.add("pict-mde-previews-hidden"),this._controlsVisible?t.classList.add("pict-mde-controls-on"):t.classList.add("pict-mde-controls-hidden");let e=this._getSegmentsFromData();e&&0!==e.length||(e=[{Content:""}],this._setSegmentsToData(e)),this._segmentCounter=0,this._segmentEditors={};for(let i=0;i<e.length;i++)this._renderSegment(t,i,e[i].Content||"");this._renderAddButton(t)}_renderSegment(t,e,i){let o=this._segmentCounter++,n={SegmentIndex:o,SegmentDisplayIndex:e+1,ViewIdentifier:this._viewCallIdentifier},r=this.pict.parseTemplateByHash("MarkdownEditor-Segment",n),s=document.createElement("div");s.innerHTML=r;let a=s.firstElementChild;t.appendChild(a),this._buildQuadrantButtons(a,o),this._hiddenPreviewSegments[e]&&a.classList.add("pict-mde-preview-hidden"),this._wireSegmentDragEvents(a,o);let l=document.getElementById(`PictMDE-SegmentEditor-${o}`);l&&(this._createEditorInContainer(l,o,i),this._wireImageDragEvents(l,o),i&&(this._updateImagePreviews(o),this._updateRichPreviews(o)))}_buildQuadrantButtons(t,e){let i=[{key:"ButtonsTL",selector:".pict-mde-quadrant-tl",baseClass:"pict-mde-left-btn"},{key:"ButtonsBL",selector:".pict-mde-quadrant-bl",baseClass:"pict-mde-left-btn"},{key:"ButtonsTR",selector:".pict-mde-quadrant-tr",baseClass:"pict-mde-sidebar-btn"},{key:"ButtonsBR",selector:".pict-mde-quadrant-br",baseClass:"pict-mde-sidebar-btn"}],o=this;for(let n=0;n<i.length;n++){let r=i[n],s=t.querySelector(r.selector);if(!s)continue;let a=this.options[r.key];if(Array.isArray(a))for(let t=0;t<a.length;t++){let i=a[t],n=document.createElement("button");n.type="button",n.className=r.baseClass,i.Class&&(n.className+=" "+i.Class),n.innerHTML=i.HTML||"",n.title=i.Title||"";let l=i.Action||"",d=l,c=null,p=l.indexOf(":");p>=0&&(d=l.substring(0,p),c=l.substring(p+1)),function(t,e,i){n.addEventListener("click",()=>{"function"==typeof o[t]?null!==e?o[t](i,e):o[t](i):o.log.warn(`PICT-MarkdownEditor _buildQuadrantButtons: method "${t}" not found.`)})}(d,c,e),s.appendChild(n)}}}customConfigureExtensions(t,e){return t}_renderAddButton(t){let e={ViewIdentifier:this._viewCallIdentifier},i=this.pict.parseTemplateByHash("MarkdownEditor-AddSegment",e),o=document.createElement("div");o.innerHTML=i;let n=o.firstElementChild;t.appendChild(n)}onImageUpload(t,e,i){return!1}toggleControls(t,e){let i=e;"boolean"==typeof t&&(i=t),this._controlsVisible="boolean"==typeof i?i:!this._controlsVisible;let o=this._getContainerElement();o&&(this._controlsVisible?(o.classList.add("pict-mde-controls-on"),o.classList.remove("pict-mde-controls-hidden")):(o.classList.remove("pict-mde-controls-on"),o.classList.add("pict-mde-controls-hidden")))}toggleLineNumbers(t){this.toggleControls(t)}togglePreview(t){this._previewsVisible="boolean"==typeof t?t:!this._previewsVisible;let e=this._getContainerElement();e&&(this._previewsVisible?e.classList.remove("pict-mde-previews-hidden"):e.classList.add("pict-mde-previews-hidden"))}toggleSegmentPreview(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let o=!!this._hiddenPreviewSegments[i];o="boolean"==typeof e?!e:!o,o?this._hiddenPreviewSegments[i]=!0:delete this._hiddenPreviewSegments[i];let n=document.getElementById(`PictMDE-Segment-${t}`);n&&(o?n.classList.add("pict-mde-preview-hidden"):(n.classList.remove("pict-mde-preview-hidden"),this._updateRichPreviews(t),this._updateImagePreviews(t)))}_getSegmentsFromData(){if(!this.options.ContentDataAddress)return null;const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.ContentDataAddress);return Array.isArray(e)?e:null}_setSegmentsToData(t){if(!this.options.ContentDataAddress)return;const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.ContentDataAddress,t)}_onSegmentContentChange(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let o=this._getSegmentsFromData();if(!o)return;i<o.length&&(o[i].Content=e),this.onContentChange(i,e);let n=this;this._imagePreviewTimers[t]&&clearTimeout(this._imagePreviewTimers[t]),this._imagePreviewTimers[t]=setTimeout(()=>{n._updateImagePreviews(t),delete n._imagePreviewTimers[t]},500),this._richPreviewTimers[t]&&clearTimeout(this._richPreviewTimers[t]),this._richPreviewTimers[t]=setTimeout(()=>{n._updateRichPreviews(t),delete n._richPreviewTimers[t]},500)}onContentChange(t,e){}_getLogicalIndex(t){let e=this._getContainerElement();if(!e)return-1;let i=e.querySelectorAll(".pict-mde-segment");for(let e=0;e<i.length;e++){if(parseInt(i[e].getAttribute("data-segment-index"),10)===t)return e}return-1}_getOrderedSegmentIndices(){let t=this._getContainerElement();if(!t)return[];let e=t.querySelectorAll(".pict-mde-segment"),i=[];for(let t=0;t<e.length;t++)i.push(parseInt(e[t].getAttribute("data-segment-index"),10));return i}addSegment(t){let e="string"==typeof t?t:"",i=this._getSegmentsFromData();i||(i=[]),i.push({Content:e}),this._setSegmentsToData(i),this._buildEditorUI()}removeSegment(t){let e=this._getLogicalIndex(t);if(e<0)return void this.log.warn(`PICT-MarkdownEditor removeSegment: segment index ${t} not found.`);let i=this._getSegmentsFromData();if(!i||i.length<=1)return void this.log.warn("PICT-MarkdownEditor removeSegment: cannot remove the last segment.");this._segmentEditors[t]&&(this._segmentEditors[t].destroy(),delete this._segmentEditors[t]),i.splice(e,1),this._setSegmentsToData(i);let o={};for(let t in this._hiddenPreviewSegments){let i=parseInt(t,10);i<e?o[i]=!0:i>e&&(o[i-1]=!0)}this._hiddenPreviewSegments=o,this._buildEditorUI()}moveSegmentUp(t){let e=this._getLogicalIndex(t);if(e<=0)return;this._marshalAllEditorsToData();let i=this._getSegmentsFromData();if(!i)return;let o=i[e];i[e]=i[e-1],i[e-1]=o,this._swapHiddenPreviewState(e,e-1),this._buildEditorUI()}moveSegmentDown(t){let e=this._getLogicalIndex(t),i=this._getSegmentsFromData();if(!i||e<0||e>=i.length-1)return;this._marshalAllEditorsToData();let o=i[e];i[e]=i[e+1],i[e+1]=o,this._swapHiddenPreviewState(e,e+1),this._buildEditorUI()}getSegmentContent(t){let e=this._getOrderedSegmentIndices();if(t<0||t>=e.length)return"";let i=e[t],o=this._segmentEditors[i];return o?o.state.doc.toString():""}setSegmentContent(t,e){let i=this._getOrderedSegmentIndices();if(t<0||t>=i.length)return void this.log.warn(`PICT-MarkdownEditor setSegmentContent: index ${t} out of range.`);let o=i[t],n=this._segmentEditors[o];n&&n.dispatch({changes:{from:0,to:n.state.doc.length,insert:e}})}getSegmentCount(){return this._getOrderedSegmentIndices().length}getAllContent(t){let e="string"==typeof t?t:"\n\n",i=this._getOrderedSegmentIndices(),o=[];for(let t=0;t<i.length;t++){let e=this._segmentEditors[i[t]];e&&o.push(e.state.doc.toString())}return o.join(e)}_marshalAllEditorsToData(){let t=this._getSegmentsFromData();if(!t)return;let e=this._getOrderedSegmentIndices();for(let i=0;i<e.length;i++){let o=this._segmentEditors[e[i]];o&&i<t.length&&(t[i].Content=o.state.doc.toString())}}setReadOnly(t){this.options.ReadOnly=t,this.initialRenderComplete&&(this._marshalAllEditorsToData(),this._buildEditorUI())}marshalToView(){super.marshalToView(),this.initialRenderComplete&&this.options.ContentDataAddress&&this._buildEditorUI()}marshalFromView(){super.marshalFromView(),this._marshalAllEditorsToData()}destroy(){for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();this._segmentEditors={};for(let t in this._richPreviewTimers)clearTimeout(this._richPreviewTimers[t]);this._richPreviewTimers={},this._richPreviewGenerations={}}},e.exports.default_configuration=r},{"./Pict-MDE-CodeMirror.js":68,"./Pict-MDE-DragAndReorder.js":69,"./Pict-MDE-Formatting.js":70,"./Pict-MDE-ImageHandling.js":71,"./Pict-MDE-RichPreview.js":72,"./Pict-Section-MarkdownEditor-DefaultConfiguration.js":73,"pict-section-content":50,"pict-view":76}],75:[function(t,e,i){e.exports={name:"pict-view",version:"1.0.67",description:"Pict View Base Class",main:"source/Pict-View.js",scripts:{test:"npx quack test",tests:"npx quack test -g",start:"node source/Pict-View.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-view-image:local","docker-dev-run":'docker run -it -d --name pict-view-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-view" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-view-image:local',"docker-dev-shell":"docker exec -it pict-view-dev /bin/bash",types:"tsc -p .",lint:"eslint source/**"},types:"types/source/Pict-View.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-view.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-view/issues"},homepage:"https://github.com/stevenvelozo/pict-view#readme",devDependencies:{"@eslint/js":"^9.39.1","browser-env":"^3.3.0",eslint:"^9.39.1",pict:"^1.0.348",quackage:"^1.0.58",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{fable:"^3.1.63","fable-serviceproviderbase":"^3.0.19"}}},{}],76:[function(t,e,i){const o=t("fable-serviceproviderbase"),n=t("../package.json"),r={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoRender:!0,AutoRenderOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,CSSHash:!1,CSS:!1,CSSProvider:!1,CSSPriority:500,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),i),this.fable,this.options,this.UUID,this.Hash,this.log;const o=this.Hash===this.UUID;this.UUID=`V-${this.UUID}`,o&&(this.Hash=this.UUID),this.options.ViewIdentifier||(this.options.ViewIdentifier=`AutoViewID-${this.fable.getUUID()}`),this.serviceType="PictView",this._Package=n,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1,this.lastRenderedTimestamp=!1,this.lastMarshalFromViewTimestamp=!1,this.lastMarshalToViewTimestamp=!1,this.pict.instantiateServiceProviderIfNotExists("TransactionTracking");for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];"Hash"in e&&"Template"in e?(e.Source||(e.Source=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} options object.`),this.pict.TemplateProvider.addTemplate(e.Hash,e.Template,e.Source)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Template ${t} in the options array.`,e)}for(let t=0;t<this.options.DefaultTemplates.length;t++){let e=this.options.DefaultTemplates[t];"Postfix"in e&&"Template"in e?(e.Source||(e.Source=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} options object.`),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Default Template ${t} in the options array.`,e)}if(this.options.CSS){let t=this.options.CSSHash?this.options.CSSHash:`View-${this.options.ViewIdentifier}`,e=this.options.CSSProvider?this.options.CSSProvider:t;this.pict.CSSMap.addCSS(t,this.options.CSS,e,this.options.CSSPriority)}this.renderables={};for(let t=0;t<this.options.Renderables.length;t++){let e=this.options.Renderables[t];this.addRenderable(e)}}addRenderable(t,e,i,o,n){let r;if("object"==typeof t)r=t;else{r={RenderableHash:t,TemplateHash:e,DefaultTemplateRecordAddress:i,ContentDestinationAddress:o,RenderMethod:"string"!=typeof n?n:"replace"}}"string"!=typeof r.RenderableHash||"string"!=typeof r.TemplateHash?this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Renderable; RenderableHash or TemplateHash are invalid.`,r):(this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} adding renderable [${r.RenderableHash}] pointed to template ${r.TemplateHash}.`),this.renderables[r.RenderableHash]=r)}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialize:`),this.initializeTimestamp?(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialize called but initialization is already completed. Aborting.`),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initializeAsync:`),this.initializeTimestamp)return this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} async initialize called but initialization is already completed. Aborting.`),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} beginning initialization...`),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(e&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialization failed: ${e.message||e}`,{stack:e.stack}),this.initializeTimestamp=this.pict.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.info(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialization complete.`),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onBeforeRender(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeRender:`),!0}onBeforeRenderAsync(t,e){return this.onBeforeRender(e),t()}onBeforeProject(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeProject:`),!0}onBeforeProjectAsync(t,e){return this.onBeforeProject(e),t()}buildRenderOptions(t,e,i){let o={Valid:!0};return o.RenderableHash="string"==typeof t?t:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,o.RenderableHash||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not find a suitable RenderableHash ${o.RenderableHash} (param ${t}because it is not a valid renderable.`),o.Valid=!1),o.Renderable=this.renderables[o.RenderableHash],o.Renderable||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${o.RenderableHash} (param ${t}) because it does not exist.`),o.Valid=!1),o.DestinationAddress="string"==typeof e?e:"string"==typeof o.Renderable.ContentDestinationAddress?o.Renderable.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress,o.DestinationAddress||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${o.RenderableHash} (param ${t}) because it does not have a valid destination address (param ${e}).`),o.Valid=!1),"object"==typeof i?(o.RecordAddress="Passed in as object",o.Record=i):(o.RecordAddress="string"==typeof i?i:"string"==typeof o.Renderable.DefaultTemplateRecordAddress?o.Renderable.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,o.Record="string"==typeof o.RecordAddress?this.pict.DataProvider.getDataByAddress(o.RecordAddress):void 0),o}assignRenderContent(t,e,i){return this.pict.ContentAssignment.projectContent(t.RenderMethod,e,i,t.TestAddress)}render(t,e,i,o){return this.renderWithScope(this,t,e,i,o)}renderWithScope(t,e,i,o,n){let r,s,a,l="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;return l?("__Virtual"==l?r={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:n&&n.TransactionHash,RootRenderableViewHash:n&&n.RootRenderableViewHash}:(r=Object.assign({},this.renderables[l]),r.ContentDestinationAddress="string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),r.TransactionHash||(r.TransactionHash=`ViewRender-V-${this.options.ViewIdentifier}-R-${l}-U-${this.pict.getUUID()}`,r.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(r.TransactionHash)),r?r.ContentDestinationAddress?("object"==typeof o?(a=o,s="Passed in as object"):(s="string"==typeof o?o:"string"==typeof r.DefaultTemplateRecordAddress?r.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,a="string"==typeof s?this.pict.DataProvider.getDataByAddress(s):void 0),this.onBeforeRender(r),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] Renderable[${l}] Destination[${r.ContentDestinationAddress}] TemplateRecordAddress[${s}] render:`),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Beginning Render of Renderable[${l}] to Destination [${r.ContentDestinationAddress}]...`),r.Content=this.pict.parseTemplateByHash(r.TemplateHash,a,null,[this],t,{RootRenderable:"object"==typeof n?n:r}),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Assigning Renderable[${l}] content length ${r.Content.length} to Destination [${r.ContentDestinationAddress}] using render method [${r.RenderMethod}].`),this.onBeforeProject(r),this.onProject(r),"virtual-assignment"!==r.RenderMethod&&(this.onAfterProject(r),this.onAfterRender(r)),!0):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it does not have a valid destination address.`),!1):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it does not exist.`),!1)):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it is not a valid renderable.`),!1)}renderAsync(t,e,i,o,n){return this.renderWithScopeAsync(this,t,e,i,o,n)}renderWithScopeAsync(t,e,i,o,n,r){let s,a,l,d="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,c="function"==typeof r?r:"function"==typeof o?o:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof n?n:null;if(c||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),c=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${t}`,t)}),!d)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not asynchronously render ${d} (param ${e}because it is not a valid renderable.`),c(new Error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not asynchronously render ${d} (param ${e}because it is not a valid renderable.`));if("__Virtual"==d?s={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:n&&"function"!=typeof n&&n.TransactionHash,RootRenderableViewHash:n&&"function"!=typeof n&&n.RootRenderableViewHash}:(s=Object.assign({},this.renderables[d]),s.ContentDestinationAddress="string"==typeof i?i:"string"==typeof s.ContentDestinationAddress?s.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),s.TransactionHash||(s.TransactionHash=`ViewRender-V-${this.options.ViewIdentifier}-R-${d}-U-${this.pict.getUUID()}`,s.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(s.TransactionHash)),!s)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not exist.`),c(new Error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not exist.`));if(!s.ContentDestinationAddress)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not have a valid destination address.`),c(new Error(`Could not render ${d}`));"object"==typeof o?(l=o,a="Passed in as object"):(a="string"==typeof o?o:"string"==typeof s.DefaultTemplateRecordAddress?s.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,l="string"==typeof a?this.pict.DataProvider.getDataByAddress(a):void 0),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] Renderable[${d}] Destination[${s.ContentDestinationAddress}] TemplateRecordAddress[${a}] renderAsync:`),this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Beginning Asynchronous Render (callback-style)...`);let p=this.fable.newAnticipate();p.anticipate(t=>{this.onBeforeRenderAsync(t,s)}),p.anticipate(i=>{this.pict.parseTemplateByHash(s.TemplateHash,l,(t,o)=>t?(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render (asynchronously) ${d} (param ${e}) because it did not parse the template.`,t),i(t)):(s.Content=o,i()),[this],t,{RootRenderable:"object"==typeof n?n:s})}),p.anticipate(t=>{this.onBeforeProjectAsync(t,s)}),p.anticipate(t=>{this.onProjectAsync(t,s)}),"virtual-assignment"!==s.RenderMethod&&(p.anticipate(t=>{this.onAfterProjectAsync(t,s)}),p.anticipate(t=>{this.onAfterRenderAsync(t,s)})),p.wait(c)}renderDefaultAsync(t){this.renderAsync(t)}basicRender(t,e,i){return this.basicRenderWithScope(this,t,e,i)}basicRenderWithScope(t,e,i,o){let n=this.buildRenderOptions(e,i,o);return n.Valid?(this.assignRenderContent(n.Renderable,n.DestinationAddress,this.pict.parseTemplateByHash(n.Renderable.TemplateHash,n.Record,null,[this],t,{RootRenderable:n.Renderable})),!0):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not perform a basic render of ${n.RenderableHash} because it is not valid.`),!1)}basicRenderAsync(t,e,i,o){return this.basicRenderWithScopeAsync(this,t,e,i,o)}basicRenderWithScopeAsync(t,e,i,o,n){let r="function"==typeof n?n:"function"==typeof o?o:"function"==typeof i?i:"function"==typeof e?e:null;r||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} basicRenderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),r=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} basicRenderAsync Auto Callback Error: ${t}`,t)});const s=this.buildRenderOptions(e,i,o);if(!s.Valid){let t=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not perform a basic render of ${s.RenderableHash} because it is not valid.`;return this.log.error(t),r(new Error(t))}this.pict.parseTemplateByHash(s.Renderable.TemplateHash,s.Record,(t,e)=>t?(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render (asynchronously) ${s.RenderableHash} because it did not parse the template.`,t),r(t)):(this.assignRenderContent(s.Renderable,s.DestinationAddress,e),r()),[this],t,{RootRenderable:s.Renderable})}onProject(t){this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onProject:`),"virtual-assignment"===t.RenderMethod&&this.pict.TransactionTracking.pushToTransactionQueue(t.TransactionHash,{ViewHash:this.Hash,Renderable:t},"Deferred-Post-Content-Assignment"),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Assigning Renderable[${t.RenderableHash}] content length ${t.Content.length} to Destination [${t.ContentDestinationAddress}] using Async render method ${t.RenderMethod}.`),this.pict.ContentAssignment.projectContent(t.RenderMethod,t.ContentDestinationAddress,t.Content,t.TestAddress),this.lastRenderedTimestamp=this.pict.log.getTimeStamp()}onProjectAsync(t,e){return this.onProject(e),t()}onAfterRender(t){if(this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRender:`),t&&t.RootRenderableViewHash===this.Hash){const e=this.pict.TransactionTracking.clearTransactionQueue(t.TransactionHash)||[];for(const i of e){const e=this.pict.views[i.Data.ViewHash];e?(e.onAfterProject(),e.onAfterRender(i.Data.Renderable)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRender: Could not find view for transaction hash ${t.TransactionHash} and ViewHash ${i.Data.ViewHash}.`)}}return!0}onAfterRenderAsync(t,e){this.onAfterRender(e);const i=this.fable.newAnticipate();if(e&&e.RootRenderableViewHash===this.Hash){const t=this.pict.TransactionTracking.clearTransactionQueue(e.TransactionHash)||[];for(const o of t){const t=this.pict.views[o.Data.ViewHash];t?(i.anticipate(t.onAfterProjectAsync.bind(t)),i.anticipate(e=>{t.onAfterRenderAsync(e,o.Data.Renderable)})):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRenderAsync: Could not find view for transaction hash ${e.TransactionHash} and ViewHash ${o.Data.ViewHash}.`)}}return i.wait(t)}onAfterProject(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterProject:`),!0}onAfterProjectAsync(t,e){return t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeSolve:`),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onSolve:`),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeSolve(),this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),!0}solveAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeSolveAsync.bind(this)),e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} solveAsync() complete.`),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterSolve:`),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeMarshalFromView:`),!0}onBeforeMarshalFromViewAsync(t){return this.onBeforeMarshalFromView(),t()}onMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onMarshalFromView:`),!0}onMarshalFromViewAsync(t){return this.onMarshalFromView(),t()}marshalFromView(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeMarshalFromView(),this.onMarshalFromView(),this.onAfterMarshalFromView(),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalFromViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalFromViewAsync.bind(this)),e.anticipate(this.onMarshalFromViewAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} marshalFromViewAsync() complete.`),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterMarshalFromView:`),!0}onAfterMarshalFromViewAsync(t){return this.onAfterMarshalFromView(),t()}onBeforeMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeMarshalToView:`),!0}onBeforeMarshalToViewAsync(t){return this.onBeforeMarshalToView(),t()}onMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onMarshalToView:`),!0}onMarshalToViewAsync(t){return this.onMarshalToView(),t()}marshalToView(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeMarshalToView(),this.onMarshalToView(),this.onAfterMarshalToView(),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalToViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalToViewAsync.bind(this)),e.anticipate(this.onMarshalToViewAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} marshalToViewAsync() complete.`),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterMarshalToView:`),!0}onAfterMarshalToViewAsync(t){return this.onAfterMarshalToView(),t()}get isPictView(){return!0}}},{"../package.json":75,"fable-serviceproviderbase":20}],77:[function(t,e,i){var o,n,r=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(o===setTimeout)return setTimeout(t,0);if((o===s||!o)&&setTimeout)return o=setTimeout,setTimeout(t,0);try{return o(t,0)}catch(e){try{return o.call(null,t,0)}catch(e){return o.call(this,t,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:s}catch(t){o=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var d,c=[],p=!1,h=-1;function u(){p&&d&&(p=!1,d.length?c=d.concat(c):h=-1,c.length&&m())}function m(){if(!p){var t=l(u);p=!0;for(var e=c.length;e;){for(d=c,c=[];++h<e;)d&&d[h].run();h=-1,e=c.length}d=null,p=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];c.push(new f(t,e)),1!==c.length||p||l(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},{}],78:[function(t,e,i){(function(t){(function(){!function(o){var n="object"==typeof i&&i&&!i.nodeType&&i,r="object"==typeof e&&e&&!e.nodeType&&e,s="object"==typeof t&&t;s.global!==s&&s.window!==s&&s.self!==s||(o=s);var a,l,d=2147483647,c=36,p=/^xn--/,h=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,g=String.fromCharCode;function v(t){throw new RangeError(m[t])}function b(t,e){for(var i=t.length,o=[];i--;)o[i]=e(t[i]);return o}function y(t,e){var i=t.split("@"),o="";return i.length>1&&(o=i[0]+"@",t=i[1]),o+b((t=t.replace(u,".")).split("."),e).join(".")}function w(t){for(var e,i,o=[],n=0,r=t.length;n<r;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<r?56320==(64512&(i=t.charCodeAt(n++)))?o.push(((1023&e)<<10)+(1023&i)+65536):(o.push(e),n--):o.push(e);return o}function C(t){return b(t,function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)}).join("")}function x(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:c}function A(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function R(t,e,i){var o=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;o+=c)t=f(t/35);return f(o+36*t/(t+38))}function E(t){var e,i,o,n,r,s,a,l,p,h,u=[],m=t.length,g=0,b=128,y=72;for((i=t.lastIndexOf("-"))<0&&(i=0),o=0;o<i;++o)t.charCodeAt(o)>=128&&v("not-basic"),u.push(t.charCodeAt(o));for(n=i>0?i+1:0;n<m;){for(r=g,s=1,a=c;n>=m&&v("invalid-input"),((l=x(t.charCodeAt(n++)))>=c||l>f((d-g)/s))&&v("overflow"),g+=l*s,!(l<(p=a<=y?1:a>=y+26?26:a-y));a+=c)s>f(d/(h=c-p))&&v("overflow"),s*=h;y=R(g-r,e=u.length+1,0==r),f(g/e)>d-b&&v("overflow"),b+=f(g/e),g%=e,u.splice(g++,0,b)}return C(u)}function D(t){var e,i,o,n,r,s,a,l,p,h,u,m,b,y,C,x=[];for(m=(t=w(t)).length,e=128,i=0,r=72,s=0;s<m;++s)(u=t[s])<128&&x.push(g(u));for(o=n=x.length,n&&x.push("-");o<m;){for(a=d,s=0;s<m;++s)(u=t[s])>=e&&u<a&&(a=u);for(a-e>f((d-i)/(b=o+1))&&v("overflow"),i+=(a-e)*b,e=a,s=0;s<m;++s)if((u=t[s])<e&&++i>d&&v("overflow"),u==e){for(l=i,p=c;!(l<(h=p<=r?1:p>=r+26?26:p-r));p+=c)C=l-h,y=c-h,x.push(g(A(h+C%y,0))),l=f(C/y);x.push(g(A(l,0))),r=R(i,b,o==n),i=0,++o}++i,++e}return x.join("")}if(a={version:"1.4.1",ucs2:{decode:w,encode:C},decode:E,encode:D,toASCII:function(t){return y(t,function(t){return h.test(t)?"xn--"+D(t):t})},toUnicode:function(t){return y(t,function(t){return p.test(t)?E(t.slice(4).toLowerCase()):t})}},n&&r)if(e.exports==n)r.exports=a;else for(l in a)a.hasOwnProperty(l)&&(n[l]=a[l]);else o.punycode=a}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(t,e,i){var o=String.prototype.replace,n=/%20/g,r="RFC1738",s="RFC3986";e.exports={default:s,formatters:{RFC1738:function(t){return o.call(t,n,"+")},RFC3986:function(t){return String(t)}},RFC1738:r,RFC3986:s}},{}],80:[function(t,e,i){var o=t("./stringify"),n=t("./parse"),r=t("./formats");e.exports={formats:r,parse:n,stringify:o}},{"./formats":79,"./parse":81,"./stringify":82}],81:[function(t,e,i){var o=t("./utils"),n=Object.prototype.hasOwnProperty,r=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},l=function(t,e,i){if(t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&i>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");return t},d=function(t,e,i,r){if(t){var s=function(t,e){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(e.depth<=0){if(!e.plainObjects&&n.call(Object.prototype,i)&&!e.allowPrototypes)return;return[i]}var o=/(\[[^[\]]*])/g,r=/(\[[^[\]]*])/.exec(i),s=r?i.slice(0,r.index):i,a=[];if(s){if(!e.plainObjects&&n.call(Object.prototype,s)&&!e.allowPrototypes)return;a[a.length]=s}for(var l=0;null!==(r=o.exec(i))&&l<e.depth;){l+=1;var d=r[1].slice(1,-1);if(!e.plainObjects&&n.call(Object.prototype,d)&&!e.allowPrototypes)return;a[a.length]=r[1]}if(r){if(!0===e.strictDepth)throw new RangeError("Input depth exceeded depth option of "+e.depth+" and strictDepth is true");a[a.length]="["+i.slice(r.index)+"]"}return a}(t,i);if(s)return function(t,e,i,n){var r=0;if(t.length>0&&"[]"===t[t.length-1]){var s=t.slice(0,-1).join("");r=Array.isArray(e)&&e[s]?e[s].length:0}for(var a=n?e:l(e,i,r),d=t.length-1;d>=0;--d){var c,p=t[d];if("[]"===p&&i.parseArrays)c=o.isOverflow(a)?a:i.allowEmptyArrays&&(""===a||i.strictNullHandling&&null===a)?[]:o.combine([],a,i.arrayLimit,i.plainObjects);else{c=i.plainObjects?{__proto__:null}:{};var h="["===p.charAt(0)&&"]"===p.charAt(p.length-1)?p.slice(1,-1):p,u=i.decodeDotInKeys?h.replace(/%2E/g,"."):h,m=parseInt(u,10),f=!isNaN(m)&&p!==u&&String(m)===u&&m>=0&&i.parseArrays;if(i.parseArrays||""!==u)if(f&&m<i.arrayLimit)(c=[])[m]=a;else{if(f&&i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(1===i.arrayLimit?"":"s")+" allowed in an array.");f?(c[m]=a,o.markOverflow(c,m)):"__proto__"!==u&&(c[u]=a)}else c={0:a}}a=c}return a}(s,e,i,r)}};e.exports=function(t,e){var i=function(t){if(!t)return s;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=void 0===t.charset?s.charset:t.charset,i=void 0===t.duplicates?s.duplicates:t.duplicates;if("combine"!==i&&"first"!==i&&"last"!==i)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||s.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:s.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:s.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:s.decoder,delimiter:"string"==typeof t.delimiter||o.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:s.depth,duplicates:i,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:s.strictDepth,strictMerge:"boolean"==typeof t.strictMerge?!!t.strictMerge:s.strictMerge,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(e);if(""===t||null==t)return i.plainObjects?{__proto__:null}:{};for(var c="string"==typeof t?function(t,e){var i={__proto__:null},d=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;d=d.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=e.parameterLimit===1/0?void 0:e.parameterLimit,p=d.split(e.delimiter,e.throwOnLimitExceeded?c+1:c);if(e.throwOnLimitExceeded&&p.length>c)throw new RangeError("Parameter limit exceeded. Only "+c+" parameter"+(1===c?"":"s")+" allowed.");var h,u=-1,m=e.charset;if(e.charsetSentinel)for(h=0;h<p.length;++h)0===p[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[h]?m="utf-8":"utf8=%26%2310003%3B"===p[h]&&(m="iso-8859-1"),u=h,h=p.length);for(h=0;h<p.length;++h)if(h!==u){var f,g,v=p[h],b=v.indexOf("]="),y=-1===b?v.indexOf("="):b+1;if(-1===y?(f=e.decoder(v,s.decoder,m,"key"),g=e.strictNullHandling?null:""):null!==(f=e.decoder(v.slice(0,y),s.decoder,m,"key"))&&(g=o.maybeMap(l(v.slice(y+1),e,r(i[f])?i[f].length:0),function(t){return e.decoder(t,s.decoder,m,"value")})),g&&e.interpretNumericEntities&&"iso-8859-1"===m&&(g=a(String(g))),v.indexOf("[]=")>-1&&(g=r(g)?[g]:g),e.comma&&r(g)&&g.length>e.arrayLimit){if(e.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");g=o.combine([],g,e.arrayLimit,e.plainObjects)}if(null!==f){var w=n.call(i,f);w&&("combine"===e.duplicates||v.indexOf("[]=")>-1)?i[f]=o.combine(i[f],g,e.arrayLimit,e.plainObjects):w&&"last"!==e.duplicates||(i[f]=g)}}return i}(t,i):t,p=i.plainObjects?{__proto__:null}:{},h=Object.keys(c),u=0;u<h.length;++u){var m=h[u],f=d(m,c[m],i,"string"==typeof t);p=o.merge(p,f,i)}return!0===i.allowSparse?p:o.compact(p)}},{"./utils":83}],82:[function(t,e,i){var o=t("side-channel"),n=t("./utils"),r=t("./formats"),s=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},l=Array.isArray,d=Array.prototype.push,c=function(t,e){d.apply(t,l(e)?e:[e])},p=Date.prototype.toISOString,h=r.default,u={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:n.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:r.formatters[h],indices:!1,serializeDate:function(t){return p.call(t)},skipNulls:!1,strictNullHandling:!1},m={},f=function t(e,i,r,s,a,d,p,h,f,g,v,b,y,w,C,x,A,R){for(var E,D=e,S=R,T=0,F=!1;void 0!==(S=S.get(m))&&!F;){var _=S.get(e);if(T+=1,void 0!==_){if(_===T)throw new RangeError("Cyclic object value");F=!0}void 0===S.get(m)&&(T=0)}if("function"==typeof g?D=g(i,D):D instanceof Date?D=y(D):"comma"===r&&l(D)&&(D=n.maybeMap(D,function(t){return t instanceof Date?y(t):t})),null===D){if(d)return f&&!x?f(i,u.encoder,A,"key",w):i;D=""}if("string"==typeof(E=D)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||n.isBuffer(D))return f?[C(x?i:f(i,u.encoder,A,"key",w))+"="+C(f(D,u.encoder,A,"value",w))]:[C(i)+"="+C(String(D))];var P,k=[];if(void 0===D)return k;if("comma"===r&&l(D))x&&f&&(D=n.maybeMap(D,f)),P=[{value:D.length>0?D.join(",")||null:void 0}];else if(l(g))P=g;else{var I=Object.keys(D);P=v?I.sort(v):I}var L=h?String(i).replace(/\./g,"%2E"):String(i),M=s&&l(D)&&1===D.length?L+"[]":L;if(a&&l(D)&&0===D.length)return M+"[]";for(var B=0;B<P.length;++B){var V=P[B],H="object"==typeof V&&V&&void 0!==V.value?V.value:D[V];if(!p||null!==H){var N=b&&h?String(V).replace(/\./g,"%2E"):String(V),j=l(D)?"function"==typeof r?r(M,N):M:M+(b?"."+N:"["+N+"]");R.set(e,T);var O=o();O.set(m,R),c(k,t(H,j,r,s,a,d,p,h,"comma"===r&&x&&l(D)?null:f,g,v,b,y,w,C,x,A,O))}}return k};e.exports=function(t,e){var i,n=t,d=function(t){if(!t)return u;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.encodeDotInKeys&&"boolean"!=typeof t.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||u.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=r.default;if(void 0!==t.format){if(!s.call(r.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var o,n=r.formatters[i],d=u.filter;if(("function"==typeof t.filter||l(t.filter))&&(d=t.filter),o=t.arrayFormat in a?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":u.arrayFormat,"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=void 0===t.allowDots?!0===t.encodeDotInKeys||u.allowDots:!!t.allowDots;return{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:u.addQueryPrefix,allowDots:c,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:u.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:u.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:void 0===t.delimiter?u.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:u.encode,encodeDotInKeys:"boolean"==typeof t.encodeDotInKeys?t.encodeDotInKeys:u.encodeDotInKeys,encoder:"function"==typeof t.encoder?t.encoder:u.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:u.encodeValuesOnly,filter:d,format:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:u.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:u.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:u.strictNullHandling}}(e);"function"==typeof d.filter?n=(0,d.filter)("",n):l(d.filter)&&(i=d.filter);var p=[];if("object"!=typeof n||null===n)return"";var h=a[d.arrayFormat],m="comma"===h&&d.commaRoundTrip;i||(i=Object.keys(n)),d.sort&&i.sort(d.sort);for(var g=o(),v=0;v<i.length;++v){var b=i[v],y=n[b];d.skipNulls&&null===y||c(p,f(y,b,h,m,d.allowEmptyArrays,d.strictNullHandling,d.skipNulls,d.encodeDotInKeys,d.encode?d.encoder:null,d.filter,d.sort,d.allowDots,d.serializeDate,d.format,d.formatter,d.encodeValuesOnly,d.charset,g))}var w=p.join(d.delimiter),C=!0===d.addQueryPrefix?"?":"";return d.charsetSentinel&&("iso-8859-1"===d.charset?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),w.length>0?C+w:""}},{"./formats":79,"./utils":83,"side-channel":109}],83:[function(t,e,i){var o=t("./formats"),n=t("side-channel"),r=Object.prototype.hasOwnProperty,s=Array.isArray,a=n(),l=function(t,e){return a.set(t,e),t},d=function(t){return a.has(t)},c=function(t){return a.get(t)},p=function(t,e){a.set(t,e)},h=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),u=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},o=0;o<t.length;++o)void 0!==t[o]&&(i[o]=t[o]);return i},m=1024;e.exports={arrayToObject:u,assign:function(t,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},t)},combine:function(t,e,i,o){if(d(t)){var n=c(t)+1;return t[n]=e,p(t,n),t}var r=[].concat(t,e);return r.length>i?l(u(r,{plainObjects:o}),r.length-1):r},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],o=0;o<e.length;++o)for(var n=e[o],r=n.obj[n.prop],a=Object.keys(r),l=0;l<a.length;++l){var d=a[l],c=r[d];"object"==typeof c&&null!==c&&-1===i.indexOf(c)&&(e[e.length]={obj:r,prop:d},i[i.length]=c)}return function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(s(i)){for(var o=[],n=0;n<i.length;++n)void 0!==i[n]&&(o[o.length]=i[n]);e.obj[e.prop]=o}}}(e),t},decode:function(t,e,i){var o=t.replace(/\+/g," ");if("iso-8859-1"===i)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(t){return o}},encode:function(t,e,i,n,r){if(0===t.length)return t;var s=t;if("symbol"==typeof t?s=Symbol.prototype.toString.call(t):"string"!=typeof t&&(s=String(t)),"iso-8859-1"===i)return escape(s).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var a="",l=0;l<s.length;l+=m){for(var d=s.length>=m?s.slice(l,l+m):s,c=[],p=0;p<d.length;++p){var u=d.charCodeAt(p);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||r===o.RFC1738&&(40===u||41===u)?c[c.length]=d.charAt(p):u<128?c[c.length]=h[u]:u<2048?c[c.length]=h[192|u>>6]+h[128|63&u]:u<55296||u>=57344?c[c.length]=h[224|u>>12]+h[128|u>>6&63]+h[128|63&u]:(p+=1,u=65536+((1023&u)<<10|1023&d.charCodeAt(p)),c[c.length]=h[240|u>>18]+h[128|u>>12&63]+h[128|u>>6&63]+h[128|63&u])}a+=c.join("")}return a},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isOverflow:d,isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},markOverflow:l,maybeMap:function(t,e){if(s(t)){for(var i=[],o=0;o<t.length;o+=1)i[i.length]=e(t[o]);return i}return e(t)},merge:function t(e,i,o){if(!i)return e;if("object"!=typeof i&&"function"!=typeof i){if(s(e)){var n=e.length;if(o&&"number"==typeof o.arrayLimit&&n>o.arrayLimit)return l(u(e.concat(i),o),n);e[n]=i}else{if(!e||"object"!=typeof e)return[e,i];if(d(e)){var a=c(e)+1;e[a]=i,p(e,a)}else{if(o&&o.strictMerge)return[e,i];(o&&(o.plainObjects||o.allowPrototypes)||!r.call(Object.prototype,i))&&(e[i]=!0)}}return e}if(!e||"object"!=typeof e){if(d(i)){for(var h=Object.keys(i),m=o&&o.plainObjects?{__proto__:null,0:e}:{0:e},f=0;f<h.length;f++){m[parseInt(h[f],10)+1]=i[h[f]]}return l(m,c(i)+1)}var g=[e].concat(i);return o&&"number"==typeof o.arrayLimit&&g.length>o.arrayLimit?l(u(g,o),g.length-1):g}var v=e;return s(e)&&!s(i)&&(v=u(e,o)),s(e)&&s(i)?(i.forEach(function(i,n){if(r.call(e,n)){var s=e[n];s&&"object"==typeof s&&i&&"object"==typeof i?e[n]=t(s,i,o):e[e.length]=i}else e[n]=i}),e):Object.keys(i).reduce(function(e,n){var s=i[n];if(r.call(e,n)?e[n]=t(e[n],s,o):e[n]=s,d(i)&&!d(e)&&l(e,c(i)),d(e)){var a=parseInt(n,10);String(a)===n&&a>=0&&a>c(e)&&p(e,a)}return e},v)}}},{"./formats":79,"side-channel":109}],84:[function(t,e,i){e.exports={Name:"Pict Docuserve",Hash:"Docuserve",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"Docuserve-Pict-Application"}}},{}],85:[function(t,e,i){const o=t("pict-application"),n=t("./providers/Pict-Provider-Docuserve-Documentation.js"),r=t("./views/PictView-Docuserve-Layout.js"),s=t("./views/PictView-Docuserve-TopBar.js"),a=t("./views/PictView-Docuserve-Sidebar.js"),l=t("./views/PictView-Docuserve-Splash.js"),d=t("./views/PictView-Docuserve-Content.js"),c=t("./views/PictView-Docuserve-Search.js");e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.pict.addProvider("Docuserve-Documentation",n.default_configuration,n),this.pict.addView("Docuserve-Layout",r.default_configuration,r),this.pict.addView("Docuserve-TopBar",s.default_configuration,s),this.pict.addView("Docuserve-Sidebar",a.default_configuration,a),this.pict.addView("Docuserve-Splash",l.default_configuration,l),this.pict.addView("Docuserve-Content",d.default_configuration,d),this.pict.addView("Docuserve-Search",c.default_configuration,c)}onAfterInitializeAsync(t){this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"",CatalogURL:"retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve;return e.CoverLoaded&&e.Cover&&e.Cover.Title?document.title=e.Cover.Title.replace(/<[^>]*>/g,""):e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(document.title=e.TopBar.Brand.replace(/<[^>]*>/g,"")),this.pict.views["Docuserve-Layout"].render(),super.onAfterInitializeAsync(t)})}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t||"Home"===t)return void this.showView("Docuserve-Splash");let e=t.split("/");if("search"===e[0]){let t=decodeURIComponent(e.slice(1).join("/"));return void this.navigateToSearch(t)}if("page"===e[0]&&e.length>=2){let t=e.slice(1).join("/");return void this.navigateToPage(t)}if("doc"===e[0]&&e.length>=3){let t=e[1],i=e[2];if(e.length>=4){let o=e.slice(3).join("/");this.navigateToModulePath(t,i,o)}else this.navigateToModule(t,i);return}this.navigateToPage(t)}navigateTo(t){window.location.hash=t}showView(t){t in this.pict.views&&(this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",this.pict.views[t].render(),this.pict.views["Docuserve-Sidebar"].clearModuleNav(),this.pict.views["Docuserve-Sidebar"].renderSidebarGroups())}navigateToModule(t,e){this.navigateToModulePath(t,e,"README.md")}navigateToModulePath(t,e,i){let o=this.pict.providers["Docuserve-Documentation"],n=this.pict.views["Docuserve-Content"],r=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup=t,this.pict.AppData.Docuserve.CurrentModule=e,this.pict.AppData.Docuserve.CurrentPath=i,n.render(),n.showLoading(),r.renderSidebarGroups(),r.renderModuleNav(t,e);let s=o.resolveDocumentURL(t,e,i||"README.md");if(!s)return void n.displayContent(o.getErrorPageHTML(t+"/"+e));let a=i||"README.md";o.fetchDocument(s,(i,r)=>{if(!i)return void n.displayContent(r);let s=t+"/"+e+"/"+a;o.fetchLocalDocument(s,(t,e)=>{n.displayContent(e)},t,e,a)},t,e,a)}navigateToPage(t){let e=this.pict.providers["Docuserve-Documentation"],i=this.pict.views["Docuserve-Content"],o=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath=t,i.render(),i.showLoading(),o.clearModuleNav(),o.renderSidebarGroups();let n=t;n.match(/\.md$/)||(n+=".md"),e.fetchLocalDocument(n,(t,e)=>{i.displayContent(e)})}navigateToSearch(t){let e=this.pict.views["Docuserve-Sidebar"],i=this.pict.views["Docuserve-Search"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",e.clearModuleNav(),e.renderSidebarGroups(),i.render(),i.showSearch(t||"")}},e.exports.default_configuration=t("./Pict-Application-Docuserve-Configuration.json")},{"./Pict-Application-Docuserve-Configuration.json":84,"./providers/Pict-Provider-Docuserve-Documentation.js":86,"./views/PictView-Docuserve-Content.js":87,"./views/PictView-Docuserve-Layout.js":88,"./views/PictView-Docuserve-Search.js":89,"./views/PictView-Docuserve-Sidebar.js":90,"./views/PictView-Docuserve-Splash.js":91,"./views/PictView-Docuserve-TopBar.js":92,"pict-application":44}],86:[function(t,e,i){const o=t("pict-provider"),n=t("lunr"),r=t("pict-section-content").PictContentProvider;e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._Catalog=null,this._ContentCache={},this._ContentProvider=this.pict.addProvider("Pict-Content",r.default_configuration,r)}_createLinkResolver(t,e,i){return(o,n)=>{if(o.match(/^\//)||o.match(/^[^:]+\.md/)){return{href:this.convertDocLink(o,t,e,i)}}let r=this.resolveGitHubURLToRoute(o);return r?{href:r}:null}}_createImageResolver(t){let e="";if(t){let i=t.lastIndexOf("/");i>=0&&(e=t.substring(0,i+1))}return(t,i)=>t.match(/^https?:\/\//)||t.match(/^data:/)||t.match(/^\//)?t:e+t}loadCatalog(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.CatalogURL||"retold-catalog.json",o=()=>{let t=5,i=()=>{if(t--,t<=0){if(this.pict.AppData.Docuserve.SidebarGroups&&!(this.pict.AppData.Docuserve.SidebarGroups.length<1))return e();this.autoDiscoverSidebar(e)}};this.loadCover(i),this.loadSidebar(i),this.loadTopbar(i),this.loadErrorPage(i),this.loadKeywordIndex(i)};fetch(i).then(t=>t.ok?t.json():(this.log.info(`Docuserve: No catalog at [${i}]; running in standalone mode.`),null)).then(t=>{t&&(this._Catalog=t,this.pict.AppData.Docuserve.Catalog=t,this.pict.AppData.Docuserve.CatalogLoaded=!0,this.buildSidebarData(t)),o()}).catch(t=>{this.log.info(`Docuserve: Catalog load error (${t}); continuing in standalone mode.`),o()})}autoDiscoverSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"README.md").then(t=>t.ok?t.text():null).then(t=>{if(t){let e=t.match(/^#+\s+(.+)/m),i=e?e[1].trim():"Docs";this.pict.AppData.Docuserve.SidebarGroups=[{Name:i,Key:"docs",Route:"#/page/README",Modules:[]}],this.pict.AppData.Docuserve.CoverLoaded||(this.pict.AppData.Docuserve.Cover={Title:i,Tagline:"",Description:"",Highlights:[],Actions:[{Text:"Read the Docs",Href:"README.md"}]},this.pict.AppData.Docuserve.CoverLoaded=!0)}else this.log.info("Docuserve: No README.md found; sidebar will be empty.");return e()}).catch(t=>(this.log.info(`Docuserve: README.md discovery failed (${t}).`),e()))}loadCover(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_cover.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.Cover=this.parseCover(t),this.pict.AppData.Docuserve.CoverLoaded=!0,e()):(this.log.info("Docuserve: No _cover.md found; splash will use catalog data."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _cover.md: ${t}`),e()))}parseCover(t){let e={Title:"",Tagline:"",Description:"",Highlights:[],Actions:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let o=i[t].trim();if(!o)continue;let n=o.match(/^#+\s+(.+)/);if(n){e.Title=n[1].trim();continue}let r=o.match(/^>\s*(.*)/);if(r){e.Tagline=r[1].trim();continue}let s=o.match(/^[-*+]\s+(.*)/);if(s){let t=s[1],i=t.match(/^\*\*([^*]+)\*\*\s*[-—:]\s*(.*)/);i?e.Highlights.push({Label:i[1].trim(),Text:i[2].trim()}):e.Highlights.push({Label:"",Text:t.trim()});continue}let a=o.match(/^\[([^\]]+)\]\(([^)]+)\)\s*$/);a?e.Actions.push({Text:a[1].trim(),Href:a[2].trim()}):e.Description?e.Description+=" "+o:e.Description=o}return e}loadSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_sidebar.md").then(t=>t.ok?t.text():null).then(t=>{if(!t)return this.log.info("Docuserve: No _sidebar.md found; sidebar will use catalog data."),e();let i=this.parseSidebarMarkdown(t);return i&&i.length>0&&(this.pict.AppData.Docuserve.SidebarGroups=i,this.pict.AppData.Docuserve.SidebarLoaded=!0),e()}).catch(t=>(this.log.warn(`Docuserve: Error loading _sidebar.md: ${t}`),e()))}loadTopbar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_topbar.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.TopBar=this.parseTopbar(t),this.pict.AppData.Docuserve.TopBarLoaded=!0,e()):(this.log.info("Docuserve: No _topbar.md found; top bar will use defaults."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _topbar.md: ${t}`),e()))}parseTopbar(t){let e={Brand:"",NavLinks:[],ExternalLinks:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let o=i[t].trim();if(!o)continue;let n=o.match(/^#+\s+(.+)/);if(n){e.Brand=n[1].trim();continue}let r=o.match(/^[-*+]\s+(.*)/);if(r){let t=r[1].trim().match(/^\[([^\]]+)\]\(([^)]+)\)/);if(t){let i=t[1].trim(),o=t[2].trim();if(o.match(/^https?:\/\//))e.ExternalLinks.push({Text:i,Href:o});else{let t=this.convertSidebarLink(o);e.NavLinks.push({Text:i,Href:t})}}continue}}return e}loadErrorPage(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"errorpage.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.ErrorPageHTML=this._ContentProvider.parseMarkdown(t),this.pict.AppData.Docuserve.ErrorPageLoaded=!0,e()):(this.log.info("Docuserve: No errorpage.md found; errors will use default page."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading errorpage.md: ${t}`),e()))}loadKeywordIndex(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"retold-keyword-index.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!t.LunrIndex||!t.Documents)return this.log.info("Docuserve: No keyword index found; search will be unavailable."),e();try{this._LunrIndex=n.Index.load(t.LunrIndex),this._KeywordDocuments=t.Documents,this.pict.AppData.Docuserve.KeywordIndexLoaded=!0,this.pict.AppData.Docuserve.KeywordDocumentCount=t.DocumentCount||0,this.log.info(`Docuserve: Keyword index loaded (${t.DocumentCount||0} documents).`)}catch(t){this.log.warn(`Docuserve: Error hydrating lunr index: ${t}`)}return e()}).catch(t=>(this.log.warn(`Docuserve: Error loading keyword index: ${t}`),e()))}isModuleInCatalog(t,e){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let i=0;i<this._Catalog.Groups.length;i++){let o=this._Catalog.Groups[i];if(o.Key===t)for(let t=0;t<o.Modules.length;t++){if(o.Modules[t].Name===e)return!0}}return!1}findModuleGroupKey(t){if(!this._Catalog||!this._Catalog.Groups)return null;for(let e=0;e<this._Catalog.Groups.length;e++){let i=this._Catalog.Groups[e];for(let e=0;e<i.Modules.length;e++)if(i.Modules[e].Name===t)return i.Key}return null}isGroupInCatalog(t){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let e=0;e<this._Catalog.Groups.length;e++)if(this._Catalog.Groups[e].Key===t)return!0;return!1}search(t){if(!(this._LunrIndex&&this._KeywordDocuments&&t&&t.trim()))return[];let e=[];try{let i=this._LunrIndex.search(t);for(let t=0;t<i.length;t++){let o=i[t].ref,n=i[t].score,r=this._KeywordDocuments[o];if(!r)continue;let s=o.split("/"),a="";if(s.length>=2){let t=s[0],e=s[1];a=this.isModuleInCatalog(t,e)?"#/doc/"+o:"#/page/"+o}e.push({Key:o,Title:r.Title||o,Group:r.Group||"",Module:r.Module||"",DocPath:r.DocPath||"",Score:n,Route:a})}}catch(t){this.log.warn(`Docuserve: Search error: ${t}`)}return e}getErrorPageHTML(t){let e=t||"unknown";return this.pict.AppData.Docuserve.ErrorPageLoaded&&this.pict.AppData.Docuserve.ErrorPageHTML?this.pict.AppData.Docuserve.ErrorPageHTML.replace(/\{\{path\}\}/g,this._ContentProvider.escapeHTML(e)):'<div class="docuserve-not-found"><h2>Page Not Found</h2><p>The document <code>'+this._ContentProvider.escapeHTML(e)+'</code> could not be loaded.</p><p><a href="#/Home">Return to the home page</a></p></div>'}parseSidebarMarkdown(t){let e=[],i=null,o=t.split("\n");for(let t=0;t<o.length;t++){let n=o[t];if(!n.trim())continue;let r=n.match(/^(\s*)/),s=r?r[1].length:0,a=n.trim().match(/^[-*+]\s+(.*)/);if(!a)continue;let l=a[1].trim(),d=l.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(s<2)if(d){let t=d[1].trim(),o=d[2].trim();i={Name:t,Key:this.deriveGroupKey(t,o),Route:this.convertSidebarLink(o),Modules:[]},e.push(i)}else{let t=l,o=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");i={Name:t,Key:o,Route:"",Modules:[]},e.push(i)}else if(i)if(d){let t=d[1].trim(),e=d[2].trim(),o=this.convertSidebarLink(e);i.Modules.push({Name:t,HasDocs:!0,Group:i.Key,Route:o})}else i.Modules.push({Name:l,HasDocs:!1,Group:i.Key,Route:""})}return e}convertSidebarLink(t){if(!t)return"";if("/"===t)return"#/Home";if(t.match(/^#[^/]/)){let t=this.pict.AppData.Docuserve.SidebarGroups;if(t)for(let e=0;e<t.length;e++){let i=t[e].Modules;if(i)for(let t=0;t<i.length;t++)if(i[t].HasDocs&&i[t].Route&&"#/Home"!==i[t].Route)return i[t].Route;if(t[e].Route&&"#/Home"!==t[e].Route)return t[e].Route}return"#/Home"}let e=t.replace(/^\//,"").replace(/\/$/,"");if(!e)return"#/Home";let i=e.split("/");if(i.length>=2){if(this.isGroupInCatalog(i[0])&&this.isModuleInCatalog(i[0],i[1]))return"#/doc/"+e;let t=this.findModuleGroupKey(i[1]);if(t){let e=i.slice(2).join("/");return e?"#/doc/"+t+"/"+i[1]+"/"+e:"#/doc/"+t+"/"+i[1]}}return e.match(/\.md$/)?"#/page/"+e.replace(/\.md$/,""):"#/page/"+e}deriveGroupKey(t,e){if(e&&"/"!==e){let t=e.replace(/^\//,"").replace(/\.md$/,"").replace(/\/$/,"");if(t&&!t.includes("/"))return t.toLowerCase()}return t.split(/[\s—\-:]+/)[0].toLowerCase().replace(/[^a-z0-9]/g,"")}buildSidebarData(t){let e=[];for(let i=0;i<t.Groups.length;i++){let o=t.Groups[i],n={Name:o.Name,Key:o.Key,Description:o.Description,Modules:[]};for(let t=0;t<o.Modules.length;t++){let e=o.Modules[t];n.Modules.push({Name:e.Name,HasDocs:e.HasDocs,Group:o.Key,Route:"#/doc/"+o.Key+"/"+e.Name})}e.push(n)}this.pict.AppData.Docuserve.SidebarGroups=e}resolveDocumentURL(t,e,i){if(!this._Catalog)return null;let o=this._Catalog.GitHubOrg||"stevenvelozo",n=this._Catalog.DefaultBranch||"master";for(let r=0;r<this._Catalog.Groups.length;r++){let s=this._Catalog.Groups[r];if(s.Key===t)for(let t=0;t<s.Modules.length;t++){let r=s.Modules[t];if(r.Name!==e)continue;let a=r.Branch||n,l=i||"README.md";return"https://raw.githubusercontent.com/"+o+"/"+r.Repo+"/"+a+"/docs/"+l}}return null}resolveGitHubURLToRoute(t){if(!this._Catalog||!this._Catalog.Groups||!t)return null;let e=t.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)/);if(!e)return null;let i=e[1],o=e[2];if(i!==this._Catalog.GitHubOrg)return null;for(let t=0;t<this._Catalog.Groups.length;t++){let e=this._Catalog.Groups[t];for(let t=0;t<e.Modules.length;t++){let i=e.Modules[t];if(i.Repo===o)return"#/doc/"+e.Key+"/"+i.Name}}return null}resolveGitHubPagesURL(t,e){if(!this._Catalog||!this._Catalog.Groups)return null;let i=this._Catalog.GitHubOrg||"stevenvelozo";for(let o=0;o<this._Catalog.Groups.length;o++){let n=this._Catalog.Groups[o];if(n.Key===t)for(let t=0;t<n.Modules.length;t++){let o=n.Modules[t];if(o.Name===e)return o.HasDocs?"https://"+i+".github.io/"+o.Repo+"/":null}}return null}getModuleSidebar(t,e){if(!this._Catalog)return null;for(let i=0;i<this._Catalog.Groups.length;i++){let o=this._Catalog.Groups[i];if(o.Key===t)for(let t=0;t<o.Modules.length;t++){let i=o.Modules[t];if(i.Name===e)return i.Sidebar||null}}return null}fetchDocument(t,e,i,o,n){let r="function"==typeof e?e:()=>{};return t?this._ContentCache[t]?r(null,this._ContentCache[t]):void fetch(t).then(t=>t.ok?t.text():null).then(e=>{if(!e)return r("Document not found",this.getErrorPageHTML(t));let s=this._ContentProvider.parseMarkdown(e,this._createLinkResolver(i,o,n),this._createImageResolver(t));return this._ContentCache[t]=s,r(null,s)}).catch(e=>(this.log.warn(`Docuserve: Error fetching document [${t}]: ${e}`),r(e,this.getErrorPageHTML(t)))):r("No URL provided","")}fetchLocalDocument(t,e,i,o,n){let r=(this.pict.AppData.Docuserve.DocsBaseURL||"")+t;this.fetchDocument(r,e,i,o,n)}convertDocLink(t,e,i,o){let n=t.replace(/^\.\//,"");n=n.replace(/^\//,"");let r=n.split("/");if(r.length>=2&&this.isGroupInCatalog(r[0])&&this.isModuleInCatalog(r[0],r[1]))return"#/doc/"+n;if(e&&i){let t="";if(o){let e=o.split("/");e.length>1&&(e.pop(),t=e.join("/")+"/")}return"#/doc/"+e+"/"+i+"/"+t+n}if(n.match(/\.md$/)){return"#/page/"+n.replace(/\.md$/,"")}return"#/page/"+n}},e.exports.default_configuration={ProviderIdentifier:"Docuserve-Documentation",AutoInitialize:!0,AutoInitializeOrdinal:0}},{lunr:32,"pict-provider":46,"pict-section-content":50}],87:[function(t,e,i){const o=t("pict-section-content"),n={ViewIdentifier:"Docuserve-Content",DefaultRenderable:"Docuserve-Content-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid #2E7D74;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t\t.docuserve-module-external-link {\n\t\t\tpadding: 0.5em 0;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-align: right;\n\t\t}\n\t\t.docuserve-module-external-link a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.docuserve-module-external-link a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-not-found {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.docuserve-not-found h2 {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.5em;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.docuserve-not-found code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Content-Template",Template:'\n<div class="pict-content" id="Docuserve-Content-Body">\n\t<div class="pict-content-loading">Loading documentation...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Content-Display",TemplateHash:"Docuserve-Content-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}displayContent(t){let e=t,i=this.pict.AppData.Docuserve.CurrentGroup,o=this.pict.AppData.Docuserve.CurrentModule;if(i&&o){let t=this.pict.providers["Docuserve-Documentation"];if(t){let n=t.resolveGitHubPagesURL(i,o);n&&(e='<div class="docuserve-module-external-link"><a href="'+n+'" target="_blank" rel="noopener">↗ View '+o+" documentation site</a></div>"+e)}}super.displayContent(e,"Docuserve-Content-Body")}showLoading(){super.showLoading("Loading documentation...","Docuserve-Content-Body")}},e.exports.default_configuration=n},{"pict-section-content":50}],88:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-Layout",DefaultRenderable:"Docuserve-Layout-Shell",DefaultDestinationAddress:"#Docuserve-Application-Container",AutoRender:!1,CSS:"\n\t\t#Docuserve-Application-Container {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t#Docuserve-TopBar-Container {\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.docuserve-body {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#Docuserve-Sidebar-Container {\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 280px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground-color: #F5F0E8;\n\t\t}\n\t\t#Docuserve-Content-Container {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow-y: auto;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Layout-Shell-Template",Template:'\n<div id="Docuserve-TopBar-Container"></div>\n<div class="docuserve-body">\n\t<div id="Docuserve-Sidebar-Container"></div>\n\t<div id="Docuserve-Content-Container"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Layout-Shell",TemplateHash:"Docuserve-Layout-Shell-Template",DestinationAddress:"#Docuserve-Application-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,o){if(this.pict.views["Docuserve-TopBar"].render(),this.pict.views["Docuserve-Sidebar"].render(),this.pict.views["Docuserve-Splash"].render(),this.pict.CSSMap.injectCSS(),this.pict.PictApplication.resolveHash(),!this._HashChangeListenerBound){this._HashChangeListenerBound=!0;let t=this;window.addEventListener("hashchange",()=>{t.pict.PictApplication.resolveHash()})}return super.onAfterRender(t,e,i,o)}},e.exports.default_configuration=n},{"pict-view":76}],89:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-Search",DefaultRenderable:"Docuserve-Search-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-search {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.docuserve-search-header {\n\t\t\tmargin-bottom: 1.5em;\n\t\t}\n\t\t.docuserve-search-header h1 {\n\t\t\tfont-size: 1.75em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin: 0 0 0.75em 0;\n\t\t}\n\t\t.docuserve-search-input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.75em 1em;\n\t\t\tfont-size: 1.1em;\n\t\t\tborder: 2px solid #D4CCBE;\n\t\t\tborder-radius: 6px;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t\ttransition: border-color 0.15s;\n\t\t}\n\t\t.docuserve-search-input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-search-status {\n\t\t\tmargin-top: 0.75em;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.docuserve-search-results {\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.docuserve-search-result {\n\t\t\tdisplay: block;\n\t\t\tpadding: 1em 1.25em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder: 1px solid #EAE3D8;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: inherit;\n\t\t\ttransition: border-color 0.15s, box-shadow 0.15s;\n\t\t}\n\t\t.docuserve-search-result:hover {\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 2px 8px rgba(46, 125, 116, 0.1);\n\t\t}\n\t\t.docuserve-search-result-title {\n\t\t\tfont-size: 1.05em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #2E7D74;\n\t\t\tmargin-bottom: 0.25em;\n\t\t}\n\t\t.docuserve-search-result-breadcrumb {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 0.2em;\n\t\t}\n\t\t.docuserve-search-result-path {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #A39889;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.docuserve-search-empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Search-Template",Template:'\n<div class="docuserve-search">\n\t<div class="docuserve-search-header">\n\t\t<h1>Search Documentation</h1>\n\t\t<input type="text" class="docuserve-search-input" id="Docuserve-Search-Input" placeholder="Search across all modules...">\n\t\t<div id="Docuserve-Search-Status" class="docuserve-search-status"></div>\n\t</div>\n\t<div id="Docuserve-Search-Results" class="docuserve-search-results"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Search-Display",TemplateHash:"Docuserve-Search-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._SearchDebounceTimer=null}onAfterRender(t,e,i,o){let n=document.getElementById("Docuserve-Search-Input");return n&&n.addEventListener("input",()=>{this._SearchDebounceTimer&&clearTimeout(this._SearchDebounceTimer),this._SearchDebounceTimer=setTimeout(()=>{this.performSearch(n.value)},250)}),super.onAfterRender(t,e,i,o)}showSearch(t){let e=document.getElementById("Docuserve-Search-Input");if(e&&(e.value=t||"",e.focus()),t&&t.trim())this.performSearch(t);else{let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let i=document.getElementById("Docuserve-Content-Container");i&&(i.scrollTop=0)}performSearch(t){if(!t||!t.trim()){let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let e=this.pict.providers["Docuserve-Documentation"].search(t);if(0===e.length)return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status","No results found for '"+this.escapeHTML(t)+"'."),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","");this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e.length+" result"+(1!==e.length?"s":"")+" for '"+this.escapeHTML(t)+"'");let i="";for(let t=0;t<e.length;t++){let o=e[t],n="";o.Group&&o.Module&&(n=o.Group+" › "+o.Module),i+='<a class="docuserve-search-result" href="'+o.Route+'">',i+='<div class="docuserve-search-result-title">'+this.escapeHTML(o.Title)+"</div>",n&&(i+='<div class="docuserve-search-result-breadcrumb">'+n+"</div>"),o.DocPath&&(i+='<div class="docuserve-search-result-path">'+this.escapeHTML(o.DocPath)+"</div>"),i+="</a>"}this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results",i)}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration=n},{"pict-view":76}],90:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-Sidebar",DefaultRenderable:"Docuserve-Sidebar-Content",DefaultDestinationAddress:"#Docuserve-Sidebar-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-sidebar {\n\t\t\tborder-right: 1px solid #DDD6CA;\n\t\t\tpadding: 1em 0;\n\t\t\tpadding-top: 0;\n\t\t\tmin-height: 100%;\n\t\t\tposition: relative;\n\t\t}\n\t\t.docuserve-sidebar-header {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: flex-end;\n\t\t\tpadding: 0.4em 0.5em 0;\n\t\t}\n\t\t.docuserve-sidebar-close {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.2em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.2em 0.4em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-sidebar-close:hover {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search {\n\t\t\tpadding: 0 1em 1em 1em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tborder: 1px solid #D4CCBE;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.85em;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.docuserve-sidebar-search input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-results {\n\t\t\tmargin-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-results a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tcolor: #423D37;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\tborder-radius: 3px;\n\t\t\ttransition: background-color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-result-title {\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover .docuserve-sidebar-search-result-title {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-result-meta {\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.docuserve-sidebar-search-all {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\tborder-top: 1px solid #EAE3D8;\n\t\t\tmargin-top: 0.25em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-all:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-sidebar-home {\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t}\n\t\t.docuserve-sidebar-home a {\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.docuserve-sidebar-home a:hover {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-group {\n\t\t\tmargin-top: 0.25em;\n\t\t}\n\t\t.docuserve-sidebar-group-title {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t}\n\t\t.docuserve-sidebar-group-title:hover {\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground-color: #EAE3D8;\n\t\t}\n\t\ta.docuserve-sidebar-group-title.active {\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground-color: #E0EDEB;\n\t\t}\n\t\t.docuserve-sidebar-modules {\n\t\t\tlist-style: none;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules li {\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-modules a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-modules a.active {\n\t\t\tcolor: #2E7D74;\n\t\t\tfont-weight: 600;\n\t\t\tbackground-color: #E0EDEB;\n\t\t}\n\t\t.docuserve-sidebar-modules .no-docs {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: #A39889;\n\t\t\tfont-size: 0.85em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav {\n\t\t\tborder-top: 1px solid #EAE3D8;\n\t\t\tmargin-top: 0.5em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav-section {\n\t\t\tpadding: 0.4em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.02em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.25em 1.25em 0.25em 2.25em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Sidebar-Template",Template:'\n<div class="docuserve-sidebar">\n\t<div class="docuserve-sidebar-header">\n\t\t<button class="docuserve-sidebar-close" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">×</button>\n\t</div>\n\t<div id="Docuserve-Sidebar-Search" class="docuserve-sidebar-search" style="display:none;">\n\t\t<input type="text" placeholder="Search docs..." id="Docuserve-Sidebar-Search-Input">\n\t\t<div id="Docuserve-Sidebar-Search-Results" class="docuserve-sidebar-search-results"></div>\n\t</div>\n\t<div class="docuserve-sidebar-home">\n\t\t<a onclick="{~P~}.PictApplication.navigateTo(\'/Home\')">Home</a>\n\t</div>\n\t<div id="Docuserve-Sidebar-Groups"></div>\n\t<div id="Docuserve-Sidebar-ModuleNav"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Sidebar-Content",TemplateHash:"Docuserve-Sidebar-Template",DestinationAddress:"#Docuserve-Sidebar-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._SidebarSearchDebounceTimer=null}onAfterRender(t,e,i,o){this.renderSidebarGroups();let n=document.getElementById("Docuserve-Sidebar-Search");if(n&&this.pict.AppData.Docuserve.KeywordIndexLoaded){n.style.display="";let t=document.getElementById("Docuserve-Sidebar-Search-Input");t&&t.addEventListener("input",()=>{this._SidebarSearchDebounceTimer&&clearTimeout(this._SidebarSearchDebounceTimer),this._SidebarSearchDebounceTimer=setTimeout(()=>{this.performSidebarSearch(t.value)},250)})}return super.onAfterRender(t,e,i,o)}renderSidebarGroups(){let t=this.pict.AppData.Docuserve.SidebarGroups;if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups","");let e="";for(let i=0;i<t.length;i++){let o=t[i];e+='<div class="docuserve-sidebar-group">';let n=o.Route||"";if(!n)for(let t=0;t<o.Modules.length;t++)if(o.Modules[t].HasDocs&&o.Modules[t].Route){n=o.Modules[t].Route;break}if(n){let t="",i=window.location.hash||"";this.pict.AppData.Docuserve.CurrentGroup!==o.Key&&i!==n||(t=" active"),e+='<a class="docuserve-sidebar-group-title'+t+'" href="'+n+'">'+this.escapeHTML(o.Name)+"</a>"}else e+='<div class="docuserve-sidebar-group-title">'+this.escapeHTML(o.Name)+"</div>";e+='<ul class="docuserve-sidebar-modules">';for(let t=0;t<o.Modules.length;t++){let i=o.Modules[t];if(i.HasDocs){let t="";this.pict.AppData.Docuserve.CurrentGroup===i.Group&&this.pict.AppData.Docuserve.CurrentModule===i.Name&&(t=' class="active"'),e+="<li><a"+t+' href="'+i.Route+'">'+this.escapeHTML(i.Name)+"</a></li>"}else e+='<li><span class="no-docs">'+this.escapeHTML(i.Name)+"</span></li>"}e+="</ul>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups",e)}renderModuleNav(t,e){let i=this.pict.providers["Docuserve-Documentation"];if(!i)return;let o=i.getModuleSidebar(t,e);if(!o)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","");let n="#/doc/"+t+"/"+e+"/",r='<div class="docuserve-sidebar-module-nav">';for(let t=0;t<o.length;t++){let e=o[t];if(e.Children){r+='<div class="docuserve-sidebar-module-nav-section">'+this.escapeHTML(e.Title)+"</div>";for(let t=0;t<e.Children.length;t++){let i=e.Children[t];i.Path&&(r+='<a href="'+n+i.Path+'">'+this.escapeHTML(i.Title)+"</a>")}}else e.Path&&(r+='<a href="'+n+e.Path+'">'+this.escapeHTML(e.Title)+"</a>")}r+="</div>",this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav",r)}performSidebarSearch(t){let e=document.getElementById("Docuserve-Sidebar-Search-Results");if(!e)return;if(!t||!t.trim())return void(e.innerHTML="");let i=this.pict.providers["Docuserve-Documentation"].search(t);if(0===i.length)return void(e.innerHTML='<div style="padding: 0.4em 0.5em; font-size: 0.82em; color: #8A7F72;">No results found.</div>');let o="";for(let t=0;t<i.length&&t<8;t++){let e=i[t],n="";e.Group&&e.Module&&(n=e.Group+" / "+e.Module),o+='<a href="'+e.Route+'">',o+='<div class="docuserve-sidebar-search-result-title">'+this.escapeHTML(e.Title)+"</div>",n&&(o+='<div class="docuserve-sidebar-search-result-meta">'+this.escapeHTML(n)+"</div>"),o+="</a>"}if(i.length>8){o+='<a class="docuserve-sidebar-search-all" href="#/search/'+encodeURIComponent(t)+'">See all '+i.length+" results</a>"}e.innerHTML=o}toggleSidebar(){this.pict.AppData.Docuserve.SidebarVisible=!this.pict.AppData.Docuserve.SidebarVisible;let t=document.getElementById("Docuserve-Sidebar-Container"),e=document.getElementById("Docuserve-TopBar-Toggle");this.pict.AppData.Docuserve.SidebarVisible?(t&&(t.style.display=""),e&&(e.style.display="none")):(t&&(t.style.display="none"),e&&(e.style.display="inline-block"))}clearModuleNav(){this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","")}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=n},{"pict-view":76}],91:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-Splash",DefaultRenderable:"Docuserve-Splash-Content",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-splash {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: calc(100vh - 56px);\n\t\t\tpadding: 3em 2em;\n\t\t\ttext-align: center;\n\t\t\tbackground: linear-gradient(135deg, #F5F0E8 0%, #E4EFED 100%);\n\t\t}\n\t\t.docuserve-splash h1 {\n\t\t\tfont-size: 3em;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin: 0 0 0.25em 0;\n\t\t}\n\t\t.docuserve-splash h1 small {\n\t\t\tfont-size: 0.4em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #7A7568;\n\t\t\tvertical-align: middle;\n\t\t\tmargin-left: 0.15em;\n\t\t}\n\t\t.docuserve-splash-tagline {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #7A7568;\n\t\t\tmargin-bottom: 1.5em;\n\t\t\tfont-style: italic;\n\t\t}\n\t\t.docuserve-splash-description {\n\t\t\tfont-size: 1em;\n\t\t\tcolor: #5E5549;\n\t\t\tmax-width: 600px;\n\t\t\tline-height: 1.7;\n\t\t\tmargin-bottom: 2em;\n\t\t}\n\t\t.docuserve-splash-highlights {\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\t\tgap: 1.25em;\n\t\t\tmax-width: 900px;\n\t\t\twidth: 100%;\n\t\t\tmargin-bottom: 2.5em;\n\t\t}\n\t\t.docuserve-splash-highlight-card {\n\t\t\tbackground: #fff;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 1.25em;\n\t\t\ttext-align: left;\n\t\t\ttransition: box-shadow 0.2s, border-color 0.2s;\n\t\t}\n\t\t.docuserve-splash-highlight-card:hover {\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-splash-highlight-card h3 {\n\t\t\tmargin: 0 0 0.5em 0;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.docuserve-splash-highlight-card p {\n\t\t\tmargin: 0;\n\t\t\tcolor: #7A7568;\n\t\t\tfont-size: 0.85em;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.docuserve-splash-actions {\n\t\t\tdisplay: flex;\n\t\t\tgap: 1em;\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.docuserve-splash-actions a {\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.7em 1.5em;\n\t\t\tborder-radius: 6px;\n\t\t\tfont-size: 0.95em;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-splash-actions .primary {\n\t\t\tbackground-color: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-splash-actions .primary:hover {\n\t\t\tbackground-color: #256861;\n\t\t}\n\t\t.docuserve-splash-actions .secondary {\n\t\t\tbackground-color: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\tborder: 2px solid #2E7D74;\n\t\t}\n\t\t.docuserve-splash-actions .secondary:hover {\n\t\t\tborder-color: #256861;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Splash-Template",Template:'\n<div class="docuserve-splash">\n\t<h1 id="Docuserve-Splash-Title"></h1>\n\t<div class="docuserve-splash-tagline" id="Docuserve-Splash-Tagline"></div>\n\t<div class="docuserve-splash-description" id="Docuserve-Splash-Description"></div>\n\t<div class="docuserve-splash-highlights" id="Docuserve-Splash-Highlights"></div>\n\t<div class="docuserve-splash-actions" id="Docuserve-Splash-Actions"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Splash-Content",TemplateHash:"Docuserve-Splash-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,o){let n=this.pict.AppData.Docuserve;return n.CoverLoaded&&n.Cover?this.renderFromCover(n.Cover):this.renderFromCatalog(n),super.onAfterRender(t,e,i,o)}renderFromCover(t){this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.sanitizeTitle(t.Title)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(t.Tagline)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description",this.escapeHTML(t.Description));let e="";for(let i=0;i<t.Highlights.length;i++){let o=t.Highlights[i];e+='<div class="docuserve-splash-highlight-card">',o.Label&&(e+="<h3>"+this.escapeHTML(o.Label)+"</h3>"),e+="<p>"+this.escapeHTML(o.Text)+"</p>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",e);let i="",o=this.pict.providers["Docuserve-Documentation"];for(let e=0;e<t.Actions.length;e++){let n=t.Actions[e],r=0===e?"primary":"secondary",s=n.Href;if(s.match(/^https?:\/\//))i+='<a class="'+r+'" href="'+this.escapeHTML(s)+'" target="_blank" rel="noopener">'+this.escapeHTML(n.Text)+"</a>";else{let t=o.convertSidebarLink(s);i+='<a class="'+r+'" href="'+this.escapeHTML(t)+'">'+this.escapeHTML(n.Text)+"</a>"}}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions",i)}renderFromCatalog(t){let e="Documentation",i="";t.CatalogLoaded&&t.Catalog&&t.Catalog.Name?e=t.Catalog.Name:t.TopBarLoaded&&t.TopBar&&t.TopBar.Brand?e=t.TopBar.Brand:"undefined"!=typeof document&&document.title&&(e=document.title),t.CatalogLoaded&&t.Catalog&&t.Catalog.Description&&(i=t.Catalog.Description),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.escapeHTML(e)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(i)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description","");let o="",n=t.SidebarGroups||[];for(let t=0;t<n.length;t++){let e=n[t];if(!e.Modules||e.Modules.length<1)continue;let i=e.Description||e.Modules.length+" modules";o+='<div class="docuserve-splash-highlight-card">',o+="<h3>"+this.escapeHTML(e.Name)+"</h3>",o+="<p>"+this.escapeHTML(i)+"</p>",o+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",o),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions","")}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/<small>/gi,"<small>").replace(/<\/small>/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=n},{"pict-view":76}],92:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Docuserve-TopBar",DefaultRenderable:"Docuserve-TopBar-Content",DefaultDestinationAddress:"#Docuserve-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-topbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tbackground-color: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 0 1.5em;\n\t\t\theight: 56px;\n\t\t\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 100;\n\t\t}\n\t\t.docuserve-topbar-brand {\n\t\t\tfont-size: 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.02em;\n\t\t\tcolor: #E8E0D4;\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-brand small {\n\t\t\tfont-size: 0.65em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-left: 0.2em;\n\t\t}\n\t\t.docuserve-topbar-brand:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-nav {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.25em;\n\t\t}\n\t\t.docuserve-topbar-nav a {\n\t\t\tcolor: #B5AA9A;\n\t\t\ttext-decoration: none;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-nav a:hover {\n\t\t\tbackground-color: #524438;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-links {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t}\n\t\t.docuserve-topbar-links a {\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tborder-radius: 4px;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t}\n\t\t.docuserve-topbar-links a:hover {\n\t\t\tbackground-color: #524438;\n\t\t\tcolor: #E8E0D4;\n\t\t}\n\t\t.docuserve-topbar-toggle {\n\t\t\tdisplay: none;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #B5AA9A;\n\t\t\tfont-size: 1.3em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.3em 0.5em;\n\t\t\tmargin-left: 0.5em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-topbar-toggle:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-right {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-TopBar-Template",Template:'\n<div class="docuserve-topbar">\n\t<a id="Docuserve-TopBar-Brand" class="docuserve-topbar-brand" href="#/Home"></a>\n\t<div id="Docuserve-TopBar-Nav" class="docuserve-topbar-nav"></div>\n\t<div class="docuserve-topbar-right">\n\t\t<div id="Docuserve-TopBar-Links" class="docuserve-topbar-links"></div>\n\t\t<button id="Docuserve-TopBar-Toggle" class="docuserve-topbar-toggle" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">☰</button>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-TopBar-Content",TemplateHash:"Docuserve-TopBar-Template",DestinationAddress:"#Docuserve-TopBar-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,o){return this.renderTopBarContent(),super.onAfterRender(t,e,i,o)}renderTopBarContent(){let t=this.pict.AppData.Docuserve,e=document.getElementById("Docuserve-TopBar-Brand"),i=document.getElementById("Docuserve-TopBar-Nav"),o=document.getElementById("Docuserve-TopBar-Links");if(e&&i&&o)if(t.TopBarLoaded&&t.TopBar){let n=t.TopBar;e.innerHTML=this.sanitizeTitle(n.Brand||"Documentation");let r='<a href="#/Home">Home</a>';for(let t=0;t<n.NavLinks.length;t++){let e=n.NavLinks[t];r+='<a href="'+e.Href+'">'+this.escapeHTML(e.Text)+"</a>"}i.innerHTML=r;let s="";t.KeywordIndexLoaded&&(s+='<a href="#/search/">Search</a>');for(let t=0;t<n.ExternalLinks.length;t++){let e=n.ExternalLinks[t];s+='<a href="'+this.escapeHTML(e.Href)+'" target="_blank" rel="noopener">'+this.escapeHTML(e.Text)+"</a>"}o.innerHTML=s}else{let n="Documentation";t.CoverLoaded&&t.Cover&&t.Cover.Title?n=t.Cover.Title:t.CatalogLoaded&&t.Catalog&&t.Catalog.Name&&(n=t.Catalog.Name),e.innerHTML=this.sanitizeTitle(n),i.innerHTML='<a href="#/Home">Home</a>',o.innerHTML=t.KeywordIndexLoaded?'<a href="#/search/">Search</a>':""}}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/<small>/gi,"<small>").replace(/<\/small>/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration=n},{"pict-view":76}],93:[function(t,e,i){e.exports={Name:"Retold Content Editor",Hash:"ContentEditor",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentEditor-Pict-Application"}}},{}],94:[function(t,e,i){const o=t("pict-application"),n=t("pict-section-filebrowser"),r=t("./providers/Pict-Provider-ContentEditor.js"),s=t("./views/PictView-Editor-Layout.js"),a=t("./views/PictView-Editor-TopBar.js"),l=t("./views/PictView-Editor-MarkdownEditor.js"),d=t("./views/PictView-Editor-CodeEditor.js"),c=t("./views/PictView-Editor-SettingsPanel.js"),p=t("./views/PictView-Editor-MarkdownReference.js"),h=t("./views/PictView-Editor-Topics.js");e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.pict.addProvider("ContentEditor-Provider",r.default_configuration,r),this.pict.addView("ContentEditor-Layout",s.default_configuration,s),this.pict.addView("ContentEditor-TopBar",a.default_configuration,a),this.pict.addView("ContentEditor-MarkdownEditor",l.default_configuration,l),this.pict.addView("ContentEditor-CodeEditor",d.default_configuration,d),this.pict.addView("ContentEditor-SettingsPanel",c.default_configuration,c),this.pict.addView("ContentEditor-MarkdownReference",p.default_configuration,p),this.pict.addView("ContentEditor-Topics",h.default_configuration,h);let o=JSON.parse(JSON.stringify(n.default_configuration));o.DefaultDestinationAddress="#ContentEditor-Sidebar-Container",o.DefaultState.Layout="list-only",this.pict.addView("Pict-FileBrowser",o,n);let u=JSON.parse(JSON.stringify(n.PictViewListDetail.default_configuration));for(let t=0;t<u.Templates.length;t++)"FileBrowser-ListDetail-Container-Template"===u.Templates[t].Hash&&(u.Templates[t].Template='\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb-bar">\n\t\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t\t<button class="pict-fb-breadcrumb-addfolder" onclick="pict.PictApplication.promptNewFolder()" title="New folder">+</button>\n\t</div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'),"FileBrowser-ListDetail-Row-Template"===u.Templates[t].Hash&&(u.Templates[t].Template='\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" data-name="{~D:Record.Name~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n\t<button class="pict-fb-insert-btn" onclick="event.stopPropagation(); pict.PictApplication.insertFileReference(this.parentElement.getAttribute(\'data-name\'))" title="Insert into editor">+</button>\n</div>\n');this.pict.addView("Pict-FileBrowser-ListDetail",u,n.PictViewListDetail)}onAfterInitializeAsync(t){"undefined"!=typeof window&&(window.pict=this.pict),this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,AutoContentPreview:!0,MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:!1,SidebarWidth:250,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:!1,TopicsFilePath:".pict_documentation_topics.json"},this._loadSettings(),this.pict.views["ContentEditor-Layout"].render();let e=this,i=this.pict.providers["Pict-FileBrowser-List"];if(i){let t=i.selectFile.bind(i);i.selectFile=function(i){t(i),i&&"file"===i.Type&&e.navigateToFile(i.Path)}}let o=this.pict.providers["Pict-FileBrowser-Browse"];if(o){let t=o.navigateToFolder.bind(o);o.navigateToFolder=function(i){t(i),e.loadFileList(i)}}this.syncHiddenFilesSetting(()=>{e.loadFileList(null,()=>{e.resolveHash()})});let n=this.pict.AppData.ContentEditor.TopicsFilePath;if(n){let t=this.pict.views["ContentEditor-Topics"];t&&t.loadTopicsFile(n,()=>{})}return super.onAfterInitializeAsync(t)}syncHiddenFilesSetting(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.ContentEditor.ShowHiddenFiles;fetch("/api/filebrowser/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({IncludeHiddenFiles:!!i})}).then(()=>e()).catch(()=>e())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},o=this,n="string"==typeof t?t:null;null===n&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(n=this.pict.AppData.PictFileBrowser.CurrentLocation);let r="/api/filebrowser/list";n&&n.length>0&&(r+="?path="+encodeURIComponent(n)),fetch(r).then(t=>t.json()).then(t=>{o.pict.AppData.PictFileBrowser=o.pict.AppData.PictFileBrowser||{},o.pict.AppData.PictFileBrowser.FileList=t||[];let e=o.pict.views["Pict-FileBrowser"];e&&e.render();let n=o.pict.views["Pict-FileBrowser-ListDetail"];return n&&n.render(),i()}).catch(t=>(o.log.error(`Failed to load file list: ${t.message}`),i()))}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t)return;let e=t.split("/");if("edit"===e[0]&&e.length>=2){let t=e.slice(1).join("/");if(this.pict.AppData.ContentEditor.CurrentFile===t)return;this.navigateToFile(t)}}getEditorTypeForFile(t){if(!t)return"markdown";let e=t.replace(/^.*\./,"").toLowerCase();if("md"===e||"markdown"===e)return"markdown";return{png:!0,jpg:!0,jpeg:!0,gif:!0,bmp:!0,webp:!0,ico:!0,svg:!0,tiff:!0,tif:!0,avif:!0,heic:!0,heif:!0,mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,mp4:!0,avi:!0,mkv:!0,mov:!0,wmv:!0,webm:!0,flv:!0,m4v:!0,pdf:!0,doc:!0,docx:!0,xls:!0,xlsx:!0,ppt:!0,pptx:!0,odt:!0,ods:!0,odp:!0,zip:!0,tar:!0,gz:!0,bz2:!0,xz:!0,"7z":!0,rar:!0,ttf:!0,otf:!0,woff:!0,woff2:!0,eot:!0,exe:!0,dll:!0,so:!0,dylib:!0,o:!0,class:!0,pyc:!0,wasm:!0}[e]?"binary":"code"}_cleanupEditors(){let t=this.pict.views["ContentEditor-CodeEditor"];t&&(t.codeJar&&t.destroy(),t.initialRenderComplete=!1);let e=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");e&&e[0]&&(e[0].innerHTML="")}_formatFileSize(t){if(0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}_getMediaType(t){return{png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0}[t]?"image":{mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0}[t]?"video":{mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0}[t]?"audio":"other"}_buildMediaPreviewHTML(t,e,i){return"image"===t?'<div class="binary-preview-image-wrap"><div class="binary-preview-image"><img src="'+e+'" alt="'+i+'"></div></div>':"video"===t?'<div class="binary-preview-media-wrap"><video class="binary-preview-video" controls preload="metadata"><source src="'+e+'">Your browser does not support the video tag.</video></div>':"audio"===t?'<div class="binary-preview-media-wrap"><audio class="binary-preview-audio" controls preload="metadata"><source src="'+e+'">Your browser does not support the audio tag.</audio></div>':""}loadMediaPreview(t,e,i){let o=document.getElementById("ContentEditor-MediaPreviewPlaceholder");o&&(o.innerHTML=this._buildMediaPreviewHTML(t,e,i))}_showBinaryPreview(t){let e=this,i=t.replace(/^.*\//,""),o=t.replace(/^.*\./,"").toLowerCase(),n="/content/"+encodeURIComponent(t),r=this._getMediaType(o),s=this.pict.AppData.ContentEditor,a=!1;"image"===r&&(a=s.AutoPreviewImages),"video"===r&&(a=s.AutoPreviewVideo),"audio"===r&&(a=s.AutoPreviewAudio),fetch("/api/filebrowser/info?path="+encodeURIComponent(t)).then(t=>t.json()).then(t=>{let s=t&&"number"==typeof t.Size?e._formatFileSize(t.Size):"Unknown",l=t&&t.Modified?new Date(t.Modified).toLocaleString():"Unknown",d=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");if(!d||!d[0])return;let c="";"other"!==r&&(a?c+=e._buildMediaPreviewHTML(r,n,i):(c+='<div id="ContentEditor-MediaPreviewPlaceholder">',c+='<button class="binary-preview-btn binary-preview-btn-preview"',c+=' onclick="pict.PictApplication.loadMediaPreview(',c+="'"+r+"','"+n+"','"+i.replace(/'/g,"\\'")+"'",c+=')">Preview '+r.charAt(0).toUpperCase()+r.slice(1)+"</button>",c+="</div>")),c+='<div class="binary-preview-card">',c+='<div class="binary-preview-icon">'+o.toUpperCase()+"</div>",c+='<div class="binary-preview-info">',c+='<div class="binary-preview-name">'+i+"</div>",c+='<div class="binary-preview-meta">Size: '+s+"</div>",c+='<div class="binary-preview-meta">Modified: '+l+"</div>",c+='<div class="binary-preview-meta">Type: .'+o+"</div>",c+="</div>",c+='<div class="binary-preview-actions">',c+='<a class="binary-preview-btn" href="'+n+'" download="'+i+'">Download</a>',c+='<a class="binary-preview-btn binary-preview-btn-secondary" href="'+n+'" target="_blank">Open in New Tab</a>',c+="</div>",c+="</div>",d[0].innerHTML=c}).catch(()=>{let t=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div class="binary-preview-card"><div class="binary-preview-icon">'+o.toUpperCase()+'</div><div class="binary-preview-info"><div class="binary-preview-name">'+i+'</div><div class="binary-preview-meta">Binary file — cannot be edited in the browser</div></div><div class="binary-preview-actions"><a class="binary-preview-btn" href="'+n+'" download="'+i+'">Download</a><a class="binary-preview-btn binary-preview-btn-secondary" href="'+n+'" target="_blank">Open in New Tab</a></div></div>')})}segmentMarkdownContent(t){let e=this.pict.AppData.ContentEditor;if(!e.AutoSegmentMarkdown||!t)return[{Content:t||""}];let i=parseInt(e.AutoSegmentDepth,10)||1;if(1===i){let e=t.split("\n"),i=[],o=[],n=!1;for(let t=0;t<e.length;t++){let r=e[t];/^(`{3,}|~{3,})/.test(r.trim())?(n=!n,o.push(r)):n||""!==r.trim()?o.push(r):o.length>0&&(i.push({Content:o.join("\n")}),o=[])}return o.length>0&&i.push({Content:o.join("\n")}),i.length>0?i:[{Content:""}]}let o=new RegExp("^(#{1,"+i+"})\\s"),n=t.split("\n"),r=[],s=[];for(let t=0;t<n.length;t++){let e=n[t];o.test(e.trim())&&s.length>0&&(r.push({Content:s.join("\n")}),s=[]),s.push(e)}return s.length>0&&r.push({Content:s.join("\n")}),r.length>0?r:[{Content:""}]}navigateToFile(t){if(!t)return;let e=this,i=this.getEditorTypeForFile(t);if(this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",window.location.hash="#/edit/"+t,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.ActiveEditor=i,this._cleanupEditors(),this.pict.views["ContentEditor-TopBar"].render(),"binary"===i)return this._showBinaryPreview(t),void this.updateStats();let o=this.pict.providers["ContentEditor-Provider"];this.pict.AppData.ContentEditor.IsLoading=!0,o.loadFile(t,(o,n)=>{if(e.pict.AppData.ContentEditor.IsLoading=!1,o)return e.pict.AppData.ContentEditor.SaveStatus="Error loading file: "+o,e.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error",void e.pict.views["ContentEditor-TopBar"].render();if("markdown"===i){e.pict.AppData.ContentEditor.Document.Segments=e.segmentMarkdownContent(n);let i=e.pict.views["ContentEditor-MarkdownEditor"];if(i){let o="/content/",n=t.lastIndexOf("/");n>0&&(o="/content/"+t.substring(0,n)+"/"),i.options.ImageBaseURL=o,i.render(),i.marshalToView(),i.togglePreview(!0);let r=!!e.pict.AppData.ContentEditor.AutoContentPreview;for(let t in i._segmentEditors)i.toggleSegmentPreview(parseInt(t,10),r);i.toggleControls(e.pict.AppData.ContentEditor.MarkdownEditingControls)}e.updateStats()}else{e.pict.AppData.ContentEditor.CodeContent=n;let i=t.replace(/^.*\./,"").toLowerCase(),o=d.getLanguageForExtension?d.getLanguageForExtension(i):d.ExtensionLanguageMap[i]||"plaintext",r=e.pict.views["ContentEditor-CodeEditor"];r&&(r.initialRenderComplete=!1,r._language=o,r._suppressNextDirty=!0,r.render(),r.marshalToView(),e.pict.AppData.ContentEditor.CodeWordWrap&&r._editorElement&&(r._editorElement.style.whiteSpace="pre-wrap",r._editorElement.style.overflowWrap="break-word")),e.updateStats()}})}saveCurrentFile(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(!t)return;let e=this.pict.providers["ContentEditor-Provider"],i=this,o="";if("code"===this.pict.AppData.ContentEditor.ActiveEditor){let t=this.pict.views["ContentEditor-CodeEditor"];t&&t.marshalFromView(),o=this.pict.AppData.ContentEditor.CodeContent||""}else{let t=this.pict.views["ContentEditor-MarkdownEditor"];t&&t.marshalFromView();let e=this.pict.AppData.ContentEditor.Document.Segments;if(e&&e.length>0){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].Content||"");o=t.join("\n\n")}}this.pict.AppData.ContentEditor.IsSaving=!0,this.pict.AppData.ContentEditor.SaveStatus="Saving...",this.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saving",this.pict.views["ContentEditor-TopBar"].render(),e.saveFile(t,o,t=>{i.pict.AppData.ContentEditor.IsSaving=!1,t?(i.pict.AppData.ContentEditor.SaveStatus="Error: "+t,i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error"):(i.pict.AppData.ContentEditor.IsDirty=!1,i.pict.AppData.ContentEditor.SaveStatus="Saved",i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saved",i.loadFileList(),setTimeout(()=>{"Saved"===i.pict.AppData.ContentEditor.SaveStatus&&(i.pict.AppData.ContentEditor.SaveStatus="",i.pict.AppData.ContentEditor.SaveStatusClass="",i.pict.views["ContentEditor-TopBar"].render())},3e3)),i.pict.views["ContentEditor-TopBar"].render()})}closeCurrentFile(){this.pict.AppData.ContentEditor.CurrentFile&&(this.pict.AppData.ContentEditor.IsDirty?this._showCloseConfirmation():this._doCloseFile())}_doCloseFile(){this._hideCloseConfirmation(),this._cleanupEditors(),this.pict.AppData.ContentEditor.CurrentFile="",this.pict.AppData.ContentEditor.ActiveEditor="markdown",this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",this.pict.AppData.ContentEditor.Document.Segments=[{Content:""}],this.pict.AppData.ContentEditor.CodeContent="",window.location.hash="",this.pict.views["ContentEditor-TopBar"].render();let t=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.updateStats()}confirmCloseFile(){this._doCloseFile()}cancelCloseFile(){this._hideCloseConfirmation()}_showCloseConfirmation(){let t=document.getElementById("ContentEditor-ConfirmOverlay");if(t&&t.classList.add("open"),!this._confirmKeyHandler){let t=this;this._confirmKeyHandler=e=>{let i=e.key.toLowerCase();"y"===i?(e.preventDefault(),t.confirmCloseFile()):"n"!==i&&"Escape"!==e.key||(e.preventDefault(),t.cancelCloseFile())}}window.addEventListener("keydown",this._confirmKeyHandler)}_hideCloseConfirmation(){let t=document.getElementById("ContentEditor-ConfirmOverlay");t&&t.classList.remove("open"),this._confirmKeyHandler&&window.removeEventListener("keydown",this._confirmKeyHandler)}createNewFile(t){if(!t)return;t.replace(/^.*\//,"").indexOf(".")<0&&(t+=".md");let e=this.pict.providers["ContentEditor-Provider"],i=this,o="";o=t.endsWith(".md")?"# "+t.replace(/\.[^.]+$/,"").replace(/^.*\//,"")+"\n\n":"// "+t.replace(/^.*\//,"")+"\n",e.saveFile(t,o,e=>{e||i.loadFileList(null,()=>{i.navigateToFile(t)})})}promptNewFile(){let t=prompt("Enter a name for the new file (e.g. my-page.md, script.js, style.css):");t&&t.trim()&&this.createNewFile(t.trim())}promptNewFolder(){let t=prompt("Enter a name for the new folder:");if(!t||!t.trim())return;t=t.trim();let e="";this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(e=this.pict.AppData.PictFileBrowser.CurrentLocation);let i=e?e+"/"+t:t,o=this;fetch("/api/content/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:i})}).then(t=>t.json()).then(t=>{t&&t.Success?(o.log.info(`Folder created: ${i}`),o.loadFileList()):alert("Could not create folder: "+(t?t.Error:"Unknown error"))}).catch(t=>{alert("Error creating folder: "+t.message)})}insertFileReference(t){if(!t)return;let e=this.pict.views["ContentEditor-MarkdownEditor"];if(!e||"markdown"!==this.pict.AppData.ContentEditor.ActiveEditor)return;let i=e._activeSegmentIndex;if(i<0){let t=e._getOrderedSegmentIndices();t.length>0&&(i=t[0])}if(i<0)return;let o=t.replace(/\.[^.]+$/,"");o=o.replace(/^\d{10,}-/,""),o=o.replace(/[-_]+/g," ").trim()||"image";let n=t.substring(t.lastIndexOf(".")).toLowerCase();if([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".avif",".apng",".ico",".tiff",".tif",".jfif"].indexOf(n)>=0)e._insertImageMarkdown(i,t,o);else{let n=e._segmentEditors[i];if(n){let e="["+o+"]("+t+")",i=n.state.selection.main.head;n.dispatch({changes:{from:i,insert:e},selection:{anchor:i+e.length}}),n.focus()}}}handleF4TopicAction(){let t=this.pict.views["ContentEditor-Layout"],e=this.pict.views["ContentEditor-Topics"];if(!t||!e)return;let i=this.pict.AppData.ContentEditor,o=i.ActiveEditor,n=i.CurrentFile,r=0,s=!1;if("markdown"===o&&n){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors){let e=0;for(let i in t._segmentEditors){let o=t._segmentEditors[i];if(o&&o.hasFocus){let t=o.state.selection.main.head;r=e+o.state.doc.lineAt(t).number,s=!0;break}o&&o.state&&(e+=o.state.doc.lines)}}}if(i.SidebarCollapsed&&t.toggleSidebar(),t.switchSidebarTab("topics"),s&&n){let t={TopicCode:"New-Topic",TopicHelpFilePath:n,TopicTitle:this._extractFirstHeading()||"New Topic"};r>0&&(t.RelevantMarkdownLine=r),e.addTopic(t)}}_extractFirstHeading(){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(!t||!t._segmentEditors)return"";let e=7,i="";for(let o in t._segmentEditors){let n=t._segmentEditors[o];if(!n||!n.state||!n.state.doc)continue;let r=n.state.doc;for(let t=1;t<=r.lines;t++){let o=r.line(t).text.match(/^(#{1,6})\s+(.+)/);if(o){let t=o[1].length;if(t<e&&(e=t,i=o[2].trim(),1===e))return i}}}return i}updateStats(){let t=document.getElementById("ContentEditor-Stats");if(!t)return;let e=this.pict.AppData.ContentEditor.ActiveEditor,i=0,o=0,n=0;if("markdown"===e){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors)for(let e in t._segmentEditors){let r=t._segmentEditors[e];if(r&&r.state&&r.state.doc){i+=r.state.doc.lines,o+=r.state.doc.length;let t=r.state.doc.toString().match(/\S+/g);t&&(n+=t.length)}}}else{if("code"!==e)return void(t.textContent="");{let t=this.pict.views["ContentEditor-CodeEditor"];if(t&&t.codeJar){let e=t.codeJar.toString();o=e.length,i=e.split("\n").length;let r=e.match(/\S+/g);r&&(n=r.length)}}}t.textContent=i+" lines · "+n+" words · "+o+" chars"}markDirty(){this.pict.AppData.ContentEditor.IsDirty||(this.pict.AppData.ContentEditor.IsDirty=!0,this.pict.views["ContentEditor-TopBar"].render())}get _settingsKey(){return"retold-content-editor-settings"}saveSettings(){if("undefined"==typeof window||!window.localStorage)return;let t=this.pict.AppData.ContentEditor,e={AutoSegmentMarkdown:t.AutoSegmentMarkdown,AutoSegmentDepth:t.AutoSegmentDepth,AutoContentPreview:t.AutoContentPreview,MarkdownEditingControls:t.MarkdownEditingControls,MarkdownWordWrap:t.MarkdownWordWrap,CodeWordWrap:t.CodeWordWrap,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,AutoPreviewImages:t.AutoPreviewImages,AutoPreviewVideo:t.AutoPreviewVideo,AutoPreviewAudio:t.AutoPreviewAudio,ShowHiddenFiles:t.ShowHiddenFiles,TopicsFilePath:t.TopicsFilePath};try{window.localStorage.setItem(this._settingsKey,JSON.stringify(e))}catch(t){this.log.warn("Failed to save settings: "+t.message)}}_loadSettings(){if("undefined"!=typeof window&&window.localStorage)try{let t=window.localStorage.getItem(this._settingsKey);if(!t)return;let e=JSON.parse(t),i=this.pict.AppData.ContentEditor;"boolean"==typeof e.AutoSegmentMarkdown&&(i.AutoSegmentMarkdown=e.AutoSegmentMarkdown),"number"==typeof e.AutoSegmentDepth&&(i.AutoSegmentDepth=e.AutoSegmentDepth),"boolean"==typeof e.AutoContentPreview&&(i.AutoContentPreview=e.AutoContentPreview),"boolean"==typeof e.MarkdownEditingControls&&(i.MarkdownEditingControls=e.MarkdownEditingControls),"boolean"==typeof e.MarkdownWordWrap&&(i.MarkdownWordWrap=e.MarkdownWordWrap),"boolean"==typeof e.CodeWordWrap&&(i.CodeWordWrap=e.CodeWordWrap),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),"number"==typeof e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),"boolean"==typeof e.AutoPreviewImages&&(i.AutoPreviewImages=e.AutoPreviewImages),"boolean"==typeof e.AutoPreviewVideo&&(i.AutoPreviewVideo=e.AutoPreviewVideo),"boolean"==typeof e.AutoPreviewAudio&&(i.AutoPreviewAudio=e.AutoPreviewAudio),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"string"==typeof e.TopicsFilePath&&(i.TopicsFilePath=e.TopicsFilePath)}catch(t){this.log.warn("Failed to load settings: "+t.message)}}},e.exports.default_configuration=t("./Pict-Application-ContentEditor-Configuration.json")},{"./Pict-Application-ContentEditor-Configuration.json":93,"./providers/Pict-Provider-ContentEditor.js":98,"./views/PictView-Editor-CodeEditor.js":99,"./views/PictView-Editor-Layout.js":100,"./views/PictView-Editor-MarkdownEditor.js":101,"./views/PictView-Editor-MarkdownReference.js":102,"./views/PictView-Editor-SettingsPanel.js":103,"./views/PictView-Editor-TopBar.js":104,"./views/PictView-Editor-Topics.js":105,"pict-application":44,"pict-section-filebrowser":54}],95:[function(t,e,i){e.exports={Name:"Retold Content Reader",Hash:"ContentReader",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentReader-Pict-Application"}}},{}],96:[function(t,e,i){const o=t("pict-docuserve");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onAfterInitializeAsync(t){this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"/content/",CatalogURL:"/content/retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve;return e.CoverLoaded&&e.Cover&&e.Cover.Title?document.title=e.Cover.Title.replace(/<[^>]*>/g,""):e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(document.title=e.TopBar.Brand.replace(/<[^>]*>/g,"")),e.TopBar?(Array.isArray(e.TopBar.ExternalLinks)||(e.TopBar.ExternalLinks=[]),e.TopBar.ExternalLinks.push({Text:"Edit",Href:"/"})):(e.TopBarLoaded=!0,e.TopBar={Brand:"Content System",NavLinks:[],ExternalLinks:[{Text:"Edit",Href:"/"}]}),this.pict.views["Docuserve-Layout"].render(),t()})}},e.exports.default_configuration=t("./Pict-Application-ContentReader-Configuration.json")},{"./Pict-Application-ContentReader-Configuration.json":95,"pict-docuserve":85}],97:[function(t,e,i){e.exports={PictContentReader:t("./Pict-Application-ContentReader.js"),PictContentEditor:t("./Pict-Application-ContentEditor.js")},"undefined"!=typeof window&&(window.PictContentReader=e.exports.PictContentReader,window.PictContentEditor=e.exports.PictContentEditor)},{"./Pict-Application-ContentEditor.js":94,"./Pict-Application-ContentReader.js":96}],98:[function(t,e,i){const o=t("pict-provider");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}loadFile(t,e){let i="function"==typeof e?e:()=>{};if(!t)return i("No file path specified","");fetch("/api/content/read/"+encodeURIComponent(t)).then(t=>t.ok?t.json():i("File not found: "+t.status,"")).then(t=>t&&t.Success?i(null,t.Content||""):i(t?t.Error:"Unknown error","")).catch(e=>(this.log.warn(`ContentEditor: Error loading file [${t}]: ${e}`),i(e.message,"")))}saveFile(t,e,i){let o="function"==typeof i?i:()=>{};if(!t)return o("No file path specified");fetch("/api/content/save/"+encodeURIComponent(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Content:e})}).then(t=>t.ok?t.json():o("Save failed: "+t.status)).then(t=>t&&t.Success?o(null):o(t?t.Error:"Unknown error")).catch(e=>(this.log.warn(`ContentEditor: Error saving file [${t}]: ${e}`),o(e.message)))}uploadImage(t,e){let i="function"==typeof e?e:()=>{},o="",n=this.pict.AppData.ContentEditor.CurrentFile;if(n){let t=n.lastIndexOf("/");t>0&&(o=n.substring(0,t))}else this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(o=this.pict.AppData.PictFileBrowser.CurrentLocation);let r={"Content-Type":t.type,"x-filename":t.name};o&&(r["x-upload-path"]=o),fetch("/api/content/upload-image",{method:"POST",body:t,headers:r}).then(t=>t.json()).then(t=>t&&t.Success&&t.URL?i(null,t.URL):i(t?t.Error:"Upload failed")).catch(t=>(this.log.warn(`ContentEditor: Image upload failed: ${t}`),i(t.message)))}},e.exports.default_configuration={ProviderIdentifier:"ContentEditor-Provider",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":46}],99:[function(t,e,i){const o=t("pict-section-code"),n={js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"xml",htm:"xml",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"scss",less:"less",sql:"sql",py:"python",rb:"ruby",java:"java",kt:"kotlin",kts:"kotlin",go:"go",rs:"rust",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",swift:"swift",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",dockerfile:"dockerfile",docker:"dockerfile",makefile:"makefile",mk:"makefile",md:"markdown",markdown:"markdown",lua:"lua",r:"r",pl:"perl",pm:"perl",ex:"elixir",exs:"elixir",erl:"erlang",hrl:"erlang",hs:"haskell",clj:"clojure",scala:"scala",dart:"dart",groovy:"groovy",gradle:"groovy",tf:"terraform",vim:"vim",diff:"diff",patch:"diff",log:"accesslog",txt:"plaintext"};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._suppressNextDirty=!1}onAfterInitialRender(){if("undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.CodeJar&&this.connectCodeJarPrototype(window.CodeJarModules.CodeJar),"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let t=window.CodeJarModules.hljs,e=this._language;this._highlightFunction=function(i){i.removeAttribute("data-highlighted"),delete i.dataset.highlighted,i.className=i.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),i.classList.add("hljs"),e&&"plaintext"!==e&&i.classList.add("language-"+e),t.highlightElement(i)}}return super.onAfterInitialRender()}setLanguage(t){if(this._language=t,"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let e=window.CodeJarModules.hljs,i=t;this._highlightFunction=function(t){t.removeAttribute("data-highlighted"),delete t.dataset.highlighted,t.className=t.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),t.classList.add("hljs"),i&&"plaintext"!==i&&t.classList.add("language-"+i),e.highlightElement(t)}}if(this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}onCodeChange(t){super.onCodeChange(t),this._suppressNextDirty?this._suppressNextDirty=!1:this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}static getLanguageForExtension(t){if(!t)return"plaintext";let e=t.toLowerCase();return n[e]||"plaintext"}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-CodeEditor",DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",CodeDataAddress:"AppData.ContentEditor.CodeContent",ReadOnly:!1,LineNumbers:!0,Language:"javascript",Tab:"\t",AutoRender:!1,Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]},e.exports.ExtensionLanguageMap=n},{"pict-section-code":49}],100:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"ContentEditor-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:'\n\t\t#ContentEditor-Application-Container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t#ContentEditor-TopBar-Container\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-body\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar wrapper holds the sidebar content + collapse toggle */\n\t\t.content-editor-sidebar-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t\ttransition: width 0.2s ease;\n\t\t}\n\t\t/* Inner wrapper: vertical flex for tab bar + panes */\n\t\t.content-editor-sidebar-inner\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar tab bar */\n\t\t.content-editor-sidebar-tabs\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.content-editor-sidebar-tab\n\t\t{\n\t\t\tflex: 1;\n\t\t\tpadding: 7px 0;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-tab:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-sidebar-tab.active\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tborder-bottom-color: #2E7D74;\n\t\t}\n\t\t.content-editor-sidebar-addfile\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 30px;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, background 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-addfile:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t/* Sidebar panes */\n\t\t.content-editor-sidebar-pane\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container\n\t\t{\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t/* Collapsed state */\n\t\t.content-editor-sidebar-wrap.collapsed\n\t\t{\n\t\t\twidth: 0 !important;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-inner\n\t\t{\n\t\t\tvisibility: hidden;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-resize-handle\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Collapse / expand toggle */\n\t\t.content-editor-sidebar-toggle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 8px;\n\t\t\tright: -20px;\n\t\t\twidth: 20px;\n\t\t\theight: 28px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #FAF8F4;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-left: none;\n\t\t\tborder-radius: 0 4px 4px 0;\n\t\t\tcursor: pointer;\n\t\t\tz-index: 10;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 11px;\n\t\t\tline-height: 1;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-toggle:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-toggle\n\t\t{\n\t\t\tright: -20px;\n\t\t}\n\t\t/* Resize handle */\n\t\t.content-editor-resize-handle\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 5px;\n\t\t\tcursor: col-resize;\n\t\t\tbackground: transparent;\n\t\t\tborder-right: 1px solid #DDD6CA;\n\t\t\ttransition: background 0.15s;\n\t\t}\n\t\t.content-editor-resize-handle:hover,\n\t\t.content-editor-resize-handle.dragging\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tborder-right-color: #2E7D74;\n\t\t}\n\t\t/* File browser layout overrides for sidebar use */\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser\n\t\t{\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\tbackground: transparent;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-browse-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-view-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide size/date columns — the sidebar is too narrow for them */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-modified,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-modified\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide the column header bar in sidebar mode */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-header\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Breadcrumb bar: flex wrapper with create-folder button */\n\t\t.pict-fb-breadcrumb-bar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t}\n\t\t.pict-fb-breadcrumb-bar .pict-fb-breadcrumb\n\t\t{\n\t\t\tflex: 1;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.pict-fb-breadcrumb-addfolder\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 4px 10px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t\tmargin-right: 4px;\n\t\t}\n\t\t.pict-fb-breadcrumb-addfolder:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t#ContentEditor-Editor-Container\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 44px 16px 16px 16px;\n\t\t}\n\t\t/* Code editor: fill the container and remove outer border */\n\t\t#ContentEditor-Editor-Container .pict-code-editor-wrap\n\t\t{\n\t\t\theight: calc(100% - 4px);\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t}\n\t\t#ContentEditor-Editor-Container .pict-code-editor\n\t\t{\n\t\t\tmin-height: unset;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAFAFA;\n\t\t}\n\t\t/* Binary file preview */\n\t\t.binary-preview-image-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-image\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t}\n\t\t.binary-preview-image img\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 400px;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.binary-preview-card\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 20px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t\tmax-width: 600px;\n\t\t}\n\t\t.binary-preview-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 64px;\n\t\t\theight: 64px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-radius: 8px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: #5E5549;\n\t\t\tletter-spacing: 0.5px;\n\t\t}\n\t\t.binary-preview-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.binary-preview-name\n\t\t{\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.binary-preview-meta\n\t\t{\n\t\t\tfont-size: 0.8rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tline-height: 1.6;\n\t\t}\n\t\t.binary-preview-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.binary-preview-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 8px 16px;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.binary-preview-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.binary-preview-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.binary-preview-btn-secondary:hover\n\t\t{\n\t\t\tborder-color: #8A7F72;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.binary-preview-btn-preview\n\t\t{\n\t\t\tpadding: 10px 20px;\n\t\t\tfont-size: 0.85rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #FAF8F4;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 6px;\n\t\t\ttransition: background 0.15s, border-color 0.15s;\n\t\t}\n\t\t.binary-preview-btn-preview:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t\t#ContentEditor-MediaPreviewPlaceholder\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-media-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-video\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 500px;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #000;\n\t\t}\n\t\t.binary-preview-audio\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-width: 500px;\n\t\t}\n\t\t/* Image upload overlay */\n\t\t.content-editor-upload-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-upload-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-upload-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 420px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-upload-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 14px 18px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t}\n\t\t.content-editor-upload-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-upload-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 6px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.content-editor-upload-close:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-upload-body\n\t\t{\n\t\t\tpadding: 18px;\n\t\t}\n\t\t.content-editor-upload-dropzone\n\t\t{\n\t\t\tborder: 2px dashed #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 28px 16px;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, background 0.15s;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.content-editor-upload-dropzone:hover,\n\t\t.content-editor-upload-dropzone.dragover\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t\tbackground: #F0FAF8;\n\t\t}\n\t\t.content-editor-upload-dropzone-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-upload-dropzone-text\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-dropzone-hint\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.content-editor-upload-file-input\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.content-editor-upload-status\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmin-height: 20px;\n\t\t}\n\t\t.content-editor-upload-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-upload-status-success\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.content-editor-upload-result\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tpadding: 10px 12px;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.content-editor-upload-result-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 4px;\n\t\t}\n\t\t.content-editor-upload-result-url\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.content-editor-upload-result-text\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-family: monospace;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #3D3229;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.content-editor-upload-result-copy\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 4px 10px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-upload-result-copy:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-upload-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-footer\n\t\t{\n\t\t\tpadding: 10px 18px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\n\t\t/* File browser row insert button — hidden by default, shown on\n\t\t hover for image file rows via CSS attribute selectors. */\n\t\t.pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: absolute;\n\t\t\tright: 6px;\n\t\t\ttop: 50%;\n\t\t\ttransform: translateY(-50%);\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 700;\n\t\t\tline-height: 1;\n\t\t\tpadding: 2px 7px;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-fb-insert-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Make the row position:relative so the button can be absolutely placed */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row\n\t\t{\n\t\t\tposition: relative;\n\t\t}\n\t\t/* Show the insert button on hover for image file extensions.\n\t\t CSS attribute selector [data-name$=".ext" i] matches\n\t\t the end of the data-name attribute, case-insensitive. */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".png" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jpg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jpeg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".gif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".webp" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".svg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".bmp" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".avif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".apng" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".ico" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".tiff" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".tif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jfif" i]:hover .pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t/* Prevent horizontal scroll on the whole app */\n\t\t\t#ContentEditor-Application-Container\n\t\t\t{\n\t\t\t\toverflow-x: hidden;\n\t\t\t\twidth: 100%;\n\t\t\t\tmax-width: 100vw;\n\t\t\t}\n\n\t\t\t/* Stack sidebar ABOVE editor instead of side-by-side */\n\t\t\t.content-editor-body\n\t\t\t{\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t/* Sidebar becomes a horizontal strip at the top */\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-height: 40vh;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\t\tborder-right: none;\n\t\t\t}\n\n\t\t\t/* When collapsed on mobile, hide the inner content but keep the\n\t\t\t toggle button visible (it\'s positioned below the sidebar strip) */\n\t\t\t.content-editor-sidebar-wrap.collapsed\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-height: 0;\n\t\t\t\toverflow: visible;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-inner\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Hide the resize handle (desktop-only interaction) */\n\t\t\t.content-editor-resize-handle\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Reposition the sidebar toggle for horizontal layout —\n\t\t\t place it at the bottom-center of the sidebar strip */\n\t\t\t.content-editor-sidebar-toggle\n\t\t\t{\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: auto;\n\t\t\t\tbottom: -20px;\n\t\t\t\tright: auto;\n\t\t\t\tleft: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\twidth: 28px;\n\t\t\t\theight: 20px;\n\t\t\t\tborder-radius: 0 0 4px 4px;\n\t\t\t\tborder: 1px solid #DDD6CA;\n\t\t\t\tborder-top: none;\n\t\t\t\tz-index: 10;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-toggle\n\t\t\t{\n\t\t\t\tbottom: -20px;\n\t\t\t\tright: auto;\n\t\t\t\tleft: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t}\n\n\t\t\t/* Reduce editor container padding (less gutters) */\n\t\t\t#ContentEditor-Editor-Container\n\t\t\t{\n\t\t\t\tpadding: 24px 8px 8px 8px;\n\t\t\t}\n\n\t\t\t/* Reduce binary preview padding */\n\t\t\t.binary-preview-image\n\t\t\t{\n\t\t\t\tpadding: 12px;\n\t\t\t}\n\t\t\t.binary-preview-card\n\t\t\t{\n\t\t\t\tpadding: 12px;\n\t\t\t\tgap: 12px;\n\t\t\t}\n\n\t\t\t/* Upload panel: fill more of the screen */\n\t\t\t.content-editor-upload-panel\n\t\t\t{\n\t\t\t\twidth: 95vw;\n\t\t\t\tmax-width: 95vw;\n\t\t\t}\n\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Even tighter editor padding */\n\t\t\t#ContentEditor-Editor-Container\n\t\t\t{\n\t\t\t\tpadding: 20px 4px 4px 4px;\n\t\t\t}\n\n\t\t\t/* Sidebar gets a smaller max height */\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\tmax-height: 35vh;\n\t\t\t}\n\t\t}\n\t',Templates:[{Hash:"ContentEditor-Layout-Shell-Template",Template:'\n<div id="ContentEditor-TopBar-Container"></div>\n<div class="content-editor-body">\n\t<div class="content-editor-sidebar-wrap" id="ContentEditor-SidebarWrap" style="width:250px">\n\t\t<div class="content-editor-sidebar-inner">\n\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t<button class="content-editor-sidebar-tab active" id="ContentEditor-SidebarTab-Files"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Reference"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'reference\')">Reference</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Topics"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'topics\')">Topics</button>\n\t\t\t\t<button class="content-editor-sidebar-addfile" title="New file"\n\t\t\t\t\tonclick="{~P~}.PictApplication.promptNewFile()">+</button>\n\t\t\t</div>\n\t\t\t<div id="ContentEditor-Sidebar-Container" class="content-editor-sidebar-pane"></div>\n\t\t\t<div id="ContentEditor-SidebarReference-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t\t<div id="ContentEditor-SidebarTopics-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t</div>\n\t\t<div class="content-editor-resize-handle" id="ContentEditor-ResizeHandle"></div>\n\t\t<div class="content-editor-sidebar-toggle" id="ContentEditor-SidebarToggle">◀</div>\n\t</div>\n\t<div id="ContentEditor-Editor-Container"></div>\n</div>\n<div class="content-editor-upload-overlay" id="ContentEditor-UploadOverlay"\n\tonclick="{~P~}.views[\'ContentEditor-Layout\'].onUploadOverlayClick(event)">\n\t<div class="content-editor-upload-panel">\n\t\t<div class="content-editor-upload-header">\n\t\t\t<span class="content-editor-upload-title">Upload Image</span>\n\t\t\t<button class="content-editor-upload-close"\n\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].toggleUploadForm()">×</button>\n\t\t</div>\n\t\t<div class="content-editor-upload-body">\n\t\t\t<div class="content-editor-upload-dropzone" id="ContentEditor-UploadDropzone"\n\t\t\t\tonclick="document.getElementById(\'ContentEditor-UploadFileInput\').click()">\n\t\t\t\t<div class="content-editor-upload-dropzone-icon">📷</div>\n\t\t\t\t<div class="content-editor-upload-dropzone-text">Drop an image here or click to browse</div>\n\t\t\t\t<div class="content-editor-upload-dropzone-hint">PNG, JPG, GIF, WebP, SVG, BMP</div>\n\t\t\t</div>\n\t\t\t<input type="file" class="content-editor-upload-file-input" id="ContentEditor-UploadFileInput"\n\t\t\t\taccept="image/png,image/jpeg,image/gif,image/webp,image/svg+xml,image/bmp"\n\t\t\t\tonchange="{~P~}.views[\'ContentEditor-Layout\'].onUploadFileSelected(this)">\n\t\t\t<div class="content-editor-upload-status" id="ContentEditor-UploadStatus"></div>\n\t\t\t<div id="ContentEditor-UploadResult"></div>\n\t\t</div>\n\t\t<div class="content-editor-upload-footer">\n\t\t\t<span class="content-editor-upload-kbd">F3</span> or\n\t\t\t<span class="content-editor-upload-kbd">Ctrl+Shift+U</span> to toggle\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-Layout-Shell",TemplateHash:"ContentEditor-Layout-Shell-Template",DestinationAddress:"#ContentEditor-Application-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._minSidebarWidth=140,this._maxSidebarWidth=600}onAfterRender(t,e,i,o){this.pict.views["ContentEditor-TopBar"].render();let n=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");n&&n[0]&&!this.pict.AppData.ContentEditor.CurrentFile&&(n[0].innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.pict.CSSMap.injectCSS();let r=this.pict.AppData.ContentEditor,s=document.getElementById("ContentEditor-SidebarWrap"),a=document.getElementById("ContentEditor-SidebarToggle");if(s){let t=window.innerWidth<=768;s.style.width=t?"100%":r.SidebarWidth+"px",r.SidebarCollapsed?(s.classList.add("collapsed"),a&&(a.innerHTML=t?"▼":"▶")):t&&(r.SidebarCollapsed=!0,s.classList.add("collapsed"),a&&(a.innerHTML="▼"))}let l=this;return a&&a.addEventListener("click",()=>{l.toggleSidebar()}),this._wireResizeHandle(),window.addEventListener("hashchange",()=>{l.pict.PictApplication.resolveHash()}),window.addEventListener("keydown",t=>{if((t.metaKey||t.ctrlKey)&&"s"===t.key)return t.preventDefault(),void l.pict.PictApplication.saveCurrentFile();if("F1"===t.key)return t.preventDefault(),void l._handleF1();if("F2"===t.key)return t.preventDefault(),void l.toggleSidebar();if("F3"===t.key)return t.preventDefault(),void l.toggleUploadForm();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("u"===t.key||"U"===t.key))return t.preventDefault(),void l.toggleUploadForm();if("F4"===t.key)return t.preventDefault(),void l.pict.PictApplication.handleF4TopicAction();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("t"===t.key||"T"===t.key))return t.preventDefault(),void l.pict.PictApplication.handleF4TopicAction();if("Escape"===t.key){let e=document.getElementById("ContentEditor-UploadOverlay");if(e&&e.classList.contains("open"))return void l.closeUploadForm();let i=document.getElementById("ContentEditor-ConfirmOverlay");if(i&&i.classList.contains("open"))return;if(l.pict.AppData.ContentEditor.CurrentFile)return t.preventDefault(),void l.pict.PictApplication.closeCurrentFile()}}),super.onAfterRender(t,e,i,o)}toggleSidebar(){let t=document.getElementById("ContentEditor-SidebarWrap"),e=document.getElementById("ContentEditor-SidebarToggle");if(!t)return;let i=this.pict.AppData.ContentEditor;i.SidebarCollapsed=!i.SidebarCollapsed;let o=window.innerWidth<=768;i.SidebarCollapsed?(t.classList.add("collapsed"),e&&(e.innerHTML=o?"▼":"▶")):(t.classList.remove("collapsed"),t.style.width=o?"100%":i.SidebarWidth+"px",e&&(e.innerHTML=o?"▲":"◀")),this.pict.PictApplication.saveSettings()}switchSidebarTab(t){let e={files:document.getElementById("ContentEditor-Sidebar-Container"),reference:document.getElementById("ContentEditor-SidebarReference-Container"),topics:document.getElementById("ContentEditor-SidebarTopics-Container")},i={files:document.getElementById("ContentEditor-SidebarTab-Files"),reference:document.getElementById("ContentEditor-SidebarTab-Reference"),topics:document.getElementById("ContentEditor-SidebarTab-Topics")};for(let t in e)e[t]&&(e[t].style.display="none"),i[t]&&i[t].classList.remove("active");if(e[t]&&(e[t].style.display=""),i[t]&&i[t].classList.add("active"),"reference"===t){let t=this.pict.views["ContentEditor-MarkdownReference"];t&&!t._hasRendered&&t.render()}if("topics"===t){let t=this.pict.views["ContentEditor-Topics"];t&&!t._hasRendered&&t.render()}}_handleF1(){if(this.pict.AppData.ContentEditor.SidebarCollapsed)return this.toggleSidebar(),void this.switchSidebarTab("reference");let t=document.getElementById("ContentEditor-SidebarTab-Reference");t&&t.classList.contains("active")?this.switchSidebarTab("files"):this.switchSidebarTab("reference")}getActiveSidebarTab(){let t=document.getElementById("ContentEditor-SidebarTab-Reference"),e=document.getElementById("ContentEditor-SidebarTab-Topics");return t&&t.classList.contains("active")?"reference":e&&e.classList.contains("active")?"topics":"files"}toggleUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&(t.classList.contains("open")?this.closeUploadForm():this.openUploadForm())}openUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&t.classList.add("open"),this._wireUploadDropzone()}closeUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&t.classList.remove("open");let e=document.getElementById("ContentEditor-UploadFileInput");e&&(e.value="");let i=document.getElementById("ContentEditor-UploadStatus");i&&(i.innerHTML="");let o=document.getElementById("ContentEditor-UploadResult");o&&(o.innerHTML="")}onUploadOverlayClick(t){"ContentEditor-UploadOverlay"===t.target.id&&this.closeUploadForm()}onUploadFileSelected(t){t.files&&t.files.length>0&&this._uploadFile(t.files[0])}_wireUploadDropzone(){let t=document.getElementById("ContentEditor-UploadDropzone");if(!t||t._wired)return;t._wired=!0;let e=this;t.addEventListener("dragover",e=>{e.preventDefault(),e.stopPropagation(),t.classList.add("dragover")}),t.addEventListener("dragleave",e=>{e.preventDefault(),e.stopPropagation(),t.classList.remove("dragover")}),t.addEventListener("drop",i=>{i.preventDefault(),i.stopPropagation(),t.classList.remove("dragover"),i.dataTransfer&&i.dataTransfer.files&&i.dataTransfer.files.length>0&&e._uploadFile(i.dataTransfer.files[0])})}_uploadFile(t){let e=document.getElementById("ContentEditor-UploadStatus"),i=document.getElementById("ContentEditor-UploadResult");if(!t)return;if(!t.type.startsWith("image/"))return void(e&&(e.innerHTML='<span class="content-editor-upload-status-error">Only image files are supported.</span>'));e&&(e.innerHTML="Uploading <strong>"+t.name+"</strong>..."),i&&(i.innerHTML="");let o=this,n=this.pict.providers["ContentEditor-Provider"];n?n.uploadImage(t,(n,r)=>{if(n)return void(e&&(e.innerHTML='<span class="content-editor-upload-status-error">Upload failed: '+n+"</span>"));e&&(e.innerHTML='<span class="content-editor-upload-status-success">Uploaded successfully!</span>');let s="";i&&(i.innerHTML='<div class="content-editor-upload-result"><div class="content-editor-upload-result-label">Markdown</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+s+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+s.replace(/'/g,"\\'")+'\').then(function(){this.textContent=\'Copied!\'}.bind(this))">Copy</button></div><div class="content-editor-upload-result-label" style="margin-top:8px">URL</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+r+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+r.replace(/'/g,"\\'")+"').then(function(){this.textContent='Copied!'}.bind(this))\">Copy</button></div></div>"),o.pict.PictApplication.loadFileList()}):e&&(e.innerHTML='<span class="content-editor-upload-status-error">Provider not available.</span>')}_wireResizeHandle(){let t=document.getElementById("ContentEditor-ResizeHandle"),e=document.getElementById("ContentEditor-SidebarWrap");if(!t||!e)return;let i=this,o=!1,n=0,r=0;function s(t){if(!o)return;let s=t.clientX-n,a=r+s;a<i._minSidebarWidth&&(a=i._minSidebarWidth),a>i._maxSidebarWidth&&(a=i._maxSidebarWidth),e.style.width=a+"px"}function a(){o&&(o=!1,t.classList.remove("dragging"),e.style.transition="",document.body.style.userSelect="",document.body.style.cursor="",i.pict.AppData.ContentEditor.SidebarWidth=e.offsetWidth,i.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a))}t.addEventListener("mousedown",function(l){i.pict.AppData.ContentEditor.SidebarCollapsed||(l.preventDefault(),o=!0,n=l.clientX,r=e.offsetWidth,t.classList.add("dragging"),e.style.transition="none",document.body.style.userSelect="none",document.body.style.cursor="col-resize",document.addEventListener("mousemove",s),document.addEventListener("mouseup",a))})}},e.exports.default_configuration=n},{"pict-view":76}],101:[function(t,e,i){const o=t("pict-section-markdowneditor");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onImageUpload(t,e,i){let o=this.pict.providers["ContentEditor-Provider"];return!!o&&(o.uploadImage(t,(t,e)=>{t?i(t):i(null,e)}),!0)}customConfigureExtensions(t,e){if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.MarkdownWordWrap){let e=this._codeMirrorModules;e&&e.EditorView&&e.EditorView.lineWrapping&&t.push(e.EditorView.lineWrapping)}return t}onContentChange(t,e){this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-MarkdownEditor",DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",ContentDataAddress:"AppData.ContentEditor.Document.Segments",ReadOnly:!1,EnableRichPreview:!0,AutoRender:!1,Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]}},{"pict-section-markdowneditor":74}],102:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-MarkdownReference",DefaultRenderable:"ContentEditor-MarkdownReference-Display",DefaultDestinationAddress:"#ContentEditor-SidebarReference-Container",AutoRender:!1,CSS:"\n\t\t.md-ref-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.md-ref-search-bar\n\t\t{\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 5;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 6px 8px;\n\t\t\tbackground: #F5F0EA;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-input\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\toutline: none;\n\t\t}\n\t\t.md-ref-search-input:focus\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.md-ref-search-nav\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\twidth: 26px;\n\t\t\theight: 26px;\n\t\t\tcursor: pointer;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.7rem;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-nav:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.md-ref-search-nav:disabled\n\t\t{\n\t\t\topacity: 0.3;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.md-ref-search-count\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tmin-width: 32px;\n\t\t\ttext-align: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tline-height: 1.6;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.md-ref-content h2\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tmargin: 20px 0 8px 0;\n\t\t\tpadding-bottom: 4px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.md-ref-content h2:first-child\n\t\t{\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.md-ref-content h3\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tmargin: 14px 0 6px 0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.md-ref-content p\n\t\t{\n\t\t\tmargin: 6px 0;\n\t\t}\n\t\t.md-ref-content code\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.md-ref-content pre\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 8px 10px;\n\t\t\toverflow-x: auto;\n\t\t\tfont-size: 0.76rem;\n\t\t\tline-height: 1.5;\n\t\t\tmargin: 6px 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.md-ref-content pre code\n\t\t{\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.md-ref-copy-btn\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tright: 4px;\n\t\t\tbackground: #FAF8F4;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.15s;\n\t\t}\n\t\t.md-ref-content pre:hover .md-ref-copy-btn\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.md-ref-copy-btn:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t/* Search highlight */\n\t\tmark.md-ref-highlight\n\t\t{\n\t\t\tbackground: #FFEAA7;\n\t\t\tcolor: inherit;\n\t\t\tpadding: 0;\n\t\t\tborder-radius: 2px;\n\t\t}\n\t\tmark.md-ref-highlight-active\n\t\t{\n\t\t\tbackground: #E8A94D;\n\t\t\tcolor: #FFF;\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-MarkdownReference-Template",Template:'\n<div class="md-ref-container">\n\t<div class="md-ref-search-bar">\n\t\t<input type="text" class="md-ref-search-input"\n\t\t\tid="ContentEditor-MdRef-SearchInput"\n\t\t\tplaceholder="Search reference..."\n\t\t\toninput="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchInput(this.value)"\n\t\t\tonkeydown="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchKeydown(event)">\n\t\t<span class="md-ref-search-count" id="ContentEditor-MdRef-SearchCount"></span>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchPrev"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(-1)" disabled>▲</button>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchNext"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(1)" disabled>▼</button>\n\t</div>\n\t<div class="md-ref-content" id="ContentEditor-MdRef-Content">\n\n<h2>Headings</h2>\n<p>Use <code>#</code> through <code>######</code> for heading levels 1–6.</p>\n<pre><code># Heading 1\n## Heading 2\n### Heading 3\n#### Heading 4\n##### Heading 5\n###### Heading 6</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Emphasis</h2>\n<p>Bold, italic, strikethrough, and combinations.</p>\n<pre><code>**bold text**\n*italic text*\n***bold and italic***\n~~strikethrough~~\n**bold and ~~strikethrough~~**</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Inline Code</h2>\n<p>Wrap text in backticks for inline code.</p>\n<pre><code>Use `console.log()` to debug.\nUse ``double backticks for `literal` backticks``.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Links</h2>\n<p>Inline links, reference links, and autolinks.</p>\n<pre><code>[Link text](https://example.com)\n[Link with title](https://example.com "Title text")\n\n[Reference link][1]\n[1]: https://example.com\n\nAutolink: https://example.com\nEmail: user@example.com</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Images</h2>\n<pre><code>\n\n\n[](https://example.com)</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Unordered Lists</h2>\n<p>Use <code>-</code>, <code>*</code>, or <code>+</code> for bullet items.</p>\n<pre><code>- Item one\n- Item two\n - Nested item\n - Another nested\n - Deeply nested\n- Item three</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Ordered Lists</h2>\n<pre><code>1. First item\n2. Second item\n3. Third item\n 1. Sub-item A\n 2. Sub-item B</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Task Lists</h2>\n<pre><code>- [x] Completed task\n- [ ] Incomplete task\n- [ ] Another task</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Blockquotes</h2>\n<pre><code>> This is a blockquote.\n>\n> It can span multiple paragraphs.\n>\n>> Nested blockquote.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Code Blocks</h2>\n<p>Use triple backticks with an optional language identifier.</p>\n<pre><code>```javascript\nfunction hello()\n{\n console.log("Hello, world!");\n}\n```\n\n```python\ndef hello():\n print("Hello, world!")\n```\n\n```css\n.container {\n display: flex;\n gap: 16px;\n}\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Tables</h2>\n<p>Use pipes and hyphens. Colons control alignment.</p>\n<pre><code>| Left Align | Center Align | Right Align |\n|:-----------|:------------:|------------:|\n| Cell 1 | Cell 2 | Cell 3 |\n| Cell 4 | Cell 5 | Cell 6 |</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Horizontal Rules</h2>\n<p>Three or more hyphens, asterisks, or underscores.</p>\n<pre><code>---\n\n***\n\n___</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Footnotes</h2>\n<pre><code>Here is a footnote reference[^1] and another[^note].\n\n[^1]: This is the footnote content.\n[^note]: Footnotes can have any label.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>HTML in Markdown</h2>\n<p>Raw HTML is allowed in GitHub-Flavored Markdown.</p>\n<pre><code><details>\n<summary>Click to expand</summary>\n\nHidden content here.\n\n</details>\n\n<kbd>Ctrl</kbd> + <kbd>S</kbd> to save.\n\n<mark>Highlighted text</mark>\n\n<sup>superscript</sup> and <sub>subscript</sub></code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Escaping Characters</h2>\n<p>Backslash-escape special markdown characters.</p>\n<pre><code>\\*not italic\\*\n\\# not a heading\n\\[not a link\\](url)\n\\`not code\\`</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Line Breaks</h2>\n<pre><code>End a line with two spaces\nto create a line break.\n\nOr use a blank line\n\nfor a new paragraph.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX — Inline Math</h2>\n<p>Wrap expressions with single dollar signs for inline math.</p>\n<pre><code>The equation $E = mc^2$ is famous.\n\nThe quadratic formula is $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$.\n\nGreek letters: $\\alpha$, $\\beta$, $\\gamma$, $\\delta$, $\\theta$, $\\pi$.\n\nSubscripts and superscripts: $x_i^2$ and $a_{n+1}$.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX — Display Math</h2>\n<p>Use double dollar signs on their own lines for display (block) math.</p>\n\n<h3>Integral</h3>\n<pre><code>$$\n\\int_{-\\infty}^{\\infty} e^{-x^2} \\, dx = \\sqrt{\\pi}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Summation</h3>\n<pre><code>$$\n\\sum_{n=1}^{\\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Matrix</h3>\n<pre><code>$$\n\\begin{bmatrix}\na & b \\\\\nc & d\n\\end{bmatrix}\n\\begin{bmatrix}\nx \\\\\ny\n\\end{bmatrix}\n=\n\\begin{bmatrix}\nax + by \\\\\ncx + dy\n\\end{bmatrix}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Aligned Equations</h3>\n<pre><code>$$\n\\begin{aligned}\nf(x) &= x^2 + 2x + 1 \\\\\n &= (x + 1)^2\n\\end{aligned}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Cases (Piecewise)</h3>\n<pre><code>$$\nf(x) = \\begin{cases}\nx^2 & \\text{if } x \\geq 0 \\\\\n-x^2 & \\text{if } x < 0\n\\end{cases}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Fractions & Limits</h3>\n<pre><code>$$\n\\lim_{x \\to 0} \\frac{\\sin x}{x} = 1\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Flowchart</h2>\n<pre><code>```mermaid\ngraph TD\n A[Start] --> B{Decision}\n B -->|Yes| C[Do something]\n B -->|No| D[Do something else]\n C --> E[End]\n D --> E\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Sequence Diagram</h2>\n<pre><code>```mermaid\nsequenceDiagram\n participant A as Alice\n participant B as Bob\n A->>B: Hello Bob\n B-->>A: Hi Alice\n A->>B: How are you?\n B-->>A: Great!\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Gantt Chart</h2>\n<pre><code>```mermaid\ngantt\n title Project Timeline\n dateFormat YYYY-MM-DD\n section Phase 1\n Research :a1, 2024-01-01, 30d\n Design :a2, after a1, 20d\n section Phase 2\n Development :b1, after a2, 40d\n Testing :b2, after b1, 15d\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Class Diagram</h2>\n<pre><code>```mermaid\nclassDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal : +int age\n Animal : +String gender\n Animal : +swim()\n Duck : +String beakColor\n Duck : +quack()\n Fish : +int sizeInFeet\n Fish : +canEat()\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — State Diagram</h2>\n<pre><code>```mermaid\nstateDiagram-v2\n [*] --> Idle\n Idle --> Processing : Start\n Processing --> Done : Complete\n Processing --> Error : Fail\n Error --> Idle : Reset\n Done --> [*]\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-MarkdownReference-Display",TemplateHash:"ContentEditor-MarkdownReference-Template",DestinationAddress:"#ContentEditor-SidebarReference-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._hasRendered=!1,this._searchMatches=[],this._currentMatchIndex=-1,this._originalContent=""}onAfterRender(t,e,i,o){this._hasRendered=!0;let n=document.getElementById("ContentEditor-MdRef-Content");return n&&(this._originalContent=n.innerHTML),this.pict.CSSMap.injectCSS(),super.onAfterRender(t,e,i,o)}copyCodeBlock(t){let e=t.closest("pre");if(!e)return;let i=e.querySelector("code");if(!i)return;let o=i.textContent;navigator.clipboard&&navigator.clipboard.writeText(o).then(()=>{t.textContent="Copied!",setTimeout(()=>{t.textContent="Copy"},1500)})}onSearchInput(t){this._performSearch(t)}onSearchKeydown(t){"Enter"===t.key&&(t.preventDefault(),t.shiftKey?this.navigateMatch(-1):this.navigateMatch(1)),"Escape"===t.key&&(t.target.value="",this._clearSearch())}navigateMatch(t){if(0===this._searchMatches.length)return;this._currentMatchIndex>=0&&this._searchMatches[this._currentMatchIndex]&&this._searchMatches[this._currentMatchIndex].classList.remove("md-ref-highlight-active"),this._currentMatchIndex+=t,this._currentMatchIndex>=this._searchMatches.length&&(this._currentMatchIndex=0),this._currentMatchIndex<0&&(this._currentMatchIndex=this._searchMatches.length-1);let e=this._searchMatches[this._currentMatchIndex];e.classList.add("md-ref-highlight-active"),e.scrollIntoView({behavior:"smooth",block:"center"}),this._updateSearchCount()}_performSearch(t){let e=document.getElementById("ContentEditor-MdRef-Content");if(!e)return;if(e.innerHTML=this._originalContent,this._searchMatches=[],this._currentMatchIndex=-1,!t||t.length<2)return this._updateSearchCount(),void this._updateNavButtons();let i,o=t.toLowerCase(),n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=[];for(;i=n.nextNode();)i.nodeValue.toLowerCase().indexOf(o)>=0&&r.push(i);for(let t=0;t<r.length;t++)this._highlightTextNode(r[t],o);this._searchMatches=Array.from(e.querySelectorAll("mark.md-ref-highlight")),this._searchMatches.length>0&&(this._currentMatchIndex=0,this._searchMatches[0].classList.add("md-ref-highlight-active"),this._searchMatches[0].scrollIntoView({behavior:"smooth",block:"center"})),this._updateSearchCount(),this._updateNavButtons()}_highlightTextNode(t,e){let i=t.nodeValue,o=i.toLowerCase(),n=t.parentNode,r=document.createDocumentFragment(),s=0,a=o.indexOf(e);for(;a>=0;){a>s&&r.appendChild(document.createTextNode(i.substring(s,a)));let t=document.createElement("mark");t.className="md-ref-highlight",t.textContent=i.substring(a,a+e.length),r.appendChild(t),s=a+e.length,a=o.indexOf(e,s)}s<i.length&&r.appendChild(document.createTextNode(i.substring(s))),n.replaceChild(r,t)}_updateSearchCount(){let t=document.getElementById("ContentEditor-MdRef-SearchCount");if(t)if(0===this._searchMatches.length){let e=document.getElementById("ContentEditor-MdRef-SearchInput");e&&e.value&&e.value.length>=2?t.textContent="0":t.textContent=""}else t.textContent=this._currentMatchIndex+1+"/"+this._searchMatches.length}_updateNavButtons(){let t=document.getElementById("ContentEditor-MdRef-SearchPrev"),e=document.getElementById("ContentEditor-MdRef-SearchNext"),i=this._searchMatches.length>0;t&&(t.disabled=!i),e&&(e.disabled=!i)}_clearSearch(){let t=document.getElementById("ContentEditor-MdRef-Content");t&&this._originalContent&&(t.innerHTML=this._originalContent),this._searchMatches=[],this._currentMatchIndex=-1,this._updateSearchCount(),this._updateNavButtons()}},e.exports.default_configuration=n},{"pict-view":76}],103:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-SettingsPanel",DefaultRenderable:"ContentEditor-SettingsPanel-Display",DefaultDestinationAddress:"#ContentEditor-SettingsPanel-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-settings-wrap\n\t\t{\n\t\t\tposition: relative;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.content-editor-settings-gear\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 6px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-radius: 4px;\n\t\t\tcolor: #B8AFA4;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-settings-gear:hover,\n\t\t.content-editor-settings-gear.active\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t}\n\t\t.content-editor-settings-gear svg\n\t\t{\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tfill: currentColor;\n\t\t}\n\t\t/* Flyout overlay — covers viewport to catch clicks outside */\n\t\t.content-editor-settings-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 999;\n\t\t}\n\t\t.content-editor-settings-overlay.open\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t/* Flyout panel */\n\t\t.content-editor-settings-flyout\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 44px;\n\t\t\tright: 0;\n\t\t\twidth: 270px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tbox-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);\n\t\t\tz-index: 1000;\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-4px);\n\t\t\tpointer-events: none;\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t}\n\t\t.content-editor-settings-flyout.open\n\t\t{\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t/* Speech bubble arrow */\n\t\t.content-editor-settings-flyout::before\n\t\t{\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: -7px;\n\t\t\tright: 12px;\n\t\t\twidth: 12px;\n\t\t\theight: 12px;\n\t\t\tbackground: #FFF;\n\t\t\tborder-left: 1px solid #DDD6CA;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\ttransform: rotate(45deg);\n\t\t}\n\t\t.content-editor-settings-flyout-body\n\t\t{\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.content-editor-settings-flyout-link\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 10px 12px;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 0.85rem;\n\t\t\tfont-weight: 500;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.content-editor-settings-flyout-link:hover\n\t\t{\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t.content-editor-settings-flyout-link svg\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tflex-shrink: 0;\n\t\t\tfill: #8A7F72;\n\t\t}\n\t\t.content-editor-settings-divider\n\t\t{\n\t\t\theight: 1px;\n\t\t\tbackground: #EDE9E3;\n\t\t\tmargin: 4px 8px;\n\t\t}\n\t\t/* Settings controls */\n\t\t.content-editor-settings-section\n\t\t{\n\t\t\tpadding: 8px 12px;\n\t\t}\n\t\t.content-editor-settings-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.content-editor-settings-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tgap: 8px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-settings-row:last-child\n\t\t{\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\taccent-color: #2E7D74;\n\t\t\tcursor: pointer;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox-label\n\t\t{\n\t\t\tfont: inherit;\n\t\t\tfont-size: 0.85rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.content-editor-settings-select\n\t\t{\n\t\t\twidth: 140px;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #FFF;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-settings-select:disabled\n\t\t{\n\t\t\topacity: 0.45;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-settings-select-label\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t/* Settings flyout: position from left edge for more room */\n\t\t\t.content-editor-settings-flyout\n\t\t\t{\n\t\t\t\tright: -8px;\n\t\t\t\twidth: 260px;\n\t\t\t}\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Full-width settings flyout on small phones */\n\t\t\t.content-editor-settings-flyout\n\t\t\t{\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 48px;\n\t\t\t\tright: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\tborder-radius: 0 0 8px 8px;\n\t\t\t}\n\t\t\t.content-editor-settings-flyout::before\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-SettingsPanel-Template",Template:'\n<div class="content-editor-settings-wrap">\n\t<button class="content-editor-settings-gear" id="ContentEditor-SettingsGear"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].togglePanel()">\n\t\t<svg viewBox="0 0 24 24"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.48.48 0 0 0-.48-.41h-3.84a.48.48 0 0 0-.48.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96a.49.49 0 0 0-.59.22L2.74 8.87a.48.48 0 0 0 .12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.26.41.48.41h3.84c.24 0 .44-.17.48-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6A3.6 3.6 0 1 1 12 8.4a3.6 3.6 0 0 1 0 7.2z"/></svg>\n\t</button>\n\t<div class="content-editor-settings-overlay" id="ContentEditor-SettingsOverlay"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].closePanel()"></div>\n\t<div class="content-editor-settings-flyout" id="ContentEditor-SettingsFlyout">\n\t\t<div class="content-editor-settings-flyout-body">\n\t\t\t<a class="content-editor-settings-flyout-link"\n\t\t\t\thref="/preview.html{~D:AppData.ContentEditor.ViewerHash~}" target="_blank">\n\t\t\t\t<svg viewBox="0 0 24 24"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>\n\t\t\t\tDocuserve Preview\n\t\t\t</a>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Word Wrap</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-MarkdownWordWrap">Markdown Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-MarkdownWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onMarkdownWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-CodeWordWrap">Code Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-CodeWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onCodeWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Markdown Editor</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-EditingControls">Editing Controls</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-EditingControls"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onEditingControlsChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreview">Auto Content Preview</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreview"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoSegment">Auto Segment Markdown</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoSegment"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoSegmentChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<span class="content-editor-settings-select-label">Segment Depth</span>\n\t\t\t\t\t<select class="content-editor-settings-select"\n\t\t\t\t\t\tid="ContentEditor-Setting-SegmentDepth"\n\t\t\t\t\t\tdisabled\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onSegmentDepthChanged(this.value)">\n\t\t\t\t\t\t<option value="1">Depth 1: Blocks</option>\n\t\t\t\t\t\t<option value="2">Depth 2: ##</option>\n\t\t\t\t\t\t<option value="3">Depth 3: ###</option>\n\t\t\t\t\t\t<option value="4">Depth 4: ####</option>\n\t\t\t\t\t\t<option value="5">Depth 5: #####</option>\n\t\t\t\t\t\t<option value="6">Depth 6: ######</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Media Preview</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewImages">Auto-Preview Images</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewImages"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewImagesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewVideo">Auto-Preview Video</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewVideo"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewVideoChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewAudio">Auto-Preview Audio</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewAudio"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewAudioChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">File Browser</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-ShowHiddenFiles">Show Hidden Files</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-ShowHiddenFiles"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onShowHiddenFilesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-SettingsPanel-Display",TemplateHash:"ContentEditor-SettingsPanel-Template",DestinationAddress:"#ContentEditor-SettingsPanel-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._isOpen=!1}onAfterRender(t,e,i,o){let n=this.pict.AppData.ContentEditor,r=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-MarkdownWordWrap");r&&r[0]&&(r[0].checked=n.MarkdownWordWrap);let s=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-CodeWordWrap");s&&s[0]&&(s[0].checked=n.CodeWordWrap);let a=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-EditingControls");a&&a[0]&&(a[0].checked=n.MarkdownEditingControls);let l=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreview");l&&l[0]&&(l[0].checked=n.AutoContentPreview);let d=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoSegment");d&&d[0]&&(d[0].checked=n.AutoSegmentMarkdown);let c=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");c&&c[0]&&(c[0].value=String(n.AutoSegmentDepth),c[0].disabled=!n.AutoSegmentMarkdown);let p=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewImages");p&&p[0]&&(p[0].checked=n.AutoPreviewImages);let h=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewVideo");h&&h[0]&&(h[0].checked=n.AutoPreviewVideo);let u=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewAudio");u&&u[0]&&(u[0].checked=n.AutoPreviewAudio);let m=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-ShowHiddenFiles");return m&&m[0]&&(m[0].checked=n.ShowHiddenFiles),super.onAfterRender(t,e,i,o)}togglePanel(){this._isOpen?this.closePanel():this.openPanel()}openPanel(){this._isOpen=!0;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.add("open"),e&&e[0]&&e[0].classList.add("open"),i&&i[0]&&i[0].classList.add("active")}closePanel(){this._isOpen=!1;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.remove("open"),e&&e[0]&&e[0].classList.remove("open"),i&&i[0]&&i[0].classList.remove("active")}onMarkdownWordWrapChanged(t){this.pict.AppData.ContentEditor.MarkdownWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e._segmentEditors)for(let i in e._segmentEditors){let o=e._segmentEditors[i];o&&o.contentDOM&&(t?o.contentDOM.classList.add("cm-lineWrapping"):o.contentDOM.classList.remove("cm-lineWrapping"))}}onCodeWordWrapChanged(t){this.pict.AppData.ContentEditor.CodeWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-CodeEditor"];e&&e._editorElement&&"code"===this.pict.AppData.ContentEditor.ActiveEditor&&(t?(e._editorElement.style.whiteSpace="pre-wrap",e._editorElement.style.overflowWrap="break-word"):(e._editorElement.style.whiteSpace="pre",e._editorElement.style.overflowWrap="normal"))}onEditingControlsChanged(t){this.pict.AppData.ContentEditor.MarkdownEditingControls=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e.toggleControls(t)}onAutoPreviewChanged(t){this.pict.AppData.ContentEditor.AutoContentPreview=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor)if(t){e.togglePreview(!0);for(let t in e._segmentEditors)e.toggleSegmentPreview(parseInt(t,10),!0)}else for(let t in e._segmentEditors)e.toggleSegmentPreview(parseInt(t,10),!1)}onAutoSegmentChanged(t){this.pict.AppData.ContentEditor.AutoSegmentMarkdown=t,this.pict.PictApplication.saveSettings();let e=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");e&&e[0]&&(e[0].disabled=!t)}onSegmentDepthChanged(t){this.pict.AppData.ContentEditor.AutoSegmentDepth=parseInt(t,10)||1,this.pict.PictApplication.saveSettings()}onAutoPreviewImagesChanged(t){this.pict.AppData.ContentEditor.AutoPreviewImages=t,this.pict.PictApplication.saveSettings()}onAutoPreviewVideoChanged(t){this.pict.AppData.ContentEditor.AutoPreviewVideo=t,this.pict.PictApplication.saveSettings()}onAutoPreviewAudioChanged(t){this.pict.AppData.ContentEditor.AutoPreviewAudio=t,this.pict.PictApplication.saveSettings()}onShowHiddenFilesChanged(t){this.pict.AppData.ContentEditor.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings();let e=this;this.pict.PictApplication.syncHiddenFilesSetting(()=>{e.pict.PictApplication.loadFileList()})}},e.exports.default_configuration=n},{"pict-view":76}],104:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"ContentEditor-TopBar-Display",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-topbar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 0;\n\t\t\theight: 48px;\n\t\t\tborder-bottom: 3px solid #2E7D74;\n\t\t\tposition: relative;\n\t\t}\n\t\t.content-editor-topbar-brand\n\t\t{\n\t\t\tpadding: 0 16px;\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #E8E0D4;\n\t\t\twhite-space: nowrap;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t/* Centered file name — absolutely positioned so it stays\n\t\t centered in the full bar regardless of left/right content */\n\t\t.content-editor-topbar-file\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t\tmax-width: 50%;\n\t\t\ttext-align: center;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.content-editor-topbar-filename\n\t\t{\n\t\t\tfont-size: 0.9rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: #E8E0D4;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-file .content-editor-dirty-indicator\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\t/* Left spacer pushes actions to the right */\n\t\t.content-editor-topbar-spacer\n\t\t{\n\t\t\tflex: 1;\n\t\t}\n\t\t.content-editor-topbar-status\n\t\t{\n\t\t\tpadding: 0 12px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-status-saving\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-status-saved\n\t\t{\n\t\t\tcolor: #7BC47F;\n\t\t}\n\t\t.content-editor-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-topbar-stats\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tpadding: 0 8px;\n\t\t\tflex-shrink: 0;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 0 12px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-topbar-btn\n\t\t{\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.content-editor-topbar-btn-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-topbar-btn-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-topbar-btn-save:disabled\n\t\t{\n\t\t\tbackground: #5E5549;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-topbar-btn-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #B8AFA4;\n\t\t\tborder: 1px solid #5E5549;\n\t\t}\n\t\t.content-editor-topbar-btn-close:hover\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t\tborder-color: #8A7F72;\n\t\t\tbackground: rgba(255, 255, 255, 0.05);\n\t\t}\n\t\t/* Close-file confirmation overlay */\n\t\t.content-editor-confirm-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-confirm-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 360px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-confirm-body\n\t\t{\n\t\t\tpadding: 24px 22px 16px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tmargin-bottom: 8px;\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-confirm-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-confirm-message\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-bottom: 16px;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.content-editor-confirm-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-btn\n\t\t{\n\t\t\tpadding: 8px 20px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 5px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-confirm-btn-discard\n\t\t{\n\t\t\tbackground: #D9534F;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-confirm-btn-discard:hover\n\t\t{\n\t\t\tbackground: #C9302C;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-confirm-footer\n\t\t{\n\t\t\tpadding: 10px 22px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t.content-editor-topbar\n\t\t\t{\n\t\t\t\theight: auto;\n\t\t\t\tmin-height: 44px;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tpadding: 4px 0;\n\t\t\t}\n\n\t\t\t/* Brand text: shrink */\n\t\t\t.content-editor-topbar-brand\n\t\t\t{\n\t\t\t\tpadding: 0 8px;\n\t\t\t\tfont-size: 0.85rem;\n\t\t\t}\n\n\t\t\t/* File name: switch from absolute centering to flow layout */\n\t\t\t.content-editor-topbar-file\n\t\t\t{\n\t\t\t\tposition: static;\n\t\t\t\ttransform: none;\n\t\t\t\tmax-width: none;\n\t\t\t\tflex: 1;\n\t\t\t\tmin-width: 0;\n\t\t\t\tpadding: 0 4px;\n\t\t\t}\n\n\t\t\t/* Hide the spacer (not needed when file is in-flow) */\n\t\t\t.content-editor-topbar-spacer\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Hide word/line count stats on mobile to save space */\n\t\t\t.content-editor-topbar-stats\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Compact action buttons */\n\t\t\t.content-editor-topbar-actions\n\t\t\t{\n\t\t\t\tgap: 4px;\n\t\t\t\tpadding: 0 6px;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-btn\n\t\t\t{\n\t\t\t\tpadding: 5px 10px;\n\t\t\t\tfont-size: 0.75rem;\n\t\t\t}\n\n\t\t\t/* Status text */\n\t\t\t.content-editor-topbar-status\n\t\t\t{\n\t\t\t\tpadding: 0 6px;\n\t\t\t\tfont-size: 0.72rem;\n\t\t\t}\n\n\t\t\t/* Confirm dialog: tighter for mobile */\n\t\t\t.content-editor-confirm-panel\n\t\t\t{\n\t\t\t\twidth: 95vw;\n\t\t\t\tmax-width: 95vw;\n\t\t\t}\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Hide brand text entirely on very small screens */\n\t\t\t.content-editor-topbar-brand\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-filename\n\t\t\t{\n\t\t\t\tfont-size: 0.8rem;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-actions\n\t\t\t{\n\t\t\t\tpadding: 0 4px;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-TopBar-Template",Template:'\n<div class="content-editor-topbar">\n\t<div class="content-editor-topbar-brand">Content Editor</div>\n\t<div class="content-editor-topbar-file">\n\t\t<span class="content-editor-topbar-filename">{~D:AppData.ContentEditor.CurrentFile~}</span>{~D:AppData.ContentEditor.DirtyIndicatorHTML~}\n\t</div>\n\t<div class="content-editor-topbar-spacer"></div>\n\t<div class="content-editor-topbar-status {~D:AppData.ContentEditor.SaveStatusClass~}">\n\t\t{~D:AppData.ContentEditor.SaveStatus~}\n\t</div>\n\t<span class="content-editor-topbar-stats" id="ContentEditor-Stats"></span>\n\t<div class="content-editor-topbar-actions">\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-save"\n\t\t\tonclick="{~P~}.PictApplication.saveCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.SaveDisabledAttr~} {~D:AppData.ContentEditor.SaveVisibilityAttr~}>Save</button>\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-close"\n\t\t\tonclick="{~P~}.PictApplication.closeCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.CloseVisibilityAttr~}>Close</button>\n\t\t<div id="ContentEditor-SettingsPanel-Container"></div>\n\t</div>\n</div>\n<div class="content-editor-confirm-overlay" id="ContentEditor-ConfirmOverlay"\n\tonclick="{~P~}.PictApplication.cancelCloseFile()">\n\t<div class="content-editor-confirm-panel" onclick="event.stopPropagation()">\n\t\t<div class="content-editor-confirm-body">\n\t\t\t<div class="content-editor-confirm-icon">⚠</div>\n\t\t\t<div class="content-editor-confirm-title">Unsaved Changes</div>\n\t\t\t<div class="content-editor-confirm-message">\n\t\t\t\tThis file has unsaved changes.<br>Close without saving?\n\t\t\t</div>\n\t\t\t<div class="content-editor-confirm-actions">\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-discard"\n\t\t\t\t\tonclick="{~P~}.PictApplication.confirmCloseFile()">Discard & Close</button>\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-cancel"\n\t\t\t\t\tonclick="{~P~}.PictApplication.cancelCloseFile()">Cancel</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="content-editor-confirm-footer">\n\t\t\t<span class="content-editor-confirm-kbd">Y</span> to discard ·\n\t\t\t<span class="content-editor-confirm-kbd">N</span> or\n\t\t\t<span class="content-editor-confirm-kbd">Esc</span> to cancel\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-TopBar-Display",TemplateHash:"ContentEditor-TopBar-Template",DestinationAddress:"#ContentEditor-TopBar-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onBeforeRender(t,e,i){let o=this.pict.AppData.ContentEditor;if(o.DirtyIndicatorHTML=o.IsDirty?' <span class="content-editor-dirty-indicator">*</span>':"",o.SaveDisabledAttr=!o.CurrentFile||o.IsSaving?"disabled":"",o.SaveVisibilityAttr=o.IsDirty||o.IsSaving||o.SaveStatus?"":'style="display:none"',o.CloseVisibilityAttr=o.CurrentFile?"":'style="display:none"',o.CurrentFile){let t=o.CurrentFile.replace(/\.md$/,"");o.ViewerHash="#/page/"+t}else o.ViewerHash="";return super.onBeforeRender(t,e,i)}onAfterRender(t,e,i,o){let n=this.pict.views["ContentEditor-SettingsPanel"];return n&&n.render(),super.onAfterRender(t,e,i,o)}},e.exports.default_configuration=n},{"pict-view":76}],105:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-Topics",DefaultRenderable:"Topics-Wrap",DefaultDestinationAddress:"#ContentEditor-SidebarTopics-Container",AutoRender:!1,CSS:"\n\t\t.topics-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.topics-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.topics-header-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-header-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-header-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-list\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\t\t.topics-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #F0EDE8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.topics-row:hover\n\t\t{\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.topics-row-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.topics-row-code\n\t\t{\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #2E7D74;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-row-title\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-path\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tgap: 2px;\n\t\t\tpadding-top: 1px;\n\t\t}\n\t\t.topics-row-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-row-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-row-btn-delete:hover\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t\tbackground: #FDF0EF;\n\t\t}\n\t\t/* Inline edit form */\n\t\t.topics-edit\n\t\t{\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #FFF9F0;\n\t\t}\n\t\t.topics-edit-field\n\t\t{\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.topics-edit-label\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 2px;\n\t\t}\n\t\t.topics-edit-input\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 4px 6px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.topics-edit-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.topics-edit-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t\tmargin-top: 8px;\n\t\t}\n\t\t.topics-edit-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-edit-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t/* Footer add button */\n\t\t.topics-footer\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.topics-add-btn\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 6px 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.topics-add-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Empty state */\n\t\t.topics-empty\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 32px 16px;\n\t\t\ttext-align: center;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t.topics-empty-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #C4BDB3;\n\t\t}\n\t\t.topics-empty-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 6px 14px;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-empty-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-empty-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.topics-empty-btn-secondary:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t",Templates:[{Hash:"Topics-Container-Template",Template:'\n<div class="topics-container" id="ContentEditor-Topics-Container">\n\t<div class="topics-header">\n\t\t<span class="topics-header-title" id="ContentEditor-Topics-HeaderTitle">Topics</span>\n\t\t<button class="topics-header-btn" title="Close topics file"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].closeTopicsFile()">×</button>\n\t</div>\n\t<div class="topics-list" id="ContentEditor-Topics-List"></div>\n\t<div class="topics-footer" id="ContentEditor-Topics-Footer">\n\t\t<button class="topics-add-btn"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].addTopic()">+ Add Topic</button>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Topics-Wrap",TemplateHash:"Topics-Container-Template",DestinationAddress:"#ContentEditor-SidebarTopics-Container"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._topics={},this._topicsFilePath="",this._hasRendered=!1,this._editingTopicCode=null}onAfterRender(){this._hasRendered=!0,this.pict.CSSMap.injectCSS(),this._topicsFilePath?(this._updateHeaderTitle(),this.renderTopicList()):this._showEmptyState()}loadTopicsFile(t,e){let i="function"==typeof e?e:()=>{},o=this;if(!t)return i("No path specified");let n=this.pict.providers["ContentEditor-Provider"];if(!n)return i("Provider not available");n.loadFile(t,(e,n)=>{if(e)return o._topics={},o._topicsFilePath="",o._hasRendered&&o._showEmptyState(),i(e);try{let t=JSON.parse(n);"object"!=typeof t||null===t||Array.isArray(t)?o._topics={}:o._topics=t}catch(t){o._topics={},o.log.warn("ContentEditor-Topics: Failed to parse topics JSON: "+t.message)}return o._topicsFilePath=t,o.pict.AppData.ContentEditor.TopicsFilePath=t,o.pict.PictApplication.saveSettings(),o._hasRendered&&(o._updateHeaderTitle(),o.renderTopicList(),o._showFooter(!0)),i(null)})}saveTopicsFile(t){let e="function"==typeof t?t:()=>{};if(!this._topicsFilePath)return e("No topics file loaded");let i=this.pict.providers["ContentEditor-Provider"];if(!i)return e("Provider not available");let o=JSON.stringify(this._topics,null,"\t");i.saveFile(this._topicsFilePath,o,e)}closeTopicsFile(){this._topics={},this._topicsFilePath="",this._editingTopicCode=null,this.pict.AppData.ContentEditor.TopicsFilePath="",this.pict.PictApplication.saveSettings(),this._hasRendered&&this._showEmptyState()}addTopic(t){if(!this._topicsFilePath)return void this._createDefaultTopicsFile(()=>{this.addTopic(t)});let e=t||{},i=e.TopicCode||this._generateUniqueCode("New-Topic"),o={TopicCode:i,TopicHelpFilePath:e.TopicHelpFilePath||"",TopicTitle:e.TopicTitle||""};"number"==typeof e.RelevantMarkdownLine&&(o.RelevantMarkdownLine=e.RelevantMarkdownLine),this._topics[i]=o;let n=this;this.saveTopicsFile(()=>{n.renderTopicList(),n.startEditTopic(i)})}removeTopic(t){if(!t||!this._topics[t])return;if(!confirm('Remove topic "'+t+'"?'))return;delete this._topics[t],this._editingTopicCode=null;let e=this;this.saveTopicsFile(()=>{e.renderTopicList()})}startEditTopic(t){if(!t||!this._topics[t])return;this._editingTopicCode=t,this.renderTopicList();let e=document.getElementById("topics-edit-code");e&&(e.focus(),e.select())}saveEditTopic(t){if(!t||!this._topics[t])return;let e=document.getElementById("topics-edit-code"),i=document.getElementById("topics-edit-title"),o=document.getElementById("topics-edit-path"),n=document.getElementById("topics-edit-line");if(!e)return;let r=e.value.trim(),s=i?i.value.trim():"",a=o?o.value.trim():"",l=n?parseInt(n.value,10):NaN;if(!r)return void(e.style.borderColor="#D9534F");if(r!==t&&this._topics[r])return e.style.borderColor="#D9534F",void alert('A topic with code "'+r+'" already exists.');r!==t&&delete this._topics[t];let d={TopicCode:r,TopicHelpFilePath:a,TopicTitle:s};!isNaN(l)&&l>0&&(d.RelevantMarkdownLine=l),this._topics[r]=d,this._editingTopicCode=null;let c=this;this.saveTopicsFile(()=>{c.renderTopicList()})}cancelEditTopic(){this._editingTopicCode=null,this.renderTopicList()}navigateToTopic(t){if(!t||!this._topics[t])return;let e=this._topics[t],i=e.TopicHelpFilePath;if(i&&(this.pict.PictApplication.navigateToFile(i),"number"==typeof e.RelevantMarkdownLine&&e.RelevantMarkdownLine>0)){let t=e.RelevantMarkdownLine;setTimeout(()=>{let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&e._segmentEditors){let i=0;for(let o in e._segmentEditors){let n=e._segmentEditors[o];if(n&&n.state&&n.state.doc){let e=n.state.doc.lines;if(i+e>=t){let o=t-i;o<1&&(o=1),o>e&&(o=e);let r=n.state.doc.line(o);n.dispatch({selection:{anchor:r.from},scrollIntoView:!0}),n.focus();break}i+=e}}}},500)}}renderTopicList(){let t=document.getElementById("ContentEditor-Topics-List");if(!t)return;let e=Object.keys(this._topics);if(0===e.length)return void(t.innerHTML='<div style="padding:16px;text-align:center;color:#8A7F72;font-size:0.78rem;">No topics yet. Click "+ Add Topic" to create one.</div>');let i="";for(let t=0;t<e.length;t++){let o=e[t],n=this._topics[o];this._editingTopicCode===o?i+=this._buildEditFormHTML(n):i+=this._buildTopicRowHTML(n)}t.innerHTML=i}_buildTopicRowHTML(t){let e=this._escapeHTML(t.TopicCode||""),i=this._escapeHTML(t.TopicTitle||""),o=this._escapeHTML(t.TopicHelpFilePath||""),n="number"==typeof t.RelevantMarkdownLine?" :"+t.RelevantMarkdownLine:"",r=this._escapeAttr(t.TopicCode||""),s="<div class=\"topics-row\" ondblclick=\"pict.views['ContentEditor-Topics'].startEditTopic('"+r+"')\">";return s+='<div class="topics-row-info">',s+='<div class="topics-row-code">'+e+"</div>",i&&(s+='<div class="topics-row-title">'+i+"</div>"),o&&(s+='<div class="topics-row-path">'+o+n+"</div>"),s+="</div>",s+='<div class="topics-row-actions">',s+='<button class="topics-row-btn" title="Edit" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].startEditTopic(\''+r+"')\">✎</button>",s+='<button class="topics-row-btn topics-row-btn-delete" title="Delete" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].removeTopic(\''+r+"')\">✖</button>",o&&(s+='<button class="topics-row-btn" title="Go to file" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].navigateToTopic(\''+r+"')\">→</button>"),s+="</div>",s+="</div>",s}_buildEditFormHTML(t){let e='<div class="topics-edit">';return e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Topic Code</label>',e+='<input class="topics-edit-input" id="topics-edit-code" type="text" value="'+this._escapeAttr(t.TopicCode||"")+'" placeholder="My-Topic-Code">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Title</label>',e+='<input class="topics-edit-input" id="topics-edit-title" type="text" value="'+this._escapeAttr(t.TopicTitle||"")+'" placeholder="Topic title">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Help File Path</label>',e+='<input class="topics-edit-input" id="topics-edit-path" type="text" value="'+this._escapeAttr(t.TopicHelpFilePath||"")+'" placeholder="path/to/file.md">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Line Number (optional)</label>',e+='<input class="topics-edit-input" id="topics-edit-line" type="number" value="'+("number"==typeof t.RelevantMarkdownLine?t.RelevantMarkdownLine:"")+'" placeholder="e.g. 23" min="1">',e+="</div>",e+='<div class="topics-edit-actions">',e+="<button class=\"topics-edit-save\" onclick=\"pict.views['ContentEditor-Topics'].saveEditTopic('"+this._escapeAttr(t.TopicCode||"")+"')\">Save</button>",e+='<button class="topics-edit-cancel" onclick="pict.views[\'ContentEditor-Topics\'].cancelEditTopic()">Cancel</button>',e+="</div>",e+="</div>",e}_showEmptyState(){let t=document.getElementById("ContentEditor-Topics-Container");if(!t){let t=document.getElementById("ContentEditor-SidebarTopics-Container");return void(t&&(t.innerHTML=this._buildEmptyStateHTML()))}t.innerHTML=this._buildEmptyStateHTML()}_buildEmptyStateHTML(){let t='<div class="topics-empty">';return t+='<div class="topics-empty-icon">📑</div>',t+="<div>No topics file loaded</div>",t+='<button class="topics-empty-btn" onclick="pict.views[\'ContentEditor-Topics\'].loadDefaultTopicsFile()">Load .pict_documentation_topics.json</button>',t+='<button class="topics-empty-btn topics-empty-btn-secondary" onclick="pict.views[\'ContentEditor-Topics\'].promptSelectTopicsFile()">Select file...</button>',t+="</div>",'<div class="topics-empty"><div class="topics-empty-icon">📑</div><div>No topics file loaded</div><button class="topics-empty-btn" onclick="pict.views[\'ContentEditor-Topics\'].loadDefaultTopicsFile()">Load .pict_documentation_topics.json</button><button class="topics-empty-btn topics-empty-btn-secondary" onclick="pict.views[\'ContentEditor-Topics\'].promptSelectTopicsFile()">Select file...</button></div>'}loadDefaultTopicsFile(){let t=this;this.loadTopicsFile(".pict_documentation_topics.json",e=>{e&&t._createDefaultTopicsFile()})}promptSelectTopicsFile(){let t=prompt("Enter the path to a topics JSON file:",".pict_documentation_topics.json");if(t&&t.trim()){let e=this;this.loadTopicsFile(t.trim(),i=>{i&&confirm('File not found. Create "'+t.trim()+'"?')&&(e._topicsFilePath=t.trim(),e._topics={},e.pict.AppData.ContentEditor.TopicsFilePath=t.trim(),e.pict.PictApplication.saveSettings(),e.saveTopicsFile(()=>{e._hasRendered&&e.render()}))})}}_createDefaultTopicsFile(t){let e="function"==typeof t?t:()=>{},i=this,o=".pict_documentation_topics.json";this._topicsFilePath=o,this._topics={},this.pict.AppData.ContentEditor.TopicsFilePath=o,this.pict.PictApplication.saveSettings(),this.saveTopicsFile(()=>{i._hasRendered&&i.render(),e()})}_updateHeaderTitle(){let t=document.getElementById("ContentEditor-Topics-HeaderTitle");if(t){let e=this._topicsFilePath.replace(/^.*\//,"");t.textContent=e||"Topics",t.title=this._topicsFilePath}}_showFooter(t){let e=document.getElementById("ContentEditor-Topics-Footer");e&&(e.style.display=t?"":"none")}_generateUniqueCode(t){if(!this._topics[t])return t;let e=2;for(;this._topics[t+"-"+e];)e++;return t+"-"+e}_escapeHTML(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_escapeAttr(t){return String(t).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}},e.exports.default_configuration=n},{"pict-view":76}],106:[function(t,e,i){var o=t("object-inspect"),n=t("es-errors/type"),r=function(t,e,i){for(var o,n=t;null!=(o=n.next);n=o)if(o.key===e)return n.next=o.next,i||(o.next=t.next,t.next=o),o};e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new n("Side channel does not contain "+o(t))},delete:function(e){var i=t&&t.next,o=function(t,e){if(t)return r(t,e,!0)}(t,e);return o&&i&&i===o&&(t=void 0),!!o},get:function(e){return function(t,e){if(t){var i=r(t,e);return i&&i.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!r(t,e)}(t,e)},set:function(e,i){t||(t={next:void 0}),function(t,e,i){var o=r(t,e);o?o.value=i:t.next={key:e,next:t.next,value:i}}(t,e,i)}};return e}},{"es-errors/type":16,"object-inspect":41}],107:[function(t,e,i){var o=t("get-intrinsic"),n=t("call-bound"),r=t("object-inspect"),s=t("es-errors/type"),a=o("%Map%",!0),l=n("Map.prototype.get",!0),d=n("Map.prototype.set",!0),c=n("Map.prototype.has",!0),p=n("Map.prototype.delete",!0),h=n("Map.prototype.size",!0);e.exports=!!a&&function(){var t,e={assert:function(t){if(!e.has(t))throw new s("Side channel does not contain "+r(t))},delete:function(e){if(t){var i=p(t,e);return 0===h(t)&&(t=void 0),i}return!1},get:function(e){if(t)return l(t,e)},has:function(e){return!!t&&c(t,e)},set:function(e,i){t||(t=new a),d(t,e,i)}};return e}},{"call-bound":8,"es-errors/type":16,"get-intrinsic":23,"object-inspect":41}],108:[function(t,e,i){var o=t("get-intrinsic"),n=t("call-bound"),r=t("object-inspect"),s=t("side-channel-map"),a=t("es-errors/type"),l=o("%WeakMap%",!0),d=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),p=n("WeakMap.prototype.has",!0),h=n("WeakMap.prototype.delete",!0);e.exports=l?function(){var t,e,i={assert:function(t){if(!i.has(t))throw new a("Side channel does not contain "+r(t))},delete:function(i){if(l&&i&&("object"==typeof i||"function"==typeof i)){if(t)return h(t,i)}else if(s&&e)return e.delete(i);return!1},get:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?d(t,i):e&&e.get(i)},has:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?p(t,i):!!e&&e.has(i)},set:function(i,o){l&&i&&("object"==typeof i||"function"==typeof i)?(t||(t=new l),c(t,i,o)):s&&(e||(e=s()),e.set(i,o))}};return i}:s},{"call-bound":8,"es-errors/type":16,"get-intrinsic":23,"object-inspect":41,"side-channel-map":107}],109:[function(t,e,i){var o=t("es-errors/type"),n=t("object-inspect"),r=t("side-channel-list"),s=t("side-channel-map"),a=t("side-channel-weakmap")||s||r;e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,i){t||(t=a()),t.set(e,i)}};return e}},{"es-errors/type":16,"object-inspect":41,"side-channel-list":106,"side-channel-map":107,"side-channel-weakmap":108}],110:[function(t,e,i){var o=t("punycode/");function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(l),c=["%","/","?",";","#"].concat(d),p=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=t("qs");function b(t,e,i){if(t&&"object"==typeof t&&t instanceof n)return t;var o=new n;return o.parse(t,e,i),o}n.prototype.parse=function(t,e,i){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),s=-1!==n&&n<t.indexOf("#")?"?":"#",l=t.split(s);l[0]=l[0].replace(/\\/g,"/");var b=t=l.join(s);if(b=b.trim(),!i&&1===t.split("#").length){var y=a.exec(b);if(y)return this.path=b,this.href=b,this.pathname=y[1],y[2]?(this.search=y[2],this.query=e?v.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=r.exec(b);if(w){var C=(w=w[0]).toLowerCase();this.protocol=C,b=b.substr(w.length)}if(i||w||b.match(/^\/\/[^@/]+@[^@/]+/)){var x="//"===b.substr(0,2);!x||w&&f[w]||(b=b.substr(2),this.slashes=!0)}if(!f[w]&&(x||w&&!g[w])){for(var A,R,E=-1,D=0;D<p.length;D++){-1!==(S=b.indexOf(p[D]))&&(-1===E||S<E)&&(E=S)}-1!==(R=-1===E?b.lastIndexOf("@"):b.lastIndexOf("@",E))&&(A=b.slice(0,R),b=b.slice(R+1),this.auth=decodeURIComponent(A)),E=-1;for(D=0;D<c.length;D++){var S;-1!==(S=b.indexOf(c[D]))&&(-1===E||S<E)&&(E=S)}-1===E&&(E=b.length),this.host=b.slice(0,E),b=b.slice(E),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var F=this.hostname.split(/\./),_=(D=0,F.length);D<_;D++){var P=F[D];if(P&&!P.match(h)){for(var k="",I=0,L=P.length;I<L;I++)P.charCodeAt(I)>127?k+="x":k+=P[I];if(!k.match(h)){var M=F.slice(0,D),B=F.slice(D+1),V=P.match(u);V&&(M.push(V[1]),B.unshift(V[2])),B.length&&(b="/"+B.join(".")+b),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=o.toASCII(this.hostname));var H=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+H,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[C])for(D=0,_=d.length;D<_;D++){var j=d[D];if(-1!==b.indexOf(j)){var O=encodeURIComponent(j);O===j&&(O=escape(j)),b=b.split(j).join(O)}}var U=b.indexOf("#");-1!==U&&(this.hash=b.substr(U),b=b.slice(0,U));var z=b.indexOf("?");if(-1!==z?(this.search=b.substr(z),this.query=b.substr(z+1),e&&(this.query=v.parse(this.query)),b=b.slice(0,z)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){H=this.pathname||"";var $=this.search||"";this.path=H+$}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",o=this.hash||"",n=!1,r="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(r=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||r&&"?"+r||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==n?(n="//"+(n||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):n||(n=""),o&&"#"!==o.charAt(0)&&(o="#"+o),s&&"?"!==s.charAt(0)&&(s="?"+s),e+n+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(s=s.replace("#","%23"))+o},n.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if("string"==typeof t){var e=new n;e.parse(t,!1,!0),t=e}for(var i=new n,o=Object.keys(this),r=0;r<o.length;r++){var s=o[r];i[s]=this[s]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),l=0;l<a.length;l++){var d=a[l];"protocol"!==d&&(i[d]=t[d])}return g[i.protocol]&&i.hostname&&!i.pathname&&(i.pathname="/",i.path=i.pathname),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!g[t.protocol]){for(var c=Object.keys(t),p=0;p<c.length;p++){var h=c[p];i[h]=t[h]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||f[t.protocol])i.pathname=t.pathname;else{for(var u=(t.pathname||"").split("/");u.length&&!(t.host=u.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==u[0]&&u.unshift(""),u.length<2&&u.unshift(""),i.pathname=u.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var m=i.pathname||"",v=i.search||"";i.path=m+v}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var b=i.pathname&&"/"===i.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=y||b||i.host&&t.pathname,C=w,x=i.pathname&&i.pathname.split("/")||[],A=(u=t.pathname&&t.pathname.split("/")||[],i.protocol&&!g[i.protocol]);if(A&&(i.hostname="",i.port=null,i.host&&(""===x[0]?x[0]=i.host:x.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===u[0]?u[0]=t.host:u.unshift(t.host)),t.host=null),w=w&&(""===u[0]||""===x[0])),y)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,x=u;else if(u.length)x||(x=[]),x.pop(),x=x.concat(u),i.search=t.search,i.query=t.query;else if(null!=t.search){if(A)i.host=x.shift(),i.hostname=i.host,(T=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=T.shift(),i.hostname=T.shift(),i.host=i.hostname);return i.search=t.search,i.query=t.query,null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!x.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var R=x.slice(-1)[0],E=(i.host||t.host||x.length>1)&&("."===R||".."===R)||""===R,D=0,S=x.length;S>=0;S--)"."===(R=x[S])?x.splice(S,1):".."===R?(x.splice(S,1),D++):D&&(x.splice(S,1),D--);if(!w&&!C)for(;D--;D)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var T,F=""===x[0]||x[0]&&"/"===x[0].charAt(0);A&&(i.hostname=F?"":x.length?x.shift():"",i.host=i.hostname,(T=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=T.shift(),i.hostname=T.shift(),i.host=i.hostname));return(w=w||i.host&&x.length)&&!F&&x.unshift(""),x.length>0?i.pathname=x.join("/"):(i.pathname=null,i.path=null),null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},n.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},i.parse=b,i.resolve=function(t,e){return b(t,!1,!0).resolve(e)},i.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},i.format=function(t){return"string"==typeof t&&(t=b(t)),t instanceof n?t.format():n.prototype.format.call(t)},i.Url=n},{"punycode/":78,qs:80}],111:[function(t,e,i){e.exports={Name:"Retold Remote",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1}},{}],112:[function(t,e,i){const o=t("retold-content-system").PictContentEditor,n=(t("pict-section-filebrowser"),t("./providers/Pict-Provider-RetoldRemote.js")),r=t("./providers/Pict-Provider-GalleryNavigation.js"),s=t("./providers/Pict-Provider-GalleryFilterSort.js"),a=t("./providers/Pict-Provider-RetoldRemoteIcons.js"),l=t("./providers/Pict-Provider-RetoldRemoteTheme.js"),d=t("./providers/Pict-Provider-FormattingUtilities.js"),c=t("./providers/Pict-Provider-ToastNotification.js"),p=t("./providers/Pict-Provider-CollectionManager.js"),h=t("./providers/Pict-Provider-AISortManager.js"),u=t("./RetoldRemote-ExtensionMaps.js"),m=t("./views/PictView-Remote-Layout.js"),f=t("./views/PictView-Remote-TopBar.js"),g=t("./views/PictView-Remote-SettingsPanel.js"),v=t("./views/PictView-Remote-Gallery.js"),b=t("./views/PictView-Remote-MediaViewer.js"),y=t("./views/PictView-Remote-ImageViewer.js"),w=t("./views/PictView-Remote-VideoExplorer.js"),C=t("./views/PictView-Remote-AudioExplorer.js"),x=t("./views/PictView-Remote-ImageExplorer.js"),A=t("./views/PictView-Remote-VLCSetup.js"),R=t("./views/PictView-Remote-CollectionsPanel.js"),E=t("./views/PictView-Remote-FileInfoPanel.js"),D=t("./Pict-Application-RetoldRemote-Configuration.json");e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},D,e),i),this.pict.addView("ContentEditor-Layout",m.default_configuration,m),this.pict.addView("ContentEditor-TopBar",f.default_configuration,f),this.pict.addView("RetoldRemote-Gallery",v.default_configuration,v),this.pict.addView("RetoldRemote-MediaViewer",b.default_configuration,b),this.pict.addView("RetoldRemote-ImageViewer",y.default_configuration,y),this.pict.addView("RetoldRemote-SettingsPanel",g.default_configuration,g),this.pict.addView("RetoldRemote-VideoExplorer",w.default_configuration,w),this.pict.addView("RetoldRemote-AudioExplorer",C.default_configuration,C),this.pict.addView("RetoldRemote-ImageExplorer",x.default_configuration,x),this.pict.addView("RetoldRemote-VLCSetup",A.default_configuration,A),this.pict.addView("RetoldRemote-CollectionsPanel",R.default_configuration,R),this.pict.addView("RetoldRemote-FileInfoPanel",E.default_configuration,E),this.pict.addProvider("RetoldRemote-Provider",n.default_configuration,n),this.pict.addProvider("RetoldRemote-GalleryNavigation",r.default_configuration,r),this.pict.addProvider("RetoldRemote-GalleryFilterSort",s.default_configuration,s),this.pict.addProvider("RetoldRemote-Icons",a.default_configuration,a),this.pict.addProvider("RetoldRemote-Theme",l.default_configuration,l),this.pict.addProvider("RetoldRemote-FormattingUtilities",d.default_configuration,d),this.pict.addProvider("RetoldRemote-ToastNotification",c.default_configuration,c),this.pict.addProvider("RetoldRemote-CollectionManager",p.default_configuration,p),this.pict.addProvider("RetoldRemote-AISortManager",h.default_configuration,h)}onAfterInitializeAsync(t){"undefined"!=typeof window&&(window.pict=this.pict),this.pict.AppData.RetoldRemote={ActiveMode:"gallery",Theme:"twilight",ViewMode:"list",ThumbnailSize:"medium",RawFileList:[],GalleryItems:[],GalleryCursorIndex:0,FolderCursorHistory:{},GalleryFilter:"all",SearchQuery:"",SearchCaseSensitive:!1,SearchRegex:!1,ServerCapabilities:{},FolderSummary:null,CurrentViewerFile:"",CurrentViewerMediaType:"",HashedFilenames:!0,ShowHiddenFiles:!1,DistractionFreeShowNav:!1,ImageFitMode:"fit",SidebarCollapsed:!1,SidebarWidth:250,AutoplayVideo:!1,AutoplayAudio:!1,ListShowExtension:!0,ListShowSize:!0,ListShowDate:!0,FilterState:{MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null},SortField:"folder-first",SortDirection:"asc",FilterBarVisible:!1,FilterPanelOpen:!1,FilterPresets:[],Collections:[],CollectionsPanelOpen:!1,CollectionsPanelWidth:300,CollectionsPanelMode:"list",ActiveCollectionGUID:null,ActiveCollection:null,CollectionSearchQuery:"",LastUsedCollectionGUID:null,BrowsingCollection:!1,BrowsingCollectionIndex:-1,FavoritesGUID:null,FavoritesCollection:null,FavoritesPathSet:{},CurrentFileMetadata:null,AISortSettings:{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"}},this._loadRemoteSettings();let e=this.pict.providers["RetoldRemote-Theme"];e&&e.applyTheme(this.pict.AppData.RetoldRemote.Theme),this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,AutoContentPreview:!1,MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:this.pict.AppData.RetoldRemote.SidebarCollapsed,SidebarWidth:this.pict.AppData.RetoldRemote.SidebarWidth,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:this.pict.AppData.RetoldRemote.ShowHiddenFiles,TopicsFilePath:""},this.pict.views["ContentEditor-Layout"].render(),this.pict.views["ContentEditor-TopBar"].render(),this.pict.views["RetoldRemote-CollectionsPanel"].render();let i=this.pict.providers["RetoldRemote-CollectionManager"];i&&i.fetchCollections(()=>{i.ensureFavoritesCollection()});let o=this.pict.views["ContentEditor-TopBar"];o&&"function"==typeof o.updateCollectionsIcon&&o.updateCollectionsIcon();let n=this,r=this.pict.providers["Pict-FileBrowser-List"];if(r){let t=r.selectFile.bind(r);r.selectFile=function(e){if(t(e),e&&"file"===e.Type)n.navigateToFile(e.Path);else if(e&&("folder"===e.Type||"archive"===e.Type)){let t=n.pict.AppData.PictFileBrowser&&n.pict.AppData.PictFileBrowser.CurrentLocation||"",i=t?t+"/"+e.Name:e.Name;n.loadFileList(i)}}}let s=this.pict.providers["Pict-FileBrowser-Browse"];if(s){let t=s.navigateToFolder.bind(s);s.navigateToFolder=function(e){t(e),n.loadFileList(e)}}let a=this.pict.providers["RetoldRemote-Provider"];a&&(a.fetchCapabilities((t,e)=>{!t&&e&&(n.pict.AppData.RetoldRemote.ServerCapabilities=e)}),a.fetchRemoteSettings((t,e)=>{!t&&e&&(n.pict.AppData.RetoldRemote.HashedFilenames=!!e.HashedFilenames)}));let l=this.pict.providers["RetoldRemote-GalleryNavigation"];l&&l.bindKeyboardNavigation();let d=window.location.hash||"";if(this.syncHiddenFilesSetting(()=>{n.loadFileList(null,()=>{d&&"#"!==d&&"#/"!==d&&"#/browse/"!==d&&"#/browse"!==d?window.location.hash=d:n.resolveHash()})}),"function"==typeof t)return t()}_getMediaType(t){return{js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0,py:!0,rb:!0,java:!0,c:!0,cpp:!0,h:!0,hpp:!0,cs:!0,go:!0,rs:!0,php:!0,sh:!0,bash:!0,zsh:!0,pl:!0,r:!0,swift:!0,kt:!0,scala:!0,lua:!0,json:!0,xml:!0,yaml:!0,yml:!0,toml:!0,ini:!0,cfg:!0,conf:!0,env:!0,properties:!0,md:!0,markdown:!0,txt:!0,csv:!0,tsv:!0,log:!0,html:!0,htm:!0,css:!0,scss:!0,sass:!0,less:!0,sql:!0,graphql:!0,gql:!0,makefile:!0,dockerfile:!0,gitignore:!0,editorconfig:!0,htaccess:!0,npmrc:!0,eslintrc:!0,prettierrc:!0}[t]?"text":u.getCategory(t)}navigateToFile(t){if(!t)return;let e=this.getEditorTypeForFile(t),i=t.replace(/^.*\./,"").toLowerCase(),o=this._getMediaType(i),n=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-Provider"]),r=n?n.getFragmentIdentifier(t):t;if(window.location.hash="#/view/"+r,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor=e,"binary"===e){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,o)}else if("text"===o){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"text")}else if("other"===o){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"document")}else{let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,o)}let s=this.pict.views["ContentEditor-TopBar"];s&&(s.updateInfo(),"function"==typeof s.updateFavoritesIcon&&s.updateFavoritesIcon())}navigateToFileAs(t,e){if(!t)return;this.pict.AppData.RetoldRemote;let i=this.pict.providers["RetoldRemote-Provider"],o=i?i.getFragmentIdentifier(t):t;window.location.hash="#/view/"+o,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor="binary";let n=this.pict.views["RetoldRemote-MediaViewer"];n&&n.showMedia(t,e);let r=this.pict.views["ContentEditor-TopBar"];r&&(r.updateInfo(),"function"==typeof r.updateFavoritesIcon&&r.updateFavoritesIcon())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},o=this,n="string"==typeof t?t:null;null===n&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(n=this.pict.AppData.PictFileBrowser.CurrentLocation);let r="/api/filebrowser/list";if(n&&n.length>0){let t=o.pict.providers["RetoldRemote-Provider"];r+=t?"?path="+t._getPathParam(n):"?path="+encodeURIComponent(n)}fetch(r).then(t=>{let e=t.headers.get("X-Retold-Folder-Hash");if(e&&n){let t=o.pict.providers["RetoldRemote-Provider"];t&&t.registerHash(n,e)}return t.json()}).then(e=>{o.pict.AppData.PictFileBrowser=o.pict.AppData.PictFileBrowser||{},o.pict.AppData.PictFileBrowser.FileList=e||[],o.pict.AppData.PictFileBrowser.CurrentLocation="string"==typeof t?t:o.pict.AppData.PictFileBrowser.CurrentLocation||"";let n=o.pict.providers["RetoldRemote-Provider"];if(n&&Array.isArray(e))for(let t=0;t<e.length;t++)e[t].Hash&&e[t].Path&&n.registerHash(e[t].Path,e[t].Hash);let r=o.pict.views["Pict-FileBrowser"];r&&r.render();let s=o.pict.views["Pict-FileBrowser-ListDetail"];s&&s.render(),o._injectSidebarAddFolderButton();let a=o.pict.AppData.RetoldRemote;a.RawFileList=e||[],a.ActiveMode="gallery",a.SearchQuery="",a.FilterState={MediaType:a.FilterState.MediaType,Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null};let l=document.getElementById("RetoldRemote-Gallery-Container"),d=document.getElementById("RetoldRemote-Viewer-Container");l&&(l.style.display=""),d&&(d.style.display="none");let c=o.pict.providers["RetoldRemote-GalleryFilterSort"];if(c)c.applyFilterSort();else{a.GalleryItems=e||[];let t=a.FolderCursorHistory&&a.FolderCursorHistory[o.pict.AppData.PictFileBrowser.CurrentLocation||""];a.GalleryCursorIndex="number"==typeof t&&t<(e||[]).length?t:0;let i=o.pict.views["RetoldRemote-Gallery"];i&&i.renderGallery()}let p=o.pict.AppData.PictFileBrowser.CurrentLocation||"",h=o.pict.providers["RetoldRemote-Provider"],u=h&&p?h.getFragmentIdentifier(p):p;window.location.hash=u?"#/browse/"+u:"#/browse/";let m=o.pict.providers["RetoldRemote-Provider"],f=/\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz)(\/|$)/i.test(p);if(m&&!f)m.fetchFolderSummary(p,(t,e)=>{if(!t&&e){a.FolderSummary=e;let t=o.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}});else{let t=o.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}return i()}).catch(t=>(o.log.error(`Failed to load file list: ${t.message}`),i()))}resolveHash(){let t=decodeURIComponent((window.location.hash||"").replace(/^#\/?/,""));if(!t)return;let e=t.split("/"),i=this.pict.providers["RetoldRemote-Provider"],o=this,n=e[0];if(["browse","view","explore","explore-audio","explore-image","edit"].indexOf(n)>=0&&e.length>=2){let t=e.slice(1).join("/"),r=i?i.resolveFragmentIdentifier(t):t;if(/^[a-f0-9]{10}$/.test(r))return void o._resolveHashFromServer(r,t=>{o._executeRoute(n,t||r)});this._executeRoute(n,r)}else if("collection"===n&&e.length>=2){let t=e[1],i=this.pict.providers["RetoldRemote-CollectionManager"];if(i){this.pict.AppData.RetoldRemote.CollectionsPanelMode="detail",i.openPanel(),i.fetchCollection(t)}}}_executeRoute(t,e){switch(t){case"browse":e!==(this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"")&&this.loadFileList(e);break;case"view":case"edit":this.pict.AppData.ContentEditor.CurrentFile!==e&&this.navigateToFile(e);break;case"explore":{let t=this.pict.views["RetoldRemote-VideoExplorer"];t&&t.showExplorer(e);break}case"explore-audio":{let t=this.pict.views["RetoldRemote-AudioExplorer"];t&&t.showExplorer(e);break}case"explore-image":{let t=this.pict.views["RetoldRemote-ImageExplorer"];t&&t.showExplorer(e);break}}}_resolveHashFromServer(t,e){let i=this;fetch("/api/resolve-hash/"+t).then(t=>t.ok?t.json():e(null)).then(o=>{if(o&&o.Success&&o.Path){let n=i.pict.providers["RetoldRemote-Provider"];n&&n.registerHash(o.Path,t);let r=o.Path.replace(/\/[^/]+$/,"")||"";return i.loadFileList(r),e(o.Path)}return e(null)}).catch(()=>e(null))}_injectSidebarAddFolderButton(){let t=document.getElementById("Pict-FileBrowser-DetailRows");if(!t)return;let e=t.parentElement.querySelector(".retold-remote-sidebar-addfolder");e&&e.parentElement.removeChild(e);let i=document.createElement("button");i.className="retold-remote-sidebar-addfolder",i.textContent="+ New Folder",i.title="Create a new folder here",i.onclick=function(){pict.PictApplication.promptNewFolder()},t.parentElement.appendChild(i)}saveSettings(){try{let t=this.pict.AppData.RetoldRemote,e={Theme:t.Theme,ViewMode:t.ViewMode,ThumbnailSize:t.ThumbnailSize,GalleryFilter:t.GalleryFilter,ShowHiddenFiles:t.ShowHiddenFiles,DistractionFreeShowNav:t.DistractionFreeShowNav,ImageFitMode:t.ImageFitMode,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,SortField:t.SortField,SortDirection:t.SortDirection,FilterPresets:t.FilterPresets,FilterPanelOpen:t.FilterPanelOpen,AutoplayVideo:t.AutoplayVideo,AutoplayAudio:t.AutoplayAudio,ListShowExtension:t.ListShowExtension,ListShowSize:t.ListShowSize,ListShowDate:t.ListShowDate,CollectionsPanelOpen:t.CollectionsPanelOpen,CollectionsPanelWidth:t.CollectionsPanelWidth,LastUsedCollectionGUID:t.LastUsedCollectionGUID,FavoritesGUID:t.FavoritesGUID,AISortSettings:t.AISortSettings};localStorage.setItem("retold-remote-settings",JSON.stringify(e))}catch(t){}}_loadRemoteSettings(){try{let t=localStorage.getItem("retold-remote-settings");if(t){let e=JSON.parse(t),i=this.pict.AppData.RetoldRemote;e.Theme&&(i.Theme=e.Theme),e.ViewMode&&(i.ViewMode=e.ViewMode),e.ThumbnailSize&&(i.ThumbnailSize=e.ThumbnailSize),e.GalleryFilter&&(i.GalleryFilter=e.GalleryFilter,i.FilterState.MediaType=e.GalleryFilter),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"boolean"==typeof e.DistractionFreeShowNav&&(i.DistractionFreeShowNav=e.DistractionFreeShowNav),e.ImageFitMode&&(i.ImageFitMode=e.ImageFitMode),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),e.SortField&&(i.SortField=e.SortField),e.SortDirection&&(i.SortDirection=e.SortDirection),Array.isArray(e.FilterPresets)&&(i.FilterPresets=e.FilterPresets),"boolean"==typeof e.FilterPanelOpen&&(i.FilterPanelOpen=e.FilterPanelOpen),"boolean"==typeof e.AutoplayVideo&&(i.AutoplayVideo=e.AutoplayVideo),"boolean"==typeof e.AutoplayAudio&&(i.AutoplayAudio=e.AutoplayAudio),"boolean"==typeof e.ListShowExtension&&(i.ListShowExtension=e.ListShowExtension),"boolean"==typeof e.ListShowSize&&(i.ListShowSize=e.ListShowSize),"boolean"==typeof e.ListShowDate&&(i.ListShowDate=e.ListShowDate),"boolean"==typeof e.CollectionsPanelOpen&&(i.CollectionsPanelOpen=e.CollectionsPanelOpen),e.CollectionsPanelWidth&&(i.CollectionsPanelWidth=e.CollectionsPanelWidth),e.LastUsedCollectionGUID&&(i.LastUsedCollectionGUID=e.LastUsedCollectionGUID),e.FavoritesGUID&&(i.FavoritesGUID=e.FavoritesGUID),e.AISortSettings&&"object"==typeof e.AISortSettings&&(e.AISortSettings.AIEndpoint&&(i.AISortSettings.AIEndpoint=e.AISortSettings.AIEndpoint),e.AISortSettings.AIModel&&(i.AISortSettings.AIModel=e.AISortSettings.AIModel),e.AISortSettings.AIProvider&&(i.AISortSettings.AIProvider=e.AISortSettings.AIProvider),e.AISortSettings.NamingTemplate&&(i.AISortSettings.NamingTemplate=e.AISortSettings.NamingTemplate))}}catch(t){}}}},{"./Pict-Application-RetoldRemote-Configuration.json":111,"./RetoldRemote-ExtensionMaps.js":114,"./providers/Pict-Provider-AISortManager.js":118,"./providers/Pict-Provider-CollectionManager.js":119,"./providers/Pict-Provider-FormattingUtilities.js":120,"./providers/Pict-Provider-GalleryFilterSort.js":121,"./providers/Pict-Provider-GalleryNavigation.js":122,"./providers/Pict-Provider-RetoldRemote.js":123,"./providers/Pict-Provider-RetoldRemoteIcons.js":124,"./providers/Pict-Provider-RetoldRemoteTheme.js":125,"./providers/Pict-Provider-ToastNotification.js":126,"./views/PictView-Remote-AudioExplorer.js":136,"./views/PictView-Remote-CollectionsPanel.js":137,"./views/PictView-Remote-FileInfoPanel.js":138,"./views/PictView-Remote-Gallery.js":139,"./views/PictView-Remote-ImageExplorer.js":140,"./views/PictView-Remote-ImageViewer.js":141,"./views/PictView-Remote-Layout.js":142,"./views/PictView-Remote-MediaViewer.js":143,"./views/PictView-Remote-SettingsPanel.js":144,"./views/PictView-Remote-TopBar.js":145,"./views/PictView-Remote-VLCSetup.js":146,"./views/PictView-Remote-VideoExplorer.js":147,"pict-section-filebrowser":54,"retold-content-system":97}],113:[function(t,e,i){e.exports={RetoldRemoteApplication:t("./Pict-Application-RetoldRemote.js")},"undefined"!=typeof window&&(window.RetoldRemoteApplication=e.exports.RetoldRemoteApplication)},{"./Pict-Application-RetoldRemote.js":112}],114:[function(t,e,i){const o={nef:!0,nrw:!0,cr2:!0,cr3:!0,crw:!0,arw:!0,srf:!0,sr2:!0,raf:!0,orf:!0,rw2:!0,rwl:!0,pef:!0,srw:!0,x3f:!0,"3fr":!0,fff:!0,iiq:!0,dcr:!0,kdc:!0,mrw:!0,erf:!0,raw:!0,dng:!0,heic:!0,heif:!0},n={png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0,tiff:!0,tif:!0,heic:!0,heif:!0};for(let t in o)n[t]=!0;const r={mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0,mpg:!0,mpeg:!0,mpe:!0,mpv:!0,m2v:!0,ts:!0,mts:!0,m2ts:!0,vob:!0,"3gp":!0,"3g2":!0,f4v:!0,rm:!0,rmvb:!0,divx:!0,asf:!0,mxf:!0,dv:!0,nsv:!0,nuv:!0,y4m:!0,wtv:!0,swf:!0,dat:!0},s={mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0},a={pdf:!0,epub:!0,mobi:!0,doc:!0,docx:!0};e.exports.RawImageExtensions=o,e.exports.ImageExtensions=n,e.exports.VideoExtensions=r,e.exports.AudioExtensions=s,e.exports.DocumentExtensions=a,e.exports.getCategory=function(t){let e=(t||"").replace(/^\./,"").toLowerCase();return n[e]?"image":r[e]?"video":s[e]?"audio":a[e]?"document":"other"},e.exports.isRawImage=function(t){let e=(t||"").replace(/^\./,"").toLowerCase();return!!o[e]}},{}],115:[function(t,e,i){
|
|
88
|
+
const o=t("fable-serviceproviderbase"),n=t("path"),r=t("fs"),s=t("url"),a={BasePath:".",APIRoutePrefix:"/api/filebrowser",WebAppRoute:"/filebrowser/*",WebAppRouteStrip:"/filebrowser/",ServeWebApp:!0,IncludeHiddenFiles:!1,MaxTreeDepth:2};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.serviceType="PictFileBrowserService";for(let t in a)t in this.options||(this.options[t]=a[t]);this.basePath=n.resolve(this.options.BasePath)}connectRoutes(){if(!this.fable.Orator||!this.fable.Orator.serviceServer)return this.log.error("PictFileBrowserService: Orator service server is not available. Initialize Orator first."),!1;let t=this.fable.Orator.serviceServer,e=this.options.APIRoutePrefix;if(t.get(e+"/list",(t,e,i)=>{let o=this.parseQueryParams(t).path||"";this.listDirectory(o,(t,o)=>t?(e.send(400,{Error:t.message}),i()):(e.send(o),i()))}),t.get(e+"/tree",(t,e,i)=>{let o=this.parseQueryParams(t),n=this.options.MaxTreeDepth;o.depth&&(n=parseInt(o.depth)||this.options.MaxTreeDepth),this.buildFolderTree("",n,(t,o)=>t?(e.send(400,{Error:t.message}),i()):(e.send(o),i()))}),t.get(e+"/info",(t,e,i)=>{let o=this.parseQueryParams(t).path||"";this.getFileInfo(o,(t,o)=>t?(e.send(400,{Error:t.message}),i()):(e.send(o),i()))}),t.get(e+"/children",(t,e,i)=>{let o=this.parseQueryParams(t).path||"";this.listChildFolders(o,(t,o)=>t?(e.send(400,{Error:t.message}),i()):(e.send(o),i()))}),this.options.ServeWebApp){let t=n.join(i,"..","www");this.fable.Orator.addStaticRoute(t,"index.html",this.options.WebAppRoute,this.options.WebAppRouteStrip)}return this.log.info("PictFileBrowserService: Routes connected. Browsing path: "+this.basePath),!0}parseQueryParams(t){if(t.query&&"object"==typeof t.query)return t.query;return s.parse(t.url,!0).query||{}}resolveSafePath(t){let e=(t||"").replace(/\.\./g,"").replace(/\/\//g,"/"),i=n.resolve(this.basePath,e);return 0!==i.indexOf(this.basePath)?null:i}listDirectory(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(o,s)=>{if(o)return"ENOENT"===o.code?e(new Error("Path not found")):"ENOTDIR"===o.code?e(new Error("Path is not a directory")):e(o);let a=[],l=s.length;if(0===l)return e(null,a);for(let o=0;o<s.length;o++){let d=s[o],c=d.name;if(!this.options.IncludeHiddenFiles&&"."===c.charAt(0)){if(l--,0===l)return e(null,a);continue}let p=n.join(i,c),h=t?t+"/"+c:c;r.stat(p,((t,i,o)=>(r,s)=>{let d={Name:t,Path:i,Type:o?"folder":"file"};if(s&&!r&&(d.Size=s.size,d.Modified=s.mtime,d.Created=s.birthtime,o||(d.Extension=n.extname(t))),a.push(d),l--,0===l)return e(null,a)})(c,h,d.isDirectory()))}})}listChildFolders(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(o,s)=>{if(o)return"ENOENT"===o.code?e(new Error("Path not found")):"ENOTDIR"===o.code?e(new Error("Path is not a directory")):e(o);let a=[];for(let t=0;t<s.length;t++){if(!s[t].isDirectory())continue;let e=s[t].name;(this.options.IncludeHiddenFiles||"."!==e.charAt(0))&&a.push(e)}if(a.sort((t,e)=>t.localeCompare(e)),0===a.length)return e(null,[]);let l=[],d=a.length;for(let o=0;o<a.length;o++){let s=a[o],c=n.join(i,s),p=t?t+"/"+s:s;r.readdir(c,{withFileTypes:!0},((t,i)=>(o,n)=>{let r=!1;if(!o&&n)for(let t=0;t<n.length;t++)if(n[t].isDirectory()){let e=n[t].name;if(this.options.IncludeHiddenFiles||"."!==e.charAt(0)){r=!0;break}}if(l.push({Name:t,Path:i,HasChildren:r}),d--,0===d)return l.sort((t,e)=>t.Name.localeCompare(e.Name)),e(null,l)})(s,p))}})}buildFolderTree(t,e,i){let o=this.resolveSafePath(t);if(!o)return i(new Error("Invalid path"));this._buildTreeRecursive(o,t,e,0,i)}_buildTreeRecursive(t,e,i,o,s){if(i>0&&o>=i)return s(null,[]);r.readdir(t,{withFileTypes:!0},(r,a)=>{if(r)return s(null,[]);let l=[];for(let t=0;t<a.length;t++)if(a[t].isDirectory()){let e=a[t].name;if(!this.options.IncludeHiddenFiles&&"."===e.charAt(0))continue;l.push(e)}if(0===l.length)return s(null,[]);let d=[],c=l.length;for(let r=0;r<l.length;r++){let a=l[r],p=n.join(t,a),h=e?e+"/"+a:a;this._buildTreeRecursive(p,h,i,o+1,((t,e)=>(i,o)=>{if(d.push({Name:t,Path:e,Children:o||[]}),c--,0===c)return d.sort((t,e)=>t.Name.localeCompare(e.Name)),s(null,d)})(a,h))}})}getFileInfo(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.stat(i,(o,r)=>{if(o)return"ENOENT"===o.code?e(new Error("Path not found")):e(o);let s=n.basename(i),a={Name:s,Path:t||s,Type:r.isDirectory()?"folder":"file",Size:r.size,Modified:r.mtime,Created:r.birthtime};return r.isDirectory()||(a.Extension=n.extname(s)),e(null,a)})}},e.exports.default_configuration=a}).call(this)}).call(this,"/node_modules/pict-section-filebrowser/source/services")},{"fable-serviceproviderbase":20,fs:2,path:42,url:113}],70:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-BrowseSearch",DefaultRenderable:"BrowseSearch-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseSearch-Container-Template",Template:'\n<div class="pict-fb-search">\n\t<input type="text" class="pict-fb-search-input"\n\t\tid="Pict-FileBrowser-SearchInput"\n\t\tplaceholder="Search files..."\n\t\toninput="pict.views[\'{~D:Record.ViewHash~}\'].onSearchInput(this.value)" />\n\t<div class="pict-fb-search-results" id="Pict-FileBrowser-SearchResults"></div>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Result-Template",Template:'\n<div class="pict-fb-search-result" onclick="{~D:Record.ClickHandler~}">\n\t<span class="pict-fb-search-result-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-search-result-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-search-result-path">{~D:Record.Path~}</span>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"BrowseSearch-Container",TemplateHash:"FileBrowser-BrowseSearch-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i),this.lastQuery="",this.debounceTimer=null}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-BrowsePane",e),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onSearchInput(t){this.lastQuery=t||"",this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.performSearch(this.lastQuery)},150)}performSearch(t){let e="#Pict-FileBrowser-SearchResults";if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent(e,"");let i=this.pict.providers["Pict-FileBrowser-Browse"];if(!i)return;let o=i.searchFiles(t),n=this.pict.providers["Pict-FileBrowser-List"];if(0===o.length){let t=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Empty-Template",{Message:"No results found"});return void this.pict.ContentAssignment.assignContent(e,t)}let r="";for(let t=0;t<o.length&&t<50;t++){let e=o[t],i=n?n.getEntryIcon(e):"📄",s=e.Path||"",a={Name:e.Name,Path:s,Icon:i,ClickHandler:"pict.views['"+this.Hash+"'].selectResult("+t+")"};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Result-Template",a)}this.pict.ContentAssignment.assignContent(e,r),this._lastResults=o}selectResult(t){if(!this._lastResults||t>=this._lastResults.length)return;let e=this._lastResults[t],i=this.pict.providers["Pict-FileBrowser-List"];i&&i.openEntry(e)}},e.exports.default_configuration=n},{"pict-view":88}],71:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-BrowseTree",DefaultRenderable:"BrowseTree-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseTree-Container-Template",Template:'<div class="pict-fb-tree" id="Pict-FileBrowser-Tree"></div>'},{Hash:"FileBrowser-BrowseTree-Node-Template",Template:'\n<div class="pict-fb-tree-node{~D:Record.SelectedClass~}" style="padding-left: {~D:Record.Indent~}px;" data-path="{~D:Record.Path~}" onclick="{~D:Record.ClickHandler~}">\n\t<span class="{~D:Record.ToggleClass~}" onclick="{~D:Record.ToggleHandler~}">{~D:Record.ToggleIcon~}</span>\n\t<span class="pict-fb-tree-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-tree-label">{~D:Record.Name~}</span>\n</div>\n<div class="pict-fb-tree-children{~D:Record.ExpandedClass~}" id="Pict-FB-TreeChildren-{~D:Record.NodeID~}">\n{~D:Record.ChildrenHTML~}\n</div>\n'}],Renderables:[{RenderableHash:"BrowseTree-Container",TemplateHash:"FileBrowser-BrowseTree-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i),this.expandedPaths={}}onAfterRender(t){return this.rebuildTree(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildTree(){if(!this.pict.providers["Pict-FileBrowser-Browse"])return;let t=this.getCurrentLocation(),e=this.renderTreeLevel("",0,t);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Tree",e)}renderTreeLevel(t,e,i){let o=this.pict.providers["Pict-FileBrowser-Browse"];if(!o)return"";let n=o.getChildFolders(t);if(!n)return this.expandedPaths[t]?'<div class="pict-fb-tree-loading" style="padding-left: '+(24+16*e)+'px;">Loading...</div>':"";let r="";for(let t=0;t<n.length;t++){let s=n[t],a=s.Path,l=a.replace(/[^a-zA-Z0-9]/g,"_"),d=!!this.expandedPaths[a],c=a===i,p=o.getChildFolders(a),h=s.HasChildren||p&&p.length>0,u="";d&&(u=this.renderTreeLevel(a,e+1,i));let m=this.pict.providers["Pict-FileBrowser-Icons"],f=m?m.getIcon("folder",16):"📁",g="";h&&(g=m?d?m.getIcon("chevron-down",10):m.getIcon("chevron-right",10):d?"▾":"▸");let v={Name:s.Name,Path:a,NodeID:l,Indent:8+16*e,Icon:f,ToggleIcon:g,ToggleClass:h?"pict-fb-tree-toggle":"pict-fb-tree-toggle-empty",ToggleHandler:h?"event.stopPropagation(); pict.views['"+this.Hash+"'].toggleNode('"+a+"')":"",ClickHandler:"pict.views['"+this.Hash+"'].selectFolder('"+a+"')",SelectedClass:c?" selected":"",ExpandedClass:d?" expanded":"",ChildrenHTML:u};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseTree-Node-Template",v)}return r}toggleNode(t){if(this.expandedPaths[t]=!this.expandedPaths[t],this.expandedPaths[t]){let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t)}}this.rebuildTree()}onRequestChildren(t){}selectFolder(t){this.expandedPaths[t]=!0;let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t),e.navigateToFolder(t)}this.rebuildTree()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=n},{"pict-view":88}],72:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-ListDetail",DefaultRenderable:"ListDetail-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListDetail-Container-Template",Template:'\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Row-Template",Template:'\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'},{Hash:"FileBrowser-Breadcrumb-Segment-Template",Template:'<span class="pict-fb-breadcrumb-segment" onclick="{~D:Record.ClickHandler~}">{~D:Record.Label~}</span>'},{Hash:"FileBrowser-Breadcrumb-Separator-Template",Template:'<span class="pict-fb-breadcrumb-separator">/</span>'},{Hash:"FileBrowser-Breadcrumb-Current-Template",Template:'<span class="pict-fb-breadcrumb-current">{~D:Record.Label~}</span>'}],Renderables:[{RenderableHash:"ListDetail-Container",TemplateHash:"FileBrowser-ListDetail-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i),this._cachedFileList=[]}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ListPane",e),this.rebuildList(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildList(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",t)}let o="";for(let n=0;n<e.length;n++){let r=e[n],s=i&&i.Name===r.Name&&i.Path===r.Path,a={Index:n,Name:r.Name,Icon:t.getEntryIcon(r),SizeFormatted:"folder"===r.Type?"--":t.formatFileSize(r.Size),ModifiedFormatted:t.formatDate(r.Modified),SelectedClass:s?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+n+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+n+")"};o+=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Row-Template",a)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",o)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="",i=this.pict.providers["Pict-FileBrowser-Icons"],o=i?i.getIcon("home",16):"🏠";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:o,ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),o="";for(let t=0;t<i.length;t++)if(o=o?o+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let n=o;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+n+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Breadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildList()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildList(),this.rebuildBreadcrumb()}sortBy(t){let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.setSortField(t),this.rebuildList()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildList(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=n},{"pict-view":88}],73:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-ListIcons",DefaultRenderable:"ListIcons-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListIcons-Container-Template",Template:'\n<div id="Pict-FileBrowser-IconList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-IconBreadcrumb"></div>\n\t<div class="pict-fb-icons" id="Pict-FileBrowser-IconGrid"></div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Item-Template",Template:'\n<div class="pict-fb-icon-item{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<div class="pict-fb-icon-graphic">{~D:Record.Icon~}</div>\n\t<div class="pict-fb-icon-label">{~D:Record.Name~}</div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ListIcons-Container",TemplateHash:"FileBrowser-ListIcons-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i),this._cachedFileList=[]}onAfterRender(t){return this.rebuildGrid(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildGrid(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",t)}let o="";for(let n=0;n<e.length;n++){let r=e[n],s=i&&i.Name===r.Name&&i.Path===r.Path,a={Index:n,Name:r.Name,Icon:t.getEntryIcon(r),SelectedClass:s?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+n+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+n+")"};o+=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Item-Template",a)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",o)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:"🏠",ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),o="";for(let t=0;t<i.length;t++)if(o=o?o+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let n=o;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+n+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconBreadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildGrid()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildGrid(),this.rebuildBreadcrumb()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildGrid(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=n},{"pict-view":88}],74:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-ViewFileInfo",DefaultRenderable:"ViewFileInfo-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewFileInfo-Container-Template",Template:'<div class="pict-fb-fileinfo" id="Pict-FileBrowser-FileInfo"></div>'},{Hash:"FileBrowser-ViewFileInfo-Detail-Template",Template:'\n<div class="pict-fb-fileinfo-title">{~D:Record.Name~}</div>\n<table class="pict-fb-fileinfo-table">\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Type</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.TypeDescription~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Size</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.SizeFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Modified</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.ModifiedFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Extension</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Extension~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Path</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Path~}</td>\n\t</tr>\n</table>\n'},{Hash:"FileBrowser-ViewFileInfo-Empty-Template",Template:'<div class="pict-fb-fileinfo-none">No file selected</div>'}],Renderables:[{RenderableHash:"ViewFileInfo-Container",TemplateHash:"FileBrowser-ViewFileInfo-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i)}onAfterRender(t){return this.rebuildFileInfo(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildFileInfo(){let t=this.pict.providers["Pict-FileBrowser-View"],e=this.pict.providers["Pict-FileBrowser-List"],i=t?t.getCurrentFile():null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Empty-Template",{});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",t)}let o={Name:i.Name||"Unknown",TypeDescription:t?t.getFileTypeDescription(i):"File",SizeFormatted:e?e.formatFileSize(i.Size):i.Size||"--",ModifiedFormatted:e?e.formatDate(i.Modified):i.Modified||"--",Extension:i.Extension||"--",Path:i.Path||"--"},n=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Detail-Template",o);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",n)}},e.exports.default_configuration=n},{"pict-view":88}],75:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-FileBrowser-ViewImage",DefaultRenderable:"ViewImage-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewImage-Container-Template",Template:'<div class="pict-fb-image-viewer" id="Pict-FileBrowser-ImageViewer"></div>'},{Hash:"FileBrowser-ViewImage-Display-Template",Template:'<img src="{~D:Record.ImageURL~}" alt="{~D:Record.Name~}" />'},{Hash:"FileBrowser-ViewImage-NoImage-Template",Template:'<div class="pict-fb-image-viewer-none">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ViewImage-Container",TemplateHash:"FileBrowser-ViewImage-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},n,e),i)}onAfterRender(t){return this.rebuildImageView(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildImageView(){let t=this.pict.providers["Pict-FileBrowser-View"],e=t?t.getCurrentFile():null;if(!e){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No file selected"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}if(!(!!t&&t.isImage(e))){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"Selected file is not an image"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let i=t?t.getImageURL(e):null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No image URL available"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let o=this.pict.parseTemplateByHash("FileBrowser-ViewImage-Display-Template",{ImageURL:i,Name:e.Name||"Image"});this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",o)}},e.exports.default_configuration=n},{"pict-view":88}],76:[function(t,e,i){const o=t("pict-view"),n=t("../Pict-Section-FileBrowser-DefaultConfiguration.js"),r=t("../providers/Pict-Provider-FileBrowserBrowse.js"),s=t("../providers/Pict-Provider-FileBrowserList.js"),a=t("../providers/Pict-Provider-FileBrowserView.js"),l=t("../providers/Pict-Provider-FileBrowserLayout.js"),d=t("../providers/Pict-Provider-FileBrowserIcons.js");e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(n)),e),i),this.pict.providers["Pict-FileBrowser-Browse"]||this.pict.addProvider("Pict-FileBrowser-Browse",r.default_configuration,r),this.pict.providers["Pict-FileBrowser-List"]||this.pict.addProvider("Pict-FileBrowser-List",s.default_configuration,s),this.pict.providers["Pict-FileBrowser-View"]||this.pict.addProvider("Pict-FileBrowser-View",a.default_configuration,a),this.pict.providers["Pict-FileBrowser-Layout"]||this.pict.addProvider("Pict-FileBrowser-Layout",l.default_configuration,l),this.pict.providers["Pict-FileBrowser-Icons"]||this.pict.addProvider("Pict-FileBrowser-Icons",d.default_configuration,d),this.ensureDefaultState()}ensureDefaultState(){let t=this.options.DefaultState||{},e=this.options.StateAddresses||{},i={AppData:this.pict.AppData,Pict:this.pict};this.pict.AppData.PictFileBrowser||(this.pict.AppData.PictFileBrowser={});for(let o in e){let n=e[o],r=this.pict.manifest.getValueByHash(i,n);if(null==r){let e=t[o];void 0!==e&&this.pict.manifest.setValueByHash(i,n,e)}}this.pict.AppData.PictFileBrowser.FileList||(this.pict.AppData.PictFileBrowser.FileList=[]),this.pict.AppData.PictFileBrowser.FolderTree||(this.pict.AppData.PictFileBrowser.FolderTree=[])}onAfterRender(t){return this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}getState(t){let e=(this.options.StateAddresses||{})[t];if(e)return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},e)}setState(t,e){let i=(this.options.StateAddresses||{})[t];i&&this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,e)}},e.exports.default_configuration=n},{"../Pict-Section-FileBrowser-DefaultConfiguration.js":62,"../providers/Pict-Provider-FileBrowserBrowse.js":64,"../providers/Pict-Provider-FileBrowserIcons.js":65,"../providers/Pict-Provider-FileBrowserLayout.js":66,"../providers/Pict-Provider-FileBrowserList.js":67,"../providers/Pict-Provider-FileBrowserView.js":68,"pict-view":88}],77:[function(t,e,i){arguments[4][59][0].apply(i,arguments)},{"./providers/Pict-Provider-Content.js":78,"./views/Pict-View-Content.js":79,dup:59}],78:[function(t,e,i){arguments[4][60][0].apply(i,arguments)},{dup:60,"pict-provider":55,"pict-section-code":58}],79:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"Pict-Content",DefaultRenderable:"Pict-Content-Display",DefaultDestinationAddress:"#Pict-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-content-code-wrap {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: auto;\n\t\t\tmargin: 1em 0;\n\t\t\tbackground: #3D3229;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers {\n\t\t\tposition: sticky;\n\t\t\tleft: 0;\n\t\t\twidth: 40px;\n\t\t\tmin-width: 40px;\n\t\t\tpadding: 1.25em 0;\n\t\t\ttext-align: right;\n\t\t\tbackground: #342A22;\n\t\t\tborder-right: 1px solid #4A3F35;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 13px;\n\t\t\tline-height: 1.5;\n\t\t\tuser-select: none;\n\t\t\tpointer-events: none;\n\t\t\tbox-sizing: border-box;\n\t\t\tz-index: 1;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers span {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0 8px 0 0;\n\t\t}\n\t\t.pict-content-code-wrap pre {\n\t\t\tmargin: 0;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em 1.25em 1.25em 8px;\n\t\t\tborder-radius: 0 6px 6px 0;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: inherit;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-content-code-wrap pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.pict-content-code-wrap .keyword { color: #C678DD; }\n\t\t.pict-content-code-wrap .string { color: #98C379; }\n\t\t.pict-content-code-wrap .number { color: #D19A66; }\n\t\t.pict-content-code-wrap .comment { color: #7F848E; font-style: italic; }\n\t\t.pict-content-code-wrap .operator { color: #56B6C2; }\n\t\t.pict-content-code-wrap .punctuation { color: #E8E0D4; }\n\t\t.pict-content-code-wrap .function-name { color: #61AFEF; }\n\t\t.pict-content-code-wrap .property { color: #E06C75; }\n\t\t.pict-content-code-wrap .tag { color: #E06C75; }\n\t\t.pict-content-code-wrap .attr-name { color: #D19A66; }\n\t\t.pict-content-code-wrap .attr-value { color: #98C379; }\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid #2E7D74;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t",Templates:[{Hash:"Pict-Content-Template",Template:'\n<div class="pict-content" id="Pict-Content-Body">\n\t<div class="pict-content-loading">Loading content...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Pict-Content-Display",TemplateHash:"Pict-Content-Template",DestinationAddress:"#Pict-Content-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}displayContent(t,e){let i=e||"Pict-Content-Body";this.pict.ContentAssignment.assignContent("#"+i,t);let o=document.getElementById(i);o&&o.parentElement&&(o.parentElement.scrollTop=0),this.renderMermaidDiagrams(i),this.renderKaTeXEquations(i)}renderMermaidDiagrams(t){if("undefined"==typeof mermaid)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let o=i.querySelectorAll("pre.mermaid");if(!(o.length<1))try{mermaid.run({nodes:o})}catch(t){this.log.error("Mermaid rendering error: "+t.message)}}renderKaTeXEquations(t){if("undefined"==typeof katex)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let o=i.querySelectorAll(".pict-content-katex-inline");for(let t=0;t<o.length;t++)try{katex.render(o[t].textContent,o[t],{throwOnError:!1,displayMode:!1})}catch(t){this.log.warn("KaTeX inline error: "+t.message)}let n=i.querySelectorAll(".pict-content-katex-display");for(let t=0;t<n.length;t++)try{katex.render(n[t].textContent,n[t],{throwOnError:!1,displayMode:!0})}catch(t){this.log.warn("KaTeX display error: "+t.message)}}showLoading(t,e){let i=e||"Pict-Content-Body",o=t||"Loading content...";this.pict.ContentAssignment.assignContent("#"+i,'<div class="pict-content-loading">'+o+"</div>")}},e.exports.default_configuration=n},{"pict-view":88}],80:[function(t,e,i){e.exports.attach=function(t){t._createEditorInContainer=function(e,i,o){let n=t._codeMirrorModules,r=[];r.push(n.EditorView.domEventHandlers({keydown:(e,o)=>(e.ctrlKey||e.metaKey)&&"b"===e.key?(e.preventDefault(),t.applyFormatting(i,"bold"),!0):(e.ctrlKey||e.metaKey)&&"i"===e.key?(e.preventDefault(),t.applyFormatting(i,"italic"),!0):(e.ctrlKey||e.metaKey)&&"e"===e.key?(e.preventDefault(),t.applyFormatting(i,"code"),!0):void 0,paste:(e,o)=>{let n=e.clipboardData&&e.clipboardData.items;if(!n)return!1;for(let o=0;o<n.length;o++)if(n[o].type.startsWith("image/")){e.preventDefault();let r=n[o].getAsFile();return r&&t._processImageFile(r,i),!0}return!1},drop:(e,o)=>{if(t._dragSourceIndex>=0)return!1;if(!e.dataTransfer||!e.dataTransfer.files||e.dataTransfer.files.length<1)return!1;let n=e.dataTransfer.files[0];if(n.type&&n.type.startsWith("image/")){e.preventDefault(),e.stopPropagation(),t._processImageFile(n,i);let r=o.dom.closest(".pict-mde-segment-editor");return r&&r.classList.remove("pict-mde-image-dragover"),!0}return!1}})),n.extensions&&Array.isArray(n.extensions)&&(r=r.concat(n.extensions)),r.push(n.EditorView.updateListener.of(e=>{e.docChanged&&t._onSegmentContentChange(i,e.state.doc.toString()),e.focusChanged&&(e.view.hasFocus?(t._setActiveSegment(i),t._updateSidebarPosition(i)):setTimeout(()=>{if(t._activeSegmentIndex===i){let e=document.getElementById(`PictMDE-Segment-${i}`);e&&!e.contains(document.activeElement)&&(t._clearActiveSegment(i),t._resetSidebarPosition(i))}},100)),e.selectionSet&&e.view.hasFocus&&t._updateSidebarPosition(i)}));let s=t._buildDataURICollapseExtension();s&&r.push(s),t.options.ReadOnly&&(r.push(n.EditorState.readOnly.of(!0)),r.push(n.EditorView.editable.of(!1))),r=t.customConfigureExtensions(r,i);let a=n.EditorState.create({doc:o||"",extensions:r}),l=new n.EditorView({state:a,parent:e});t._segmentEditors[i]=l,l.contentDOM.addEventListener("keydown",function(e){if("ArrowDown"!==e.key&&"ArrowUp"!==e.key)return;if(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)return;let o=l.state,n=o.selection.main.head,r=o.doc.lineAt(n),s=n-r.from;if("ArrowDown"===e.key){if(r.to<o.doc.length)return;let n=t._getOrderedSegmentIndices(),a=t._getLogicalIndex(i);if(a<0||a>=n.length-1)return;let l=n[a+1],d=t._segmentEditors[l];if(!d)return;e.preventDefault(),e.stopPropagation();let c=d.state.doc.line(1),p=Math.min(s,c.to-c.from);d.focus(),d.dispatch({selection:{anchor:c.from+p}}),t._setActiveSegment(l)}else if("ArrowUp"===e.key){if(r.number>1)return;let o=t._getOrderedSegmentIndices(),n=t._getLogicalIndex(i);if(n<=0)return;let a=o[n-1],l=t._segmentEditors[a];if(!l)return;e.preventDefault(),e.stopPropagation();let d=l.state.doc.line(l.state.doc.lines),c=Math.min(s,d.to-d.from);l.focus(),l.dispatch({selection:{anchor:d.from+c}}),t._setActiveSegment(a)}},!0),l.contentDOM.addEventListener("drop",function(e){if(t._dragSourceIndex>=0)return;if(!e.dataTransfer||!e.dataTransfer.files||e.dataTransfer.files.length<1)return;let o=e.dataTransfer.files[0];if(o.type&&o.type.startsWith("image/")){e.preventDefault(),e.stopPropagation(),t._processImageFile(o,i);let n=document.getElementById(`PictMDE-SegmentEditor-${i}`);n&&n.classList.remove("pict-mde-image-dragover")}},!0)},t._buildDataURICollapseExtension=function(){let e=t._codeMirrorModules;if(!(e&&e.Decoration&&e.ViewPlugin&&e.WidgetType))return null;let i=e.Decoration,o=e.ViewPlugin,n=e.WidgetType;class r extends n{constructor(t){super(),this.label=t}toDOM(){let t=document.createElement("span");return t.className="pict-mde-data-uri-collapsed",t.textContent=this.label,t.title="Data URI (click to expand in image preview below)",t}eq(t){return this.label===t.label}}function s(t){let e=[],o=t.state.doc;for(let n of t.visibleRanges){let t,s=n.from,a=n.to,l=o.sliceString(s,a),d=/!\[[^\]]*\]\(data:([^;]+);base64,/g;for(;null!==(t=d.exec(l));){let n=s+t.index+t[0].length,a=-1,l=n,d=o.length,c=Math.min(d,l+5242880),p=4096;for(let t=l;t<c;t+=p){let e=Math.min(t+p,c),i=o.sliceString(t,e).indexOf(")");if(i>=0){a=t+i;break}}if(a<0)continue;let h=a-n;if(h<200)continue;let u,m=Math.round(.75*h);u=m>=1048576?(m/1048576).toFixed(1)+"MB":m>=1024?Math.round(m/1024)+"KB":m+"B";t[1];let f=`…${u})`,g=i.replace({widget:new r(f)});e.push(g.range(n,a+1))}}return i.set(e,!0)}return o.fromClass(class{constructor(t){this.decorations=s(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=s(t.view))}},{decorations:t=>t.decorations})}}},{}],81:[function(t,e,i){e.exports.attach=function(t){t._wireSegmentDragEvents=function(e,i){let o=e.querySelector(".pict-mde-drag-handle");o&&(o.addEventListener("dragstart",o=>{t._dragSourceIndex=i,o.dataTransfer.effectAllowed="move",o.dataTransfer.setData("text/plain",String(i));let n=t._getContainerElement();n&&n.classList.add("pict-mde-dragging"),setTimeout(()=>{e.style.opacity="0.4"},0)}),o.addEventListener("dragend",()=>{e.style.opacity="",t._dragSourceIndex=-1,t._clearAllDropIndicators();let i=t._getContainerElement();i&&i.classList.remove("pict-mde-dragging")}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",t._clearAllDropIndicators();let o=e.getBoundingClientRect(),n=o.top+o.height/2;i.clientY<n?e.classList.add("pict-mde-drag-over-top"):e.classList.add("pict-mde-drag-over-bottom")}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||(e.classList.remove("pict-mde-drag-over-top"),e.classList.remove("pict-mde-drag-over-bottom"))}),e.addEventListener("drop",o=>{o.preventDefault();let n=e.classList.contains("pict-mde-drag-over-bottom");t._clearAllDropIndicators();let r=t._dragSourceIndex;r<0||r===i||t._reorderSegment(r,i,n)}))},t._clearAllDropIndicators=function(){let e=t._getContainerElement();if(!e)return;let i=e.querySelectorAll(".pict-mde-segment");for(let t=0;t<i.length;t++)i[t].classList.remove("pict-mde-drag-over-top"),i[t].classList.remove("pict-mde-drag-over-bottom")},t._reorderSegment=function(e,i,o){let n=t._getLogicalIndex(e),r=t._getLogicalIndex(i);if(n<0||r<0)return void t.log.warn(`PICT-MarkdownEditor _reorderSegment: could not resolve logical indices (from=${n}, to=${r}).`);if(n===r)return;t._marshalAllEditorsToData();let s=t._getSegmentsFromData();if(!s||s.length<2)return;let a=o?r+1:r;if(n<a&&a--,a===n)return;let l=s.splice(n,1)[0];s.splice(a,0,l),t._setSegmentsToData(s),t._reorderHiddenPreviewState(n,a),t._reorderSegmentTabStates(n,a),t._buildEditorUI()},t._reorderHiddenPreviewState=function(e,i){if(e===i)return;let o=Object.keys(t._hiddenPreviewSegments).map(t=>parseInt(t,10));if(0===o.length)return;let n=Math.max(...o,e,i),r=[];for(let e=0;e<=n;e++)r.push(!!t._hiddenPreviewSegments[e]);let s=r.splice(e,1)[0];r.splice(i,0,s),t._hiddenPreviewSegments={};for(let e=0;e<r.length;e++)r[e]&&(t._hiddenPreviewSegments[e]=!0)},t._swapHiddenPreviewState=function(e,i){let o=!!t._hiddenPreviewSegments[e];!!t._hiddenPreviewSegments[i]?t._hiddenPreviewSegments[e]=!0:delete t._hiddenPreviewSegments[e],o?t._hiddenPreviewSegments[i]=!0:delete t._hiddenPreviewSegments[i]},t._reorderSegmentTabStates=function(e,i){if(e===i)return;let o=Object.keys(t._segmentTabStates).map(t=>parseInt(t,10));if(0===o.length)return;let n=Math.max(...o,e,i),r=[];for(let e=0;e<=n;e++)r.push(t._segmentTabStates[e]||"editor");let s=r.splice(e,1)[0];r.splice(i,0,s),t._segmentTabStates={};for(let e=0;e<r.length;e++)"editor"!==r[e]&&(t._segmentTabStates[e]=r[e])},t._swapSegmentTabStates=function(e,i){let o=t._segmentTabStates[e]||"editor",n=t._segmentTabStates[i]||"editor";"editor"!==n?t._segmentTabStates[e]=n:delete t._segmentTabStates[e],"editor"!==o?t._segmentTabStates[i]=o:delete t._segmentTabStates[i]},t._setActiveSegment=function(e){if(t._activeSegmentIndex>=0&&t._activeSegmentIndex!==e){let e=document.getElementById(`PictMDE-Segment-${t._activeSegmentIndex}`);e&&e.classList.remove("pict-mde-active")}t._activeSegmentIndex=e;let i=document.getElementById(`PictMDE-Segment-${e}`);i&&i.classList.add("pict-mde-active")},t._clearActiveSegment=function(e){t._activeSegmentIndex===e&&(t._activeSegmentIndex=-1);let i=document.getElementById(`PictMDE-Segment-${e}`);i&&i.classList.remove("pict-mde-active"),t._resetSidebarPosition(e)},t._updateSidebarPosition=function(e){let i=document.getElementById(`PictMDE-Segment-${e}`);if(!i)return;let o=i.querySelector(".pict-mde-quadrant-tr");if(!o)return;let n=t._segmentEditors[e];if(!n)return;let r=n.state.selection.main.head,s=n.coordsAtPos(r);if(!s)return void t._resetSidebarPosition(e);let a=i.getBoundingClientRect(),l=s.top-a.top,d=o.offsetHeight||0,c=i.offsetHeight||0,p=Math.max(0,c-d);l=Math.max(0,Math.min(l,p)),o.classList.add("pict-mde-sidebar-at-cursor"),o.style.setProperty("--pict-mde-sidebar-top",`${l}px`)},t._resetSidebarPosition=function(t){let e=document.getElementById(`PictMDE-Segment-${t}`);if(!e)return;let i=e.querySelector(".pict-mde-quadrant-tr");i&&(i.classList.remove("pict-mde-sidebar-at-cursor"),i.style.removeProperty("--pict-mde-sidebar-top"))}}},{}],82:[function(t,e,i){const o={bold:{wrap:"**"},italic:{wrap:"*"},code:{wrap:"`"},heading:{prefix:"# "},link:{before:"[",after:"](url)"}};e.exports.attach=function(t){t.applyFormatting=function(e,i){let n=t._segmentEditors[e];if(!n)return void t.log.warn(`PICT-MarkdownEditor applyFormatting: no editor for segment ${e}.`);let r=o[i];if(!r)return void t.log.warn(`PICT-MarkdownEditor applyFormatting: unknown format type "${i}".`);let s,a,l=n.state,d=l.selection.main,c=d.from,p=d.to,h=c!==p,u=h?l.sliceDoc(c,p):"";if(r.wrap){let t=r.wrap;if(h){let e=l.sliceDoc(Math.max(0,c-t.length),c),i=l.sliceDoc(p,Math.min(l.doc.length,p+t.length));if(e===t&&i===t)return s=[{from:c-t.length,to:c,insert:""},{from:p,to:p+t.length,insert:""}],a=c-t.length,void n.dispatch({changes:s,selection:{anchor:a,head:a+u.length}});s={from:c,to:p,insert:t+u+t},a=c+t.length,n.dispatch({changes:s,selection:{anchor:a,head:a+u.length}})}else{s={from:c,insert:t+t},a=c+t.length,n.dispatch({changes:s,selection:{anchor:a}})}}else if(r.prefix){let t=l.doc.lineAt(c);s=t.text.startsWith(r.prefix)?{from:t.from,to:t.from+r.prefix.length,insert:""}:{from:t.from,insert:r.prefix},n.dispatch({changes:s})}else if(r.before&&r.after)if(h){s={from:c,to:p,insert:r.before+u+r.after},a=c+r.before.length+u.length+2,n.dispatch({changes:s,selection:{anchor:a,head:a+3}})}else{s={from:c,insert:r.before+r.after},a=c+r.before.length,n.dispatch({changes:s,selection:{anchor:a}})}n.focus()}}},{}],83:[function(t,e,i){e.exports.attach=function(t){t.openImagePicker=function(e){let i=document.getElementById(`PictMDE-ImageInput-${e}`);i?(i.onchange=()=>{i.files&&i.files.length>0&&t._processImageFile(i.files[0],e),i.value=""},i.click()):t.log.warn(`PICT-MarkdownEditor openImagePicker: file input not found for segment ${e}.`)},t._processImageFile=function(e,i){if(!e||!e.type||!e.type.startsWith("image/"))return void t.log.warn(`PICT-MarkdownEditor _processImageFile: not an image file (type: ${e?e.type:"null"}).`);let o=e.name?e.name.replace(/\.[^.]+$/,""):"image";if(t.onImageUpload(e,i,(e,n)=>{e?t.log.error(`PICT-MarkdownEditor image upload error: ${e}`):n&&t._insertImageMarkdown(i,n,o)}))return;if("undefined"==typeof FileReader)return void t.log.error("PICT-MarkdownEditor _processImageFile: FileReader not available in this environment.");let n=new FileReader;n.onload=()=>{t._insertImageMarkdown(i,n.result,o)},n.onerror=()=>{t.log.error("PICT-MarkdownEditor _processImageFile: FileReader error.")},n.readAsDataURL(e)},t._insertImageMarkdown=function(e,i,o){let n=t._segmentEditors[e];if(!n)return void t.log.warn(`PICT-MarkdownEditor _insertImageMarkdown: no editor for segment ${e}.`);let r=``,s=n.state.selection.main.head;n.dispatch({changes:{from:s,insert:r},selection:{anchor:s+r.length}}),n.focus(),t._updateImagePreviews(e)},t._updateImagePreviews=function(e){let i=document.getElementById(`PictMDE-ImagePreview-${e}`);if(!i)return;let o=t._segmentEditors[e];if(!o)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let n,r=o.state.doc.toString(),s=/!\[([^\]]*)\]\(([^)]+)\)/g,a=[];for(;null!==(n=s.exec(r));)a.push({alt:n[1]||"image",url:n[2]});if(0===a.length)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let l="";for(let e=0;e<a.length;e++){let i=a[e].alt.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");l+=`<div class="pict-mde-image-preview-item"><img src="${t._resolveImageURL(a[e].url).replace(/&/g,"&").replace(/"/g,""")}" alt="${i}" /><span class="pict-mde-image-preview-label">${i}</span></div>`}i.innerHTML=l,i.classList.add("pict-mde-has-images")},t._wireImageDragEvents=function(e,i){e.addEventListener("dragover",i=>{t._dragSourceIndex>=0||!i.dataTransfer||!i.dataTransfer.types||i.dataTransfer.types.indexOf("Files")<0||(i.preventDefault(),i.dataTransfer.dropEffect="copy",e.classList.add("pict-mde-image-dragover"))}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||e.classList.remove("pict-mde-image-dragover")}),e.addEventListener("drop",o=>{if(e.classList.remove("pict-mde-image-dragover"),t._dragSourceIndex>=0)return;if(!o.dataTransfer||!o.dataTransfer.files||o.dataTransfer.files.length<1)return;let n=o.dataTransfer.files[0];n.type&&n.type.startsWith("image/")&&(o.preventDefault(),o.stopPropagation(),t._processImageFile(n,i))})}}},{}],84:[function(t,e,i){const o=t("pict-section-content").PictContentProvider;e.exports.attach=function(t){t._getContentProvider=function(){return t._contentProvider||(t._contentProvider=new o(t.fable,{},"Pict-Content-Provider-MDE")),t._contentProvider},t._updateRichPreviews=function(e){if(!t.options.EnableRichPreview)return;let i=document.getElementById(`PictMDE-RichPreview-${e}`);if(!i)return;let o=t._segmentEditors[e];if(!o)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let n=o.state.doc.toString();if(!n||0===n.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let r=t._getContentProvider().parseMarkdown(n);if(!r||0===r.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let s=`PictMDE-RichPreviewBody-${e}`;if(i.innerHTML=`<div class="pict-content" id="${s}">${r}</div>`,i.classList.add("pict-mde-has-rich-preview"),t.options.ImageBaseURL){let e=i.querySelectorAll("img");for(let i=0;i<e.length;i++){let o=e[i].getAttribute("src");if(o){let n=t._resolveImageURL(o);n!==o&&e[i].setAttribute("src",n)}}}let a=(t._richPreviewGenerations[e]||0)+1;t._richPreviewGenerations[e]=a,t._postRenderMermaid(s,e,a),t._postRenderKaTeX(s)},t._postRenderMermaid=function(e,i,o){if("undefined"==typeof mermaid)return;let n=document.getElementById(e);if(!n)return;let r=n.querySelectorAll("pre.mermaid");if(!(r.length<1))try{let e=mermaid.run({nodes:r});e&&"function"==typeof e.catch&&e.catch(e=>{(-1===i?t._renderedViewGeneration:t._richPreviewGenerations[i])===o&&t.log.warn(`PICT-MarkdownEditor mermaid render error: ${e.message||e}`)})}catch(e){t.log.warn(`PICT-MarkdownEditor mermaid render error: ${e.message||e}`)}},t._postRenderKaTeX=function(e){if("undefined"==typeof katex)return;let i=document.getElementById(e);if(!i)return;let o=i.querySelectorAll(".pict-content-katex-inline");for(let e=0;e<o.length;e++)try{katex.render(o[e].textContent,o[e],{throwOnError:!1,displayMode:!1})}catch(e){t.log.warn(`PICT-MarkdownEditor KaTeX inline error: ${e.message||e}`)}let n=i.querySelectorAll(".pict-content-katex-display");for(let e=0;e<n.length;e++)try{katex.render(n[e].textContent,n[e],{throwOnError:!1,displayMode:!0})}catch(e){t.log.warn(`PICT-MarkdownEditor KaTeX display error: ${e.message||e}`)}},t._escapeHTMLForPreview=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},t.toggleRenderedView=function(e){t._renderedViewActive="boolean"==typeof e?e:!t._renderedViewActive,t._renderedViewActive?t._renderRenderedView():t._restoreEditingView()},t._renderRenderedView=function(){let e=t._getContainerElement();if(!e)return;t._marshalAllEditorsToData();let i=t._getSegmentsFromData(),o="";if(i&&i.length>0){let t=[];for(let e=0;e<i.length;e++)t.push(i[e].Content||"");o=t.join("\n\n")}for(let e in t._segmentEditors)t._segmentEditors[e]&&t._segmentEditors[e].destroy();t._segmentEditors={};let n=t._getContentProvider().parseMarkdown(o),r="PictMDE-RenderedView";if(e.innerHTML=`<div class="pict-mde-rendered-view" id="${r}"><div class="pict-content">${n||""}</div></div>`,e.classList.add("pict-mde-rendered-mode"),t.options.ImageBaseURL){let i=e.querySelectorAll(".pict-mde-rendered-view img");for(let e=0;e<i.length;e++){let o=i[e].getAttribute("src");if(o){let n=t._resolveImageURL(o);n!==o&&i[e].setAttribute("src",n)}}}t._renderedViewGeneration++;let s=t._renderedViewGeneration,a=e.querySelector(`#${r} .pict-content`);if(a){let e="PictMDE-RenderedViewContent";a.id=e,t._postRenderMermaid(e,-1,s),t._postRenderKaTeX(e)}},t._restoreEditingView=function(){let e=t._getContainerElement();e&&(e.classList.remove("pict-mde-rendered-mode"),t._buildEditorUI())}}},{"pict-section-content":77}],85:[function(t,e,i){e.exports={DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#MarkdownEditor-Container-Div",Templates:[{Hash:"MarkdownEditor-Container",Template:'<div class="pict-mde" id="PictMDE-Container"></div>'},{Hash:"MarkdownEditor-Segment",Template:'<div class="pict-mde-segment" id="PictMDE-Segment-{~D:Record.SegmentIndex~}" data-segment-index="{~D:Record.SegmentIndex~}">\n\t<div class="pict-mde-left-controls">\n\t\t<div class="pict-mde-quadrant-tl"></div>\n\t\t<div class="pict-mde-quadrant-bl"></div>\n\t</div>\n\t<div class="pict-mde-drag-handle" draggable="true" title="Drag to reorder"></div>\n\t<div class="pict-mde-segment-body">\n\t\t<div class="pict-mde-tab-bar" id="PictMDE-TabBar-{~D:Record.SegmentIndex~}">\n\t\t\t<button type="button" class="pict-mde-tab pict-mde-tab-active" data-tab="editor" onclick="{~D:Record.ViewIdentifier~}.switchSegmentTab({~D:Record.SegmentIndex~}, \'editor\')">Edit</button>\n\t\t\t<button type="button" class="pict-mde-tab" data-tab="preview" onclick="{~D:Record.ViewIdentifier~}.switchSegmentTab({~D:Record.SegmentIndex~}, \'preview\')">Preview</button>\n\t\t</div>\n\t\t<div class="pict-mde-segment-editor" id="PictMDE-SegmentEditor-{~D:Record.SegmentIndex~}"></div>\n\t\t<div class="pict-mde-preview-pane" id="PictMDE-PreviewPane-{~D:Record.SegmentIndex~}">\n\t\t\t<div class="pict-mde-image-preview" id="PictMDE-ImagePreview-{~D:Record.SegmentIndex~}"></div>\n\t\t\t<div class="pict-mde-rich-preview" id="PictMDE-RichPreview-{~D:Record.SegmentIndex~}"></div>\n\t\t</div>\n\t</div>\n\t<div class="pict-mde-sidebar" id="PictMDE-Sidebar-{~D:Record.SegmentIndex~}">\n\t\t<div class="pict-mde-quadrant-tr"></div>\n\t\t<div class="pict-mde-quadrant-br"></div>\n\t\t<input type="file" accept="image/*" class="pict-mde-image-input" id="PictMDE-ImageInput-{~D:Record.SegmentIndex~}" style="display:none" />\n\t</div>\n</div>'},{Hash:"MarkdownEditor-AddSegment",Template:'<div class="pict-mde-add-segment">\n\t<button type="button" class="pict-mde-btn-add" onclick="{~D:Record.ViewIdentifier~}.addSegment()">+ Add Segment</button>\n</div>'}],Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#MarkdownEditor-Container-Div"}],TargetElementAddress:"#MarkdownEditor-Container-Div",ContentDataAddress:!1,ReadOnly:!1,EnableRichPreview:!0,DefaultPreviewMode:"off",ImageBaseURL:"",ButtonsTL:[{HTML:"×",Action:"removeSegment",Class:"pict-mde-btn-remove",Title:"Remove Segment"}],ButtonsBL:[{HTML:"↑",Action:"moveSegmentUp",Class:"pict-mde-btn-move",Title:"Move Up"},{HTML:"↓",Action:"moveSegmentDown",Class:"pict-mde-btn-move",Title:"Move Down"},{HTML:"⊞",Action:"toggleControls",Class:"pict-mde-btn-linenums",Title:"Toggle Controls"},{HTML:"◎",Action:"cyclePreviewMode",Class:"pict-mde-btn-preview",Title:"Cycle Preview Mode"}],ButtonsTR:[{HTML:"<b>B</b>",Action:"applyFormatting:bold",Class:"",Title:"Bold (Ctrl+B)"},{HTML:"<i>I</i>",Action:"applyFormatting:italic",Class:"",Title:"Italic (Ctrl+I)"},{HTML:"<code><></code>",Action:"applyFormatting:code",Class:"",Title:"Inline Code (Ctrl+E)"},{HTML:"#",Action:"applyFormatting:heading",Class:"",Title:"Heading"},{HTML:"[ ]",Action:"applyFormatting:link",Class:"",Title:"Link"},{HTML:"▣",Action:"openImagePicker",Class:"pict-mde-sidebar-btn-image",Title:"Insert Image"}],ButtonsBR:[],CSS:"\n/* ---- Container ---- */\n.pict-mde\n{\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\tfont-size: 14px;\n}\n\n/* ---- Segment row: left-controls | drag-handle | editor body | sidebar ---- */\n.pict-mde-segment\n{\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: stretch;\n\tmargin-bottom: 6px;\n\tmin-height: 48px;\n\ttransition: background-color 0.15s ease;\n}\n\n/* ---- Left controls column ---- */\n.pict-mde-left-controls\n{\n\tflex: 0 0 22px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 2px 0;\n}\n\n/* ---- Left-side quadrants ---- */\n.pict-mde-quadrant-tl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tposition: sticky;\n\ttop: 2px;\n\tz-index: 2;\n}\n.pict-mde-quadrant-bl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tposition: sticky;\n\tbottom: 2px;\n\tz-index: 2;\n}\n\n/* ---- Left-side buttons (shared base) ---- */\n.pict-mde-left-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 20px;\n\theight: 20px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tcolor: #888;\n\tline-height: 1;\n\tfont-family: inherit;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n}\n.pict-mde-segment:hover .pict-mde-left-btn,\n.pict-mde-segment.pict-mde-active .pict-mde-left-btn\n{\n\topacity: 1;\n}\n.pict-mde-left-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-btn-remove:hover\n{\n\tcolor: #CC3333;\n}\n.pict-mde-btn-linenums\n{\n\tfont-size: 11px;\n\tfont-weight: 600;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n/* Highlight when controls are active */\n.pict-mde.pict-mde-controls-on .pict-mde-btn-linenums\n{\n\tcolor: #4A90D9;\n}\n.pict-mde-btn-preview\n{\n\tfont-size: 11px;\n}\n/* Preview button: highlight when any preview mode is active */\n.pict-mde.pict-mde-preview-bottom .pict-mde-btn-preview,\n.pict-mde.pict-mde-preview-side .pict-mde-btn-preview,\n.pict-mde.pict-mde-preview-tabbed .pict-mde-btn-preview\n{\n\tcolor: #4A90D9;\n}\n/* Dim preview button when mode is off */\n.pict-mde.pict-mde-preview-off .pict-mde-btn-preview\n{\n\tcolor: #CCC;\n}\n\n/* ---- Drag handle (simple grey bar) ---- */\n.pict-mde-drag-handle\n{\n\tflex: 0 0 8px;\n\tcursor: grab;\n\tbackground: #EDEDED;\n\ttransition: background-color 0.15s ease;\n\tuser-select: none;\n}\n.pict-mde-drag-handle:active\n{\n\tcursor: grabbing;\n}\n.pict-mde-drag-handle:hover\n{\n\tbackground: #C8C8C8;\n}\n\n/* ---- Editor body (middle column) ---- */\n.pict-mde-segment-body\n{\n\tflex: 1 1 0%;\n\tmin-width: 0;\n\toverflow: hidden;\n\tbackground: #FFFFFF;\n\ttransition: background-color 0.15s ease;\n}\n.pict-mde-segment-editor\n{\n\tmin-height: 48px;\n}\n\n/* ---- Image preview area below the editor ---- */\n.pict-mde-image-preview\n{\n\tdisplay: none;\n}\n.pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tborder-top: 1px solid #EDEDED;\n}\n.pict-mde-image-preview img\n{\n\tmax-width: 200px;\n\tmax-height: 150px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tobject-fit: contain;\n\tbackground: #F8F8F8;\n}\n.pict-mde-image-preview-item\n{\n\tposition: relative;\n\tdisplay: inline-block;\n}\n.pict-mde-image-preview-label\n{\n\tdisplay: block;\n\tfont-size: 10px;\n\tcolor: #999;\n\tmargin-top: 2px;\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* ---- Rich content preview area (rendered via pict-section-content) ---- */\n.pict-mde-rich-preview\n{\n\tdisplay: none;\n}\n.pict-mde-rich-preview.pict-mde-has-rich-preview\n{\n\tdisplay: block;\n\tborder-top: 1px solid #EDEDED;\n\tbackground: #FCFCFC;\n\toverflow: hidden;\n}\n/* Constrain images in the rich preview even if pict-section-content CSS loads late */\n.pict-mde-rich-preview img\n{\n\tmax-width: 100%;\n\theight: auto;\n}\n/* ---- Preview layout modes ---- */\n\n/* Tab bar: hidden by default, shown only in tabbed mode */\n.pict-mde-tab-bar\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-tab-bar\n{\n\tdisplay: flex;\n\tgap: 0;\n\tborder-bottom: 1px solid #EDEDED;\n\tbackground: #F8F8F8;\n}\n.pict-mde-tab\n{\n\tpadding: 4px 12px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tcolor: #888;\n\tborder-bottom: 2px solid transparent;\n\tfont-family: inherit;\n}\n.pict-mde-tab:hover\n{\n\tcolor: #222;\n}\n.pict-mde-tab.pict-mde-tab-active\n{\n\tcolor: #4A90D9;\n\tborder-bottom-color: #4A90D9;\n}\n\n/* Off mode: hide all preview panes and tab bars */\n.pict-mde.pict-mde-preview-off .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-off .pict-mde-tab-bar\n{\n\tdisplay: none;\n}\n/* Legacy class alias for backward compatibility */\n.pict-mde.pict-mde-previews-hidden .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n\n/* Bottom mode: vertical stacking (default flex-column behavior) */\n.pict-mde.pict-mde-preview-bottom .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n/* Side-by-side mode: editor and preview side by side */\n.pict-mde.pict-mde-preview-side .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: row;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-segment-editor\n{\n\tflex: 1 1 50%;\n\tmin-width: 0;\n\toverflow: hidden;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-preview-pane\n{\n\tflex: 1 1 50%;\n\tmin-width: 0;\n\toverflow: auto;\n\tborder-left: 1px solid #EDEDED;\n}\n/* Side-by-side: remove top borders since preview is beside, not below */\n.pict-mde.pict-mde-preview-side .pict-mde-rich-preview.pict-mde-has-rich-preview\n{\n\tborder-top: none;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-image-preview.pict-mde-has-images\n{\n\tborder-top: none;\n}\n\n/* Tabbed mode: default hides preview, shows editor */\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: column;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n/* Tabbed mode: when showing preview, hide editor and show preview */\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment.pict-mde-tab-showing-preview .pict-mde-segment-editor\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment.pict-mde-tab-showing-preview .pict-mde-preview-pane\n{\n\tdisplay: block;\n}\n\n/* Per-segment preview hide: only applies in bottom and side modes */\n.pict-mde.pict-mde-preview-bottom .pict-mde-segment.pict-mde-preview-hidden .pict-mde-preview-pane,\n.pict-mde.pict-mde-preview-side .pict-mde-segment.pict-mde-preview-hidden .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n/* Constrain the pict-content inside the preview to fit the segment */\n.pict-mde-rich-preview .pict-content\n{\n\tpadding: 12px;\n\tmax-width: none;\n\tmargin: 0;\n\tfont-size: 13px;\n}\n/* Reduce heading sizes in the preview to be proportional */\n.pict-mde-rich-preview .pict-content h1\n{\n\tfont-size: 1.4em;\n\tmargin-top: 0;\n}\n.pict-mde-rich-preview .pict-content h2\n{\n\tfont-size: 1.2em;\n\tmargin-top: 0.75em;\n}\n.pict-mde-rich-preview .pict-content h3\n{\n\tfont-size: 1.1em;\n\tmargin-top: 0.6em;\n}\n\n/* ---- Rendered view (full document preview mode) ---- */\n.pict-mde-rendered-view\n{\n\tpadding: 16px 20px;\n\tbackground: #FFFFFF;\n\tmin-height: 120px;\n}\n.pict-mde-rendered-view .pict-content\n{\n\tmax-width: none;\n\tmargin: 0;\n}\n/* Hide the add-segment button in rendered mode */\n.pict-mde.pict-mde-rendered-mode .pict-mde-add-segment\n{\n\tdisplay: none;\n}\n\n/* Focused / active editor gets subtle warm background */\n.pict-mde-segment.pict-mde-active .pict-mde-segment-body\n{\n\tbackground: #FAFAF5;\n}\n.pict-mde-segment.pict-mde-active .pict-mde-drag-handle\n{\n\tbackground: #9CB4C8;\n}\n\n/* ---- Right sidebar column ---- */\n.pict-mde-sidebar\n{\n\tflex: 0 0 30px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tposition: relative;\n}\n\n/* ---- Right-side quadrants ---- */\n.pict-mde-quadrant-tr\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease, top 0.1s ease;\n\tposition: sticky;\n\ttop: 0;\n}\n.pict-mde-quadrant-br\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n\tposition: sticky;\n\tbottom: 0;\n}\n\n/* Active segment always shows its right-side quadrants */\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n/* When no segment is active, hovering shows both left + right controls */\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n\n/* ---- Controls-hidden mode: right quadrants show faintly on hover ---- */\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-br\n{\n\topacity: 0;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n\n/* When JS sets a cursor-relative offset, switch TR from sticky to absolute positioning */\n.pict-mde-quadrant-tr.pict-mde-sidebar-at-cursor\n{\n\tposition: absolute;\n\ttop: var(--pict-mde-sidebar-top, 0px);\n}\n\n/* ---- Right-side buttons (shared base) ---- */\n.pict-mde-sidebar-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 22px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tborder-radius: 3px;\n\tcolor: #666;\n\tline-height: 1;\n\tfont-family: inherit;\n}\n.pict-mde-sidebar-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-sidebar-btn b\n{\n\tfont-size: 13px;\n\tfont-weight: 700;\n}\n.pict-mde-sidebar-btn i\n{\n\tfont-size: 13px;\n\tfont-style: italic;\n}\n.pict-mde-sidebar-btn code\n{\n\tfont-size: 10px;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n\n/* ---- Add segment button ---- */\n.pict-mde-add-segment\n{\n\tmargin-top: 6px;\n\tpadding-left: 30px;\n}\n.pict-mde-btn-add\n{\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 7px;\n\tborder: 2px dashed #D0D0D0;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: #999;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\tcursor: pointer;\n\ttransition: all 0.15s ease;\n}\n.pict-mde-btn-add:hover\n{\n\tborder-color: #4A90D9;\n\tcolor: #4A90D9;\n\tbackground: rgba(74, 144, 217, 0.04);\n}\n\n/* ---- Image drag-over indicator ---- */\n.pict-mde-segment-editor.pict-mde-image-dragover\n{\n\toutline: 2px dashed #4A90D9;\n\toutline-offset: -2px;\n}\n\n/* ---- Drag-in-progress: prevent CodeMirror from intercepting drop events ---- */\n.pict-mde.pict-mde-dragging .pict-mde-segment-editor\n{\n\tpointer-events: none;\n}\n\n/* ---- Drop target indicators for drag reorder ---- */\n.pict-mde-segment.pict-mde-drag-over-top\n{\n\tbox-shadow: 0 -2px 0 0 #4A90D9;\n}\n.pict-mde-segment.pict-mde-drag-over-bottom\n{\n\tbox-shadow: 0 2px 0 0 #4A90D9;\n}\n\n/* ---- CodeMirror overrides inside segments ---- */\n.pict-mde-segment-editor .cm-editor\n{\n\tborder: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-scroller\n{\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.6;\n}\n.pict-mde-segment-editor .cm-editor.cm-focused\n{\n\toutline: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-content\n{\n\tpadding: 8px 12px;\n\tmin-height: 36px;\n}\n.pict-mde-segment-editor .cm-editor .cm-gutters\n{\n\tbackground: #F8F8F8;\n\tborder-right: 1px solid #E8E8E8;\n\tcolor: #BBB;\n}\n\n/* ---- Collapsed data URI widget ---- */\n.pict-mde-data-uri-collapsed\n{\n\tdisplay: inline;\n\tbackground: #F0F0F0;\n\tcolor: #888;\n\tfont-size: 11px;\n\tpadding: 1px 4px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n\tcursor: default;\n\twhite-space: nowrap;\n}\n\n/* ---- Line number / controls toggle: gutters hidden by default ---- */\n.pict-mde .cm-editor .cm-gutters\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-controls-on .cm-editor .cm-gutters\n{\n\tdisplay: flex;\n}\n\n/* ============================================\n RESPONSIVE: Tablet / Phone (max-width: 768px)\n ============================================ */\n@media (max-width: 768px)\n{\n\t/* Prevent any horizontal overflow in the editor */\n\t.pict-mde\n\t{\n\t\toverflow-x: hidden;\n\t\tmax-width: 100%;\n\t}\n\n\t/* Reduce the left controls column width */\n\t.pict-mde-left-controls\n\t{\n\t\tflex: 0 0 16px;\n\t}\n\t.pict-mde-left-btn\n\t{\n\t\twidth: 16px;\n\t\theight: 18px;\n\t\tfont-size: 10px;\n\t}\n\n\t/* Make left-side buttons always visible on touch (no hover) */\n\t.pict-mde-left-btn\n\t{\n\t\topacity: 0.6;\n\t}\n\n\t/* Narrow the drag handle */\n\t.pict-mde-drag-handle\n\t{\n\t\tflex: 0 0 5px;\n\t}\n\n\t/* Shrink the right sidebar column */\n\t.pict-mde-sidebar\n\t{\n\t\tflex: 0 0 24px;\n\t}\n\t.pict-mde-sidebar-btn\n\t{\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tfont-size: 11px;\n\t}\n\n\t/* Make right sidebar buttons always visible (touch devices) */\n\t.pict-mde-quadrant-tr,\n\t.pict-mde-quadrant-br\n\t{\n\t\topacity: 0.7;\n\t}\n\t.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n\t.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n\t{\n\t\topacity: 1;\n\t}\n\n\t/* Reduce CodeMirror content padding */\n\t.pict-mde-segment-editor .cm-editor .cm-content\n\t{\n\t\tpadding: 6px 6px;\n\t}\n\n\t/* Reduce font size slightly for more content on screen */\n\t.pict-mde-segment-editor .cm-editor .cm-scroller\n\t{\n\t\tfont-size: 13px;\n\t}\n\n\t/* Add segment button: reduce left margin */\n\t.pict-mde-add-segment\n\t{\n\t\tpadding-left: 21px;\n\t}\n\n\t/* Side-by-side: fall back to vertical stacking on narrow screens */\n\t.pict-mde.pict-mde-preview-side .pict-mde-segment-body\n\t{\n\t\tflex-direction: column;\n\t}\n\t.pict-mde.pict-mde-preview-side .pict-mde-preview-pane\n\t{\n\t\tborder-left: none;\n\t\tborder-top: 1px solid #EDEDED;\n\t}\n\n\t/* Tab bar: smaller on tablet */\n\t.pict-mde-tab\n\t{\n\t\tpadding: 3px 8px;\n\t\tfont-size: 11px;\n\t}\n\n\t/* Rich preview: less padding */\n\t.pict-mde-rich-preview .pict-content\n\t{\n\t\tpadding: 8px;\n\t\tfont-size: 12px;\n\t}\n\n\t/* Image previews: smaller max dimensions */\n\t.pict-mde-image-preview img\n\t{\n\t\tmax-width: 120px;\n\t\tmax-height: 100px;\n\t}\n\n\t/* Rendered view: less padding */\n\t.pict-mde-rendered-view\n\t{\n\t\tpadding: 10px 8px;\n\t}\n}\n\n/* ============================================\n RESPONSIVE: Small phone (max-width: 480px)\n ============================================ */\n@media (max-width: 480px)\n{\n\t/* Wrap segment so left controls flow to the top as a horizontal bar */\n\t.pict-mde-segment\n\t{\n\t\tflex-wrap: wrap;\n\t}\n\n\t/* Left controls become a horizontal toolbar at the top of the segment */\n\t.pict-mde-left-controls\n\t{\n\t\tflex: 0 0 100%;\n\t\tflex-direction: row;\n\t\tjustify-content: flex-start;\n\t\tgap: 2px;\n\t\tpadding: 3px 4px;\n\t\torder: -1;\n\t\tbackground: #F5F5F5;\n\t\tborder-bottom: 1px solid #EDEDED;\n\t}\n\t.pict-mde-left-btn\n\t{\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tfont-size: 12px;\n\t\topacity: 0.7;\n\t}\n\n\t/* Left quadrants flow horizontally */\n\t.pict-mde-quadrant-tl,\n\t.pict-mde-quadrant-bl\n\t{\n\t\tflex-direction: row;\n\t\tgap: 2px;\n\t\tposition: static;\n\t}\n\n\t/* Segment body: explicit basis so it fills the wrapped row */\n\t.pict-mde-segment-body\n\t{\n\t\tflex: 1 1 calc(100% - 20px);\n\t}\n\n\t/* Hide drag handle on very small screens */\n\t.pict-mde-drag-handle\n\t{\n\t\tdisplay: none;\n\t}\n\n\t/* Right sidebar: further shrink */\n\t.pict-mde-sidebar\n\t{\n\t\tflex: 0 0 20px;\n\t}\n\t.pict-mde-sidebar-btn\n\t{\n\t\twidth: 18px;\n\t\theight: 18px;\n\t\tfont-size: 10px;\n\t}\n\n\t/* Add segment: no left offset since controls are at top */\n\t.pict-mde-add-segment\n\t{\n\t\tpadding-left: 0;\n\t}\n\n\t/* Even tighter CodeMirror padding */\n\t.pict-mde-segment-editor .cm-editor .cm-content\n\t{\n\t\tpadding: 4px 4px;\n\t}\n}\n"}},{}],86:[function(t,e,i){const o=t("pict-view"),n=t("pict-section-content"),r=t("./Pict-Section-MarkdownEditor-DefaultConfiguration.js"),s=t("./Pict-MDE-Formatting.js"),a=t("./Pict-MDE-ImageHandling.js"),l=t("./Pict-MDE-DragAndReorder.js"),d=t("./Pict-MDE-RichPreview.js"),c=t("./Pict-MDE-CodeMirror.js");e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this._codeMirrorModules=null,this._segmentEditors={},this._segmentCounter=0,this._viewCallIdentifier=!1,this._activeSegmentIndex=-1,this._dragSourceIndex=-1,this._controlsVisible=!0,this._previewMode=this.options.DefaultPreviewMode||"off",this._lastPreviewLayout="bottom",this._segmentTabStates={},this._hiddenPreviewSegments={},this._imagePreviewTimers={},this._richPreviewTimers={},this._richPreviewGenerations={},this._contentProvider=null,this._renderedViewActive=!1,this._renderedViewGeneration=0,s.attach(this),a.attach(this),l.attach(this),d.attach(this),c.attach(this)}onBeforeInitialize(){return super.onBeforeInitialize(),this.targetElement=!1,super.onBeforeInitialize()}connectCodeMirrorModules(t){if(!t||"object"!=typeof t||"function"!=typeof t.EditorView||"function"!=typeof t.EditorState)return"undefined"!=typeof window&&window.CodeMirrorModules&&"function"==typeof window.CodeMirrorModules.EditorView?(this.log.trace("PICT-MarkdownEditor Found CodeMirror modules on window.CodeMirrorModules."),void(this._codeMirrorModules=window.CodeMirrorModules)):(this.log.error("PICT-MarkdownEditor No CodeMirror modules found. Provide them via connectCodeMirrorModules() or set window.CodeMirrorModules."),!1);this._codeMirrorModules=t}onAfterRender(t){return this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeMirrorModules||this.connectCodeMirrorModules(),!this._codeMirrorModules)return this.log.error("PICT-MarkdownEditor Cannot initialize; no CodeMirror modules available."),!1;if(this.options.EnableRichPreview){let t=n.default_configuration;t&&t.CSS&&this.pict.CSSMap.addCSS("Pict-Content-View",t.CSS)}let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error(`PICT-MarkdownEditor Could not find target element [${this.options.TargetElementAddress}]!`),this.targetElement=!1,!1;this.targetElement=t[0],this._viewCallIdentifier=this._resolveViewCallIdentifier(),this._buildEditorUI()}_resolveViewCallIdentifier(){let t=this.pict.views;for(let e in t)if(t[e]===this)return`_Pict.views.${e}`;return`_Pict.servicesMap.PictView['${this.Hash}']`}_getContainerElement(){if(this.targetElement){let t=this.targetElement.querySelector(".pict-mde");if(t)return t}return this.targetElement||null}_resolveImageURL(t){if(!t||!this.options.ImageBaseURL)return t;if(t.startsWith("/")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:"))return t;let e=this.options.ImageBaseURL;return e&&!e.endsWith("/")&&(e+="/"),e+t}_buildEditorUI(){let t=this._getContainerElement();t&&!t.classList.contains("pict-mde")&&t.classList.add("pict-mde");for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();t.innerHTML="",t.classList.remove("pict-mde-preview-off","pict-mde-preview-bottom","pict-mde-preview-side","pict-mde-preview-tabbed","pict-mde-previews-hidden"),t.classList.add("pict-mde-preview-"+this._previewMode),this._controlsVisible?t.classList.add("pict-mde-controls-on"):t.classList.add("pict-mde-controls-hidden");let e=this._getSegmentsFromData();e&&0!==e.length||(e=[{Content:""}],this._setSegmentsToData(e)),this._segmentCounter=0,this._segmentEditors={};for(let i=0;i<e.length;i++)this._renderSegment(t,i,e[i].Content||"");this._renderAddButton(t)}_renderSegment(t,e,i){let o=this._segmentCounter++,n={SegmentIndex:o,SegmentDisplayIndex:e+1,ViewIdentifier:this._viewCallIdentifier},r=this.pict.parseTemplateByHash("MarkdownEditor-Segment",n),s=document.createElement("div");s.innerHTML=r;let a=s.firstElementChild;if(t.appendChild(a),this._buildQuadrantButtons(a,o),this._hiddenPreviewSegments[e]&&a.classList.add("pict-mde-preview-hidden"),"tabbed"===this._previewMode&&"preview"===this._segmentTabStates[e]){a.classList.add("pict-mde-tab-showing-preview");let t=a.querySelector(".pict-mde-tab-bar");if(t){let e=t.querySelector('[data-tab="editor"]'),i=t.querySelector('[data-tab="preview"]');e&&e.classList.remove("pict-mde-tab-active"),i&&i.classList.add("pict-mde-tab-active")}}this._wireSegmentDragEvents(a,o);let l=document.getElementById(`PictMDE-SegmentEditor-${o}`);l&&(this._createEditorInContainer(l,o,i),this._wireImageDragEvents(l,o),i&&(this._updateImagePreviews(o),this._updateRichPreviews(o)))}_buildQuadrantButtons(t,e){let i=[{key:"ButtonsTL",selector:".pict-mde-quadrant-tl",baseClass:"pict-mde-left-btn"},{key:"ButtonsBL",selector:".pict-mde-quadrant-bl",baseClass:"pict-mde-left-btn"},{key:"ButtonsTR",selector:".pict-mde-quadrant-tr",baseClass:"pict-mde-sidebar-btn"},{key:"ButtonsBR",selector:".pict-mde-quadrant-br",baseClass:"pict-mde-sidebar-btn"}],o=this;for(let n=0;n<i.length;n++){let r=i[n],s=t.querySelector(r.selector);if(!s)continue;let a=this.options[r.key];if(Array.isArray(a))for(let t=0;t<a.length;t++){let i=a[t],n=document.createElement("button");n.type="button",n.className=r.baseClass,i.Class&&(n.className+=" "+i.Class),n.innerHTML=i.HTML||"",n.title=i.Title||"";let l=i.Action||"",d=l,c=null,p=l.indexOf(":");p>=0&&(d=l.substring(0,p),c=l.substring(p+1)),function(t,e,i){n.addEventListener("click",()=>{"function"==typeof o[t]?null!==e?o[t](i,e):o[t](i):o.log.warn(`PICT-MarkdownEditor _buildQuadrantButtons: method "${t}" not found.`)})}(d,c,e),s.appendChild(n)}}}customConfigureExtensions(t,e){return t}_renderAddButton(t){let e={ViewIdentifier:this._viewCallIdentifier},i=this.pict.parseTemplateByHash("MarkdownEditor-AddSegment",e),o=document.createElement("div");o.innerHTML=i;let n=o.firstElementChild;t.appendChild(n)}onImageUpload(t,e,i){return!1}toggleControls(t,e){let i=e;"boolean"==typeof t&&(i=t),this._controlsVisible="boolean"==typeof i?i:!this._controlsVisible;let o=this._getContainerElement();o&&(this._controlsVisible?(o.classList.add("pict-mde-controls-on"),o.classList.remove("pict-mde-controls-hidden")):(o.classList.remove("pict-mde-controls-on"),o.classList.add("pict-mde-controls-hidden")))}toggleLineNumbers(t){this.toggleControls(t)}togglePreview(t){"boolean"==typeof t?t?this.setPreviewMode(this._lastPreviewLayout||"bottom"):this.setPreviewMode("off"):"off"===this._previewMode?this.setPreviewMode(this._lastPreviewLayout||"bottom"):this.setPreviewMode("off")}setPreviewMode(t){if(["off","bottom","side","tabbed"].indexOf(t)<0)return void this.log.warn(`PICT-MarkdownEditor setPreviewMode: unknown mode "${t}".`);"off"!==t&&(this._lastPreviewLayout=t),this._previewMode=t;let e=this._getContainerElement();if(e&&(e.classList.remove("pict-mde-preview-off","pict-mde-preview-bottom","pict-mde-preview-side","pict-mde-preview-tabbed","pict-mde-previews-hidden"),e.classList.add("pict-mde-preview-"+t)),"off"!==t){let t=this._getOrderedSegmentIndices();for(let e=0;e<t.length;e++)this._updateRichPreviews(t[e]),this._updateImagePreviews(t[e])}}cyclePreviewMode(t){let e=["off","bottom","side","tabbed"],i=(e.indexOf(this._previewMode)+1)%e.length;this.setPreviewMode(e[i])}switchSegmentTab(t,e){let i=this._getLogicalIndex(t);if(i<0)return;this._segmentTabStates[i]=e;let o=document.getElementById(`PictMDE-Segment-${t}`);if(!o)return;"preview"===e?(o.classList.add("pict-mde-tab-showing-preview"),this._updateRichPreviews(t),this._updateImagePreviews(t)):o.classList.remove("pict-mde-tab-showing-preview");let n=document.getElementById(`PictMDE-TabBar-${t}`);if(n){let t=n.querySelectorAll(".pict-mde-tab");for(let i=0;i<t.length;i++)t[i].getAttribute("data-tab")===e?t[i].classList.add("pict-mde-tab-active"):t[i].classList.remove("pict-mde-tab-active")}}toggleSegmentPreview(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let o=!!this._hiddenPreviewSegments[i];o="boolean"==typeof e?!e:!o,o?this._hiddenPreviewSegments[i]=!0:delete this._hiddenPreviewSegments[i];let n=document.getElementById(`PictMDE-Segment-${t}`);n&&(o?n.classList.add("pict-mde-preview-hidden"):(n.classList.remove("pict-mde-preview-hidden"),this._updateRichPreviews(t),this._updateImagePreviews(t)))}_getSegmentsFromData(){if(!this.options.ContentDataAddress)return null;const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.ContentDataAddress);return Array.isArray(e)?e:null}_setSegmentsToData(t){if(!this.options.ContentDataAddress)return;const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.ContentDataAddress,t)}_onSegmentContentChange(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let o=this._getSegmentsFromData();if(!o)return;i<o.length&&(o[i].Content=e),this.onContentChange(i,e);let n=this;this._imagePreviewTimers[t]&&clearTimeout(this._imagePreviewTimers[t]),this._imagePreviewTimers[t]=setTimeout(()=>{n._updateImagePreviews(t),delete n._imagePreviewTimers[t]},500),this._richPreviewTimers[t]&&clearTimeout(this._richPreviewTimers[t]),this._richPreviewTimers[t]=setTimeout(()=>{n._updateRichPreviews(t),delete n._richPreviewTimers[t]},500)}onContentChange(t,e){}_getLogicalIndex(t){let e=this._getContainerElement();if(!e)return-1;let i=e.querySelectorAll(".pict-mde-segment");for(let e=0;e<i.length;e++){if(parseInt(i[e].getAttribute("data-segment-index"),10)===t)return e}return-1}_getOrderedSegmentIndices(){let t=this._getContainerElement();if(!t)return[];let e=t.querySelectorAll(".pict-mde-segment"),i=[];for(let t=0;t<e.length;t++)i.push(parseInt(e[t].getAttribute("data-segment-index"),10));return i}addSegment(t){let e="string"==typeof t?t:"",i=this._getSegmentsFromData();i||(i=[]),i.push({Content:e}),this._setSegmentsToData(i),this._buildEditorUI()}removeSegment(t){let e=this._getLogicalIndex(t);if(e<0)return void this.log.warn(`PICT-MarkdownEditor removeSegment: segment index ${t} not found.`);let i=this._getSegmentsFromData();if(!i||i.length<=1)return void this.log.warn("PICT-MarkdownEditor removeSegment: cannot remove the last segment.");this._segmentEditors[t]&&(this._segmentEditors[t].destroy(),delete this._segmentEditors[t]),i.splice(e,1),this._setSegmentsToData(i);let o={};for(let t in this._hiddenPreviewSegments){let i=parseInt(t,10);i<e?o[i]=!0:i>e&&(o[i-1]=!0)}this._hiddenPreviewSegments=o;let n={};for(let t in this._segmentTabStates){let i=parseInt(t,10);i<e?n[i]=this._segmentTabStates[t]:i>e&&(n[i-1]=this._segmentTabStates[t])}this._segmentTabStates=n,this._buildEditorUI()}moveSegmentUp(t){let e=this._getLogicalIndex(t);if(e<=0)return;this._marshalAllEditorsToData();let i=this._getSegmentsFromData();if(!i)return;let o=i[e];i[e]=i[e-1],i[e-1]=o,this._swapHiddenPreviewState(e,e-1),this._swapSegmentTabStates(e,e-1),this._buildEditorUI()}moveSegmentDown(t){let e=this._getLogicalIndex(t),i=this._getSegmentsFromData();if(!i||e<0||e>=i.length-1)return;this._marshalAllEditorsToData();let o=i[e];i[e]=i[e+1],i[e+1]=o,this._swapHiddenPreviewState(e,e+1),this._swapSegmentTabStates(e,e+1),this._buildEditorUI()}getSegmentContent(t){let e=this._getOrderedSegmentIndices();if(t<0||t>=e.length)return"";let i=e[t],o=this._segmentEditors[i];return o?o.state.doc.toString():""}setSegmentContent(t,e){let i=this._getOrderedSegmentIndices();if(t<0||t>=i.length)return void this.log.warn(`PICT-MarkdownEditor setSegmentContent: index ${t} out of range.`);let o=i[t],n=this._segmentEditors[o];n&&n.dispatch({changes:{from:0,to:n.state.doc.length,insert:e}})}getSegmentCount(){return this._getOrderedSegmentIndices().length}getAllContent(t){let e="string"==typeof t?t:"\n\n",i=this._getOrderedSegmentIndices(),o=[];for(let t=0;t<i.length;t++){let e=this._segmentEditors[i[t]];e&&o.push(e.state.doc.toString())}return o.join(e)}_marshalAllEditorsToData(){let t=this._getSegmentsFromData();if(!t)return;let e=this._getOrderedSegmentIndices();for(let i=0;i<e.length;i++){let o=this._segmentEditors[e[i]];o&&i<t.length&&(t[i].Content=o.state.doc.toString())}}setReadOnly(t){this.options.ReadOnly=t,this.initialRenderComplete&&(this._marshalAllEditorsToData(),this._buildEditorUI())}marshalToView(){super.marshalToView(),this.initialRenderComplete&&this.options.ContentDataAddress&&this._buildEditorUI()}marshalFromView(){super.marshalFromView(),this._marshalAllEditorsToData()}destroy(){for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();this._segmentEditors={};for(let t in this._richPreviewTimers)clearTimeout(this._richPreviewTimers[t]);this._richPreviewTimers={},this._richPreviewGenerations={},this._segmentTabStates={}}},e.exports.default_configuration=r},{"./Pict-MDE-CodeMirror.js":80,"./Pict-MDE-DragAndReorder.js":81,"./Pict-MDE-Formatting.js":82,"./Pict-MDE-ImageHandling.js":83,"./Pict-MDE-RichPreview.js":84,"./Pict-Section-MarkdownEditor-DefaultConfiguration.js":85,"pict-section-content":77,"pict-view":88}],87:[function(t,e,i){e.exports={name:"pict-view",version:"1.0.67",description:"Pict View Base Class",main:"source/Pict-View.js",scripts:{test:"npx quack test",tests:"npx quack test -g",start:"node source/Pict-View.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-view-image:local","docker-dev-run":'docker run -it -d --name pict-view-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-view" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-view-image:local',"docker-dev-shell":"docker exec -it pict-view-dev /bin/bash",types:"tsc -p .",lint:"eslint source/**"},types:"types/source/Pict-View.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-view.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-view/issues"},homepage:"https://github.com/stevenvelozo/pict-view#readme",devDependencies:{"@eslint/js":"^9.39.1","browser-env":"^3.3.0",eslint:"^9.39.1",pict:"^1.0.348",quackage:"^1.0.58",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{fable:"^3.1.63","fable-serviceproviderbase":"^3.0.19"}}},{}],88:[function(t,e,i){const o=t("fable-serviceproviderbase"),n=t("../package.json"),r={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoRender:!0,AutoRenderOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,CSSHash:!1,CSS:!1,CSSProvider:!1,CSSPriority:500,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),i),this.fable,this.options,this.UUID,this.Hash,this.log;const o=this.Hash===this.UUID;this.UUID=`V-${this.UUID}`,o&&(this.Hash=this.UUID),this.options.ViewIdentifier||(this.options.ViewIdentifier=`AutoViewID-${this.fable.getUUID()}`),this.serviceType="PictView",this._Package=n,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1,this.lastRenderedTimestamp=!1,this.lastMarshalFromViewTimestamp=!1,this.lastMarshalToViewTimestamp=!1,this.pict.instantiateServiceProviderIfNotExists("TransactionTracking");for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];"Hash"in e&&"Template"in e?(e.Source||(e.Source=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} options object.`),this.pict.TemplateProvider.addTemplate(e.Hash,e.Template,e.Source)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Template ${t} in the options array.`,e)}for(let t=0;t<this.options.DefaultTemplates.length;t++){let e=this.options.DefaultTemplates[t];"Postfix"in e&&"Template"in e?(e.Source||(e.Source=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} options object.`),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Default Template ${t} in the options array.`,e)}if(this.options.CSS){let t=this.options.CSSHash?this.options.CSSHash:`View-${this.options.ViewIdentifier}`,e=this.options.CSSProvider?this.options.CSSProvider:t;this.pict.CSSMap.addCSS(t,this.options.CSS,e,this.options.CSSPriority)}this.renderables={};for(let t=0;t<this.options.Renderables.length;t++){let e=this.options.Renderables[t];this.addRenderable(e)}}addRenderable(t,e,i,o,n){let r;if("object"==typeof t)r=t;else{r={RenderableHash:t,TemplateHash:e,DefaultTemplateRecordAddress:i,ContentDestinationAddress:o,RenderMethod:"string"!=typeof n?n:"replace"}}"string"!=typeof r.RenderableHash||"string"!=typeof r.TemplateHash?this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Renderable; RenderableHash or TemplateHash are invalid.`,r):(this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} adding renderable [${r.RenderableHash}] pointed to template ${r.TemplateHash}.`),this.renderables[r.RenderableHash]=r)}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialize:`),this.initializeTimestamp?(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialize called but initialization is already completed. Aborting.`),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initializeAsync:`),this.initializeTimestamp)return this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} async initialize called but initialization is already completed. Aborting.`),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} beginning initialization...`),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(e&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialization failed: ${e.message||e}`,{stack:e.stack}),this.initializeTimestamp=this.pict.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.info(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialization complete.`),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onBeforeRender(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeRender:`),!0}onBeforeRenderAsync(t,e){return this.onBeforeRender(e),t()}onBeforeProject(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeProject:`),!0}onBeforeProjectAsync(t,e){return this.onBeforeProject(e),t()}buildRenderOptions(t,e,i){let o={Valid:!0};return o.RenderableHash="string"==typeof t?t:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,o.RenderableHash||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not find a suitable RenderableHash ${o.RenderableHash} (param ${t}because it is not a valid renderable.`),o.Valid=!1),o.Renderable=this.renderables[o.RenderableHash],o.Renderable||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${o.RenderableHash} (param ${t}) because it does not exist.`),o.Valid=!1),o.DestinationAddress="string"==typeof e?e:"string"==typeof o.Renderable.ContentDestinationAddress?o.Renderable.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress,o.DestinationAddress||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${o.RenderableHash} (param ${t}) because it does not have a valid destination address (param ${e}).`),o.Valid=!1),"object"==typeof i?(o.RecordAddress="Passed in as object",o.Record=i):(o.RecordAddress="string"==typeof i?i:"string"==typeof o.Renderable.DefaultTemplateRecordAddress?o.Renderable.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,o.Record="string"==typeof o.RecordAddress?this.pict.DataProvider.getDataByAddress(o.RecordAddress):void 0),o}assignRenderContent(t,e,i){return this.pict.ContentAssignment.projectContent(t.RenderMethod,e,i,t.TestAddress)}render(t,e,i,o){return this.renderWithScope(this,t,e,i,o)}renderWithScope(t,e,i,o,n){let r,s,a,l="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;return l?("__Virtual"==l?r={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:n&&n.TransactionHash,RootRenderableViewHash:n&&n.RootRenderableViewHash}:(r=Object.assign({},this.renderables[l]),r.ContentDestinationAddress="string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),r.TransactionHash||(r.TransactionHash=`ViewRender-V-${this.options.ViewIdentifier}-R-${l}-U-${this.pict.getUUID()}`,r.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(r.TransactionHash)),r?r.ContentDestinationAddress?("object"==typeof o?(a=o,s="Passed in as object"):(s="string"==typeof o?o:"string"==typeof r.DefaultTemplateRecordAddress?r.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,a="string"==typeof s?this.pict.DataProvider.getDataByAddress(s):void 0),this.onBeforeRender(r),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] Renderable[${l}] Destination[${r.ContentDestinationAddress}] TemplateRecordAddress[${s}] render:`),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Beginning Render of Renderable[${l}] to Destination [${r.ContentDestinationAddress}]...`),r.Content=this.pict.parseTemplateByHash(r.TemplateHash,a,null,[this],t,{RootRenderable:"object"==typeof n?n:r}),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Assigning Renderable[${l}] content length ${r.Content.length} to Destination [${r.ContentDestinationAddress}] using render method [${r.RenderMethod}].`),this.onBeforeProject(r),this.onProject(r),"virtual-assignment"!==r.RenderMethod&&(this.onAfterProject(r),this.onAfterRender(r)),!0):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it does not have a valid destination address.`),!1):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it does not exist.`),!1)):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it is not a valid renderable.`),!1)}renderAsync(t,e,i,o,n){return this.renderWithScopeAsync(this,t,e,i,o,n)}renderWithScopeAsync(t,e,i,o,n,r){let s,a,l,d="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,c="function"==typeof r?r:"function"==typeof o?o:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof n?n:null;if(c||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),c=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${t}`,t)}),!d)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not asynchronously render ${d} (param ${e}because it is not a valid renderable.`),c(new Error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not asynchronously render ${d} (param ${e}because it is not a valid renderable.`));if("__Virtual"==d?s={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:n&&"function"!=typeof n&&n.TransactionHash,RootRenderableViewHash:n&&"function"!=typeof n&&n.RootRenderableViewHash}:(s=Object.assign({},this.renderables[d]),s.ContentDestinationAddress="string"==typeof i?i:"string"==typeof s.ContentDestinationAddress?s.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),s.TransactionHash||(s.TransactionHash=`ViewRender-V-${this.options.ViewIdentifier}-R-${d}-U-${this.pict.getUUID()}`,s.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(s.TransactionHash)),!s)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not exist.`),c(new Error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not exist.`));if(!s.ContentDestinationAddress)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not have a valid destination address.`),c(new Error(`Could not render ${d}`));"object"==typeof o?(l=o,a="Passed in as object"):(a="string"==typeof o?o:"string"==typeof s.DefaultTemplateRecordAddress?s.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,l="string"==typeof a?this.pict.DataProvider.getDataByAddress(a):void 0),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] Renderable[${d}] Destination[${s.ContentDestinationAddress}] TemplateRecordAddress[${a}] renderAsync:`),this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Beginning Asynchronous Render (callback-style)...`);let p=this.fable.newAnticipate();p.anticipate(t=>{this.onBeforeRenderAsync(t,s)}),p.anticipate(i=>{this.pict.parseTemplateByHash(s.TemplateHash,l,(t,o)=>t?(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render (asynchronously) ${d} (param ${e}) because it did not parse the template.`,t),i(t)):(s.Content=o,i()),[this],t,{RootRenderable:"object"==typeof n?n:s})}),p.anticipate(t=>{this.onBeforeProjectAsync(t,s)}),p.anticipate(t=>{this.onProjectAsync(t,s)}),"virtual-assignment"!==s.RenderMethod&&(p.anticipate(t=>{this.onAfterProjectAsync(t,s)}),p.anticipate(t=>{this.onAfterRenderAsync(t,s)})),p.wait(c)}renderDefaultAsync(t){this.renderAsync(t)}basicRender(t,e,i){return this.basicRenderWithScope(this,t,e,i)}basicRenderWithScope(t,e,i,o){let n=this.buildRenderOptions(e,i,o);return n.Valid?(this.assignRenderContent(n.Renderable,n.DestinationAddress,this.pict.parseTemplateByHash(n.Renderable.TemplateHash,n.Record,null,[this],t,{RootRenderable:n.Renderable})),!0):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not perform a basic render of ${n.RenderableHash} because it is not valid.`),!1)}basicRenderAsync(t,e,i,o){return this.basicRenderWithScopeAsync(this,t,e,i,o)}basicRenderWithScopeAsync(t,e,i,o,n){let r="function"==typeof n?n:"function"==typeof o?o:"function"==typeof i?i:"function"==typeof e?e:null;r||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} basicRenderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),r=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} basicRenderAsync Auto Callback Error: ${t}`,t)});const s=this.buildRenderOptions(e,i,o);if(!s.Valid){let t=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not perform a basic render of ${s.RenderableHash} because it is not valid.`;return this.log.error(t),r(new Error(t))}this.pict.parseTemplateByHash(s.Renderable.TemplateHash,s.Record,(t,e)=>t?(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render (asynchronously) ${s.RenderableHash} because it did not parse the template.`,t),r(t)):(this.assignRenderContent(s.Renderable,s.DestinationAddress,e),r()),[this],t,{RootRenderable:s.Renderable})}onProject(t){this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onProject:`),"virtual-assignment"===t.RenderMethod&&this.pict.TransactionTracking.pushToTransactionQueue(t.TransactionHash,{ViewHash:this.Hash,Renderable:t},"Deferred-Post-Content-Assignment"),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Assigning Renderable[${t.RenderableHash}] content length ${t.Content.length} to Destination [${t.ContentDestinationAddress}] using Async render method ${t.RenderMethod}.`),this.pict.ContentAssignment.projectContent(t.RenderMethod,t.ContentDestinationAddress,t.Content,t.TestAddress),this.lastRenderedTimestamp=this.pict.log.getTimeStamp()}onProjectAsync(t,e){return this.onProject(e),t()}onAfterRender(t){if(this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRender:`),t&&t.RootRenderableViewHash===this.Hash){const e=this.pict.TransactionTracking.clearTransactionQueue(t.TransactionHash)||[];for(const i of e){const e=this.pict.views[i.Data.ViewHash];e?(e.onAfterProject(),e.onAfterRender(i.Data.Renderable)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRender: Could not find view for transaction hash ${t.TransactionHash} and ViewHash ${i.Data.ViewHash}.`)}}return!0}onAfterRenderAsync(t,e){this.onAfterRender(e);const i=this.fable.newAnticipate();if(e&&e.RootRenderableViewHash===this.Hash){const t=this.pict.TransactionTracking.clearTransactionQueue(e.TransactionHash)||[];for(const o of t){const t=this.pict.views[o.Data.ViewHash];t?(i.anticipate(t.onAfterProjectAsync.bind(t)),i.anticipate(e=>{t.onAfterRenderAsync(e,o.Data.Renderable)})):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRenderAsync: Could not find view for transaction hash ${e.TransactionHash} and ViewHash ${o.Data.ViewHash}.`)}}return i.wait(t)}onAfterProject(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterProject:`),!0}onAfterProjectAsync(t,e){return t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeSolve:`),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onSolve:`),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeSolve(),this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),!0}solveAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeSolveAsync.bind(this)),e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} solveAsync() complete.`),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterSolve:`),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeMarshalFromView:`),!0}onBeforeMarshalFromViewAsync(t){return this.onBeforeMarshalFromView(),t()}onMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onMarshalFromView:`),!0}onMarshalFromViewAsync(t){return this.onMarshalFromView(),t()}marshalFromView(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeMarshalFromView(),this.onMarshalFromView(),this.onAfterMarshalFromView(),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalFromViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalFromViewAsync.bind(this)),e.anticipate(this.onMarshalFromViewAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} marshalFromViewAsync() complete.`),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterMarshalFromView:`),!0}onAfterMarshalFromViewAsync(t){return this.onAfterMarshalFromView(),t()}onBeforeMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeMarshalToView:`),!0}onBeforeMarshalToViewAsync(t){return this.onBeforeMarshalToView(),t()}onMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onMarshalToView:`),!0}onMarshalToViewAsync(t){return this.onMarshalToView(),t()}marshalToView(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeMarshalToView(),this.onMarshalToView(),this.onAfterMarshalToView(),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalToViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalToViewAsync.bind(this)),e.anticipate(this.onMarshalToViewAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} marshalToViewAsync() complete.`),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterMarshalToView:`),!0}onAfterMarshalToViewAsync(t){return this.onAfterMarshalToView(),t()}get isPictView(){return!0}}},{"../package.json":87,"fable-serviceproviderbase":20}],89:[function(t,e,i){var o,n,r=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(o===setTimeout)return setTimeout(t,0);if((o===s||!o)&&setTimeout)return o=setTimeout,setTimeout(t,0);try{return o(t,0)}catch(e){try{return o.call(null,t,0)}catch(e){return o.call(this,t,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:s}catch(t){o=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var d,c=[],p=!1,h=-1;function u(){p&&d&&(p=!1,d.length?c=d.concat(c):h=-1,c.length&&m())}function m(){if(!p){var t=l(u);p=!0;for(var e=c.length;e;){for(d=c,c=[];++h<e;)d&&d[h].run();h=-1,e=c.length}d=null,p=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];c.push(new f(t,e)),1!==c.length||p||l(m)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},{}],90:[function(t,e,i){(function(t){(function(){!function(o){var n="object"==typeof i&&i&&!i.nodeType&&i,r="object"==typeof e&&e&&!e.nodeType&&e,s="object"==typeof t&&t;s.global!==s&&s.window!==s&&s.self!==s||(o=s);var a,l,d=2147483647,c=36,p=/^xn--/,h=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,g=String.fromCharCode;function v(t){throw new RangeError(m[t])}function b(t,e){for(var i=t.length,o=[];i--;)o[i]=e(t[i]);return o}function w(t,e){var i=t.split("@"),o="";return i.length>1&&(o=i[0]+"@",t=i[1]),o+b((t=t.replace(u,".")).split("."),e).join(".")}function y(t){for(var e,i,o=[],n=0,r=t.length;n<r;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<r?56320==(64512&(i=t.charCodeAt(n++)))?o.push(((1023&e)<<10)+(1023&i)+65536):(o.push(e),n--):o.push(e);return o}function C(t){return b(t,function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)}).join("")}function x(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:c}function A(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function R(t,e,i){var o=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;o+=c)t=f(t/35);return f(o+36*t/(t+38))}function D(t){var e,i,o,n,r,s,a,l,p,h,u=[],m=t.length,g=0,b=128,w=72;for((i=t.lastIndexOf("-"))<0&&(i=0),o=0;o<i;++o)t.charCodeAt(o)>=128&&v("not-basic"),u.push(t.charCodeAt(o));for(n=i>0?i+1:0;n<m;){for(r=g,s=1,a=c;n>=m&&v("invalid-input"),((l=x(t.charCodeAt(n++)))>=c||l>f((d-g)/s))&&v("overflow"),g+=l*s,!(l<(p=a<=w?1:a>=w+26?26:a-w));a+=c)s>f(d/(h=c-p))&&v("overflow"),s*=h;w=R(g-r,e=u.length+1,0==r),f(g/e)>d-b&&v("overflow"),b+=f(g/e),g%=e,u.splice(g++,0,b)}return C(u)}function E(t){var e,i,o,n,r,s,a,l,p,h,u,m,b,w,C,x=[];for(m=(t=y(t)).length,e=128,i=0,r=72,s=0;s<m;++s)(u=t[s])<128&&x.push(g(u));for(o=n=x.length,n&&x.push("-");o<m;){for(a=d,s=0;s<m;++s)(u=t[s])>=e&&u<a&&(a=u);for(a-e>f((d-i)/(b=o+1))&&v("overflow"),i+=(a-e)*b,e=a,s=0;s<m;++s)if((u=t[s])<e&&++i>d&&v("overflow"),u==e){for(l=i,p=c;!(l<(h=p<=r?1:p>=r+26?26:p-r));p+=c)C=l-h,w=c-h,x.push(g(A(h+C%w,0))),l=f(C/w);x.push(g(A(l,0))),r=R(i,b,o==n),i=0,++o}++i,++e}return x.join("")}if(a={version:"1.4.1",ucs2:{decode:y,encode:C},decode:D,encode:E,toASCII:function(t){return w(t,function(t){return h.test(t)?"xn--"+E(t):t})},toUnicode:function(t){return w(t,function(t){return p.test(t)?D(t.slice(4).toLowerCase()):t})}},n&&r)if(e.exports==n)r.exports=a;else for(l in a)a.hasOwnProperty(l)&&(n[l]=a[l]);else o.punycode=a}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],91:[function(t,e,i){var o=String.prototype.replace,n=/%20/g,r="RFC1738",s="RFC3986";e.exports={default:s,formatters:{RFC1738:function(t){return o.call(t,n,"+")},RFC3986:function(t){return String(t)}},RFC1738:r,RFC3986:s}},{}],92:[function(t,e,i){var o=t("./stringify"),n=t("./parse"),r=t("./formats");e.exports={formats:r,parse:n,stringify:o}},{"./formats":91,"./parse":93,"./stringify":94}],93:[function(t,e,i){var o=t("./utils"),n=Object.prototype.hasOwnProperty,r=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},l=function(t,e,i){if(t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&i>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");return t},d=function(t,e,i,r){if(t){var s=function(t,e){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(e.depth<=0){if(!e.plainObjects&&n.call(Object.prototype,i)&&!e.allowPrototypes)return;return[i]}var o=/(\[[^[\]]*])/g,r=/(\[[^[\]]*])/.exec(i),s=r?i.slice(0,r.index):i,a=[];if(s){if(!e.plainObjects&&n.call(Object.prototype,s)&&!e.allowPrototypes)return;a[a.length]=s}for(var l=0;null!==(r=o.exec(i))&&l<e.depth;){l+=1;var d=r[1].slice(1,-1);if(!e.plainObjects&&n.call(Object.prototype,d)&&!e.allowPrototypes)return;a[a.length]=r[1]}if(r){if(!0===e.strictDepth)throw new RangeError("Input depth exceeded depth option of "+e.depth+" and strictDepth is true");a[a.length]="["+i.slice(r.index)+"]"}return a}(t,i);if(s)return function(t,e,i,n){var r=0;if(t.length>0&&"[]"===t[t.length-1]){var s=t.slice(0,-1).join("");r=Array.isArray(e)&&e[s]?e[s].length:0}for(var a=n?e:l(e,i,r),d=t.length-1;d>=0;--d){var c,p=t[d];if("[]"===p&&i.parseArrays)c=o.isOverflow(a)?a:i.allowEmptyArrays&&(""===a||i.strictNullHandling&&null===a)?[]:o.combine([],a,i.arrayLimit,i.plainObjects);else{c=i.plainObjects?{__proto__:null}:{};var h="["===p.charAt(0)&&"]"===p.charAt(p.length-1)?p.slice(1,-1):p,u=i.decodeDotInKeys?h.replace(/%2E/g,"."):h,m=parseInt(u,10),f=!isNaN(m)&&p!==u&&String(m)===u&&m>=0&&i.parseArrays;if(i.parseArrays||""!==u)if(f&&m<i.arrayLimit)(c=[])[m]=a;else{if(f&&i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(1===i.arrayLimit?"":"s")+" allowed in an array.");f?(c[m]=a,o.markOverflow(c,m)):"__proto__"!==u&&(c[u]=a)}else c={0:a}}a=c}return a}(s,e,i,r)}};e.exports=function(t,e){var i=function(t){if(!t)return s;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=void 0===t.charset?s.charset:t.charset,i=void 0===t.duplicates?s.duplicates:t.duplicates;if("combine"!==i&&"first"!==i&&"last"!==i)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||s.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:s.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:s.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:s.decoder,delimiter:"string"==typeof t.delimiter||o.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:s.depth,duplicates:i,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:s.strictDepth,strictMerge:"boolean"==typeof t.strictMerge?!!t.strictMerge:s.strictMerge,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(e);if(""===t||null==t)return i.plainObjects?{__proto__:null}:{};for(var c="string"==typeof t?function(t,e){var i={__proto__:null},d=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;d=d.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=e.parameterLimit===1/0?void 0:e.parameterLimit,p=d.split(e.delimiter,e.throwOnLimitExceeded?c+1:c);if(e.throwOnLimitExceeded&&p.length>c)throw new RangeError("Parameter limit exceeded. Only "+c+" parameter"+(1===c?"":"s")+" allowed.");var h,u=-1,m=e.charset;if(e.charsetSentinel)for(h=0;h<p.length;++h)0===p[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[h]?m="utf-8":"utf8=%26%2310003%3B"===p[h]&&(m="iso-8859-1"),u=h,h=p.length);for(h=0;h<p.length;++h)if(h!==u){var f,g,v=p[h],b=v.indexOf("]="),w=-1===b?v.indexOf("="):b+1;if(-1===w?(f=e.decoder(v,s.decoder,m,"key"),g=e.strictNullHandling?null:""):null!==(f=e.decoder(v.slice(0,w),s.decoder,m,"key"))&&(g=o.maybeMap(l(v.slice(w+1),e,r(i[f])?i[f].length:0),function(t){return e.decoder(t,s.decoder,m,"value")})),g&&e.interpretNumericEntities&&"iso-8859-1"===m&&(g=a(String(g))),v.indexOf("[]=")>-1&&(g=r(g)?[g]:g),e.comma&&r(g)&&g.length>e.arrayLimit){if(e.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");g=o.combine([],g,e.arrayLimit,e.plainObjects)}if(null!==f){var y=n.call(i,f);y&&("combine"===e.duplicates||v.indexOf("[]=")>-1)?i[f]=o.combine(i[f],g,e.arrayLimit,e.plainObjects):y&&"last"!==e.duplicates||(i[f]=g)}}return i}(t,i):t,p=i.plainObjects?{__proto__:null}:{},h=Object.keys(c),u=0;u<h.length;++u){var m=h[u],f=d(m,c[m],i,"string"==typeof t);p=o.merge(p,f,i)}return!0===i.allowSparse?p:o.compact(p)}},{"./utils":95}],94:[function(t,e,i){var o=t("side-channel"),n=t("./utils"),r=t("./formats"),s=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},l=Array.isArray,d=Array.prototype.push,c=function(t,e){d.apply(t,l(e)?e:[e])},p=Date.prototype.toISOString,h=r.default,u={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:n.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:r.formatters[h],indices:!1,serializeDate:function(t){return p.call(t)},skipNulls:!1,strictNullHandling:!1},m={},f=function t(e,i,r,s,a,d,p,h,f,g,v,b,w,y,C,x,A,R){for(var D,E=e,S=R,T=0,F=!1;void 0!==(S=S.get(m))&&!F;){var P=S.get(e);if(T+=1,void 0!==P){if(P===T)throw new RangeError("Cyclic object value");F=!0}void 0===S.get(m)&&(T=0)}if("function"==typeof g?E=g(i,E):E instanceof Date?E=w(E):"comma"===r&&l(E)&&(E=n.maybeMap(E,function(t){return t instanceof Date?w(t):t})),null===E){if(d)return f&&!x?f(i,u.encoder,A,"key",y):i;E=""}if("string"==typeof(D=E)||"number"==typeof D||"boolean"==typeof D||"symbol"==typeof D||"bigint"==typeof D||n.isBuffer(E))return f?[C(x?i:f(i,u.encoder,A,"key",y))+"="+C(f(E,u.encoder,A,"value",y))]:[C(i)+"="+C(String(E))];var _,k=[];if(void 0===E)return k;if("comma"===r&&l(E))x&&f&&(E=n.maybeMap(E,f)),_=[{value:E.length>0?E.join(",")||null:void 0}];else if(l(g))_=g;else{var I=Object.keys(E);_=v?I.sort(v):I}var L=h?String(i).replace(/\./g,"%2E"):String(i),M=s&&l(E)&&1===E.length?L+"[]":L;if(a&&l(E)&&0===E.length)return M+"[]";for(var B=0;B<_.length;++B){var V=_[B],H="object"==typeof V&&V&&void 0!==V.value?V.value:E[V];if(!p||null!==H){var N=b&&h?String(V).replace(/\./g,"%2E"):String(V),j=l(E)?"function"==typeof r?r(M,N):M:M+(b?"."+N:"["+N+"]");R.set(e,T);var O=o();O.set(m,R),c(k,t(H,j,r,s,a,d,p,h,"comma"===r&&x&&l(E)?null:f,g,v,b,w,y,C,x,A,O))}}return k};e.exports=function(t,e){var i,n=t,d=function(t){if(!t)return u;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.encodeDotInKeys&&"boolean"!=typeof t.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||u.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=r.default;if(void 0!==t.format){if(!s.call(r.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var o,n=r.formatters[i],d=u.filter;if(("function"==typeof t.filter||l(t.filter))&&(d=t.filter),o=t.arrayFormat in a?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":u.arrayFormat,"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=void 0===t.allowDots?!0===t.encodeDotInKeys||u.allowDots:!!t.allowDots;return{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:u.addQueryPrefix,allowDots:c,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:u.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:u.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:void 0===t.delimiter?u.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:u.encode,encodeDotInKeys:"boolean"==typeof t.encodeDotInKeys?t.encodeDotInKeys:u.encodeDotInKeys,encoder:"function"==typeof t.encoder?t.encoder:u.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:u.encodeValuesOnly,filter:d,format:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:u.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:u.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:u.strictNullHandling}}(e);"function"==typeof d.filter?n=(0,d.filter)("",n):l(d.filter)&&(i=d.filter);var p=[];if("object"!=typeof n||null===n)return"";var h=a[d.arrayFormat],m="comma"===h&&d.commaRoundTrip;i||(i=Object.keys(n)),d.sort&&i.sort(d.sort);for(var g=o(),v=0;v<i.length;++v){var b=i[v],w=n[b];d.skipNulls&&null===w||c(p,f(w,b,h,m,d.allowEmptyArrays,d.strictNullHandling,d.skipNulls,d.encodeDotInKeys,d.encode?d.encoder:null,d.filter,d.sort,d.allowDots,d.serializeDate,d.format,d.formatter,d.encodeValuesOnly,d.charset,g))}var y=p.join(d.delimiter),C=!0===d.addQueryPrefix?"?":"";return d.charsetSentinel&&("iso-8859-1"===d.charset?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),y.length>0?C+y:""}},{"./formats":91,"./utils":95,"side-channel":112}],95:[function(t,e,i){var o=t("./formats"),n=t("side-channel"),r=Object.prototype.hasOwnProperty,s=Array.isArray,a=n(),l=function(t,e){return a.set(t,e),t},d=function(t){return a.has(t)},c=function(t){return a.get(t)},p=function(t,e){a.set(t,e)},h=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),u=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},o=0;o<t.length;++o)void 0!==t[o]&&(i[o]=t[o]);return i},m=1024;e.exports={arrayToObject:u,assign:function(t,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},t)},combine:function(t,e,i,o){if(d(t)){var n=c(t)+1;return t[n]=e,p(t,n),t}var r=[].concat(t,e);return r.length>i?l(u(r,{plainObjects:o}),r.length-1):r},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],o=0;o<e.length;++o)for(var n=e[o],r=n.obj[n.prop],a=Object.keys(r),l=0;l<a.length;++l){var d=a[l],c=r[d];"object"==typeof c&&null!==c&&-1===i.indexOf(c)&&(e[e.length]={obj:r,prop:d},i[i.length]=c)}return function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(s(i)){for(var o=[],n=0;n<i.length;++n)void 0!==i[n]&&(o[o.length]=i[n]);e.obj[e.prop]=o}}}(e),t},decode:function(t,e,i){var o=t.replace(/\+/g," ");if("iso-8859-1"===i)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(t){return o}},encode:function(t,e,i,n,r){if(0===t.length)return t;var s=t;if("symbol"==typeof t?s=Symbol.prototype.toString.call(t):"string"!=typeof t&&(s=String(t)),"iso-8859-1"===i)return escape(s).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var a="",l=0;l<s.length;l+=m){for(var d=s.length>=m?s.slice(l,l+m):s,c=[],p=0;p<d.length;++p){var u=d.charCodeAt(p);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||r===o.RFC1738&&(40===u||41===u)?c[c.length]=d.charAt(p):u<128?c[c.length]=h[u]:u<2048?c[c.length]=h[192|u>>6]+h[128|63&u]:u<55296||u>=57344?c[c.length]=h[224|u>>12]+h[128|u>>6&63]+h[128|63&u]:(p+=1,u=65536+((1023&u)<<10|1023&d.charCodeAt(p)),c[c.length]=h[240|u>>18]+h[128|u>>12&63]+h[128|u>>6&63]+h[128|63&u])}a+=c.join("")}return a},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isOverflow:d,isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},markOverflow:l,maybeMap:function(t,e){if(s(t)){for(var i=[],o=0;o<t.length;o+=1)i[i.length]=e(t[o]);return i}return e(t)},merge:function t(e,i,o){if(!i)return e;if("object"!=typeof i&&"function"!=typeof i){if(s(e)){var n=e.length;if(o&&"number"==typeof o.arrayLimit&&n>o.arrayLimit)return l(u(e.concat(i),o),n);e[n]=i}else{if(!e||"object"!=typeof e)return[e,i];if(d(e)){var a=c(e)+1;e[a]=i,p(e,a)}else{if(o&&o.strictMerge)return[e,i];(o&&(o.plainObjects||o.allowPrototypes)||!r.call(Object.prototype,i))&&(e[i]=!0)}}return e}if(!e||"object"!=typeof e){if(d(i)){for(var h=Object.keys(i),m=o&&o.plainObjects?{__proto__:null,0:e}:{0:e},f=0;f<h.length;f++){m[parseInt(h[f],10)+1]=i[h[f]]}return l(m,c(i)+1)}var g=[e].concat(i);return o&&"number"==typeof o.arrayLimit&&g.length>o.arrayLimit?l(u(g,o),g.length-1):g}var v=e;return s(e)&&!s(i)&&(v=u(e,o)),s(e)&&s(i)?(i.forEach(function(i,n){if(r.call(e,n)){var s=e[n];s&&"object"==typeof s&&i&&"object"==typeof i?e[n]=t(s,i,o):e[e.length]=i}else e[n]=i}),e):Object.keys(i).reduce(function(e,n){var s=i[n];if(r.call(e,n)?e[n]=t(e[n],s,o):e[n]=s,d(i)&&!d(e)&&l(e,c(i)),d(e)){var a=parseInt(n,10);String(a)===n&&a>=0&&a>c(e)&&p(e,a)}return e},v)}}},{"./formats":91,"side-channel":112}],96:[function(t,e,i){e.exports={Name:"Retold Content Editor",Hash:"ContentEditor",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentEditor-Pict-Application"}}},{}],97:[function(t,e,i){const o=t("pict-application"),n=t("pict-section-filebrowser"),r=t("./providers/Pict-Provider-ContentEditor.js"),s=t("./views/PictView-Editor-Layout.js"),a=t("./views/PictView-Editor-TopBar.js"),l=t("./views/PictView-Editor-MarkdownEditor.js"),d=t("./views/PictView-Editor-CodeEditor.js"),c=t("./views/PictView-Editor-SettingsPanel.js"),p=t("./views/PictView-Editor-MarkdownReference.js"),h=t("./views/PictView-Editor-Topics.js");e.exports=class extends o{constructor(t,e,i){super(t,e,i),this.pict.addProvider("ContentEditor-Provider",r.default_configuration,r),this.pict.addView("ContentEditor-Layout",s.default_configuration,s),this.pict.addView("ContentEditor-TopBar",a.default_configuration,a),this.pict.addView("ContentEditor-MarkdownEditor",l.default_configuration,l),this.pict.addView("ContentEditor-CodeEditor",d.default_configuration,d),this.pict.addView("ContentEditor-SettingsPanel",c.default_configuration,c),this.pict.addView("ContentEditor-MarkdownReference",p.default_configuration,p),this.pict.addView("ContentEditor-Topics",h.default_configuration,h);let o=JSON.parse(JSON.stringify(n.default_configuration));o.DefaultDestinationAddress="#ContentEditor-Sidebar-Container",o.DefaultState.Layout="list-only",this.pict.addView("Pict-FileBrowser",o,n);let u=JSON.parse(JSON.stringify(n.PictViewListDetail.default_configuration));for(let t=0;t<u.Templates.length;t++)"FileBrowser-ListDetail-Container-Template"===u.Templates[t].Hash&&(u.Templates[t].Template='\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb-bar">\n\t\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t\t<button class="pict-fb-breadcrumb-addfolder" onclick="pict.PictApplication.promptNewFolder()" title="New folder">+</button>\n\t</div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'),"FileBrowser-ListDetail-Row-Template"===u.Templates[t].Hash&&(u.Templates[t].Template='\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" data-name="{~D:Record.Name~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n\t<button class="pict-fb-insert-btn" onclick="event.stopPropagation(); pict.PictApplication.insertFileReference(this.parentElement.getAttribute(\'data-name\'))" title="Insert into editor">+</button>\n</div>\n');this.pict.addView("Pict-FileBrowser-ListDetail",u,n.PictViewListDetail)}onAfterInitializeAsync(t){"undefined"!=typeof window&&(window.pict=this.pict),this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,ContentPreviewMode:"off",MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:!1,SidebarWidth:250,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:!1,TopicsFilePath:".pict_documentation_topics.json"},this._loadSettings(),this.pict.views["ContentEditor-Layout"].render();let e=this,i=this.pict.providers["Pict-FileBrowser-List"];if(i){let t=i.selectFile.bind(i);i.selectFile=function(i){t(i),i&&"file"===i.Type&&e.navigateToFile(i.Path)}}let o=this.pict.providers["Pict-FileBrowser-Browse"];if(o){let t=o.navigateToFolder.bind(o);o.navigateToFolder=function(i){t(i),e.loadFileList(i)}}this.syncHiddenFilesSetting(()=>{e.loadFileList(null,()=>{e.resolveHash()})});let n=this.pict.AppData.ContentEditor.TopicsFilePath;if(n){let t=this.pict.views["ContentEditor-Topics"];t&&t.loadTopicsFile(n,()=>{})}return super.onAfterInitializeAsync(t)}syncHiddenFilesSetting(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.ContentEditor.ShowHiddenFiles;fetch("/api/filebrowser/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({IncludeHiddenFiles:!!i})}).then(()=>e()).catch(()=>e())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},o=this,n="string"==typeof t?t:null;null===n&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(n=this.pict.AppData.PictFileBrowser.CurrentLocation);let r="/api/filebrowser/list";n&&n.length>0&&(r+="?path="+encodeURIComponent(n)),fetch(r).then(t=>t.json()).then(t=>{o.pict.AppData.PictFileBrowser=o.pict.AppData.PictFileBrowser||{},o.pict.AppData.PictFileBrowser.FileList=t||[];let e=o.pict.views["Pict-FileBrowser"];e&&e.render();let n=o.pict.views["Pict-FileBrowser-ListDetail"];return n&&n.render(),i()}).catch(t=>(o.log.error(`Failed to load file list: ${t.message}`),i()))}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t)return;let e=t.split("/");if("edit"===e[0]&&e.length>=2){let t=e.slice(1).join("/");if(this.pict.AppData.ContentEditor.CurrentFile===t)return;this.navigateToFile(t)}}getEditorTypeForFile(t){if(!t)return"markdown";let e=t.replace(/^.*\./,"").toLowerCase();if("md"===e||"markdown"===e)return"markdown";return{png:!0,jpg:!0,jpeg:!0,gif:!0,bmp:!0,webp:!0,ico:!0,svg:!0,tiff:!0,tif:!0,avif:!0,heic:!0,heif:!0,mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,mp4:!0,avi:!0,mkv:!0,mov:!0,wmv:!0,webm:!0,flv:!0,m4v:!0,pdf:!0,doc:!0,docx:!0,xls:!0,xlsx:!0,ppt:!0,pptx:!0,odt:!0,ods:!0,odp:!0,zip:!0,tar:!0,gz:!0,bz2:!0,xz:!0,"7z":!0,rar:!0,ttf:!0,otf:!0,woff:!0,woff2:!0,eot:!0,exe:!0,dll:!0,so:!0,dylib:!0,o:!0,class:!0,pyc:!0,wasm:!0}[e]?"binary":"code"}_cleanupEditors(){let t=this.pict.views["ContentEditor-CodeEditor"];t&&(t.codeJar&&t.destroy(),t.initialRenderComplete=!1);let e=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");e&&e[0]&&(e[0].innerHTML="")}_formatFileSize(t){if(0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}_getMediaType(t){return{png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0}[t]?"image":{mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0}[t]?"video":{mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0}[t]?"audio":"other"}_buildMediaPreviewHTML(t,e,i){return"image"===t?'<div class="binary-preview-image-wrap"><div class="binary-preview-image"><img src="'+e+'" alt="'+i+'"></div></div>':"video"===t?'<div class="binary-preview-media-wrap"><video class="binary-preview-video" controls preload="metadata"><source src="'+e+'">Your browser does not support the video tag.</video></div>':"audio"===t?'<div class="binary-preview-media-wrap"><audio class="binary-preview-audio" controls preload="metadata"><source src="'+e+'">Your browser does not support the audio tag.</audio></div>':""}loadMediaPreview(t,e,i){let o=document.getElementById("ContentEditor-MediaPreviewPlaceholder");o&&(o.innerHTML=this._buildMediaPreviewHTML(t,e,i))}_showBinaryPreview(t){let e=this,i=t.replace(/^.*\//,""),o=t.replace(/^.*\./,"").toLowerCase(),n="/content/"+encodeURIComponent(t),r=this._getMediaType(o),s=this.pict.AppData.ContentEditor,a=!1;"image"===r&&(a=s.AutoPreviewImages),"video"===r&&(a=s.AutoPreviewVideo),"audio"===r&&(a=s.AutoPreviewAudio),fetch("/api/filebrowser/info?path="+encodeURIComponent(t)).then(t=>t.json()).then(t=>{let s=t&&"number"==typeof t.Size?e._formatFileSize(t.Size):"Unknown",l=t&&t.Modified?new Date(t.Modified).toLocaleString():"Unknown",d=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");if(!d||!d[0])return;let c="";"other"!==r&&(a?c+=e._buildMediaPreviewHTML(r,n,i):(c+='<div id="ContentEditor-MediaPreviewPlaceholder">',c+='<button class="binary-preview-btn binary-preview-btn-preview"',c+=' onclick="pict.PictApplication.loadMediaPreview(',c+="'"+r+"','"+n+"','"+i.replace(/'/g,"\\'")+"'",c+=')">Preview '+r.charAt(0).toUpperCase()+r.slice(1)+"</button>",c+="</div>")),c+='<div class="binary-preview-card">',c+='<div class="binary-preview-icon">'+o.toUpperCase()+"</div>",c+='<div class="binary-preview-info">',c+='<div class="binary-preview-name">'+i+"</div>",c+='<div class="binary-preview-meta">Size: '+s+"</div>",c+='<div class="binary-preview-meta">Modified: '+l+"</div>",c+='<div class="binary-preview-meta">Type: .'+o+"</div>",c+="</div>",c+='<div class="binary-preview-actions">',c+='<a class="binary-preview-btn" href="'+n+'" download="'+i+'">Download</a>',c+='<a class="binary-preview-btn binary-preview-btn-secondary" href="'+n+'" target="_blank">Open in New Tab</a>',c+="</div>",c+="</div>",d[0].innerHTML=c}).catch(()=>{let t=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div class="binary-preview-card"><div class="binary-preview-icon">'+o.toUpperCase()+'</div><div class="binary-preview-info"><div class="binary-preview-name">'+i+'</div><div class="binary-preview-meta">Binary file — cannot be edited in the browser</div></div><div class="binary-preview-actions"><a class="binary-preview-btn" href="'+n+'" download="'+i+'">Download</a><a class="binary-preview-btn binary-preview-btn-secondary" href="'+n+'" target="_blank">Open in New Tab</a></div></div>')})}segmentMarkdownContent(t){let e=this.pict.AppData.ContentEditor;if(!e.AutoSegmentMarkdown||!t)return[{Content:t||""}];let i=parseInt(e.AutoSegmentDepth,10)||1;if(1===i){let e=t.split("\n"),i=[],o=[],n=!1;for(let t=0;t<e.length;t++){let r=e[t];/^(`{3,}|~{3,})/.test(r.trim())?(n=!n,o.push(r)):n||""!==r.trim()?o.push(r):o.length>0&&(i.push({Content:o.join("\n")}),o=[])}return o.length>0&&i.push({Content:o.join("\n")}),i.length>0?i:[{Content:""}]}let o=new RegExp("^(#{1,"+i+"})\\s"),n=t.split("\n"),r=[],s=[];for(let t=0;t<n.length;t++){let e=n[t];o.test(e.trim())&&s.length>0&&(r.push({Content:s.join("\n")}),s=[]),s.push(e)}return s.length>0&&r.push({Content:s.join("\n")}),r.length>0?r:[{Content:""}]}navigateToFile(t){if(!t)return;let e=this,i=this.getEditorTypeForFile(t);if(this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",window.location.hash="#/edit/"+t,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.ActiveEditor=i,this._cleanupEditors(),this.pict.views["ContentEditor-TopBar"].render(),"binary"===i)return this._showBinaryPreview(t),void this.updateStats();let o=this.pict.providers["ContentEditor-Provider"];this.pict.AppData.ContentEditor.IsLoading=!0,o.loadFile(t,(o,n)=>{if(e.pict.AppData.ContentEditor.IsLoading=!1,o)return e.pict.AppData.ContentEditor.SaveStatus="Error loading file: "+o,e.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error",void e.pict.views["ContentEditor-TopBar"].render();if("markdown"===i){e.pict.AppData.ContentEditor.Document.Segments=e.segmentMarkdownContent(n);let i=e.pict.views["ContentEditor-MarkdownEditor"];if(i){let o="/content/",n=t.lastIndexOf("/");n>0&&(o="/content/"+t.substring(0,n)+"/"),i.options.ImageBaseURL=o,i.render(),i.marshalToView(),i.setPreviewMode(e.pict.AppData.ContentEditor.ContentPreviewMode||"off"),i.toggleControls(e.pict.AppData.ContentEditor.MarkdownEditingControls)}e.updateStats()}else{e.pict.AppData.ContentEditor.CodeContent=n;let i=t.replace(/^.*\./,"").toLowerCase(),o=d.getLanguageForExtension?d.getLanguageForExtension(i):d.ExtensionLanguageMap[i]||"plaintext",r=e.pict.views["ContentEditor-CodeEditor"];r&&(r.initialRenderComplete=!1,r._language=o,r._suppressNextDirty=!0,r.render(),r.marshalToView(),e.pict.AppData.ContentEditor.CodeWordWrap&&r._editorElement&&(r._editorElement.style.whiteSpace="pre-wrap",r._editorElement.style.overflowWrap="break-word")),e.updateStats()}})}saveCurrentFile(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(!t)return;let e=this.pict.providers["ContentEditor-Provider"],i=this,o="";if("code"===this.pict.AppData.ContentEditor.ActiveEditor){let t=this.pict.views["ContentEditor-CodeEditor"];t&&t.marshalFromView(),o=this.pict.AppData.ContentEditor.CodeContent||""}else{let t=this.pict.views["ContentEditor-MarkdownEditor"];t&&t.marshalFromView();let e=this.pict.AppData.ContentEditor.Document.Segments;if(e&&e.length>0){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].Content||"");o=t.join("\n\n")}}this.pict.AppData.ContentEditor.IsSaving=!0,this.pict.AppData.ContentEditor.SaveStatus="Saving...",this.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saving",this.pict.views["ContentEditor-TopBar"].render(),e.saveFile(t,o,t=>{i.pict.AppData.ContentEditor.IsSaving=!1,t?(i.pict.AppData.ContentEditor.SaveStatus="Error: "+t,i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error"):(i.pict.AppData.ContentEditor.IsDirty=!1,i.pict.AppData.ContentEditor.SaveStatus="Saved",i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saved",i.loadFileList(),setTimeout(()=>{"Saved"===i.pict.AppData.ContentEditor.SaveStatus&&(i.pict.AppData.ContentEditor.SaveStatus="",i.pict.AppData.ContentEditor.SaveStatusClass="",i.pict.views["ContentEditor-TopBar"].render())},3e3)),i.pict.views["ContentEditor-TopBar"].render()})}closeCurrentFile(){this.pict.AppData.ContentEditor.CurrentFile&&(this.pict.AppData.ContentEditor.IsDirty?this._showCloseConfirmation():this._doCloseFile())}_doCloseFile(){this._hideCloseConfirmation(),this._cleanupEditors(),this.pict.AppData.ContentEditor.CurrentFile="",this.pict.AppData.ContentEditor.ActiveEditor="markdown",this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",this.pict.AppData.ContentEditor.Document.Segments=[{Content:""}],this.pict.AppData.ContentEditor.CodeContent="",window.location.hash="",this.pict.views["ContentEditor-TopBar"].render();let t=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.updateStats()}confirmCloseFile(){this._doCloseFile()}cancelCloseFile(){this._hideCloseConfirmation()}_showCloseConfirmation(){let t=document.getElementById("ContentEditor-ConfirmOverlay");if(t&&t.classList.add("open"),!this._confirmKeyHandler){let t=this;this._confirmKeyHandler=e=>{let i=e.key.toLowerCase();"y"===i?(e.preventDefault(),t.confirmCloseFile()):"n"!==i&&"Escape"!==e.key||(e.preventDefault(),t.cancelCloseFile())}}window.addEventListener("keydown",this._confirmKeyHandler)}_hideCloseConfirmation(){let t=document.getElementById("ContentEditor-ConfirmOverlay");t&&t.classList.remove("open"),this._confirmKeyHandler&&window.removeEventListener("keydown",this._confirmKeyHandler)}createNewFile(t){if(!t)return;t.replace(/^.*\//,"").indexOf(".")<0&&(t+=".md");let e=this.pict.providers["ContentEditor-Provider"],i=this,o="";o=t.endsWith(".md")?"# "+t.replace(/\.[^.]+$/,"").replace(/^.*\//,"")+"\n\n":"// "+t.replace(/^.*\//,"")+"\n",e.saveFile(t,o,e=>{e||i.loadFileList(null,()=>{i.navigateToFile(t)})})}promptNewFile(){let t=prompt("Enter a name for the new file (e.g. my-page.md, script.js, style.css):");t&&t.trim()&&this.createNewFile(t.trim())}promptNewFolder(){let t=prompt("Enter a name for the new folder:");if(!t||!t.trim())return;t=t.trim();let e="";this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(e=this.pict.AppData.PictFileBrowser.CurrentLocation);let i=e?e+"/"+t:t,o=this;fetch("/api/content/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:i})}).then(t=>t.json()).then(t=>{t&&t.Success?(o.log.info(`Folder created: ${i}`),o.loadFileList()):alert("Could not create folder: "+(t?t.Error:"Unknown error"))}).catch(t=>{alert("Error creating folder: "+t.message)})}insertFileReference(t){if(!t)return;let e=this.pict.views["ContentEditor-MarkdownEditor"];if(!e||"markdown"!==this.pict.AppData.ContentEditor.ActiveEditor)return;let i=e._activeSegmentIndex;if(i<0){let t=e._getOrderedSegmentIndices();t.length>0&&(i=t[0])}if(i<0)return;let o=t.replace(/\.[^.]+$/,"");o=o.replace(/^\d{10,}-/,""),o=o.replace(/[-_]+/g," ").trim()||"image";let n=t.substring(t.lastIndexOf(".")).toLowerCase();if([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".avif",".apng",".ico",".tiff",".tif",".jfif"].indexOf(n)>=0)e._insertImageMarkdown(i,t,o);else{let n=e._segmentEditors[i];if(n){let e="["+o+"]("+t+")",i=n.state.selection.main.head;n.dispatch({changes:{from:i,insert:e},selection:{anchor:i+e.length}}),n.focus()}}}handleF4TopicAction(){let t=this.pict.views["ContentEditor-Layout"],e=this.pict.views["ContentEditor-Topics"];if(!t||!e)return;let i=this.pict.AppData.ContentEditor,o=i.ActiveEditor,n=i.CurrentFile,r=0,s=!1;if("markdown"===o&&n){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors){let e=0;for(let i in t._segmentEditors){let o=t._segmentEditors[i];if(o&&o.hasFocus){let t=o.state.selection.main.head;r=e+o.state.doc.lineAt(t).number,s=!0;break}o&&o.state&&(e+=o.state.doc.lines)}}}if(i.SidebarCollapsed&&t.toggleSidebar(),t.switchSidebarTab("topics"),s&&n){let t={TopicCode:"New-Topic",TopicHelpFilePath:n,TopicTitle:this._extractFirstHeading()||"New Topic"};r>0&&(t.RelevantMarkdownLine=r),e.addTopic(t)}}_extractFirstHeading(){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(!t||!t._segmentEditors)return"";let e=7,i="";for(let o in t._segmentEditors){let n=t._segmentEditors[o];if(!n||!n.state||!n.state.doc)continue;let r=n.state.doc;for(let t=1;t<=r.lines;t++){let o=r.line(t).text.match(/^(#{1,6})\s+(.+)/);if(o){let t=o[1].length;if(t<e&&(e=t,i=o[2].trim(),1===e))return i}}}return i}updateStats(){let t=document.getElementById("ContentEditor-Stats");if(!t)return;let e=this.pict.AppData.ContentEditor.ActiveEditor,i=0,o=0,n=0;if("markdown"===e){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors)for(let e in t._segmentEditors){let r=t._segmentEditors[e];if(r&&r.state&&r.state.doc){i+=r.state.doc.lines,o+=r.state.doc.length;let t=r.state.doc.toString().match(/\S+/g);t&&(n+=t.length)}}}else{if("code"!==e)return void(t.textContent="");{let t=this.pict.views["ContentEditor-CodeEditor"];if(t&&t.codeJar){let e=t.codeJar.toString();o=e.length,i=e.split("\n").length;let r=e.match(/\S+/g);r&&(n=r.length)}}}t.textContent=i+" lines · "+n+" words · "+o+" chars"}markDirty(){this.pict.AppData.ContentEditor.IsDirty||(this.pict.AppData.ContentEditor.IsDirty=!0,this.pict.views["ContentEditor-TopBar"].render())}get _settingsKey(){return"retold-content-editor-settings"}saveSettings(){if("undefined"==typeof window||!window.localStorage)return;let t=this.pict.AppData.ContentEditor,e={AutoSegmentMarkdown:t.AutoSegmentMarkdown,AutoSegmentDepth:t.AutoSegmentDepth,ContentPreviewMode:t.ContentPreviewMode,MarkdownEditingControls:t.MarkdownEditingControls,MarkdownWordWrap:t.MarkdownWordWrap,CodeWordWrap:t.CodeWordWrap,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,AutoPreviewImages:t.AutoPreviewImages,AutoPreviewVideo:t.AutoPreviewVideo,AutoPreviewAudio:t.AutoPreviewAudio,ShowHiddenFiles:t.ShowHiddenFiles,TopicsFilePath:t.TopicsFilePath};try{window.localStorage.setItem(this._settingsKey,JSON.stringify(e))}catch(t){this.log.warn("Failed to save settings: "+t.message)}}_loadSettings(){if("undefined"!=typeof window&&window.localStorage)try{let t=window.localStorage.getItem(this._settingsKey);if(!t)return;let e=JSON.parse(t),i=this.pict.AppData.ContentEditor;"boolean"==typeof e.AutoSegmentMarkdown&&(i.AutoSegmentMarkdown=e.AutoSegmentMarkdown),"number"==typeof e.AutoSegmentDepth&&(i.AutoSegmentDepth=e.AutoSegmentDepth),"string"==typeof e.ContentPreviewMode?i.ContentPreviewMode=e.ContentPreviewMode:"boolean"==typeof e.AutoContentPreview&&(i.ContentPreviewMode=e.AutoContentPreview?"bottom":"off"),"boolean"==typeof e.MarkdownEditingControls&&(i.MarkdownEditingControls=e.MarkdownEditingControls),"boolean"==typeof e.MarkdownWordWrap&&(i.MarkdownWordWrap=e.MarkdownWordWrap),"boolean"==typeof e.CodeWordWrap&&(i.CodeWordWrap=e.CodeWordWrap),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),"number"==typeof e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),"boolean"==typeof e.AutoPreviewImages&&(i.AutoPreviewImages=e.AutoPreviewImages),"boolean"==typeof e.AutoPreviewVideo&&(i.AutoPreviewVideo=e.AutoPreviewVideo),"boolean"==typeof e.AutoPreviewAudio&&(i.AutoPreviewAudio=e.AutoPreviewAudio),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"string"==typeof e.TopicsFilePath&&(i.TopicsFilePath=e.TopicsFilePath)}catch(t){this.log.warn("Failed to load settings: "+t.message)}}},e.exports.default_configuration=t("./Pict-Application-ContentEditor-Configuration.json")},{"./Pict-Application-ContentEditor-Configuration.json":96,"./providers/Pict-Provider-ContentEditor.js":101,"./views/PictView-Editor-CodeEditor.js":102,"./views/PictView-Editor-Layout.js":103,"./views/PictView-Editor-MarkdownEditor.js":104,"./views/PictView-Editor-MarkdownReference.js":105,"./views/PictView-Editor-SettingsPanel.js":106,"./views/PictView-Editor-TopBar.js":107,"./views/PictView-Editor-Topics.js":108,"pict-application":44,"pict-section-filebrowser":63}],98:[function(t,e,i){e.exports={Name:"Retold Content Reader",Hash:"ContentReader",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentReader-Pict-Application"}}},{}],99:[function(t,e,i){const o=t("pict-docuserve");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onAfterInitializeAsync(t){this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"/content/",CatalogURL:"/content/retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve;return e.CoverLoaded&&e.Cover&&e.Cover.Title?document.title=e.Cover.Title.replace(/<[^>]*>/g,""):e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(document.title=e.TopBar.Brand.replace(/<[^>]*>/g,"")),e.TopBar?(Array.isArray(e.TopBar.ExternalLinks)||(e.TopBar.ExternalLinks=[]),e.TopBar.ExternalLinks.push({Text:"Edit",Href:"/"})):(e.TopBarLoaded=!0,e.TopBar={Brand:"Content System",NavLinks:[],ExternalLinks:[{Text:"Edit",Href:"/"}]}),this.pict.views["Docuserve-Layout"].render(),t()})}},e.exports.default_configuration=t("./Pict-Application-ContentReader-Configuration.json")},{"./Pict-Application-ContentReader-Configuration.json":98,"pict-docuserve":46}],100:[function(t,e,i){e.exports={PictContentReader:t("./Pict-Application-ContentReader.js"),PictContentEditor:t("./Pict-Application-ContentEditor.js")},"undefined"!=typeof window&&(window.PictContentReader=e.exports.PictContentReader,window.PictContentEditor=e.exports.PictContentEditor)},{"./Pict-Application-ContentEditor.js":97,"./Pict-Application-ContentReader.js":99}],101:[function(t,e,i){const o=t("pict-provider");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}loadFile(t,e){let i="function"==typeof e?e:()=>{};if(!t)return i("No file path specified","");fetch("/api/content/read/"+encodeURIComponent(t)).then(t=>t.ok?t.json():i("File not found: "+t.status,"")).then(t=>t&&t.Success?i(null,t.Content||""):i(t?t.Error:"Unknown error","")).catch(e=>(this.log.warn(`ContentEditor: Error loading file [${t}]: ${e}`),i(e.message,"")))}saveFile(t,e,i){let o="function"==typeof i?i:()=>{};if(!t)return o("No file path specified");fetch("/api/content/save/"+encodeURIComponent(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Content:e})}).then(t=>t.ok?t.json():o("Save failed: "+t.status)).then(t=>t&&t.Success?o(null):o(t?t.Error:"Unknown error")).catch(e=>(this.log.warn(`ContentEditor: Error saving file [${t}]: ${e}`),o(e.message)))}uploadImage(t,e){let i="function"==typeof e?e:()=>{},o="",n=this.pict.AppData.ContentEditor.CurrentFile;if(n){let t=n.lastIndexOf("/");t>0&&(o=n.substring(0,t))}else this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(o=this.pict.AppData.PictFileBrowser.CurrentLocation);let r={"Content-Type":t.type,"x-filename":t.name};o&&(r["x-upload-path"]=o),fetch("/api/content/upload-image",{method:"POST",body:t,headers:r}).then(t=>t.json()).then(t=>t&&t.Success&&t.URL?i(null,t.URL):i(t?t.Error:"Upload failed")).catch(t=>(this.log.warn(`ContentEditor: Image upload failed: ${t}`),i(t.message)))}},e.exports.default_configuration={ProviderIdentifier:"ContentEditor-Provider",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":55}],102:[function(t,e,i){const o=t("pict-section-code"),n={js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"xml",htm:"xml",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"scss",less:"less",sql:"sql",py:"python",rb:"ruby",java:"java",kt:"kotlin",kts:"kotlin",go:"go",rs:"rust",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",swift:"swift",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",dockerfile:"dockerfile",docker:"dockerfile",makefile:"makefile",mk:"makefile",md:"markdown",markdown:"markdown",lua:"lua",r:"r",pl:"perl",pm:"perl",ex:"elixir",exs:"elixir",erl:"erlang",hrl:"erlang",hs:"haskell",clj:"clojure",scala:"scala",dart:"dart",groovy:"groovy",gradle:"groovy",tf:"terraform",vim:"vim",diff:"diff",patch:"diff",log:"accesslog",txt:"plaintext"};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._suppressNextDirty=!1}onAfterInitialRender(){if("undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.CodeJar&&this.connectCodeJarPrototype(window.CodeJarModules.CodeJar),"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let t=window.CodeJarModules.hljs,e=this._language;this._highlightFunction=function(i){i.removeAttribute("data-highlighted"),delete i.dataset.highlighted,i.className=i.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),i.classList.add("hljs"),e&&"plaintext"!==e&&i.classList.add("language-"+e),t.highlightElement(i)}}return super.onAfterInitialRender()}setLanguage(t){if(this._language=t,"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let e=window.CodeJarModules.hljs,i=t;this._highlightFunction=function(t){t.removeAttribute("data-highlighted"),delete t.dataset.highlighted,t.className=t.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),t.classList.add("hljs"),i&&"plaintext"!==i&&t.classList.add("language-"+i),e.highlightElement(t)}}if(this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}onCodeChange(t){super.onCodeChange(t),this._suppressNextDirty?this._suppressNextDirty=!1:this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}static getLanguageForExtension(t){if(!t)return"plaintext";let e=t.toLowerCase();return n[e]||"plaintext"}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-CodeEditor",DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",CodeDataAddress:"AppData.ContentEditor.CodeContent",ReadOnly:!1,LineNumbers:!0,Language:"javascript",Tab:"\t",AutoRender:!1,Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]},e.exports.ExtensionLanguageMap=n},{"pict-section-code":58}],103:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"ContentEditor-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:'\n\t\t#ContentEditor-Application-Container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t#ContentEditor-TopBar-Container\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-body\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar wrapper holds the sidebar content + collapse toggle */\n\t\t.content-editor-sidebar-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t\ttransition: width 0.2s ease;\n\t\t}\n\t\t/* Inner wrapper: vertical flex for tab bar + panes */\n\t\t.content-editor-sidebar-inner\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar tab bar */\n\t\t.content-editor-sidebar-tabs\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.content-editor-sidebar-tab\n\t\t{\n\t\t\tflex: 1;\n\t\t\tpadding: 7px 0;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-tab:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-sidebar-tab.active\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tborder-bottom-color: #2E7D74;\n\t\t}\n\t\t.content-editor-sidebar-addfile\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 30px;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, background 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-addfile:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t/* Sidebar panes */\n\t\t.content-editor-sidebar-pane\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container\n\t\t{\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t/* Collapsed state */\n\t\t.content-editor-sidebar-wrap.collapsed\n\t\t{\n\t\t\twidth: 0 !important;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-inner\n\t\t{\n\t\t\tvisibility: hidden;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-resize-handle\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Collapse / expand toggle */\n\t\t.content-editor-sidebar-toggle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 8px;\n\t\t\tright: -20px;\n\t\t\twidth: 20px;\n\t\t\theight: 28px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #FAF8F4;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-left: none;\n\t\t\tborder-radius: 0 4px 4px 0;\n\t\t\tcursor: pointer;\n\t\t\tz-index: 10;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 11px;\n\t\t\tline-height: 1;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-toggle:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-toggle\n\t\t{\n\t\t\tright: -20px;\n\t\t}\n\t\t/* Resize handle */\n\t\t.content-editor-resize-handle\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 5px;\n\t\t\tcursor: col-resize;\n\t\t\tbackground: transparent;\n\t\t\tborder-right: 1px solid #DDD6CA;\n\t\t\ttransition: background 0.15s;\n\t\t}\n\t\t.content-editor-resize-handle:hover,\n\t\t.content-editor-resize-handle.dragging\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tborder-right-color: #2E7D74;\n\t\t}\n\t\t/* File browser layout overrides for sidebar use */\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser\n\t\t{\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\tbackground: transparent;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-browse-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-view-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide size/date columns — the sidebar is too narrow for them */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-modified,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-modified\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide the column header bar in sidebar mode */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-header\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Breadcrumb bar: flex wrapper with create-folder button */\n\t\t.pict-fb-breadcrumb-bar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t}\n\t\t.pict-fb-breadcrumb-bar .pict-fb-breadcrumb\n\t\t{\n\t\t\tflex: 1;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.pict-fb-breadcrumb-addfolder\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 4px 10px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t\tmargin-right: 4px;\n\t\t}\n\t\t.pict-fb-breadcrumb-addfolder:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t#ContentEditor-Editor-Container\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 44px 16px 16px 16px;\n\t\t}\n\t\t/* Code editor: fill the container and remove outer border */\n\t\t#ContentEditor-Editor-Container .pict-code-editor-wrap\n\t\t{\n\t\t\theight: calc(100% - 4px);\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t}\n\t\t#ContentEditor-Editor-Container .pict-code-editor\n\t\t{\n\t\t\tmin-height: unset;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAFAFA;\n\t\t}\n\t\t/* Binary file preview */\n\t\t.binary-preview-image-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-image\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t}\n\t\t.binary-preview-image img\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 400px;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.binary-preview-card\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 20px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t\tmax-width: 600px;\n\t\t}\n\t\t.binary-preview-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 64px;\n\t\t\theight: 64px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-radius: 8px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: #5E5549;\n\t\t\tletter-spacing: 0.5px;\n\t\t}\n\t\t.binary-preview-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.binary-preview-name\n\t\t{\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.binary-preview-meta\n\t\t{\n\t\t\tfont-size: 0.8rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tline-height: 1.6;\n\t\t}\n\t\t.binary-preview-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.binary-preview-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 8px 16px;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.binary-preview-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.binary-preview-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.binary-preview-btn-secondary:hover\n\t\t{\n\t\t\tborder-color: #8A7F72;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.binary-preview-btn-preview\n\t\t{\n\t\t\tpadding: 10px 20px;\n\t\t\tfont-size: 0.85rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #FAF8F4;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 6px;\n\t\t\ttransition: background 0.15s, border-color 0.15s;\n\t\t}\n\t\t.binary-preview-btn-preview:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t\t#ContentEditor-MediaPreviewPlaceholder\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-media-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-video\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 500px;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #000;\n\t\t}\n\t\t.binary-preview-audio\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-width: 500px;\n\t\t}\n\t\t/* Image upload overlay */\n\t\t.content-editor-upload-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-upload-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-upload-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 420px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-upload-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 14px 18px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t}\n\t\t.content-editor-upload-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-upload-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 6px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.content-editor-upload-close:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-upload-body\n\t\t{\n\t\t\tpadding: 18px;\n\t\t}\n\t\t.content-editor-upload-dropzone\n\t\t{\n\t\t\tborder: 2px dashed #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 28px 16px;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, background 0.15s;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.content-editor-upload-dropzone:hover,\n\t\t.content-editor-upload-dropzone.dragover\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t\tbackground: #F0FAF8;\n\t\t}\n\t\t.content-editor-upload-dropzone-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-upload-dropzone-text\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-dropzone-hint\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.content-editor-upload-file-input\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.content-editor-upload-status\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmin-height: 20px;\n\t\t}\n\t\t.content-editor-upload-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-upload-status-success\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.content-editor-upload-result\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tpadding: 10px 12px;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.content-editor-upload-result-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 4px;\n\t\t}\n\t\t.content-editor-upload-result-url\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.content-editor-upload-result-text\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-family: monospace;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #3D3229;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.content-editor-upload-result-copy\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 4px 10px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-upload-result-copy:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-upload-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-footer\n\t\t{\n\t\t\tpadding: 10px 18px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\n\t\t/* File browser row insert button — hidden by default, shown on\n\t\t hover for image file rows via CSS attribute selectors. */\n\t\t.pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: absolute;\n\t\t\tright: 6px;\n\t\t\ttop: 50%;\n\t\t\ttransform: translateY(-50%);\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 700;\n\t\t\tline-height: 1;\n\t\t\tpadding: 2px 7px;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-fb-insert-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Make the row position:relative so the button can be absolutely placed */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row\n\t\t{\n\t\t\tposition: relative;\n\t\t}\n\t\t/* Show the insert button on hover for image file extensions.\n\t\t CSS attribute selector [data-name$=".ext" i] matches\n\t\t the end of the data-name attribute, case-insensitive. */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".png" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jpg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jpeg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".gif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".webp" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".svg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".bmp" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".avif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".apng" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".ico" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".tiff" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".tif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jfif" i]:hover .pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t/* Prevent horizontal scroll on the whole app */\n\t\t\t#ContentEditor-Application-Container\n\t\t\t{\n\t\t\t\toverflow-x: hidden;\n\t\t\t\twidth: 100%;\n\t\t\t\tmax-width: 100vw;\n\t\t\t}\n\n\t\t\t/* Stack sidebar ABOVE editor instead of side-by-side */\n\t\t\t.content-editor-body\n\t\t\t{\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t/* Sidebar becomes a horizontal strip at the top */\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-height: 40vh;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\t\tborder-right: none;\n\t\t\t}\n\n\t\t\t/* Give the Reference and Topics tabs much more room on mobile\n\t\t\t since they contain long scrollable content */\n\t\t\t.content-editor-sidebar-wrap.sidebar-expanded-pane\n\t\t\t{\n\t\t\t\tmax-height: 70vh;\n\t\t\t}\n\n\t\t\t/* When collapsed on mobile, hide the inner content but keep the\n\t\t\t toggle button visible (it\'s positioned below the sidebar strip) */\n\t\t\t.content-editor-sidebar-wrap.collapsed\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-height: 0;\n\t\t\t\toverflow: visible;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-inner\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Hide the resize handle (desktop-only interaction) */\n\t\t\t.content-editor-resize-handle\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Reposition the sidebar toggle for horizontal layout —\n\t\t\t place it at the bottom-center of the sidebar strip */\n\t\t\t.content-editor-sidebar-toggle\n\t\t\t{\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: auto;\n\t\t\t\tbottom: -20px;\n\t\t\t\tright: auto;\n\t\t\t\tleft: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\twidth: 28px;\n\t\t\t\theight: 20px;\n\t\t\t\tborder-radius: 0 0 4px 4px;\n\t\t\t\tborder: 1px solid #DDD6CA;\n\t\t\t\tborder-top: none;\n\t\t\t\tz-index: 10;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-toggle\n\t\t\t{\n\t\t\t\tbottom: -20px;\n\t\t\t\tright: auto;\n\t\t\t\tleft: 50%;\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t}\n\n\t\t\t/* Reduce editor container padding (less gutters) */\n\t\t\t#ContentEditor-Editor-Container\n\t\t\t{\n\t\t\t\tpadding: 24px 8px 8px 8px;\n\t\t\t}\n\n\t\t\t/* Reduce binary preview padding */\n\t\t\t.binary-preview-image\n\t\t\t{\n\t\t\t\tpadding: 12px;\n\t\t\t}\n\t\t\t.binary-preview-card\n\t\t\t{\n\t\t\t\tpadding: 12px;\n\t\t\t\tgap: 12px;\n\t\t\t}\n\n\t\t\t/* Upload panel: fill more of the screen */\n\t\t\t.content-editor-upload-panel\n\t\t\t{\n\t\t\t\twidth: 95vw;\n\t\t\t\tmax-width: 95vw;\n\t\t\t}\n\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Even tighter editor padding */\n\t\t\t#ContentEditor-Editor-Container\n\t\t\t{\n\t\t\t\tpadding: 20px 4px 4px 4px;\n\t\t\t}\n\n\t\t\t/* Sidebar gets a smaller max height */\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\tmax-height: 35vh;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.sidebar-expanded-pane\n\t\t\t{\n\t\t\t\tmax-height: 65vh;\n\t\t\t}\n\t\t}\n\t',Templates:[{Hash:"ContentEditor-Layout-Shell-Template",Template:'\n<div id="ContentEditor-TopBar-Container"></div>\n<div class="content-editor-body">\n\t<div class="content-editor-sidebar-wrap" id="ContentEditor-SidebarWrap" style="width:250px">\n\t\t<div class="content-editor-sidebar-inner">\n\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t<button class="content-editor-sidebar-tab active" id="ContentEditor-SidebarTab-Files"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Reference"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'reference\')">Reference</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Topics"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'topics\')">Topics</button>\n\t\t\t\t<button class="content-editor-sidebar-addfile" title="New file"\n\t\t\t\t\tonclick="{~P~}.PictApplication.promptNewFile()">+</button>\n\t\t\t</div>\n\t\t\t<div id="ContentEditor-Sidebar-Container" class="content-editor-sidebar-pane"></div>\n\t\t\t<div id="ContentEditor-SidebarReference-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t\t<div id="ContentEditor-SidebarTopics-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t</div>\n\t\t<div class="content-editor-resize-handle" id="ContentEditor-ResizeHandle"></div>\n\t\t<div class="content-editor-sidebar-toggle" id="ContentEditor-SidebarToggle">◀</div>\n\t</div>\n\t<div id="ContentEditor-Editor-Container"></div>\n</div>\n<div class="content-editor-upload-overlay" id="ContentEditor-UploadOverlay"\n\tonclick="{~P~}.views[\'ContentEditor-Layout\'].onUploadOverlayClick(event)">\n\t<div class="content-editor-upload-panel">\n\t\t<div class="content-editor-upload-header">\n\t\t\t<span class="content-editor-upload-title">Upload Image</span>\n\t\t\t<button class="content-editor-upload-close"\n\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].toggleUploadForm()">×</button>\n\t\t</div>\n\t\t<div class="content-editor-upload-body">\n\t\t\t<div class="content-editor-upload-dropzone" id="ContentEditor-UploadDropzone"\n\t\t\t\tonclick="document.getElementById(\'ContentEditor-UploadFileInput\').click()">\n\t\t\t\t<div class="content-editor-upload-dropzone-icon">📷</div>\n\t\t\t\t<div class="content-editor-upload-dropzone-text">Drop an image here or click to browse</div>\n\t\t\t\t<div class="content-editor-upload-dropzone-hint">PNG, JPG, GIF, WebP, SVG, BMP</div>\n\t\t\t</div>\n\t\t\t<input type="file" class="content-editor-upload-file-input" id="ContentEditor-UploadFileInput"\n\t\t\t\taccept="image/png,image/jpeg,image/gif,image/webp,image/svg+xml,image/bmp"\n\t\t\t\tonchange="{~P~}.views[\'ContentEditor-Layout\'].onUploadFileSelected(this)">\n\t\t\t<div class="content-editor-upload-status" id="ContentEditor-UploadStatus"></div>\n\t\t\t<div id="ContentEditor-UploadResult"></div>\n\t\t</div>\n\t\t<div class="content-editor-upload-footer">\n\t\t\t<span class="content-editor-upload-kbd">F3</span> or\n\t\t\t<span class="content-editor-upload-kbd">Ctrl+Shift+U</span> to toggle\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-Layout-Shell",TemplateHash:"ContentEditor-Layout-Shell-Template",DestinationAddress:"#ContentEditor-Application-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._minSidebarWidth=140,this._maxSidebarWidth=600}onAfterRender(t,e,i,o){this.pict.views["ContentEditor-TopBar"].render();let n=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");n&&n[0]&&!this.pict.AppData.ContentEditor.CurrentFile&&(n[0].innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.pict.CSSMap.injectCSS();let r=this.pict.AppData.ContentEditor,s=document.getElementById("ContentEditor-SidebarWrap"),a=document.getElementById("ContentEditor-SidebarToggle");if(s){let t=window.innerWidth<=768;s.style.width=t?"100%":r.SidebarWidth+"px",r.SidebarCollapsed?(s.classList.add("collapsed"),a&&(a.innerHTML=t?"▼":"▶")):t&&(r.SidebarCollapsed=!0,s.classList.add("collapsed"),a&&(a.innerHTML="▼"))}let l=this;return a&&a.addEventListener("click",()=>{l.toggleSidebar()}),this._wireResizeHandle(),window.addEventListener("hashchange",()=>{l.pict.PictApplication.resolveHash()}),window.addEventListener("keydown",t=>{if((t.metaKey||t.ctrlKey)&&"s"===t.key)return t.preventDefault(),void l.pict.PictApplication.saveCurrentFile();if("F1"===t.key)return t.preventDefault(),void l._handleF1();if("F2"===t.key)return t.preventDefault(),void l.toggleSidebar();if("F3"===t.key)return t.preventDefault(),void l.toggleUploadForm();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("u"===t.key||"U"===t.key))return t.preventDefault(),void l.toggleUploadForm();if("F4"===t.key)return t.preventDefault(),void l.pict.PictApplication.handleF4TopicAction();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("t"===t.key||"T"===t.key))return t.preventDefault(),void l.pict.PictApplication.handleF4TopicAction();if("Escape"===t.key){let e=document.getElementById("ContentEditor-UploadOverlay");if(e&&e.classList.contains("open"))return void l.closeUploadForm();let i=document.getElementById("ContentEditor-ConfirmOverlay");if(i&&i.classList.contains("open"))return;if(l.pict.AppData.ContentEditor.CurrentFile)return t.preventDefault(),void l.pict.PictApplication.closeCurrentFile()}}),super.onAfterRender(t,e,i,o)}toggleSidebar(){let t=document.getElementById("ContentEditor-SidebarWrap"),e=document.getElementById("ContentEditor-SidebarToggle");if(!t)return;let i=this.pict.AppData.ContentEditor;i.SidebarCollapsed=!i.SidebarCollapsed;let o=window.innerWidth<=768;i.SidebarCollapsed?(t.classList.add("collapsed"),e&&(e.innerHTML=o?"▼":"▶")):(t.classList.remove("collapsed"),t.style.width=o?"100%":i.SidebarWidth+"px",e&&(e.innerHTML=o?"▲":"◀")),this.pict.PictApplication.saveSettings()}switchSidebarTab(t){let e={files:document.getElementById("ContentEditor-Sidebar-Container"),reference:document.getElementById("ContentEditor-SidebarReference-Container"),topics:document.getElementById("ContentEditor-SidebarTopics-Container")},i={files:document.getElementById("ContentEditor-SidebarTab-Files"),reference:document.getElementById("ContentEditor-SidebarTab-Reference"),topics:document.getElementById("ContentEditor-SidebarTab-Topics")};for(let t in e)e[t]&&(e[t].style.display="none"),i[t]&&i[t].classList.remove("active");e[t]&&(e[t].style.display=""),i[t]&&i[t].classList.add("active");let o=document.getElementById("ContentEditor-SidebarWrap");if(o&&("reference"===t||"topics"===t?o.classList.add("sidebar-expanded-pane"):o.classList.remove("sidebar-expanded-pane")),"reference"===t){let t=this.pict.views["ContentEditor-MarkdownReference"];t&&!t._hasRendered&&t.render()}if("topics"===t){let t=this.pict.views["ContentEditor-Topics"];t&&!t._hasRendered&&t.render()}}_handleF1(){if(this.pict.AppData.ContentEditor.SidebarCollapsed)return this.toggleSidebar(),void this.switchSidebarTab("reference");let t=document.getElementById("ContentEditor-SidebarTab-Reference");t&&t.classList.contains("active")?this.switchSidebarTab("files"):this.switchSidebarTab("reference")}getActiveSidebarTab(){let t=document.getElementById("ContentEditor-SidebarTab-Reference"),e=document.getElementById("ContentEditor-SidebarTab-Topics");return t&&t.classList.contains("active")?"reference":e&&e.classList.contains("active")?"topics":"files"}toggleUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&(t.classList.contains("open")?this.closeUploadForm():this.openUploadForm())}openUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&t.classList.add("open"),this._wireUploadDropzone()}closeUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&t.classList.remove("open");let e=document.getElementById("ContentEditor-UploadFileInput");e&&(e.value="");let i=document.getElementById("ContentEditor-UploadStatus");i&&(i.innerHTML="");let o=document.getElementById("ContentEditor-UploadResult");o&&(o.innerHTML="")}onUploadOverlayClick(t){"ContentEditor-UploadOverlay"===t.target.id&&this.closeUploadForm()}onUploadFileSelected(t){t.files&&t.files.length>0&&this._uploadFile(t.files[0])}_wireUploadDropzone(){let t=document.getElementById("ContentEditor-UploadDropzone");if(!t||t._wired)return;t._wired=!0;let e=this;t.addEventListener("dragover",e=>{e.preventDefault(),e.stopPropagation(),t.classList.add("dragover")}),t.addEventListener("dragleave",e=>{e.preventDefault(),e.stopPropagation(),t.classList.remove("dragover")}),t.addEventListener("drop",i=>{i.preventDefault(),i.stopPropagation(),t.classList.remove("dragover"),i.dataTransfer&&i.dataTransfer.files&&i.dataTransfer.files.length>0&&e._uploadFile(i.dataTransfer.files[0])})}_uploadFile(t){let e=document.getElementById("ContentEditor-UploadStatus"),i=document.getElementById("ContentEditor-UploadResult");if(!t)return;if(!t.type.startsWith("image/"))return void(e&&(e.innerHTML='<span class="content-editor-upload-status-error">Only image files are supported.</span>'));e&&(e.innerHTML="Uploading <strong>"+t.name+"</strong>..."),i&&(i.innerHTML="");let o=this,n=this.pict.providers["ContentEditor-Provider"];n?n.uploadImage(t,(n,r)=>{if(n)return void(e&&(e.innerHTML='<span class="content-editor-upload-status-error">Upload failed: '+n+"</span>"));e&&(e.innerHTML='<span class="content-editor-upload-status-success">Uploaded successfully!</span>');let s="";i&&(i.innerHTML='<div class="content-editor-upload-result"><div class="content-editor-upload-result-label">Markdown</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+s+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+s.replace(/'/g,"\\'")+'\').then(function(){this.textContent=\'Copied!\'}.bind(this))">Copy</button></div><div class="content-editor-upload-result-label" style="margin-top:8px">URL</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+r+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+r.replace(/'/g,"\\'")+"').then(function(){this.textContent='Copied!'}.bind(this))\">Copy</button></div></div>"),o.pict.PictApplication.loadFileList()}):e&&(e.innerHTML='<span class="content-editor-upload-status-error">Provider not available.</span>')}_wireResizeHandle(){let t=document.getElementById("ContentEditor-ResizeHandle"),e=document.getElementById("ContentEditor-SidebarWrap");if(!t||!e)return;let i=this,o=!1,n=0,r=0;function s(t){if(!o)return;let s=t.clientX-n,a=r+s;a<i._minSidebarWidth&&(a=i._minSidebarWidth),a>i._maxSidebarWidth&&(a=i._maxSidebarWidth),e.style.width=a+"px"}function a(){o&&(o=!1,t.classList.remove("dragging"),e.style.transition="",document.body.style.userSelect="",document.body.style.cursor="",i.pict.AppData.ContentEditor.SidebarWidth=e.offsetWidth,i.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a))}t.addEventListener("mousedown",function(l){i.pict.AppData.ContentEditor.SidebarCollapsed||(l.preventDefault(),o=!0,n=l.clientX,r=e.offsetWidth,t.classList.add("dragging"),e.style.transition="none",document.body.style.userSelect="none",document.body.style.cursor="col-resize",document.addEventListener("mousemove",s),document.addEventListener("mouseup",a))})}},e.exports.default_configuration=n},{"pict-view":88}],104:[function(t,e,i){const o=t("pict-section-markdowneditor");e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onImageUpload(t,e,i){let o=this.pict.providers["ContentEditor-Provider"];return!!o&&(o.uploadImage(t,(t,e)=>{t?i(t):i(null,e)}),!0)}customConfigureExtensions(t,e){if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.MarkdownWordWrap){let e=this._codeMirrorModules;e&&e.EditorView&&e.EditorView.lineWrapping&&t.push(e.EditorView.lineWrapping)}return t}onContentChange(t,e){this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-MarkdownEditor",DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",ContentDataAddress:"AppData.ContentEditor.Document.Segments",ReadOnly:!1,EnableRichPreview:!0,AutoRender:!1,Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]}},{"pict-section-markdowneditor":86}],105:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-MarkdownReference",DefaultRenderable:"ContentEditor-MarkdownReference-Display",DefaultDestinationAddress:"#ContentEditor-SidebarReference-Container",AutoRender:!1,CSS:"\n\t\t.md-ref-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.md-ref-search-bar\n\t\t{\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 5;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 6px 8px;\n\t\t\tbackground: #F5F0EA;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-input\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\toutline: none;\n\t\t}\n\t\t.md-ref-search-input:focus\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.md-ref-search-nav\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\twidth: 26px;\n\t\t\theight: 26px;\n\t\t\tcursor: pointer;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.7rem;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-nav:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.md-ref-search-nav:disabled\n\t\t{\n\t\t\topacity: 0.3;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.md-ref-search-count\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tmin-width: 32px;\n\t\t\ttext-align: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tline-height: 1.6;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.md-ref-content h2\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tmargin: 20px 0 8px 0;\n\t\t\tpadding-bottom: 4px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.md-ref-content h2:first-child\n\t\t{\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.md-ref-content h3\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tmargin: 14px 0 6px 0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.md-ref-content p\n\t\t{\n\t\t\tmargin: 6px 0;\n\t\t}\n\t\t.md-ref-content code\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.md-ref-content pre\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 8px 10px;\n\t\t\toverflow-x: auto;\n\t\t\tfont-size: 0.76rem;\n\t\t\tline-height: 1.5;\n\t\t\tmargin: 6px 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.md-ref-content pre code\n\t\t{\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.md-ref-copy-btn\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tright: 4px;\n\t\t\tbackground: #FAF8F4;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.15s;\n\t\t}\n\t\t.md-ref-content pre:hover .md-ref-copy-btn\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.md-ref-copy-btn:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.md-ref-docs-link\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tbackground: #F0FAF8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-docs-link a\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.md-ref-docs-link a:hover\n\t\t{\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t/* Search highlight */\n\t\tmark.md-ref-highlight\n\t\t{\n\t\t\tbackground: #FFEAA7;\n\t\t\tcolor: inherit;\n\t\t\tpadding: 0;\n\t\t\tborder-radius: 2px;\n\t\t}\n\t\tmark.md-ref-highlight-active\n\t\t{\n\t\t\tbackground: #E8A94D;\n\t\t\tcolor: #FFF;\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-MarkdownReference-Template",Template:'\n<div class="md-ref-container">\n\t<div class="md-ref-docs-link">\n\t\t<span>📖</span>\n\t\t<a href="/docs/" target="_blank">Full Documentation</a>\n\t</div>\n\t<div class="md-ref-search-bar">\n\t\t<input type="text" class="md-ref-search-input"\n\t\t\tid="ContentEditor-MdRef-SearchInput"\n\t\t\tplaceholder="Search reference..."\n\t\t\toninput="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchInput(this.value)"\n\t\t\tonkeydown="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchKeydown(event)">\n\t\t<span class="md-ref-search-count" id="ContentEditor-MdRef-SearchCount"></span>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchPrev"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(-1)" disabled>▲</button>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchNext"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(1)" disabled>▼</button>\n\t</div>\n\t<div class="md-ref-content" id="ContentEditor-MdRef-Content">\n\n<h2>Headings</h2>\n<p>Use <code>#</code> through <code>######</code> for heading levels 1–6.</p>\n<pre><code># Heading 1\n## Heading 2\n### Heading 3\n#### Heading 4\n##### Heading 5\n###### Heading 6</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Emphasis</h2>\n<p>Bold, italic, strikethrough, and combinations.</p>\n<pre><code>**bold text**\n*italic text*\n***bold and italic***\n~~strikethrough~~\n**bold and ~~strikethrough~~**</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Inline Code</h2>\n<p>Wrap text in backticks for inline code.</p>\n<pre><code>Use `console.log()` to debug.\nUse ``double backticks for `literal` backticks``.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Links</h2>\n<p>Inline links, reference links, and autolinks.</p>\n<pre><code>[Link text](https://example.com)\n[Link with title](https://example.com "Title text")\n\n[Reference link][1]\n[1]: https://example.com\n\nAutolink: https://example.com\nEmail: user@example.com</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Images</h2>\n<pre><code>\n\n\n[](https://example.com)</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Unordered Lists</h2>\n<p>Use <code>-</code>, <code>*</code>, or <code>+</code> for bullet items.</p>\n<pre><code>- Item one\n- Item two\n - Nested item\n - Another nested\n - Deeply nested\n- Item three</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Ordered Lists</h2>\n<pre><code>1. First item\n2. Second item\n3. Third item\n 1. Sub-item A\n 2. Sub-item B</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Task Lists</h2>\n<pre><code>- [x] Completed task\n- [ ] Incomplete task\n- [ ] Another task</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Blockquotes</h2>\n<pre><code>> This is a blockquote.\n>\n> It can span multiple paragraphs.\n>\n>> Nested blockquote.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Code Blocks</h2>\n<p>Use triple backticks with an optional language identifier.</p>\n<pre><code>```javascript\nfunction hello()\n{\n console.log("Hello, world!");\n}\n```\n\n```python\ndef hello():\n print("Hello, world!")\n```\n\n```css\n.container {\n display: flex;\n gap: 16px;\n}\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Tables</h2>\n<p>Use pipes and hyphens. Colons control alignment.</p>\n<pre><code>| Left Align | Center Align | Right Align |\n|:-----------|:------------:|------------:|\n| Cell 1 | Cell 2 | Cell 3 |\n| Cell 4 | Cell 5 | Cell 6 |</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Horizontal Rules</h2>\n<p>Three or more hyphens, asterisks, or underscores.</p>\n<pre><code>---\n\n***\n\n___</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Footnotes</h2>\n<pre><code>Here is a footnote reference[^1] and another[^note].\n\n[^1]: This is the footnote content.\n[^note]: Footnotes can have any label.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>HTML in Markdown</h2>\n<p>Raw HTML is allowed in GitHub-Flavored Markdown.</p>\n<pre><code><details>\n<summary>Click to expand</summary>\n\nHidden content here.\n\n</details>\n\n<kbd>Ctrl</kbd> + <kbd>S</kbd> to save.\n\n<mark>Highlighted text</mark>\n\n<sup>superscript</sup> and <sub>subscript</sub></code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Escaping Characters</h2>\n<p>Backslash-escape special markdown characters.</p>\n<pre><code>\\*not italic\\*\n\\# not a heading\n\\[not a link\\](url)\n\\`not code\\`</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Line Breaks</h2>\n<pre><code>End a line with two spaces\nto create a line break.\n\nOr use a blank line\n\nfor a new paragraph.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX — Inline Math</h2>\n<p>Wrap expressions with single dollar signs for inline math.</p>\n<pre><code>The equation $E = mc^2$ is famous.\n\nThe quadratic formula is $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$.\n\nGreek letters: $\\alpha$, $\\beta$, $\\gamma$, $\\delta$, $\\theta$, $\\pi$.\n\nSubscripts and superscripts: $x_i^2$ and $a_{n+1}$.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX — Display Math</h2>\n<p>Use double dollar signs on their own lines for display (block) math.</p>\n\n<h3>Integral</h3>\n<pre><code>$$\n\\int_{-\\infty}^{\\infty} e^{-x^2} \\, dx = \\sqrt{\\pi}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Summation</h3>\n<pre><code>$$\n\\sum_{n=1}^{\\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Matrix</h3>\n<pre><code>$$\n\\begin{bmatrix}\na & b \\\\\nc & d\n\\end{bmatrix}\n\\begin{bmatrix}\nx \\\\\ny\n\\end{bmatrix}\n=\n\\begin{bmatrix}\nax + by \\\\\ncx + dy\n\\end{bmatrix}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Aligned Equations</h3>\n<pre><code>$$\n\\begin{aligned}\nf(x) &= x^2 + 2x + 1 \\\\\n &= (x + 1)^2\n\\end{aligned}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Cases (Piecewise)</h3>\n<pre><code>$$\nf(x) = \\begin{cases}\nx^2 & \\text{if } x \\geq 0 \\\\\n-x^2 & \\text{if } x < 0\n\\end{cases}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Fractions & Limits</h3>\n<pre><code>$$\n\\lim_{x \\to 0} \\frac{\\sin x}{x} = 1\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Flowchart</h2>\n<pre><code>```mermaid\ngraph TD\n A[Start] --> B{Decision}\n B -->|Yes| C[Do something]\n B -->|No| D[Do something else]\n C --> E[End]\n D --> E\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Sequence Diagram</h2>\n<pre><code>```mermaid\nsequenceDiagram\n participant A as Alice\n participant B as Bob\n A->>B: Hello Bob\n B-->>A: Hi Alice\n A->>B: How are you?\n B-->>A: Great!\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Gantt Chart</h2>\n<pre><code>```mermaid\ngantt\n title Project Timeline\n dateFormat YYYY-MM-DD\n section Phase 1\n Research :a1, 2024-01-01, 30d\n Design :a2, after a1, 20d\n section Phase 2\n Development :b1, after a2, 40d\n Testing :b2, after b1, 15d\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Class Diagram</h2>\n<pre><code>```mermaid\nclassDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal : +int age\n Animal : +String gender\n Animal : +swim()\n Duck : +String beakColor\n Duck : +quack()\n Fish : +int sizeInFeet\n Fish : +canEat()\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — State Diagram</h2>\n<pre><code>```mermaid\nstateDiagram-v2\n [*] --> Idle\n Idle --> Processing : Start\n Processing --> Done : Complete\n Processing --> Error : Fail\n Error --> Idle : Reset\n Done --> [*]\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-MarkdownReference-Display",TemplateHash:"ContentEditor-MarkdownReference-Template",DestinationAddress:"#ContentEditor-SidebarReference-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._hasRendered=!1,this._searchMatches=[],this._currentMatchIndex=-1,this._originalContent=""}onAfterRender(t,e,i,o){this._hasRendered=!0;let n=document.getElementById("ContentEditor-MdRef-Content");return n&&(this._originalContent=n.innerHTML),this.pict.CSSMap.injectCSS(),super.onAfterRender(t,e,i,o)}copyCodeBlock(t){let e=t.closest("pre");if(!e)return;let i=e.querySelector("code");if(!i)return;let o=i.textContent;navigator.clipboard&&navigator.clipboard.writeText(o).then(()=>{t.textContent="Copied!",setTimeout(()=>{t.textContent="Copy"},1500)})}onSearchInput(t){this._performSearch(t)}onSearchKeydown(t){"Enter"===t.key&&(t.preventDefault(),t.shiftKey?this.navigateMatch(-1):this.navigateMatch(1)),"Escape"===t.key&&(t.target.value="",this._clearSearch())}navigateMatch(t){if(0===this._searchMatches.length)return;this._currentMatchIndex>=0&&this._searchMatches[this._currentMatchIndex]&&this._searchMatches[this._currentMatchIndex].classList.remove("md-ref-highlight-active"),this._currentMatchIndex+=t,this._currentMatchIndex>=this._searchMatches.length&&(this._currentMatchIndex=0),this._currentMatchIndex<0&&(this._currentMatchIndex=this._searchMatches.length-1);let e=this._searchMatches[this._currentMatchIndex];e.classList.add("md-ref-highlight-active"),e.scrollIntoView({behavior:"smooth",block:"center"}),this._updateSearchCount()}_performSearch(t){let e=document.getElementById("ContentEditor-MdRef-Content");if(!e)return;if(e.innerHTML=this._originalContent,this._searchMatches=[],this._currentMatchIndex=-1,!t||t.length<2)return this._updateSearchCount(),void this._updateNavButtons();let i,o=t.toLowerCase(),n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=[];for(;i=n.nextNode();)i.nodeValue.toLowerCase().indexOf(o)>=0&&r.push(i);for(let t=0;t<r.length;t++)this._highlightTextNode(r[t],o);this._searchMatches=Array.from(e.querySelectorAll("mark.md-ref-highlight")),this._searchMatches.length>0&&(this._currentMatchIndex=0,this._searchMatches[0].classList.add("md-ref-highlight-active"),this._searchMatches[0].scrollIntoView({behavior:"smooth",block:"center"})),this._updateSearchCount(),this._updateNavButtons()}_highlightTextNode(t,e){let i=t.nodeValue,o=i.toLowerCase(),n=t.parentNode,r=document.createDocumentFragment(),s=0,a=o.indexOf(e);for(;a>=0;){a>s&&r.appendChild(document.createTextNode(i.substring(s,a)));let t=document.createElement("mark");t.className="md-ref-highlight",t.textContent=i.substring(a,a+e.length),r.appendChild(t),s=a+e.length,a=o.indexOf(e,s)}s<i.length&&r.appendChild(document.createTextNode(i.substring(s))),n.replaceChild(r,t)}_updateSearchCount(){let t=document.getElementById("ContentEditor-MdRef-SearchCount");if(t)if(0===this._searchMatches.length){let e=document.getElementById("ContentEditor-MdRef-SearchInput");e&&e.value&&e.value.length>=2?t.textContent="0":t.textContent=""}else t.textContent=this._currentMatchIndex+1+"/"+this._searchMatches.length}_updateNavButtons(){let t=document.getElementById("ContentEditor-MdRef-SearchPrev"),e=document.getElementById("ContentEditor-MdRef-SearchNext"),i=this._searchMatches.length>0;t&&(t.disabled=!i),e&&(e.disabled=!i)}_clearSearch(){let t=document.getElementById("ContentEditor-MdRef-Content");t&&this._originalContent&&(t.innerHTML=this._originalContent),this._searchMatches=[],this._currentMatchIndex=-1,this._updateSearchCount(),this._updateNavButtons()}},e.exports.default_configuration=n},{"pict-view":88}],106:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-SettingsPanel",DefaultRenderable:"ContentEditor-SettingsPanel-Display",DefaultDestinationAddress:"#ContentEditor-SettingsPanel-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-settings-wrap\n\t\t{\n\t\t\tposition: relative;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.content-editor-settings-gear\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 6px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-radius: 4px;\n\t\t\tcolor: #B8AFA4;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-settings-gear:hover,\n\t\t.content-editor-settings-gear.active\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t}\n\t\t.content-editor-settings-gear svg\n\t\t{\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tfill: currentColor;\n\t\t}\n\t\t/* Flyout overlay — covers viewport to catch clicks outside */\n\t\t.content-editor-settings-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 999;\n\t\t}\n\t\t.content-editor-settings-overlay.open\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t/* Flyout panel */\n\t\t.content-editor-settings-flyout\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 44px;\n\t\t\tright: 0;\n\t\t\twidth: 270px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tbox-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);\n\t\t\tz-index: 1000;\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-4px);\n\t\t\tpointer-events: none;\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t}\n\t\t.content-editor-settings-flyout.open\n\t\t{\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t/* Speech bubble arrow */\n\t\t.content-editor-settings-flyout::before\n\t\t{\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: -7px;\n\t\t\tright: 12px;\n\t\t\twidth: 12px;\n\t\t\theight: 12px;\n\t\t\tbackground: #FFF;\n\t\t\tborder-left: 1px solid #DDD6CA;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\ttransform: rotate(45deg);\n\t\t}\n\t\t.content-editor-settings-flyout-body\n\t\t{\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.content-editor-settings-flyout-link\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 10px 12px;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 0.85rem;\n\t\t\tfont-weight: 500;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.content-editor-settings-flyout-link:hover\n\t\t{\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t.content-editor-settings-flyout-link svg\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tflex-shrink: 0;\n\t\t\tfill: #8A7F72;\n\t\t}\n\t\t.content-editor-settings-divider\n\t\t{\n\t\t\theight: 1px;\n\t\t\tbackground: #EDE9E3;\n\t\t\tmargin: 4px 8px;\n\t\t}\n\t\t/* Settings controls */\n\t\t.content-editor-settings-section\n\t\t{\n\t\t\tpadding: 8px 12px;\n\t\t}\n\t\t.content-editor-settings-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.content-editor-settings-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tgap: 8px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-settings-row:last-child\n\t\t{\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\taccent-color: #2E7D74;\n\t\t\tcursor: pointer;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox-label\n\t\t{\n\t\t\tfont: inherit;\n\t\t\tfont-size: 0.85rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.content-editor-settings-select\n\t\t{\n\t\t\twidth: 140px;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #FFF;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-settings-select:disabled\n\t\t{\n\t\t\topacity: 0.45;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-settings-select-label\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t/* Settings flyout: position from left edge for more room */\n\t\t\t.content-editor-settings-flyout\n\t\t\t{\n\t\t\t\tright: -8px;\n\t\t\t\twidth: 260px;\n\t\t\t}\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Full-width settings flyout on small phones */\n\t\t\t.content-editor-settings-flyout\n\t\t\t{\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 48px;\n\t\t\t\tright: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\tborder-radius: 0 0 8px 8px;\n\t\t\t}\n\t\t\t.content-editor-settings-flyout::before\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-SettingsPanel-Template",Template:'\n<div class="content-editor-settings-wrap">\n\t<button class="content-editor-settings-gear" id="ContentEditor-SettingsGear"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].togglePanel()">\n\t\t<svg viewBox="0 0 24 24"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.48.48 0 0 0-.48-.41h-3.84a.48.48 0 0 0-.48.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96a.49.49 0 0 0-.59.22L2.74 8.87a.48.48 0 0 0 .12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.26.41.48.41h3.84c.24 0 .44-.17.48-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6A3.6 3.6 0 1 1 12 8.4a3.6 3.6 0 0 1 0 7.2z"/></svg>\n\t</button>\n\t<div class="content-editor-settings-overlay" id="ContentEditor-SettingsOverlay"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].closePanel()"></div>\n\t<div class="content-editor-settings-flyout" id="ContentEditor-SettingsFlyout">\n\t\t<div class="content-editor-settings-flyout-body">\n\t\t\t<a class="content-editor-settings-flyout-link"\n\t\t\t\thref="/preview.html{~D:AppData.ContentEditor.ViewerHash~}" target="_blank">\n\t\t\t\t<svg viewBox="0 0 24 24"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>\n\t\t\t\tDocuserve Preview\n\t\t\t</a>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Word Wrap</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-MarkdownWordWrap">Markdown Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-MarkdownWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onMarkdownWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-CodeWordWrap">Code Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-CodeWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onCodeWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Markdown Editor</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-EditingControls">Editing Controls</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-EditingControls"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onEditingControlsChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<span class="content-editor-settings-select-label">Content Preview</span>\n\t\t\t\t\t<select class="content-editor-settings-select"\n\t\t\t\t\t\tid="ContentEditor-Setting-ContentPreviewMode"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onContentPreviewModeChanged(this.value)">\n\t\t\t\t\t\t<option value="off">Off</option>\n\t\t\t\t\t\t<option value="bottom">Underneath</option>\n\t\t\t\t\t\t<option value="side">Beside</option>\n\t\t\t\t\t\t<option value="tabbed">Tab</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoSegment">Auto Segment Markdown</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoSegment"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoSegmentChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<span class="content-editor-settings-select-label">Segment Depth</span>\n\t\t\t\t\t<select class="content-editor-settings-select"\n\t\t\t\t\t\tid="ContentEditor-Setting-SegmentDepth"\n\t\t\t\t\t\tdisabled\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onSegmentDepthChanged(this.value)">\n\t\t\t\t\t\t<option value="1">Depth 1: Blocks</option>\n\t\t\t\t\t\t<option value="2">Depth 2: ##</option>\n\t\t\t\t\t\t<option value="3">Depth 3: ###</option>\n\t\t\t\t\t\t<option value="4">Depth 4: ####</option>\n\t\t\t\t\t\t<option value="5">Depth 5: #####</option>\n\t\t\t\t\t\t<option value="6">Depth 6: ######</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Media Preview</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewImages">Auto-Preview Images</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewImages"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewImagesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewVideo">Auto-Preview Video</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewVideo"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewVideoChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewAudio">Auto-Preview Audio</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewAudio"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewAudioChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">File Browser</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-ShowHiddenFiles">Show Hidden Files</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-ShowHiddenFiles"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onShowHiddenFilesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-SettingsPanel-Display",TemplateHash:"ContentEditor-SettingsPanel-Template",DestinationAddress:"#ContentEditor-SettingsPanel-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._isOpen=!1}onAfterRender(t,e,i,o){let n=this.pict.AppData.ContentEditor,r=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-MarkdownWordWrap");r&&r[0]&&(r[0].checked=n.MarkdownWordWrap);let s=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-CodeWordWrap");s&&s[0]&&(s[0].checked=n.CodeWordWrap);let a=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-EditingControls");a&&a[0]&&(a[0].checked=n.MarkdownEditingControls);let l=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-ContentPreviewMode");l&&l[0]&&(l[0].value=n.ContentPreviewMode||"off");let d=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoSegment");d&&d[0]&&(d[0].checked=n.AutoSegmentMarkdown);let c=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");c&&c[0]&&(c[0].value=String(n.AutoSegmentDepth),c[0].disabled=!n.AutoSegmentMarkdown);let p=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewImages");p&&p[0]&&(p[0].checked=n.AutoPreviewImages);let h=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewVideo");h&&h[0]&&(h[0].checked=n.AutoPreviewVideo);let u=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewAudio");u&&u[0]&&(u[0].checked=n.AutoPreviewAudio);let m=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-ShowHiddenFiles");return m&&m[0]&&(m[0].checked=n.ShowHiddenFiles),super.onAfterRender(t,e,i,o)}togglePanel(){this._isOpen?this.closePanel():this.openPanel()}openPanel(){this._isOpen=!0;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.add("open"),e&&e[0]&&e[0].classList.add("open"),i&&i[0]&&i[0].classList.add("active")}closePanel(){this._isOpen=!1;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.remove("open"),e&&e[0]&&e[0].classList.remove("open"),i&&i[0]&&i[0].classList.remove("active")}onMarkdownWordWrapChanged(t){this.pict.AppData.ContentEditor.MarkdownWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e._segmentEditors)for(let i in e._segmentEditors){let o=e._segmentEditors[i];o&&o.contentDOM&&(t?o.contentDOM.classList.add("cm-lineWrapping"):o.contentDOM.classList.remove("cm-lineWrapping"))}}onCodeWordWrapChanged(t){this.pict.AppData.ContentEditor.CodeWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-CodeEditor"];e&&e._editorElement&&"code"===this.pict.AppData.ContentEditor.ActiveEditor&&(t?(e._editorElement.style.whiteSpace="pre-wrap",e._editorElement.style.overflowWrap="break-word"):(e._editorElement.style.whiteSpace="pre",e._editorElement.style.overflowWrap="normal"))}onEditingControlsChanged(t){this.pict.AppData.ContentEditor.MarkdownEditingControls=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e.toggleControls(t)}onContentPreviewModeChanged(t){this.pict.AppData.ContentEditor.ContentPreviewMode=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e.setPreviewMode(t)}onAutoSegmentChanged(t){this.pict.AppData.ContentEditor.AutoSegmentMarkdown=t,this.pict.PictApplication.saveSettings();let e=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");e&&e[0]&&(e[0].disabled=!t)}onSegmentDepthChanged(t){this.pict.AppData.ContentEditor.AutoSegmentDepth=parseInt(t,10)||1,this.pict.PictApplication.saveSettings()}onAutoPreviewImagesChanged(t){this.pict.AppData.ContentEditor.AutoPreviewImages=t,this.pict.PictApplication.saveSettings()}onAutoPreviewVideoChanged(t){this.pict.AppData.ContentEditor.AutoPreviewVideo=t,this.pict.PictApplication.saveSettings()}onAutoPreviewAudioChanged(t){this.pict.AppData.ContentEditor.AutoPreviewAudio=t,this.pict.PictApplication.saveSettings()}onShowHiddenFilesChanged(t){this.pict.AppData.ContentEditor.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings();let e=this;this.pict.PictApplication.syncHiddenFilesSetting(()=>{e.pict.PictApplication.loadFileList()})}},e.exports.default_configuration=n},{"pict-view":88}],107:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"ContentEditor-TopBar-Display",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-topbar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 0;\n\t\t\theight: 48px;\n\t\t\tborder-bottom: 3px solid #2E7D74;\n\t\t\tposition: relative;\n\t\t}\n\t\t.content-editor-topbar-brand\n\t\t{\n\t\t\tpadding: 0 16px;\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #E8E0D4;\n\t\t\twhite-space: nowrap;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t/* Centered file name — absolutely positioned so it stays\n\t\t centered in the full bar regardless of left/right content */\n\t\t.content-editor-topbar-file\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t\tmax-width: 50%;\n\t\t\ttext-align: center;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.content-editor-topbar-filename\n\t\t{\n\t\t\tfont-size: 0.9rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: #E8E0D4;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-file .content-editor-dirty-indicator\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\t/* Left spacer pushes actions to the right */\n\t\t.content-editor-topbar-spacer\n\t\t{\n\t\t\tflex: 1;\n\t\t}\n\t\t.content-editor-topbar-status\n\t\t{\n\t\t\tpadding: 0 12px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-status-saving\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-status-saved\n\t\t{\n\t\t\tcolor: #7BC47F;\n\t\t}\n\t\t.content-editor-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-topbar-stats\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tpadding: 0 8px;\n\t\t\tflex-shrink: 0;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 0 12px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-topbar-btn\n\t\t{\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.content-editor-topbar-btn-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-topbar-btn-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-topbar-btn-save:disabled\n\t\t{\n\t\t\tbackground: #5E5549;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-topbar-btn-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #B8AFA4;\n\t\t\tborder: 1px solid #5E5549;\n\t\t}\n\t\t.content-editor-topbar-btn-close:hover\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t\tborder-color: #8A7F72;\n\t\t\tbackground: rgba(255, 255, 255, 0.05);\n\t\t}\n\t\t/* Close-file confirmation overlay */\n\t\t.content-editor-confirm-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-confirm-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 360px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-confirm-body\n\t\t{\n\t\t\tpadding: 24px 22px 16px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tmargin-bottom: 8px;\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-confirm-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-confirm-message\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-bottom: 16px;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.content-editor-confirm-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-btn\n\t\t{\n\t\t\tpadding: 8px 20px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 5px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-confirm-btn-discard\n\t\t{\n\t\t\tbackground: #D9534F;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-confirm-btn-discard:hover\n\t\t{\n\t\t\tbackground: #C9302C;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-confirm-footer\n\t\t{\n\t\t\tpadding: 10px 22px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t.content-editor-topbar\n\t\t\t{\n\t\t\t\theight: auto;\n\t\t\t\tmin-height: 44px;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tpadding: 4px 0;\n\t\t\t}\n\n\t\t\t/* Brand text: shrink */\n\t\t\t.content-editor-topbar-brand\n\t\t\t{\n\t\t\t\tpadding: 0 8px;\n\t\t\t\tfont-size: 0.85rem;\n\t\t\t}\n\n\t\t\t/* File name: switch from absolute centering to flow layout */\n\t\t\t.content-editor-topbar-file\n\t\t\t{\n\t\t\t\tposition: static;\n\t\t\t\ttransform: none;\n\t\t\t\tmax-width: none;\n\t\t\t\tflex: 1;\n\t\t\t\tmin-width: 0;\n\t\t\t\tpadding: 0 4px;\n\t\t\t}\n\n\t\t\t/* Hide the spacer (not needed when file is in-flow) */\n\t\t\t.content-editor-topbar-spacer\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Hide word/line count stats on mobile to save space */\n\t\t\t.content-editor-topbar-stats\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Compact action buttons */\n\t\t\t.content-editor-topbar-actions\n\t\t\t{\n\t\t\t\tgap: 4px;\n\t\t\t\tpadding: 0 6px;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-btn\n\t\t\t{\n\t\t\t\tpadding: 5px 10px;\n\t\t\t\tfont-size: 0.75rem;\n\t\t\t}\n\n\t\t\t/* Status text */\n\t\t\t.content-editor-topbar-status\n\t\t\t{\n\t\t\t\tpadding: 0 6px;\n\t\t\t\tfont-size: 0.72rem;\n\t\t\t}\n\n\t\t\t/* Confirm dialog: tighter for mobile */\n\t\t\t.content-editor-confirm-panel\n\t\t\t{\n\t\t\t\twidth: 95vw;\n\t\t\t\tmax-width: 95vw;\n\t\t\t}\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Hide brand text entirely on very small screens */\n\t\t\t.content-editor-topbar-brand\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-filename\n\t\t\t{\n\t\t\t\tfont-size: 0.8rem;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-actions\n\t\t\t{\n\t\t\t\tpadding: 0 4px;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-TopBar-Template",Template:'\n<div class="content-editor-topbar">\n\t<div class="content-editor-topbar-brand">Content Editor</div>\n\t<div class="content-editor-topbar-file">\n\t\t<span class="content-editor-topbar-filename">{~D:AppData.ContentEditor.CurrentFile~}</span>{~D:AppData.ContentEditor.DirtyIndicatorHTML~}\n\t</div>\n\t<div class="content-editor-topbar-spacer"></div>\n\t<div class="content-editor-topbar-status {~D:AppData.ContentEditor.SaveStatusClass~}">\n\t\t{~D:AppData.ContentEditor.SaveStatus~}\n\t</div>\n\t<span class="content-editor-topbar-stats" id="ContentEditor-Stats"></span>\n\t<div class="content-editor-topbar-actions">\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-save"\n\t\t\tonclick="{~P~}.PictApplication.saveCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.SaveDisabledAttr~} {~D:AppData.ContentEditor.SaveVisibilityAttr~}>Save</button>\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-close"\n\t\t\tonclick="{~P~}.PictApplication.closeCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.CloseVisibilityAttr~}>Close</button>\n\t\t<div id="ContentEditor-SettingsPanel-Container"></div>\n\t</div>\n</div>\n<div class="content-editor-confirm-overlay" id="ContentEditor-ConfirmOverlay"\n\tonclick="{~P~}.PictApplication.cancelCloseFile()">\n\t<div class="content-editor-confirm-panel" onclick="event.stopPropagation()">\n\t\t<div class="content-editor-confirm-body">\n\t\t\t<div class="content-editor-confirm-icon">⚠</div>\n\t\t\t<div class="content-editor-confirm-title">Unsaved Changes</div>\n\t\t\t<div class="content-editor-confirm-message">\n\t\t\t\tThis file has unsaved changes.<br>Close without saving?\n\t\t\t</div>\n\t\t\t<div class="content-editor-confirm-actions">\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-discard"\n\t\t\t\t\tonclick="{~P~}.PictApplication.confirmCloseFile()">Discard & Close</button>\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-cancel"\n\t\t\t\t\tonclick="{~P~}.PictApplication.cancelCloseFile()">Cancel</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="content-editor-confirm-footer">\n\t\t\t<span class="content-editor-confirm-kbd">Y</span> to discard ·\n\t\t\t<span class="content-editor-confirm-kbd">N</span> or\n\t\t\t<span class="content-editor-confirm-kbd">Esc</span> to cancel\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-TopBar-Display",TemplateHash:"ContentEditor-TopBar-Template",DestinationAddress:"#ContentEditor-TopBar-Container",RenderMethod:"replace"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i)}onBeforeRender(t,e,i){let o=this.pict.AppData.ContentEditor;if(o.DirtyIndicatorHTML=o.IsDirty?' <span class="content-editor-dirty-indicator">*</span>':"",o.SaveDisabledAttr=!o.CurrentFile||o.IsSaving?"disabled":"",o.SaveVisibilityAttr=o.IsDirty||o.IsSaving||o.SaveStatus?"":'style="display:none"',o.CloseVisibilityAttr=o.CurrentFile?"":'style="display:none"',o.CurrentFile){let t=o.CurrentFile.replace(/\.md$/,"");o.ViewerHash="#/page/"+t}else o.ViewerHash="";return super.onBeforeRender(t,e,i)}onAfterRender(t,e,i,o){let n=this.pict.views["ContentEditor-SettingsPanel"];return n&&n.render(),super.onAfterRender(t,e,i,o)}},e.exports.default_configuration=n},{"pict-view":88}],108:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-Topics",DefaultRenderable:"Topics-Wrap",DefaultDestinationAddress:"#ContentEditor-SidebarTopics-Container",AutoRender:!1,CSS:"\n\t\t.topics-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.topics-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.topics-header-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-header-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-header-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-list\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\t\t.topics-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #F0EDE8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.topics-row:hover\n\t\t{\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.topics-row-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.topics-row-code\n\t\t{\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #2E7D74;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-row-title\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-path\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tgap: 2px;\n\t\t\tpadding-top: 1px;\n\t\t}\n\t\t.topics-row-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-row-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-row-btn-delete:hover\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t\tbackground: #FDF0EF;\n\t\t}\n\t\t/* Inline edit form */\n\t\t.topics-edit\n\t\t{\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #FFF9F0;\n\t\t}\n\t\t.topics-edit-field\n\t\t{\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.topics-edit-label\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 2px;\n\t\t}\n\t\t.topics-edit-input\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 4px 6px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.topics-edit-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.topics-edit-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t\tmargin-top: 8px;\n\t\t}\n\t\t.topics-edit-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-edit-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t/* Footer add button */\n\t\t.topics-footer\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.topics-add-btn\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 6px 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.topics-add-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Empty state */\n\t\t.topics-empty\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 32px 16px;\n\t\t\ttext-align: center;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t.topics-empty-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #C4BDB3;\n\t\t}\n\t\t.topics-empty-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 6px 14px;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-empty-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-empty-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.topics-empty-btn-secondary:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t",Templates:[{Hash:"Topics-Container-Template",Template:'\n<div class="topics-container" id="ContentEditor-Topics-Container">\n\t<div class="topics-header">\n\t\t<span class="topics-header-title" id="ContentEditor-Topics-HeaderTitle">Topics</span>\n\t\t<button class="topics-header-btn" title="Close topics file"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].closeTopicsFile()">×</button>\n\t</div>\n\t<div class="topics-list" id="ContentEditor-Topics-List"></div>\n\t<div class="topics-footer" id="ContentEditor-Topics-Footer">\n\t\t<button class="topics-add-btn"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].addTopic()">+ Add Topic</button>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Topics-Wrap",TemplateHash:"Topics-Container-Template",DestinationAddress:"#ContentEditor-SidebarTopics-Container"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._topics={},this._topicsFilePath="",this._hasRendered=!1,this._editingTopicCode=null}onAfterRender(){this._hasRendered=!0,this.pict.CSSMap.injectCSS(),this._topicsFilePath?(this._updateHeaderTitle(),this.renderTopicList()):this._showEmptyState()}loadTopicsFile(t,e){let i="function"==typeof e?e:()=>{},o=this;if(!t)return i("No path specified");let n=this.pict.providers["ContentEditor-Provider"];if(!n)return i("Provider not available");n.loadFile(t,(e,n)=>{if(e)return o._topics={},o._topicsFilePath="",o._hasRendered&&o._showEmptyState(),i(e);try{let t=JSON.parse(n);"object"!=typeof t||null===t||Array.isArray(t)?o._topics={}:o._topics=t}catch(t){o._topics={},o.log.warn("ContentEditor-Topics: Failed to parse topics JSON: "+t.message)}return o._topicsFilePath=t,o.pict.AppData.ContentEditor.TopicsFilePath=t,o.pict.PictApplication.saveSettings(),o._hasRendered&&(o._updateHeaderTitle(),o.renderTopicList(),o._showFooter(!0)),i(null)})}saveTopicsFile(t){let e="function"==typeof t?t:()=>{};if(!this._topicsFilePath)return e("No topics file loaded");let i=this.pict.providers["ContentEditor-Provider"];if(!i)return e("Provider not available");let o=JSON.stringify(this._topics,null,"\t");i.saveFile(this._topicsFilePath,o,e)}closeTopicsFile(){this._topics={},this._topicsFilePath="",this._editingTopicCode=null,this.pict.AppData.ContentEditor.TopicsFilePath="",this.pict.PictApplication.saveSettings(),this._hasRendered&&this._showEmptyState()}addTopic(t){if(!this._topicsFilePath)return void this._createDefaultTopicsFile(()=>{this.addTopic(t)});let e=t||{},i=e.TopicCode||this._generateUniqueCode("New-Topic"),o={TopicCode:i,TopicHelpFilePath:e.TopicHelpFilePath||"",TopicTitle:e.TopicTitle||""};"number"==typeof e.RelevantMarkdownLine&&(o.RelevantMarkdownLine=e.RelevantMarkdownLine),this._topics[i]=o;let n=this;this.saveTopicsFile(()=>{n.renderTopicList(),n.startEditTopic(i)})}removeTopic(t){if(!t||!this._topics[t])return;if(!confirm('Remove topic "'+t+'"?'))return;delete this._topics[t],this._editingTopicCode=null;let e=this;this.saveTopicsFile(()=>{e.renderTopicList()})}startEditTopic(t){if(!t||!this._topics[t])return;this._editingTopicCode=t,this.renderTopicList();let e=document.getElementById("topics-edit-code");e&&(e.focus(),e.select())}saveEditTopic(t){if(!t||!this._topics[t])return;let e=document.getElementById("topics-edit-code"),i=document.getElementById("topics-edit-title"),o=document.getElementById("topics-edit-path"),n=document.getElementById("topics-edit-line");if(!e)return;let r=e.value.trim(),s=i?i.value.trim():"",a=o?o.value.trim():"",l=n?parseInt(n.value,10):NaN;if(!r)return void(e.style.borderColor="#D9534F");if(r!==t&&this._topics[r])return e.style.borderColor="#D9534F",void alert('A topic with code "'+r+'" already exists.');r!==t&&delete this._topics[t];let d={TopicCode:r,TopicHelpFilePath:a,TopicTitle:s};!isNaN(l)&&l>0&&(d.RelevantMarkdownLine=l),this._topics[r]=d,this._editingTopicCode=null;let c=this;this.saveTopicsFile(()=>{c.renderTopicList()})}cancelEditTopic(){this._editingTopicCode=null,this.renderTopicList()}navigateToTopic(t){if(!t||!this._topics[t])return;let e=this._topics[t],i=e.TopicHelpFilePath;if(i&&(this.pict.PictApplication.navigateToFile(i),"number"==typeof e.RelevantMarkdownLine&&e.RelevantMarkdownLine>0)){let t=e.RelevantMarkdownLine;setTimeout(()=>{let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&e._segmentEditors){let i=0;for(let o in e._segmentEditors){let n=e._segmentEditors[o];if(n&&n.state&&n.state.doc){let e=n.state.doc.lines;if(i+e>=t){let o=t-i;o<1&&(o=1),o>e&&(o=e);let r=n.state.doc.line(o);n.dispatch({selection:{anchor:r.from},scrollIntoView:!0}),n.focus();break}i+=e}}}},500)}}renderTopicList(){let t=document.getElementById("ContentEditor-Topics-List");if(!t)return;let e=Object.keys(this._topics);if(0===e.length)return void(t.innerHTML='<div style="padding:16px;text-align:center;color:#8A7F72;font-size:0.78rem;">No topics yet. Click "+ Add Topic" to create one.</div>');let i="";for(let t=0;t<e.length;t++){let o=e[t],n=this._topics[o];this._editingTopicCode===o?i+=this._buildEditFormHTML(n):i+=this._buildTopicRowHTML(n)}t.innerHTML=i}_buildTopicRowHTML(t){let e=this._escapeHTML(t.TopicCode||""),i=this._escapeHTML(t.TopicTitle||""),o=this._escapeHTML(t.TopicHelpFilePath||""),n="number"==typeof t.RelevantMarkdownLine?" :"+t.RelevantMarkdownLine:"",r=this._escapeAttr(t.TopicCode||""),s="<div class=\"topics-row\" ondblclick=\"pict.views['ContentEditor-Topics'].startEditTopic('"+r+"')\">";return s+='<div class="topics-row-info">',s+='<div class="topics-row-code">'+e+"</div>",i&&(s+='<div class="topics-row-title">'+i+"</div>"),o&&(s+='<div class="topics-row-path">'+o+n+"</div>"),s+="</div>",s+='<div class="topics-row-actions">',s+='<button class="topics-row-btn" title="Edit" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].startEditTopic(\''+r+"')\">✎</button>",s+='<button class="topics-row-btn topics-row-btn-delete" title="Delete" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].removeTopic(\''+r+"')\">✖</button>",o&&(s+='<button class="topics-row-btn" title="Go to file" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].navigateToTopic(\''+r+"')\">→</button>"),s+="</div>",s+="</div>",s}_buildEditFormHTML(t){let e='<div class="topics-edit">';return e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Topic Code</label>',e+='<input class="topics-edit-input" id="topics-edit-code" type="text" value="'+this._escapeAttr(t.TopicCode||"")+'" placeholder="My-Topic-Code">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Title</label>',e+='<input class="topics-edit-input" id="topics-edit-title" type="text" value="'+this._escapeAttr(t.TopicTitle||"")+'" placeholder="Topic title">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Help File Path</label>',e+='<input class="topics-edit-input" id="topics-edit-path" type="text" value="'+this._escapeAttr(t.TopicHelpFilePath||"")+'" placeholder="path/to/file.md">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Line Number (optional)</label>',e+='<input class="topics-edit-input" id="topics-edit-line" type="number" value="'+("number"==typeof t.RelevantMarkdownLine?t.RelevantMarkdownLine:"")+'" placeholder="e.g. 23" min="1">',e+="</div>",e+='<div class="topics-edit-actions">',e+="<button class=\"topics-edit-save\" onclick=\"pict.views['ContentEditor-Topics'].saveEditTopic('"+this._escapeAttr(t.TopicCode||"")+"')\">Save</button>",e+='<button class="topics-edit-cancel" onclick="pict.views[\'ContentEditor-Topics\'].cancelEditTopic()">Cancel</button>',e+="</div>",e+="</div>",e}_showEmptyState(){let t=document.getElementById("ContentEditor-Topics-Container");if(!t){let t=document.getElementById("ContentEditor-SidebarTopics-Container");return void(t&&(t.innerHTML=this._buildEmptyStateHTML()))}t.innerHTML=this._buildEmptyStateHTML()}_buildEmptyStateHTML(){let t='<div class="topics-empty">';return t+='<div class="topics-empty-icon">📑</div>',t+="<div>No topics file loaded</div>",t+='<button class="topics-empty-btn" onclick="pict.views[\'ContentEditor-Topics\'].loadDefaultTopicsFile()">Load .pict_documentation_topics.json</button>',t+='<button class="topics-empty-btn topics-empty-btn-secondary" onclick="pict.views[\'ContentEditor-Topics\'].promptSelectTopicsFile()">Select file...</button>',t+="</div>",'<div class="topics-empty"><div class="topics-empty-icon">📑</div><div>No topics file loaded</div><button class="topics-empty-btn" onclick="pict.views[\'ContentEditor-Topics\'].loadDefaultTopicsFile()">Load .pict_documentation_topics.json</button><button class="topics-empty-btn topics-empty-btn-secondary" onclick="pict.views[\'ContentEditor-Topics\'].promptSelectTopicsFile()">Select file...</button></div>'}loadDefaultTopicsFile(){let t=this;this.loadTopicsFile(".pict_documentation_topics.json",e=>{e&&t._createDefaultTopicsFile()})}promptSelectTopicsFile(){let t=prompt("Enter the path to a topics JSON file:",".pict_documentation_topics.json");if(t&&t.trim()){let e=this;this.loadTopicsFile(t.trim(),i=>{i&&confirm('File not found. Create "'+t.trim()+'"?')&&(e._topicsFilePath=t.trim(),e._topics={},e.pict.AppData.ContentEditor.TopicsFilePath=t.trim(),e.pict.PictApplication.saveSettings(),e.saveTopicsFile(()=>{e._hasRendered&&e.render()}))})}}_createDefaultTopicsFile(t){let e="function"==typeof t?t:()=>{},i=this,o=".pict_documentation_topics.json";this._topicsFilePath=o,this._topics={},this.pict.AppData.ContentEditor.TopicsFilePath=o,this.pict.PictApplication.saveSettings(),this.saveTopicsFile(()=>{i._hasRendered&&i.render(),e()})}_updateHeaderTitle(){let t=document.getElementById("ContentEditor-Topics-HeaderTitle");if(t){let e=this._topicsFilePath.replace(/^.*\//,"");t.textContent=e||"Topics",t.title=this._topicsFilePath}}_showFooter(t){let e=document.getElementById("ContentEditor-Topics-Footer");e&&(e.style.display=t?"":"none")}_generateUniqueCode(t){if(!this._topics[t])return t;let e=2;for(;this._topics[t+"-"+e];)e++;return t+"-"+e}_escapeHTML(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_escapeAttr(t){return String(t).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}},e.exports.default_configuration=n},{"pict-view":88}],109:[function(t,e,i){var o=t("object-inspect"),n=t("es-errors/type"),r=function(t,e,i){for(var o,n=t;null!=(o=n.next);n=o)if(o.key===e)return n.next=o.next,i||(o.next=t.next,t.next=o),o};e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new n("Side channel does not contain "+o(t))},delete:function(e){var i=t&&t.next,o=function(t,e){if(t)return r(t,e,!0)}(t,e);return o&&i&&i===o&&(t=void 0),!!o},get:function(e){return function(t,e){if(t){var i=r(t,e);return i&&i.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!r(t,e)}(t,e)},set:function(e,i){t||(t={next:void 0}),function(t,e,i){var o=r(t,e);o?o.value=i:t.next={key:e,next:t.next,value:i}}(t,e,i)}};return e}},{"es-errors/type":16,"object-inspect":41}],110:[function(t,e,i){var o=t("get-intrinsic"),n=t("call-bound"),r=t("object-inspect"),s=t("es-errors/type"),a=o("%Map%",!0),l=n("Map.prototype.get",!0),d=n("Map.prototype.set",!0),c=n("Map.prototype.has",!0),p=n("Map.prototype.delete",!0),h=n("Map.prototype.size",!0);e.exports=!!a&&function(){var t,e={assert:function(t){if(!e.has(t))throw new s("Side channel does not contain "+r(t))},delete:function(e){if(t){var i=p(t,e);return 0===h(t)&&(t=void 0),i}return!1},get:function(e){if(t)return l(t,e)},has:function(e){return!!t&&c(t,e)},set:function(e,i){t||(t=new a),d(t,e,i)}};return e}},{"call-bound":8,"es-errors/type":16,"get-intrinsic":23,"object-inspect":41}],111:[function(t,e,i){var o=t("get-intrinsic"),n=t("call-bound"),r=t("object-inspect"),s=t("side-channel-map"),a=t("es-errors/type"),l=o("%WeakMap%",!0),d=n("WeakMap.prototype.get",!0),c=n("WeakMap.prototype.set",!0),p=n("WeakMap.prototype.has",!0),h=n("WeakMap.prototype.delete",!0);e.exports=l?function(){var t,e,i={assert:function(t){if(!i.has(t))throw new a("Side channel does not contain "+r(t))},delete:function(i){if(l&&i&&("object"==typeof i||"function"==typeof i)){if(t)return h(t,i)}else if(s&&e)return e.delete(i);return!1},get:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?d(t,i):e&&e.get(i)},has:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?p(t,i):!!e&&e.has(i)},set:function(i,o){l&&i&&("object"==typeof i||"function"==typeof i)?(t||(t=new l),c(t,i,o)):s&&(e||(e=s()),e.set(i,o))}};return i}:s},{"call-bound":8,"es-errors/type":16,"get-intrinsic":23,"object-inspect":41,"side-channel-map":110}],112:[function(t,e,i){var o=t("es-errors/type"),n=t("object-inspect"),r=t("side-channel-list"),s=t("side-channel-map"),a=t("side-channel-weakmap")||s||r;e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,i){t||(t=a()),t.set(e,i)}};return e}},{"es-errors/type":16,"object-inspect":41,"side-channel-list":109,"side-channel-map":110,"side-channel-weakmap":111}],113:[function(t,e,i){var o=t("punycode/");function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(l),c=["%","/","?",";","#"].concat(d),p=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=t("qs");function b(t,e,i){if(t&&"object"==typeof t&&t instanceof n)return t;var o=new n;return o.parse(t,e,i),o}n.prototype.parse=function(t,e,i){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),s=-1!==n&&n<t.indexOf("#")?"?":"#",l=t.split(s);l[0]=l[0].replace(/\\/g,"/");var b=t=l.join(s);if(b=b.trim(),!i&&1===t.split("#").length){var w=a.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?v.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var y=r.exec(b);if(y){var C=(y=y[0]).toLowerCase();this.protocol=C,b=b.substr(y.length)}if(i||y||b.match(/^\/\/[^@/]+@[^@/]+/)){var x="//"===b.substr(0,2);!x||y&&f[y]||(b=b.substr(2),this.slashes=!0)}if(!f[y]&&(x||y&&!g[y])){for(var A,R,D=-1,E=0;E<p.length;E++){-1!==(S=b.indexOf(p[E]))&&(-1===D||S<D)&&(D=S)}-1!==(R=-1===D?b.lastIndexOf("@"):b.lastIndexOf("@",D))&&(A=b.slice(0,R),b=b.slice(R+1),this.auth=decodeURIComponent(A)),D=-1;for(E=0;E<c.length;E++){var S;-1!==(S=b.indexOf(c[E]))&&(-1===D||S<D)&&(D=S)}-1===D&&(D=b.length),this.host=b.slice(0,D),b=b.slice(D),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var F=this.hostname.split(/\./),P=(E=0,F.length);E<P;E++){var _=F[E];if(_&&!_.match(h)){for(var k="",I=0,L=_.length;I<L;I++)_.charCodeAt(I)>127?k+="x":k+=_[I];if(!k.match(h)){var M=F.slice(0,E),B=F.slice(E+1),V=_.match(u);V&&(M.push(V[1]),B.unshift(V[2])),B.length&&(b="/"+B.join(".")+b),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=o.toASCII(this.hostname));var H=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+H,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[C])for(E=0,P=d.length;E<P;E++){var j=d[E];if(-1!==b.indexOf(j)){var O=encodeURIComponent(j);O===j&&(O=escape(j)),b=b.split(j).join(O)}}var U=b.indexOf("#");-1!==U&&(this.hash=b.substr(U),b=b.slice(0,U));var z=b.indexOf("?");if(-1!==z?(this.search=b.substr(z),this.query=b.substr(z+1),e&&(this.query=v.parse(this.query)),b=b.slice(0,z)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){H=this.pathname||"";var $=this.search||"";this.path=H+$}return this.href=this.format(),this},n.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",o=this.hash||"",n=!1,r="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(r=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||r&&"?"+r||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==n?(n="//"+(n||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):n||(n=""),o&&"#"!==o.charAt(0)&&(o="#"+o),s&&"?"!==s.charAt(0)&&(s="?"+s),e+n+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(s=s.replace("#","%23"))+o},n.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},n.prototype.resolveObject=function(t){if("string"==typeof t){var e=new n;e.parse(t,!1,!0),t=e}for(var i=new n,o=Object.keys(this),r=0;r<o.length;r++){var s=o[r];i[s]=this[s]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),l=0;l<a.length;l++){var d=a[l];"protocol"!==d&&(i[d]=t[d])}return g[i.protocol]&&i.hostname&&!i.pathname&&(i.pathname="/",i.path=i.pathname),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!g[t.protocol]){for(var c=Object.keys(t),p=0;p<c.length;p++){var h=c[p];i[h]=t[h]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||f[t.protocol])i.pathname=t.pathname;else{for(var u=(t.pathname||"").split("/");u.length&&!(t.host=u.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==u[0]&&u.unshift(""),u.length<2&&u.unshift(""),i.pathname=u.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var m=i.pathname||"",v=i.search||"";i.path=m+v}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var b=i.pathname&&"/"===i.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),y=w||b||i.host&&t.pathname,C=y,x=i.pathname&&i.pathname.split("/")||[],A=(u=t.pathname&&t.pathname.split("/")||[],i.protocol&&!g[i.protocol]);if(A&&(i.hostname="",i.port=null,i.host&&(""===x[0]?x[0]=i.host:x.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===u[0]?u[0]=t.host:u.unshift(t.host)),t.host=null),y=y&&(""===u[0]||""===x[0])),w)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,x=u;else if(u.length)x||(x=[]),x.pop(),x=x.concat(u),i.search=t.search,i.query=t.query;else if(null!=t.search){if(A)i.host=x.shift(),i.hostname=i.host,(T=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=T.shift(),i.hostname=T.shift(),i.host=i.hostname);return i.search=t.search,i.query=t.query,null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!x.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var R=x.slice(-1)[0],D=(i.host||t.host||x.length>1)&&("."===R||".."===R)||""===R,E=0,S=x.length;S>=0;S--)"."===(R=x[S])?x.splice(S,1):".."===R?(x.splice(S,1),E++):E&&(x.splice(S,1),E--);if(!y&&!C)for(;E--;E)x.unshift("..");!y||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),D&&"/"!==x.join("/").substr(-1)&&x.push("");var T,F=""===x[0]||x[0]&&"/"===x[0].charAt(0);A&&(i.hostname=F?"":x.length?x.shift():"",i.host=i.hostname,(T=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=T.shift(),i.hostname=T.shift(),i.host=i.hostname));return(y=y||i.host&&x.length)&&!F&&x.unshift(""),x.length>0?i.pathname=x.join("/"):(i.pathname=null,i.path=null),null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},n.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},i.parse=b,i.resolve=function(t,e){return b(t,!1,!0).resolve(e)},i.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},i.format=function(t){return"string"==typeof t&&(t=b(t)),t instanceof n?t.format():n.prototype.format.call(t)},i.Url=n},{"punycode/":90,qs:92}],114:[function(t,e,i){e.exports={Name:"Retold Remote",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1}},{}],115:[function(t,e,i){const o=t("retold-content-system").PictContentEditor,n=(t("pict-section-filebrowser"),t("./providers/Pict-Provider-RetoldRemote.js")),r=t("./providers/Pict-Provider-GalleryNavigation.js"),s=t("./providers/Pict-Provider-GalleryFilterSort.js"),a=t("./providers/Pict-Provider-RetoldRemoteIcons.js"),l=t("./providers/Pict-Provider-RetoldRemoteTheme.js"),d=t("./providers/Pict-Provider-FormattingUtilities.js"),c=t("./providers/Pict-Provider-ToastNotification.js"),p=t("./providers/Pict-Provider-CollectionManager.js"),h=t("./providers/Pict-Provider-AISortManager.js"),u=t("./RetoldRemote-ExtensionMaps.js"),m=t("./views/PictView-Remote-Layout.js"),f=t("./views/PictView-Remote-TopBar.js"),g=t("./views/PictView-Remote-SettingsPanel.js"),v=t("./views/PictView-Remote-Gallery.js"),b=t("./views/PictView-Remote-MediaViewer.js"),w=t("./views/PictView-Remote-ImageViewer.js"),y=t("./views/PictView-Remote-VideoExplorer.js"),C=t("./views/PictView-Remote-AudioExplorer.js"),x=t("./views/PictView-Remote-ImageExplorer.js"),A=t("./views/PictView-Remote-VLCSetup.js"),R=t("./views/PictView-Remote-CollectionsPanel.js"),D=t("./views/PictView-Remote-FileInfoPanel.js"),E=t("./Pict-Application-RetoldRemote-Configuration.json");e.exports=class extends o{constructor(t,e,i){super(t,Object.assign({},E,e),i),this.pict.addView("ContentEditor-Layout",m.default_configuration,m),this.pict.addView("ContentEditor-TopBar",f.default_configuration,f),this.pict.addView("RetoldRemote-Gallery",v.default_configuration,v),this.pict.addView("RetoldRemote-MediaViewer",b.default_configuration,b),this.pict.addView("RetoldRemote-ImageViewer",w.default_configuration,w),this.pict.addView("RetoldRemote-SettingsPanel",g.default_configuration,g),this.pict.addView("RetoldRemote-VideoExplorer",y.default_configuration,y),this.pict.addView("RetoldRemote-AudioExplorer",C.default_configuration,C),this.pict.addView("RetoldRemote-ImageExplorer",x.default_configuration,x),this.pict.addView("RetoldRemote-VLCSetup",A.default_configuration,A),this.pict.addView("RetoldRemote-CollectionsPanel",R.default_configuration,R),this.pict.addView("RetoldRemote-FileInfoPanel",D.default_configuration,D),this.pict.addProvider("RetoldRemote-Provider",n.default_configuration,n),this.pict.addProvider("RetoldRemote-GalleryNavigation",r.default_configuration,r),this.pict.addProvider("RetoldRemote-GalleryFilterSort",s.default_configuration,s),this.pict.addProvider("RetoldRemote-Icons",a.default_configuration,a),this.pict.addProvider("RetoldRemote-Theme",l.default_configuration,l),this.pict.addProvider("RetoldRemote-FormattingUtilities",d.default_configuration,d),this.pict.addProvider("RetoldRemote-ToastNotification",c.default_configuration,c),this.pict.addProvider("RetoldRemote-CollectionManager",p.default_configuration,p),this.pict.addProvider("RetoldRemote-AISortManager",h.default_configuration,h)}onAfterInitializeAsync(t){"undefined"!=typeof window&&(window.pict=this.pict),this.pict.AppData.RetoldRemote={ActiveMode:"gallery",Theme:"twilight",ViewMode:"list",ThumbnailSize:"medium",RawFileList:[],GalleryItems:[],GalleryCursorIndex:0,FolderCursorHistory:{},GalleryFilter:"all",SearchQuery:"",SearchCaseSensitive:!1,SearchRegex:!1,ServerCapabilities:{},FolderSummary:null,CurrentViewerFile:"",CurrentViewerMediaType:"",HashedFilenames:!0,ShowHiddenFiles:!1,DistractionFreeShowNav:!1,ImageFitMode:"fit",SidebarCollapsed:!1,SidebarWidth:250,AutoplayVideo:!1,AutoplayAudio:!1,ListShowExtension:!0,ListShowSize:!0,ListShowDate:!0,FilterState:{MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null},SortField:"folder-first",SortDirection:"asc",FilterBarVisible:!1,FilterPanelOpen:!1,FilterPresets:[],Collections:[],CollectionsPanelOpen:!1,CollectionsPanelWidth:300,CollectionsPanelMode:"list",ActiveCollectionGUID:null,ActiveCollection:null,CollectionSearchQuery:"",LastUsedCollectionGUID:null,BrowsingCollection:!1,BrowsingCollectionIndex:-1,FavoritesGUID:null,FavoritesCollection:null,FavoritesPathSet:{},CurrentFileMetadata:null,AISortSettings:{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"}},this._loadRemoteSettings();let e=this.pict.providers["RetoldRemote-Theme"];e&&e.applyTheme(this.pict.AppData.RetoldRemote.Theme),this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,AutoContentPreview:!1,MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:this.pict.AppData.RetoldRemote.SidebarCollapsed,SidebarWidth:this.pict.AppData.RetoldRemote.SidebarWidth,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:this.pict.AppData.RetoldRemote.ShowHiddenFiles,TopicsFilePath:""},this.pict.views["ContentEditor-Layout"].render(),this.pict.views["ContentEditor-TopBar"].render(),this.pict.views["RetoldRemote-CollectionsPanel"].render();let i=this.pict.providers["RetoldRemote-CollectionManager"];i&&i.fetchCollections(()=>{i.ensureFavoritesCollection()});let o=this.pict.views["ContentEditor-TopBar"];o&&"function"==typeof o.updateCollectionsIcon&&o.updateCollectionsIcon();let n=this,r=this.pict.providers["Pict-FileBrowser-List"];if(r){let t=r.selectFile.bind(r);r.selectFile=function(e){if(t(e),e&&"file"===e.Type)n.navigateToFile(e.Path);else if(e&&("folder"===e.Type||"archive"===e.Type)){let t=n.pict.AppData.PictFileBrowser&&n.pict.AppData.PictFileBrowser.CurrentLocation||"",i=t?t+"/"+e.Name:e.Name;n.loadFileList(i)}}}let s=this.pict.providers["Pict-FileBrowser-Browse"];if(s){let t=s.navigateToFolder.bind(s);s.navigateToFolder=function(e){t(e),n.loadFileList(e)}}let a=this.pict.providers["RetoldRemote-Provider"];a&&(a.fetchCapabilities((t,e)=>{!t&&e&&(n.pict.AppData.RetoldRemote.ServerCapabilities=e)}),a.fetchRemoteSettings((t,e)=>{!t&&e&&(n.pict.AppData.RetoldRemote.HashedFilenames=!!e.HashedFilenames)}));let l=this.pict.providers["RetoldRemote-GalleryNavigation"];l&&l.bindKeyboardNavigation();let d=window.location.hash||"";if(this.syncHiddenFilesSetting(()=>{n.loadFileList(null,()=>{d&&"#"!==d&&"#/"!==d&&"#/browse/"!==d&&"#/browse"!==d?window.location.hash=d:n.resolveHash()})}),"function"==typeof t)return t()}_getMediaType(t){return{js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0,py:!0,rb:!0,java:!0,c:!0,cpp:!0,h:!0,hpp:!0,cs:!0,go:!0,rs:!0,php:!0,sh:!0,bash:!0,zsh:!0,pl:!0,r:!0,swift:!0,kt:!0,scala:!0,lua:!0,json:!0,xml:!0,yaml:!0,yml:!0,toml:!0,ini:!0,cfg:!0,conf:!0,env:!0,properties:!0,md:!0,markdown:!0,txt:!0,csv:!0,tsv:!0,log:!0,html:!0,htm:!0,css:!0,scss:!0,sass:!0,less:!0,sql:!0,graphql:!0,gql:!0,makefile:!0,dockerfile:!0,gitignore:!0,editorconfig:!0,htaccess:!0,npmrc:!0,eslintrc:!0,prettierrc:!0}[t]?"text":u.getCategory(t)}navigateToFile(t){if(!t)return;let e=this.getEditorTypeForFile(t),i=t.replace(/^.*\./,"").toLowerCase(),o=this._getMediaType(i),n=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-Provider"]),r=n?n.getFragmentIdentifier(t):t;if(window.location.hash="#/view/"+r,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor=e,"binary"===e){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,o)}else if("text"===o){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"text")}else if("other"===o){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"document")}else{let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,o)}let s=this.pict.views["ContentEditor-TopBar"];s&&(s.updateInfo(),"function"==typeof s.updateFavoritesIcon&&s.updateFavoritesIcon())}navigateToFileAs(t,e){if(!t)return;this.pict.AppData.RetoldRemote;let i=this.pict.providers["RetoldRemote-Provider"],o=i?i.getFragmentIdentifier(t):t;window.location.hash="#/view/"+o,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor="binary";let n=this.pict.views["RetoldRemote-MediaViewer"];n&&n.showMedia(t,e);let r=this.pict.views["ContentEditor-TopBar"];r&&(r.updateInfo(),"function"==typeof r.updateFavoritesIcon&&r.updateFavoritesIcon())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},o=this,n="string"==typeof t?t:null;null===n&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(n=this.pict.AppData.PictFileBrowser.CurrentLocation);let r="/api/filebrowser/list";if(n&&n.length>0){let t=o.pict.providers["RetoldRemote-Provider"];r+=t?"?path="+t._getPathParam(n):"?path="+encodeURIComponent(n)}fetch(r).then(t=>{let e=t.headers.get("X-Retold-Folder-Hash");if(e&&n){let t=o.pict.providers["RetoldRemote-Provider"];t&&t.registerHash(n,e)}return t.json()}).then(e=>{o.pict.AppData.PictFileBrowser=o.pict.AppData.PictFileBrowser||{},o.pict.AppData.PictFileBrowser.FileList=e||[],o.pict.AppData.PictFileBrowser.CurrentLocation="string"==typeof t?t:o.pict.AppData.PictFileBrowser.CurrentLocation||"";let n=o.pict.providers["RetoldRemote-Provider"];if(n&&Array.isArray(e))for(let t=0;t<e.length;t++)e[t].Hash&&e[t].Path&&n.registerHash(e[t].Path,e[t].Hash);let r=o.pict.views["Pict-FileBrowser"];r&&r.render();let s=o.pict.views["Pict-FileBrowser-ListDetail"];s&&s.render(),o._injectSidebarAddFolderButton();let a=o.pict.AppData.RetoldRemote;a.RawFileList=e||[],a.ActiveMode="gallery",a.SearchQuery="",a.FilterState={MediaType:a.FilterState.MediaType,Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null};let l=document.getElementById("RetoldRemote-Gallery-Container"),d=document.getElementById("RetoldRemote-Viewer-Container");l&&(l.style.display=""),d&&(d.style.display="none");let c=o.pict.providers["RetoldRemote-GalleryFilterSort"];if(c)c.applyFilterSort();else{a.GalleryItems=e||[];let t=a.FolderCursorHistory&&a.FolderCursorHistory[o.pict.AppData.PictFileBrowser.CurrentLocation||""];a.GalleryCursorIndex="number"==typeof t&&t<(e||[]).length?t:0;let i=o.pict.views["RetoldRemote-Gallery"];i&&i.renderGallery()}let p=o.pict.AppData.PictFileBrowser.CurrentLocation||"",h=o.pict.providers["RetoldRemote-Provider"],u=h&&p?h.getFragmentIdentifier(p):p;window.location.hash=u?"#/browse/"+u:"#/browse/";let m=o.pict.providers["RetoldRemote-Provider"],f=/\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz)(\/|$)/i.test(p);if(m&&!f)m.fetchFolderSummary(p,(t,e)=>{if(!t&&e){a.FolderSummary=e;let t=o.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}});else{let t=o.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}return i()}).catch(t=>(o.log.error(`Failed to load file list: ${t.message}`),i()))}resolveHash(){let t=decodeURIComponent((window.location.hash||"").replace(/^#\/?/,""));if(!t)return;let e=t.split("/"),i=this.pict.providers["RetoldRemote-Provider"],o=this,n=e[0];if(["browse","view","explore","explore-audio","explore-image","edit"].indexOf(n)>=0&&e.length>=2){let t=e.slice(1).join("/"),r=i?i.resolveFragmentIdentifier(t):t;if(/^[a-f0-9]{10}$/.test(r))return void o._resolveHashFromServer(r,t=>{o._executeRoute(n,t||r)});this._executeRoute(n,r)}else if("collection"===n&&e.length>=2){let t=e[1],i=this.pict.providers["RetoldRemote-CollectionManager"];if(i){this.pict.AppData.RetoldRemote.CollectionsPanelMode="detail",i.openPanel(),i.fetchCollection(t)}}}_executeRoute(t,e){switch(t){case"browse":e!==(this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"")&&this.loadFileList(e);break;case"view":case"edit":this.pict.AppData.ContentEditor.CurrentFile!==e&&this.navigateToFile(e);break;case"explore":{let t=this.pict.views["RetoldRemote-VideoExplorer"];t&&t.showExplorer(e);break}case"explore-audio":{let t=this.pict.views["RetoldRemote-AudioExplorer"];t&&t.showExplorer(e);break}case"explore-image":{let t=this.pict.views["RetoldRemote-ImageExplorer"];t&&t.showExplorer(e);break}}}_resolveHashFromServer(t,e){let i=this;fetch("/api/resolve-hash/"+t).then(t=>t.ok?t.json():e(null)).then(o=>{if(o&&o.Success&&o.Path){let n=i.pict.providers["RetoldRemote-Provider"];n&&n.registerHash(o.Path,t);let r=o.Path.replace(/\/[^/]+$/,"")||"";return i.loadFileList(r),e(o.Path)}return e(null)}).catch(()=>e(null))}_injectSidebarAddFolderButton(){let t=document.getElementById("Pict-FileBrowser-DetailRows");if(!t)return;let e=t.parentElement.querySelector(".retold-remote-sidebar-addfolder");e&&e.parentElement.removeChild(e);let i=document.createElement("button");i.className="retold-remote-sidebar-addfolder",i.textContent="+ New Folder",i.title="Create a new folder here",i.onclick=function(){pict.PictApplication.promptNewFolder()},t.parentElement.appendChild(i)}saveSettings(){try{let t=this.pict.AppData.RetoldRemote,e={Theme:t.Theme,ViewMode:t.ViewMode,ThumbnailSize:t.ThumbnailSize,GalleryFilter:t.GalleryFilter,ShowHiddenFiles:t.ShowHiddenFiles,DistractionFreeShowNav:t.DistractionFreeShowNav,ImageFitMode:t.ImageFitMode,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,SortField:t.SortField,SortDirection:t.SortDirection,FilterPresets:t.FilterPresets,FilterPanelOpen:t.FilterPanelOpen,AutoplayVideo:t.AutoplayVideo,AutoplayAudio:t.AutoplayAudio,ListShowExtension:t.ListShowExtension,ListShowSize:t.ListShowSize,ListShowDate:t.ListShowDate,CollectionsPanelOpen:t.CollectionsPanelOpen,CollectionsPanelWidth:t.CollectionsPanelWidth,LastUsedCollectionGUID:t.LastUsedCollectionGUID,FavoritesGUID:t.FavoritesGUID,AISortSettings:t.AISortSettings};localStorage.setItem("retold-remote-settings",JSON.stringify(e))}catch(t){}}_loadRemoteSettings(){try{let t=localStorage.getItem("retold-remote-settings");if(t){let e=JSON.parse(t),i=this.pict.AppData.RetoldRemote;e.Theme&&(i.Theme=e.Theme),e.ViewMode&&(i.ViewMode=e.ViewMode),e.ThumbnailSize&&(i.ThumbnailSize=e.ThumbnailSize),e.GalleryFilter&&(i.GalleryFilter=e.GalleryFilter,i.FilterState.MediaType=e.GalleryFilter),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"boolean"==typeof e.DistractionFreeShowNav&&(i.DistractionFreeShowNav=e.DistractionFreeShowNav),e.ImageFitMode&&(i.ImageFitMode=e.ImageFitMode),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),e.SortField&&(i.SortField=e.SortField),e.SortDirection&&(i.SortDirection=e.SortDirection),Array.isArray(e.FilterPresets)&&(i.FilterPresets=e.FilterPresets),"boolean"==typeof e.FilterPanelOpen&&(i.FilterPanelOpen=e.FilterPanelOpen),"boolean"==typeof e.AutoplayVideo&&(i.AutoplayVideo=e.AutoplayVideo),"boolean"==typeof e.AutoplayAudio&&(i.AutoplayAudio=e.AutoplayAudio),"boolean"==typeof e.ListShowExtension&&(i.ListShowExtension=e.ListShowExtension),"boolean"==typeof e.ListShowSize&&(i.ListShowSize=e.ListShowSize),"boolean"==typeof e.ListShowDate&&(i.ListShowDate=e.ListShowDate),"boolean"==typeof e.CollectionsPanelOpen&&(i.CollectionsPanelOpen=e.CollectionsPanelOpen),e.CollectionsPanelWidth&&(i.CollectionsPanelWidth=e.CollectionsPanelWidth),e.LastUsedCollectionGUID&&(i.LastUsedCollectionGUID=e.LastUsedCollectionGUID),e.FavoritesGUID&&(i.FavoritesGUID=e.FavoritesGUID),e.AISortSettings&&"object"==typeof e.AISortSettings&&(e.AISortSettings.AIEndpoint&&(i.AISortSettings.AIEndpoint=e.AISortSettings.AIEndpoint),e.AISortSettings.AIModel&&(i.AISortSettings.AIModel=e.AISortSettings.AIModel),e.AISortSettings.AIProvider&&(i.AISortSettings.AIProvider=e.AISortSettings.AIProvider),e.AISortSettings.NamingTemplate&&(i.AISortSettings.NamingTemplate=e.AISortSettings.NamingTemplate))}}catch(t){}}}},{"./Pict-Application-RetoldRemote-Configuration.json":114,"./RetoldRemote-ExtensionMaps.js":117,"./providers/Pict-Provider-AISortManager.js":121,"./providers/Pict-Provider-CollectionManager.js":122,"./providers/Pict-Provider-FormattingUtilities.js":123,"./providers/Pict-Provider-GalleryFilterSort.js":124,"./providers/Pict-Provider-GalleryNavigation.js":125,"./providers/Pict-Provider-RetoldRemote.js":126,"./providers/Pict-Provider-RetoldRemoteIcons.js":127,"./providers/Pict-Provider-RetoldRemoteTheme.js":128,"./providers/Pict-Provider-ToastNotification.js":129,"./views/PictView-Remote-AudioExplorer.js":139,"./views/PictView-Remote-CollectionsPanel.js":140,"./views/PictView-Remote-FileInfoPanel.js":141,"./views/PictView-Remote-Gallery.js":142,"./views/PictView-Remote-ImageExplorer.js":143,"./views/PictView-Remote-ImageViewer.js":144,"./views/PictView-Remote-Layout.js":145,"./views/PictView-Remote-MediaViewer.js":146,"./views/PictView-Remote-SettingsPanel.js":147,"./views/PictView-Remote-TopBar.js":148,"./views/PictView-Remote-VLCSetup.js":149,"./views/PictView-Remote-VideoExplorer.js":150,"pict-section-filebrowser":63,"retold-content-system":100}],116:[function(t,e,i){e.exports={RetoldRemoteApplication:t("./Pict-Application-RetoldRemote.js")},"undefined"!=typeof window&&(window.RetoldRemoteApplication=e.exports.RetoldRemoteApplication)},{"./Pict-Application-RetoldRemote.js":115}],117:[function(t,e,i){const o={nef:!0,nrw:!0,cr2:!0,cr3:!0,crw:!0,arw:!0,srf:!0,sr2:!0,raf:!0,orf:!0,rw2:!0,rwl:!0,pef:!0,srw:!0,x3f:!0,"3fr":!0,fff:!0,iiq:!0,dcr:!0,kdc:!0,mrw:!0,erf:!0,raw:!0,dng:!0,heic:!0,heif:!0},n={png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0,tiff:!0,tif:!0,heic:!0,heif:!0};for(let t in o)n[t]=!0;const r={mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0,mpg:!0,mpeg:!0,mpe:!0,mpv:!0,m2v:!0,ts:!0,mts:!0,m2ts:!0,vob:!0,"3gp":!0,"3g2":!0,f4v:!0,rm:!0,rmvb:!0,divx:!0,asf:!0,mxf:!0,dv:!0,nsv:!0,nuv:!0,y4m:!0,wtv:!0,swf:!0,dat:!0},s={mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0},a={pdf:!0,epub:!0,mobi:!0,doc:!0,docx:!0};e.exports.RawImageExtensions=o,e.exports.ImageExtensions=n,e.exports.VideoExtensions=r,e.exports.AudioExtensions=s,e.exports.DocumentExtensions=a,e.exports.getCategory=function(t){let e=(t||"").replace(/^\./,"").toLowerCase();return n[e]?"image":r[e]?"video":s[e]?"audio":a[e]?"document":"other"},e.exports.isRawImage=function(t){let e=(t||"").replace(/^\./,"").toLowerCase();return!!o[e]}},{}],118:[function(t,e,i){
|
|
89
89
|
/**
|
|
90
90
|
* CollectionManager — Add Items Mixin
|
|
91
91
|
*
|
|
@@ -98,7 +98,7 @@ const o=t("fable-serviceproviderbase"),n=t("path"),r=t("fs"),s=t("url"),a={BaseP
|
|
|
98
98
|
*
|
|
99
99
|
* @license MIT
|
|
100
100
|
*/
|
|
101
|
-
e.exports={addCurrentFileToCollection:function(t){let e=this._getRemote(),i=t||e.LastUsedCollectionGUID;if(!i)return!1;if("video-explorer"===e.ActiveMode)return this.addVideoFrameToCollection(i);if("audio-explorer"===e.ActiveMode)return this.addAudioSnippetToCollection(i);let o=this._resolveCurrentItem();if(!o||!o.Path)return!1;let n=o.Path;if("folder"===o.Type||"archive"===o.Type){let t=this;return this.showFolderChoicePrompt(e=>{let o={Type:"contents"===e?"folder-contents":"folder",Path:n,Label:"",Note:""};t.addItemsToCollection(i,[o])}),!0}let r={Type:"file",Path:n,Label:"",Note:""},s=n.match(/^(.*?\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz))\/(.*)/i);if(s&&(r.Type="subfile",r.ArchivePath=s[1]),"viewer"===e.ActiveMode&&"video"===e.CurrentViewerMediaType&&!e.VideoMenuActive){let t=document.getElementById("RetoldRemote-VideoPlayer");t&&!isNaN(t.currentTime)&&t.currentTime>0&&(r.Type="video-frame",r.FrameTimestamp=Math.round(100*t.currentTime)/100)}let a=this.pict.providers["RetoldRemote-Provider"];if(a){let t=a.getHashForPath(n);t&&(r.Hash=t)}return this.addItemsToCollection(i,[r]),!0},addVideoFrameToCollection:function(t){let e=this._getRemote(),i=t||e.LastUsedCollectionGUID;if(!i)return!1;let o=this.pict.views["RetoldRemote-VideoExplorer"];if(!o||!o._currentPath||!o._frameData)return!1;let n=o._selectedFrameIndex;n<0&&(n=0);let r=o._frameData.Frames[n];if(!r)return!1;let s=o._currentPath.replace(/^.*\//,""),a=r.TimestampFormatted||this._formatTimestamp(r.Timestamp),l={Type:"video-frame",Path:o._currentPath,FrameTimestamp:r.Timestamp,FrameCacheKey:o._frameData.CacheKey||null,FrameFilename:r.Filename||null,Label:s+" @ "+a,Note:""};return this.addItemsToCollection(i,[l]),!0},addVideoClipToCollection:function(t,e,i){let o=this._getRemote(),n=t||o.LastUsedCollectionGUID;if(!n)return!1;let r=null;if("video-explorer"===o.ActiveMode){let t=this.pict.views["RetoldRemote-VideoExplorer"];t&&t._currentPath&&(r=t._currentPath)}if(r||(r=o.CurrentViewerFile),!r)return!1;let s=r.replace(/^.*\//,""),a={Type:"video-clip",Path:r,VideoStart:e,VideoEnd:i,Label:s+": "+this._formatTimestamp(e)+" – "+this._formatTimestamp(i),Note:""};return this.addItemsToCollection(n,[a]),!0},addAudioSnippetToCollection:function(t){let e=this._getRemote(),i=t||e.LastUsedCollectionGUID;if(!i)return!1;let o=this.pict.views["RetoldRemote-AudioExplorer"];if(!o||!o._currentPath||!o._waveformData)return!1;let n=o._waveformData.Duration||0;if(n<=0)return!1;let r=0,s=n;o._selectionStart>=0&&o._selectionEnd>=0&&(r=Math.round(o._selectionStart*n*100)/100,s=Math.round(o._selectionEnd*n*100)/100);let a=o._currentPath.replace(/^.*\//,""),l={Type:"audio-clip",Path:o._currentPath,AudioStart:r,AudioEnd:s,Label:a+": "+this._formatTimestamp(r)+" – "+this._formatTimestamp(s),Note:""};return this.addItemsToCollection(i,[l]),!0},addAudioClipToCollection:function(t,e,i){let o=this._getRemote(),n=t||o.LastUsedCollectionGUID;if(!n)return!1;let r=null;if("audio-explorer"===o.ActiveMode){let t=this.pict.views["RetoldRemote-AudioExplorer"];t&&t._currentPath&&(r=t._currentPath)}if(r||(r=o.CurrentViewerFile),!r)return!1;let s=r.replace(/^.*\//,""),a={Type:"audio-clip",Path:r,AudioStart:e,AudioEnd:i,Label:s+": "+this._formatTimestamp(e)+" – "+this._formatTimestamp(i),Note:""};return this.addItemsToCollection(n,[a]),!0},_formatTimestamp:function(t){if("number"!=typeof t||isNaN(t))return"0:00";let e=Math.floor(t),i=Math.floor(e/3600),o=Math.floor(e%3600/60),n=e%60;return i>0?i+":"+(o<10?"0":"")+o+":"+(n<10?"0":"")+n:o+":"+(n<10?"0":"")+n},addCurrentFolderToCollection:function(t,e){this._getRemote();let i=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!i||!t)return;let o={Type:"contents"===e?"folder-contents":"folder",Path:i,Label:"",Note:""};this.addItemsToCollection(t,[o])},showFolderChoicePrompt:function(t){let e=this;this.closeFolderChoicePrompt();let i=document.getElementById("RetoldRemote-TopBar-AddToCollectionBtn")||document.getElementById("RetoldRemote-TopBar-FavoritesBtn"),o=document.createElement("div");o.className="retold-remote-addcoll-dropdown",o.id="RetoldRemote-FolderChoice-Dropdown";let n=document.createElement("div");n.className="retold-remote-addcoll-dropdown-item",n.style.fontWeight="600",n.style.cursor="default",n.style.color="var(--retold-text-muted)",n.style.fontSize="0.75rem",n.textContent="This is a folder:",o.appendChild(n);let r=document.createElement("button");r.className="retold-remote-addcoll-dropdown-item",r.textContent="📁 Add Folder",r.onclick=function(){e.closeFolderChoicePrompt(),t("folder")},o.appendChild(r);let s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item",s.textContent="📂 Add Folder Contents",s.onclick=function(){e.closeFolderChoicePrompt(),t("contents")},o.appendChild(s),i?(i.style.position="relative",i.appendChild(o)):(o.style.position="fixed",o.style.top="50px",o.style.right="20px",document.body.appendChild(o)),setTimeout(function(){e._boundCloseFolderChoice=function(t){o.contains(t.target)||t.target===i||e.closeFolderChoicePrompt()},document.addEventListener("click",e._boundCloseFolderChoice),e._boundCloseFolderChoiceKey=function(t){"Escape"===t.key&&e.closeFolderChoicePrompt()},document.addEventListener("keydown",e._boundCloseFolderChoiceKey)},10)},closeFolderChoicePrompt:function(){let t=document.getElementById("RetoldRemote-FolderChoice-Dropdown");t&&t.remove(),this._boundCloseFolderChoice&&(document.removeEventListener("click",this._boundCloseFolderChoice),this._boundCloseFolderChoice=null),this._boundCloseFolderChoiceKey&&(document.removeEventListener("keydown",this._boundCloseFolderChoiceKey),this._boundCloseFolderChoiceKey=null)}}},{}],
|
|
101
|
+
e.exports={addCurrentFileToCollection:function(t){let e=this._getRemote(),i=t||e.LastUsedCollectionGUID;if(!i)return!1;if("video-explorer"===e.ActiveMode)return this.addVideoFrameToCollection(i);if("audio-explorer"===e.ActiveMode)return this.addAudioSnippetToCollection(i);let o=this._resolveCurrentItem();if(!o||!o.Path)return!1;let n=o.Path;if("folder"===o.Type||"archive"===o.Type){let t=this;return this.showFolderChoicePrompt(e=>{let o={Type:"contents"===e?"folder-contents":"folder",Path:n,Label:"",Note:""};t.addItemsToCollection(i,[o])}),!0}let r={Type:"file",Path:n,Label:"",Note:""},s=n.match(/^(.*?\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz))\/(.*)/i);if(s&&(r.Type="subfile",r.ArchivePath=s[1]),"viewer"===e.ActiveMode&&"video"===e.CurrentViewerMediaType&&!e.VideoMenuActive){let t=document.getElementById("RetoldRemote-VideoPlayer");t&&!isNaN(t.currentTime)&&t.currentTime>0&&(r.Type="video-frame",r.FrameTimestamp=Math.round(100*t.currentTime)/100)}let a=this.pict.providers["RetoldRemote-Provider"];if(a){let t=a.getHashForPath(n);t&&(r.Hash=t)}return this.addItemsToCollection(i,[r]),!0},addVideoFrameToCollection:function(t){let e=this._getRemote(),i=t||e.LastUsedCollectionGUID;if(!i)return!1;let o=this.pict.views["RetoldRemote-VideoExplorer"];if(!o||!o._currentPath||!o._frameData)return!1;let n=o._selectedFrameIndex;n<0&&(n=0);let r=o._frameData.Frames[n];if(!r)return!1;let s=o._currentPath.replace(/^.*\//,""),a=r.TimestampFormatted||this._formatTimestamp(r.Timestamp),l={Type:"video-frame",Path:o._currentPath,FrameTimestamp:r.Timestamp,FrameCacheKey:o._frameData.CacheKey||null,FrameFilename:r.Filename||null,Label:s+" @ "+a,Note:""};return this.addItemsToCollection(i,[l]),!0},addVideoClipToCollection:function(t,e,i){let o=this._getRemote(),n=t||o.LastUsedCollectionGUID;if(!n)return!1;let r=null;if("video-explorer"===o.ActiveMode){let t=this.pict.views["RetoldRemote-VideoExplorer"];t&&t._currentPath&&(r=t._currentPath)}if(r||(r=o.CurrentViewerFile),!r)return!1;let s=r.replace(/^.*\//,""),a={Type:"video-clip",Path:r,VideoStart:e,VideoEnd:i,Label:s+": "+this._formatTimestamp(e)+" – "+this._formatTimestamp(i),Note:""};return this.addItemsToCollection(n,[a]),!0},addAudioSnippetToCollection:function(t){let e=this._getRemote(),i=t||e.LastUsedCollectionGUID;if(!i)return!1;let o=this.pict.views["RetoldRemote-AudioExplorer"];if(!o||!o._currentPath||!o._waveformData)return!1;let n=o._waveformData.Duration||0;if(n<=0)return!1;let r=0,s=n;o._selectionStart>=0&&o._selectionEnd>=0&&(r=Math.round(o._selectionStart*n*100)/100,s=Math.round(o._selectionEnd*n*100)/100);let a=o._currentPath.replace(/^.*\//,""),l={Type:"audio-clip",Path:o._currentPath,AudioStart:r,AudioEnd:s,Label:a+": "+this._formatTimestamp(r)+" – "+this._formatTimestamp(s),Note:""};return this.addItemsToCollection(i,[l]),!0},addAudioClipToCollection:function(t,e,i){let o=this._getRemote(),n=t||o.LastUsedCollectionGUID;if(!n)return!1;let r=null;if("audio-explorer"===o.ActiveMode){let t=this.pict.views["RetoldRemote-AudioExplorer"];t&&t._currentPath&&(r=t._currentPath)}if(r||(r=o.CurrentViewerFile),!r)return!1;let s=r.replace(/^.*\//,""),a={Type:"audio-clip",Path:r,AudioStart:e,AudioEnd:i,Label:s+": "+this._formatTimestamp(e)+" – "+this._formatTimestamp(i),Note:""};return this.addItemsToCollection(n,[a]),!0},_formatTimestamp:function(t){if("number"!=typeof t||isNaN(t))return"0:00";let e=Math.floor(t),i=Math.floor(e/3600),o=Math.floor(e%3600/60),n=e%60;return i>0?i+":"+(o<10?"0":"")+o+":"+(n<10?"0":"")+n:o+":"+(n<10?"0":"")+n},addCurrentFolderToCollection:function(t,e){this._getRemote();let i=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!i||!t)return;let o={Type:"contents"===e?"folder-contents":"folder",Path:i,Label:"",Note:""};this.addItemsToCollection(t,[o])},showFolderChoicePrompt:function(t){let e=this;this.closeFolderChoicePrompt();let i=document.getElementById("RetoldRemote-TopBar-AddToCollectionBtn")||document.getElementById("RetoldRemote-TopBar-FavoritesBtn"),o=document.createElement("div");o.className="retold-remote-addcoll-dropdown",o.id="RetoldRemote-FolderChoice-Dropdown";let n=document.createElement("div");n.className="retold-remote-addcoll-dropdown-item",n.style.fontWeight="600",n.style.cursor="default",n.style.color="var(--retold-text-muted)",n.style.fontSize="0.75rem",n.textContent="This is a folder:",o.appendChild(n);let r=document.createElement("button");r.className="retold-remote-addcoll-dropdown-item",r.textContent="📁 Add Folder",r.onclick=function(){e.closeFolderChoicePrompt(),t("folder")},o.appendChild(r);let s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item",s.textContent="📂 Add Folder Contents",s.onclick=function(){e.closeFolderChoicePrompt(),t("contents")},o.appendChild(s),i?(i.style.position="relative",i.appendChild(o)):(o.style.position="fixed",o.style.top="50px",o.style.right="20px",document.body.appendChild(o)),setTimeout(function(){e._boundCloseFolderChoice=function(t){o.contains(t.target)||t.target===i||e.closeFolderChoicePrompt()},document.addEventListener("click",e._boundCloseFolderChoice),e._boundCloseFolderChoiceKey=function(t){"Escape"===t.key&&e.closeFolderChoicePrompt()},document.addEventListener("keydown",e._boundCloseFolderChoiceKey)},10)},closeFolderChoicePrompt:function(){let t=document.getElementById("RetoldRemote-FolderChoice-Dropdown");t&&t.remove(),this._boundCloseFolderChoice&&(document.removeEventListener("click",this._boundCloseFolderChoice),this._boundCloseFolderChoice=null),this._boundCloseFolderChoiceKey&&(document.removeEventListener("keydown",this._boundCloseFolderChoiceKey),this._boundCloseFolderChoiceKey=null)}}},{}],119:[function(t,e,i){
|
|
102
102
|
/**
|
|
103
103
|
* CollectionManager — Favorites Mixin
|
|
104
104
|
*
|
|
@@ -110,7 +110,7 @@ e.exports={addCurrentFileToCollection:function(t){let e=this._getRemote(),i=t||e
|
|
|
110
110
|
*
|
|
111
111
|
* @license MIT
|
|
112
112
|
*/
|
|
113
|
-
e.exports={ensureFavoritesCollection:function(t){let e=this,i="function"==typeof t?t:()=>{},o=this._getRemote();if(o.FavoritesGUID)return this._loadFavoritesCollection(o.FavoritesGUID,i);let n=o.Collections||[];for(let t=0;t<n.length;t++)if("favorites"===n[t].CollectionType)return o.FavoritesGUID=n[t].GUID,this.pict.PictApplication.saveSettings(),this._loadFavoritesCollection(n[t].GUID,i);let r="favorites-default";fetch("/api/collections/"+encodeURIComponent(r),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Name:"Favorites",CollectionType:"favorites",Icon:"heart"})}).then(t=>t.json()).then(t=>{o.FavoritesGUID=r,e.pict.PictApplication.saveSettings(),e._loadFavoritesCollection(r,i)}).catch(t=>(e.log.error("Failed to create favorites collection: "+t.message),i(t)))},_loadFavoritesCollection:function(t,e){let i=this,o="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)).then(t=>{if(!t.ok)throw new Error("Favorites collection not found");return t.json()}).then(t=>{i._getRemote().FavoritesCollection=t,i._rebuildFavoritesPathSet(t);let e=i.pict.views["ContentEditor-TopBar"];return e&&"function"==typeof e.updateFavoritesIcon&&e.updateFavoritesIcon(),i._renderFavoritesPane(),o(null)}).catch(t=>(i.log.error("Failed to load favorites collection: "+t.message),o(t)))},_rebuildFavoritesPathSet:function(t){let e=this._getRemote();if(e.FavoritesPathSet={},t&&Array.isArray(t.Items))for(let i=0;i<t.Items.length;i++){let o=t.Items[i];o.Path&&(e.FavoritesPathSet[o.Path]=o.ID)}},isFavorited:function(t){let e=this._getRemote(),i=t||this._resolveCurrentFilePath();return!!e.FavoritesPathSet[i]},toggleFavorite:function(t){let e=this,i=this._getRemote(),o=t||this._resolveCurrentFilePath();if(o&&i.FavoritesGUID)if(this.isFavorited(o)){let t=i.FavoritesPathSet[o];this.removeItemFromCollection(i.FavoritesGUID,t,(t,o)=>{!t&&o&&(i.FavoritesCollection=o,e._rebuildFavoritesPathSet(o));let n=e.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateFavoritesIcon&&n.updateFavoritesIcon(),e._renderFavoritesPane();let r=e._getToast();r&&r.showToast("Removed from favorites")})}else{let t=this._resolveCurrentItem();if(t&&("folder"===t.Type||"archive"===t.Type))return void this.showFolderChoicePrompt(t=>{let n={Type:"contents"===t?"folder-contents":"folder",Path:o,Label:"",Note:""};e.addItemsToCollection(i.FavoritesGUID,[n],(t,o)=>{!t&&o&&(i.FavoritesCollection=o,e._rebuildFavoritesPathSet(o));let n=e.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateFavoritesIcon&&n.updateFavoritesIcon(),e._renderFavoritesPane();let r=e._getToast();r&&r.showToast("Added to favorites")})});let n={Type:"file",Path:o,Label:"",Note:""},r=o.match(/^(.*?\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz))\/(.*)/i);r&&(n.Type="subfile",n.ArchivePath=r[1]);let s=this.pict.providers["RetoldRemote-Provider"];if(s){let t=s.getHashForPath(o);t&&(n.Hash=t)}this.addItemsToCollection(i.FavoritesGUID,[n],(t,o)=>{!t&&o&&(i.FavoritesCollection=o,e._rebuildFavoritesPathSet(o));let n=e.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateFavoritesIcon&&n.updateFavoritesIcon(),e._renderFavoritesPane();let r=e._getToast();r&&r.showToast("Added to favorites")})}},_renderFavoritesPane:function(){let t=this.pict.views["ContentEditor-Layout"];t&&"function"==typeof t.renderFavoritesList&&t.renderFavoritesList()}}},{}],
|
|
113
|
+
e.exports={ensureFavoritesCollection:function(t){let e=this,i="function"==typeof t?t:()=>{},o=this._getRemote();if(o.FavoritesGUID)return this._loadFavoritesCollection(o.FavoritesGUID,i);let n=o.Collections||[];for(let t=0;t<n.length;t++)if("favorites"===n[t].CollectionType)return o.FavoritesGUID=n[t].GUID,this.pict.PictApplication.saveSettings(),this._loadFavoritesCollection(n[t].GUID,i);let r="favorites-default";fetch("/api/collections/"+encodeURIComponent(r),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Name:"Favorites",CollectionType:"favorites",Icon:"heart"})}).then(t=>t.json()).then(t=>{o.FavoritesGUID=r,e.pict.PictApplication.saveSettings(),e._loadFavoritesCollection(r,i)}).catch(t=>(e.log.error("Failed to create favorites collection: "+t.message),i(t)))},_loadFavoritesCollection:function(t,e){let i=this,o="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)).then(t=>{if(!t.ok)throw new Error("Favorites collection not found");return t.json()}).then(t=>{i._getRemote().FavoritesCollection=t,i._rebuildFavoritesPathSet(t);let e=i.pict.views["ContentEditor-TopBar"];return e&&"function"==typeof e.updateFavoritesIcon&&e.updateFavoritesIcon(),i._renderFavoritesPane(),o(null)}).catch(t=>(i.log.error("Failed to load favorites collection: "+t.message),o(t)))},_rebuildFavoritesPathSet:function(t){let e=this._getRemote();if(e.FavoritesPathSet={},t&&Array.isArray(t.Items))for(let i=0;i<t.Items.length;i++){let o=t.Items[i];o.Path&&(e.FavoritesPathSet[o.Path]=o.ID)}},isFavorited:function(t){let e=this._getRemote(),i=t||this._resolveCurrentFilePath();return!!e.FavoritesPathSet[i]},toggleFavorite:function(t){let e=this,i=this._getRemote(),o=t||this._resolveCurrentFilePath();if(o&&i.FavoritesGUID)if(this.isFavorited(o)){let t=i.FavoritesPathSet[o];this.removeItemFromCollection(i.FavoritesGUID,t,(t,o)=>{!t&&o&&(i.FavoritesCollection=o,e._rebuildFavoritesPathSet(o));let n=e.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateFavoritesIcon&&n.updateFavoritesIcon(),e._renderFavoritesPane();let r=e._getToast();r&&r.showToast("Removed from favorites")})}else{let t=this._resolveCurrentItem();if(t&&("folder"===t.Type||"archive"===t.Type))return void this.showFolderChoicePrompt(t=>{let n={Type:"contents"===t?"folder-contents":"folder",Path:o,Label:"",Note:""};e.addItemsToCollection(i.FavoritesGUID,[n],(t,o)=>{!t&&o&&(i.FavoritesCollection=o,e._rebuildFavoritesPathSet(o));let n=e.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateFavoritesIcon&&n.updateFavoritesIcon(),e._renderFavoritesPane();let r=e._getToast();r&&r.showToast("Added to favorites")})});let n={Type:"file",Path:o,Label:"",Note:""},r=o.match(/^(.*?\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz))\/(.*)/i);r&&(n.Type="subfile",n.ArchivePath=r[1]);let s=this.pict.providers["RetoldRemote-Provider"];if(s){let t=s.getHashForPath(o);t&&(n.Hash=t)}this.addItemsToCollection(i.FavoritesGUID,[n],(t,o)=>{!t&&o&&(i.FavoritesCollection=o,e._rebuildFavoritesPathSet(o));let n=e.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateFavoritesIcon&&n.updateFavoritesIcon(),e._renderFavoritesPane();let r=e._getToast();r&&r.showToast("Added to favorites")})}},_renderFavoritesPane:function(){let t=this.pict.views["ContentEditor-Layout"];t&&"function"==typeof t.renderFavoritesList&&t.renderFavoritesList()}}},{}],120:[function(t,e,i){
|
|
114
114
|
/**
|
|
115
115
|
* CollectionManager — Operation Plan Mixin
|
|
116
116
|
*
|
|
@@ -123,7 +123,7 @@ e.exports={ensureFavoritesCollection:function(t){let e=this,i="function"==typeof
|
|
|
123
123
|
*
|
|
124
124
|
* @license MIT
|
|
125
125
|
*/
|
|
126
|
-
e.exports={createOperationPlan:function(t,e,i){let o=this,n="function"==typeof i?i:()=>{},r=this.fable.getUUID(),s={Name:t||"Sort Plan",CollectionType:"operation-plan",Items:e||[]};fetch("/api/collections/"+encodeURIComponent(r),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(t=>t.json()).then(e=>{let i=o._getRemote();if(i.ActiveCollectionGUID=r,i.ActiveCollection=e,i.CollectionsPanelMode="detail",i.CollectionsPanelOpen){let t=o._getPanelView();t&&t.renderContent()}else o.togglePanel();o.fetchCollections();let s=o._getToast();return s&&s.showToast("Sort plan created: "+(e.Name||t)),n(null,e)}).catch(t=>(o.log.error("Failed to create operation plan: "+t.message),n(t)))},executeCollectionOperations:function(t,e){let i=this,o="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}).then(t=>t.json()).then(e=>{let n=i._getRemote();e.Collection&&n.ActiveCollectionGUID===t&&(n.ActiveCollection=e.Collection);let r=i._getPanelView();r&&r.renderContent();let s=i._getToast();return s&&(e.TotalFailed>0?s.showToast("Moved "+e.TotalMoved+" files ("+e.TotalFailed+" failed)"):s.showToast("Successfully moved "+e.TotalMoved+" files")),o(null,e)}).catch(t=>{i.log.error("Failed to execute operations: "+t.message);let e=i._getToast();return e&&e.showToast("Failed to execute operations: "+t.message),o(t)})},undoCollectionOperations:function(t,e){let i=this,o="function"==typeof e?e:()=>{},n=this._getRemote().ActiveCollection;if(!n||!n.OperationBatchGUID){let t=i._getToast();return t&&t.showToast("No batch to undo"),o(new Error("No batch to undo"))}fetch("/api/files/undo-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({BatchGUID:n.OperationBatchGUID})}).then(t=>t.json()).then(t=>{if(n.Items)for(let t=0;t<n.Items.length;t++)"completed"===n.Items[t].OperationStatus&&(n.Items[t].OperationStatus="pending");n.OperationBatchGUID=null,i.updateCollection(n);let e=i._getPanelView();e&&e.renderContent();let r=i._getToast();return r&&r.showToast("Undo complete: "+t.TotalReversed+" files restored"),o(null,t)}).catch(t=>{i.log.error("Failed to undo operations: "+t.message);let e=i._getToast();return e&&e.showToast("Failed to undo: "+t.message),o(t)})},setItemDestination:function(t,e){let i=this._getRemote().ActiveCollection;if(i&&i.Items){for(let o=0;o<i.Items.length;o++)if(i.Items[o].ID===t){i.Items[o].DestinationPath=e;break}this.updateCollection(i)}},skipItemOperation:function(t){let e=this._getRemote().ActiveCollection;if(!e||!e.Items)return;for(let i=0;i<e.Items.length;i++)if(e.Items[i].ID===t){e.Items[i].OperationStatus="skipped";break}let i=this._getPanelView();i&&i.renderContent(),this.updateCollection(e)}}},{}],
|
|
126
|
+
e.exports={createOperationPlan:function(t,e,i){let o=this,n="function"==typeof i?i:()=>{},r=this.fable.getUUID(),s={Name:t||"Sort Plan",CollectionType:"operation-plan",Items:e||[]};fetch("/api/collections/"+encodeURIComponent(r),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(t=>t.json()).then(e=>{let i=o._getRemote();if(i.ActiveCollectionGUID=r,i.ActiveCollection=e,i.CollectionsPanelMode="detail",i.CollectionsPanelOpen){let t=o._getPanelView();t&&t.renderContent()}else o.togglePanel();o.fetchCollections();let s=o._getToast();return s&&s.showToast("Sort plan created: "+(e.Name||t)),n(null,e)}).catch(t=>(o.log.error("Failed to create operation plan: "+t.message),n(t)))},executeCollectionOperations:function(t,e){let i=this,o="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}).then(t=>t.json()).then(e=>{let n=i._getRemote();e.Collection&&n.ActiveCollectionGUID===t&&(n.ActiveCollection=e.Collection);let r=i._getPanelView();r&&r.renderContent();let s=i._getToast();return s&&(e.TotalFailed>0?s.showToast("Moved "+e.TotalMoved+" files ("+e.TotalFailed+" failed)"):s.showToast("Successfully moved "+e.TotalMoved+" files")),o(null,e)}).catch(t=>{i.log.error("Failed to execute operations: "+t.message);let e=i._getToast();return e&&e.showToast("Failed to execute operations: "+t.message),o(t)})},undoCollectionOperations:function(t,e){let i=this,o="function"==typeof e?e:()=>{},n=this._getRemote().ActiveCollection;if(!n||!n.OperationBatchGUID){let t=i._getToast();return t&&t.showToast("No batch to undo"),o(new Error("No batch to undo"))}fetch("/api/files/undo-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({BatchGUID:n.OperationBatchGUID})}).then(t=>t.json()).then(t=>{if(n.Items)for(let t=0;t<n.Items.length;t++)"completed"===n.Items[t].OperationStatus&&(n.Items[t].OperationStatus="pending");n.OperationBatchGUID=null,i.updateCollection(n);let e=i._getPanelView();e&&e.renderContent();let r=i._getToast();return r&&r.showToast("Undo complete: "+t.TotalReversed+" files restored"),o(null,t)}).catch(t=>{i.log.error("Failed to undo operations: "+t.message);let e=i._getToast();return e&&e.showToast("Failed to undo: "+t.message),o(t)})},setItemDestination:function(t,e){let i=this._getRemote().ActiveCollection;if(i&&i.Items){for(let o=0;o<i.Items.length;o++)if(i.Items[o].ID===t){i.Items[o].DestinationPath=e;break}this.updateCollection(i)}},skipItemOperation:function(t){let e=this._getRemote().ActiveCollection;if(!e||!e.Items)return;for(let i=0;i<e.Items.length;i++)if(e.Items[i].ID===t){e.Items[i].OperationStatus="skipped";break}let i=this._getPanelView();i&&i.renderContent(),this.updateCollection(e)}}},{}],121:[function(t,e,i){
|
|
127
127
|
/**
|
|
128
128
|
* Retold Remote -- AI Sort Manager Provider
|
|
129
129
|
*
|
|
@@ -140,7 +140,7 @@ e.exports={createOperationPlan:function(t,e,i){let o=this,n="function"==typeof i
|
|
|
140
140
|
*
|
|
141
141
|
* @license MIT
|
|
142
142
|
*/
|
|
143
|
-
const o=t("pict-provider");class n extends o{constructor(t,e,i){super(t,e,i),this._generating=!1,this._scanning=!1,this._testingConnection=!1}_getRemote(){return this.pict.AppData.RetoldRemote}_getSettings(){let t=this._getRemote();return t.AISortSettings||(t.AISortSettings={AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"}),t.AISortSettings}_getToast(){return this.pict.providers["RetoldRemote-ToastNotification"]}_getCollectionManager(){return this.pict.providers["RetoldRemote-CollectionManager"]}updateSettings(t){let e=this._getSettings();void 0!==t.AIEndpoint&&(e.AIEndpoint=t.AIEndpoint),void 0!==t.AIModel&&(e.AIModel=t.AIModel),void 0!==t.AIProvider&&(e.AIProvider=t.AIProvider),void 0!==t.NamingTemplate&&(e.NamingTemplate=t.NamingTemplate),this.pict.PictApplication.saveSettings()}testConnection(t){let e=this,i="function"==typeof t?t:()=>{};if(this._testingConnection)return i(new Error("Connection test already in progress"));this._testingConnection=!0;let o=this._getSettings(),n=this._getToast();fetch("/api/ai-sort/test-connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({AIEndpoint:o.AIEndpoint,AIModel:o.AIModel,AIProvider:o.AIProvider})}).then(t=>t.json()).then(t=>(e._testingConnection=!1,t.Success?n&&n.show("AI connected ("+t.ResponseTime+"ms)"):n&&n.show("AI connection failed: "+(t.Error||"Unknown error")),e._updateTestButtonState(t.Success),i(null,t))).catch(t=>(e._testingConnection=!1,n&&n.show("AI connection error: "+t.message),e._updateTestButtonState(!1),i(t)))}scanFolder(t,e,i){let o=this,n="function"==typeof i?i:()=>{};if(this._scanning)return n(new Error("Scan already in progress"));this._scanning=!0,fetch("/api/ai-sort/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:t||"",Recursive:e||!1})}).then(t=>t.json()).then(t=>{o._scanning=!1;let e=o._getToast();return e&&(t.Success?e.show("Scanned "+t.FileCount+" audio files"):e.show("Scan failed: "+(t.Error||"Unknown error"))),n(null,t)}).catch(t=>{o._scanning=!1;let e=o._getToast();return e&&e.show("Scan error: "+t.message),n(t)})}generateSortPlan(t,e){let i=this,o="function"==typeof e?e:()=>{};if(this._generating){let t=this._getToast();return t&&t.show("Sort plan generation already in progress..."),o(new Error("Generation already in progress"))}this._generating=!0;let n=this._getSettings(),r=this._getToast();r&&r.show("Generating sort plan..."),fetch("/api/ai-sort/generate-plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:t||"",NamingTemplate:n.NamingTemplate,Recursive:!0,AIEndpoint:n.AIEndpoint,AIModel:n.AIModel,AIProvider:n.AIProvider})}).then(t=>t.json()).then(t=>{if(i._generating=!1,!t.Success)return r&&r.show("Sort plan failed: "+(t.Error||t.Message||"Unknown error")),o(new Error(t.Error||t.Message));if(!t.CollectionGUID)return r&&r.show(t.Message||"No audio files found"),o(null,t);let e=i._getCollectionManager();if(e){let o=i._getRemote();o.CollectionsPanelMode="detail",o.CollectionsPanelOpen||e.togglePanel(),e.fetchCollection(t.CollectionGUID),e.fetchCollections()}if(r){let e="Sort plan created: "+t.TotalFiles+" files";t.TaggedFiles>0&&(e+=" ("+t.TaggedFiles+" by tags",t.AIFiles>0&&(e+=", "+t.AIFiles+" by AI"),e+=")"),r.show(e)}return o(null,t)}).catch(t=>(i._generating=!1,r&&r.show("Sort plan error: "+t.message),o(t)))}_updateTestButtonState(t){let e=document.getElementById("RetoldRemote-AISortTestBtn");e&&(e.disabled=!1,!0===t?(e.style.borderColor="var(--retold-accent)",e.style.color="var(--retold-accent)",e.textContent="Connected",setTimeout(()=>{e.textContent="Test Connection",e.style.borderColor="",e.style.color=""},3e3)):!1===t&&(e.style.borderColor="var(--retold-danger-muted)",e.style.color="var(--retold-danger-muted)",e.textContent="Failed",setTimeout(()=>{e.textContent="Test Connection",e.style.borderColor="",e.style.color=""},3e3)))}getTemplatePreview(t){return(t||"{artist}/{album}/{track} - {title}").replace(/\{artist\}/gi,"Pink Floyd").replace(/\{album\}/gi,"Dark Side of the Moon").replace(/\{title\}/gi,"Time").replace(/\{track\}/gi,"04").replace(/\{year\}/gi,"1973").replace(/\{genre\}/gi,"Progressive Rock")+".mp3"}isAvailable(){return"gallery"===this._getRemote().ActiveMode}isGenerating(){return this._generating}}n.default_configuration={ProviderIdentifier:"RetoldRemote-AISortManager",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=n},{"pict-provider":
|
|
143
|
+
const o=t("pict-provider");class n extends o{constructor(t,e,i){super(t,e,i),this._generating=!1,this._scanning=!1,this._testingConnection=!1}_getRemote(){return this.pict.AppData.RetoldRemote}_getSettings(){let t=this._getRemote();return t.AISortSettings||(t.AISortSettings={AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"}),t.AISortSettings}_getToast(){return this.pict.providers["RetoldRemote-ToastNotification"]}_getCollectionManager(){return this.pict.providers["RetoldRemote-CollectionManager"]}updateSettings(t){let e=this._getSettings();void 0!==t.AIEndpoint&&(e.AIEndpoint=t.AIEndpoint),void 0!==t.AIModel&&(e.AIModel=t.AIModel),void 0!==t.AIProvider&&(e.AIProvider=t.AIProvider),void 0!==t.NamingTemplate&&(e.NamingTemplate=t.NamingTemplate),this.pict.PictApplication.saveSettings()}testConnection(t){let e=this,i="function"==typeof t?t:()=>{};if(this._testingConnection)return i(new Error("Connection test already in progress"));this._testingConnection=!0;let o=this._getSettings(),n=this._getToast();fetch("/api/ai-sort/test-connection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({AIEndpoint:o.AIEndpoint,AIModel:o.AIModel,AIProvider:o.AIProvider})}).then(t=>t.json()).then(t=>(e._testingConnection=!1,t.Success?n&&n.show("AI connected ("+t.ResponseTime+"ms)"):n&&n.show("AI connection failed: "+(t.Error||"Unknown error")),e._updateTestButtonState(t.Success),i(null,t))).catch(t=>(e._testingConnection=!1,n&&n.show("AI connection error: "+t.message),e._updateTestButtonState(!1),i(t)))}scanFolder(t,e,i){let o=this,n="function"==typeof i?i:()=>{};if(this._scanning)return n(new Error("Scan already in progress"));this._scanning=!0,fetch("/api/ai-sort/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:t||"",Recursive:e||!1})}).then(t=>t.json()).then(t=>{o._scanning=!1;let e=o._getToast();return e&&(t.Success?e.show("Scanned "+t.FileCount+" audio files"):e.show("Scan failed: "+(t.Error||"Unknown error"))),n(null,t)}).catch(t=>{o._scanning=!1;let e=o._getToast();return e&&e.show("Scan error: "+t.message),n(t)})}generateSortPlan(t,e){let i=this,o="function"==typeof e?e:()=>{};if(this._generating){let t=this._getToast();return t&&t.show("Sort plan generation already in progress..."),o(new Error("Generation already in progress"))}this._generating=!0;let n=this._getSettings(),r=this._getToast();r&&r.show("Generating sort plan..."),fetch("/api/ai-sort/generate-plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:t||"",NamingTemplate:n.NamingTemplate,Recursive:!0,AIEndpoint:n.AIEndpoint,AIModel:n.AIModel,AIProvider:n.AIProvider})}).then(t=>t.json()).then(t=>{if(i._generating=!1,!t.Success)return r&&r.show("Sort plan failed: "+(t.Error||t.Message||"Unknown error")),o(new Error(t.Error||t.Message));if(!t.CollectionGUID)return r&&r.show(t.Message||"No audio files found"),o(null,t);let e=i._getCollectionManager();if(e){let o=i._getRemote();o.CollectionsPanelMode="detail",o.CollectionsPanelOpen||e.togglePanel(),e.fetchCollection(t.CollectionGUID),e.fetchCollections()}if(r){let e="Sort plan created: "+t.TotalFiles+" files";t.TaggedFiles>0&&(e+=" ("+t.TaggedFiles+" by tags",t.AIFiles>0&&(e+=", "+t.AIFiles+" by AI"),e+=")"),r.show(e)}return o(null,t)}).catch(t=>(i._generating=!1,r&&r.show("Sort plan error: "+t.message),o(t)))}_updateTestButtonState(t){let e=document.getElementById("RetoldRemote-AISortTestBtn");e&&(e.disabled=!1,!0===t?(e.style.borderColor="var(--retold-accent)",e.style.color="var(--retold-accent)",e.textContent="Connected",setTimeout(()=>{e.textContent="Test Connection",e.style.borderColor="",e.style.color=""},3e3)):!1===t&&(e.style.borderColor="var(--retold-danger-muted)",e.style.color="var(--retold-danger-muted)",e.textContent="Failed",setTimeout(()=>{e.textContent="Test Connection",e.style.borderColor="",e.style.color=""},3e3)))}getTemplatePreview(t){return(t||"{artist}/{album}/{track} - {title}").replace(/\{artist\}/gi,"Pink Floyd").replace(/\{album\}/gi,"Dark Side of the Moon").replace(/\{title\}/gi,"Time").replace(/\{track\}/gi,"04").replace(/\{year\}/gi,"1973").replace(/\{genre\}/gi,"Progressive Rock")+".mp3"}isAvailable(){return"gallery"===this._getRemote().ActiveMode}isGenerating(){return this._generating}}n.default_configuration={ProviderIdentifier:"RetoldRemote-AISortManager",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=n},{"pict-provider":55}],122:[function(t,e,i){
|
|
144
144
|
/**
|
|
145
145
|
* Retold Remote -- Collection Manager Provider
|
|
146
146
|
*
|
|
@@ -161,7 +161,7 @@ const o=t("pict-provider");class n extends o{constructor(t,e,i){super(t,e,i),thi
|
|
|
161
161
|
*
|
|
162
162
|
* @license MIT
|
|
163
163
|
*/
|
|
164
|
-
const o=t("pict-provider"),n=t("./CollectionManager-Favorites"),r=t("./CollectionManager-AddItems"),s=t("./CollectionManager-OperationPlan");class a extends o{constructor(t,e,i){super(t,e,i)}_getRemote(){return this.pict.AppData.RetoldRemote}_getPanelView(){return this.pict.views["RetoldRemote-CollectionsPanel"]}_getToast(){return this.pict.providers["RetoldRemote-ToastNotification"]}setPendingClipContext(t){this._pendingClipContext=t||null}clearPendingClipContext(){this._pendingClipContext=null}addPendingOrCurrentToCollection(t){if(this._pendingClipContext){let e=this._pendingClipContext;if(this._pendingClipContext=null,"video-clip"===e.Type)return this.addVideoClipToCollection(t,e.Start,e.End);if("audio-clip"===e.Type)return this.addAudioClipToCollection(t,e.Start,e.End)}return this.addCurrentFileToCollection(t)}getQuickAddTargetGUID(){let t=this._getRemote();return t.ActiveCollectionGUID&&"detail"===t.CollectionsPanelMode?t.ActiveCollectionGUID:t.LastUsedCollectionGUID||null}fetchCollections(t){let e=this,i="function"==typeof t?t:()=>{};fetch("/api/collections").then(t=>t.json()).then(t=>{let o=e._getRemote();o.Collections=Array.isArray(t)?t:[];let n=e._getPanelView();return n&&o.CollectionsPanelOpen&&n.renderContent(),i(null,o.Collections)}).catch(t=>(e.log.error("Failed to fetch collections: "+t.message),i(t)))}fetchCollection(t,e){let i=this,o="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)).then(t=>{if(!t.ok)throw new Error("Collection not found");return t.json()}).then(e=>{let n=i._getRemote();n.ActiveCollectionGUID=t,n.ActiveCollection=e;let r=i._getPanelView();return r&&r.renderContent(),o(null,e)}).catch(t=>(i.log.error("Failed to fetch collection: "+t.message),o(t)))}createCollection(t,e){let i=this,o="function"==typeof e?e:()=>{},n=this.fable.getUUID();fetch("/api/collections/"+encodeURIComponent(n),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Name:t||"Untitled Collection"})}).then(t=>t.json()).then(e=>{i._getRemote().LastUsedCollectionGUID=n,i.fetchCollections();let r=i._getToast();return r&&r.showToast("Collection created: "+(e.Name||t)),o(null,e)}).catch(t=>(i.log.error("Failed to create collection: "+t.message),o(t)))}updateCollection(t,e){let i=this,o="function"==typeof e?e:()=>{};if(!t||!t.GUID)return o(new Error("Collection must have a GUID"));fetch("/api/collections/"+encodeURIComponent(t.GUID),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>t.json()).then(e=>{let n=i._getRemote();return n.ActiveCollectionGUID===t.GUID&&(n.ActiveCollection=e),i.fetchCollections(),o(null,e)}).catch(t=>(i.log.error("Failed to update collection: "+t.message),o(t)))}deleteCollection(t,e){let i=this,o="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t),{method:"DELETE"}).then(t=>t.json()).then(()=>{let e=i._getRemote();e.ActiveCollectionGUID===t&&(e.ActiveCollectionGUID=null,e.ActiveCollection=null,e.CollectionsPanelMode="list"),e.LastUsedCollectionGUID===t&&(e.LastUsedCollectionGUID=null),i.fetchCollections();let n=i._getToast();return n&&n.showToast("Collection deleted"),o(null)}).catch(t=>(i.log.error("Failed to delete collection: "+t.message),o(t)))}addItemsToCollection(t,e,i){let o=this,n="function"==typeof i?i:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Items:e})}).then(t=>t.json()).then(i=>{let r=o._getRemote();r.LastUsedCollectionGUID=t,r.ActiveCollectionGUID===t&&(r.ActiveCollection=i),o.fetchCollections();let s=o._getPanelView();s&&"detail"===r.CollectionsPanelMode&&r.ActiveCollectionGUID===t&&s.renderContent();let a=o._getToast();if(a){let t=i.Name||"collection";a.showToast("Added "+e.length+" item"+(e.length>1?"s":"")+" to "+t)}return n(null,i)}).catch(t=>(o.log.error("Failed to add items to collection: "+t.message),n(t)))}removeItemFromCollection(t,e,i){let o=this,n="function"==typeof i?i:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/items/"+encodeURIComponent(e),{method:"DELETE"}).then(t=>t.json()).then(e=>{let i=o._getRemote();i.ActiveCollectionGUID===t&&(i.ActiveCollection=e),o.fetchCollections();let r=o._getPanelView();return r&&"detail"===i.CollectionsPanelMode&&i.ActiveCollectionGUID===t&&r.renderContent(),n(null,e)}).catch(t=>(o.log.error("Failed to remove item from collection: "+t.message),n(t)))}reorderItems(t,e,i){let o=this,n="function"==typeof i?i:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/reorder",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({ItemOrder:e})}).then(t=>t.json()).then(e=>{let i=o._getRemote();i.ActiveCollectionGUID===t&&(i.ActiveCollection=e);let r=o._getPanelView();return r&&"detail"===i.CollectionsPanelMode&&r.renderContent(),n(null,e)}).catch(t=>(o.log.error("Failed to reorder items: "+t.message),n(t)))}copyItems(t,e,i,o){let n=this,r="function"==typeof o?o:()=>{};fetch("/api/collections/copy-items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({SourceGUID:t,TargetGUID:e,ItemIDs:i})}).then(t=>t.json()).then(t=>{n.fetchCollections();let e=n._getToast();return e&&e.showToast("Copied "+i.length+" item"+(i.length>1?"s":"")),r(null,t)}).catch(t=>(n.log.error("Failed to copy items: "+t.message),r(t)))}togglePanel(){let t=this._getRemote(),e=this.pict.views["ContentEditor-Layout"];if(e&&e.isMobileDrawer()){let i=document.querySelector(".content-editor-sidebar-tab.active");i&&"collections"===i.getAttribute("data-tab")?e.switchSidebarTab("files"):(t.SidebarCollapsed&&e.toggleSidebar(),e.switchSidebarTab("collections"));let o=this.pict.views["ContentEditor-TopBar"];return void(o&&"function"==typeof o.updateCollectionsIcon&&o.updateCollectionsIcon())}t.CollectionsPanelOpen=!t.CollectionsPanelOpen;let i=document.getElementById("RetoldRemote-Collections-Wrap");i&&(t.CollectionsPanelOpen?(i.classList.remove("collapsed"),t.CollectionsPanelWidth&&(i.style.width=t.CollectionsPanelWidth+"px"),this.fetchCollections()):i.classList.add("collapsed"));let o=this.pict.views["ContentEditor-TopBar"];o&&"function"==typeof o.updateCollectionsIcon&&o.updateCollectionsIcon(),this.pict.PictApplication.saveSettings();let n=this;setTimeout(()=>{let t=n.pict.providers["RetoldRemote-GalleryNavigation"];t&&"function"==typeof t.recalculateColumns&&t.recalculateColumns()},250)}openPanel(){this._getRemote().CollectionsPanelOpen||this.togglePanel()}closePanel(){this._getRemote().CollectionsPanelOpen&&this.togglePanel()}_resolveCurrentFilePath(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(t)return t;let e=this._getRemote();if(e.CurrentViewerFile)return e.CurrentViewerFile;let i=e.GalleryItems||[],o=e.GalleryCursorIndex||0;return i.length>0&&i[o]&&i[o].Path?i[o].Path:""}_resolveCurrentItem(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(t)return{Path:t,Type:"file"};let e=this._getRemote();if(e.CurrentViewerFile)return{Path:e.CurrentViewerFile,Type:"file"};let i=e.GalleryItems||[],o=e.GalleryCursorIndex||0;return i.length>0&&i[o]?{Path:i[o].Path||"",Type:i[o].Type||"file"}:null}_sortItems(t,e,i){if(!Array.isArray(t)||t.length<2)return t;let o="desc"===i?-1:1;switch(e){case"name":t.sort((t,e)=>{let i=(t.Label||t.Path||"").toLowerCase(),n=(e.Label||e.Path||"").toLowerCase(),r=i.lastIndexOf("/"),s=n.lastIndexOf("/");return r>=0&&(i=i.substring(r+1)),s>=0&&(n=n.substring(s+1)),o*i.localeCompare(n)});break;case"type":t.sort((t,e)=>{let i=(t.Type||"").toLowerCase(),n=(e.Type||"").toLowerCase();return o*i.localeCompare(n)});break;case"modified":t.sort((t,e)=>{let i=t.AddedAt||"",n=e.AddedAt||"";return o*i.localeCompare(n)});break;default:t.sort((t,e)=>o*((t.SortOrder||0)-(e.SortOrder||0)))}return t}sortActiveCollection(t,e){let i=this._getRemote().ActiveCollection;if(!i)return;"string"==typeof t&&(i.SortMode=t),"string"==typeof e&&(i.SortDirection=e),this._sortItems(i.Items||[],i.SortMode,i.SortDirection);let o=this._getPanelView();o&&o.renderContent(),fetch("/api/collections/"+encodeURIComponent(i.GUID),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({GUID:i.GUID,SortMode:i.SortMode,SortDirection:i.SortDirection})}).catch(t=>{this.log.error("Failed to save sort preference: "+t.message)})}searchCollections(t){let e=this._getRemote(),i=(t||"").toLowerCase();return i?e.Collections.filter(t=>{let e=(t.Name||"").toLowerCase(),o=(t.Description||"").toLowerCase(),n=(t.Tags||[]).join(" ").toLowerCase();return e.indexOf(i)>=0||o.indexOf(i)>=0||n.indexOf(i)>=0}):e.Collections}}Object.assign(a.prototype,n),Object.assign(a.prototype,r),Object.assign(a.prototype,s),a.default_configuration={ProviderIdentifier:"RetoldRemote-CollectionManager",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=a},{"./CollectionManager-AddItems":115,"./CollectionManager-Favorites":116,"./CollectionManager-OperationPlan":117,"pict-provider":46}],120:[function(t,e,i){const o=t("pict-provider");class n extends o{constructor(t,e,i){super(t,e,i),this.serviceType="RetoldRemoteProvider"}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}formatFileSize(t){if(!t||0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}formatShortDate(t){if(!t)return"";let e=new Date(t);return isNaN(e.getTime())?"":e.getMonth()+1+"/"+e.getDate()+"/"+String(e.getFullYear()).slice(-2)}formatTimestamp(t,e){if(null==t||isNaN(t))return"--";let i,o=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.floor(t%60);if(i=o>0?o+":"+String(n).padStart(2,"0")+":"+String(r).padStart(2,"0"):n+":"+String(r).padStart(2,"0"),e){i+="."+Math.floor(t%1*10)}return i}}n.default_configuration={ProviderIdentifier:"RetoldRemote-FormattingUtilities",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=n},{"pict-provider":46}],121:[function(t,e,i){const o=t("pict-provider"),n=t("../RetoldRemote-ExtensionMaps.js");class r extends o{constructor(t,e,i){super(t,e,i)}applyFilterSort(){let t=this.pict.AppData.RetoldRemote;if(!t)return;let e=(t.RawFileList||[]).slice();e=this._applySearch(e,t.SearchQuery);let i=t.FilterState||{};e=this._applyMediaTypeFilter(e,i.MediaType||"all"),e=this._applyExtensionFilter(e,i.Extensions||[]),e=this._applySizeFilter(e,i.SizeMin,i.SizeMax),e=this._applyDateFilter(e,i),e=this._sortItems(e,t.SortField||"folder-first",t.SortDirection||"asc"),t.GalleryItems=e;let o=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",n=t.FolderCursorHistory&&t.FolderCursorHistory[o];"number"==typeof n&&n<e.length?t.GalleryCursorIndex=n:t.GalleryCursorIndex=0;let r=this.pict.views["RetoldRemote-Gallery"];r&&r.renderGallery()}_applySearch(t,e){if(!e)return t;let i=this.pict.AppData.RetoldRemote,o=i.SearchCaseSensitive||!1;if(i.SearchRegex||!1){let n;try{n=new RegExp(e,o?"":"i")}catch(e){return i._searchRegexError=e.message,t}return i._searchRegexError=null,t.filter(t=>n.test(t.Name))}if(i._searchRegexError=null,o)return t.filter(t=>t.Name.includes(e));let n=e.toLowerCase();return t.filter(t=>t.Name.toLowerCase().includes(n))}_applyMediaTypeFilter(t,e){return"all"===e?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let i=this.getCategory((t.Extension||"").toLowerCase());return"images"===e?"image"===i:"video"===e?"video"===i:"audio"===e?"audio"===i:"documents"!==e||"document"===i})}_applyExtensionFilter(t,e){if(!e||0===e.length)return t;let i={};for(let t=0;t<e.length;t++)i[e[t].toLowerCase()]=!0;return t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let e=(t.Extension||"").replace(/^\./,"").toLowerCase();return!0===i[e]})}_applySizeFilter(t,e,i){return null===e&&null===i?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let o=t.Size||0;return!(null!==e&&o<e)&&!(null!==i&&o>i)})}_applyDateFilter(t,e){let i=e.DateModifiedAfter?new Date(e.DateModifiedAfter).getTime():null,o=e.DateModifiedBefore?new Date(e.DateModifiedBefore+"T23:59:59").getTime():null,n=e.DateCreatedAfter?new Date(e.DateCreatedAfter).getTime():null,r=e.DateCreatedBefore?new Date(e.DateCreatedBefore+"T23:59:59").getTime():null;return null===i&&null===o&&null===n&&null===r?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;if(null!==i||null!==o){let e=t.Modified?new Date(t.Modified).getTime():0;if(null!==i&&e<i)return!1;if(null!==o&&e>o)return!1}if(null!==n||null!==r){let e=t.Created?new Date(t.Created).getTime():0;if(null!==n&&e<n)return!1;if(null!==r&&e>r)return!1}return!0})}_sortItems(t,e,i){let o="desc"===i?-1:1;return t.slice().sort((t,i)=>{if("folder-first"===e){let e="folder"===t.Type||"archive"===t.Type,n="folder"===i.Type||"archive"===i.Type;if(e&&!n)return-1;if(!e&&n)return 1;let r=(t.Name||"").toLowerCase(),s=(i.Name||"").toLowerCase();return r<s?-1*o:r>s?1*o:0}if("name"===e){let e=(t.Name||"").toLowerCase(),n=(i.Name||"").toLowerCase();return e<n?-1*o:e>n?1*o:0}if("modified"===e){let e=t.Modified?new Date(t.Modified).getTime():0,n=i.Modified?new Date(i.Modified).getTime():0;if(e!==n)return(e-n)*o;let r=(t.Name||"").toLowerCase(),s=(i.Name||"").toLowerCase();return r<s?-1:r>s?1:0}if("created"===e){let e=t.Created?new Date(t.Created).getTime():0,n=i.Created?new Date(i.Created).getTime():0;if(e!==n)return(e-n)*o;let r=(t.Name||"").toLowerCase(),s=(i.Name||"").toLowerCase();return r<s?-1:r>s?1:0}return 0})}getCategory(t){return n.getCategory(t)}getAvailableExtensions(){let t=this.pict.AppData.RetoldRemote,e=t?t.RawFileList:[],i={};for(let t=0;t<e.length;t++){let o=e[t];if("folder"===o.Type||"archive"===o.Type)continue;let n=(o.Extension||"").replace(/^\./,"").toLowerCase();n&&(i[n]||(i[n]={ext:n,category:this.getCategory(n),count:0}),i[n].count++)}let o={image:0,video:1,audio:2,document:3,other:4},n=Object.values(i);return n.sort((t,e)=>{let i=o[t.category]||99,n=o[e.category]||99;return i!==n?i-n:t.ext<e.ext?-1:t.ext>e.ext?1:0}),n}getActiveFilterChips(){let t=this.pict.AppData.RetoldRemote;if(!t)return[];let e=[],i=t.FilterState||{};if(i.MediaType&&"all"!==i.MediaType){let t={images:"Images",video:"Video",audio:"Audio",documents:"Docs"};e.push({key:"mediaType",label:t[i.MediaType]||i.MediaType})}let o=i.Extensions||[];if(o.length>0)for(let t=0;t<o.length;t++)e.push({key:"ext:"+o[t],label:"."+o[t]});if(null!==i.SizeMin&&void 0!==i.SizeMin&&e.push({key:"sizeMin",label:"≥ "+this._formatSizeKB(i.SizeMin)}),null!==i.SizeMax&&void 0!==i.SizeMax&&e.push({key:"sizeMax",label:"≤ "+this._formatSizeKB(i.SizeMax)}),i.DateModifiedAfter&&e.push({key:"dateModifiedAfter",label:"Modified after "+i.DateModifiedAfter}),i.DateModifiedBefore&&e.push({key:"dateModifiedBefore",label:"Modified before "+i.DateModifiedBefore}),i.DateCreatedAfter&&e.push({key:"dateCreatedAfter",label:"Created after "+i.DateCreatedAfter}),i.DateCreatedBefore&&e.push({key:"dateCreatedBefore",label:"Created before "+i.DateCreatedBefore}),t.SearchQuery){let i='Search: "'+t.SearchQuery+'"',o=[];t.SearchCaseSensitive&&o.push("Aa"),t.SearchRegex&&o.push(".*"),o.length>0&&(i+=" ["+o.join(", ")+"]"),e.push({key:"search",label:i})}return e}_formatSizeKB(t){return t>=1048576?(t/1048576).toFixed(1)+" MB":Math.round(t/1024)+" KB"}removeFilter(t){let e=this.pict.AppData.RetoldRemote;if(!e)return;let i=e.FilterState;if("mediaType"===t)i.MediaType="all",e.GalleryFilter="all";else if(t.startsWith("ext:")){let e=t.substring(4);i.Extensions=(i.Extensions||[]).filter(t=>t!==e)}else"sizeMin"===t?i.SizeMin=null:"sizeMax"===t?i.SizeMax=null:"dateModifiedAfter"===t?i.DateModifiedAfter=null:"dateModifiedBefore"===t?i.DateModifiedBefore=null:"dateCreatedAfter"===t?i.DateCreatedAfter=null:"dateCreatedBefore"===t?i.DateCreatedBefore=null:"search"===t&&(e.SearchQuery="",e._searchRegexError=null)}clearAllFilters(){let t=this.pict.AppData.RetoldRemote;t&&(t.SearchQuery="",t.SearchCaseSensitive=!1,t.SearchRegex=!1,t._searchRegexError=null,t.GalleryFilter="all",t.FilterState={MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null})}savePreset(t){if(!t)return;let e=this.pict.AppData.RetoldRemote;if(!e)return;let i={Name:t,FilterState:JSON.parse(JSON.stringify(e.FilterState)),SortField:e.SortField,SortDirection:e.SortDirection};e.FilterPresets=e.FilterPresets||[],e.FilterPresets.push(i)}loadPreset(t){let e=this.pict.AppData.RetoldRemote;if(!e||!e.FilterPresets)return;let i=e.FilterPresets[t];i&&(e.FilterState=JSON.parse(JSON.stringify(i.FilterState)),e.GalleryFilter=e.FilterState.MediaType||"all",e.SortField=i.SortField||"folder-first",e.SortDirection=i.SortDirection||"asc")}deletePreset(t){let e=this.pict.AppData.RetoldRemote;e&&e.FilterPresets&&e.FilterPresets.splice(t,1)}}r.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryFilterSort",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!1},e.exports=r},{"../RetoldRemote-ExtensionMaps.js":114,"pict-provider":46}],122:[function(t,e,i){const o=t("pict-provider"),n=t("./keyboard-handlers/KeyHandler-Gallery.js"),r=t("./keyboard-handlers/KeyHandler-Viewer.js"),s=t("./keyboard-handlers/KeyHandler-Sidebar.js"),a=t("./keyboard-handlers/KeyHandler-VideoExplorer.js"),l=t("./keyboard-handlers/KeyHandler-AudioExplorer.js"),d=t("./keyboard-handlers/KeyHandler-ImageExplorer.js");class c extends o{constructor(t,e,i){super(t,e,i),this._columnsPerRow=4,this._keydownBound=!1,this._helpPanelVisible=!1,this._sidebarFocused=!1,this._sidebarCursorIndex=0}recalculateColumns(){if("list"===this.pict.AppData.RetoldRemote.ViewMode)return void(this._columnsPerRow=1);let t=document.querySelectorAll(".retold-remote-tile");if(t.length<2)return void(this._columnsPerRow=Math.max(1,t.length));let e=t[0].offsetTop,i=1;for(let o=1;o<t.length&&t[o].offsetTop===e;o++)i++;this._columnsPerRow=i}bindKeyboardNavigation(){if(this._keydownBound)return;let t=this;this._keydownHandler=function(e){if("F1"===e.key)return e.preventDefault(),void t._toggleHelpPanel();if("F9"===e.key)return e.preventDefault(),void(t._sidebarFocused?t._blurSidebar():t._focusSidebar());if("/"===e.key){let i=document.getElementById("RetoldRemote-Gallery-Search");if(e.target===i)return e.preventDefault(),t._hideFilterBar(),void i.blur();if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;return e.preventDefault(),void t._toggleFilterBar()}if("Escape"===e.key&&"RetoldRemote-Gallery-Search"===e.target.id)return e.preventDefault(),e.target.blur(),void t._hideFilterBar();if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;if(t._helpPanelVisible&&"Escape"===e.key)return e.preventDefault(),void t._toggleHelpPanel();let i=t.pict.AppData.RetoldRemote.ActiveMode;"gallery"===i&&t._sidebarFocused?t._handleSidebarKey(e):"gallery"===i?t._handleGalleryKey(e):"video-explorer"===i?t._handleVideoExplorerKey(e):"audio-explorer"===i?t._handleAudioExplorerKey(e):"image-explorer"===i?t._handleImageExplorerKey(e):"viewer"===i&&t._handleViewerKey(e)},document.addEventListener("keydown",this._keydownHandler),this._keydownBound=!0,this._setupDFSwipeGestures()}_setupDFSwipeGestures(){if(this._dfSwipeBound)return;let t=this,e=0,i=0,o=0,n=0;this._dfSwipeTouchStart=function(t){n=t.touches.length,1===n&&(i=t.touches[0].clientX,e=t.touches[0].clientY,o=e)},this._dfSwipeTouchEnd=function(r){if(1!==n)return;let s=r.changedTouches[0].clientX,a=r.changedTouches[0].clientY,l=s-i,d=a-e;if(Math.abs(d)<60||Math.abs(l)>Math.abs(d))return;let c=t.pict.AppData.RetoldRemote._distractionFreeMode||!1;(!c&&d<0&&o<=60||c&&d>0&&o<=40)&&t._toggleDistractionFree()},document.addEventListener("touchstart",this._dfSwipeTouchStart,{passive:!0}),document.addEventListener("touchend",this._dfSwipeTouchEnd,{passive:!0}),this._dfSwipeBound=!0}_handleGalleryKey(t){n(this,t)}_handleSidebarKey(t){s(this,t)}_focusSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t||t.classList.contains("collapsed"))return;this._sidebarFocused=!0,this._sidebarCursorIndex=0;let e=document.querySelector(".content-editor-sidebar-inner");e&&e.classList.add("keyboard-focused"),this._moveSidebarCursor(0)}_blurSidebar(){this._sidebarFocused=!1;let t=document.querySelector(".content-editor-sidebar-inner");t&&t.classList.remove("keyboard-focused");let e=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row");for(let t=0;t<e.length;t++)e[t].classList.remove("sidebar-focused")}_moveSidebarCursor(t){let e=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row");0!==e.length&&(this._sidebarCursorIndex<e.length&&e[this._sidebarCursorIndex].classList.remove("sidebar-focused"),this._sidebarCursorIndex=t,t<e.length&&(e[t].classList.add("sidebar-focused"),e[t].scrollIntoView({block:"nearest",behavior:"smooth"})))}_handleViewerKey(t){r(this,t)}_handleVideoExplorerKey(t){a(this,t)}_handleAudioExplorerKey(t){l(this,t)}_handleImageExplorerKey(t){d(this,t)}moveCursor(t){let e=this.pict.AppData.RetoldRemote,i=e.GalleryCursorIndex||0;if(t===i)return;e.GalleryCursorIndex=t;let o=document.querySelector(`.retold-remote-tile[data-index="${i}"], .retold-remote-list-row[data-index="${i}"]`),n=document.querySelector(`.retold-remote-tile[data-index="${t}"], .retold-remote-list-row[data-index="${t}"]`);o&&o.classList.remove("selected"),n&&(n.classList.add("selected"),n.scrollIntoView({block:"nearest",behavior:"smooth"}));let r=this.pict.views["ContentEditor-TopBar"];r&&r.updateInfo()}openCurrent(){let t=this.pict.AppData.RetoldRemote,e=t.GalleryItems||[],i=t.GalleryCursorIndex||0;if(i>=e.length)return;let o=e[i];if("folder"===o.Type||"archive"===o.Type){let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";t.FolderCursorHistory[e]=i;let n=this.pict.PictApplication;n&&n.loadFileList&&n.loadFileList(o.Path)}else{let t=this.pict.PictApplication;t&&t.navigateToFile&&t.navigateToFile(o.Path)}}openCurrentAs(t){let e=this.pict.AppData.RetoldRemote,i=e.GalleryItems||[],o=e.GalleryCursorIndex||0;if(o>=i.length)return;let n=i[o];if("folder"===n.Type||"archive"===n.Type)return;let r=this.pict.PictApplication;r&&r.navigateToFileAs&&r.navigateToFileAs(n.Path,t)}switchViewerType(t){let e=this.pict.AppData.RetoldRemote.CurrentViewerFile;if(!e)return;let i=this.pict.views["RetoldRemote-MediaViewer"];i&&i.showMedia(e,t)}navigateUp(){let t=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!t)return;let e=this.pict.AppData.RetoldRemote;e.FolderCursorHistory[t]=e.GalleryCursorIndex||0;let i=t.indexOf("/")>=0?t.replace(/\/[^/]+\/?$/,""):"",o=this.pict.PictApplication;o&&o.loadFileList&&o.loadFileList(i)}closeViewer(){let t=this.pict.AppData.RetoldRemote;t.ActiveMode="gallery",t.CurrentViewerFile="",t.CurrentViewerMediaType="",t.BrowsingCollection=!1,t.BrowsingCollectionIndex=-1;let e=document.getElementById("RetoldRemote-Gallery-Container"),i=document.getElementById("RetoldRemote-Viewer-Container");e&&(e.style.display=""),i&&(i.style.display="none");let o=this.pict.views["RetoldRemote-MediaViewer"];o&&(o._cleanupSwipe&&o._cleanupSwipe(),o._cleanupDFExitHotspot&&o._cleanupDFExitHotspot());let n=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",r=this.pict.providers["RetoldRemote-Provider"],s=r&&n?r.getFragmentIdentifier(n):n;window.location.hash=s?"#/browse/"+s:"#/browse/";let a=this.pict.views["RetoldRemote-Gallery"];a&&a.renderGallery()}_navigateToCollectionItem(t,e){let i=this.pict.AppData.RetoldRemote;if(i.BrowsingCollection=!0,i.BrowsingCollectionIndex=e,"video-clip"===t.Type){let e=this.pict.views["RetoldRemote-VideoExplorer"];e&&e.showExplorer(t.Path,t.VideoStart,t.VideoEnd)}else if("audio-clip"===t.Type){let e=this.pict.views["RetoldRemote-AudioExplorer"];e&&e.showExplorer(t.Path,t.AudioStart,t.AudioEnd)}else if("video-frame"===t.Type&&t.FrameCacheKey&&t.FrameFilename){let e="/api/media/video-frame/"+encodeURIComponent(t.FrameCacheKey)+"/"+encodeURIComponent(t.FrameFilename),i=this.pict.views["RetoldRemote-MediaViewer"];i&&i.showDirectImage(e,t.Label||t.FrameFilename,t.Path)}else{let e=this.pict.PictApplication;e&&e.navigateToFile&&e.navigateToFile(t.Path)}}nextFile(){let t=this.pict.AppData.RetoldRemote;if(t.BrowsingCollection&&t.ActiveCollection){let e=t.ActiveCollection.Items||[];for(let i=t.BrowsingCollectionIndex+1;i<e.length;i++){let t=e[i];if("file"===t.Type||"subfile"===t.Type||"image-crop"===t.Type||"video-clip"===t.Type||"video-frame"===t.Type)return void this._navigateToCollectionItem(t,i)}return}let e=t.GalleryItems||[];for(let i=(t.GalleryCursorIndex||0)+1;i<e.length;i++)if("file"===e[i].Type){t.GalleryCursorIndex=i;let o=this.pict.PictApplication;return void(o&&o.navigateToFile&&o.navigateToFile(e[i].Path))}}prevFile(){let t=this.pict.AppData.RetoldRemote;if(t.BrowsingCollection&&t.ActiveCollection){let e=t.ActiveCollection.Items||[];for(let i=t.BrowsingCollectionIndex-1;i>=0;i--){let t=e[i];if("file"===t.Type||"subfile"===t.Type||"image-crop"===t.Type||"video-clip"===t.Type||"video-frame"===t.Type)return void this._navigateToCollectionItem(t,i)}return}let e=t.GalleryItems||[];for(let i=(t.GalleryCursorIndex||0)-1;i>=0;i--)if("file"===e[i].Type){t.GalleryCursorIndex=i;let o=this.pict.PictApplication;return void(o&&o.navigateToFile&&o.navigateToFile(e[i].Path))}}_toggleViewMode(){let t=this.pict.AppData.RetoldRemote;t.ViewMode="gallery"===t.ViewMode?"list":"gallery";let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery();let i=this.pict.PictApplication;i&&"function"==typeof i.saveSettings&&i.saveSettings()}_focusSearch(){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()}_toggleFilterBar(){this.pict.AppData.RetoldRemote.FilterBarVisible?this._hideFilterBar():this._showFilterBar()}_showFilterBar(){let t=this.pict.AppData.RetoldRemote;if(t.FilterBarVisible){let t=document.getElementById("RetoldRemote-Gallery-Search");return void(t&&t.focus())}t.FilterBarVisible=!0;let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}_hideFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!1,t.FilterPanelOpen=!1;let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery()}_clearAllFilters(){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.clearAllFilters(),this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Filters cleared")}_toggleHelpPanel(){let t=document.getElementById("RetoldRemote-Help-Panel");if(t)return t.remove(),void(this._helpPanelVisible=!1);this._helpPanelVisible=!0;let e=document.createElement("div");e.id="RetoldRemote-Help-Panel",e.innerHTML=this._buildHelpPanelHTML(),(document.fullscreenElement||document.body).appendChild(e)}_buildHelpPanelHTML(){let t=this.pict.AppData.RetoldRemote.ActiveMode||"gallery",e='<div class="retold-remote-help-backdrop" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">';e+='<div class="retold-remote-help-flyout" onclick="event.stopPropagation()">',e+='<div class="retold-remote-help-header">',e+='<span class="retold-remote-help-title">Keyboard Shortcuts</span>',e+='<button class="retold-remote-help-close" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">×</button>',e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Gallery / File List</div>';let i=[["← → ↑ ↓","Navigate tiles"],["Enter","Open selected item"],["Escape","Go up one folder"],["F9","Toggle sidebar focus"],["Home / End","Jump to first / last"],["g","Toggle gallery / list view"],["/","Toggle filter bar & search"],["f","Toggle advanced filter panel"],["s","Focus sort dropdown"],["x","Clear all filters"],["c","Settings / config panel"],["d","Distraction-free mode"],["e","Video explorer (on video files)"]];for(let t=0;t<i.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+i[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+i[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Sidebar (F9 to focus)</div>';let o=[["↑ / ↓","Navigate file list"],["Enter","Open selected item"],["Home / End","Jump to first / last"],["Escape / F9","Return to gallery"]];for(let t=0;t<o.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+o[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+o[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Media Viewer</div>';let n=[["← / k","Previous file"],["→ / j","Next file"],["Escape","Back to gallery"],["f","Toggle fullscreen"],["i","Toggle file info"],["Space","Play / pause media"],["Enter","Open video in VLC"],["z","Cycle fit mode"],["+ / -","Zoom in / out"],["0","Reset zoom"],["d","Distraction-free mode"]];for(let t=0;t<n.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+n[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+n[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Global</div>';let r=[["F1","Toggle this help panel"],["F9","Toggle sidebar focus"],["Escape","Close help panel"]];for(let t=0;t<r.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+r[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+r[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-row" style="justify-content: center; padding: 8px 0;">',e+='<a href="docs.html" target="_blank" style="color: var(--retold-accent, #569cd6); text-decoration: none; font-size: 0.9rem; cursor: pointer;">',e+="View Documentation ↗</a>",e+="</div>",e+="</div>",e+='<div class="retold-remote-help-footer">';let s="Gallery";return"viewer"===t?s="Media Viewer":"video-explorer"===t?s="Video Explorer":"audio-explorer"===t&&(s="Audio Explorer"),e+="Current mode: <strong>"+s+"</strong>",e+="</div>",e+="</div>",e+="</div>",e}_toggleSettingsPanel(){let t=this.pict.views["ContentEditor-Layout"];if(!t)return;let e=document.querySelector(".content-editor-sidebar-wrap");if(!e)return;let i=e.classList.contains("collapsed"),o=document.querySelector('.content-editor-sidebar-tab[data-tab="settings"]'),n=o&&o.classList.contains("active");i?(t.toggleSidebar(),t.switchSidebarTab("settings")):n?t.switchSidebarTab("files"):t.switchSidebarTab("settings")}_toggleFilterPresets(){let t=this.pict.AppData.RetoldRemote,e=this.pict.views["RetoldRemote-Gallery"];"gallery"===t.ActiveMode&&(!t.FilterPanelOpen&&e&&e.toggleFilterPanel(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(t)t.focus(),t.click();else{let t=document.getElementById("RetoldRemote-Filter-PresetName");t&&t.focus()}},50))}_toggleDistractionFree(){let t=this.pict.AppData.RetoldRemote,e=document.getElementById("ContentEditor-TopBar-Container"),i=document.querySelector(".content-editor-sidebar-wrap");if(!e||!i)return;if(t._distractionFreeMode||!1){e.style.display="",i.style.display="",t._distractionFreeMode=!1;let o=document.querySelector(".retold-remote-viewer-header");if(o&&(o.style.display=""),t._collectionsPanelWasOpen){let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px")),t.CollectionsPanelOpen=!0,t._collectionsPanelWasOpen=!1}}else{if(e.style.display="none",i.style.display="none",t._distractionFreeMode=!0,!t.DistractionFreeShowNav){let t=document.querySelector(".retold-remote-viewer-header");t&&(t.style.display="none")}if(t.CollectionsPanelOpen){t._collectionsPanelWasOpen=!0;let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&e.classList.add("collapsed"),t.CollectionsPanelOpen=!1}}let o=this.pict.views["RetoldRemote-MediaViewer"];o&&o._updateDFControls&&o._updateDFControls(),setTimeout(()=>this.recalculateColumns(),100)}_toggleFullscreen(){if(document.fullscreenElement)return void document.exitFullscreen();if("video"===this.pict.AppData.RetoldRemote.CurrentViewerMediaType){let t=document.getElementById("RetoldRemote-VideoPlayer");if(t)return void t.requestFullscreen()}let t=document.getElementById("RetoldRemote-Viewer-Container");t&&t.requestFullscreen()}_toggleFileInfo(){let t=document.getElementById("RetoldRemote-FileInfo-Overlay");if(t){let e="none"===window.getComputedStyle(t).display;t.style.display=e?"block":"none"}}_togglePlayPause(){let t=document.querySelector("#RetoldRemote-Viewer-Container video"),e=document.querySelector("#RetoldRemote-Viewer-Container audio"),i=t||e;i&&(i.paused?i.play():i.pause())}_zoomIn(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomIn&&t.zoomIn()}_zoomOut(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomOut&&t.zoomOut()}_zoomReset(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomReset&&t.zoomReset()}_cycleFitMode(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.cycleFitMode&&t.cycleFitMode()}_openWithVLC(){let t=this.pict.AppData.RetoldRemote;if("video"!==t.CurrentViewerMediaType)return;if(!(t.ServerCapabilities||{}).vlc)return;let e=t.CurrentViewerFile;e&&(this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Opening in VLC..."),fetch("/api/media/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}).then(t=>t.json()).then(t=>{t.Success||this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Failed to open: "+(t.Error||"Unknown error"))}).catch(t=>{this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Failed to open: "+t.message)}))}_streamWithVLC(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerMediaType;if("video"!==e&&"audio"!==e)return;let i=t.CurrentViewerFile;if(!i)return;let o,n=this.pict.providers["RetoldRemote-Provider"],r=n?n.getContentURL(i):"/content/"+encodeURIComponent(i),s=window.location.origin+r,a=/Windows/.test(navigator.userAgent),l=/iPhone|iPad|iPod/i.test(navigator.userAgent)||/Macintosh/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1,d=/Android/i.test(navigator.userAgent);if(o=l?"vlc-x-callback://x-callback-url/stream?url="+encodeURIComponent(s):a||d?"vlc://"+s:"vlc://"+encodeURIComponent(s),this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Opening VLC..."),l)window.location.href=o;else{let t=document.createElement("a");t.href=o,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}}}c.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryNavigation",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=c},{"./keyboard-handlers/KeyHandler-AudioExplorer.js":128,"./keyboard-handlers/KeyHandler-Gallery.js":129,"./keyboard-handlers/KeyHandler-ImageExplorer.js":130,"./keyboard-handlers/KeyHandler-Sidebar.js":131,"./keyboard-handlers/KeyHandler-VideoExplorer.js":132,"./keyboard-handlers/KeyHandler-Viewer.js":133,"pict-provider":46}],123:[function(t,e,i){const o=t("pict-provider"),n=t("../RetoldRemote-ExtensionMaps.js");class r extends o{constructor(t,e,i){super(t,e,i),this._pathToHash={},this._hashToPath={}}fetchCapabilities(t){fetch("/api/media/capabilities").then(t=>t.json()).then(e=>e&&e.Capabilities?t(null,e.Capabilities):t(null,{})).catch(e=>t(e))}fetchRemoteSettings(t){fetch("/api/remote/settings").then(t=>t.json()).then(e=>t(null,e||{})).catch(e=>t(e))}registerHash(t,e){t&&e&&(this._pathToHash[t]=e,this._hashToPath[e]=t)}getHashForPath(t){return this._pathToHash[t]||null}getPathForHash(t){return this._hashToPath[t]||null}_getPathParam(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return e}return encodeURIComponent(t)}getFragmentIdentifier(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return e}return t}resolveFragmentIdentifier(t){if(t&&/^[a-f0-9]{10}$/.test(t)){let e=this.getPathForHash(t);if(null!==e)return e}return t}getContentURL(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return"/content-hashed/"+e}return"/content/"+t.split("/").map(t=>encodeURIComponent(t)).join("/")}getThumbnailURL(t,e,i){let o=this.pict.AppData.RetoldRemote.ServerCapabilities,n=t.replace(/^.*\./,"").toLowerCase(),r=this._isImageExtension(n);return o&&(o.sharp||o.imagemagick)?"/api/media/thumbnail?path="+this._getPathParam(t)+"&width="+(e||200)+"&height="+(i||200):r?this.getContentURL(t):null}fetchMediaProbe(t,e){fetch("/api/media/probe?path="+this._getPathParam(t)).then(t=>t.json()).then(t=>{t&&t.Hash&&t.Path&&this.registerHash(t.Path,t.Hash),e(null,t)}).catch(t=>e(t))}fetchFolderSummary(t,e){let i="/api/media/folder-summary";t&&(i+="?path="+this._getPathParam(t)),fetch(i).then(t=>t.json()).then(t=>e(null,t)).catch(t=>e(t))}_isImageExtension(t){return"image"===n.getCategory(t)}}r.default_configuration={ProviderIdentifier:"RetoldRemote-Provider",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=r},{"../RetoldRemote-ExtensionMaps.js":114,"pict-provider":46}],124:[function(t,e,i){const o=t("pict-provider"),n={Primary:"#C0C0DD",Accent:"#66C2B8",Muted:"#6A6A8A",Light:"#2A2A4A",WarmBeige:"#2E2E4E",TealTint:"#1E3A3A",Lavender:"#2A2A48",AmberTint:"#3A3028",PdfFill:"#3A2028",PdfText:"#E06060"};let r;try{r=t("pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js").ExtensionMap}catch(t){r={}}const s=Object.keys(r).length>0?r:{".jpg":"file-image",".jpeg":"file-image",".png":"file-image",".gif":"file-image",".svg":"file-image",".webp":"file-image",".bmp":"file-image",".ico":"file-image",".tiff":"file-image",".tif":"file-image",".heic":"file-image",".heif":"file-image",".avif":"file-image",".raw":"file-image",".dng":"file-image",".nef":"file-image",".nrw":"file-image",".cr2":"file-image",".cr3":"file-image",".crw":"file-image",".arw":"file-image",".srf":"file-image",".sr2":"file-image",".raf":"file-image",".orf":"file-image",".rw2":"file-image",".rwl":"file-image",".pef":"file-image",".srw":"file-image",".x3f":"file-image",".3fr":"file-image",".fff":"file-image",".iiq":"file-image",".dcr":"file-image",".kdc":"file-image",".mrw":"file-image",".erf":"file-image",".txt":"file-text",".md":"file-text",".rtf":"file-text",".doc":"file-text",".docx":"file-text",".pdf":"file-pdf",".xls":"file-spreadsheet",".xlsx":"file-spreadsheet",".csv":"file-spreadsheet",".ods":"file-spreadsheet",".js":"file-code",".ts":"file-code",".jsx":"file-code",".tsx":"file-code",".py":"file-code",".rb":"file-code",".java":"file-code",".c":"file-code",".cpp":"file-code",".h":"file-code",".go":"file-code",".rs":"file-code",".swift":"file-code",".kt":"file-code",".scala":"file-code",".sh":"file-code",".bash":"file-code",".zsh":"file-code",".php":"file-code",".lua":"file-code",".r":"file-code",".sql":"file-code",".pl":"file-code",".html":"file-web",".htm":"file-web",".css":"file-web",".scss":"file-web",".less":"file-web",".xml":"file-web",".json":"file-config",".yaml":"file-config",".yml":"file-config",".toml":"file-config",".ini":"file-config",".env":"file-config",".conf":"file-config",".cfg":"file-config",".zip":"file-archive",".tar":"file-archive",".gz":"file-archive",".rar":"file-archive",".7z":"file-archive",".bz2":"file-archive",".xz":"file-archive",".tgz":"file-archive",".cbz":"file-archive",".cbr":"file-archive",".mp3":"file-audio",".wav":"file-audio",".flac":"file-audio",".ogg":"file-audio",".aac":"file-audio",".wma":"file-audio",".m4a":"file-audio",".opus":"file-audio",".aiff":"file-audio",".mp4":"file-video",".avi":"file-video",".mov":"file-video",".mkv":"file-video",".webm":"file-video",".wmv":"file-video",".flv":"file-video",".m4v":"file-video",".ogv":"file-video",".mpg":"file-video",".mpeg":"file-video",".mpe":"file-video",".mpv":"file-video",".m2v":"file-video",".ts":"file-video",".mts":"file-video",".m2ts":"file-video",".vob":"file-video",".3gp":"file-video",".3g2":"file-video",".f4v":"file-video",".rm":"file-video",".rmvb":"file-video",".divx":"file-video",".asf":"file-video",".mxf":"file-video",".dv":"file-video",".nsv":"file-video",".nuv":"file-video",".y4m":"file-video",".wtv":"file-video",".swf":"file-video",".dat":"file-video",".epub":"file-text",".mobi":"file-text"};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._colors=Object.assign({},n),this._icons=this._buildIconSet(),this._customIcons={},this._extensionMap=Object.assign({},s),this._cssInjected=!1}_buildIconSet(){let t=this;return{folder:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+i.WarmBeige+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 9H20.8" stroke="'+i.Primary+'" stroke-width="1" opacity="0.3" /></svg>'},"folder-open":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+i.WarmBeige+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 10.2L5.8 17.8C6 18.4 6.6 18.9 7.2 18.9H19.8L22.1 11.2C22.3 10.6 21.8 10 21.2 10H5.2C4.6 10 4 10.4 3.8 11" stroke="'+i.Primary+'" stroke-width="1.5" fill="'+i.Light+'" stroke-linecap="round" stroke-linejoin="round" opacity="0.7" /></svg>'},file:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-text":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="12.8" x2="15.9" y2="12.8" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="15.8" x2="15.9" y2="15.8" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="18.8" x2="12.2" y2="18.8" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-code":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M8.5 13.2L6.8 15.1L8.6 16.8" stroke="'+i.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><path d="M15.5 13.2L17.2 15.1L15.4 16.8" stroke="'+i.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><line x1="12.8" y1="12" x2="11.2" y2="18" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-image":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3.1" y="3.2" width="17.8" height="17.7" rx="2" fill="'+i.Lavender+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="8.3" cy="8.7" r="1.8" fill="'+i.Accent+'" /><path d="M20.8 15.2L15.9 10.1L5.2 20.8" stroke="'+i.Primary+'" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-pdf":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.PdfFill+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><text x="8.2" y="16.8" font-family="sans-serif" font-weight="700" font-size="6.5" fill="'+i.PdfText+'" letter-spacing="-0.3">PDF</text></svg>'},"file-spreadsheet":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.TealTint+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="7.2" y="11.1" width="9.8" height="7.8" rx="0.5" fill="none" stroke="'+i.Accent+'" stroke-width="1.2" /><line x1="7.2" y1="13.7" x2="17" y2="13.7" stroke="'+i.Accent+'" stroke-width="1" /><line x1="7.2" y1="16.3" x2="17" y2="16.3" stroke="'+i.Accent+'" stroke-width="1" /><line x1="10.9" y1="11.1" x2="10.9" y2="18.9" stroke="'+i.Accent+'" stroke-width="1" /></svg>'},"file-archive":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.WarmBeige+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="8.8" y="11.2" width="2.5" height="2" rx="0.4" fill="'+i.Primary+'" /><rect x="8.8" y="14.2" width="2.5" height="2" rx="0.4" fill="'+i.Primary+'" /><rect x="8.8" y="17.2" width="2.5" height="2" rx="0.4" fill="'+i.Primary+'" /></svg>'},"file-audio":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.AmberTint+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="10.2" cy="16.8" r="2.1" fill="none" stroke="'+i.Accent+'" stroke-width="1.5" /><path d="M12.2 16.8V11.2L16.1 10.1" stroke="'+i.Accent+'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="15.3" r="1.4" fill="none" stroke="'+i.Accent+'" stroke-width="1.2" /></svg>'},"file-video":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Lavender+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M9.8 12.2V18.2L15.8 15.2L9.8 12.2Z" fill="'+i.Accent+'" stroke="'+i.Accent+'" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-web":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.9" fill="'+i.TealTint+'" stroke="'+i.Primary+'" stroke-width="1.8" /><ellipse cx="12" cy="12" rx="4.1" ry="8.9" fill="none" stroke="'+i.Primary+'" stroke-width="1.2" /><line x1="3.1" y1="12" x2="20.9" y2="12" stroke="'+i.Primary+'" stroke-width="1" /><path d="M4.8 7.8C7 8.5 9.4 8.9 12 8.9C14.6 8.9 17 8.5 19.2 7.8" stroke="'+i.Primary+'" stroke-width="1" fill="none" /><path d="M4.8 16.2C7 15.5 9.4 15.1 12 15.1C14.6 15.1 17 15.5 19.2 16.2" stroke="'+i.Primary+'" stroke-width="1" fill="none" /></svg>'},"file-config":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="12" cy="15" r="2.8" fill="none" stroke="'+i.Muted+'" stroke-width="1.5" /><line x1="12" y1="11" x2="12" y2="12.2" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="12" y1="17.8" x2="12" y2="19" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="13.2" x2="15.8" y2="12.6" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="17" x2="9.2" y2="16.4" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="16.8" x2="15.8" y2="17.4" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="13" x2="9.2" y2="13.6" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /></svg>'},home:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.1 9.6L12 3.1L20.9 9.6V19.9C20.9 20.5 20.5 21 19.9 20.9H4.1C3.5 21 3 20.5 3.1 19.9V9.6Z" fill="'+i.TealTint+'" stroke="'+i.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="9.2" y="14.1" width="5.6" height="6.9" rx="0.5" fill="'+i.Accent+'" /></svg>'},"arrow-up":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12.1 19.1V5.1" stroke="'+i.Muted+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M5.2 11.9L12.1 5.1L18.9 11.9" stroke="'+i.Muted+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"chevron-right":e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M9.2 6.1L14.8 12.1L9.1 17.9" stroke="'+t._colors.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-down":e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6.1 9.2L12.1 14.8L17.9 9.1" stroke="'+t._colors.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',search:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="10.8" cy="10.8" r="6.8" stroke="'+i.Primary+'" stroke-width="1.8" /><line x1="15.9" y1="16.1" x2="20.8" y2="20.8" stroke="'+i.Primary+'" stroke-width="2" stroke-linecap="round" /></svg>'},"sort-asc":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+i.Primary+'" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+i.Muted+'" opacity="0.35" /></svg>'},"sort-desc":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+i.Muted+'" opacity="0.35" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+i.Primary+'" /></svg>'},sidebar:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="2" stroke="'+i.Primary+'" stroke-width="1.8" fill="none" /><line x1="9" y1="3" x2="9" y2="21" stroke="'+i.Primary+'" stroke-width="1.8" /><line x1="5" y1="7.5" x2="7.5" y2="7.5" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="5" y1="10.5" x2="7.5" y2="10.5" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="5" y1="13.5" x2="7.5" y2="13.5" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"music-note":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="8.2" cy="17.8" r="3.1" fill="'+i.AmberTint+'" stroke="'+i.Accent+'" stroke-width="1.8" /><path d="M11.2 17.8V5.2L19.1 3.1V14.8" stroke="'+i.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="14.8" r="2.4" fill="'+i.AmberTint+'" stroke="'+i.Accent+'" stroke-width="1.5" /></svg>'},"film-strip":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3" y="4" width="18" height="16" rx="2" stroke="'+i.Primary+'" stroke-width="1.8" fill="'+i.Lavender+'" /><path d="M9.5 8.5V15.5L16 12L9.5 8.5Z" fill="'+i.Accent+'" stroke="'+i.Accent+'" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"gallery-empty":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+i.WarmBeige+'" stroke="'+i.Muted+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="9" y1="11" x2="15" y2="17" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /><line x1="15" y1="11" x2="9" y2="17" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /></svg>'},"document-large":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="13" x2="15.9" y2="13" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="16" x2="15.9" y2="16" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="19" x2="12" y2="19" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},bookmark:e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="'+t._colors.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /></svg>',"bookmark-filled":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="'+i.Accent+'" /></svg>'},collection:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="4" y="8" width="16" height="12" rx="2" stroke="'+i.Primary+'" stroke-width="1.8" fill="'+i.Light+'" /><path d="M7 8V6C7 5.45 7.45 5 8 5H16C16.55 5 17 5.45 17 6V8" stroke="'+i.Primary+'" stroke-width="1.5" fill="none" /><path d="M9 5V3.5C9 3.22 9.22 3 9.5 3H14.5C14.78 3 15 3.22 15 3.5V5" stroke="'+i.Muted+'" stroke-width="1.2" fill="none" /></svg>'},heart:e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" stroke="'+t._colors.Primary+'" stroke-width="1.8" fill="none" /></svg>',"heart-filled":e=>{t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" stroke="#e74c3c" stroke-width="1.8" fill="#e74c3c" /></svg>'},"drag-handle":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="9" cy="7" r="1.5" fill="'+i.Muted+'" /><circle cx="15" cy="7" r="1.5" fill="'+i.Muted+'" /><circle cx="9" cy="12" r="1.5" fill="'+i.Muted+'" /><circle cx="15" cy="12" r="1.5" fill="'+i.Muted+'" /><circle cx="9" cy="17" r="1.5" fill="'+i.Muted+'" /><circle cx="15" cy="17" r="1.5" fill="'+i.Muted+'" /></svg>'}}}getIcon(t,e){let i=e||16,o=this._customIcons[t]||this._icons[t];return"function"==typeof o?o(i):""}getIconForEntry(t,e){if(!t)return"";if(t.Icon&&"string"==typeof t.Icon&&0===t.Icon.indexOf("<svg"))return t.Icon;let i=e||16;if("folder"===t.Type)return this.getIcon("folder",i);let o=(t.Extension||"").toLowerCase();return o&&this._extensionMap[o]?this.getIcon(this._extensionMap[o],i):this.getIcon("file",i)}getUIIcon(t,e){return this.getIcon(t,e||16)}registerIcon(t,e){return!(!t||"function"!=typeof e)&&(this._customIcons[t]=e,!0)}registerExtension(t,e){return!(!t||!e)&&(this._extensionMap[t.toLowerCase()]=e,!0)}setColors(t){t&&"object"==typeof t&&(Object.assign(this._colors,t),this._icons=this._buildIconSet())}getColors(){return Object.assign({},this._colors)}getIconNames(){let t=Object.keys(this._icons),e=Object.keys(this._customIcons);for(let i=0;i<e.length;i++)t.indexOf(e[i])<0&&t.push(e[i]);return t}getExtensionMap(){return Object.assign({},this._extensionMap)}injectCSS(){this._cssInjected||this.pict&&this.pict.CSSMap&&(this.pict.CSSMap.addCSS("RetoldRemoteIcons",".retold-remote-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }\n.retold-remote-icon svg { display: block; }\n.retold-remote-icon-sm svg { width: 16px; height: 16px; }\n.retold-remote-icon-md svg { width: 48px; height: 48px; }\n.retold-remote-icon-lg svg { width: 64px; height: 64px; }\n.retold-remote-icon-xl svg { width: 96px; height: 96px; }\n"),this._cssInjected=!0)}onAfterInitialize(){this.injectCSS();let e=Object.keys(t("../RetoldRemote-ExtensionMaps.js").VideoExtensions);for(let t=0;t<e.length;t++){let i="."+e[t];this._extensionMap[i]||(this._extensionMap[i]="file-video")}let i=Object.keys(t("../RetoldRemote-ExtensionMaps.js").AudioExtensions);for(let t=0;t<i.length;t++){let e="."+i[t];this._extensionMap[e]||(this._extensionMap[e]="file-audio")}let o=Object.keys(t("../RetoldRemote-ExtensionMaps.js").ImageExtensions);for(let t=0;t<o.length;t++){let e="."+o[t];this._extensionMap[e]||(this._extensionMap[e]="file-image")}return super.onAfterInitialize()}},e.exports.default_configuration={ProviderIdentifier:"RetoldRemote-Icons",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.DefaultColors=n},{"../RetoldRemote-ExtensionMaps.js":114,"pict-provider":46,"pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js":56}],125:[function(t,e,i){const o=t("pict-provider"),n=t("./RetoldRemote-ThemeDefinitions");class r extends o{constructor(t,e,i){super(t,e,i),this._themes={},this._themeOrder=[],this._currentTheme="twilight";for(let t=0;t<n.length;t++){let e=n[t];this._addTheme(e.Key,e)}}_addTheme(t,e){this._themes[t]=e,this._themeOrder.push(t)}applyTheme(t){let e=this._themes[t];e||(e=this._themes.twilight,t="twilight"),this._currentTheme=t;let i=":root {\n",o=e.Variables,n=Object.keys(o);for(let t=0;t<n.length;t++)i+="\t"+n[t]+": "+o[n[t]]+";\n";if(i+="}\n","undefined"!=typeof document){let t=document.getElementById("retold-remote-theme");t||(t=document.createElement("style"),t.id="retold-remote-theme",document.head.appendChild(t)),t.textContent=i}let r=this.pict.providers["RetoldRemote-Icons"];r&&e.IconColors&&r.setColors(e.IconColors);let s=this.pict.AppData.RetoldRemote;return s&&(s.Theme=t),!0}getThemeList(){let t=[];for(let e=0;e<this._themeOrder.length;e++){let i=this._themeOrder[e],o=this._themes[i];t.push({key:i,name:o.Name,category:o.Category,description:o.Description})}return t}getCurrentTheme(){return this._currentTheme}getTheme(t){return this._themes[t]||null}}r.default_configuration={ProviderIdentifier:"RetoldRemote-Theme",AutoInitialize:!0,AutoInitializeOrdinal:0},e.exports=r},{"./RetoldRemote-ThemeDefinitions":127,"pict-provider":46}],126:[function(t,e,i){const o=t("pict-provider");class n extends o{constructor(t,e,i){super(t,e,i),this.serviceType="RetoldRemoteProvider",this._overlayTimeout=null}showOverlayIndicator(t,e){let i=e||1500,o=document.getElementById("RetoldRemote-FitIndicator");if(!o){o=document.createElement("div"),o.id="RetoldRemote-FitIndicator",o.className="retold-remote-fit-indicator";let t=document.querySelector(".retold-remote-viewer-body");t&&t.appendChild(o)}o.textContent=t,o.classList.add("visible"),this._overlayTimeout&&clearTimeout(this._overlayTimeout),this._overlayTimeout=setTimeout(function(){o.classList.remove("visible")},i)}showToast(t,e){let i=e||2e3,o=document.querySelector(".retold-remote-toast");o&&o.remove();let n=document.createElement("div");n.className="retold-remote-toast",n.textContent=t,document.body.appendChild(n),setTimeout(function(){n.parentNode&&n.remove()},i)}}n.default_configuration={ProviderIdentifier:"RetoldRemote-ToastNotification",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=n},{"pict-provider":46}],127:[function(t,e,i){e.exports=[{Key:"daylight",Name:"Daylight",Category:"Grey",Description:"Bright white, dark text",Variables:{"--retold-bg-primary":"#FFFFFF","--retold-bg-secondary":"#F0F0F0","--retold-bg-tertiary":"#E8E8E8","--retold-bg-panel":"#F5F5F5","--retold-bg-viewer":"#FAFAFA","--retold-bg-hover":"#E0E0E0","--retold-bg-selected":"#C8C8C8","--retold-bg-thumb":"#F0F0F0","--retold-text-primary":"#1A1A1A","--retold-text-secondary":"#333333","--retold-text-muted":"#666666","--retold-text-dim":"#888888","--retold-text-placeholder":"#AAAAAA","--retold-accent":"#444444","--retold-accent-hover":"#222222","--retold-border":"#D0D0D0","--retold-border-light":"#E0E0E0","--retold-danger":"#CC0000","--retold-danger-muted":"#884444","--retold-scrollbar":"#C0C0C0","--retold-scrollbar-hover":"#A0A0A0","--retold-selection-bg":"rgba(68, 68, 68, 0.2)","--retold-focus-outline":"#444444","--retold-font-family":"'Segoe UI', system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#333333",Accent:"#444444",Muted:"#888888",Light:"#E8E8E8",WarmBeige:"#F0F0F0",TealTint:"#E0E0E0",Lavender:"#EBEBEB",AmberTint:"#F0EDE8",PdfFill:"#F0E0E0",PdfText:"#CC0000"}},{Key:"afternoon",Name:"Afternoon",Category:"Grey",Description:"Warm light grey, softer contrast",Variables:{"--retold-bg-primary":"#E8E4E0","--retold-bg-secondary":"#DAD6D2","--retold-bg-tertiary":"#D0CCC8","--retold-bg-panel":"#DDD9D5","--retold-bg-viewer":"#F0ECE8","--retold-bg-hover":"#CCC8C4","--retold-bg-selected":"#B8B4B0","--retold-bg-thumb":"#DAD6D2","--retold-text-primary":"#2A2A2A","--retold-text-secondary":"#404040","--retold-text-muted":"#707070","--retold-text-dim":"#909090","--retold-text-placeholder":"#B0B0B0","--retold-accent":"#555555","--retold-accent-hover":"#333333","--retold-border":"#C0BCB8","--retold-border-light":"#D0CCC8","--retold-danger":"#AA3333","--retold-danger-muted":"#886655","--retold-scrollbar":"#B8B4B0","--retold-scrollbar-hover":"#A0A09C","--retold-selection-bg":"rgba(85, 85, 85, 0.2)","--retold-focus-outline":"#555555","--retold-font-family":"Georgia, 'Times New Roman', serif","--retold-font-mono":"'Courier New', Courier, monospace"},IconColors:{Primary:"#404040",Accent:"#555555",Muted:"#909090",Light:"#D0CCC8",WarmBeige:"#DAD6D2",TealTint:"#CCC8C4",Lavender:"#D2D0CE",AmberTint:"#D8D2C8",PdfFill:"#D8C8C0",PdfText:"#AA3333"}},{Key:"evening",Name:"Evening",Category:"Grey",Description:"Medium grey, transitional",Variables:{"--retold-bg-primary":"#484848","--retold-bg-secondary":"#3C3C3C","--retold-bg-tertiary":"#424242","--retold-bg-panel":"#454545","--retold-bg-viewer":"#363636","--retold-bg-hover":"#525252","--retold-bg-selected":"#606060","--retold-bg-thumb":"#3C3C3C","--retold-text-primary":"#E0E0E0","--retold-text-secondary":"#D0D0D0","--retold-text-muted":"#A0A0A0","--retold-text-dim":"#888888","--retold-text-placeholder":"#707070","--retold-accent":"#C0C0C0","--retold-accent-hover":"#E0E0E0","--retold-border":"#585858","--retold-border-light":"#606060","--retold-danger":"#FF6666","--retold-danger-muted":"#AA6666","--retold-scrollbar":"#585858","--retold-scrollbar-hover":"#686868","--retold-selection-bg":"rgba(192, 192, 192, 0.25)","--retold-focus-outline":"#C0C0C0","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#D0D0D0",Accent:"#C0C0C0",Muted:"#888888",Light:"#424242",WarmBeige:"#484848",TealTint:"#3E3E3E",Lavender:"#444444",AmberTint:"#4A4640",PdfFill:"#4A3C3C",PdfText:"#FF6666"}},{Key:"twilight",Name:"Twilight",Category:"Grey",Description:"Dark grey, low light (default)",Variables:{"--retold-bg-primary":"#1E1E1E","--retold-bg-secondary":"#181818","--retold-bg-tertiary":"#252525","--retold-bg-panel":"#202020","--retold-bg-viewer":"#141414","--retold-bg-hover":"#2E2E2E","--retold-bg-selected":"#404040","--retold-bg-thumb":"#181818","--retold-text-primary":"#E0E0E0","--retold-text-secondary":"#C8C8C8","--retold-text-muted":"#909090","--retold-text-dim":"#707070","--retold-text-placeholder":"#585858","--retold-accent":"#A0A0A0","--retold-accent-hover":"#C0C0C0","--retold-border":"#333333","--retold-border-light":"#404040","--retold-danger":"#FF6666","--retold-danger-muted":"#AA6666","--retold-scrollbar":"#404040","--retold-scrollbar-hover":"#505050","--retold-selection-bg":"rgba(160, 160, 160, 0.25)","--retold-focus-outline":"#A0A0A0","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#C8C8C8",Accent:"#A0A0A0",Muted:"#707070",Light:"#252525",WarmBeige:"#2A2A2A",TealTint:"#222222",Lavender:"#282828",AmberTint:"#2E2A24",PdfFill:"#2E2224",PdfText:"#E06060"}},{Key:"night",Name:"Night",Category:"Grey",Description:"Near-black, minimal contrast",Variables:{"--retold-bg-primary":"#0A0A0A","--retold-bg-secondary":"#060606","--retold-bg-tertiary":"#0E0E0E","--retold-bg-panel":"#0C0C0C","--retold-bg-viewer":"#040404","--retold-bg-hover":"#161616","--retold-bg-selected":"#252525","--retold-bg-thumb":"#060606","--retold-text-primary":"#888888","--retold-text-secondary":"#707070","--retold-text-muted":"#555555","--retold-text-dim":"#444444","--retold-text-placeholder":"#333333","--retold-accent":"#666666","--retold-accent-hover":"#808080","--retold-border":"#1A1A1A","--retold-border-light":"#222222","--retold-danger":"#AA4444","--retold-danger-muted":"#663333","--retold-scrollbar":"#1A1A1A","--retold-scrollbar-hover":"#2A2A2A","--retold-selection-bg":"rgba(102, 102, 102, 0.2)","--retold-focus-outline":"#666666","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#707070",Accent:"#666666",Muted:"#444444",Light:"#0E0E0E",WarmBeige:"#121212",TealTint:"#0C0C0C",Lavender:"#101010",AmberTint:"#141210",PdfFill:"#141010",PdfText:"#AA4444"}},{Key:"neo-tokyo",Name:"Neo-Tokyo",Category:"Fun",Description:"Neon pink on dark navy",Variables:{"--retold-bg-primary":"#0D0D2B","--retold-bg-secondary":"#080820","--retold-bg-tertiary":"#121235","--retold-bg-panel":"#0F0F28","--retold-bg-viewer":"#060615","--retold-bg-hover":"#1A1A42","--retold-bg-selected":"#2A1845","--retold-bg-thumb":"#080820","--retold-text-primary":"#E8E0F0","--retold-text-secondary":"#D0C8E0","--retold-text-muted":"#9088A8","--retold-text-dim":"#6860A0","--retold-text-placeholder":"#504888","--retold-accent":"#FF2D8A","--retold-accent-hover":"#FF5AA0","--retold-border":"#2A2050","--retold-border-light":"#382868","--retold-danger":"#FF4466","--retold-danger-muted":"#AA3355","--retold-scrollbar":"#2A2050","--retold-scrollbar-hover":"#3A3068","--retold-selection-bg":"rgba(255, 45, 138, 0.25)","--retold-focus-outline":"#FF2D8A","--retold-font-family":"'Courier New', monospace","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#D0C8E0",Accent:"#FF2D8A",Muted:"#6860A0",Light:"#121235",WarmBeige:"#141438",TealTint:"#100E30",Lavender:"#141232",AmberTint:"#1A1228",PdfFill:"#1A1028",PdfText:"#FF4466"}},{Key:"cyberpunk",Name:"Cyberpunk",Category:"Fun",Description:"Electric green on black",Variables:{"--retold-bg-primary":"#0A0E0A","--retold-bg-secondary":"#060806","--retold-bg-tertiary":"#0E120E","--retold-bg-panel":"#0C100C","--retold-bg-viewer":"#040604","--retold-bg-hover":"#142014","--retold-bg-selected":"#1A3A1A","--retold-bg-thumb":"#060806","--retold-text-primary":"#C8FFC8","--retold-text-secondary":"#A0D8A0","--retold-text-muted":"#608860","--retold-text-dim":"#406040","--retold-text-placeholder":"#305030","--retold-accent":"#00FF41","--retold-accent-hover":"#44FF77","--retold-border":"#1A2A1A","--retold-border-light":"#224022","--retold-danger":"#FF3333","--retold-danger-muted":"#AA2222","--retold-scrollbar":"#1A2A1A","--retold-scrollbar-hover":"#2A4A2A","--retold-selection-bg":"rgba(0, 255, 65, 0.2)","--retold-focus-outline":"#00FF41","--retold-font-family":"'Lucida Console', 'Courier New', monospace","--retold-font-mono":"'Lucida Console', 'Courier New', monospace"},IconColors:{Primary:"#A0D8A0",Accent:"#00FF41",Muted:"#406040",Light:"#0E120E",WarmBeige:"#101610",TealTint:"#0C140C",Lavender:"#0E120E",AmberTint:"#141810",PdfFill:"#181010",PdfText:"#FF3333"}},{Key:"hotdog",Name:"Hotdog",Category:"Fun",Description:"Red and mustard yellow, garish",Variables:{"--retold-bg-primary":"#8B0000","--retold-bg-secondary":"#6B0000","--retold-bg-tertiary":"#7B0000","--retold-bg-panel":"#750000","--retold-bg-viewer":"#550000","--retold-bg-hover":"#AA1111","--retold-bg-selected":"#BB3300","--retold-bg-thumb":"#6B0000","--retold-text-primary":"#FFD700","--retold-text-secondary":"#FFC000","--retold-text-muted":"#CC9900","--retold-text-dim":"#AA7700","--retold-text-placeholder":"#886600","--retold-accent":"#FFD700","--retold-accent-hover":"#FFEE44","--retold-border":"#AA2222","--retold-border-light":"#BB3333","--retold-danger":"#FFFF00","--retold-danger-muted":"#CCCC00","--retold-scrollbar":"#AA2222","--retold-scrollbar-hover":"#CC3333","--retold-selection-bg":"rgba(255, 215, 0, 0.3)","--retold-focus-outline":"#FFD700","--retold-font-family":"Impact, 'Arial Black', sans-serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#FFC000",Accent:"#FFD700",Muted:"#AA7700",Light:"#7B0000",WarmBeige:"#800000",TealTint:"#6B0000",Lavender:"#780000",AmberTint:"#7A1000",PdfFill:"#6B0000",PdfText:"#FFFF00"}},{Key:"1970s-console",Name:"1970s Console",Category:"Fun",Description:"Amber phosphor on brown-black",Variables:{"--retold-bg-primary":"#1A1000","--retold-bg-secondary":"#140C00","--retold-bg-tertiary":"#1E1400","--retold-bg-panel":"#1C1200","--retold-bg-viewer":"#100A00","--retold-bg-hover":"#2A1C00","--retold-bg-selected":"#3A2800","--retold-bg-thumb":"#140C00","--retold-text-primary":"#FFAA00","--retold-text-secondary":"#DD8800","--retold-text-muted":"#AA6600","--retold-text-dim":"#884400","--retold-text-placeholder":"#663300","--retold-accent":"#FFCC00","--retold-accent-hover":"#FFDD44","--retold-border":"#2A1800","--retold-border-light":"#3A2200","--retold-danger":"#FF4400","--retold-danger-muted":"#AA3300","--retold-scrollbar":"#2A1800","--retold-scrollbar-hover":"#3A2800","--retold-selection-bg":"rgba(255, 204, 0, 0.2)","--retold-focus-outline":"#FFCC00","--retold-font-family":"'Courier New', 'Lucida Console', monospace","--retold-font-mono":"'Courier New', 'Lucida Console', monospace"},IconColors:{Primary:"#DD8800",Accent:"#FFCC00",Muted:"#884400",Light:"#1E1400",WarmBeige:"#201800",TealTint:"#1A1000",Lavender:"#1C1200",AmberTint:"#221800",PdfFill:"#201000",PdfText:"#FF4400"}},{Key:"1980s-console",Name:"1980s Console",Category:"Fun",Description:"Green phosphor on black",Variables:{"--retold-bg-primary":"#001200","--retold-bg-secondary":"#000E00","--retold-bg-tertiary":"#001600","--retold-bg-panel":"#001400","--retold-bg-viewer":"#000A00","--retold-bg-hover":"#002200","--retold-bg-selected":"#003800","--retold-bg-thumb":"#000E00","--retold-text-primary":"#00FF00","--retold-text-secondary":"#00CC00","--retold-text-muted":"#009900","--retold-text-dim":"#006600","--retold-text-placeholder":"#004400","--retold-accent":"#00FF66","--retold-accent-hover":"#44FF88","--retold-border":"#002A00","--retold-border-light":"#003A00","--retold-danger":"#FF0000","--retold-danger-muted":"#AA0000","--retold-scrollbar":"#002A00","--retold-scrollbar-hover":"#004400","--retold-selection-bg":"rgba(0, 255, 102, 0.2)","--retold-focus-outline":"#00FF66","--retold-font-family":"'Courier New', monospace","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#00CC00",Accent:"#00FF66",Muted:"#006600",Light:"#001600",WarmBeige:"#001A00",TealTint:"#001200",Lavender:"#001400",AmberTint:"#001800",PdfFill:"#140000",PdfText:"#FF0000"}},{Key:"1990s-website",Name:"1990s Web Site",Category:"Fun",Description:"Blue links on grey, beveled",Variables:{"--retold-bg-primary":"#C0C0C0","--retold-bg-secondary":"#B0B0B0","--retold-bg-tertiary":"#A8A8A8","--retold-bg-panel":"#B8B8B8","--retold-bg-viewer":"#D0D0D0","--retold-bg-hover":"#B8B8D0","--retold-bg-selected":"#000080","--retold-bg-thumb":"#B0B0B0","--retold-text-primary":"#000000","--retold-text-secondary":"#000080","--retold-text-muted":"#404040","--retold-text-dim":"#606060","--retold-text-placeholder":"#808080","--retold-accent":"#0000FF","--retold-accent-hover":"#0000CC","--retold-border":"#808080","--retold-border-light":"#A0A0A0","--retold-danger":"#FF0000","--retold-danger-muted":"#990000","--retold-scrollbar":"#808080","--retold-scrollbar-hover":"#606060","--retold-selection-bg":"rgba(0, 0, 128, 0.3)","--retold-focus-outline":"#0000FF","--retold-font-family":"'Times New Roman', Times, serif","--retold-font-mono":"'Courier New', Courier, monospace"},IconColors:{Primary:"#000080",Accent:"#0000FF",Muted:"#606060",Light:"#A8A8A8",WarmBeige:"#B0B0B0",TealTint:"#A0A0A0",Lavender:"#ABABD0",AmberTint:"#B8B0A0",PdfFill:"#C0A0A0",PdfText:"#FF0000"}},{Key:"early-2000s",Name:"Early 2000s Web",Category:"Fun",Description:"Teal and silver, Web 2.0",Variables:{"--retold-bg-primary":"#E8F4F8","--retold-bg-secondary":"#D0E8EE","--retold-bg-tertiary":"#C0DDE6","--retold-bg-panel":"#D8EEF2","--retold-bg-viewer":"#F0F8FA","--retold-bg-hover":"#B0D4E0","--retold-bg-selected":"#88C4D8","--retold-bg-thumb":"#D0E8EE","--retold-text-primary":"#1A3A4A","--retold-text-secondary":"#2A4A5A","--retold-text-muted":"#5A7A8A","--retold-text-dim":"#7A9AAA","--retold-text-placeholder":"#9ABACA","--retold-accent":"#0099CC","--retold-accent-hover":"#00AADD","--retold-border":"#A0C8D8","--retold-border-light":"#B8D8E4","--retold-danger":"#CC3300","--retold-danger-muted":"#994422","--retold-scrollbar":"#A0C8D8","--retold-scrollbar-hover":"#88B8CC","--retold-selection-bg":"rgba(0, 153, 204, 0.2)","--retold-focus-outline":"#0099CC","--retold-font-family":"Verdana, Geneva, Tahoma, sans-serif","--retold-font-mono":"'Lucida Console', Monaco, monospace"},IconColors:{Primary:"#2A4A5A",Accent:"#0099CC",Muted:"#7A9AAA",Light:"#C0DDE6",WarmBeige:"#D0E8EE",TealTint:"#B0D8E4",Lavender:"#C8DCE6",AmberTint:"#D8E0D0",PdfFill:"#E0C8C0",PdfText:"#CC3300"}},{Key:"synthwave",Name:"Synthwave",Category:"Fun",Description:"Purple and pink neon",Variables:{"--retold-bg-primary":"#1A0A2E","--retold-bg-secondary":"#140824","--retold-bg-tertiary":"#200E38","--retold-bg-panel":"#1C0C32","--retold-bg-viewer":"#100620","--retold-bg-hover":"#2A1848","--retold-bg-selected":"#3A2060","--retold-bg-thumb":"#140824","--retold-text-primary":"#E8C0F8","--retold-text-secondary":"#D0A8E8","--retold-text-muted":"#9878B8","--retold-text-dim":"#7858A8","--retold-text-placeholder":"#584088","--retold-accent":"#FF71CE","--retold-accent-hover":"#FF99DD","--retold-border":"#302050","--retold-border-light":"#402868","--retold-danger":"#FF4488","--retold-danger-muted":"#AA3366","--retold-scrollbar":"#302050","--retold-scrollbar-hover":"#402868","--retold-selection-bg":"rgba(255, 113, 206, 0.25)","--retold-focus-outline":"#FF71CE","--retold-font-family":"'Trebuchet MS', sans-serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#D0A8E8",Accent:"#FF71CE",Muted:"#7858A8",Light:"#200E38",WarmBeige:"#221040",TealTint:"#1A0C30",Lavender:"#1E0E36",AmberTint:"#241028",PdfFill:"#241020",PdfText:"#FF4488"}},{Key:"solarized-dark",Name:"Solarized Dark",Category:"Fun",Description:"Schoonover's classic palette",Variables:{"--retold-bg-primary":"#002B36","--retold-bg-secondary":"#073642","--retold-bg-tertiary":"#003B4A","--retold-bg-panel":"#00303C","--retold-bg-viewer":"#001E28","--retold-bg-hover":"#0A4858","--retold-bg-selected":"#155868","--retold-bg-thumb":"#073642","--retold-text-primary":"#FDF6E3","--retold-text-secondary":"#EEE8D5","--retold-text-muted":"#93A1A1","--retold-text-dim":"#839496","--retold-text-placeholder":"#657B83","--retold-accent":"#268BD2","--retold-accent-hover":"#45A0E0","--retold-border":"#0A4050","--retold-border-light":"#125868","--retold-danger":"#DC322F","--retold-danger-muted":"#AA2A28","--retold-scrollbar":"#0A4050","--retold-scrollbar-hover":"#125868","--retold-selection-bg":"rgba(38, 139, 210, 0.25)","--retold-focus-outline":"#268BD2","--retold-font-family":"'Source Code Pro', 'Fira Code', monospace","--retold-font-mono":"'Source Code Pro', 'Fira Code', monospace"},IconColors:{Primary:"#EEE8D5",Accent:"#268BD2",Muted:"#839496",Light:"#003B4A",WarmBeige:"#073642",TealTint:"#004050",Lavender:"#003848",AmberTint:"#0A3A30",PdfFill:"#0A3028",PdfText:"#DC322F"}},{Key:"forest",Name:"Forest",Category:"Fun",Description:"Deep greens and earth browns",Variables:{"--retold-bg-primary":"#1A2018","--retold-bg-secondary":"#141A12","--retold-bg-tertiary":"#1E2620","--retold-bg-panel":"#1C221A","--retold-bg-viewer":"#101410","--retold-bg-hover":"#283828","--retold-bg-selected":"#344834","--retold-bg-thumb":"#141A12","--retold-text-primary":"#D0DCC8","--retold-text-secondary":"#B0C4A8","--retold-text-muted":"#809878","--retold-text-dim":"#607858","--retold-text-placeholder":"#486040","--retold-accent":"#6AAF5C","--retold-accent-hover":"#88CC78","--retold-border":"#2A3A28","--retold-border-light":"#3A4A38","--retold-danger":"#CC4422","--retold-danger-muted":"#884422","--retold-scrollbar":"#2A3A28","--retold-scrollbar-hover":"#3A4A38","--retold-selection-bg":"rgba(106, 175, 92, 0.25)","--retold-focus-outline":"#6AAF5C","--retold-font-family":"'Palatino Linotype', 'Book Antiqua', Palatino, serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#B0C4A8",Accent:"#6AAF5C",Muted:"#607858",Light:"#1E2620",WarmBeige:"#22281E",TealTint:"#1A221A",Lavender:"#1E2420",AmberTint:"#262218",PdfFill:"#261A18",PdfText:"#CC4422"}},{Key:"mobile-debug",Name:"Mobile Container Debug",Category:"Debug",Description:"Unique color per container for layout debugging",Variables:{"--retold-bg-primary":"#FF0000","--retold-bg-secondary":"#00CCCC","--retold-bg-tertiary":"#00AA00","--retold-bg-panel":"#FFAA00","--retold-bg-viewer":"#333333","--retold-bg-hover":"rgba(255, 255, 255, 0.2)","--retold-bg-selected":"rgba(255, 255, 255, 0.3)","--retold-bg-thumb":"#AA00AA","--retold-text-primary":"#FFFFFF","--retold-text-secondary":"#EEEEEE","--retold-text-muted":"#CCCCCC","--retold-text-dim":"#AAAAAA","--retold-text-placeholder":"#888888","--retold-accent":"#FFFF00","--retold-accent-hover":"#FFFF88","--retold-border":"#FFFFFF","--retold-border-light":"#CCCCCC","--retold-danger":"#FF0000","--retold-danger-muted":"#CC4444","--retold-scrollbar":"#888888","--retold-scrollbar-hover":"#AAAAAA","--retold-selection-bg":"rgba(255, 255, 0, 0.3)","--retold-focus-outline":"#FFFF00","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Consolas', monospace"},IconColors:{Primary:"#FFFFFF",Accent:"#FFFF00",Muted:"#CCCCCC",Light:"#333333",WarmBeige:"#FFAA00",TealTint:"#00CCCC",Lavender:"#AA00AA",AmberTint:"#FFAA00",PdfFill:"#FF4444",PdfText:"#FFFFFF"}}]},{}],128:[function(t,e,i){e.exports=function(t,e){let i=t.pict.views["RetoldRemote-AudioExplorer"];if(i)switch(e.key){case"Escape":e.preventDefault(),i._selectionStart>=0?i.clearSelection():i.goBack();break;case"+":case"=":e.preventDefault(),i.zoomIn();break;case"-":case"_":e.preventDefault(),i.zoomOut();break;case"0":e.preventDefault(),i.zoomToFit();break;case"z":case"Z":e.preventDefault(),i.zoomToSelection();break;case" ":e.preventDefault(),i.playSelection();break;case"a":case"s":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addAudioSnippetToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}}}},{}],129:[function(t,e,i){e.exports=function(t,e){let i=t.pict.AppData.RetoldRemote,o=i.GalleryItems||[],n=i.GalleryCursorIndex||0;switch(e.key){case"ArrowRight":e.preventDefault(),t.moveCursor(Math.min(n+1,o.length-1));break;case"ArrowLeft":e.preventDefault(),t.moveCursor(Math.max(n-1,0));break;case"ArrowDown":e.preventDefault(),t.moveCursor(Math.min(n+t._columnsPerRow,o.length-1));break;case"ArrowUp":e.preventDefault(),t.moveCursor(Math.max(n-t._columnsPerRow,0));break;case"Enter":e.preventDefault(),t.openCurrent();break;case"Escape":e.preventDefault(),t.navigateUp();break;case"g":e.preventDefault(),t._toggleViewMode();break;case"x":e.preventDefault(),t._clearAllFilters();break;case"Home":e.preventDefault(),t.moveCursor(0);break;case"End":e.preventDefault(),t.moveCursor(o.length-1);break;case"1":e.preventDefault(),t.openCurrentAs("image");break;case"2":e.preventDefault(),t.openCurrentAs("video");break;case"3":e.preventDefault(),t.openCurrentAs("audio");break;case"4":e.preventDefault(),t.openCurrentAs("text");break;case"f":e.preventDefault();{t._showFilterBar();let e=t.pict.views["RetoldRemote-Gallery"];e&&e.toggleFilterPanel()}break;case"s":e.preventDefault(),t._showFilterBar(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Sort");t&&t.focus()},50);break;case"c":e.preventDefault(),t._toggleSettingsPanel();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=o[n],r=e.getQuickAddTargetGUID();if(i&&r)if("folder"===i.Type||"archive"===i.Type)e.showFolderChoicePrompt(t=>{let o={Type:"contents"===t?"folder-contents":"folder",Path:i.Path||"",Label:""};e.addItemsToCollection(r,[o])});else{let t={Type:"file",Path:i.Path||"",Hash:i.Hash||"",Label:""};e.addItemsToCollection(r,[t])}else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"d":e.preventDefault(),t._toggleDistractionFree();break;case"e":e.preventDefault();{let e=o[n];if(e&&"folder"!==e.Type&&"archive"!==e.Type){let i=t.pict.providers["RetoldRemote-GalleryFilterSort"];if("video"===(i?i.getCategory(e.Extension):"")){let i=t.pict.views["RetoldRemote-VideoExplorer"];i&&i.showExplorer(e.Path)}}}break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}break;case"i":e.preventDefault();{let e=t.pict.views["ContentEditor-Layout"];e&&e.switchSidebarTab("info")}}}},{}],130:[function(t,e,i){e.exports=function(t,e){let i=t.pict.views["RetoldRemote-ImageExplorer"];if(i)switch(e.key){case"Escape":e.preventDefault(),i.goBack();break;case"+":case"=":e.preventDefault(),i.zoomIn();break;case"-":case"_":e.preventDefault(),i.zoomOut();break;case"0":e.preventDefault(),i.zoomHome();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addCurrentFileToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}}}},{}],131:[function(t,e,i){e.exports=function(t,e){let i=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row"),o=i.length;if(0!==o)switch(e.key){case"ArrowDown":e.preventDefault(),t._moveSidebarCursor(Math.min(t._sidebarCursorIndex+1,o-1));break;case"ArrowUp":e.preventDefault(),t._moveSidebarCursor(Math.max(t._sidebarCursorIndex-1,0));break;case"Home":e.preventDefault(),t._moveSidebarCursor(0);break;case"End":e.preventDefault(),t._moveSidebarCursor(o-1);break;case"Enter":e.preventDefault();{let e=i[t._sidebarCursorIndex];if(e){let t=e.getAttribute("ondblclick");t&&new Function(t).call(e)}}break;case"Escape":e.preventDefault(),t._blurSidebar()}else t._blurSidebar()}},{}],132:[function(t,e,i){e.exports=function(t,e){switch(t.pict.AppData.RetoldRemote,e.key){case"Escape":e.preventDefault();let i=t.pict.views["RetoldRemote-VideoExplorer"];i&&(i._previewKeyHandler?i.closeFramePreview():i.goBack());break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addVideoFrameToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"s":e.preventDefault();{let e=t.pict.views["RetoldRemote-VideoExplorer"];if(!e||e._selectionStartTime<0||e._selectionEndTime<0)break;let i=t.pict.providers["RetoldRemote-CollectionManager"];if(i){let o=Math.min(e._selectionStartTime,e._selectionEndTime),n=Math.max(e._selectionStartTime,e._selectionEndTime),r=i.getQuickAddTargetGUID();if(r)i.addVideoClipToCollection(r,o,n);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"[":e.preventDefault();{let e=t.pict.views["RetoldRemote-VideoExplorer"];if(e&&e._frameData&&e._frameData.Frames&&e._selectedFrameIndex>=0&&e._frameData.Frames[e._selectedFrameIndex]){let t=e._frameData.Frames[e._selectedFrameIndex].Timestamp;e.setSelectionStart(t)}}break;case"]":e.preventDefault();{let e=t.pict.views["RetoldRemote-VideoExplorer"];if(e&&e._frameData&&e._frameData.Frames&&e._selectedFrameIndex>=0&&e._frameData.Frames[e._selectedFrameIndex]){let t=e._frameData.Frames[e._selectedFrameIndex].Timestamp;e.setSelectionEnd(t)}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}}}},{}],133:[function(t,e,i){e.exports=function(t,e){let i=t.pict.AppData.RetoldRemote;if(i.VideoMenuActive&&"video"===i.CurrentViewerMediaType)switch(e.key){case"Escape":return e.preventDefault(),void t.closeViewer();case"ArrowRight":case"j":return e.preventDefault(),void t.nextFile();case"ArrowLeft":case"k":return e.preventDefault(),void t.prevFile();case"e":e.preventDefault();let o=t.pict.views["RetoldRemote-VideoExplorer"];return void(o&&o.showExplorer(i.CurrentViewerFile));case" ":case"Enter":e.preventDefault();let n=t.pict.views["RetoldRemote-MediaViewer"];return void(n&&n.playVideo());case"t":e.preventDefault();let r=t.pict.views["RetoldRemote-MediaViewer"];return void(r&&r.loadVideoMenuFrame());case"v":return e.preventDefault(),void t._streamWithVLC();case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addCurrentFileToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}return;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}return;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}return}else switch(e.key){case"Escape":e.preventDefault(),t.closeViewer();break;case"ArrowRight":case"j":e.preventDefault(),t.nextFile();break;case"ArrowLeft":case"k":e.preventDefault(),t.prevFile();break;case"f":case"d":e.preventDefault(),t._toggleDistractionFree();break;case"i":e.preventDefault(),t._toggleFileInfo();break;case" ":e.preventDefault(),t._togglePlayPause();break;case"+":case"=":e.preventDefault(),t._zoomIn();break;case"-":e.preventDefault(),t._zoomOut();break;case"0":e.preventDefault(),t._zoomReset();break;case"z":e.preventDefault(),t._cycleFitMode();break;case"Enter":case"v":e.preventDefault(),t._streamWithVLC();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addCurrentFileToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"e":e.preventDefault();{let e=i.CurrentViewerMediaType;if("video"===e){let e=t.pict.views["RetoldRemote-VideoExplorer"];e&&e.showExplorer(i.CurrentViewerFile)}else if("audio"===e){let e=t.pict.views["RetoldRemote-AudioExplorer"];e&&e.showExplorer(i.CurrentViewerFile)}else if("image"===e){let e=t.pict.views["RetoldRemote-ImageExplorer"];e&&e.showExplorer(i.CurrentViewerFile)}}break;case"1":e.preventDefault(),t.switchViewerType("image");break;case"2":e.preventDefault(),t.switchViewerType("video");break;case"3":e.preventDefault(),t.switchViewerType("audio");break;case"4":e.preventDefault(),t.switchViewerType("text");break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}}}},{}],134:[function(t,e,i){
|
|
164
|
+
const o=t("pict-provider"),n=t("./CollectionManager-Favorites"),r=t("./CollectionManager-AddItems"),s=t("./CollectionManager-OperationPlan");class a extends o{constructor(t,e,i){super(t,e,i)}_getRemote(){return this.pict.AppData.RetoldRemote}_getPanelView(){return this.pict.views["RetoldRemote-CollectionsPanel"]}_getToast(){return this.pict.providers["RetoldRemote-ToastNotification"]}setPendingClipContext(t){this._pendingClipContext=t||null}clearPendingClipContext(){this._pendingClipContext=null}addPendingOrCurrentToCollection(t){if(this._pendingClipContext){let e=this._pendingClipContext;if(this._pendingClipContext=null,"video-clip"===e.Type)return this.addVideoClipToCollection(t,e.Start,e.End);if("audio-clip"===e.Type)return this.addAudioClipToCollection(t,e.Start,e.End)}return this.addCurrentFileToCollection(t)}getQuickAddTargetGUID(){let t=this._getRemote();return t.ActiveCollectionGUID&&"detail"===t.CollectionsPanelMode?t.ActiveCollectionGUID:t.LastUsedCollectionGUID||null}fetchCollections(t){let e=this,i="function"==typeof t?t:()=>{};fetch("/api/collections").then(t=>t.json()).then(t=>{let o=e._getRemote();o.Collections=Array.isArray(t)?t:[];let n=e._getPanelView();return n&&o.CollectionsPanelOpen&&n.renderContent(),i(null,o.Collections)}).catch(t=>(e.log.error("Failed to fetch collections: "+t.message),i(t)))}fetchCollection(t,e){let i=this,o="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)).then(t=>{if(!t.ok)throw new Error("Collection not found");return t.json()}).then(e=>{let n=i._getRemote();n.ActiveCollectionGUID=t,n.ActiveCollection=e;let r=i._getPanelView();return r&&r.renderContent(),o(null,e)}).catch(t=>(i.log.error("Failed to fetch collection: "+t.message),o(t)))}createCollection(t,e){let i=this,o="function"==typeof e?e:()=>{},n=this.fable.getUUID();fetch("/api/collections/"+encodeURIComponent(n),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Name:t||"Untitled Collection"})}).then(t=>t.json()).then(e=>{i._getRemote().LastUsedCollectionGUID=n,i.fetchCollections();let r=i._getToast();return r&&r.showToast("Collection created: "+(e.Name||t)),o(null,e)}).catch(t=>(i.log.error("Failed to create collection: "+t.message),o(t)))}updateCollection(t,e){let i=this,o="function"==typeof e?e:()=>{};if(!t||!t.GUID)return o(new Error("Collection must have a GUID"));fetch("/api/collections/"+encodeURIComponent(t.GUID),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>t.json()).then(e=>{let n=i._getRemote();return n.ActiveCollectionGUID===t.GUID&&(n.ActiveCollection=e),i.fetchCollections(),o(null,e)}).catch(t=>(i.log.error("Failed to update collection: "+t.message),o(t)))}deleteCollection(t,e){let i=this,o="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t),{method:"DELETE"}).then(t=>t.json()).then(()=>{let e=i._getRemote();e.ActiveCollectionGUID===t&&(e.ActiveCollectionGUID=null,e.ActiveCollection=null,e.CollectionsPanelMode="list"),e.LastUsedCollectionGUID===t&&(e.LastUsedCollectionGUID=null),i.fetchCollections();let n=i._getToast();return n&&n.showToast("Collection deleted"),o(null)}).catch(t=>(i.log.error("Failed to delete collection: "+t.message),o(t)))}addItemsToCollection(t,e,i){let o=this,n="function"==typeof i?i:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Items:e})}).then(t=>t.json()).then(i=>{let r=o._getRemote();r.LastUsedCollectionGUID=t,r.ActiveCollectionGUID===t&&(r.ActiveCollection=i),o.fetchCollections();let s=o._getPanelView();s&&"detail"===r.CollectionsPanelMode&&r.ActiveCollectionGUID===t&&s.renderContent();let a=o._getToast();if(a){let t=i.Name||"collection";a.showToast("Added "+e.length+" item"+(e.length>1?"s":"")+" to "+t)}return n(null,i)}).catch(t=>(o.log.error("Failed to add items to collection: "+t.message),n(t)))}removeItemFromCollection(t,e,i){let o=this,n="function"==typeof i?i:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/items/"+encodeURIComponent(e),{method:"DELETE"}).then(t=>t.json()).then(e=>{let i=o._getRemote();i.ActiveCollectionGUID===t&&(i.ActiveCollection=e),o.fetchCollections();let r=o._getPanelView();return r&&"detail"===i.CollectionsPanelMode&&i.ActiveCollectionGUID===t&&r.renderContent(),n(null,e)}).catch(t=>(o.log.error("Failed to remove item from collection: "+t.message),n(t)))}reorderItems(t,e,i){let o=this,n="function"==typeof i?i:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/reorder",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({ItemOrder:e})}).then(t=>t.json()).then(e=>{let i=o._getRemote();i.ActiveCollectionGUID===t&&(i.ActiveCollection=e);let r=o._getPanelView();return r&&"detail"===i.CollectionsPanelMode&&r.renderContent(),n(null,e)}).catch(t=>(o.log.error("Failed to reorder items: "+t.message),n(t)))}copyItems(t,e,i,o){let n=this,r="function"==typeof o?o:()=>{};fetch("/api/collections/copy-items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({SourceGUID:t,TargetGUID:e,ItemIDs:i})}).then(t=>t.json()).then(t=>{n.fetchCollections();let e=n._getToast();return e&&e.showToast("Copied "+i.length+" item"+(i.length>1?"s":"")),r(null,t)}).catch(t=>(n.log.error("Failed to copy items: "+t.message),r(t)))}togglePanel(){let t=this._getRemote(),e=this.pict.views["ContentEditor-Layout"];if(e&&e.isMobileDrawer()){let i=document.querySelector(".content-editor-sidebar-tab.active");i&&"collections"===i.getAttribute("data-tab")?e.switchSidebarTab("files"):(t.SidebarCollapsed&&e.toggleSidebar(),e.switchSidebarTab("collections"));let o=this.pict.views["ContentEditor-TopBar"];return void(o&&"function"==typeof o.updateCollectionsIcon&&o.updateCollectionsIcon())}t.CollectionsPanelOpen=!t.CollectionsPanelOpen;let i=document.getElementById("RetoldRemote-Collections-Wrap");i&&(t.CollectionsPanelOpen?(i.classList.remove("collapsed"),t.CollectionsPanelWidth&&(i.style.width=t.CollectionsPanelWidth+"px"),this.fetchCollections()):i.classList.add("collapsed"));let o=this.pict.views["ContentEditor-TopBar"];o&&"function"==typeof o.updateCollectionsIcon&&o.updateCollectionsIcon(),this.pict.PictApplication.saveSettings();let n=this;setTimeout(()=>{let t=n.pict.providers["RetoldRemote-GalleryNavigation"];t&&"function"==typeof t.recalculateColumns&&t.recalculateColumns()},250)}openPanel(){this._getRemote().CollectionsPanelOpen||this.togglePanel()}closePanel(){this._getRemote().CollectionsPanelOpen&&this.togglePanel()}_resolveCurrentFilePath(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(t)return t;let e=this._getRemote();if(e.CurrentViewerFile)return e.CurrentViewerFile;let i=e.GalleryItems||[],o=e.GalleryCursorIndex||0;return i.length>0&&i[o]&&i[o].Path?i[o].Path:""}_resolveCurrentItem(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(t)return{Path:t,Type:"file"};let e=this._getRemote();if(e.CurrentViewerFile)return{Path:e.CurrentViewerFile,Type:"file"};let i=e.GalleryItems||[],o=e.GalleryCursorIndex||0;return i.length>0&&i[o]?{Path:i[o].Path||"",Type:i[o].Type||"file"}:null}_sortItems(t,e,i){if(!Array.isArray(t)||t.length<2)return t;let o="desc"===i?-1:1;switch(e){case"name":t.sort((t,e)=>{let i=(t.Label||t.Path||"").toLowerCase(),n=(e.Label||e.Path||"").toLowerCase(),r=i.lastIndexOf("/"),s=n.lastIndexOf("/");return r>=0&&(i=i.substring(r+1)),s>=0&&(n=n.substring(s+1)),o*i.localeCompare(n)});break;case"type":t.sort((t,e)=>{let i=(t.Type||"").toLowerCase(),n=(e.Type||"").toLowerCase();return o*i.localeCompare(n)});break;case"modified":t.sort((t,e)=>{let i=t.AddedAt||"",n=e.AddedAt||"";return o*i.localeCompare(n)});break;default:t.sort((t,e)=>o*((t.SortOrder||0)-(e.SortOrder||0)))}return t}sortActiveCollection(t,e){let i=this._getRemote().ActiveCollection;if(!i)return;"string"==typeof t&&(i.SortMode=t),"string"==typeof e&&(i.SortDirection=e),this._sortItems(i.Items||[],i.SortMode,i.SortDirection);let o=this._getPanelView();o&&o.renderContent(),fetch("/api/collections/"+encodeURIComponent(i.GUID),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({GUID:i.GUID,SortMode:i.SortMode,SortDirection:i.SortDirection})}).catch(t=>{this.log.error("Failed to save sort preference: "+t.message)})}searchCollections(t){let e=this._getRemote(),i=(t||"").toLowerCase();return i?e.Collections.filter(t=>{let e=(t.Name||"").toLowerCase(),o=(t.Description||"").toLowerCase(),n=(t.Tags||[]).join(" ").toLowerCase();return e.indexOf(i)>=0||o.indexOf(i)>=0||n.indexOf(i)>=0}):e.Collections}}Object.assign(a.prototype,n),Object.assign(a.prototype,r),Object.assign(a.prototype,s),a.default_configuration={ProviderIdentifier:"RetoldRemote-CollectionManager",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=a},{"./CollectionManager-AddItems":118,"./CollectionManager-Favorites":119,"./CollectionManager-OperationPlan":120,"pict-provider":55}],123:[function(t,e,i){const o=t("pict-provider");class n extends o{constructor(t,e,i){super(t,e,i),this.serviceType="RetoldRemoteProvider"}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}formatFileSize(t){if(!t||0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}formatShortDate(t){if(!t)return"";let e=new Date(t);return isNaN(e.getTime())?"":e.getMonth()+1+"/"+e.getDate()+"/"+String(e.getFullYear()).slice(-2)}formatTimestamp(t,e){if(null==t||isNaN(t))return"--";let i,o=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.floor(t%60);if(i=o>0?o+":"+String(n).padStart(2,"0")+":"+String(r).padStart(2,"0"):n+":"+String(r).padStart(2,"0"),e){i+="."+Math.floor(t%1*10)}return i}}n.default_configuration={ProviderIdentifier:"RetoldRemote-FormattingUtilities",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=n},{"pict-provider":55}],124:[function(t,e,i){const o=t("pict-provider"),n=t("../RetoldRemote-ExtensionMaps.js");class r extends o{constructor(t,e,i){super(t,e,i)}applyFilterSort(){let t=this.pict.AppData.RetoldRemote;if(!t)return;let e=(t.RawFileList||[]).slice();e=this._applySearch(e,t.SearchQuery);let i=t.FilterState||{};e=this._applyMediaTypeFilter(e,i.MediaType||"all"),e=this._applyExtensionFilter(e,i.Extensions||[]),e=this._applySizeFilter(e,i.SizeMin,i.SizeMax),e=this._applyDateFilter(e,i),e=this._sortItems(e,t.SortField||"folder-first",t.SortDirection||"asc"),t.GalleryItems=e;let o=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",n=t.FolderCursorHistory&&t.FolderCursorHistory[o];"number"==typeof n&&n<e.length?t.GalleryCursorIndex=n:t.GalleryCursorIndex=0;let r=this.pict.views["RetoldRemote-Gallery"];r&&r.renderGallery()}_applySearch(t,e){if(!e)return t;let i=this.pict.AppData.RetoldRemote,o=i.SearchCaseSensitive||!1;if(i.SearchRegex||!1){let n;try{n=new RegExp(e,o?"":"i")}catch(e){return i._searchRegexError=e.message,t}return i._searchRegexError=null,t.filter(t=>n.test(t.Name))}if(i._searchRegexError=null,o)return t.filter(t=>t.Name.includes(e));let n=e.toLowerCase();return t.filter(t=>t.Name.toLowerCase().includes(n))}_applyMediaTypeFilter(t,e){return"all"===e?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let i=this.getCategory((t.Extension||"").toLowerCase());return"images"===e?"image"===i:"video"===e?"video"===i:"audio"===e?"audio"===i:"documents"!==e||"document"===i})}_applyExtensionFilter(t,e){if(!e||0===e.length)return t;let i={};for(let t=0;t<e.length;t++)i[e[t].toLowerCase()]=!0;return t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let e=(t.Extension||"").replace(/^\./,"").toLowerCase();return!0===i[e]})}_applySizeFilter(t,e,i){return null===e&&null===i?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let o=t.Size||0;return!(null!==e&&o<e)&&!(null!==i&&o>i)})}_applyDateFilter(t,e){let i=e.DateModifiedAfter?new Date(e.DateModifiedAfter).getTime():null,o=e.DateModifiedBefore?new Date(e.DateModifiedBefore+"T23:59:59").getTime():null,n=e.DateCreatedAfter?new Date(e.DateCreatedAfter).getTime():null,r=e.DateCreatedBefore?new Date(e.DateCreatedBefore+"T23:59:59").getTime():null;return null===i&&null===o&&null===n&&null===r?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;if(null!==i||null!==o){let e=t.Modified?new Date(t.Modified).getTime():0;if(null!==i&&e<i)return!1;if(null!==o&&e>o)return!1}if(null!==n||null!==r){let e=t.Created?new Date(t.Created).getTime():0;if(null!==n&&e<n)return!1;if(null!==r&&e>r)return!1}return!0})}_sortItems(t,e,i){let o="desc"===i?-1:1;return t.slice().sort((t,i)=>{if("folder-first"===e){let e="folder"===t.Type||"archive"===t.Type,n="folder"===i.Type||"archive"===i.Type;if(e&&!n)return-1;if(!e&&n)return 1;let r=(t.Name||"").toLowerCase(),s=(i.Name||"").toLowerCase();return r<s?-1*o:r>s?1*o:0}if("name"===e){let e=(t.Name||"").toLowerCase(),n=(i.Name||"").toLowerCase();return e<n?-1*o:e>n?1*o:0}if("modified"===e){let e=t.Modified?new Date(t.Modified).getTime():0,n=i.Modified?new Date(i.Modified).getTime():0;if(e!==n)return(e-n)*o;let r=(t.Name||"").toLowerCase(),s=(i.Name||"").toLowerCase();return r<s?-1:r>s?1:0}if("created"===e){let e=t.Created?new Date(t.Created).getTime():0,n=i.Created?new Date(i.Created).getTime():0;if(e!==n)return(e-n)*o;let r=(t.Name||"").toLowerCase(),s=(i.Name||"").toLowerCase();return r<s?-1:r>s?1:0}return 0})}getCategory(t){return n.getCategory(t)}getAvailableExtensions(){let t=this.pict.AppData.RetoldRemote,e=t?t.RawFileList:[],i={};for(let t=0;t<e.length;t++){let o=e[t];if("folder"===o.Type||"archive"===o.Type)continue;let n=(o.Extension||"").replace(/^\./,"").toLowerCase();n&&(i[n]||(i[n]={ext:n,category:this.getCategory(n),count:0}),i[n].count++)}let o={image:0,video:1,audio:2,document:3,other:4},n=Object.values(i);return n.sort((t,e)=>{let i=o[t.category]||99,n=o[e.category]||99;return i!==n?i-n:t.ext<e.ext?-1:t.ext>e.ext?1:0}),n}getActiveFilterChips(){let t=this.pict.AppData.RetoldRemote;if(!t)return[];let e=[],i=t.FilterState||{};if(i.MediaType&&"all"!==i.MediaType){let t={images:"Images",video:"Video",audio:"Audio",documents:"Docs"};e.push({key:"mediaType",label:t[i.MediaType]||i.MediaType})}let o=i.Extensions||[];if(o.length>0)for(let t=0;t<o.length;t++)e.push({key:"ext:"+o[t],label:"."+o[t]});if(null!==i.SizeMin&&void 0!==i.SizeMin&&e.push({key:"sizeMin",label:"≥ "+this._formatSizeKB(i.SizeMin)}),null!==i.SizeMax&&void 0!==i.SizeMax&&e.push({key:"sizeMax",label:"≤ "+this._formatSizeKB(i.SizeMax)}),i.DateModifiedAfter&&e.push({key:"dateModifiedAfter",label:"Modified after "+i.DateModifiedAfter}),i.DateModifiedBefore&&e.push({key:"dateModifiedBefore",label:"Modified before "+i.DateModifiedBefore}),i.DateCreatedAfter&&e.push({key:"dateCreatedAfter",label:"Created after "+i.DateCreatedAfter}),i.DateCreatedBefore&&e.push({key:"dateCreatedBefore",label:"Created before "+i.DateCreatedBefore}),t.SearchQuery){let i='Search: "'+t.SearchQuery+'"',o=[];t.SearchCaseSensitive&&o.push("Aa"),t.SearchRegex&&o.push(".*"),o.length>0&&(i+=" ["+o.join(", ")+"]"),e.push({key:"search",label:i})}return e}_formatSizeKB(t){return t>=1048576?(t/1048576).toFixed(1)+" MB":Math.round(t/1024)+" KB"}removeFilter(t){let e=this.pict.AppData.RetoldRemote;if(!e)return;let i=e.FilterState;if("mediaType"===t)i.MediaType="all",e.GalleryFilter="all";else if(t.startsWith("ext:")){let e=t.substring(4);i.Extensions=(i.Extensions||[]).filter(t=>t!==e)}else"sizeMin"===t?i.SizeMin=null:"sizeMax"===t?i.SizeMax=null:"dateModifiedAfter"===t?i.DateModifiedAfter=null:"dateModifiedBefore"===t?i.DateModifiedBefore=null:"dateCreatedAfter"===t?i.DateCreatedAfter=null:"dateCreatedBefore"===t?i.DateCreatedBefore=null:"search"===t&&(e.SearchQuery="",e._searchRegexError=null)}clearAllFilters(){let t=this.pict.AppData.RetoldRemote;t&&(t.SearchQuery="",t.SearchCaseSensitive=!1,t.SearchRegex=!1,t._searchRegexError=null,t.GalleryFilter="all",t.FilterState={MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null})}savePreset(t){if(!t)return;let e=this.pict.AppData.RetoldRemote;if(!e)return;let i={Name:t,FilterState:JSON.parse(JSON.stringify(e.FilterState)),SortField:e.SortField,SortDirection:e.SortDirection};e.FilterPresets=e.FilterPresets||[],e.FilterPresets.push(i)}loadPreset(t){let e=this.pict.AppData.RetoldRemote;if(!e||!e.FilterPresets)return;let i=e.FilterPresets[t];i&&(e.FilterState=JSON.parse(JSON.stringify(i.FilterState)),e.GalleryFilter=e.FilterState.MediaType||"all",e.SortField=i.SortField||"folder-first",e.SortDirection=i.SortDirection||"asc")}deletePreset(t){let e=this.pict.AppData.RetoldRemote;e&&e.FilterPresets&&e.FilterPresets.splice(t,1)}}r.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryFilterSort",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!1},e.exports=r},{"../RetoldRemote-ExtensionMaps.js":117,"pict-provider":55}],125:[function(t,e,i){const o=t("pict-provider"),n=t("./keyboard-handlers/KeyHandler-Gallery.js"),r=t("./keyboard-handlers/KeyHandler-Viewer.js"),s=t("./keyboard-handlers/KeyHandler-Sidebar.js"),a=t("./keyboard-handlers/KeyHandler-VideoExplorer.js"),l=t("./keyboard-handlers/KeyHandler-AudioExplorer.js"),d=t("./keyboard-handlers/KeyHandler-ImageExplorer.js");class c extends o{constructor(t,e,i){super(t,e,i),this._columnsPerRow=4,this._keydownBound=!1,this._helpPanelVisible=!1,this._sidebarFocused=!1,this._sidebarCursorIndex=0}recalculateColumns(){if("list"===this.pict.AppData.RetoldRemote.ViewMode)return void(this._columnsPerRow=1);let t=document.querySelectorAll(".retold-remote-tile");if(t.length<2)return void(this._columnsPerRow=Math.max(1,t.length));let e=t[0].offsetTop,i=1;for(let o=1;o<t.length&&t[o].offsetTop===e;o++)i++;this._columnsPerRow=i}bindKeyboardNavigation(){if(this._keydownBound)return;let t=this;this._keydownHandler=function(e){if("F1"===e.key)return e.preventDefault(),void t._toggleHelpPanel();if("F9"===e.key)return e.preventDefault(),void(t._sidebarFocused?t._blurSidebar():t._focusSidebar());if("/"===e.key){let i=document.getElementById("RetoldRemote-Gallery-Search");if(e.target===i)return e.preventDefault(),t._hideFilterBar(),void i.blur();if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;return e.preventDefault(),void t._toggleFilterBar()}if("Escape"===e.key&&"RetoldRemote-Gallery-Search"===e.target.id)return e.preventDefault(),e.target.blur(),void t._hideFilterBar();if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;if(t._helpPanelVisible&&"Escape"===e.key)return e.preventDefault(),void t._toggleHelpPanel();let i=t.pict.AppData.RetoldRemote.ActiveMode;"gallery"===i&&t._sidebarFocused?t._handleSidebarKey(e):"gallery"===i?t._handleGalleryKey(e):"video-explorer"===i?t._handleVideoExplorerKey(e):"audio-explorer"===i?t._handleAudioExplorerKey(e):"image-explorer"===i?t._handleImageExplorerKey(e):"viewer"===i&&t._handleViewerKey(e)},document.addEventListener("keydown",this._keydownHandler),this._keydownBound=!0,this._setupDFSwipeGestures()}_setupDFSwipeGestures(){if(this._dfSwipeBound)return;let t=this,e=0,i=0,o=0,n=0;this._dfSwipeTouchStart=function(t){n=t.touches.length,1===n&&(i=t.touches[0].clientX,e=t.touches[0].clientY,o=e)},this._dfSwipeTouchEnd=function(r){if(1!==n)return;let s=r.changedTouches[0].clientX,a=r.changedTouches[0].clientY,l=s-i,d=a-e;if(Math.abs(d)<60||Math.abs(l)>Math.abs(d))return;let c=t.pict.AppData.RetoldRemote._distractionFreeMode||!1;(!c&&d<0&&o<=60||c&&d>0&&o<=40)&&t._toggleDistractionFree()},document.addEventListener("touchstart",this._dfSwipeTouchStart,{passive:!0}),document.addEventListener("touchend",this._dfSwipeTouchEnd,{passive:!0}),this._dfSwipeBound=!0}_handleGalleryKey(t){n(this,t)}_handleSidebarKey(t){s(this,t)}_focusSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t||t.classList.contains("collapsed"))return;this._sidebarFocused=!0,this._sidebarCursorIndex=0;let e=document.querySelector(".content-editor-sidebar-inner");e&&e.classList.add("keyboard-focused"),this._moveSidebarCursor(0)}_blurSidebar(){this._sidebarFocused=!1;let t=document.querySelector(".content-editor-sidebar-inner");t&&t.classList.remove("keyboard-focused");let e=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row");for(let t=0;t<e.length;t++)e[t].classList.remove("sidebar-focused")}_moveSidebarCursor(t){let e=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row");0!==e.length&&(this._sidebarCursorIndex<e.length&&e[this._sidebarCursorIndex].classList.remove("sidebar-focused"),this._sidebarCursorIndex=t,t<e.length&&(e[t].classList.add("sidebar-focused"),e[t].scrollIntoView({block:"nearest",behavior:"smooth"})))}_handleViewerKey(t){r(this,t)}_handleVideoExplorerKey(t){a(this,t)}_handleAudioExplorerKey(t){l(this,t)}_handleImageExplorerKey(t){d(this,t)}moveCursor(t){let e=this.pict.AppData.RetoldRemote,i=e.GalleryCursorIndex||0;if(t===i)return;e.GalleryCursorIndex=t;let o=document.querySelector(`.retold-remote-tile[data-index="${i}"], .retold-remote-list-row[data-index="${i}"]`),n=document.querySelector(`.retold-remote-tile[data-index="${t}"], .retold-remote-list-row[data-index="${t}"]`);o&&o.classList.remove("selected"),n&&(n.classList.add("selected"),n.scrollIntoView({block:"nearest",behavior:"smooth"}));let r=this.pict.views["ContentEditor-TopBar"];r&&r.updateInfo()}openCurrent(){let t=this.pict.AppData.RetoldRemote,e=t.GalleryItems||[],i=t.GalleryCursorIndex||0;if(i>=e.length)return;let o=e[i];if("folder"===o.Type||"archive"===o.Type){let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";t.FolderCursorHistory[e]=i;let n=this.pict.PictApplication;n&&n.loadFileList&&n.loadFileList(o.Path)}else{let t=this.pict.PictApplication;t&&t.navigateToFile&&t.navigateToFile(o.Path)}}openCurrentAs(t){let e=this.pict.AppData.RetoldRemote,i=e.GalleryItems||[],o=e.GalleryCursorIndex||0;if(o>=i.length)return;let n=i[o];if("folder"===n.Type||"archive"===n.Type)return;let r=this.pict.PictApplication;r&&r.navigateToFileAs&&r.navigateToFileAs(n.Path,t)}switchViewerType(t){let e=this.pict.AppData.RetoldRemote.CurrentViewerFile;if(!e)return;let i=this.pict.views["RetoldRemote-MediaViewer"];i&&i.showMedia(e,t)}navigateUp(){let t=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!t)return;let e=this.pict.AppData.RetoldRemote;e.FolderCursorHistory[t]=e.GalleryCursorIndex||0;let i=t.indexOf("/")>=0?t.replace(/\/[^/]+\/?$/,""):"",o=this.pict.PictApplication;o&&o.loadFileList&&o.loadFileList(i)}closeViewer(){let t=this.pict.AppData.RetoldRemote;t.ActiveMode="gallery",t.CurrentViewerFile="",t.CurrentViewerMediaType="",t.BrowsingCollection=!1,t.BrowsingCollectionIndex=-1;let e=document.getElementById("RetoldRemote-Gallery-Container"),i=document.getElementById("RetoldRemote-Viewer-Container"),o=document.querySelector("#RetoldRemote-Viewer-Container video"),n=document.querySelector("#RetoldRemote-Viewer-Container audio");o&&(o.pause(),o.removeAttribute("src"),o.load()),n&&(n.pause(),n.removeAttribute("src"),n.load()),e&&(e.style.display=""),i&&(i.style.display="none");let r=this.pict.views["RetoldRemote-MediaViewer"];r&&(r._cleanupSwipe&&r._cleanupSwipe(),r._cleanupDFExitHotspot&&r._cleanupDFExitHotspot());let s=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",a=this.pict.providers["RetoldRemote-Provider"],l=a&&s?a.getFragmentIdentifier(s):s;window.location.hash=l?"#/browse/"+l:"#/browse/";let d=this.pict.views["RetoldRemote-Gallery"];d&&d.renderGallery()}_navigateToCollectionItem(t,e){let i=this.pict.AppData.RetoldRemote;if(i.BrowsingCollection=!0,i.BrowsingCollectionIndex=e,"video-clip"===t.Type){let e=this.pict.views["RetoldRemote-VideoExplorer"];e&&e.showExplorer(t.Path,t.VideoStart,t.VideoEnd)}else if("audio-clip"===t.Type){let e=this.pict.views["RetoldRemote-AudioExplorer"];e&&e.showExplorer(t.Path,t.AudioStart,t.AudioEnd)}else if("video-frame"===t.Type&&t.FrameCacheKey&&t.FrameFilename){let e="/api/media/video-frame/"+encodeURIComponent(t.FrameCacheKey)+"/"+encodeURIComponent(t.FrameFilename),i=this.pict.views["RetoldRemote-MediaViewer"];i&&i.showDirectImage(e,t.Label||t.FrameFilename,t.Path)}else{let e=this.pict.PictApplication;e&&e.navigateToFile&&e.navigateToFile(t.Path)}}nextFile(){let t=this.pict.AppData.RetoldRemote;if(t.BrowsingCollection&&t.ActiveCollection){let e=t.ActiveCollection.Items||[];for(let i=t.BrowsingCollectionIndex+1;i<e.length;i++){let t=e[i];if("file"===t.Type||"subfile"===t.Type||"image-crop"===t.Type||"video-clip"===t.Type||"video-frame"===t.Type)return void this._navigateToCollectionItem(t,i)}return}let e=t.GalleryItems||[];for(let i=(t.GalleryCursorIndex||0)+1;i<e.length;i++)if("file"===e[i].Type){t.GalleryCursorIndex=i;let o=this.pict.PictApplication;return void(o&&o.navigateToFile&&o.navigateToFile(e[i].Path))}}prevFile(){let t=this.pict.AppData.RetoldRemote;if(t.BrowsingCollection&&t.ActiveCollection){let e=t.ActiveCollection.Items||[];for(let i=t.BrowsingCollectionIndex-1;i>=0;i--){let t=e[i];if("file"===t.Type||"subfile"===t.Type||"image-crop"===t.Type||"video-clip"===t.Type||"video-frame"===t.Type)return void this._navigateToCollectionItem(t,i)}return}let e=t.GalleryItems||[];for(let i=(t.GalleryCursorIndex||0)-1;i>=0;i--)if("file"===e[i].Type){t.GalleryCursorIndex=i;let o=this.pict.PictApplication;return void(o&&o.navigateToFile&&o.navigateToFile(e[i].Path))}}_toggleViewMode(){let t=this.pict.AppData.RetoldRemote;t.ViewMode="gallery"===t.ViewMode?"list":"gallery";let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery();let i=this.pict.PictApplication;i&&"function"==typeof i.saveSettings&&i.saveSettings()}_focusSearch(){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()}_toggleFilterBar(){this.pict.AppData.RetoldRemote.FilterBarVisible?this._hideFilterBar():this._showFilterBar()}_showFilterBar(){let t=this.pict.AppData.RetoldRemote;if(t.FilterBarVisible){let t=document.getElementById("RetoldRemote-Gallery-Search");return void(t&&t.focus())}t.FilterBarVisible=!0;let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}_hideFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!1,t.FilterPanelOpen=!1;let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery()}_clearAllFilters(){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.clearAllFilters(),this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Filters cleared")}_toggleHelpPanel(){let t=document.getElementById("RetoldRemote-Help-Panel");if(t)return t.remove(),void(this._helpPanelVisible=!1);this._helpPanelVisible=!0;let e=document.createElement("div");e.id="RetoldRemote-Help-Panel",e.innerHTML=this._buildHelpPanelHTML(),(document.fullscreenElement||document.body).appendChild(e)}_buildHelpPanelHTML(){let t=this.pict.AppData.RetoldRemote.ActiveMode||"gallery",e='<div class="retold-remote-help-backdrop" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">';e+='<div class="retold-remote-help-flyout" onclick="event.stopPropagation()">',e+='<div class="retold-remote-help-header">',e+='<span class="retold-remote-help-title">Keyboard Shortcuts</span>',e+='<button class="retold-remote-help-close" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">×</button>',e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Gallery / File List</div>';let i=[["← → ↑ ↓","Navigate tiles"],["Enter","Open selected item"],["Escape","Go up one folder"],["F9","Toggle sidebar focus"],["Home / End","Jump to first / last"],["g","Toggle gallery / list view"],["/","Toggle filter bar & search"],["f","Toggle advanced filter panel"],["s","Focus sort dropdown"],["x","Clear all filters"],["c","Settings / config panel"],["d","Distraction-free mode"],["e","Video explorer (on video files)"]];for(let t=0;t<i.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+i[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+i[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Sidebar (F9 to focus)</div>';let o=[["↑ / ↓","Navigate file list"],["Enter","Open selected item"],["Home / End","Jump to first / last"],["Escape / F9","Return to gallery"]];for(let t=0;t<o.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+o[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+o[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Media Viewer</div>';let n=[["← / k","Previous file"],["→ / j","Next file"],["Escape","Back to gallery"],["f","Toggle fullscreen"],["i","Toggle file info"],["Space","Play / pause media"],["Enter","Open video in VLC"],["z","Cycle fit mode"],["+ / -","Zoom in / out"],["0","Reset zoom"],["d","Distraction-free mode"]];for(let t=0;t<n.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+n[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+n[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Global</div>';let r=[["F1","Toggle this help panel"],["F9","Toggle sidebar focus"],["Escape","Close help panel"]];for(let t=0;t<r.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+r[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+r[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-row" style="justify-content: center; padding: 8px 0;">',e+='<a href="docs.html" target="_blank" style="color: var(--retold-accent, #569cd6); text-decoration: none; font-size: 0.9rem; cursor: pointer;">',e+="View Documentation ↗</a>",e+="</div>",e+="</div>",e+='<div class="retold-remote-help-footer">';let s="Gallery";return"viewer"===t?s="Media Viewer":"video-explorer"===t?s="Video Explorer":"audio-explorer"===t&&(s="Audio Explorer"),e+="Current mode: <strong>"+s+"</strong>",e+="</div>",e+="</div>",e+="</div>",e}_toggleSettingsPanel(){let t=this.pict.views["ContentEditor-Layout"];if(!t)return;let e=document.querySelector(".content-editor-sidebar-wrap");if(!e)return;let i=e.classList.contains("collapsed"),o=document.querySelector('.content-editor-sidebar-tab[data-tab="settings"]'),n=o&&o.classList.contains("active");i?(t.toggleSidebar(),t.switchSidebarTab("settings")):n?t.switchSidebarTab("files"):t.switchSidebarTab("settings")}_toggleFilterPresets(){let t=this.pict.AppData.RetoldRemote,e=this.pict.views["RetoldRemote-Gallery"];"gallery"===t.ActiveMode&&(!t.FilterPanelOpen&&e&&e.toggleFilterPanel(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(t)t.focus(),t.click();else{let t=document.getElementById("RetoldRemote-Filter-PresetName");t&&t.focus()}},50))}_toggleDistractionFree(){let t=this.pict.AppData.RetoldRemote,e=document.getElementById("ContentEditor-TopBar-Container"),i=document.querySelector(".content-editor-sidebar-wrap");if(!e||!i)return;if(t._distractionFreeMode||!1){e.style.display="",i.style.display="",t._distractionFreeMode=!1;let o=document.querySelector(".retold-remote-viewer-header");if(o&&(o.style.display=""),t._collectionsPanelWasOpen){let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px")),t.CollectionsPanelOpen=!0,t._collectionsPanelWasOpen=!1}}else{if(e.style.display="none",i.style.display="none",t._distractionFreeMode=!0,!t.DistractionFreeShowNav){let t=document.querySelector(".retold-remote-viewer-header");t&&(t.style.display="none")}if(t.CollectionsPanelOpen){t._collectionsPanelWasOpen=!0;let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&e.classList.add("collapsed"),t.CollectionsPanelOpen=!1}}let o=this.pict.views["RetoldRemote-MediaViewer"];o&&o._updateDFControls&&o._updateDFControls(),setTimeout(()=>this.recalculateColumns(),100)}_toggleFullscreen(){if(document.fullscreenElement)return void document.exitFullscreen();if("video"===this.pict.AppData.RetoldRemote.CurrentViewerMediaType){let t=document.getElementById("RetoldRemote-VideoPlayer");if(t)return void t.requestFullscreen()}let t=document.getElementById("RetoldRemote-Viewer-Container");t&&t.requestFullscreen()}_toggleFileInfo(){let t=document.getElementById("RetoldRemote-FileInfo-Overlay");if(t){let e="none"===window.getComputedStyle(t).display;t.style.display=e?"block":"none"}}_togglePlayPause(){let t=document.querySelector("#RetoldRemote-Viewer-Container video"),e=document.querySelector("#RetoldRemote-Viewer-Container audio"),i=t||e;i&&(i.paused?i.play():i.pause())}_zoomIn(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomIn&&t.zoomIn()}_zoomOut(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomOut&&t.zoomOut()}_zoomReset(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomReset&&t.zoomReset()}_cycleFitMode(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.cycleFitMode&&t.cycleFitMode()}_openWithVLC(){let t=this.pict.AppData.RetoldRemote;if("video"!==t.CurrentViewerMediaType)return;if(!(t.ServerCapabilities||{}).vlc)return;let e=t.CurrentViewerFile;e&&(this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Opening in VLC..."),fetch("/api/media/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}).then(t=>t.json()).then(t=>{t.Success||this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Failed to open: "+(t.Error||"Unknown error"))}).catch(t=>{this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Failed to open: "+t.message)}))}_streamWithVLC(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerMediaType;if("video"!==e&&"audio"!==e)return;let i=t.CurrentViewerFile;if(!i)return;let o,n=this.pict.providers["RetoldRemote-Provider"],r=n?n.getContentURL(i):"/content/"+encodeURIComponent(i),s=window.location.origin+r,a=(/Windows/.test(navigator.userAgent),/iPhone|iPad|iPod/i.test(navigator.userAgent)||/Macintosh/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1),l=/Android/i.test(navigator.userAgent);if(o=a?"vlc-x-callback://x-callback-url/stream?url="+encodeURIComponent(s):l?"vlc://"+s:"vlc://"+encodeURIComponent(s),this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Opening VLC..."),a)window.location.href=o;else{let t=document.createElement("a");t.href=o,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}}}c.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryNavigation",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=c},{"./keyboard-handlers/KeyHandler-AudioExplorer.js":131,"./keyboard-handlers/KeyHandler-Gallery.js":132,"./keyboard-handlers/KeyHandler-ImageExplorer.js":133,"./keyboard-handlers/KeyHandler-Sidebar.js":134,"./keyboard-handlers/KeyHandler-VideoExplorer.js":135,"./keyboard-handlers/KeyHandler-Viewer.js":136,"pict-provider":55}],126:[function(t,e,i){const o=t("pict-provider"),n=t("../RetoldRemote-ExtensionMaps.js");class r extends o{constructor(t,e,i){super(t,e,i),this._pathToHash={},this._hashToPath={}}fetchCapabilities(t){fetch("/api/media/capabilities").then(t=>t.json()).then(e=>e&&e.Capabilities?t(null,e.Capabilities):t(null,{})).catch(e=>t(e))}fetchRemoteSettings(t){fetch("/api/remote/settings").then(t=>t.json()).then(e=>t(null,e||{})).catch(e=>t(e))}registerHash(t,e){t&&e&&(this._pathToHash[t]=e,this._hashToPath[e]=t)}getHashForPath(t){return this._pathToHash[t]||null}getPathForHash(t){return this._hashToPath[t]||null}_getPathParam(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return e}return encodeURIComponent(t)}getFragmentIdentifier(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return e}return t}resolveFragmentIdentifier(t){if(t&&/^[a-f0-9]{10}$/.test(t)){let e=this.getPathForHash(t);if(null!==e)return e}return t}getContentURL(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return"/content-hashed/"+e}return"/content/"+t.split("/").map(t=>encodeURIComponent(t)).join("/")}getThumbnailURL(t,e,i){let o=this.pict.AppData.RetoldRemote.ServerCapabilities,n=t.replace(/^.*\./,"").toLowerCase(),r=this._isImageExtension(n);return o&&(o.sharp||o.imagemagick)?"/api/media/thumbnail?path="+this._getPathParam(t)+"&width="+(e||200)+"&height="+(i||200):r?this.getContentURL(t):null}fetchMediaProbe(t,e){fetch("/api/media/probe?path="+this._getPathParam(t)).then(t=>t.json()).then(t=>{t&&t.Hash&&t.Path&&this.registerHash(t.Path,t.Hash),e(null,t)}).catch(t=>e(t))}fetchFolderSummary(t,e){let i="/api/media/folder-summary";t&&(i+="?path="+this._getPathParam(t)),fetch(i).then(t=>t.json()).then(t=>e(null,t)).catch(t=>e(t))}_isImageExtension(t){return"image"===n.getCategory(t)}}r.default_configuration={ProviderIdentifier:"RetoldRemote-Provider",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=r},{"../RetoldRemote-ExtensionMaps.js":117,"pict-provider":55}],127:[function(t,e,i){const o=t("pict-provider"),n={Primary:"#C0C0DD",Accent:"#66C2B8",Muted:"#6A6A8A",Light:"#2A2A4A",WarmBeige:"#2E2E4E",TealTint:"#1E3A3A",Lavender:"#2A2A48",AmberTint:"#3A3028",PdfFill:"#3A2028",PdfText:"#E06060"};let r;try{r=t("pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js").ExtensionMap}catch(t){r={}}const s=Object.keys(r).length>0?r:{".jpg":"file-image",".jpeg":"file-image",".png":"file-image",".gif":"file-image",".svg":"file-image",".webp":"file-image",".bmp":"file-image",".ico":"file-image",".tiff":"file-image",".tif":"file-image",".heic":"file-image",".heif":"file-image",".avif":"file-image",".raw":"file-image",".dng":"file-image",".nef":"file-image",".nrw":"file-image",".cr2":"file-image",".cr3":"file-image",".crw":"file-image",".arw":"file-image",".srf":"file-image",".sr2":"file-image",".raf":"file-image",".orf":"file-image",".rw2":"file-image",".rwl":"file-image",".pef":"file-image",".srw":"file-image",".x3f":"file-image",".3fr":"file-image",".fff":"file-image",".iiq":"file-image",".dcr":"file-image",".kdc":"file-image",".mrw":"file-image",".erf":"file-image",".txt":"file-text",".md":"file-text",".rtf":"file-text",".doc":"file-text",".docx":"file-text",".pdf":"file-pdf",".xls":"file-spreadsheet",".xlsx":"file-spreadsheet",".csv":"file-spreadsheet",".ods":"file-spreadsheet",".js":"file-code",".ts":"file-code",".jsx":"file-code",".tsx":"file-code",".py":"file-code",".rb":"file-code",".java":"file-code",".c":"file-code",".cpp":"file-code",".h":"file-code",".go":"file-code",".rs":"file-code",".swift":"file-code",".kt":"file-code",".scala":"file-code",".sh":"file-code",".bash":"file-code",".zsh":"file-code",".php":"file-code",".lua":"file-code",".r":"file-code",".sql":"file-code",".pl":"file-code",".html":"file-web",".htm":"file-web",".css":"file-web",".scss":"file-web",".less":"file-web",".xml":"file-web",".json":"file-config",".yaml":"file-config",".yml":"file-config",".toml":"file-config",".ini":"file-config",".env":"file-config",".conf":"file-config",".cfg":"file-config",".zip":"file-archive",".tar":"file-archive",".gz":"file-archive",".rar":"file-archive",".7z":"file-archive",".bz2":"file-archive",".xz":"file-archive",".tgz":"file-archive",".cbz":"file-archive",".cbr":"file-archive",".mp3":"file-audio",".wav":"file-audio",".flac":"file-audio",".ogg":"file-audio",".aac":"file-audio",".wma":"file-audio",".m4a":"file-audio",".opus":"file-audio",".aiff":"file-audio",".mp4":"file-video",".avi":"file-video",".mov":"file-video",".mkv":"file-video",".webm":"file-video",".wmv":"file-video",".flv":"file-video",".m4v":"file-video",".ogv":"file-video",".mpg":"file-video",".mpeg":"file-video",".mpe":"file-video",".mpv":"file-video",".m2v":"file-video",".ts":"file-video",".mts":"file-video",".m2ts":"file-video",".vob":"file-video",".3gp":"file-video",".3g2":"file-video",".f4v":"file-video",".rm":"file-video",".rmvb":"file-video",".divx":"file-video",".asf":"file-video",".mxf":"file-video",".dv":"file-video",".nsv":"file-video",".nuv":"file-video",".y4m":"file-video",".wtv":"file-video",".swf":"file-video",".dat":"file-video",".epub":"file-text",".mobi":"file-text"};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._colors=Object.assign({},n),this._icons=this._buildIconSet(),this._customIcons={},this._extensionMap=Object.assign({},s),this._cssInjected=!1}_buildIconSet(){let t=this;return{folder:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+i.WarmBeige+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 9H20.8" stroke="'+i.Primary+'" stroke-width="1" opacity="0.3" /></svg>'},"folder-open":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+i.WarmBeige+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 10.2L5.8 17.8C6 18.4 6.6 18.9 7.2 18.9H19.8L22.1 11.2C22.3 10.6 21.8 10 21.2 10H5.2C4.6 10 4 10.4 3.8 11" stroke="'+i.Primary+'" stroke-width="1.5" fill="'+i.Light+'" stroke-linecap="round" stroke-linejoin="round" opacity="0.7" /></svg>'},file:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-text":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="12.8" x2="15.9" y2="12.8" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="15.8" x2="15.9" y2="15.8" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="18.8" x2="12.2" y2="18.8" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-code":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M8.5 13.2L6.8 15.1L8.6 16.8" stroke="'+i.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><path d="M15.5 13.2L17.2 15.1L15.4 16.8" stroke="'+i.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><line x1="12.8" y1="12" x2="11.2" y2="18" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-image":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3.1" y="3.2" width="17.8" height="17.7" rx="2" fill="'+i.Lavender+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="8.3" cy="8.7" r="1.8" fill="'+i.Accent+'" /><path d="M20.8 15.2L15.9 10.1L5.2 20.8" stroke="'+i.Primary+'" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-pdf":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.PdfFill+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><text x="8.2" y="16.8" font-family="sans-serif" font-weight="700" font-size="6.5" fill="'+i.PdfText+'" letter-spacing="-0.3">PDF</text></svg>'},"file-spreadsheet":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.TealTint+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="7.2" y="11.1" width="9.8" height="7.8" rx="0.5" fill="none" stroke="'+i.Accent+'" stroke-width="1.2" /><line x1="7.2" y1="13.7" x2="17" y2="13.7" stroke="'+i.Accent+'" stroke-width="1" /><line x1="7.2" y1="16.3" x2="17" y2="16.3" stroke="'+i.Accent+'" stroke-width="1" /><line x1="10.9" y1="11.1" x2="10.9" y2="18.9" stroke="'+i.Accent+'" stroke-width="1" /></svg>'},"file-archive":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.WarmBeige+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="8.8" y="11.2" width="2.5" height="2" rx="0.4" fill="'+i.Primary+'" /><rect x="8.8" y="14.2" width="2.5" height="2" rx="0.4" fill="'+i.Primary+'" /><rect x="8.8" y="17.2" width="2.5" height="2" rx="0.4" fill="'+i.Primary+'" /></svg>'},"file-audio":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.AmberTint+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="10.2" cy="16.8" r="2.1" fill="none" stroke="'+i.Accent+'" stroke-width="1.5" /><path d="M12.2 16.8V11.2L16.1 10.1" stroke="'+i.Accent+'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="15.3" r="1.4" fill="none" stroke="'+i.Accent+'" stroke-width="1.2" /></svg>'},"file-video":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Lavender+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M9.8 12.2V18.2L15.8 15.2L9.8 12.2Z" fill="'+i.Accent+'" stroke="'+i.Accent+'" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-web":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.9" fill="'+i.TealTint+'" stroke="'+i.Primary+'" stroke-width="1.8" /><ellipse cx="12" cy="12" rx="4.1" ry="8.9" fill="none" stroke="'+i.Primary+'" stroke-width="1.2" /><line x1="3.1" y1="12" x2="20.9" y2="12" stroke="'+i.Primary+'" stroke-width="1" /><path d="M4.8 7.8C7 8.5 9.4 8.9 12 8.9C14.6 8.9 17 8.5 19.2 7.8" stroke="'+i.Primary+'" stroke-width="1" fill="none" /><path d="M4.8 16.2C7 15.5 9.4 15.1 12 15.1C14.6 15.1 17 15.5 19.2 16.2" stroke="'+i.Primary+'" stroke-width="1" fill="none" /></svg>'},"file-config":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="12" cy="15" r="2.8" fill="none" stroke="'+i.Muted+'" stroke-width="1.5" /><line x1="12" y1="11" x2="12" y2="12.2" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="12" y1="17.8" x2="12" y2="19" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="13.2" x2="15.8" y2="12.6" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="17" x2="9.2" y2="16.4" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="16.8" x2="15.8" y2="17.4" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="13" x2="9.2" y2="13.6" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /></svg>'},home:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.1 9.6L12 3.1L20.9 9.6V19.9C20.9 20.5 20.5 21 19.9 20.9H4.1C3.5 21 3 20.5 3.1 19.9V9.6Z" fill="'+i.TealTint+'" stroke="'+i.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="9.2" y="14.1" width="5.6" height="6.9" rx="0.5" fill="'+i.Accent+'" /></svg>'},"arrow-up":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12.1 19.1V5.1" stroke="'+i.Muted+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M5.2 11.9L12.1 5.1L18.9 11.9" stroke="'+i.Muted+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"chevron-right":e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M9.2 6.1L14.8 12.1L9.1 17.9" stroke="'+t._colors.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-down":e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6.1 9.2L12.1 14.8L17.9 9.1" stroke="'+t._colors.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',search:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="10.8" cy="10.8" r="6.8" stroke="'+i.Primary+'" stroke-width="1.8" /><line x1="15.9" y1="16.1" x2="20.8" y2="20.8" stroke="'+i.Primary+'" stroke-width="2" stroke-linecap="round" /></svg>'},"sort-asc":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+i.Primary+'" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+i.Muted+'" opacity="0.35" /></svg>'},"sort-desc":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+i.Muted+'" opacity="0.35" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+i.Primary+'" /></svg>'},sidebar:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="2" stroke="'+i.Primary+'" stroke-width="1.8" fill="none" /><line x1="9" y1="3" x2="9" y2="21" stroke="'+i.Primary+'" stroke-width="1.8" /><line x1="5" y1="7.5" x2="7.5" y2="7.5" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="5" y1="10.5" x2="7.5" y2="10.5" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="5" y1="13.5" x2="7.5" y2="13.5" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"music-note":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="8.2" cy="17.8" r="3.1" fill="'+i.AmberTint+'" stroke="'+i.Accent+'" stroke-width="1.8" /><path d="M11.2 17.8V5.2L19.1 3.1V14.8" stroke="'+i.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="14.8" r="2.4" fill="'+i.AmberTint+'" stroke="'+i.Accent+'" stroke-width="1.5" /></svg>'},"film-strip":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3" y="4" width="18" height="16" rx="2" stroke="'+i.Primary+'" stroke-width="1.8" fill="'+i.Lavender+'" /><path d="M9.5 8.5V15.5L16 12L9.5 8.5Z" fill="'+i.Accent+'" stroke="'+i.Accent+'" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"gallery-empty":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+i.WarmBeige+'" stroke="'+i.Muted+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="9" y1="11" x2="15" y2="17" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /><line x1="15" y1="11" x2="9" y2="17" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /></svg>'},"document-large":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="13" x2="15.9" y2="13" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="16" x2="15.9" y2="16" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="19" x2="12" y2="19" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},bookmark:e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="'+t._colors.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /></svg>',"bookmark-filled":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="'+i.Accent+'" /></svg>'},collection:e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="4" y="8" width="16" height="12" rx="2" stroke="'+i.Primary+'" stroke-width="1.8" fill="'+i.Light+'" /><path d="M7 8V6C7 5.45 7.45 5 8 5H16C16.55 5 17 5.45 17 6V8" stroke="'+i.Primary+'" stroke-width="1.5" fill="none" /><path d="M9 5V3.5C9 3.22 9.22 3 9.5 3H14.5C14.78 3 15 3.22 15 3.5V5" stroke="'+i.Muted+'" stroke-width="1.2" fill="none" /></svg>'},heart:e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" stroke="'+t._colors.Primary+'" stroke-width="1.8" fill="none" /></svg>',"heart-filled":e=>{t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" stroke="#e74c3c" stroke-width="1.8" fill="#e74c3c" /></svg>'},"drag-handle":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="9" cy="7" r="1.5" fill="'+i.Muted+'" /><circle cx="15" cy="7" r="1.5" fill="'+i.Muted+'" /><circle cx="9" cy="12" r="1.5" fill="'+i.Muted+'" /><circle cx="15" cy="12" r="1.5" fill="'+i.Muted+'" /><circle cx="9" cy="17" r="1.5" fill="'+i.Muted+'" /><circle cx="15" cy="17" r="1.5" fill="'+i.Muted+'" /></svg>'}}}getIcon(t,e){let i=e||16,o=this._customIcons[t]||this._icons[t];return"function"==typeof o?o(i):""}getIconForEntry(t,e){if(!t)return"";if(t.Icon&&"string"==typeof t.Icon&&0===t.Icon.indexOf("<svg"))return t.Icon;let i=e||16;if("folder"===t.Type)return this.getIcon("folder",i);let o=(t.Extension||"").toLowerCase();return o&&this._extensionMap[o]?this.getIcon(this._extensionMap[o],i):this.getIcon("file",i)}getUIIcon(t,e){return this.getIcon(t,e||16)}registerIcon(t,e){return!(!t||"function"!=typeof e)&&(this._customIcons[t]=e,!0)}registerExtension(t,e){return!(!t||!e)&&(this._extensionMap[t.toLowerCase()]=e,!0)}setColors(t){t&&"object"==typeof t&&(Object.assign(this._colors,t),this._icons=this._buildIconSet())}getColors(){return Object.assign({},this._colors)}getIconNames(){let t=Object.keys(this._icons),e=Object.keys(this._customIcons);for(let i=0;i<e.length;i++)t.indexOf(e[i])<0&&t.push(e[i]);return t}getExtensionMap(){return Object.assign({},this._extensionMap)}injectCSS(){this._cssInjected||this.pict&&this.pict.CSSMap&&(this.pict.CSSMap.addCSS("RetoldRemoteIcons",".retold-remote-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }\n.retold-remote-icon svg { display: block; }\n.retold-remote-icon-sm svg { width: 16px; height: 16px; }\n.retold-remote-icon-md svg { width: 48px; height: 48px; }\n.retold-remote-icon-lg svg { width: 64px; height: 64px; }\n.retold-remote-icon-xl svg { width: 96px; height: 96px; }\n"),this._cssInjected=!0)}onAfterInitialize(){this.injectCSS();let e=Object.keys(t("../RetoldRemote-ExtensionMaps.js").VideoExtensions);for(let t=0;t<e.length;t++){let i="."+e[t];this._extensionMap[i]||(this._extensionMap[i]="file-video")}let i=Object.keys(t("../RetoldRemote-ExtensionMaps.js").AudioExtensions);for(let t=0;t<i.length;t++){let e="."+i[t];this._extensionMap[e]||(this._extensionMap[e]="file-audio")}let o=Object.keys(t("../RetoldRemote-ExtensionMaps.js").ImageExtensions);for(let t=0;t<o.length;t++){let e="."+o[t];this._extensionMap[e]||(this._extensionMap[e]="file-image")}return super.onAfterInitialize()}},e.exports.default_configuration={ProviderIdentifier:"RetoldRemote-Icons",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.DefaultColors=n},{"../RetoldRemote-ExtensionMaps.js":117,"pict-provider":55,"pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js":65}],128:[function(t,e,i){const o=t("pict-provider"),n=t("./RetoldRemote-ThemeDefinitions");class r extends o{constructor(t,e,i){super(t,e,i),this._themes={},this._themeOrder=[],this._currentTheme="twilight";for(let t=0;t<n.length;t++){let e=n[t];this._addTheme(e.Key,e)}}_addTheme(t,e){this._themes[t]=e,this._themeOrder.push(t)}applyTheme(t){let e=this._themes[t];e||(e=this._themes.twilight,t="twilight"),this._currentTheme=t;let i=":root {\n",o=e.Variables,n=Object.keys(o);for(let t=0;t<n.length;t++)i+="\t"+n[t]+": "+o[n[t]]+";\n";if(i+="}\n","undefined"!=typeof document){let t=document.getElementById("retold-remote-theme");t||(t=document.createElement("style"),t.id="retold-remote-theme",document.head.appendChild(t)),t.textContent=i}let r=this.pict.providers["RetoldRemote-Icons"];r&&e.IconColors&&r.setColors(e.IconColors);let s=this.pict.AppData.RetoldRemote;return s&&(s.Theme=t),!0}getThemeList(){let t=[];for(let e=0;e<this._themeOrder.length;e++){let i=this._themeOrder[e],o=this._themes[i];t.push({key:i,name:o.Name,category:o.Category,description:o.Description})}return t}getCurrentTheme(){return this._currentTheme}getTheme(t){return this._themes[t]||null}}r.default_configuration={ProviderIdentifier:"RetoldRemote-Theme",AutoInitialize:!0,AutoInitializeOrdinal:0},e.exports=r},{"./RetoldRemote-ThemeDefinitions":130,"pict-provider":55}],129:[function(t,e,i){const o=t("pict-provider");class n extends o{constructor(t,e,i){super(t,e,i),this.serviceType="RetoldRemoteProvider",this._overlayTimeout=null}showOverlayIndicator(t,e){let i=e||1500,o=document.getElementById("RetoldRemote-FitIndicator");if(!o){o=document.createElement("div"),o.id="RetoldRemote-FitIndicator",o.className="retold-remote-fit-indicator";let t=document.querySelector(".retold-remote-viewer-body");t&&t.appendChild(o)}o.textContent=t,o.classList.add("visible"),this._overlayTimeout&&clearTimeout(this._overlayTimeout),this._overlayTimeout=setTimeout(function(){o.classList.remove("visible")},i)}showToast(t,e){let i=e||2e3,o=document.querySelector(".retold-remote-toast");o&&o.remove();let n=document.createElement("div");n.className="retold-remote-toast",n.textContent=t,document.body.appendChild(n),setTimeout(function(){n.parentNode&&n.remove()},i)}}n.default_configuration={ProviderIdentifier:"RetoldRemote-ToastNotification",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=n},{"pict-provider":55}],130:[function(t,e,i){e.exports=[{Key:"daylight",Name:"Daylight",Category:"Grey",Description:"Bright white, dark text",Variables:{"--retold-bg-primary":"#FFFFFF","--retold-bg-secondary":"#F0F0F0","--retold-bg-tertiary":"#E8E8E8","--retold-bg-panel":"#F5F5F5","--retold-bg-viewer":"#FAFAFA","--retold-bg-hover":"#E0E0E0","--retold-bg-selected":"#C8C8C8","--retold-bg-thumb":"#F0F0F0","--retold-text-primary":"#1A1A1A","--retold-text-secondary":"#333333","--retold-text-muted":"#666666","--retold-text-dim":"#888888","--retold-text-placeholder":"#AAAAAA","--retold-accent":"#444444","--retold-accent-hover":"#222222","--retold-border":"#D0D0D0","--retold-border-light":"#E0E0E0","--retold-danger":"#CC0000","--retold-danger-muted":"#884444","--retold-scrollbar":"#C0C0C0","--retold-scrollbar-hover":"#A0A0A0","--retold-selection-bg":"rgba(68, 68, 68, 0.2)","--retold-focus-outline":"#444444","--retold-font-family":"'Segoe UI', system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#333333",Accent:"#444444",Muted:"#888888",Light:"#E8E8E8",WarmBeige:"#F0F0F0",TealTint:"#E0E0E0",Lavender:"#EBEBEB",AmberTint:"#F0EDE8",PdfFill:"#F0E0E0",PdfText:"#CC0000"}},{Key:"afternoon",Name:"Afternoon",Category:"Grey",Description:"Warm light grey, softer contrast",Variables:{"--retold-bg-primary":"#E8E4E0","--retold-bg-secondary":"#DAD6D2","--retold-bg-tertiary":"#D0CCC8","--retold-bg-panel":"#DDD9D5","--retold-bg-viewer":"#F0ECE8","--retold-bg-hover":"#CCC8C4","--retold-bg-selected":"#B8B4B0","--retold-bg-thumb":"#DAD6D2","--retold-text-primary":"#2A2A2A","--retold-text-secondary":"#404040","--retold-text-muted":"#707070","--retold-text-dim":"#909090","--retold-text-placeholder":"#B0B0B0","--retold-accent":"#555555","--retold-accent-hover":"#333333","--retold-border":"#C0BCB8","--retold-border-light":"#D0CCC8","--retold-danger":"#AA3333","--retold-danger-muted":"#886655","--retold-scrollbar":"#B8B4B0","--retold-scrollbar-hover":"#A0A09C","--retold-selection-bg":"rgba(85, 85, 85, 0.2)","--retold-focus-outline":"#555555","--retold-font-family":"Georgia, 'Times New Roman', serif","--retold-font-mono":"'Courier New', Courier, monospace"},IconColors:{Primary:"#404040",Accent:"#555555",Muted:"#909090",Light:"#D0CCC8",WarmBeige:"#DAD6D2",TealTint:"#CCC8C4",Lavender:"#D2D0CE",AmberTint:"#D8D2C8",PdfFill:"#D8C8C0",PdfText:"#AA3333"}},{Key:"evening",Name:"Evening",Category:"Grey",Description:"Medium grey, transitional",Variables:{"--retold-bg-primary":"#484848","--retold-bg-secondary":"#3C3C3C","--retold-bg-tertiary":"#424242","--retold-bg-panel":"#454545","--retold-bg-viewer":"#363636","--retold-bg-hover":"#525252","--retold-bg-selected":"#606060","--retold-bg-thumb":"#3C3C3C","--retold-text-primary":"#E0E0E0","--retold-text-secondary":"#D0D0D0","--retold-text-muted":"#A0A0A0","--retold-text-dim":"#888888","--retold-text-placeholder":"#707070","--retold-accent":"#C0C0C0","--retold-accent-hover":"#E0E0E0","--retold-border":"#585858","--retold-border-light":"#606060","--retold-danger":"#FF6666","--retold-danger-muted":"#AA6666","--retold-scrollbar":"#585858","--retold-scrollbar-hover":"#686868","--retold-selection-bg":"rgba(192, 192, 192, 0.25)","--retold-focus-outline":"#C0C0C0","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#D0D0D0",Accent:"#C0C0C0",Muted:"#888888",Light:"#424242",WarmBeige:"#484848",TealTint:"#3E3E3E",Lavender:"#444444",AmberTint:"#4A4640",PdfFill:"#4A3C3C",PdfText:"#FF6666"}},{Key:"twilight",Name:"Twilight",Category:"Grey",Description:"Dark grey, low light (default)",Variables:{"--retold-bg-primary":"#1E1E1E","--retold-bg-secondary":"#181818","--retold-bg-tertiary":"#252525","--retold-bg-panel":"#202020","--retold-bg-viewer":"#141414","--retold-bg-hover":"#2E2E2E","--retold-bg-selected":"#404040","--retold-bg-thumb":"#181818","--retold-text-primary":"#E0E0E0","--retold-text-secondary":"#C8C8C8","--retold-text-muted":"#909090","--retold-text-dim":"#707070","--retold-text-placeholder":"#585858","--retold-accent":"#A0A0A0","--retold-accent-hover":"#C0C0C0","--retold-border":"#333333","--retold-border-light":"#404040","--retold-danger":"#FF6666","--retold-danger-muted":"#AA6666","--retold-scrollbar":"#404040","--retold-scrollbar-hover":"#505050","--retold-selection-bg":"rgba(160, 160, 160, 0.25)","--retold-focus-outline":"#A0A0A0","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#C8C8C8",Accent:"#A0A0A0",Muted:"#707070",Light:"#252525",WarmBeige:"#2A2A2A",TealTint:"#222222",Lavender:"#282828",AmberTint:"#2E2A24",PdfFill:"#2E2224",PdfText:"#E06060"}},{Key:"night",Name:"Night",Category:"Grey",Description:"Near-black, minimal contrast",Variables:{"--retold-bg-primary":"#0A0A0A","--retold-bg-secondary":"#060606","--retold-bg-tertiary":"#0E0E0E","--retold-bg-panel":"#0C0C0C","--retold-bg-viewer":"#040404","--retold-bg-hover":"#161616","--retold-bg-selected":"#252525","--retold-bg-thumb":"#060606","--retold-text-primary":"#888888","--retold-text-secondary":"#707070","--retold-text-muted":"#555555","--retold-text-dim":"#444444","--retold-text-placeholder":"#333333","--retold-accent":"#666666","--retold-accent-hover":"#808080","--retold-border":"#1A1A1A","--retold-border-light":"#222222","--retold-danger":"#AA4444","--retold-danger-muted":"#663333","--retold-scrollbar":"#1A1A1A","--retold-scrollbar-hover":"#2A2A2A","--retold-selection-bg":"rgba(102, 102, 102, 0.2)","--retold-focus-outline":"#666666","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#707070",Accent:"#666666",Muted:"#444444",Light:"#0E0E0E",WarmBeige:"#121212",TealTint:"#0C0C0C",Lavender:"#101010",AmberTint:"#141210",PdfFill:"#141010",PdfText:"#AA4444"}},{Key:"neo-tokyo",Name:"Neo-Tokyo",Category:"Fun",Description:"Neon pink on dark navy",Variables:{"--retold-bg-primary":"#0D0D2B","--retold-bg-secondary":"#080820","--retold-bg-tertiary":"#121235","--retold-bg-panel":"#0F0F28","--retold-bg-viewer":"#060615","--retold-bg-hover":"#1A1A42","--retold-bg-selected":"#2A1845","--retold-bg-thumb":"#080820","--retold-text-primary":"#E8E0F0","--retold-text-secondary":"#D0C8E0","--retold-text-muted":"#9088A8","--retold-text-dim":"#6860A0","--retold-text-placeholder":"#504888","--retold-accent":"#FF2D8A","--retold-accent-hover":"#FF5AA0","--retold-border":"#2A2050","--retold-border-light":"#382868","--retold-danger":"#FF4466","--retold-danger-muted":"#AA3355","--retold-scrollbar":"#2A2050","--retold-scrollbar-hover":"#3A3068","--retold-selection-bg":"rgba(255, 45, 138, 0.25)","--retold-focus-outline":"#FF2D8A","--retold-font-family":"'Courier New', monospace","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#D0C8E0",Accent:"#FF2D8A",Muted:"#6860A0",Light:"#121235",WarmBeige:"#141438",TealTint:"#100E30",Lavender:"#141232",AmberTint:"#1A1228",PdfFill:"#1A1028",PdfText:"#FF4466"}},{Key:"cyberpunk",Name:"Cyberpunk",Category:"Fun",Description:"Electric green on black",Variables:{"--retold-bg-primary":"#0A0E0A","--retold-bg-secondary":"#060806","--retold-bg-tertiary":"#0E120E","--retold-bg-panel":"#0C100C","--retold-bg-viewer":"#040604","--retold-bg-hover":"#142014","--retold-bg-selected":"#1A3A1A","--retold-bg-thumb":"#060806","--retold-text-primary":"#C8FFC8","--retold-text-secondary":"#A0D8A0","--retold-text-muted":"#608860","--retold-text-dim":"#406040","--retold-text-placeholder":"#305030","--retold-accent":"#00FF41","--retold-accent-hover":"#44FF77","--retold-border":"#1A2A1A","--retold-border-light":"#224022","--retold-danger":"#FF3333","--retold-danger-muted":"#AA2222","--retold-scrollbar":"#1A2A1A","--retold-scrollbar-hover":"#2A4A2A","--retold-selection-bg":"rgba(0, 255, 65, 0.2)","--retold-focus-outline":"#00FF41","--retold-font-family":"'Lucida Console', 'Courier New', monospace","--retold-font-mono":"'Lucida Console', 'Courier New', monospace"},IconColors:{Primary:"#A0D8A0",Accent:"#00FF41",Muted:"#406040",Light:"#0E120E",WarmBeige:"#101610",TealTint:"#0C140C",Lavender:"#0E120E",AmberTint:"#141810",PdfFill:"#181010",PdfText:"#FF3333"}},{Key:"hotdog",Name:"Hotdog",Category:"Fun",Description:"Red and mustard yellow, garish",Variables:{"--retold-bg-primary":"#8B0000","--retold-bg-secondary":"#6B0000","--retold-bg-tertiary":"#7B0000","--retold-bg-panel":"#750000","--retold-bg-viewer":"#550000","--retold-bg-hover":"#AA1111","--retold-bg-selected":"#BB3300","--retold-bg-thumb":"#6B0000","--retold-text-primary":"#FFD700","--retold-text-secondary":"#FFC000","--retold-text-muted":"#CC9900","--retold-text-dim":"#AA7700","--retold-text-placeholder":"#886600","--retold-accent":"#FFD700","--retold-accent-hover":"#FFEE44","--retold-border":"#AA2222","--retold-border-light":"#BB3333","--retold-danger":"#FFFF00","--retold-danger-muted":"#CCCC00","--retold-scrollbar":"#AA2222","--retold-scrollbar-hover":"#CC3333","--retold-selection-bg":"rgba(255, 215, 0, 0.3)","--retold-focus-outline":"#FFD700","--retold-font-family":"Impact, 'Arial Black', sans-serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#FFC000",Accent:"#FFD700",Muted:"#AA7700",Light:"#7B0000",WarmBeige:"#800000",TealTint:"#6B0000",Lavender:"#780000",AmberTint:"#7A1000",PdfFill:"#6B0000",PdfText:"#FFFF00"}},{Key:"1970s-console",Name:"1970s Console",Category:"Fun",Description:"Amber phosphor on brown-black",Variables:{"--retold-bg-primary":"#1A1000","--retold-bg-secondary":"#140C00","--retold-bg-tertiary":"#1E1400","--retold-bg-panel":"#1C1200","--retold-bg-viewer":"#100A00","--retold-bg-hover":"#2A1C00","--retold-bg-selected":"#3A2800","--retold-bg-thumb":"#140C00","--retold-text-primary":"#FFAA00","--retold-text-secondary":"#DD8800","--retold-text-muted":"#AA6600","--retold-text-dim":"#884400","--retold-text-placeholder":"#663300","--retold-accent":"#FFCC00","--retold-accent-hover":"#FFDD44","--retold-border":"#2A1800","--retold-border-light":"#3A2200","--retold-danger":"#FF4400","--retold-danger-muted":"#AA3300","--retold-scrollbar":"#2A1800","--retold-scrollbar-hover":"#3A2800","--retold-selection-bg":"rgba(255, 204, 0, 0.2)","--retold-focus-outline":"#FFCC00","--retold-font-family":"'Courier New', 'Lucida Console', monospace","--retold-font-mono":"'Courier New', 'Lucida Console', monospace"},IconColors:{Primary:"#DD8800",Accent:"#FFCC00",Muted:"#884400",Light:"#1E1400",WarmBeige:"#201800",TealTint:"#1A1000",Lavender:"#1C1200",AmberTint:"#221800",PdfFill:"#201000",PdfText:"#FF4400"}},{Key:"1980s-console",Name:"1980s Console",Category:"Fun",Description:"Green phosphor on black",Variables:{"--retold-bg-primary":"#001200","--retold-bg-secondary":"#000E00","--retold-bg-tertiary":"#001600","--retold-bg-panel":"#001400","--retold-bg-viewer":"#000A00","--retold-bg-hover":"#002200","--retold-bg-selected":"#003800","--retold-bg-thumb":"#000E00","--retold-text-primary":"#00FF00","--retold-text-secondary":"#00CC00","--retold-text-muted":"#009900","--retold-text-dim":"#006600","--retold-text-placeholder":"#004400","--retold-accent":"#00FF66","--retold-accent-hover":"#44FF88","--retold-border":"#002A00","--retold-border-light":"#003A00","--retold-danger":"#FF0000","--retold-danger-muted":"#AA0000","--retold-scrollbar":"#002A00","--retold-scrollbar-hover":"#004400","--retold-selection-bg":"rgba(0, 255, 102, 0.2)","--retold-focus-outline":"#00FF66","--retold-font-family":"'Courier New', monospace","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#00CC00",Accent:"#00FF66",Muted:"#006600",Light:"#001600",WarmBeige:"#001A00",TealTint:"#001200",Lavender:"#001400",AmberTint:"#001800",PdfFill:"#140000",PdfText:"#FF0000"}},{Key:"1990s-website",Name:"1990s Web Site",Category:"Fun",Description:"Blue links on grey, beveled",Variables:{"--retold-bg-primary":"#C0C0C0","--retold-bg-secondary":"#B0B0B0","--retold-bg-tertiary":"#A8A8A8","--retold-bg-panel":"#B8B8B8","--retold-bg-viewer":"#D0D0D0","--retold-bg-hover":"#B8B8D0","--retold-bg-selected":"#000080","--retold-bg-thumb":"#B0B0B0","--retold-text-primary":"#000000","--retold-text-secondary":"#000080","--retold-text-muted":"#404040","--retold-text-dim":"#606060","--retold-text-placeholder":"#808080","--retold-accent":"#0000FF","--retold-accent-hover":"#0000CC","--retold-border":"#808080","--retold-border-light":"#A0A0A0","--retold-danger":"#FF0000","--retold-danger-muted":"#990000","--retold-scrollbar":"#808080","--retold-scrollbar-hover":"#606060","--retold-selection-bg":"rgba(0, 0, 128, 0.3)","--retold-focus-outline":"#0000FF","--retold-font-family":"'Times New Roman', Times, serif","--retold-font-mono":"'Courier New', Courier, monospace"},IconColors:{Primary:"#000080",Accent:"#0000FF",Muted:"#606060",Light:"#A8A8A8",WarmBeige:"#B0B0B0",TealTint:"#A0A0A0",Lavender:"#ABABD0",AmberTint:"#B8B0A0",PdfFill:"#C0A0A0",PdfText:"#FF0000"}},{Key:"early-2000s",Name:"Early 2000s Web",Category:"Fun",Description:"Teal and silver, Web 2.0",Variables:{"--retold-bg-primary":"#E8F4F8","--retold-bg-secondary":"#D0E8EE","--retold-bg-tertiary":"#C0DDE6","--retold-bg-panel":"#D8EEF2","--retold-bg-viewer":"#F0F8FA","--retold-bg-hover":"#B0D4E0","--retold-bg-selected":"#88C4D8","--retold-bg-thumb":"#D0E8EE","--retold-text-primary":"#1A3A4A","--retold-text-secondary":"#2A4A5A","--retold-text-muted":"#5A7A8A","--retold-text-dim":"#7A9AAA","--retold-text-placeholder":"#9ABACA","--retold-accent":"#0099CC","--retold-accent-hover":"#00AADD","--retold-border":"#A0C8D8","--retold-border-light":"#B8D8E4","--retold-danger":"#CC3300","--retold-danger-muted":"#994422","--retold-scrollbar":"#A0C8D8","--retold-scrollbar-hover":"#88B8CC","--retold-selection-bg":"rgba(0, 153, 204, 0.2)","--retold-focus-outline":"#0099CC","--retold-font-family":"Verdana, Geneva, Tahoma, sans-serif","--retold-font-mono":"'Lucida Console', Monaco, monospace"},IconColors:{Primary:"#2A4A5A",Accent:"#0099CC",Muted:"#7A9AAA",Light:"#C0DDE6",WarmBeige:"#D0E8EE",TealTint:"#B0D8E4",Lavender:"#C8DCE6",AmberTint:"#D8E0D0",PdfFill:"#E0C8C0",PdfText:"#CC3300"}},{Key:"synthwave",Name:"Synthwave",Category:"Fun",Description:"Purple and pink neon",Variables:{"--retold-bg-primary":"#1A0A2E","--retold-bg-secondary":"#140824","--retold-bg-tertiary":"#200E38","--retold-bg-panel":"#1C0C32","--retold-bg-viewer":"#100620","--retold-bg-hover":"#2A1848","--retold-bg-selected":"#3A2060","--retold-bg-thumb":"#140824","--retold-text-primary":"#E8C0F8","--retold-text-secondary":"#D0A8E8","--retold-text-muted":"#9878B8","--retold-text-dim":"#7858A8","--retold-text-placeholder":"#584088","--retold-accent":"#FF71CE","--retold-accent-hover":"#FF99DD","--retold-border":"#302050","--retold-border-light":"#402868","--retold-danger":"#FF4488","--retold-danger-muted":"#AA3366","--retold-scrollbar":"#302050","--retold-scrollbar-hover":"#402868","--retold-selection-bg":"rgba(255, 113, 206, 0.25)","--retold-focus-outline":"#FF71CE","--retold-font-family":"'Trebuchet MS', sans-serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#D0A8E8",Accent:"#FF71CE",Muted:"#7858A8",Light:"#200E38",WarmBeige:"#221040",TealTint:"#1A0C30",Lavender:"#1E0E36",AmberTint:"#241028",PdfFill:"#241020",PdfText:"#FF4488"}},{Key:"solarized-dark",Name:"Solarized Dark",Category:"Fun",Description:"Schoonover's classic palette",Variables:{"--retold-bg-primary":"#002B36","--retold-bg-secondary":"#073642","--retold-bg-tertiary":"#003B4A","--retold-bg-panel":"#00303C","--retold-bg-viewer":"#001E28","--retold-bg-hover":"#0A4858","--retold-bg-selected":"#155868","--retold-bg-thumb":"#073642","--retold-text-primary":"#FDF6E3","--retold-text-secondary":"#EEE8D5","--retold-text-muted":"#93A1A1","--retold-text-dim":"#839496","--retold-text-placeholder":"#657B83","--retold-accent":"#268BD2","--retold-accent-hover":"#45A0E0","--retold-border":"#0A4050","--retold-border-light":"#125868","--retold-danger":"#DC322F","--retold-danger-muted":"#AA2A28","--retold-scrollbar":"#0A4050","--retold-scrollbar-hover":"#125868","--retold-selection-bg":"rgba(38, 139, 210, 0.25)","--retold-focus-outline":"#268BD2","--retold-font-family":"'Source Code Pro', 'Fira Code', monospace","--retold-font-mono":"'Source Code Pro', 'Fira Code', monospace"},IconColors:{Primary:"#EEE8D5",Accent:"#268BD2",Muted:"#839496",Light:"#003B4A",WarmBeige:"#073642",TealTint:"#004050",Lavender:"#003848",AmberTint:"#0A3A30",PdfFill:"#0A3028",PdfText:"#DC322F"}},{Key:"forest",Name:"Forest",Category:"Fun",Description:"Deep greens and earth browns",Variables:{"--retold-bg-primary":"#1A2018","--retold-bg-secondary":"#141A12","--retold-bg-tertiary":"#1E2620","--retold-bg-panel":"#1C221A","--retold-bg-viewer":"#101410","--retold-bg-hover":"#283828","--retold-bg-selected":"#344834","--retold-bg-thumb":"#141A12","--retold-text-primary":"#D0DCC8","--retold-text-secondary":"#B0C4A8","--retold-text-muted":"#809878","--retold-text-dim":"#607858","--retold-text-placeholder":"#486040","--retold-accent":"#6AAF5C","--retold-accent-hover":"#88CC78","--retold-border":"#2A3A28","--retold-border-light":"#3A4A38","--retold-danger":"#CC4422","--retold-danger-muted":"#884422","--retold-scrollbar":"#2A3A28","--retold-scrollbar-hover":"#3A4A38","--retold-selection-bg":"rgba(106, 175, 92, 0.25)","--retold-focus-outline":"#6AAF5C","--retold-font-family":"'Palatino Linotype', 'Book Antiqua', Palatino, serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#B0C4A8",Accent:"#6AAF5C",Muted:"#607858",Light:"#1E2620",WarmBeige:"#22281E",TealTint:"#1A221A",Lavender:"#1E2420",AmberTint:"#262218",PdfFill:"#261A18",PdfText:"#CC4422"}},{Key:"mobile-debug",Name:"Mobile Container Debug",Category:"Debug",Description:"Unique color per container for layout debugging",Variables:{"--retold-bg-primary":"#FF0000","--retold-bg-secondary":"#00CCCC","--retold-bg-tertiary":"#00AA00","--retold-bg-panel":"#FFAA00","--retold-bg-viewer":"#333333","--retold-bg-hover":"rgba(255, 255, 255, 0.2)","--retold-bg-selected":"rgba(255, 255, 255, 0.3)","--retold-bg-thumb":"#AA00AA","--retold-text-primary":"#FFFFFF","--retold-text-secondary":"#EEEEEE","--retold-text-muted":"#CCCCCC","--retold-text-dim":"#AAAAAA","--retold-text-placeholder":"#888888","--retold-accent":"#FFFF00","--retold-accent-hover":"#FFFF88","--retold-border":"#FFFFFF","--retold-border-light":"#CCCCCC","--retold-danger":"#FF0000","--retold-danger-muted":"#CC4444","--retold-scrollbar":"#888888","--retold-scrollbar-hover":"#AAAAAA","--retold-selection-bg":"rgba(255, 255, 0, 0.3)","--retold-focus-outline":"#FFFF00","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Consolas', monospace"},IconColors:{Primary:"#FFFFFF",Accent:"#FFFF00",Muted:"#CCCCCC",Light:"#333333",WarmBeige:"#FFAA00",TealTint:"#00CCCC",Lavender:"#AA00AA",AmberTint:"#FFAA00",PdfFill:"#FF4444",PdfText:"#FFFFFF"}}]},{}],131:[function(t,e,i){e.exports=function(t,e){let i=t.pict.views["RetoldRemote-AudioExplorer"];if(i)switch(e.key){case"Escape":e.preventDefault(),i._selectionStart>=0?i.clearSelection():i.goBack();break;case"+":case"=":e.preventDefault(),i.zoomIn();break;case"-":case"_":e.preventDefault(),i.zoomOut();break;case"0":e.preventDefault(),i.zoomToFit();break;case"z":case"Z":e.preventDefault(),i.zoomToSelection();break;case" ":e.preventDefault(),i.playSelection();break;case"a":case"s":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addAudioSnippetToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}break;case"v":e.preventDefault(),t._streamWithVLC()}}},{}],132:[function(t,e,i){e.exports=function(t,e){let i=t.pict.AppData.RetoldRemote,o=i.GalleryItems||[],n=i.GalleryCursorIndex||0;switch(e.key){case"ArrowRight":e.preventDefault(),t.moveCursor(Math.min(n+1,o.length-1));break;case"ArrowLeft":e.preventDefault(),t.moveCursor(Math.max(n-1,0));break;case"ArrowDown":e.preventDefault(),t.moveCursor(Math.min(n+t._columnsPerRow,o.length-1));break;case"ArrowUp":e.preventDefault(),t.moveCursor(Math.max(n-t._columnsPerRow,0));break;case"Enter":e.preventDefault(),t.openCurrent();break;case"Escape":e.preventDefault(),t.navigateUp();break;case"g":e.preventDefault(),t._toggleViewMode();break;case"x":e.preventDefault(),t._clearAllFilters();break;case"Home":e.preventDefault(),t.moveCursor(0);break;case"End":e.preventDefault(),t.moveCursor(o.length-1);break;case"1":e.preventDefault(),t.openCurrentAs("image");break;case"2":e.preventDefault(),t.openCurrentAs("video");break;case"3":e.preventDefault(),t.openCurrentAs("audio");break;case"4":e.preventDefault(),t.openCurrentAs("text");break;case"f":e.preventDefault();{t._showFilterBar();let e=t.pict.views["RetoldRemote-Gallery"];e&&e.toggleFilterPanel()}break;case"s":e.preventDefault(),t._showFilterBar(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Sort");t&&t.focus()},50);break;case"c":e.preventDefault(),t._toggleSettingsPanel();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=o[n],r=e.getQuickAddTargetGUID();if(i&&r)if("folder"===i.Type||"archive"===i.Type)e.showFolderChoicePrompt(t=>{let o={Type:"contents"===t?"folder-contents":"folder",Path:i.Path||"",Label:""};e.addItemsToCollection(r,[o])});else{let t={Type:"file",Path:i.Path||"",Hash:i.Hash||"",Label:""};e.addItemsToCollection(r,[t])}else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"d":e.preventDefault(),t._toggleDistractionFree();break;case"e":e.preventDefault();{let e=o[n];if(e&&"folder"!==e.Type&&"archive"!==e.Type){let i=t.pict.providers["RetoldRemote-GalleryFilterSort"];if("video"===(i?i.getCategory(e.Extension):"")){let i=t.pict.views["RetoldRemote-VideoExplorer"];i&&i.showExplorer(e.Path)}}}break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}break;case"i":e.preventDefault();{let e=t.pict.views["ContentEditor-Layout"];e&&e.switchSidebarTab("info")}}}},{}],133:[function(t,e,i){e.exports=function(t,e){let i=t.pict.views["RetoldRemote-ImageExplorer"];if(i)switch(e.key){case"Escape":e.preventDefault(),i.goBack();break;case"+":case"=":e.preventDefault(),i.zoomIn();break;case"-":case"_":e.preventDefault(),i.zoomOut();break;case"0":e.preventDefault(),i.zoomHome();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addCurrentFileToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}}}},{}],134:[function(t,e,i){e.exports=function(t,e){let i=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row"),o=i.length;if(0!==o)switch(e.key){case"ArrowDown":e.preventDefault(),t._moveSidebarCursor(Math.min(t._sidebarCursorIndex+1,o-1));break;case"ArrowUp":e.preventDefault(),t._moveSidebarCursor(Math.max(t._sidebarCursorIndex-1,0));break;case"Home":e.preventDefault(),t._moveSidebarCursor(0);break;case"End":e.preventDefault(),t._moveSidebarCursor(o-1);break;case"Enter":e.preventDefault();{let e=i[t._sidebarCursorIndex];if(e){let t=e.getAttribute("ondblclick");t&&new Function(t).call(e)}}break;case"Escape":e.preventDefault(),t._blurSidebar()}else t._blurSidebar()}},{}],135:[function(t,e,i){e.exports=function(t,e){switch(t.pict.AppData.RetoldRemote,e.key){case"Escape":e.preventDefault();let i=t.pict.views["RetoldRemote-VideoExplorer"];i&&(i._previewKeyHandler?i.closeFramePreview():i.goBack());break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addVideoFrameToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"s":e.preventDefault();{let e=t.pict.views["RetoldRemote-VideoExplorer"];if(!e||e._selectionStartTime<0||e._selectionEndTime<0)break;let i=t.pict.providers["RetoldRemote-CollectionManager"];if(i){let o=Math.min(e._selectionStartTime,e._selectionEndTime),n=Math.max(e._selectionStartTime,e._selectionEndTime),r=i.getQuickAddTargetGUID();if(r)i.addVideoClipToCollection(r,o,n);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"[":e.preventDefault();{let e=t.pict.views["RetoldRemote-VideoExplorer"];if(e&&e._frameData&&e._frameData.Frames&&e._selectedFrameIndex>=0&&e._frameData.Frames[e._selectedFrameIndex]){let t=e._frameData.Frames[e._selectedFrameIndex].Timestamp;e.setSelectionStart(t)}}break;case"]":e.preventDefault();{let e=t.pict.views["RetoldRemote-VideoExplorer"];if(e&&e._frameData&&e._frameData.Frames&&e._selectedFrameIndex>=0&&e._frameData.Frames[e._selectedFrameIndex]){let t=e._frameData.Frames[e._selectedFrameIndex].Timestamp;e.setSelectionEnd(t)}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}break;case"v":e.preventDefault(),t._streamWithVLC();break;case" ":e.preventDefault();{let e=t.pict.views["RetoldRemote-VideoExplorer"];e&&e.playInBrowser()}}}},{}],136:[function(t,e,i){e.exports=function(t,e){let i=t.pict.AppData.RetoldRemote;if(i.VideoMenuActive&&"video"===i.CurrentViewerMediaType)switch(e.key){case"Escape":return e.preventDefault(),void t.closeViewer();case"ArrowRight":case"j":return e.preventDefault(),void t.nextFile();case"ArrowLeft":case"k":return e.preventDefault(),void t.prevFile();case"e":e.preventDefault();let o=t.pict.views["RetoldRemote-VideoExplorer"];return void(o&&o.showExplorer(i.CurrentViewerFile));case" ":case"Enter":e.preventDefault();let n=t.pict.views["RetoldRemote-MediaViewer"];return void(n&&n.playVideo());case"t":e.preventDefault();let r=t.pict.views["RetoldRemote-MediaViewer"];return void(r&&r.loadVideoMenuFrame());case"v":return e.preventDefault(),void t._streamWithVLC();case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addCurrentFileToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}return;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}return;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}return}else switch(e.key){case"Escape":e.preventDefault(),t.closeViewer();break;case"ArrowRight":case"j":e.preventDefault(),t.nextFile();break;case"ArrowLeft":case"k":e.preventDefault(),t.prevFile();break;case"f":case"d":e.preventDefault(),t._toggleDistractionFree();break;case"i":e.preventDefault(),t._toggleFileInfo();break;case" ":e.preventDefault(),t._togglePlayPause();break;case"+":case"=":e.preventDefault(),t._zoomIn();break;case"-":e.preventDefault(),t._zoomOut();break;case"0":e.preventDefault(),t._zoomReset();break;case"z":e.preventDefault(),t._cycleFitMode();break;case"Enter":case"v":e.preventDefault(),t._streamWithVLC();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let i=e.getQuickAddTargetGUID();if(i)e.addCurrentFileToCollection(i);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"e":e.preventDefault();{let e=i.CurrentViewerMediaType;if("video"===e){let e=t.pict.views["RetoldRemote-VideoExplorer"];e&&e.showExplorer(i.CurrentViewerFile)}else if("audio"===e){let e=t.pict.views["RetoldRemote-AudioExplorer"];e&&e.showExplorer(i.CurrentViewerFile)}else if("image"===e){let e=t.pict.views["RetoldRemote-ImageExplorer"];e&&e.showExplorer(i.CurrentViewerFile)}}break;case"1":e.preventDefault(),t.switchViewerType("image");break;case"2":e.preventDefault(),t.switchViewerType("video");break;case"3":e.preventDefault(),t.switchViewerType("audio");break;case"4":e.preventDefault(),t.switchViewerType("text");break;case"h":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.toggleFavorite()}}}},{}],137:[function(t,e,i){
|
|
165
165
|
/**
|
|
166
166
|
* MediaViewer — Code Viewer Mixin
|
|
167
167
|
*
|
|
@@ -174,7 +174,7 @@ const o=t("pict-provider"),n=t("./CollectionManager-Favorites"),r=t("./Collectio
|
|
|
174
174
|
*
|
|
175
175
|
* @license MIT
|
|
176
176
|
*/
|
|
177
|
-
const o=t("pict-section-code");e.exports={_buildTextHTML:function(t,e,i){return'<div class="retold-remote-code-viewer-container" id="RetoldRemote-CodeViewer-Container"><div class="retold-remote-code-viewer-loading">Loading...</div></div>'},_getHighlightLanguage:function(t){if({js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0}[t])return"javascript";if("json"===t)return"json";if({html:!0,htm:!0,xml:!0,svg:!0}[t])return"html";return{css:!0,scss:!0,sass:!0,less:!0}[t]?"css":"sql"===t?"sql":"javascript"},_loadCodeViewer:function(t,e){let i=this,n=e.replace(/^.*\./,"").toLowerCase();fetch(t).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.text()}).then(t=>{let e=document.getElementById("RetoldRemote-CodeViewer-Container");if(!e)return;let r=i._getHighlightLanguage(n);if(i._activeCodeJar&&(i._activeCodeJar.destroy(),i._activeCodeJar=null),"undefined"==typeof window||"function"!=typeof window.CodeJar){e.innerHTML='<div class="retold-remote-code-viewer-loading">CodeJar not loaded; showing plain text.</div>';let i=document.createElement("pre");return i.style.cssText="padding:16px 20px; margin:0; color:var(--retold-text-primary); font-family:monospace; white-space:pre; tab-size:4; overflow:auto; height:100%;",i.textContent=t,void e.appendChild(i)}e.innerHTML="";let s=document.createElement("div");s.className="pict-code-editor-wrap";let a=document.createElement("div");a.className="pict-code-line-numbers",s.appendChild(a);let l=document.createElement("div");l.className="pict-code-editor language-"+r,s.appendChild(l),e.appendChild(s);let d=o.createHighlighter(r);i._activeCodeJar=window.CodeJar(l,d,{tab:"\t",catchTab:!1,addClosing:!1}),l.style.whiteSpace="pre",l.style.overflowWrap="normal",i._activeCodeJar.updateCode(t),l.setAttribute("contenteditable","false");let c=t.split("\n").length,p="";for(let t=1;t<=c;t++)p+="<span>"+t+"</span>";a.innerHTML=p}).catch(t=>{let e=document.getElementById("RetoldRemote-CodeViewer-Container");e&&(e.innerHTML='<div class="retold-remote-code-viewer-loading">Failed to load file: '+t.message+"</div>")})}}},{"pict-section-code":
|
|
177
|
+
const o=t("pict-section-code");e.exports={_buildTextHTML:function(t,e,i){return'<div class="retold-remote-code-viewer-container" id="RetoldRemote-CodeViewer-Container"><div class="retold-remote-code-viewer-loading">Loading...</div></div>'},_getHighlightLanguage:function(t){if({js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0}[t])return"javascript";if("json"===t)return"json";if({html:!0,htm:!0,xml:!0,svg:!0}[t])return"html";return{css:!0,scss:!0,sass:!0,less:!0}[t]?"css":"sql"===t?"sql":"javascript"},_loadCodeViewer:function(t,e){let i=this,n=e.replace(/^.*\./,"").toLowerCase();fetch(t).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.text()}).then(t=>{let e=document.getElementById("RetoldRemote-CodeViewer-Container");if(!e)return;let r=i._getHighlightLanguage(n);if(i._activeCodeJar&&(i._activeCodeJar.destroy(),i._activeCodeJar=null),"undefined"==typeof window||"function"!=typeof window.CodeJar){e.innerHTML='<div class="retold-remote-code-viewer-loading">CodeJar not loaded; showing plain text.</div>';let i=document.createElement("pre");return i.style.cssText="padding:16px 20px; margin:0; color:var(--retold-text-primary); font-family:monospace; white-space:pre; tab-size:4; overflow:auto; height:100%;",i.textContent=t,void e.appendChild(i)}e.innerHTML="";let s=document.createElement("div");s.className="pict-code-editor-wrap";let a=document.createElement("div");a.className="pict-code-line-numbers",s.appendChild(a);let l=document.createElement("div");l.className="pict-code-editor language-"+r,s.appendChild(l),e.appendChild(s);let d=o.createHighlighter(r);i._activeCodeJar=window.CodeJar(l,d,{tab:"\t",catchTab:!1,addClosing:!1}),l.style.whiteSpace="pre",l.style.overflowWrap="normal",i._activeCodeJar.updateCode(t),l.setAttribute("contenteditable","false");let c=t.split("\n").length,p="";for(let t=1;t<=c;t++)p+="<span>"+t+"</span>";a.innerHTML=p}).catch(t=>{let e=document.getElementById("RetoldRemote-CodeViewer-Container");e&&(e.innerHTML='<div class="retold-remote-code-viewer-loading">Failed to load file: '+t.message+"</div>")})}}},{"pict-section-code":58}],138:[function(t,e,i){
|
|
178
178
|
/**
|
|
179
179
|
* MediaViewer — Ebook Viewer Mixin
|
|
180
180
|
*
|
|
@@ -186,7 +186,7 @@ const o=t("pict-section-code");e.exports={_buildTextHTML:function(t,e,i){return'
|
|
|
186
186
|
*
|
|
187
187
|
* @license MIT
|
|
188
188
|
*/
|
|
189
|
-
e.exports={_buildEbookHTML:function(t,e,i){return'<div class="retold-remote-ebook-wrap"><div class="retold-remote-ebook-toc collapsed" id="RetoldRemote-EbookTOC"><div class="retold-remote-ebook-toc-header"><span>Contents</span><button class="retold-remote-ebook-toc-close" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleEbookTOC()" title="Close">×</button></div><div class="retold-remote-ebook-toc-items" id="RetoldRemote-EbookTOCItems"></div></div><div class="retold-remote-ebook-reader"><div class="retold-remote-ebook-content" id="RetoldRemote-EbookContent"><div class="retold-remote-ebook-loading">Loading ebook...</div></div><div class="retold-remote-ebook-controls"><button class="retold-remote-ebook-toc-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleEbookTOC()">☰ TOC</button><button class="retold-remote-ebook-page-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].ebookPrevPage()">← Prev</button><button class="retold-remote-ebook-page-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].ebookNextPage()">Next →</button></div></div></div>'},_loadEbookViewer:function(t,e){let i=this;if("mobi"===e.replace(/^.*\./,"").toLowerCase()){if(!(this.pict.AppData.RetoldRemote.ServerCapabilities||{}).ebook_convert){let e=document.getElementById("RetoldRemote-EbookContent");return void(e&&(e.innerHTML='<div class="retold-remote-ebook-loading">MOBI viewing requires Calibre (ebook-convert) on the server.<br><a href="'+t+'" target="_blank" style="color: var(--retold-accent); margin-top: 12px; display: inline-block;">Download file</a></div>'))}let o=document.getElementById("RetoldRemote-EbookContent");o&&(o.innerHTML='<div class="retold-remote-ebook-loading">Converting MOBI to EPUB...</div>');let n=this.pict.providers["RetoldRemote-Provider"],r=n?n._getPathParam(e):encodeURIComponent(e);fetch("/api/media/ebook-convert?path="+r).then(t=>t.json()).then(t=>{if(!t||!t.Success)throw new Error(t?t.Error:"Conversion failed.");let e="/api/media/ebook/"+t.CacheKey+"/"+t.OutputFilename;i._renderEpub(e)}).catch(e=>{let o=document.getElementById("RetoldRemote-EbookContent");o&&(o.innerHTML='<div class="retold-remote-ebook-loading">Failed to convert: '+i.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.message)+'<br><a href="'+t+'" target="_blank" style="color: var(--retold-accent); margin-top: 12px; display: inline-block;">Download file</a></div>')})}else this._renderEpub(t)},_renderEpub:function(t){let e=this;if("undefined"==typeof window||"function"!=typeof window.ePub){let t=document.getElementById("RetoldRemote-EbookContent");return void(t&&(t.innerHTML='<div class="retold-remote-ebook-loading">epub.js library not loaded.</div>'))}if(this._activeBook){try{this._activeBook.destroy()}catch(t){}this._activeBook=null,this._activeRendition=null}let i=document.getElementById("RetoldRemote-EbookContent");i&&(i.innerHTML="",fetch(t).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.arrayBuffer()}).then(t=>{let o=window.ePub(t);e._activeBook=o;let n=o.renderTo(i,{width:"100%",height:"100%",spread:"none"});e._activeRendition=n,n.display(),n.themes.default({body:{color:"var(--retold-text-primary, #d4d4d4)",background:"var(--retold-bg-primary, #1e1e1e)","font-family":'Georgia, "Times New Roman", serif',"line-height":"1.6",padding:"20px 40px"},a:{color:"var(--retold-accent, #569cd6)"}}),o.loaded.navigation.then(t=>{e._renderEbookTOC(t.toc)})}).catch(t=>{i&&(i.innerHTML='<div class="retold-remote-ebook-loading">Failed to load ebook: '+e.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.message)+"</div>")}))},_renderEbookTOC:function(t){let e=document.getElementById("RetoldRemote-EbookTOCItems");if(!e||!t)return;let i=this,o="",n=function(t,e){for(let r=0;r<t.length;r++){let s=t[r],a=e>0?" indent-"+Math.min(e,2):"";o+='<button class="retold-remote-ebook-toc-item'+a+'" data-href="'+i.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.href)+"\" onclick=\"pict.views['RetoldRemote-MediaViewer'].ebookGoToChapter(this.getAttribute('data-href'))\">"+i.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.label.trim())+"</button>",s.subitems&&s.subitems.length>0&&n(s.subitems,e+1)}};n(t,0),e.innerHTML=o},ebookGoToChapter:function(t){this._activeRendition&&t&&this._activeRendition.display(t)},ebookPrevPage:function(){this._activeRendition&&this._activeRendition.prev()},ebookNextPage:function(){this._activeRendition&&this._activeRendition.next()},toggleEbookTOC:function(){let t=document.getElementById("RetoldRemote-EbookTOC");t&&t.classList.toggle("collapsed")}}},{}],136:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-AudioExplorer",DefaultRenderable:"RetoldRemote-AudioExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i),this._currentPath="",this._waveformData=null,this._peaks=[],this._viewStart=0,this._viewEnd=1,this._minZoom=.005,this._selectionStart=-1,this._selectionEnd=-1,this._isDragging=!1,this._dragStart=-1,this._cursorX=-1,this._segmentURL=null,this._mainCanvas=null,this._overviewCanvas=null,this._resizeObserver=null}showExplorer(t,e,i){this.pict.AppData.RetoldRemote.ActiveMode="audio-explorer",this._currentPath=t,this._waveformData=null,this._peaks=[],this._viewStart=0,this._viewEnd=1,this._segmentURL=null,this._pendingSelectionStartSec="number"==typeof e&&e>=0?e:-1,this._pendingSelectionEndSec="number"==typeof i&&i>=0?i:-1,this._selectionStart=-1,this._selectionEnd=-1;let o=this.pict.providers["RetoldRemote-Provider"],n="#/explore-audio/"+(o?o.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",n):window.location.hash=n;let r=document.getElementById("RetoldRemote-Gallery-Container"),s=document.getElementById("RetoldRemote-Viewer-Container");r&&(r.style.display="none"),s&&(s.style.display="block");let a=t.replace(/^.*\//,""),l='<div class="retold-remote-aex">';l+='<div class="retold-remote-aex-header">',l+='<button class="retold-remote-aex-nav-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].goBack()" title="Back to audio (Esc)">← Back</button>',l+='<div class="retold-remote-aex-title">Audio Explorer — '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(a)+"</div>",l+="</div>",l+='<div class="retold-remote-aex-info" id="RetoldRemote-AEX-Info" style="display:none;"></div>',l+='<div class="retold-remote-aex-controls" id="RetoldRemote-AEX-Controls" style="display:none;">',l+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomIn()" title="Zoom In (+)">+ Zoom In</button>',l+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomOut()" title="Zoom Out (-)">- Zoom Out</button>',l+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomToFit()" title="Zoom to Fit (0)">Fit All</button>',l+='<button class="retold-remote-aex-btn" id="RetoldRemote-AEX-ZoomSelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomToSelection()" title="Zoom to Selection (Z)" disabled>Zoom to Selection</button>',l+='<button class="retold-remote-aex-btn" id="RetoldRemote-AEX-PlaySelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].playSelection()" title="Play Selection (Space)" disabled>▶ Play Selection</button>',l+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].clearSelection()" title="Clear Selection (Esc)">Clear Selection</button>',l+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 4px;"></span>',l+='<button class="retold-remote-aex-save-btn" id="RetoldRemote-AEX-SaveSelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].saveSelectionToCollection()" title="Save segment to collection (s)" disabled>Save Segment</button>',l+="</div>",l+='<div class="retold-remote-aex-body" id="RetoldRemote-AEX-Body">',l+='<div class="retold-remote-aex-loading">',l+='<div class="retold-remote-aex-loading-spinner"></div>',l+="Analyzing audio waveform...",l+="</div>",l+="</div>",l+='<div class="retold-remote-aex-time-bar" id="RetoldRemote-AEX-TimeBar" style="display:none;">',l+='<span class="retold-remote-aex-time-label">View:</span>',l+='<span class="retold-remote-aex-time-value" id="RetoldRemote-AEX-ViewRange">--</span>',l+='<span class="retold-remote-aex-time-label" style="margin-left: 12px;">Selection:</span>',l+='<span class="retold-remote-aex-time-selection" id="RetoldRemote-AEX-SelectionRange">None</span>',l+='<span class="retold-remote-aex-time-label" style="margin-left: 12px;">Cursor:</span>',l+='<span class="retold-remote-aex-time-value" id="RetoldRemote-AEX-CursorTime">--</span>',l+="</div>",l+='<div class="retold-remote-aex-playback" id="RetoldRemote-AEX-Playback" style="display:none;">',l+='<span class="retold-remote-aex-playback-label">Segment:</span>',l+='<audio controls id="RetoldRemote-AEX-Audio"></audio>',l+="</div>",l+="</div>",s&&(s.innerHTML=l);let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo(),this._fetchWaveform(t)}_fetchWaveform(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"],o=i?i._getPathParam(t):encodeURIComponent(t);fetch("/api/media/audio-waveform?path="+o+"&peaks=2000").then(t=>t.json()).then(t=>{t&&t.Success?(e._waveformData=t,e._peaks=t.Peaks||[],e._renderWaveformUI()):e._showError(t?t.Error:"Unknown error")}).catch(t=>{e._showError(t.message)})}_renderWaveformUI(){let t=this._waveformData;if(!t)return;let e=document.getElementById("RetoldRemote-AEX-Info");if(e){let i="";i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Duration</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.DurationFormatted)+"</span></span>",t.SampleRate&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Sample Rate</span> <span class="retold-remote-aex-info-value">'+(t.SampleRate/1e3).toFixed(1)+" kHz</span></span>"),t.Channels&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Channels</span> <span class="retold-remote-aex-info-value">'+t.Channels+(t.ChannelLayout?" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.ChannelLayout)+")":"")+"</span></span>"),t.Codec&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Codec</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Codec)+"</span></span>"),t.Bitrate&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Bitrate</span> <span class="retold-remote-aex-info-value">'+Math.round(t.Bitrate/1e3)+" kbps</span></span>"),t.FileSize&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Size</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(t.FileSize)+"</span></span>"),i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Peaks</span> <span class="retold-remote-aex-info-value">'+t.PeakCount+" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Method)+")</span></span>",e.innerHTML=i,e.style.display=""}let i=document.getElementById("RetoldRemote-AEX-Controls");i&&(i.style.display="");let o=document.getElementById("RetoldRemote-AEX-TimeBar");o&&(o.style.display="");let n=document.getElementById("RetoldRemote-AEX-Body");if(n){let t="";t+='<div class="retold-remote-aex-canvas-wrap" id="RetoldRemote-AEX-CanvasWrap">',t+='<canvas id="RetoldRemote-AEX-MainCanvas"></canvas>',t+="</div>",t+='<div class="retold-remote-aex-overview-wrap" id="RetoldRemote-AEX-OverviewWrap">',t+='<canvas id="RetoldRemote-AEX-OverviewCanvas"></canvas>',t+='<div class="retold-remote-aex-overview-viewport" id="RetoldRemote-AEX-OverviewViewport"></div>',t+="</div>",n.innerHTML=t}this._mainCanvas=document.getElementById("RetoldRemote-AEX-MainCanvas"),this._overviewCanvas=document.getElementById("RetoldRemote-AEX-OverviewCanvas"),this._bindCanvasEvents(),this._resizeCanvases(),this._drawAll(),this._updateTimeDisplay();let r=this;if("undefined"!=typeof ResizeObserver){this._resizeObserver=new ResizeObserver(()=>{r._resizeCanvases(),r._drawAll()});let t=document.getElementById("RetoldRemote-AEX-CanvasWrap");t&&this._resizeObserver.observe(t)}this._loadSavedState()}_resizeCanvases(){if(this._mainCanvas){let t=this._mainCanvas.parentElement;if(t){let e=window.devicePixelRatio||1;this._mainCanvas.width=t.clientWidth*e,this._mainCanvas.height=t.clientHeight*e}}if(this._overviewCanvas){let t=this._overviewCanvas.parentElement;if(t){let e=window.devicePixelRatio||1;this._overviewCanvas.width=t.clientWidth*e,this._overviewCanvas.height=t.clientHeight*e}}}_drawAll(){this._drawMainWaveform(),this._drawOverviewWaveform(),this._updateOverviewViewport()}_drawMainWaveform(){if(!this._mainCanvas||0===this._peaks.length)return;let t=this._mainCanvas.getContext("2d"),e=this._mainCanvas.width,i=this._mainCanvas.height,o=window.devicePixelRatio||1;t.clearRect(0,0,e,i);let n=getComputedStyle(document.documentElement).getPropertyValue("--retold-bg-primary").trim()||"#1e1e2e";t.fillStyle=n,t.fillRect(0,0,e,i);let r=this._peaks,s=r.length,a=Math.floor(this._viewStart*s),l=Math.ceil(this._viewEnd*s)-a;if(l<=0)return;let d=i/2;if(this._selectionStart>=0&&this._selectionEnd>=0){let n=Math.min(this._selectionStart,this._selectionEnd),r=Math.max(this._selectionStart,this._selectionEnd),s=this._viewEnd-this._viewStart,a=(n-this._viewStart)/s*e,l=(r-this._viewStart)/s*e;if(a=Math.max(0,a),l=Math.min(e,l),l>a){let e=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa";t.fillStyle=e+"22",t.fillRect(a,0,l-a,i),t.strokeStyle=e,t.lineWidth=2*o,t.beginPath(),t.moveTo(a,0),t.lineTo(a,i),t.stroke(),t.beginPath(),t.moveTo(l,0),t.lineTo(l,i),t.stroke()}}let c=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-dim").trim()||"#585b70";t.strokeStyle=c,t.lineWidth=1,t.setLineDash([4,4]),t.beginPath(),t.moveTo(0,d),t.lineTo(e,d),t.stroke(),t.setLineDash([]);let p=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa",h=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-secondary").trim()||"#cdd6f4";for(let i=0;i<e;i++){let o=a+i/e*l,n=a+(i+1)/e*l,c=Math.floor(o),u=Math.ceil(n);c=Math.max(0,Math.min(c,s-1)),u=Math.max(c+1,Math.min(u,s));let m=0,f=0;for(let t=c;t<u;t++)r[t].Min<m&&(m=r[t].Min),r[t].Max>f&&(f=r[t].Max);let g=d-f*d*.9,v=d-m*d*.9,b=Math.max(1,v-g),y=this._viewStart+i/e*(this._viewEnd-this._viewStart),w=!1;if(this._selectionStart>=0&&this._selectionEnd>=0){let t=Math.min(this._selectionStart,this._selectionEnd),e=Math.max(this._selectionStart,this._selectionEnd);w=y>=t&&y<=e}t.fillStyle=w?p:h,t.fillRect(i,g,1,b)}this._cursorX>=0&&this._cursorX<e&&(t.strokeStyle="#ffffff44",t.lineWidth=1,t.beginPath(),t.moveTo(this._cursorX*o,0),t.lineTo(this._cursorX*o,i),t.stroke())}_drawOverviewWaveform(){if(!this._overviewCanvas||0===this._peaks.length)return;let t=this._overviewCanvas.getContext("2d"),e=this._overviewCanvas.width,i=this._overviewCanvas.height;t.clearRect(0,0,e,i);let o=getComputedStyle(document.documentElement).getPropertyValue("--retold-bg-tertiary").trim()||"#313244";t.fillStyle=o,t.fillRect(0,0,e,i);let n=this._peaks,r=n.length,s=i/2,a=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-muted").trim()||"#a6adc8";if(this._selectionStart>=0&&this._selectionEnd>=0){let o=Math.min(this._selectionStart,this._selectionEnd),n=Math.max(this._selectionStart,this._selectionEnd),r=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa";t.fillStyle=r+"33",t.fillRect(o*e,0,(n-o)*e,i)}for(let i=0;i<e;i++){let o=i/e*r,l=(i+1)/e*r,d=Math.floor(o),c=Math.ceil(l);d=Math.max(0,Math.min(d,r-1)),c=Math.max(d+1,Math.min(c,r));let p=0,h=0;for(let t=d;t<c;t++)n[t].Min<p&&(p=n[t].Min),n[t].Max>h&&(h=n[t].Max);let u=s-h*s*.85,m=s-p*s*.85,f=Math.max(1,m-u);t.fillStyle=a,t.fillRect(i,u,1,f)}}_updateOverviewViewport(){let t=document.getElementById("RetoldRemote-AEX-OverviewViewport");if(!t)return;let e=document.getElementById("RetoldRemote-AEX-OverviewWrap");if(!e)return;let i=e.clientWidth,o=this._viewStart*i,n=this._viewEnd*i;t.style.left=o+"px",t.style.width=n-o+"px"}_bindCanvasEvents(){let t=this,e=document.getElementById("RetoldRemote-AEX-CanvasWrap");if(!e)return;e.addEventListener("mousemove",i=>{let o=e.getBoundingClientRect();if(t._cursorX=i.clientX-o.left,t._isDragging){let e=t._viewStart+t._cursorX/o.width*(t._viewEnd-t._viewStart);e=Math.max(0,Math.min(1,e)),t._selectionEnd=e,t._drawMainWaveform(),t._drawOverviewWaveform(),t._updateSelectionButtons()}t._updateTimeDisplay(),t._drawMainWaveform()}),e.addEventListener("mouseleave",()=>{t._cursorX=-1,t._drawMainWaveform()}),e.addEventListener("mousedown",i=>{if(0!==i.button)return;let o=e.getBoundingClientRect(),n=t._viewStart+(i.clientX-o.left)/o.width*(t._viewEnd-t._viewStart);n=Math.max(0,Math.min(1,n)),t._isDragging=!0,t._selectionStart=n,t._selectionEnd=n,t._dragStart=n,t._segmentURL=null;let r=document.getElementById("RetoldRemote-AEX-Playback");r&&(r.style.display="none")}),window.addEventListener("mouseup",()=>{t._isDragging&&(t._isDragging=!1,Math.abs(t._selectionEnd-t._selectionStart)<.001&&(t._selectionStart=-1,t._selectionEnd=-1),t._updateSelectionButtons(),t._drawAll(),t._updateTimeDisplay(),t._saveState())}),e.addEventListener("wheel",i=>{i.preventDefault();let o=e.getBoundingClientRect(),n=(i.clientX-o.left)/o.width,r=i.deltaY>0?1.2:.8;t._zoomAtPoint(n,r)},{passive:!1});let i=document.getElementById("RetoldRemote-AEX-OverviewWrap");i&&i.addEventListener("click",e=>{let o=i.getBoundingClientRect(),n=(e.clientX-o.left)/o.width;n=Math.max(0,Math.min(1,n));let r=t._viewEnd-t._viewStart,s=n-r/2;s=Math.max(0,Math.min(1-r,s)),t._viewStart=s,t._viewEnd=s+r,t._drawAll(),t._updateTimeDisplay()})}_zoomAtPoint(t,e){let i=this._viewEnd-this._viewStart,o=this._viewStart+t*i,n=i*e;n=Math.max(this._minZoom,Math.min(1,n));let r=o-t*n,s=r+n;r<0&&(r=0,s=n),s>1&&(s=1,r=1-n),this._viewStart=Math.max(0,r),this._viewEnd=Math.min(1,s),this._drawAll(),this._updateTimeDisplay()}_updateTimeDisplay(){if(!this._waveformData)return;let t=this._waveformData.Duration,e=document.getElementById("RetoldRemote-AEX-ViewRange");if(e){let i=this._viewStart*t,o=this._viewEnd*t;e.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(i,!0)+" - "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(o,!0)}let i=document.getElementById("RetoldRemote-AEX-SelectionRange");if(i)if(this._selectionStart>=0&&this._selectionEnd>=0){let e=Math.min(this._selectionStart,this._selectionEnd)*t,o=Math.max(this._selectionStart,this._selectionEnd)*t,n=o-e;i.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(e,!0)+" - "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(o,!0)+" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(n,!0)+")"}else i.textContent="None";let o=document.getElementById("RetoldRemote-AEX-CursorTime");if(o)if(this._cursorX>=0&&this._mainCanvas){let e=this._mainCanvas.parentElement;if(e){let i=this._viewStart+this._cursorX/e.clientWidth*(this._viewEnd-this._viewStart);o.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(i*t,!0)}}else o.textContent="--"}_updateSelectionButtons(){let t=this._selectionStart>=0&&this._selectionEnd>=0&&Math.abs(this._selectionEnd-this._selectionStart)>=.001,e=document.getElementById("RetoldRemote-AEX-ZoomSelBtn");e&&(e.disabled=!t);let i=document.getElementById("RetoldRemote-AEX-PlaySelBtn");i&&(i.disabled=!t);let o=document.getElementById("RetoldRemote-AEX-SaveSelBtn");o&&(o.disabled=!t)}zoomIn(){this._zoomAtPoint(.5,.5)}zoomOut(){this._zoomAtPoint(.5,2)}zoomToFit(){this._viewStart=0,this._viewEnd=1,this._drawAll(),this._updateTimeDisplay()}zoomToSelection(){if(this._selectionStart<0||this._selectionEnd<0)return;let t=Math.min(this._selectionStart,this._selectionEnd),e=Math.max(this._selectionStart,this._selectionEnd),i=.05*(e-t);this._viewStart=Math.max(0,t-i),this._viewEnd=Math.min(1,e+i),this._drawAll(),this._updateTimeDisplay()}clearSelection(){this._selectionStart=-1,this._selectionEnd=-1,this._segmentURL=null;let t=document.getElementById("RetoldRemote-AEX-Playback");t&&(t.style.display="none"),this._updateSelectionButtons(),this._drawAll(),this._updateTimeDisplay(),this._saveState()}_applyPendingSelection(){if(this._pendingSelectionStartSec<0||this._pendingSelectionEndSec<0)return;if(!this._waveformData||!this._waveformData.Duration||this._waveformData.Duration<=0)return;let t=this._waveformData.Duration;this._selectionStart=Math.min(this._pendingSelectionStartSec,this._pendingSelectionEndSec)/t,this._selectionEnd=Math.max(this._pendingSelectionStartSec,this._pendingSelectionEndSec)/t,this._selectionStart=Math.max(0,Math.min(1,this._selectionStart)),this._selectionEnd=Math.max(0,Math.min(1,this._selectionEnd)),this._pendingSelectionStartSec=-1,this._pendingSelectionEndSec=-1}saveSelectionToCollection(){if(this._selectionStart<0||this._selectionEnd<0)return;let t=this.pict.providers["RetoldRemote-CollectionManager"];if(!t)return;let e=t.getQuickAddTargetGUID();if(e)t.addAudioSnippetToCollection(e);else{let e=this._waveformData&&this._waveformData.Duration?this._waveformData.Duration:0,i=Math.round(this._selectionStart*e*100)/100,o=Math.round(this._selectionEnd*e*100)/100;t.setPendingClipContext({Type:"audio-clip",Start:i,End:o});let n=this.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.showAddToCollectionDropdown&&n.showAddToCollectionDropdown()}}playSelection(){if(this._selectionStart<0||this._selectionEnd<0||!this._waveformData)return;let t=this._waveformData.Duration,e=Math.min(this._selectionStart,this._selectionEnd)*t,i=Math.max(this._selectionStart,this._selectionEnd)*t,o=this.pict.providers["RetoldRemote-Provider"],n="/api/media/audio-segment?path="+(o?o._getPathParam(this._currentPath):encodeURIComponent(this._currentPath))+"&start="+e.toFixed(3)+"&end="+i.toFixed(3)+"&format=mp3",r=document.getElementById("RetoldRemote-AEX-Playback");r&&(r.style.display="");let s=document.getElementById("RetoldRemote-AEX-Audio");s&&(s.src=n,s.load(),s.play().catch(()=>{})),this._segmentURL=n}goBack(){if(this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._currentPath){let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"audio")}else{let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}}_saveState(){if(!this._currentPath||!this._waveformData)return;this.pict.providers["RetoldRemote-Provider"];let t=[];if(this._selectionStart>=0&&this._selectionEnd>=0&&Math.abs(this._selectionEnd-this._selectionStart)>=.001){let e=this._waveformData.Duration||0,i=Math.min(this._selectionStart,this._selectionEnd),o=Math.max(this._selectionStart,this._selectionEnd),n=Math.round(i*e*100)/100,r=Math.round(o*e*100)/100,s=this.pict.providers["RetoldRemote-FormattingUtilities"];t.push({Start:i,End:o,StartSeconds:n,EndSeconds:r,Label:s.formatTimestamp(n,!0)+" - "+s.formatTimestamp(r,!0)})}let e={Path:this._currentPath,Selections:t,ViewStart:this._viewStart,ViewEnd:this._viewEnd};fetch("/api/media/audio-explorer-state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(()=>{})}_loadSavedState(){let t=this,e=this.pict.providers["RetoldRemote-Provider"],i=e?e._getPathParam(this._currentPath):encodeURIComponent(this._currentPath);fetch("/api/media/audio-explorer-state?path="+i).then(t=>t.json()).then(e=>{if(e&&e.Success&&e.State){let i=e.State;if("number"==typeof i.ViewStart&&"number"==typeof i.ViewEnd&&(t._viewStart=i.ViewStart,t._viewEnd=i.ViewEnd),Array.isArray(i.Selections)&&i.Selections.length>0){let e=i.Selections[0];t._selectionStart=e.Start,t._selectionEnd=e.End}}t._applyPendingSelection(),t._updateSelectionButtons(),t._drawAll(),t._updateTimeDisplay()}).catch(()=>{t._applyPendingSelection(),t._updateSelectionButtons(),t._drawAll(),t._updateTimeDisplay()})}_showError(t){let e=document.getElementById("RetoldRemote-AEX-Body");e&&(e.innerHTML='<div class="retold-remote-aex-error"><div class="retold-remote-aex-error-message">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-aex-nav-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].goBack()">Back to Audio</button></div>')}}r.default_configuration=n,e.exports=r},{"pict-view":76}],137:[function(t,e,i){
|
|
189
|
+
e.exports={_buildEbookHTML:function(t,e,i){return'<div class="retold-remote-ebook-wrap"><div class="retold-remote-ebook-toc collapsed" id="RetoldRemote-EbookTOC"><div class="retold-remote-ebook-toc-header"><span>Contents</span><button class="retold-remote-ebook-toc-close" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleEbookTOC()" title="Close">×</button></div><div class="retold-remote-ebook-toc-items" id="RetoldRemote-EbookTOCItems"></div></div><div class="retold-remote-ebook-reader"><div class="retold-remote-ebook-content" id="RetoldRemote-EbookContent"><div class="retold-remote-ebook-loading">Loading ebook...</div></div><div class="retold-remote-ebook-controls"><button class="retold-remote-ebook-toc-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleEbookTOC()">☰ TOC</button><button class="retold-remote-ebook-page-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].ebookPrevPage()">← Prev</button><button class="retold-remote-ebook-page-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].ebookNextPage()">Next →</button></div></div></div>'},_loadEbookViewer:function(t,e){let i=this;if("mobi"===e.replace(/^.*\./,"").toLowerCase()){if(!(this.pict.AppData.RetoldRemote.ServerCapabilities||{}).ebook_convert){let e=document.getElementById("RetoldRemote-EbookContent");return void(e&&(e.innerHTML='<div class="retold-remote-ebook-loading">MOBI viewing requires Calibre (ebook-convert) on the server.<br><a href="'+t+'" target="_blank" style="color: var(--retold-accent); margin-top: 12px; display: inline-block;">Download file</a></div>'))}let o=document.getElementById("RetoldRemote-EbookContent");o&&(o.innerHTML='<div class="retold-remote-ebook-loading">Converting MOBI to EPUB...</div>');let n=this.pict.providers["RetoldRemote-Provider"],r=n?n._getPathParam(e):encodeURIComponent(e);fetch("/api/media/ebook-convert?path="+r).then(t=>t.json()).then(t=>{if(!t||!t.Success)throw new Error(t?t.Error:"Conversion failed.");let e="/api/media/ebook/"+t.CacheKey+"/"+t.OutputFilename;i._renderEpub(e)}).catch(e=>{let o=document.getElementById("RetoldRemote-EbookContent");o&&(o.innerHTML='<div class="retold-remote-ebook-loading">Failed to convert: '+i.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.message)+'<br><a href="'+t+'" target="_blank" style="color: var(--retold-accent); margin-top: 12px; display: inline-block;">Download file</a></div>')})}else this._renderEpub(t)},_renderEpub:function(t){let e=this;if("undefined"==typeof window||"function"!=typeof window.ePub){let t=document.getElementById("RetoldRemote-EbookContent");return void(t&&(t.innerHTML='<div class="retold-remote-ebook-loading">epub.js library not loaded.</div>'))}if(this._activeBook){try{this._activeBook.destroy()}catch(t){}this._activeBook=null,this._activeRendition=null}let i=document.getElementById("RetoldRemote-EbookContent");i&&(i.innerHTML="",fetch(t).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.arrayBuffer()}).then(t=>{let o=window.ePub(t);e._activeBook=o;let n=o.renderTo(i,{width:"100%",height:"100%",spread:"none"});e._activeRendition=n,n.display(),n.themes.default({body:{color:"var(--retold-text-primary, #d4d4d4)",background:"var(--retold-bg-primary, #1e1e1e)","font-family":'Georgia, "Times New Roman", serif',"line-height":"1.6",padding:"20px 40px"},a:{color:"var(--retold-accent, #569cd6)"}}),o.loaded.navigation.then(t=>{e._renderEbookTOC(t.toc)})}).catch(t=>{i&&(i.innerHTML='<div class="retold-remote-ebook-loading">Failed to load ebook: '+e.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.message)+"</div>")}))},_renderEbookTOC:function(t){let e=document.getElementById("RetoldRemote-EbookTOCItems");if(!e||!t)return;let i=this,o="",n=function(t,e){for(let r=0;r<t.length;r++){let s=t[r],a=e>0?" indent-"+Math.min(e,2):"";o+='<button class="retold-remote-ebook-toc-item'+a+'" data-href="'+i.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.href)+"\" onclick=\"pict.views['RetoldRemote-MediaViewer'].ebookGoToChapter(this.getAttribute('data-href'))\">"+i.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.label.trim())+"</button>",s.subitems&&s.subitems.length>0&&n(s.subitems,e+1)}};n(t,0),e.innerHTML=o},ebookGoToChapter:function(t){this._activeRendition&&t&&this._activeRendition.display(t)},ebookPrevPage:function(){this._activeRendition&&this._activeRendition.prev()},ebookNextPage:function(){this._activeRendition&&this._activeRendition.next()},toggleEbookTOC:function(){let t=document.getElementById("RetoldRemote-EbookTOC");t&&t.classList.toggle("collapsed")}}},{}],139:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-AudioExplorer",DefaultRenderable:"RetoldRemote-AudioExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i),this._currentPath="",this._waveformData=null,this._peaks=[],this._viewStart=0,this._viewEnd=1,this._minZoom=.005,this._selectionStart=-1,this._selectionEnd=-1,this._isDragging=!1,this._dragStart=-1,this._cursorX=-1,this._segmentURL=null,this._mainCanvas=null,this._overviewCanvas=null,this._resizeObserver=null}showExplorer(t,e,i){let o=this.pict.AppData.RetoldRemote;o.ActiveMode="audio-explorer",o.CurrentViewerFile=t,o.CurrentViewerMediaType="audio",this._currentPath=t,this._waveformData=null,this._peaks=[],this._viewStart=0,this._viewEnd=1,this._segmentURL=null,this._pendingSelectionStartSec="number"==typeof e&&e>=0?e:-1,this._pendingSelectionEndSec="number"==typeof i&&i>=0?i:-1,this._selectionStart=-1,this._selectionEnd=-1;let n=this.pict.providers["RetoldRemote-Provider"],r="#/explore-audio/"+(n?n.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",r):window.location.hash=r;let s=document.getElementById("RetoldRemote-Gallery-Container"),a=document.getElementById("RetoldRemote-Viewer-Container");s&&(s.style.display="none"),a&&(a.style.display="block");let l=t.replace(/^.*\//,""),d='<div class="retold-remote-aex">';d+='<div class="retold-remote-aex-header">',d+='<button class="retold-remote-aex-nav-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].goBack()" title="Back (Esc)">← Back</button>',d+='<div class="retold-remote-aex-title">Audio Explorer — '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l)+"</div>",d+='<div class="retold-remote-aex-actions">',d+='<button class="retold-remote-aex-action-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].playInBrowser()" title="Play in browser">▶ Play</button>',d+='<button class="retold-remote-aex-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream with VLC (v)">▶ VLC</button>',d+="</div>",d+="</div>",d+='<div class="retold-remote-aex-info" id="RetoldRemote-AEX-Info" style="display:none;"></div>',d+='<div class="retold-remote-aex-controls" id="RetoldRemote-AEX-Controls" style="display:none;">',d+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomIn()" title="Zoom In (+)">+ Zoom In</button>',d+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomOut()" title="Zoom Out (-)">- Zoom Out</button>',d+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomToFit()" title="Zoom to Fit (0)">Fit All</button>',d+='<button class="retold-remote-aex-btn" id="RetoldRemote-AEX-ZoomSelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomToSelection()" title="Zoom to Selection (Z)" disabled>Zoom to Selection</button>',d+='<button class="retold-remote-aex-btn" id="RetoldRemote-AEX-PlaySelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].playSelection()" title="Play Selection (Space)" disabled>▶ Play Selection</button>',d+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].clearSelection()" title="Clear Selection (Esc)">Clear Selection</button>',d+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 4px;"></span>',d+='<button class="retold-remote-aex-save-btn" id="RetoldRemote-AEX-SaveSelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].saveSelectionToCollection()" title="Save segment to collection (s)" disabled>Save Segment</button>',d+="</div>",d+='<div class="retold-remote-aex-body" id="RetoldRemote-AEX-Body">',d+='<div class="retold-remote-aex-loading">',d+='<div class="retold-remote-aex-loading-spinner"></div>',d+="Analyzing audio waveform...",d+="</div>",d+="</div>",d+='<div class="retold-remote-aex-time-bar" id="RetoldRemote-AEX-TimeBar" style="display:none;">',d+='<span class="retold-remote-aex-time-label">View:</span>',d+='<span class="retold-remote-aex-time-value" id="RetoldRemote-AEX-ViewRange">--</span>',d+='<span class="retold-remote-aex-time-label" style="margin-left: 12px;">Selection:</span>',d+='<span class="retold-remote-aex-time-selection" id="RetoldRemote-AEX-SelectionRange">None</span>',d+='<span class="retold-remote-aex-time-label" style="margin-left: 12px;">Cursor:</span>',d+='<span class="retold-remote-aex-time-value" id="RetoldRemote-AEX-CursorTime">--</span>',d+="</div>",d+='<div class="retold-remote-aex-playback" id="RetoldRemote-AEX-Playback" style="display:none;">',d+='<span class="retold-remote-aex-playback-label">Segment:</span>',d+='<audio controls id="RetoldRemote-AEX-Audio"></audio>',d+="</div>",d+="</div>",a&&(a.innerHTML=d);let c=this.pict.views["ContentEditor-TopBar"];c&&c.updateInfo(),this._fetchWaveform(t)}_fetchWaveform(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"],o=i?i._getPathParam(t):encodeURIComponent(t);fetch("/api/media/audio-waveform?path="+o+"&peaks=2000").then(t=>t.json()).then(t=>{t&&t.Success?(e._waveformData=t,e._peaks=t.Peaks||[],e._renderWaveformUI()):e._showError(t?t.Error:"Unknown error")}).catch(t=>{e._showError(t.message)})}_renderWaveformUI(){let t=this._waveformData;if(!t)return;let e=document.getElementById("RetoldRemote-AEX-Info");if(e){let i="";i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Duration</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.DurationFormatted)+"</span></span>",t.SampleRate&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Sample Rate</span> <span class="retold-remote-aex-info-value">'+(t.SampleRate/1e3).toFixed(1)+" kHz</span></span>"),t.Channels&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Channels</span> <span class="retold-remote-aex-info-value">'+t.Channels+(t.ChannelLayout?" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.ChannelLayout)+")":"")+"</span></span>"),t.Codec&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Codec</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Codec)+"</span></span>"),t.Bitrate&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Bitrate</span> <span class="retold-remote-aex-info-value">'+Math.round(t.Bitrate/1e3)+" kbps</span></span>"),t.FileSize&&(i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Size</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(t.FileSize)+"</span></span>"),i+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Peaks</span> <span class="retold-remote-aex-info-value">'+t.PeakCount+" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Method)+")</span></span>",e.innerHTML=i,e.style.display=""}let i=document.getElementById("RetoldRemote-AEX-Controls");i&&(i.style.display="");let o=document.getElementById("RetoldRemote-AEX-TimeBar");o&&(o.style.display="");let n=document.getElementById("RetoldRemote-AEX-Body");if(n){let t="";t+='<div class="retold-remote-aex-canvas-wrap" id="RetoldRemote-AEX-CanvasWrap">',t+='<canvas id="RetoldRemote-AEX-MainCanvas"></canvas>',t+="</div>",t+='<div class="retold-remote-aex-overview-wrap" id="RetoldRemote-AEX-OverviewWrap">',t+='<canvas id="RetoldRemote-AEX-OverviewCanvas"></canvas>',t+='<div class="retold-remote-aex-overview-viewport" id="RetoldRemote-AEX-OverviewViewport"></div>',t+="</div>",n.innerHTML=t}this._mainCanvas=document.getElementById("RetoldRemote-AEX-MainCanvas"),this._overviewCanvas=document.getElementById("RetoldRemote-AEX-OverviewCanvas"),this._bindCanvasEvents(),this._resizeCanvases(),this._drawAll(),this._updateTimeDisplay();let r=this;if("undefined"!=typeof ResizeObserver){this._resizeObserver=new ResizeObserver(()=>{r._resizeCanvases(),r._drawAll()});let t=document.getElementById("RetoldRemote-AEX-CanvasWrap");t&&this._resizeObserver.observe(t)}this._loadSavedState()}_resizeCanvases(){if(this._mainCanvas){let t=this._mainCanvas.parentElement;if(t){let e=window.devicePixelRatio||1;this._mainCanvas.width=t.clientWidth*e,this._mainCanvas.height=t.clientHeight*e}}if(this._overviewCanvas){let t=this._overviewCanvas.parentElement;if(t){let e=window.devicePixelRatio||1;this._overviewCanvas.width=t.clientWidth*e,this._overviewCanvas.height=t.clientHeight*e}}}_drawAll(){this._drawMainWaveform(),this._drawOverviewWaveform(),this._updateOverviewViewport()}_drawMainWaveform(){if(!this._mainCanvas||0===this._peaks.length)return;let t=this._mainCanvas.getContext("2d"),e=this._mainCanvas.width,i=this._mainCanvas.height,o=window.devicePixelRatio||1;t.clearRect(0,0,e,i);let n=getComputedStyle(document.documentElement).getPropertyValue("--retold-bg-primary").trim()||"#1e1e2e";t.fillStyle=n,t.fillRect(0,0,e,i);let r=this._peaks,s=r.length,a=Math.floor(this._viewStart*s),l=Math.ceil(this._viewEnd*s)-a;if(l<=0)return;let d=i/2;if(this._selectionStart>=0&&this._selectionEnd>=0){let n=Math.min(this._selectionStart,this._selectionEnd),r=Math.max(this._selectionStart,this._selectionEnd),s=this._viewEnd-this._viewStart,a=(n-this._viewStart)/s*e,l=(r-this._viewStart)/s*e;if(a=Math.max(0,a),l=Math.min(e,l),l>a){let e=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa";t.fillStyle=e+"22",t.fillRect(a,0,l-a,i),t.strokeStyle=e,t.lineWidth=2*o,t.beginPath(),t.moveTo(a,0),t.lineTo(a,i),t.stroke(),t.beginPath(),t.moveTo(l,0),t.lineTo(l,i),t.stroke()}}let c=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-dim").trim()||"#585b70";t.strokeStyle=c,t.lineWidth=1,t.setLineDash([4,4]),t.beginPath(),t.moveTo(0,d),t.lineTo(e,d),t.stroke(),t.setLineDash([]);let p=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa",h=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-secondary").trim()||"#cdd6f4";for(let i=0;i<e;i++){let o=a+i/e*l,n=a+(i+1)/e*l,c=Math.floor(o),u=Math.ceil(n);c=Math.max(0,Math.min(c,s-1)),u=Math.max(c+1,Math.min(u,s));let m=0,f=0;for(let t=c;t<u;t++)r[t].Min<m&&(m=r[t].Min),r[t].Max>f&&(f=r[t].Max);let g=d-f*d*.9,v=d-m*d*.9,b=Math.max(1,v-g),w=this._viewStart+i/e*(this._viewEnd-this._viewStart),y=!1;if(this._selectionStart>=0&&this._selectionEnd>=0){let t=Math.min(this._selectionStart,this._selectionEnd),e=Math.max(this._selectionStart,this._selectionEnd);y=w>=t&&w<=e}t.fillStyle=y?p:h,t.fillRect(i,g,1,b)}this._cursorX>=0&&this._cursorX<e&&(t.strokeStyle="#ffffff44",t.lineWidth=1,t.beginPath(),t.moveTo(this._cursorX*o,0),t.lineTo(this._cursorX*o,i),t.stroke())}_drawOverviewWaveform(){if(!this._overviewCanvas||0===this._peaks.length)return;let t=this._overviewCanvas.getContext("2d"),e=this._overviewCanvas.width,i=this._overviewCanvas.height;t.clearRect(0,0,e,i);let o=getComputedStyle(document.documentElement).getPropertyValue("--retold-bg-tertiary").trim()||"#313244";t.fillStyle=o,t.fillRect(0,0,e,i);let n=this._peaks,r=n.length,s=i/2,a=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-muted").trim()||"#a6adc8";if(this._selectionStart>=0&&this._selectionEnd>=0){let o=Math.min(this._selectionStart,this._selectionEnd),n=Math.max(this._selectionStart,this._selectionEnd),r=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa";t.fillStyle=r+"33",t.fillRect(o*e,0,(n-o)*e,i)}for(let i=0;i<e;i++){let o=i/e*r,l=(i+1)/e*r,d=Math.floor(o),c=Math.ceil(l);d=Math.max(0,Math.min(d,r-1)),c=Math.max(d+1,Math.min(c,r));let p=0,h=0;for(let t=d;t<c;t++)n[t].Min<p&&(p=n[t].Min),n[t].Max>h&&(h=n[t].Max);let u=s-h*s*.85,m=s-p*s*.85,f=Math.max(1,m-u);t.fillStyle=a,t.fillRect(i,u,1,f)}}_updateOverviewViewport(){let t=document.getElementById("RetoldRemote-AEX-OverviewViewport");if(!t)return;let e=document.getElementById("RetoldRemote-AEX-OverviewWrap");if(!e)return;let i=e.clientWidth,o=this._viewStart*i,n=this._viewEnd*i;t.style.left=o+"px",t.style.width=n-o+"px"}_bindCanvasEvents(){let t=this,e=document.getElementById("RetoldRemote-AEX-CanvasWrap");if(!e)return;e.addEventListener("mousemove",i=>{let o=e.getBoundingClientRect();if(t._cursorX=i.clientX-o.left,t._isDragging){let e=t._viewStart+t._cursorX/o.width*(t._viewEnd-t._viewStart);e=Math.max(0,Math.min(1,e)),t._selectionEnd=e,t._drawMainWaveform(),t._drawOverviewWaveform(),t._updateSelectionButtons()}t._updateTimeDisplay(),t._drawMainWaveform()}),e.addEventListener("mouseleave",()=>{t._cursorX=-1,t._drawMainWaveform()}),e.addEventListener("mousedown",i=>{if(0!==i.button)return;let o=e.getBoundingClientRect(),n=t._viewStart+(i.clientX-o.left)/o.width*(t._viewEnd-t._viewStart);n=Math.max(0,Math.min(1,n)),t._isDragging=!0,t._selectionStart=n,t._selectionEnd=n,t._dragStart=n,t._segmentURL=null;let r=document.getElementById("RetoldRemote-AEX-Playback");r&&(r.style.display="none")}),window.addEventListener("mouseup",()=>{t._isDragging&&(t._isDragging=!1,Math.abs(t._selectionEnd-t._selectionStart)<.001&&(t._selectionStart=-1,t._selectionEnd=-1),t._updateSelectionButtons(),t._drawAll(),t._updateTimeDisplay(),t._saveState())}),e.addEventListener("wheel",i=>{i.preventDefault();let o=e.getBoundingClientRect(),n=(i.clientX-o.left)/o.width,r=i.deltaY>0?1.2:.8;t._zoomAtPoint(n,r)},{passive:!1});let i=document.getElementById("RetoldRemote-AEX-OverviewWrap");i&&i.addEventListener("click",e=>{let o=i.getBoundingClientRect(),n=(e.clientX-o.left)/o.width;n=Math.max(0,Math.min(1,n));let r=t._viewEnd-t._viewStart,s=n-r/2;s=Math.max(0,Math.min(1-r,s)),t._viewStart=s,t._viewEnd=s+r,t._drawAll(),t._updateTimeDisplay()})}_zoomAtPoint(t,e){let i=this._viewEnd-this._viewStart,o=this._viewStart+t*i,n=i*e;n=Math.max(this._minZoom,Math.min(1,n));let r=o-t*n,s=r+n;r<0&&(r=0,s=n),s>1&&(s=1,r=1-n),this._viewStart=Math.max(0,r),this._viewEnd=Math.min(1,s),this._drawAll(),this._updateTimeDisplay()}_updateTimeDisplay(){if(!this._waveformData)return;let t=this._waveformData.Duration,e=document.getElementById("RetoldRemote-AEX-ViewRange");if(e){let i=this._viewStart*t,o=this._viewEnd*t;e.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(i,!0)+" - "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(o,!0)}let i=document.getElementById("RetoldRemote-AEX-SelectionRange");if(i)if(this._selectionStart>=0&&this._selectionEnd>=0){let e=Math.min(this._selectionStart,this._selectionEnd)*t,o=Math.max(this._selectionStart,this._selectionEnd)*t,n=o-e;i.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(e,!0)+" - "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(o,!0)+" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(n,!0)+")"}else i.textContent="None";let o=document.getElementById("RetoldRemote-AEX-CursorTime");if(o)if(this._cursorX>=0&&this._mainCanvas){let e=this._mainCanvas.parentElement;if(e){let i=this._viewStart+this._cursorX/e.clientWidth*(this._viewEnd-this._viewStart);o.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(i*t,!0)}}else o.textContent="--"}_updateSelectionButtons(){let t=this._selectionStart>=0&&this._selectionEnd>=0&&Math.abs(this._selectionEnd-this._selectionStart)>=.001,e=document.getElementById("RetoldRemote-AEX-ZoomSelBtn");e&&(e.disabled=!t);let i=document.getElementById("RetoldRemote-AEX-PlaySelBtn");i&&(i.disabled=!t);let o=document.getElementById("RetoldRemote-AEX-SaveSelBtn");o&&(o.disabled=!t)}zoomIn(){this._zoomAtPoint(.5,.5)}zoomOut(){this._zoomAtPoint(.5,2)}zoomToFit(){this._viewStart=0,this._viewEnd=1,this._drawAll(),this._updateTimeDisplay()}zoomToSelection(){if(this._selectionStart<0||this._selectionEnd<0)return;let t=Math.min(this._selectionStart,this._selectionEnd),e=Math.max(this._selectionStart,this._selectionEnd),i=.05*(e-t);this._viewStart=Math.max(0,t-i),this._viewEnd=Math.min(1,e+i),this._drawAll(),this._updateTimeDisplay()}clearSelection(){this._selectionStart=-1,this._selectionEnd=-1,this._segmentURL=null;let t=document.getElementById("RetoldRemote-AEX-Playback");t&&(t.style.display="none"),this._updateSelectionButtons(),this._drawAll(),this._updateTimeDisplay(),this._saveState()}_applyPendingSelection(){if(this._pendingSelectionStartSec<0||this._pendingSelectionEndSec<0)return;if(!this._waveformData||!this._waveformData.Duration||this._waveformData.Duration<=0)return;let t=this._waveformData.Duration;this._selectionStart=Math.min(this._pendingSelectionStartSec,this._pendingSelectionEndSec)/t,this._selectionEnd=Math.max(this._pendingSelectionStartSec,this._pendingSelectionEndSec)/t,this._selectionStart=Math.max(0,Math.min(1,this._selectionStart)),this._selectionEnd=Math.max(0,Math.min(1,this._selectionEnd)),this._pendingSelectionStartSec=-1,this._pendingSelectionEndSec=-1}saveSelectionToCollection(){if(this._selectionStart<0||this._selectionEnd<0)return;let t=this.pict.providers["RetoldRemote-CollectionManager"];if(!t)return;let e=t.getQuickAddTargetGUID();if(e)t.addAudioSnippetToCollection(e);else{let e=this._waveformData&&this._waveformData.Duration?this._waveformData.Duration:0,i=Math.round(this._selectionStart*e*100)/100,o=Math.round(this._selectionEnd*e*100)/100;t.setPendingClipContext({Type:"audio-clip",Start:i,End:o});let n=this.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.showAddToCollectionDropdown&&n.showAddToCollectionDropdown()}}playSelection(){if(this._selectionStart<0||this._selectionEnd<0||!this._waveformData)return;let t=this._waveformData.Duration,e=Math.min(this._selectionStart,this._selectionEnd)*t,i=Math.max(this._selectionStart,this._selectionEnd)*t,o=this.pict.providers["RetoldRemote-Provider"],n="/api/media/audio-segment?path="+(o?o._getPathParam(this._currentPath):encodeURIComponent(this._currentPath))+"&start="+e.toFixed(3)+"&end="+i.toFixed(3)+"&format=mp3",r=document.getElementById("RetoldRemote-AEX-Playback");r&&(r.style.display="");let s=document.getElementById("RetoldRemote-AEX-Audio");s&&(s.src=n,s.load(),s.play().catch(()=>{})),this._segmentURL=n}goBack(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null);let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}playInBrowser(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null);let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"audio")}_saveState(){if(!this._currentPath||!this._waveformData)return;this.pict.providers["RetoldRemote-Provider"];let t=[];if(this._selectionStart>=0&&this._selectionEnd>=0&&Math.abs(this._selectionEnd-this._selectionStart)>=.001){let e=this._waveformData.Duration||0,i=Math.min(this._selectionStart,this._selectionEnd),o=Math.max(this._selectionStart,this._selectionEnd),n=Math.round(i*e*100)/100,r=Math.round(o*e*100)/100,s=this.pict.providers["RetoldRemote-FormattingUtilities"];t.push({Start:i,End:o,StartSeconds:n,EndSeconds:r,Label:s.formatTimestamp(n,!0)+" - "+s.formatTimestamp(r,!0)})}let e={Path:this._currentPath,Selections:t,ViewStart:this._viewStart,ViewEnd:this._viewEnd};fetch("/api/media/audio-explorer-state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(()=>{})}_loadSavedState(){let t=this,e=this.pict.providers["RetoldRemote-Provider"],i=e?e._getPathParam(this._currentPath):encodeURIComponent(this._currentPath);fetch("/api/media/audio-explorer-state?path="+i).then(t=>t.json()).then(e=>{if(e&&e.Success&&e.State){let i=e.State;if("number"==typeof i.ViewStart&&"number"==typeof i.ViewEnd&&(t._viewStart=i.ViewStart,t._viewEnd=i.ViewEnd),Array.isArray(i.Selections)&&i.Selections.length>0){let e=i.Selections[0];t._selectionStart=e.Start,t._selectionEnd=e.End}}t._applyPendingSelection(),t._updateSelectionButtons(),t._drawAll(),t._updateTimeDisplay()}).catch(()=>{t._applyPendingSelection(),t._updateSelectionButtons(),t._drawAll(),t._updateTimeDisplay()})}_showError(t){let e=document.getElementById("RetoldRemote-AEX-Body");e&&(e.innerHTML='<div class="retold-remote-aex-error"><div class="retold-remote-aex-error-message">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-aex-nav-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].goBack()">Back to Audio</button></div>')}}r.default_configuration=n,e.exports=r},{"pict-view":88}],140:[function(t,e,i){
|
|
190
190
|
/**
|
|
191
191
|
* Retold Remote -- Collections Panel View
|
|
192
192
|
*
|
|
@@ -202,7 +202,7 @@ e.exports={_buildEbookHTML:function(t,e,i){return'<div class="retold-remote-eboo
|
|
|
202
202
|
*
|
|
203
203
|
* @license MIT
|
|
204
204
|
*/
|
|
205
|
-
const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-CollectionsPanel",DefaultRenderable:"RetoldRemote-CollectionsPanel",DefaultDestinationAddress:"#RetoldRemote-Collections-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-CollectionsPanel",Template:'<div class="retold-remote-collections-panel" id="RetoldRemote-CollectionsPanel-Root"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-CollectionsPanel",TemplateHash:"RetoldRemote-CollectionsPanel",DestinationAddress:"#RetoldRemote-Collections-Container"}]};class r extends o{constructor(t,e,i){super(t,e,i),this._draggedItemId=null}onAfterRender(){super.onAfterRender(),this.renderContent()}renderContent(){let t=document.getElementById("RetoldRemote-CollectionsPanel-Root");if(t)switch(this.pict.AppData.RetoldRemote.CollectionsPanelMode){case"detail":this._renderDetailMode(t);break;case"edit":this._renderEditMode(t);break;default:this._renderListMode(t)}}_renderListMode(t){let e=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"];t.innerHTML="";let n=document.createElement("div");n.className="retold-remote-collections-header";let r=document.createElement("div");r.className="retold-remote-collections-header-title",r.textContent="Collections";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="New Collection",s.textContent="+",s.onclick=()=>{let t=prompt("Collection name:");t&&t.trim()&&o.createCollection(t.trim(),(t,e)=>{!t&&e&&(i.CollectionsPanelMode="detail",o.fetchCollection(e.GUID))})},n.appendChild(r),n.appendChild(s),t.appendChild(n);let a=document.createElement("div");a.className="retold-remote-collections-search";let l=document.createElement("input");l.type="text",l.placeholder="Search collections...",l.value=i.CollectionSearchQuery||"",l.oninput=o=>{i.CollectionSearchQuery=o.target.value,e._renderCollectionCards(t.querySelector(".retold-remote-collections-body"))},a.appendChild(l),t.appendChild(a);let d=document.createElement("div");d.className="retold-remote-collections-body",t.appendChild(d),this._renderCollectionCards(d)}_renderCollectionCards(t){if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"],o=this.pict.providers["RetoldRemote-Icons"];t.innerHTML="";let n=i.searchCollections(e.CollectionSearchQuery);if(!n||0===n.length){let i=document.createElement("div");return i.className="retold-remote-collections-empty",i.textContent=e.CollectionSearchQuery?"No collections match your search.":"No collections yet. Click + to create one.",void t.appendChild(i)}for(let r=0;r<n.length;r++){let s=n[r],a=document.createElement("div");a.className="retold-remote-collection-card",a.onclick=()=>{e.CollectionsPanelMode="detail",i.fetchCollection(s.GUID)};let l=document.createElement("div");l.className="retold-remote-collection-card-icon",o&&"function"==typeof o.getIcon?l.innerHTML=o.getIcon("bookmark",18):l.textContent="☰";let d=document.createElement("div");d.className="retold-remote-collection-card-info";let c=document.createElement("div");c.className="retold-remote-collection-card-name",c.textContent=s.Name||"Untitled";let p=document.createElement("div");p.className="retold-remote-collection-card-meta",p.textContent=s.ItemCount+" item"+(1!==s.ItemCount?"s":""),d.appendChild(c),d.appendChild(p),a.appendChild(l),a.appendChild(d),t.appendChild(a)}}_renderDetailMode(t){let e=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"],n=i.ActiveCollection;if(t.innerHTML="",!n)return void(t.innerHTML='<div class="retold-remote-collections-empty">Loading...</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="Back to list",s.textContent="←",s.onclick=()=>{i.CollectionsPanelMode="list",i.ActiveCollectionGUID=null,i.ActiveCollection=null,e.renderContent()};let a=document.createElement("div");a.className="retold-remote-collections-header-title",a.textContent=n.Name||"Untitled";let l=document.createElement("button");l.className="retold-remote-collections-header-btn",l.title="Edit collection",l.textContent="✎",l.onclick=()=>{i.CollectionsPanelMode="edit",e.renderContent()},r.appendChild(s),r.appendChild(a),r.appendChild(l),t.appendChild(r);let d="operation-plan"===n.CollectionType;if(d){let e=document.createElement("div");e.className="retold-remote-collections-detail-controls retold-remote-collections-op-controls";let i=n.Items||[],r=0,s=0,a=0,l=0;for(let t=0;t<i.length;t++){let e=i[t].OperationStatus;"completed"===e?s++:"failed"===e?a++:"skipped"===e?l++:i[t].Operation&&r++}let d=document.createElement("div");d.className="retold-remote-collections-op-summary";let c=[];r>0&&c.push(r+" pending"),s>0&&c.push(s+" done"),a>0&&c.push(a+" failed"),l>0&&c.push(l+" skipped"),d.textContent=c.join(" · ")||"No operations",e.appendChild(d);let p=document.createElement("div");if(p.className="retold-remote-collections-op-buttons",r>0){let t=document.createElement("button");t.className="retold-remote-collections-op-execute-btn",t.textContent="Execute "+r+" Move"+(r>1?"s":""),t.onclick=()=>{t.disabled=!0,t.textContent="Moving...",o.executeCollectionOperations(n.GUID)},p.appendChild(t)}if(n.OperationBatchGUID&&s>0){let t=document.createElement("button");t.className="retold-remote-collections-op-undo-btn",t.textContent="Undo",t.onclick=()=>{t.disabled=!0,t.textContent="Undoing...",o.undoCollectionOperations(n.GUID)},p.appendChild(t)}e.appendChild(p),t.appendChild(e)}else{let e=document.createElement("div");e.className="retold-remote-collections-detail-controls";let r=document.createElement("select");r.className="retold-remote-collections-sort-select";let s=[{value:"manual",label:"Manual"},{value:"name",label:"Name"},{value:"modified",label:"Date Added"},{value:"type",label:"Type"}];for(let t=0;t<s.length;t++){let e=document.createElement("option");e.value=s[t].value,e.textContent=s[t].label,n.SortMode===s[t].value&&(e.selected=!0),r.appendChild(e)}r.onchange=t=>{o.sortActiveCollection(t.target.value,null)};let a=document.createElement("button");a.className="retold-remote-collections-sort-dir",a.textContent="desc"===n.SortDirection?"↓":"↑",a.title="desc"===n.SortDirection?"Descending":"Ascending",a.onclick=()=>{let t="desc"===i.ActiveCollection.SortDirection?"asc":"desc";o.sortActiveCollection(null,t)},e.appendChild(r),e.appendChild(a),t.appendChild(e)}let c=document.createElement("div");c.className="retold-remote-collections-body",t.appendChild(c),d?this._renderOperationItemList(c,n):this._renderItemList(c,n)}_renderItemList(t,e){let i=this,o=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-CollectionManager"]),n=e.Items||[];if(t.innerHTML="",0===n.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items yet. Browse files and add them to this collection.",void t.appendChild(e)}for(let r=0;r<n.length;r++){let s=n[r],a=document.createElement("div");if(a.className="retold-remote-collection-item",a.setAttribute("data-item-id",s.ID),"manual"===e.SortMode){let e=document.createElement("div");e.className="retold-remote-collection-item-drag",e.textContent="☰",e.draggable=!0,e.ondragstart=t=>{i._draggedItemId=s.ID,a.classList.add("dragging"),t.dataTransfer.effectAllowed="move"},e.ondragend=()=>{a.classList.remove("dragging"),i._draggedItemId=null;let e=t.querySelectorAll(".retold-remote-collection-item");for(let t=0;t<e.length;t++)e[t].classList.remove("drag-over")},a.appendChild(e)}a.ondragover=t=>{t.preventDefault(),t.dataTransfer.dropEffect="move",a.classList.add("drag-over")},a.ondragleave=()=>{a.classList.remove("drag-over")},a.ondrop=t=>{if(t.preventDefault(),a.classList.remove("drag-over"),i._draggedItemId&&i._draggedItemId!==s.ID){let t=e.Items||[],n=[];for(let e=0;e<t.length;e++)t[e].ID!==i._draggedItemId&&(t[e].ID===s.ID&&n.push(i._draggedItemId),n.push(t[e].ID));o.reorderItems(e.GUID,n)}};let l=document.createElement("div");l.className="retold-remote-collection-item-icon";let d=s.Path||"",c=d.replace(/^.*\./,"").toLowerCase(),p=this.pict.PictApplication._getMediaType(c);if("video-frame"===s.Type&&s.FrameCacheKey&&s.FrameFilename){let t=document.createElement("img");t.src="/api/media/video-frame/"+encodeURIComponent(s.FrameCacheKey)+"/"+encodeURIComponent(s.FrameFilename),t.alt="",t.loading="lazy",l.appendChild(t)}else if("image-crop"===s.Type&&s.CropRegion){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(d,48,48)),t.alt="",t.loading="lazy",l.appendChild(t)}else if("image"===p&&"file"===s.Type){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(d,48,48)),t.alt="",t.loading="lazy",l.appendChild(t)}else l.textContent=this._getTypeIcon(s.Type,p);let h=document.createElement("div");h.className="retold-remote-collection-item-name",h.textContent=s.Label||d.split("/").pop()||d,h.title=d;let u=document.createElement("div");u.className="retold-remote-collection-item-type",u.textContent=s.Type||"file";let m=document.createElement("button");m.className="retold-remote-collection-item-remove",m.title="Remove from collection",m.textContent="×",m.onclick=t=>{t.stopPropagation(),o.removeItemFromCollection(e.GUID,s.ID)};let f=r;a.onclick=()=>{if("folder"===s.Type||"folder-contents"===s.Type)i.pict.PictApplication.loadFileList(s.Path);else{let t=i.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._navigateToCollectionItem(s,f)}},a.appendChild(l),a.appendChild(h),a.appendChild(u),a.appendChild(m),t.appendChild(a)}}_renderOperationItemList(t,e){let i=this,o=this.pict.providers["RetoldRemote-CollectionManager"],n=e.Items||[];if(t.innerHTML="",0===n.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items in this sort plan.",void t.appendChild(e)}for(let r=0;r<n.length;r++){let s=n[r],a=document.createElement("div");a.className="retold-remote-collection-op-item";let l=s.OperationStatus||"pending";a.classList.add("op-status-"+l);let d=document.createElement("div");d.className="retold-remote-collection-op-status","completed"===l?(d.textContent="✓",d.title="Completed"):"failed"===l?(d.textContent="✗",d.title=s.OperationError||"Failed"):"skipped"===l?(d.textContent="—",d.title="Skipped"):(d.textContent="○",d.title="Pending");let c=document.createElement("div");c.className="retold-remote-collection-op-source";let p=s.Path||"";c.textContent=p.split("/").pop()||p,c.title=p;let h=document.createElement("div");h.className="retold-remote-collection-op-arrow",h.textContent="→";let u=document.createElement("div");u.className="retold-remote-collection-op-dest";let m=s.DestinationPath||"";u.textContent=m||"(no destination)",u.title=m,"pending"===l&&(u.style.cursor="pointer",u.onclick=t=>{t.stopPropagation(),i._startEditDestination(u,s,e)});let f=document.createElement("div");f.className="retold-remote-collection-op-badge",f.textContent=(s.Operation||"move").toUpperCase();let g=document.createElement("button");if(g.className="retold-remote-collection-item-remove",g.title="Skip this operation",g.textContent="×","pending"===l?g.onclick=t=>{t.stopPropagation(),o.skipItemOperation(s.ID)}:g.style.visibility="hidden","failed"===l&&s.OperationError){let t=document.createElement("div");t.className="retold-remote-collection-op-error",t.textContent=s.OperationError,a.appendChild(t)}a.appendChild(d),a.appendChild(c),a.appendChild(h),a.appendChild(u),a.appendChild(f),a.appendChild(g),t.appendChild(a)}}_startEditDestination(t,e,i){let o=this.pict.providers["RetoldRemote-CollectionManager"],n=document.createElement("input");n.type="text",n.className="retold-remote-collection-op-dest-input",n.value=e.DestinationPath||"";n.onblur=()=>{let i=n.value.trim();i&&i!==e.DestinationPath&&o.setItemDestination(e.ID,i),t.textContent=i||e.DestinationPath||"(no destination)",t.title=i||e.DestinationPath||""},n.onkeydown=i=>{"Enter"===i.key?(i.preventDefault(),n.blur()):"Escape"===i.key&&(i.preventDefault(),t.textContent=e.DestinationPath||"(no destination)",t.title=e.DestinationPath||"")},t.textContent="",t.appendChild(n),n.focus(),n.select()}_renderEditMode(t){let e=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"],n=i.ActiveCollection;if(t.innerHTML="",!n)return void(t.innerHTML='<div class="retold-remote-collections-empty">No collection selected.</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="Back to detail",s.textContent="←",s.onclick=()=>{i.CollectionsPanelMode="detail",e.renderContent()};let a=document.createElement("div");a.className="retold-remote-collections-header-title",a.textContent="Edit Collection",r.appendChild(s),r.appendChild(a),t.appendChild(r);let l=document.createElement("div");l.className="retold-remote-collections-body";let d=document.createElement("div");d.className="retold-remote-collections-edit",d.appendChild(this._createEditGroup("Name","input",n.Name||"","edit-name")),d.appendChild(this._createEditGroup("Description (Markdown)","textarea",n.Description||"","edit-description"));let c=this._createEditGroup("Cover Image Path","input",n.CoverImage||"","edit-cover"),p=this.pict.AppData.ContentEditor.CurrentFile;if(p){let t=document.createElement("button");t.className="retold-remote-collections-edit-btn",t.textContent="Use current file",t.style.marginTop="4px",t.style.fontSize="0.72rem",t.onclick=()=>{let t=document.getElementById("retold-remote-edit-cover");t&&(t.value=p)},c.appendChild(t)}d.appendChild(c),d.appendChild(this._createEditGroup("Tags (comma-separated)","input",(n.Tags||[]).join(", "),"edit-tags"));let h=document.createElement("div");h.className="retold-remote-collections-edit-actions";let u=document.createElement("button");u.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-primary",u.textContent="Save",u.onclick=()=>{let t=document.getElementById("retold-remote-edit-name"),e=document.getElementById("retold-remote-edit-description"),r=document.getElementById("retold-remote-edit-cover"),s=document.getElementById("retold-remote-edit-tags"),a={GUID:n.GUID,Name:t?t.value:n.Name,Description:e?e.value:n.Description,CoverImage:r?r.value:n.CoverImage,Tags:s?s.value.split(",").map(t=>t.trim()).filter(t=>t):n.Tags};o.updateCollection(a,t=>{if(!t){i.CollectionsPanelMode="detail",o.fetchCollection(n.GUID);let t=o._getToast();t&&t.show("Collection saved")}})};let m=document.createElement("button");m.className="retold-remote-collections-edit-btn",m.textContent="Cancel",m.onclick=()=>{i.CollectionsPanelMode="detail",e.renderContent()},h.appendChild(u),h.appendChild(m),d.appendChild(h);let f=document.createElement("button");f.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-danger",f.textContent="Delete Collection",f.onclick=()=>{confirm("Delete this collection? This cannot be undone.")&&o.deleteCollection(n.GUID)},d.appendChild(f),l.appendChild(d),t.appendChild(l)}_createEditGroup(t,e,i,o){let n=document.createElement("div");n.className="retold-remote-collections-edit-group";let r,s=document.createElement("div");return s.className="retold-remote-collections-edit-label",s.textContent=t,"textarea"===e?(r=document.createElement("textarea"),r.className="retold-remote-collections-edit-textarea"):(r=document.createElement("input"),r.className="retold-remote-collections-edit-input",r.type="text"),r.value=i,r.id="retold-remote-"+o,n.appendChild(s),n.appendChild(r),n}_getTypeIcon(t,e){switch(t){case"folder":case"folder-contents":return"📁";case"subfile":return"🗄";case"image-crop":return"✂";case"audio-clip":return"🎵";case"video-clip":case"video-frame":return"🎬"}switch(e){case"image":return"🖼";case"video":return"🎬";case"audio":return"🎵";default:return"📄"}}}r.default_configuration=n,e.exports=r},{"pict-view":76}],138:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-FileInfoPanel",DefaultRenderable:"RetoldRemote-FileInfoPanel",DefaultDestinationAddress:"#RetoldRemote-Info-Container",AutoRender:!1,CSS:"",DefaultTemplateRecordAddress:!1,Templates:[{Hash:"RetoldRemote-FileInfoPanel",Template:'<div class="retold-remote-info" id="RetoldRemote-Info-Body"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-FileInfoPanel",TemplateHash:"RetoldRemote-FileInfoPanel",DestinationAddress:"#RetoldRemote-Info-Container"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._currentPath=null,this._currentMetadata=null,this._extracting=!1}onAfterRender(){this._refreshForCurrentFile()}_refreshForCurrentFile(){let t=this.pict.AppData.RetoldRemote,e="";if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.CurrentFile&&(e=this.pict.AppData.ContentEditor.CurrentFile),!e&&t.CurrentViewerFile&&(e=t.CurrentViewerFile),!e){let i=t.GalleryItems||[],o=t.GalleryCursorIndex||0;i.length>0&&i[o]&&i[o].Path&&(e=i[o].Path)}e?e===this._currentPath&&this._currentMetadata?this._renderMetadata(this._currentMetadata):(this._currentPath=e,this._currentMetadata=null,this._fetchMetadata(e,!1)):this._renderEmpty("No file selected")}_fetchMetadata(t,e){let i=this,o="/api/media/extended-metadata?path="+encodeURIComponent(t);e&&(o+="&extract=true",this._extracting=!0,this._renderSpinner()),fetch(o).then(t=>t.json()).then(e=>{i._extracting=!1,e&&e.Success?(i._currentMetadata=e,i.pict.AppData.RetoldRemote.CurrentFileMetadata=e,i._renderMetadata(e)):e&&!1===e.Cached?i._renderUncached(t):i._renderEmpty("Could not load metadata")}).catch(t=>{i._extracting=!1,i._renderEmpty("Error: "+t.message)})}extractMetadata(){!this._extracting&&this._currentPath&&this._fetchMetadata(this._currentPath,!0)}_getExtension(t){let e=(t||"").split("/").pop()||"",i=e.lastIndexOf(".");return i<1?"":e.substring(i)}_getHashForCurrentFile(){let t=this.pict.providers.RetoldRemote;if(t&&"function"==typeof t.getHashForPath){let e=t.getHashForPath(this._currentPath);if(e)return e}let e=this.pict.AppData.RetoldRemote.GalleryItems||[];for(let t=0;t<e.length;t++)if(e[t].Path===this._currentPath&&e[t].Hash)return e[t].Hash;return null}_triggerDownload(t,e){let i=document.createElement("a");i.href=t,i.download=e,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}downloadFile(){if(!this._currentPath)return;let t=this._currentPath.split("/").pop()||this._currentPath,e="/content/"+encodeURIComponent(this._currentPath);this._triggerDownload(e,t)}downloadHashedFile(){if(!this._currentPath)return;let t=this._getHashForCurrentFile();if(!t)return void this.fable.log.warn("No hash available for file: "+this._currentPath);let e=t+this._getExtension(this._currentPath),i="/content/"+encodeURIComponent(this._currentPath);this._triggerDownload(i,e)}_getInfoBody(){return document.getElementById("RetoldRemote-Info-Body")}_renderEmpty(t){let e=this._getInfoBody();e&&(e.innerHTML=`<div class="retold-remote-info-empty">${this._esc(t)}</div>`)}_renderSpinner(){let t=this._getInfoBody();t&&(t.innerHTML='<div class="retold-remote-info-spinner">Extracting metadata...</div>')}_renderUncached(t){let e=this._getInfoBody();if(!e)return;let i=t.split("/").pop()||t,o=t.substring(0,t.length-i.length),n=this.pict.AppData.RetoldRemote.GalleryItems||[],r=null;for(let e=0;e<n.length;e++)if(n[e].Path===t){r=n[e];break}let s="";s+=`<div class="retold-remote-info-filename">${this._esc(i)}</div>`,s+=`<div class="retold-remote-info-path">${this._esc(o)}</div>`,r&&(s+='<div class="retold-remote-info-section">',s+='<div class="retold-remote-info-section-title">Basic</div>',r.Size&&(s+=this._row("Size",this._formatSize(r.Size))),r.Type&&(s+=this._row("Type",r.Type)),r.Extension&&(s+=this._row("Extension",r.Extension)),s+="</div>"),s+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].extractMetadata()">Extract Metadata</button>',s+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadFile()" style="margin-top: 4px;">Download File</button>',s+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadHashedFile()" style="margin-top: 4px;">Download Hashed File</button>',e.innerHTML=s}_renderMetadata(t){let e=this._getInfoBody();if(!e)return;let i=(t.Path||"").split("/").pop()||t.Path,o=(t.Path||"").substring(0,(t.Path||"").length-i.length),n="";if(n+=`<div class="retold-remote-info-filename">${this._esc(i)}</div>`,n+=`<div class="retold-remote-info-path">${this._esc(o)}</div>`,n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Basic</div>',n+=this._row("Size",this._formatSize(t.FileSize)),n+=this._row("Category",t.Category||"unknown"),t.Extension&&(n+=this._row("Extension",t.Extension)),t.Modified&&(n+=this._row("Modified",this._formatDate(t.Modified))),t.Created&&(n+=this._row("Created",this._formatDate(t.Created))),t.MD5&&(n+='<div class="retold-remote-info-row">',n+='<span class="retold-remote-info-label">MD5</span>',n+=`<span class="retold-remote-info-value retold-remote-info-value-mono">${this._esc(t.MD5)}</span>`,n+="</div>"),n+="</div>",(t.FormatName||t.Duration)&&(n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Format</div>',t.FormatName&&(n+=this._row("Container",t.FormatName)),t.Duration&&(n+=this._row("Duration",this._formatDuration(t.Duration))),t.Bitrate&&(n+=this._row("Bitrate",this._formatBitrate(t.Bitrate))),n+="</div>"),t.Video){n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Video</div>';let e=t.Video;if(e.Codec){let t=e.Codec;e.Profile&&(t+=` (${e.Profile}`,e.Level&&(t+=` ${e.Level}`),t+=")"),n+=this._row("Codec",t)}e.Width&&e.Height&&(n+=this._row("Resolution",`${e.Width}×${e.Height}`)),e.FrameRate&&(n+=this._row("Frame Rate",this._formatFrameRate(e.FrameRate))),e.PixelFormat&&(n+=this._row("Pixel Format",e.PixelFormat)),e.ColorSpace&&(n+=this._row("Color Space",e.ColorSpace)),e.Bitrate&&(n+=this._row("Bitrate",this._formatBitrate(e.Bitrate))),n+="</div>"}if(t.Audio){n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Audio</div>';let e=t.Audio;if(e.Codec){let t=e.Codec;e.Profile&&(t+=` (${e.Profile})`),n+=this._row("Codec",t)}if(e.SampleRate&&(n+=this._row("Sample Rate",e.SampleRate+" Hz")),e.Channels){let t=e.ChannelLayout||e.Channels+" ch";n+=this._row("Channels",t)}e.Bitrate&&(n+=this._row("Bitrate",this._formatBitrate(e.Bitrate))),e.BitsPerSample&&(n+=this._row("Bit Depth",e.BitsPerSample+"-bit")),n+="</div>"}if(t.Image){let e=t.Image;if(n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Image</div>',e.Width&&e.Height&&(n+=this._row("Dimensions",`${e.Width}×${e.Height}`)),e.Format&&(n+=this._row("Format",e.Format)),e.Space&&(n+=this._row("Color Space",e.Space)),e.DPI&&(n+=this._row("DPI",e.DPI)),null!==e.HasAlpha&&void 0!==e.HasAlpha&&(n+=this._row("Alpha",e.HasAlpha?"Yes":"No")),n+="</div>",e.EXIF){let t=e.EXIF;if(t.Make||t.Model||t.ExposureTime||t.Software){if(n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">EXIF</div>',(t.Make||t.Model)&&(n+=this._row("Camera",((t.Make||"")+" "+(t.Model||"")).trim())),t.LensModel&&(n+=this._row("Lens",t.LensModel)),t.ExposureTime||t.FNumber||t.ISO){let e="";t.ExposureTime&&(e+=t.ExposureTime<1?`1/${Math.round(1/t.ExposureTime)}s`:t.ExposureTime+"s"),t.FNumber&&(e+=(e?" ":"")+`f/${t.FNumber}`),t.ISO&&(e+=(e?" ":"")+`ISO ${t.ISO}`),n+=this._row("Exposure",e)}t.FocalLength&&(n+=this._row("Focal Length",t.FocalLength+"mm")),t.DateTimeOriginal&&(n+=this._row("Date Taken",this._formatDate(t.DateTimeOriginal))),t.Software&&(n+=this._row("Software",t.Software)),n+="</div>"}}if(e.GPS){let t=e.GPS;if(n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">GPS</div>',null!==t.Latitude&&null!==t.Longitude){let e=parseFloat(t.Latitude).toFixed(6),i=parseFloat(t.Longitude).toFixed(6),o=t.Latitude>=0?"N":"S",r=t.Longitude>=0?"E":"W";n+=this._row("Latitude",`${Math.abs(e)}° ${o}`),n+=this._row("Longitude",`${Math.abs(i)}° ${r}`),null!==t.Altitude&&void 0!==t.Altitude&&(n+=this._row("Altitude",Math.round(t.Altitude)+"m")),n+='<div style="margin-top: 4px;">',n+=`<a class="retold-remote-info-gps-link" href="${`https://www.google.com/maps?q=${e},${i}`}" target="_blank" rel="noopener">Open in Maps ↗</a>`,n+="</div>"}n+="</div>"}}if(t.Document){let e=t.Document;n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Document</div>',e.PageCount&&(n+=this._row("Pages",e.PageCount)),e.Title&&(n+=this._row("Title",e.Title)),e.Author&&(n+=this._row("Author",e.Author)),e.Subject&&(n+=this._row("Subject",e.Subject)),e.Keywords&&(n+=this._row("Keywords",e.Keywords)),e.Creator&&(n+=this._row("Creator",e.Creator)),e.Producer&&(n+=this._row("Producer",e.Producer)),e.CreatedDate&&(n+=this._row("Created",this._formatDate(e.CreatedDate))),e.ModifiedDate&&(n+=this._row("Modified",this._formatDate(e.ModifiedDate))),n+="</div>"}if(t.Tags&&Object.keys(t.Tags).length>0){n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Tags</div>';let e=Object.keys(t.Tags).sort();for(let i=0;i<e.length;i++){let o=e[i],r=t.Tags[o];n+='<div class="retold-remote-info-tag-row">',n+=`<span class="retold-remote-info-tag-key">${this._esc(o)}</span>`,n+=`<span class="retold-remote-info-tag-value">${this._esc(String(r))}</span>`,n+="</div>"}n+="</div>"}if(t.Chapters&&t.Chapters.length>0){n+='<div class="retold-remote-info-section">',n+=`<div class="retold-remote-info-section-title">Chapters (${t.Chapters.length})</div>`;for(let e=0;e<t.Chapters.length;e++){let i=t.Chapters[e];n+='<div class="retold-remote-info-chapter-row">',n+=`<span class="retold-remote-info-chapter-time">${this._formatDuration(i.StartTime)}</span>`,n+=`<span class="retold-remote-info-chapter-title">${this._esc(i.Title)}</span>`,n+="</div>"}n+="</div>"}n+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].extractMetadata()" style="margin-top: 8px;">Re-extract Metadata</button>',n+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadFile()" style="margin-top: 4px;">Download File</button>',n+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadHashedFile()" style="margin-top: 4px;">Download Hashed File</button>',e.innerHTML=n}_row(t,e){return`<div class="retold-remote-info-row"><span class="retold-remote-info-label">${this._esc(String(t))}</span><span class="retold-remote-info-value">${this._esc(String(e))}</span></div>`}_esc(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}_formatSize(t){if(!t&&0!==t)return"unknown";let e=parseInt(t,10);return e<1024?e+" B":e<1048576?(e/1024).toFixed(1)+" KB":e<1073741824?(e/1048576).toFixed(1)+" MB":(e/1073741824).toFixed(2)+" GB"}_formatDuration(t){if(!t&&0!==t)return"unknown";let e=Math.floor(t),i=Math.floor(e/3600),o=Math.floor(e%3600/60),n=e%60;return i>0?`${i}:${String(o).padStart(2,"0")}:${String(n).padStart(2,"0")}`:`${o}:${String(n).padStart(2,"0")}`}_formatBitrate(t){if(!t)return"unknown";let e=parseInt(t,10);return e<1e3?e+" bps":e<1e6?(e/1e3).toFixed(0)+" kbps":(e/1e6).toFixed(1)+" Mbps"}_formatFrameRate(t){if(!t)return"unknown";if("string"==typeof t&&t.includes("/")){let e=t.split("/"),i=parseFloat(e[0]),o=parseFloat(e[1]);if(o>0)return(i/o).toFixed(3).replace(/\.?0+$/,"")+" fps"}return t+" fps"}_formatDate(t){if(!t)return"unknown";try{let e=new Date(t);return isNaN(e.getTime())?String(t):e.toLocaleDateString()+" "+e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(e){return String(t)}}},e.exports.default_configuration=n},{"pict-view":76}],139:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-Gallery",DefaultRenderable:"RetoldRemote-Gallery-Grid",DefaultDestinationAddress:"#RetoldRemote-Gallery-Container",AutoRender:!1,CSS:"",Templates:[],Renderables:[]};class r extends o{constructor(t,e,i){super(t,e,i),this._intersectionObserver=null}renderGallery(){let t=document.getElementById("RetoldRemote-Gallery-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.GalleryItems||[],o=e.ViewMode||"list",n=e.ThumbnailSize||"medium",r=e.GalleryCursorIndex||0,s=document.getElementById("RetoldRemote-Gallery-Search"),a=s&&document.activeElement===s,l=a?s.selectionStart:0,d=a?s.selectionEnd:0,c=this._buildHeaderHTML(e.FilterState?e.FilterState.MediaType:"all");if(c+=this._buildFilterPanelHTML(),c+=this._buildFilterChipsHTML(),0===i.length){c+='<div class="retold-remote-empty">';let e=this.pict.providers["RetoldRemote-Icons"];if(c+='<div class="retold-remote-empty-icon"><span class="retold-remote-icon retold-remote-icon-xl">'+(e?e.getIcon("gallery-empty",96):"")+"</span></div>",c+="<div>Empty folder</div>",c+="</div>",t.innerHTML=c,a){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&(t.focus(),t.setSelectionRange(l,d))}return}if(c+="gallery"===o?this._buildGridHTML(i,n,r):this._buildListHTML(i,r),t.innerHTML=c,a){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&(t.focus(),t.setSelectionRange(l,d))}this._setupLazyLoading();let p=this.pict.providers["RetoldRemote-GalleryNavigation"];p&&p.recalculateColumns();let h=this.pict.views["ContentEditor-TopBar"];h&&h.updateFilterIcon&&h.updateFilterIcon()}_buildHeaderHTML(t){let e=this.pict.AppData.RetoldRemote;if(!e.FilterBarVisible)return"";let i=[{key:"all",label:"All"},{key:"images",label:"Images"},{key:"video",label:"Video"},{key:"audio",label:"Audio"},{key:"documents",label:"Docs"}],o='<div class="retold-remote-gallery-header">';o+='<div class="retold-remote-gallery-filter">';for(let e=0;e<i.length;e++){let n=i[e];o+='<button class="retold-remote-gallery-filter-btn'+(n.key===t?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].setFilter('"+n.key+"')\">"+n.label+"</button>"}o+="</div>",o+='<div class="retold-remote-gallery-sort">',o+='<select class="retold-remote-gallery-sort-select" id="RetoldRemote-Gallery-Sort" onchange="pict.views[\'RetoldRemote-Gallery\'].onSortChange(this.value)">';let n=[{value:"folder-first:asc",label:"Folders first"},{value:"name:asc",label:"Name A–Z"},{value:"name:desc",label:"Name Z–A"},{value:"modified:desc",label:"Newest modified"},{value:"modified:asc",label:"Oldest modified"},{value:"created:desc",label:"Newest created"},{value:"created:asc",label:"Oldest created"}],r=(e.SortField||"folder-first")+":"+(e.SortDirection||"asc");for(let t=0;t<n.length;t++){let e=n[t].value===r?" selected":"";o+='<option value="'+n[t].value+'"'+e+">"+n[t].label+"</option>"}o+="</select>",o+="</div>";let s=this.pict.providers["RetoldRemote-GalleryFilterSort"],a=s?s.getActiveFilterChips().length:0;o+='<button class="retold-remote-gallery-filter-btn retold-remote-gallery-filter-toggle'+(a>0?" has-filters":"")+'" onclick="pict.views[\'RetoldRemote-Gallery\'].toggleFilterPanel()">⚙ Filters',a>0&&(o+='<span class="retold-remote-gallery-filter-count">'+a+"</span>"),o+="</button>";let l=e.SearchQuery||"";o+='<input type="text" class="retold-remote-gallery-search" id="RetoldRemote-Gallery-Search" placeholder="Search files... (/)" value="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l)+'" oninput="pict.views[\'RetoldRemote-Gallery\'].onSearchInput(this.value)">';let d=e.SearchCaseSensitive||!1,c=e.SearchRegex||!1;return o+='<div class="retold-remote-gallery-search-options">',o+='<label class="retold-remote-gallery-search-option'+(d?" active":"")+'"><input type="checkbox" '+(d?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchCaseSensitiveChange(this.checked)\">Aa</label>",o+='<label class="retold-remote-gallery-search-option'+(c?" active":"")+'"><input type="checkbox" '+(c?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchRegexChange(this.checked)\">.*</label>",e._searchRegexError&&(o+='<span class="retold-remote-gallery-search-regex-error" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e._searchRegexError)+'">invalid regex</span>'),o+="</div>",o+="</div>",o}_buildFilterPanelHTML(){let t=this.pict.AppData.RetoldRemote;if(!t.FilterPanelOpen)return"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"],i=e?e.getAvailableExtensions():[],o=t.FilterState||{},n='<div class="retold-remote-filter-panel">';n+='<div class="retold-remote-filter-panel-grid">',n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">File Type</div>',n+='<div class="retold-remote-filter-ext-list">';let r=o.Extensions||[];for(let t=0;t<i.length;t++){let e=i[t];n+='<label class="retold-remote-filter-ext-item">',n+='<input type="checkbox" '+(0===r.length||r.indexOf(e.ext)>=0?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onExtensionToggle('"+e.ext+"', this.checked)\">",n+=" ."+e.ext+' <span class="retold-remote-filter-ext-count">('+e.count+")</span>",n+="</label>"}return n+="</div>",n+="</div>",n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">File Size</div>',n+='<div class="retold-remote-filter-row">',n+='<input type="number" class="retold-remote-filter-input" placeholder="Min KB" value="'+(null!==o.SizeMin&&void 0!==o.SizeMin?Math.round(o.SizeMin/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('min', this.value)\">",n+='<span class="retold-remote-filter-label">to</span>',n+='<input type="number" class="retold-remote-filter-input" placeholder="Max KB" value="'+(null!==o.SizeMax&&void 0!==o.SizeMax?Math.round(o.SizeMax/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('max', this.value)\">",n+='<span class="retold-remote-filter-label">KB</span>',n+="</div>",n+="</div>",n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">Modified Date</div>',n+='<div class="retold-remote-filter-row">',n+='<input type="date" class="retold-remote-filter-input" value="'+(o.DateModifiedAfter||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedAfter', this.value)\">",n+='<span class="retold-remote-filter-label">to</span>',n+='<input type="date" class="retold-remote-filter-input" value="'+(o.DateModifiedBefore||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedBefore', this.value)\">",n+="</div>",n+="</div>",n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">List Columns</div>',n+='<div class="retold-remote-filter-col-toggles">',n+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowExtension?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowExtension')\">Ext</button>",n+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowSize?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowSize')\">Size</button>",n+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowDate?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowDate')\">Date</button>",n+="</div>",n+="</div>",n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">Presets</div>',n+=this._buildPresetControlsHTML(),n+="</div>",n+='<div class="retold-remote-filter-actions">',n+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear All Filters</button>',n+="</div>",n+="</div>",n+="</div>",n}_buildPresetControlsHTML(){let t=this.pict.AppData.RetoldRemote.FilterPresets||[],e='<div class="retold-remote-filter-preset-row">';if(t.length>0){e+='<select class="retold-remote-filter-preset-select" id="RetoldRemote-Filter-PresetSelect" onchange="pict.views[\'RetoldRemote-Gallery\'].loadFilterPreset(this.value)">',e+='<option value="">Load preset...</option>';for(let i=0;i<t.length;i++)e+='<option value="'+i+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t[i].Name)+"</option>";e+="</select>",e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].deleteSelectedPreset()">✕</button>'}return e+='<input type="text" class="retold-remote-filter-preset-input" id="RetoldRemote-Filter-PresetName" placeholder="Preset name...">',e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].saveFilterPreset()">Save</button>',e+="</div>",e}_buildFilterChipsHTML(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(!t)return"";let e=t.getActiveFilterChips();if(0===e.length)return"";let i='<div class="retold-remote-filter-chips">';for(let t=0;t<e.length;t++){let o=e[t];i+='<span class="retold-remote-filter-chip">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(o.label)+" <button class=\"retold-remote-filter-chip-remove\" onclick=\"pict.views['RetoldRemote-Gallery'].removeFilterChip('"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(o.key)+"')\">×</button></span>"}return i+='<button class="retold-remote-filter-chip-clear" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear all</button>',i+="</div>",i}_buildGridHTML(t,e,i){let o='<div class="retold-remote-grid size-'+e+'">',n=this.pict.providers["RetoldRemote-Provider"],r=this.pict.providers["RetoldRemote-Icons"];for(let e=0;e<t.length;e++){let s=t[e],a=e===i?" selected":"",l=(s.Extension||"").toLowerCase(),d=this._getCategory(l,s.Type);if(o+='<div class="retold-remote-tile'+a+'" data-index="'+e+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+e+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+e+')">',o+='<div class="retold-remote-tile-thumb">',"folder"===s.Type)o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("folder",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Folder</span>';else if("archive"===s.Type)o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-archive",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Archive</span>';else if("image"===d&&n){let t=n.getThumbnailURL(s.Path,400,300);o+=t?'<img data-src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-image",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-image">'+l+"</span>"}else if("video"===d){if(n){let t=n.getThumbnailURL(s.Path,400,300);o+=t?'<img data-src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>"}else o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>";o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-video">Video</span>'}else"audio"===d?(o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-audio",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-audio">Audio</span>'):"document"===d?(o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-document">'+l+"</span>"):o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>";o+="</div>",o+='<div class="retold-remote-tile-label" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+"</div>","file"===s.Type&&void 0!==s.Size?o+='<div class="retold-remote-tile-meta">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(s.Size)+"</div>":"folder"===s.Type?o+='<div class="retold-remote-tile-meta">Folder</div>':"archive"===s.Type&&(o+='<div class="retold-remote-tile-meta">Archive'+(s.Size?" · "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(s.Size):"")+"</div>"),o+="</div>"}return o+="</div>",o}_buildListHTML(t,e){let i=this.pict.AppData.RetoldRemote,o=!1!==i.ListShowExtension,n=!1!==i.ListShowSize,r=!1!==i.ListShowDate,s='<div class="retold-remote-list">',a=this.pict.providers["RetoldRemote-Icons"];for(let i=0;i<t.length;i++){let l=t[i],d=i===e?" selected":"",c="";if(a&&(c='<span class="retold-remote-icon retold-remote-icon-sm">'+a.getIconForEntry(l,16)+"</span>"),s+='<div class="retold-remote-list-row'+d+'" data-index="'+i+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+i+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+i+')">',s+='<div class="retold-remote-list-icon">'+c+"</div>",s+='<div class="retold-remote-list-name" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name)+"\" ontouchstart=\"pict.views['RetoldRemote-Gallery']._onNameTouchStart(event, '"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name).replace(/'/g,"\\'")+"')\" ontouchend=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\" ontouchcancel=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\">"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name)+"</div>",o){let t="";"file"===l.Type||"archive"===l.Type?t=(l.Extension||"").replace(/^\./,"").toLowerCase():"folder"===l.Type&&(t=""),s+='<div class="retold-remote-list-ext">'+t+"</div>"}n&&("file"!==l.Type&&"archive"!==l.Type||void 0===l.Size?s+='<div class="retold-remote-list-size"></div>':s+='<div class="retold-remote-list-size">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(l.Size)+"</div>"),r&&(l.Modified?s+='<div class="retold-remote-list-date">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatShortDate(l.Modified)+"</div>":s+='<div class="retold-remote-list-date"></div>'),s+="</div>"}return s+="</div>",s}_setupLazyLoading(){this._intersectionObserver&&this._intersectionObserver.disconnect();let t=document.querySelectorAll(".retold-remote-tile-thumb img[data-src]");if(0!==t.length){this._intersectionObserver=new IntersectionObserver(t=>{for(let e=0;e<t.length;e++)if(t[e].isIntersecting){let i=t[e].target;i.src=i.getAttribute("data-src"),i.removeAttribute("data-src"),this._intersectionObserver.unobserve(i)}},{rootMargin:"200px"});for(let e=0;e<t.length;e++)this._intersectionObserver.observe(t[e])}}onTileClick(t){let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.moveCursor(t)}onTileDoubleClick(t){this.pict.AppData.RetoldRemote.GalleryCursorIndex=t;let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.openCurrent()}setFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState.MediaType=t;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}onSearchInput(t){this.pict.AppData.RetoldRemote.SearchQuery=t||"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchCaseSensitiveChange(t){this.pict.AppData.RetoldRemote.SearchCaseSensitive=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchRegexChange(t){this.pict.AppData.RetoldRemote.SearchRegex=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSortChange(t){let e=t.split(":"),i=this.pict.AppData.RetoldRemote;i.SortField=e[0],i.SortDirection=e[1]||"asc";let o=this.pict.providers["RetoldRemote-GalleryFilterSort"];o&&o.applyFilterSort(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}toggleFilterPanel(){let t=this.pict.AppData.RetoldRemote;t.FilterPanelOpen=!t.FilterPanelOpen,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}onExtensionToggle(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,o=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e)i.Extensions.length>0&&i.Extensions.push(t);else if(0===i.Extensions.length&&o){let e=o.getAvailableExtensions();i.Extensions=e.map(t=>t.ext).filter(e=>e!==t)}else i.Extensions=i.Extensions.filter(e=>e!==t);o&&o.applyFilterSort()}onSizeFilterChange(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,o=e&&""!==e?1024*parseInt(e,10):null;"min"===t?i.SizeMin=o:i.SizeMax=o;let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.applyFilterSort()}onDateFilterChange(t,e){this.pict.AppData.RetoldRemote.FilterState[t]=e||null;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}removeFilterChip(t){let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.removeFilter(t),e.applyFilterSort())}clearAllFilters(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];t&&(t.clearAllFilters(),t.applyFilterSort())}saveFilterPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetName");if(!t||!t.value.trim())return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.savePreset(t.value.trim()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}loadFilterPreset(t){if(""===t||null==t)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.loadPreset(parseInt(t,10)),e.applyFilterSort()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}deleteSelectedPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(!t||""===t.value)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.deletePreset(parseInt(t.value,10)),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}toggleListColumn(t){let e=this.pict.AppData.RetoldRemote,i=e[t];e[t]=!1===i,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}_onNameTouchStart(t,e){let i=this;this._clearLongPressTimer(),this._longPressTimer=setTimeout(function(){i._showLongPressTooltip(t,e)},500)}_onNameTouchEnd(t){this._clearLongPressTimer(),this._hideLongPressTooltip()}_clearLongPressTimer(){this._longPressTimer&&(clearTimeout(this._longPressTimer),this._longPressTimer=null)}_showLongPressTooltip(t,e){this._hideLongPressTooltip();let i=document.createElement("div");i.className="retold-remote-longpress-tooltip",i.textContent=e;let o=t.touches&&t.touches[0];o&&(i.style.left=Math.min(o.clientX,window.innerWidth-20)+"px",i.style.top=o.clientY-50+"px"),document.body.appendChild(i),this._longPressTooltipEl=i,t.preventDefault()}_hideLongPressTooltip(){this._longPressTooltipEl&&(this._longPressTooltipEl.parentNode&&this._longPressTooltipEl.parentNode.removeChild(this._longPressTooltipEl),this._longPressTooltipEl=null)}_getCategory(t,e){if("folder"===e)return"folder";if("archive"===e)return"archive";let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(i)return i.getCategory(t);let o=(t||"").replace(/^\./,"").toLowerCase();return"png"===o||"jpg"===o||"jpeg"===o||"gif"===o||"webp"===o?"image":"mp4"===o||"webm"===o||"mov"===o?"video":"mp3"===o||"wav"===o||"ogg"===o?"audio":"pdf"===o?"document":"other"}}r.default_configuration=n,e.exports=r},{"pict-view":76}],140:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-ImageExplorer",DefaultRenderable:"RetoldRemote-ImageExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i),this._currentPath="",this._osdViewer=null,this._dziData=null,this._osdLoaded=!1,this._loading=!1}showExplorer(t){if(this.pict.AppData.RetoldRemote.ActiveMode="image-explorer",this._currentPath=t,this._dziData=null,this._loading=!1,this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let e=this.pict.providers["RetoldRemote-Provider"],i="#/explore-image/"+(e?e.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",i):window.location.hash=i;let o=document.getElementById("RetoldRemote-Gallery-Container"),n=document.getElementById("RetoldRemote-Viewer-Container");o&&(o.style.display="none"),n&&(n.style.display="block");let r=t.replace(/^.*\//,""),s='<div class="retold-remote-iex">';s+='<div class="retold-remote-iex-header">',s+='<button class="retold-remote-iex-nav-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].goBack()" title="Back (Esc)">← Back</button>',s+='<div class="retold-remote-iex-title">Image Explorer — '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",s+="</div>",s+='<div class="retold-remote-iex-info" id="RetoldRemote-IEX-Info" style="display:none;"></div>',s+='<div class="retold-remote-iex-body" id="RetoldRemote-IEX-Body">',s+='<div class="retold-remote-iex-loading" id="RetoldRemote-IEX-Loading">',s+="<div>Loading image…</div>",s+="</div>",s+='<div id="RetoldRemote-IEX-Viewer" style="display:none;"></div>',s+="</div>",s+='<div class="retold-remote-iex-controls" id="RetoldRemote-IEX-Controls" style="display:none;">',s+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomIn()" title="Zoom In (+)">+ Zoom In</button>',s+='<span class="retold-remote-iex-zoom-label" id="RetoldRemote-IEX-ZoomLabel">100%</span>',s+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomOut()" title="Zoom Out (-)">- Zoom Out</button>',s+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomHome()" title="Fit to view (0)">Fit</button>',s+='<span style="flex:1;"></span>',s+='<span id="RetoldRemote-IEX-Coords" style="color:var(--retold-text-dim);font-size:0.72rem;"></span>',s+="</div>",s+="</div>",n&&(n.innerHTML=s);let a=this.pict.views["ContentEditor-TopBar"];a&&a.updateInfo(),this._ensureOSDLoaded(()=>{this._probeAndShow(t)})}_ensureOSDLoaded(t){if("undefined"!=typeof OpenSeadragon)return this._osdLoaded=!0,t();let e=this,i=document.createElement("script");i.src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/4.1.1/openseadragon.min.js",i.onload=function(){e._osdLoaded=!0,t()},i.onerror=function(){e._showError("Failed to load OpenSeadragon library.")},document.head.appendChild(i)}_probeAndShow(t){if(this._loading)return;this._loading=!0;let e=this,i=this.pict.providers["RetoldRemote-Provider"],o=i?i._getPathParam(t):encodeURIComponent(t);fetch("/api/media/image-preview?path="+o).then(t=>t.json()).then(i=>{if(!i||!i.Success)return e._loading=!1,void(e._isRawExtension(t)?e._showRawUnsupported():e._showSimpleImage(t));if(Math.max(i.OrigWidth||0,i.OrigHeight||0)>4096)e._generateAndShowTiles(t,o,i);else if(e._loading=!1,e._dziData={Width:i.OrigWidth,Height:i.OrigHeight},e._showSimpleImageInfo(i.OrigWidth,i.OrigHeight),i.IsRawFormat&&i.CacheKey){let t="/api/media/image-preview-file/"+encodeURIComponent(i.CacheKey)+"/"+encodeURIComponent(i.OutputFilename);e._initSimpleViewer(null,t)}else e._initSimpleViewer(t)}).catch(()=>{e._loading=!1,e._showSimpleImage(t)})}_showSimpleImage(t){this._dziData={Width:0,Height:0},this._initSimpleViewer(t)}_isRawExtension(t){return!!{nef:!0,nrw:!0,cr2:!0,cr3:!0,crw:!0,arw:!0,srf:!0,sr2:!0,raf:!0,orf:!0,rw2:!0,rwl:!0,pef:!0,srw:!0,x3f:!0,"3fr":!0,fff:!0,iiq:!0,dcr:!0,kdc:!0,mrw:!0,erf:!0,raw:!0,dng:!0,heic:!0,heif:!0}[(t||"").replace(/^.*\./,"").toLowerCase()]}_showRawUnsupported(){let t=document.getElementById("RetoldRemote-IEX-Loading");t&&(t.innerHTML='<div style="padding: 2em; text-align: center; color: #999;">Raw image preview not available.<br>Install dcraw on the server for raw camera format support.</div>')}_showSimpleImageInfo(t,e){let i=document.getElementById("RetoldRemote-IEX-Info");if(!i)return;let o="";o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',o+='<span class="retold-remote-iex-info-value">'+t+" × "+e+" px</span></span>",o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',o+='<span class="retold-remote-iex-info-value">'+(t*e/1e6).toFixed(1)+" MP</span></span>",o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',o+='<span class="retold-remote-iex-info-value">Direct</span></span>',i.innerHTML=o,i.style.display=""}_initSimpleViewer(t,e){let i=document.getElementById("RetoldRemote-IEX-Loading"),o=document.getElementById("RetoldRemote-IEX-Viewer"),n=document.getElementById("RetoldRemote-IEX-Controls");i&&(i.style.display="none"),o&&(o.style.display="block"),n&&(n.style.display="");let r,s=this;if(e)r=e;else{let e=this.pict.providers["RetoldRemote-Provider"];r=e?e.getContentURL(t):"/content/"+encodeURIComponent(t)}this._osdViewer=OpenSeadragon({id:"RetoldRemote-IEX-Viewer",tileSources:{type:"image",url:r},prefixUrl:"",showNavigationControl:!1,showNavigator:!0,navigatorPosition:"BOTTOM_RIGHT",navigatorSizeRatio:.15,animationTime:.3,blendTime:.1,minZoomLevel:.1,maxZoomLevel:20,visibilityRatio:.5,constrainDuringPan:!1,gestureSettingsMouse:{scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!0,flickEnabled:!1},gestureSettingsTouch:{pinchToZoom:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25}}),this._osdViewer.addHandler("zoom",function(){s._updateZoomLabel()}),this._osdViewer.addHandler("open",function(){let t=s._osdViewer.world.getItemAt(0);if(t){let e=t.getContentSize();e&&(s._dziData={Width:e.x,Height:e.y})}s._updateZoomLabel()}),void 0!==OpenSeadragon.MouseTracker&&new OpenSeadragon.MouseTracker({element:o,moveHandler:function(t){s._updateCoords(t.position)}})}_generateAndShowTiles(t,e,i){let o=this,n=null;i&&i.CacheKey&&i.OutputFilename&&(n="/api/media/image-preview-file/"+encodeURIComponent(i.CacheKey)+"/"+encodeURIComponent(i.OutputFilename)),n&&(this._dziData={Width:i.OrigWidth,Height:i.OrigHeight},this._showPreviewInfo(i.OrigWidth,i.OrigHeight),this._initSimpleViewer(null,n)),fetch("/api/media/dzi?path="+e).then(t=>t.json()).then(e=>{if(o._loading=!1,!e||!e.Success)return void(n||o._showSimpleImage(t));if(o._dziData=e,o._showInfo(e),o._osdViewer){try{o._osdViewer.destroy()}catch(t){}o._osdViewer=null}let i=document.getElementById("RetoldRemote-IEX-Viewer");i&&(i.innerHTML=""),o._initViewer(e)}).catch(e=>{o._loading=!1,n||o._showSimpleImage(t)})}_showPreviewInfo(t,e){let i=document.getElementById("RetoldRemote-IEX-Info");if(!i)return;let o="";o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',o+='<span class="retold-remote-iex-info-value">'+t+" × "+e+" px</span></span>",o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',o+='<span class="retold-remote-iex-info-value">'+(t*e/1e6).toFixed(1)+" MP</span></span>",o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',o+='<span class="retold-remote-iex-info-value retold-remote-iex-tiling-status">Preview — generating tiles…</span></span>',i.innerHTML=o,i.style.display=""}_showInfo(t){let e=document.getElementById("RetoldRemote-IEX-Info");if(!e)return;let i="";i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.Width+" × "+t.Height+" px</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Tile size:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.TileSize+" px</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Format:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.Format+"</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',i+='<span class="retold-remote-iex-info-value">'+(t.Width*t.Height/1e6).toFixed(1)+" MP</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',i+='<span class="retold-remote-iex-info-value">Tiled</span></span>',e.innerHTML=i,e.style.display=""}_initViewer(t){let e=document.getElementById("RetoldRemote-IEX-Loading"),i=document.getElementById("RetoldRemote-IEX-Viewer"),o=document.getElementById("RetoldRemote-IEX-Controls");e&&(e.style.display="none"),i&&(i.style.display="block"),o&&(o.style.display="");let n=this,r={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:"/api/media/dzi-tile/"+encodeURIComponent(t.CacheKey)+"/",Format:t.Format,Overlap:String(t.Overlap),TileSize:String(t.TileSize),Size:{Width:String(t.Width),Height:String(t.Height)}}};this._osdViewer=OpenSeadragon({id:"RetoldRemote-IEX-Viewer",tileSources:r,prefixUrl:"",showNavigationControl:!1,showNavigator:!0,navigatorPosition:"BOTTOM_RIGHT",navigatorSizeRatio:.15,animationTime:.3,blendTime:.1,minZoomLevel:.1,maxZoomLevel:20,visibilityRatio:.5,constrainDuringPan:!1,gestureSettingsMouse:{scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!0,flickEnabled:!1},gestureSettingsTouch:{pinchToZoom:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25}}),this._osdViewer.addHandler("zoom",function(t){n._updateZoomLabel()}),this._osdViewer.addHandler("open",function(){n._updateZoomLabel()}),void 0!==OpenSeadragon.MouseTracker&&new OpenSeadragon.MouseTracker({element:i,moveHandler:function(t){n._updateCoords(t.position)}})}_updateZoomLabel(){if(!this._osdViewer)return;let t=document.getElementById("RetoldRemote-IEX-ZoomLabel");if(t){let e=this._osdViewer.viewport.getZoom(!0),i=this._osdViewer.viewport.getHomeZoom(),o=Math.round(e/i*100);t.textContent=o+"%"}}_updateCoords(t){if(!this._osdViewer||!this._dziData)return;let e=document.getElementById("RetoldRemote-IEX-Coords");if(e)try{let i=this._osdViewer.viewport.pointFromPixel(t),o=this._osdViewer.viewport.viewportToImageCoordinates(i),n=Math.round(o.x),r=Math.round(o.y);n>=0&&n<=this._dziData.Width&&r>=0&&r<=this._dziData.Height?e.textContent=n+", "+r:e.textContent=""}catch(t){}}zoomIn(){if(this._osdViewer){let t=this._osdViewer.viewport.getZoom();this._osdViewer.viewport.zoomTo(1.5*t)}}zoomOut(){if(this._osdViewer){let t=this._osdViewer.viewport.getZoom();this._osdViewer.viewport.zoomTo(t/1.5)}}zoomHome(){this._osdViewer&&this._osdViewer.viewport.goHome()}goBack(){if(this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}if(this._currentPath){let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"image")}else{let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}}_showError(t){let e=document.getElementById("RetoldRemote-IEX-Loading");e&&(e.style.display="none");let i=document.getElementById("RetoldRemote-IEX-Body");if(i){let e=this.pict.providers["RetoldRemote-FormattingUtilities"];i.innerHTML='<div class="retold-remote-iex-error"><div class="retold-remote-iex-error-message">'+e.escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-iex-nav-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].goBack()">Back to Image</button></div>'}}}r.default_configuration=n,e.exports=r},{"pict-view":76}],141:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-ImageViewer",DefaultRenderable:"RetoldRemote-ImageViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i),this._zoomLevel=1,this._naturalWidth=0,this._naturalHeight=0,this._resizeHandler=null}initImage(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t)return;this._naturalWidth=t.naturalWidth,this._naturalHeight=t.naturalHeight,this._zoomLevel=1,this._applyDisplay(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler);let e=this,i=null;this._resizeHandler=function(){clearTimeout(i),i=setTimeout(function(){e._applyDisplay()},100)},window.addEventListener("resize",this._resizeHandler),this._showExploreButton()}_showExploreButton(){let t=document.getElementById("RetoldRemote-ImageExploreBtn");t&&(t.style.display="")}_getFitMode(){return this.pict.AppData.RetoldRemote.ImageFitMode||"fit"}setFitMode(t){this.pict.AppData.RetoldRemote.ImageFitMode=t,this._zoomLevel=1,this._applyDisplay(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}cycleFitMode(){let t;switch(this._getFitMode()){case"fit":t="auto";break;case"auto":t="original";break;default:t="fit"}this.setFitMode(t),this._showFitModeIndicator(t)}toggleZoom(){this._naturalWidth&&(1===this._zoomLevel?this._zoomLevel=2:this._zoomLevel=1,this._applyDisplay())}zoomIn(){this._zoomLevel=Math.min(1.25*this._zoomLevel,8),this._applyDisplay()}zoomOut(){this._zoomLevel=Math.max(this._zoomLevel/1.25,.25),this._applyDisplay()}zoomReset(){this._zoomLevel=1,this._applyDisplay()}_applyDisplay(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t||!this._naturalWidth)return;let e=t.parentElement;if(!e)return;let i=this._getBaseSize(e),o=Math.round(i.width*this._zoomLevel),n=Math.round(i.height*this._zoomLevel);t.style.maxWidth="none",t.style.maxHeight="none",t.style.objectFit="",t.style.width=o+"px",t.style.height=n+"px",t.style.transform="",this._zoomLevel>1||o>e.clientWidth||n>e.clientHeight?t.style.cursor="zoom-out":t.style.cursor="zoom-in"}_getBaseSize(t){let e=this._naturalWidth,i=this._naturalHeight,o=t.clientWidth,n=t.clientHeight;if(!o||!n)return{width:e,height:i};let r=e/i;switch(this._getFitMode()){case"fit":{let t=o,e=o/r;return e>n&&(e=n,t=n*r),{width:t,height:e}}case"auto":{if(e<=o&&i<=n)return{width:e,height:i};let t=o,s=o/r;return s>n&&(s=n,t=n*r),{width:t,height:s}}default:return{width:e,height:i}}}_showFitModeIndicator(t){let e={fit:"Fit to Window",auto:"Original if Smaller",original:"Original Size"}[t]||t;this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator(e,1200)}cleanup(){this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null)}}r.default_configuration=n,e.exports=r},{"pict-view":76}],142:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"RetoldRemote-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-Layout-Shell",Template:'\n\t\t\t\t<div id="ContentEditor-TopBar-Container"></div>\n\t\t\t\t<div class="content-editor-body">\n\t\t\t\t\t<div class="content-editor-sidebar-wrap" style="width: 250px;">\n\t\t\t\t\t\t<div class="content-editor-sidebar-inner">\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab active" data-tab="files" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="favorites" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'favorites\')">Favorites</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="info" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'info\')">Info</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="settings" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'settings\')">Settings</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab content-editor-sidebar-tab-collections" data-tab="collections" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'collections\')" style="display:none;">Collections</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="files" id="ContentEditor-Sidebar-Container"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="favorites" id="RetoldRemote-Favorites-Container" style="display:none">\n\t\t\t\t\t\t\t\t<div id="RetoldRemote-Favorites-Body"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="info" id="RetoldRemote-Info-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="settings" id="RetoldRemote-Settings-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="collections" id="RetoldRemote-Collections-MobilePane" style="display:none"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="content-editor-resize-handle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="RetoldRemote-Content-Container">\n\t\t\t\t\t\t<div id="RetoldRemote-Gallery-Container"></div>\n\t\t\t\t\t\t<div id="RetoldRemote-Viewer-Container"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="retold-remote-collections-wrap collapsed" id="RetoldRemote-Collections-Wrap" style="width: 300px;">\n\t\t\t\t\t\t<div class="retold-remote-collections-resize-handle"></div>\n\t\t\t\t\t\t<div class="retold-remote-collections-inner">\n\t\t\t\t\t\t\t<div id="RetoldRemote-Collections-Container"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-Layout-Shell",TemplateHash:"RetoldRemote-Layout-Shell",DestinationAddress:"#ContentEditor-Application-Container"}]};class r extends o{constructor(t,e,i){super(t,e,i),this._sidebarDragging=!1,this._collectionsDragging=!1}onAfterRender(){super.onAfterRender(),this.pict.CSSMap.injectCSS(),this._setupResizeHandle();let t=this.pict.AppData.RetoldRemote;if(t&&t.SidebarCollapsed){let t=document.querySelector(".content-editor-sidebar-wrap");t&&t.classList.add("collapsed")}if(!this.isMobileDrawer()&&t&&t.SidebarWidth){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.width=t.SidebarWidth+"px")}if(this.isMobileDrawer()&&t&&t.SidebarDrawerHeight){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.height=t.SidebarDrawerHeight+"px")}if(t&&t.CollectionsPanelOpen){let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px"))}this._setupCollectionsResizeHandle();let e=this;window.addEventListener("hashchange",()=>{e.pict.PictApplication.resolveHash()})}isMobileDrawer(){return window.innerWidth<=600}toggleSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t)return;t.classList.toggle("collapsed");let e=this.pict.AppData.RetoldRemote,i=t.classList.contains("collapsed");if(e.SidebarCollapsed=i,!i)if(this.isMobileDrawer()){let i=e.SidebarDrawerHeight||Math.round(.33*window.innerHeight);t.style.height=i+"px"}else e.SidebarWidth&&(t.style.width=e.SidebarWidth+"px");this.pict.PictApplication.saveSettings();let o=this.pict.providers["RetoldRemote-GalleryNavigation"];o&&setTimeout(()=>o.recalculateColumns(),250)}switchSidebarTab(t){if(document.querySelectorAll(".content-editor-sidebar-tab").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-tab")===t)}),document.querySelectorAll(".content-editor-sidebar-pane").forEach(e=>{e.style.display=e.getAttribute("data-pane")===t?"":"none"}),"settings"===t){let t=this.pict.views["RetoldRemote-SettingsPanel"];t&&t.render()}if("favorites"===t&&this.renderFavoritesList(),"info"===t){let t=this.pict.views["RetoldRemote-FileInfoPanel"];t&&t.render()}if("collections"===t){let t=document.getElementById("RetoldRemote-Collections-Container"),e=document.getElementById("RetoldRemote-Collections-MobilePane");t&&e&&!e.contains(t)&&e.appendChild(t);let i=this.pict.views["RetoldRemote-CollectionsPanel"];i&&i.render();let o=this.pict.providers["RetoldRemote-CollectionManager"];o&&o.fetchCollections()}else{let t=document.getElementById("RetoldRemote-Collections-Container"),e=document.querySelector(".retold-remote-collections-inner");t&&e&&!e.contains(t)&&e.appendChild(t)}}_setupResizeHandle(){let t=this,e=document.querySelector(".content-editor-resize-handle"),i=document.querySelector(".content-editor-sidebar-wrap");if(!e||!i)return;let o=0,n=0,r=0,s=0;function a(t){return t.touches&&t.touches.length>0?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}}function l(l){t._sidebarDragging=!0;let p=a(l);o=p.x,n=p.y,r=i.offsetWidth,s=i.offsetHeight,e.classList.add("dragging"),document.addEventListener("mousemove",d),document.addEventListener("mouseup",c),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",c),l.preventDefault()}function d(e){if(!t._sidebarDragging)return;let l=a(e);if(t.isMobileDrawer()){let t=s+(l.y-n),e=Math.round(.7*window.innerHeight);t=Math.max(80,Math.min(t,e)),i.style.height=t+"px"}else{let t=r+(l.x-o);t=Math.max(150,Math.min(t,600)),i.style.width=t+"px"}e.preventDefault()}function c(){t._sidebarDragging=!1,e.classList.remove("dragging"),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",c);let o=t.pict.AppData.RetoldRemote;t.isMobileDrawer()?o.SidebarDrawerHeight=i.offsetHeight:o.SidebarWidth=i.offsetWidth,t.pict.PictApplication.saveSettings();let n=t.pict.providers["RetoldRemote-GalleryNavigation"];n&&n.recalculateColumns()}e.addEventListener("mousedown",l),e.addEventListener("touchstart",l,{passive:!1}),e.addEventListener("dblclick",function(e){e.preventDefault(),t.toggleSidebar()})}toggleCollectionsPanel(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}renderFavoritesList(){let t=document.getElementById("RetoldRemote-Favorites-Body");if(!t)return;let e=this.pict.AppData.RetoldRemote.FavoritesCollection,i=this.pict.providers["RetoldRemote-Icons"];if(!e||!Array.isArray(e.Items)||0===e.Items.length)return void(t.innerHTML='<div class="retold-remote-favorites-empty"><div style="font-size:1.5rem; margin-bottom:8px; opacity:0.4;">♡</div>No favorites yet.<br>Tap ♡ or press <b>h</b> to favorite files.</div>');let o="";for(let t=0;t<e.Items.length;t++){let n=e.Items[t],r=n.Path||"",s=r.split("/").pop()||r,a=s.lastIndexOf(".")>=0?s.substring(s.lastIndexOf(".")):"",l="";i&&(l=i.getIconForEntry({Type:"folder"===n.Type?"folder":"file",Extension:a},16));let d=r.replace(/'/g,"\\'");o+='<div class="retold-remote-favorites-item" onclick="pict.PictApplication.navigateToFile(\''+d+"')\">",o+='<span class="retold-remote-favorites-item-icon">'+l+"</span>",o+='<span class="retold-remote-favorites-item-name" title="'+r+'">'+s+"</span>",o+="<button class=\"retold-remote-favorites-item-remove\" onclick=\"event.stopPropagation(); pict.providers['RetoldRemote-CollectionManager'].toggleFavorite('"+d+'\')" title="Remove from favorites">×</button>',o+="</div>"}t.innerHTML=o}_setupCollectionsResizeHandle(){let t=document.querySelector(".retold-remote-collections-resize-handle"),e=document.getElementById("RetoldRemote-Collections-Wrap");if(!t||!e)return;let i=this,o=0,n=0;function r(r){if(e.classList.contains("collapsed"))return;r.preventDefault(),i._collectionsDragging=!0,t.classList.add("dragging");let l=r.touches?r.touches[0].clientX:r.clientX;o=l,n=e.getBoundingClientRect().width,document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",a)}function s(t){if(!i._collectionsDragging)return;t.preventDefault();let r=t.touches?t.touches[0].clientX:t.clientX,s=o-r,a=Math.max(150,Math.min(600,n+s));e.style.width=a+"px"}function a(){if(!i._collectionsDragging)return;i._collectionsDragging=!1,t.classList.remove("dragging"),i.pict.AppData.RetoldRemote.CollectionsPanelWidth=e.getBoundingClientRect().width,i.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a);let o=i.pict.providers["RetoldRemote-GalleryNavigation"];o&&"function"==typeof o.recalculateColumns&&o.recalculateColumns()}t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1}),t.addEventListener("dblclick",function(t){t.preventDefault(),i.toggleCollectionsPanel()})}}r.default_configuration=n,e.exports=r},{"pict-view":76}],143:[function(t,e,i){const o=t("pict-view"),n=t("./MediaViewer-EbookViewer"),r=t("./MediaViewer-CodeViewer"),s={ViewIdentifier:"RetoldRemote-MediaViewer",DefaultRenderable:"RetoldRemote-MediaViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class a extends o{constructor(t,e,i){super(t,e,i),this._swipeStartX=0,this._swipeStartY=0,this._swipeTouchCount=0,this._swipeHandlers=null,this._dfExitHandlers=null}showMedia(t,e){let i=this.pict.AppData.RetoldRemote;i.ActiveMode="viewer",i.CurrentViewerFile=t,i.CurrentViewerMediaType=e,i.VideoMenuActive="video"===e;let o=document.getElementById("RetoldRemote-Gallery-Container"),n=document.getElementById("RetoldRemote-Viewer-Container");o&&(o.style.display="none"),n&&(n.style.display="block");let r=t.replace(/^.*\//,""),s=this.pict.providers["RetoldRemote-Provider"],a=s?s.getContentURL(t):"/content/"+encodeURIComponent(t),l='<div class="retold-remote-viewer">';if(l+='<div class="retold-remote-viewer-header">',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">← Back</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">‹ Prev</button>',l+='<div class="retold-remote-viewer-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next ›</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">ⓘ</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">▢</button>',l+="</div>",l+='<div class="retold-remote-viewer-body">',l+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(i._distractionFreeMode?"":' style="display:none"')+"></div>","image"===e)l+=this._buildImagePlaceholderHTML(r);else switch(e){case"video":l+=this._buildVideoHTML(a,r);break;case"audio":l+=this._buildAudioHTML(a,r);break;case"text":l+=this._buildTextHTML(a,r,t);break;case"document":l+=this._buildDocumentHTML(a,r,t);break;default:l+=this._buildFallbackHTML(a,r)}if(l+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',l+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Loading...</span></div>',l+="</div>",l+="</div>",l+="</div>",n&&(n.innerHTML=l),"image"===e&&this._probeAndShowImage(t,a,r),this._loadFileInfo(t),"text"===e&&this._loadCodeViewer(a,t),"document"===e){let e=t.replace(/^.*\./,"").toLowerCase();"epub"!==e&&"mobi"!==e||this._loadEbookViewer(a,t)}this._setupSwipeNavigation(),this._setupDFExitHotspot();let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo()}showDirectImage(t,e,i){let o=this.pict.AppData.RetoldRemote;o.ActiveMode="viewer",o.CurrentViewerFile=i||"",o.CurrentViewerMediaType="image",o.VideoMenuActive=!1;let n=document.getElementById("RetoldRemote-Gallery-Container"),r=document.getElementById("RetoldRemote-Viewer-Container");n&&(n.style.display="none"),r&&(r.style.display="block");let s=this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e),a='<div class="retold-remote-viewer">';a+='<div class="retold-remote-viewer-header">',a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">← Back</button>',a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">‹ Prev</button>',a+='<div class="retold-remote-viewer-title">'+s+"</div>",a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next ›</button>',a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">ⓘ</button>',a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">▢</button>',a+="</div>",a+='<div class="retold-remote-viewer-body">',a+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(o._distractionFreeMode?"":' style="display:none"')+"></div>",a+='<img id="RetoldRemote-ImageViewer-Img" src="'+t+'" alt="'+s+"\" style=\"max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;\" onload=\"if (pict.views['RetoldRemote-ImageViewer']) pict.views['RetoldRemote-ImageViewer'].initImage();\" onclick=\"if (pict.views['RetoldRemote-ImageViewer']) pict.views['RetoldRemote-ImageViewer'].toggleZoom();\" />",a+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',a+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Frame: '+s+"</span></div>",a+="</div>",a+="</div>",a+="</div>",r&&(r.innerHTML=a),this._setupSwipeNavigation(),this._setupDFExitHotspot();let l=this.pict.views["ContentEditor-TopBar"];l&&l.updateInfo()}_setupSwipeNavigation(){this._cleanupSwipe();let t=document.querySelector(".retold-remote-viewer-body");if(!t)return;let e=this,i=function(t){e._swipeTouchCount=t.touches.length,1===t.touches.length&&(e._swipeStartX=t.touches[0].clientX,e._swipeStartY=t.touches[0].clientY)},o=function(t){if(1!==e._swipeTouchCount)return;let i=t.changedTouches[0].clientX,o=t.changedTouches[0].clientY,n=i-e._swipeStartX,r=o-e._swipeStartY;if(Math.abs(n)<50||Math.abs(r)>Math.abs(n))return;let s=document.querySelector(".retold-remote-viewer-body");if(s&&s.scrollWidth>s.clientWidth+2)return;let a=e.pict.providers["RetoldRemote-GalleryNavigation"];a&&(n<0?a.nextFile():a.prevFile())};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",o,{passive:!0}),this._swipeHandlers={element:t,touchstart:i,touchend:o}}_cleanupSwipe(){this._swipeHandlers&&(this._swipeHandlers.element.removeEventListener("touchstart",this._swipeHandlers.touchstart),this._swipeHandlers.element.removeEventListener("touchend",this._swipeHandlers.touchend),this._swipeHandlers=null)}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree(),this._updateDFControls()}_updateDFControls(){let t=this.pict.AppData.RetoldRemote._distractionFreeMode||!1,e=document.getElementById("RetoldRemote-DF-ExitHotspot");e&&(e.style.display=t?"":"none")}_setupDFExitHotspot(){this._cleanupDFExitHotspot();let t=document.getElementById("RetoldRemote-DF-ExitHotspot");if(!t)return;let e=this,i=function(){e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree()},o=0,n=function(t){let i=Date.now();if(i-o<300){t.preventDefault(),e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree(),o=0}else o=i};t.addEventListener("dblclick",i),t.addEventListener("touchend",n),this._dfExitHandlers={element:t,dblclick:i,touchend:n}}_cleanupDFExitHotspot(){this._dfExitHandlers&&(this._dfExitHandlers.element.removeEventListener("dblclick",this._dfExitHandlers.dblclick),this._dfExitHandlers.element.removeEventListener("touchend",this._dfExitHandlers.touchend),this._dfExitHandlers=null)}_buildImagePlaceholderHTML(t){return'<div id="RetoldRemote-ImagePlaceholder" style="display:flex;align-items:center;justify-content:center;height:100%;color:var(--retold-text-dim);font-size:0.85rem;">Loading '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t)+"…</div>"}_probeAndShowImage(t,e,i){let o=this,n=this.pict.providers["RetoldRemote-Provider"],r=n?n._getPathParam(t):encodeURIComponent(t);fetch("/api/media/image-preview?path="+r).then(t=>t.json()).then(n=>{if(!n||!n.Success)return void o._insertImageTag(e,i,!1);if(Math.max(n.OrigWidth||0,n.OrigHeight||0)>8192){let e=o.pict.views["RetoldRemote-ImageExplorer"];if(e)return void e.showExplorer(t)}if(n.NeedsPreview&&n.CacheKey){let t="/api/media/image-preview-file/"+encodeURIComponent(n.CacheKey)+"/"+encodeURIComponent(n.OutputFilename);return void o._insertImageTag(t,i,!0,n.OrigWidth,n.OrigHeight)}o._insertImageTag(e,i,!1)}).catch(()=>{o._insertImageTag(e,i,!1)})}_insertImageTag(t,e,i,o,n){let r=document.getElementById("RetoldRemote-ImagePlaceholder");if(!r||!r.parentElement)return;let s=this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e),a=document.createDocumentFragment(),l=document.createElement("img");l.src=t,l.alt=s,l.id="RetoldRemote-ImageViewer-Img",l.style.cssText="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;",l.onload=function(){pict.views["RetoldRemote-ImageViewer"].initImage()},l.onclick=function(){pict.views["RetoldRemote-ImageViewer"].toggleZoom()},a.appendChild(l);let d=document.createElement("button");if(d.className="retold-remote-image-explore-btn",d.id="RetoldRemote-ImageExploreBtn",d.style.display=i?"":"none",d.title="Open in deep-zoom explorer (e)",d.innerHTML="🔍 Explore",d.onclick=function(){pict.views["RetoldRemote-ImageExplorer"].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)},a.appendChild(d),i&&o&&n){let t=document.createElement("div");t.id="RetoldRemote-LargeImageBadge",t.className="retold-remote-image-large-badge",t.textContent=o+" × "+n+" px (preview)",a.appendChild(t)}r.parentElement.replaceChild(a,r)}_buildImageHTML(t,e){let i='<img src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'" style="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;" id="RetoldRemote-ImageViewer-Img" onload="pict.views[\'RetoldRemote-ImageViewer\'].initImage()" onclick="pict.views[\'RetoldRemote-ImageViewer\'].toggleZoom()">';return i+='<button class="retold-remote-image-explore-btn" id="RetoldRemote-ImageExploreBtn" style="display:none" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Open in deep-zoom explorer (e)">🔍 Explore</button>',i}_buildVideoHTML(t,e){let i=this.pict.AppData.RetoldRemote.ServerCapabilities||{},o=(this.pict.AppData.RetoldRemote.CurrentViewerFile,'<div class="retold-remote-video-action-menu" id="RetoldRemote-VideoActionMenu">');return o+='<div class="retold-remote-video-action-menu-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div>",i.ffmpeg&&(o+='<div id="RetoldRemote-VideoActionThumb" class="retold-remote-video-action-thumb-wrap"></div>',setTimeout(()=>{this.loadVideoMenuFrame()},0)),i.ffmpeg&&(o+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video"><span class="retold-remote-video-action-key">e</span>Explore Video Frames</button>'),o+='<button class="retold-remote-video-action-btn selected" onclick="pict.views[\'RetoldRemote-MediaViewer\'].playVideo()" title="Play video in browser"><span class="retold-remote-video-action-key">Space</span>Play in Browser</button>',i.ffmpeg&&(o+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].loadVideoMenuFrame()" title="Extract a frame from the midpoint of this video"><span class="retold-remote-video-action-key">t</span>Thumbnail</button>'),o+='<button class="retold-remote-video-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device"><span class="retold-remote-video-action-key">v</span>Stream with VLC</button>',o+="</div>",o}playVideo(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;e.replace(/^.*\//,"");let i=this.pict.providers["RetoldRemote-Provider"],o=i?i.getContentURL(e):"/content/"+encodeURIComponent(e),n=t.ServerCapabilities||{},r='<div class="retold-remote-video-wrap">';r+="<video controls"+(t.AutoplayVideo?" autoplay":"")+' preload="metadata" id="RetoldRemote-VideoPlayer"><source src="'+o+'">Your browser does not support the video tag.</video>',r+='<div class="retold-remote-video-stats" id="RetoldRemote-VideoStats">',r+='<span class="retold-remote-video-stat-label">Loading info...</span>',n.ffmpeg&&(r+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video">Explore Video</button>'),r+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device">Stream with VLC</button>',r+="</div>",r+="</div>";let s=document.getElementById("RetoldRemote-VideoActionMenu");s&&(s.outerHTML=r),t.VideoMenuActive=!1}loadVideoMenuFrame(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;let i=document.getElementById("RetoldRemote-VideoActionThumb");if(!i)return;i.innerHTML='<div class="retold-remote-video-action-thumb-loading">Extracting frame...</div>';let o=this.pict.providers["RetoldRemote-Provider"],n=o?o._getPathParam(e):encodeURIComponent(e);fetch("/api/media/video-frames?path="+n+"&count=1").then(t=>t.json()).then(i=>{if(t.CurrentViewerFile!==e)return;let o=document.getElementById("RetoldRemote-VideoActionThumb");if(o)if(i&&i.Frames&&i.Frames.length>0){let t=i.Frames[0],n="/api/media/video-frame/"+i.CacheKey+"/"+t.Filename;o.innerHTML='<img src="'+n+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.replace(/^.*\//,""))+'" onerror="this.parentNode.innerHTML=\'\'">'}else o.innerHTML=""}).catch(()=>{let t=document.getElementById("RetoldRemote-VideoActionThumb");t&&(t.innerHTML="")})}_buildAudioHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"],o='<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("music-note",64)+"</span>":"🎵")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div><audio controls"+(this.pict.AppData.RetoldRemote.AutoplayAudio?" autoplay":"")+' preload="metadata" id="RetoldRemote-AudioPlayer" style="width: 100%; max-width: 500px;"><source src="'+t+'">Your browser does not support the audio tag.</audio>';o+='<div style="margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;">';let n=this.pict.AppData.RetoldRemote.ServerCapabilities||{};return(n.ffprobe||n.ffmpeg)&&(o+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore waveform and extract segments from this audio">Explore Audio</button>'),o+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device (v)">Stream with VLC</button>',o+="</div>",o+="</div>",o}_buildDocumentHTML(t,e,i){let o=i.replace(/^.*\./,"").toLowerCase();if("pdf"===o)return'<iframe src="'+t+'" style="width: 100%; height: 100%; border: none;"></iframe>';if("epub"===o||"mobi"===o)return this._buildEbookHTML(t,e,i);let n=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(n?'<span class="retold-remote-icon retold-remote-icon-lg">'+n.getIcon("document-large",64)+"</span>":"📄")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Open in new tab</a></div>'}_buildFallbackHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("document-large",64)+"</span>":"📄")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Download / Open in new tab</a></div>'}_loadFileInfo(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"];i&&i.fetchMediaProbe(t,(t,i)=>{if(!i)return;let o=document.getElementById("RetoldRemote-FileInfo-Overlay");if(o){let t="";if(void 0!==i.Size&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Size</span><span class="retold-remote-fileinfo-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(i.Size)+"</span></div>"),i.Width&&i.Height&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Dimensions</span><span class="retold-remote-fileinfo-value">'+i.Width+" x "+i.Height+"</span></div>"),i.Duration){let e=Math.floor(i.Duration/60),o=Math.floor(i.Duration%60);t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Duration</span><span class="retold-remote-fileinfo-value">'+e+":"+(o<10?"0":"")+o+"</span></div>"}i.Codec&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Codec</span><span class="retold-remote-fileinfo-value">'+i.Codec+"</span></div>"),i.Format&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Format</span><span class="retold-remote-fileinfo-value">'+i.Format+"</span></div>"),i.Modified&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Modified</span><span class="retold-remote-fileinfo-value">'+new Date(i.Modified).toLocaleString()+"</span></div>"),i.Path&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Path</span><span class="retold-remote-fileinfo-value">'+i.Path+"</span></div>"),o.innerHTML=t}let n=document.getElementById("RetoldRemote-VideoStats");if(n){let t="";if(i.Duration){let e=Math.floor(i.Duration/60),o=Math.floor(i.Duration%60);t+='<span><span class="retold-remote-video-stat-label">Duration</span> <span class="retold-remote-video-stat-value">'+e+":"+(o<10?"0":"")+o+"</span></span>"}if(i.Width&&i.Height&&(t+='<span><span class="retold-remote-video-stat-label">Resolution</span> <span class="retold-remote-video-stat-value">'+i.Width+"×"+i.Height+"</span></span>"),i.Codec&&(t+='<span><span class="retold-remote-video-stat-label">Codec</span> <span class="retold-remote-video-stat-value">'+i.Codec+"</span></span>"),i.Bitrate){let e,o=i.Bitrate;e=o>=1e6?(o/1e6).toFixed(1)+" Mbps":o>=1e3?Math.round(o/1e3)+" kbps":o+" bps",t+='<span><span class="retold-remote-video-stat-label">Bitrate</span> <span class="retold-remote-video-stat-value">'+e+"</span></span>"}void 0!==i.Size&&(t+='<span><span class="retold-remote-video-stat-label">Size</span> <span class="retold-remote-video-stat-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(i.Size)+"</span></span>");let o=n.querySelector(".retold-remote-explore-btn"),r=o?o.outerHTML:"",s=n.querySelector(".retold-remote-vlc-btn"),a=s?s.outerHTML:"";n.innerHTML=t+r+a}})}}Object.assign(a.prototype,n),Object.assign(a.prototype,r),a.default_configuration=s,e.exports=a},{"./MediaViewer-CodeViewer":134,"./MediaViewer-EbookViewer":135,"pict-view":76}],144:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-SettingsPanel",DefaultRenderable:"RetoldRemote-SettingsPanel",DefaultDestinationAddress:"#RetoldRemote-Settings-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this._renderSettingsContent()}_renderSettingsContent(){let t=document.getElementById("RetoldRemote-Settings-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.ServerCapabilities||{},o='<div class="retold-remote-settings">';o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Appearance</div>',o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Theme</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeTheme(this.value)">';let n=this.pict.providers["RetoldRemote-Theme"];if(n){let t=n.getThemeList(),e=n.getCurrentTheme(),i="";for(let n=0;n<t.length;n++){let r=t[n];r.category!==i&&(i&&(o+="</optgroup>"),o+='<optgroup label="'+r.category+'">',i=r.category),o+='<option value="'+r.key+'"'+(r.key===e?" selected":"")+">"+r.name+"</option>"}i&&(o+="</optgroup>")}o+="</select>",o+="</div>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Gallery</div>',o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">View mode</span>',o+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ViewMode', this.value)\">",o+='<option value="gallery"'+("gallery"===e.ViewMode?" selected":"")+">Grid</option>",o+='<option value="list"'+("list"===e.ViewMode?" selected":"")+">List</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Thumbnail size</span>',o+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ThumbnailSize', this.value)\">",o+='<option value="small"'+("small"===e.ThumbnailSize?" selected":"")+">Small</option>",o+='<option value="medium"'+("medium"===e.ThumbnailSize?" selected":"")+">Medium</option>",o+='<option value="large"'+("large"===e.ThumbnailSize?" selected":"")+">Large</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Sort by</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortField(this.value)">',o+='<option value="folder-first"'+("folder-first"===e.SortField?" selected":"")+">Folders first</option>",o+='<option value="name"'+("name"===e.SortField?" selected":"")+">Name</option>",o+='<option value="modified"'+("modified"===e.SortField?" selected":"")+">Modified</option>",o+='<option value="created"'+("created"===e.SortField?" selected":"")+">Created</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Sort direction</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortDirection(this.value)">',o+='<option value="asc"'+("asc"===e.SortDirection?" selected":"")+">Ascending</option>",o+='<option value="desc"'+("desc"===e.SortDirection?" selected":"")+">Descending</option>",o+="</select>",o+="</div>";let r=e.FilterState&&e.FilterState.MediaType||"all";o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Media filter</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeMediaFilter(this.value)">',o+='<option value="all"'+("all"===r?" selected":"")+">All files</option>",o+='<option value="images"'+("images"===r?" selected":"")+">Images</option>",o+='<option value="video"'+("video"===r?" selected":"")+">Video</option>",o+='<option value="audio"'+("audio"===r?" selected":"")+">Audio</option>",o+='<option value="documents"'+("documents"===r?" selected":"")+">Documents</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Show hidden files</span>',o+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.ShowHiddenFiles?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleHiddenFiles(this.checked)\">",o+="</div>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Viewer</div>',o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Image fit mode</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeImageFitMode(this.value)">',o+='<option value="fit"'+("fit"===e.ImageFitMode?" selected":"")+">Fit to window</option>",o+='<option value="auto"'+("auto"===e.ImageFitMode?" selected":"")+">Original if smaller</option>",o+='<option value="original"'+("original"===e.ImageFitMode?" selected":"")+">Original size</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Autoplay video</span>',o+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayVideo?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayVideo', this.checked)\">",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Autoplay audio</span>',o+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayAudio?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayAudio', this.checked)\">",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Nav bar in distraction-free</span>',o+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.DistractionFreeShowNav?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleDistractionFreeNav(this.checked)\">",o+="</div>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Server Capabilities</div>',o+='<div class="retold-remote-settings-capabilities">';let s="Sharp (image thumbnails)";i.sharpMode&&(s="Sharp / "+i.sharpMode+" (image thumbnails)");let a=[{key:"sharp",label:s},{key:"imagemagick",label:"ImageMagick (image fallback)"},{key:"ffmpeg",label:"ffmpeg (video thumbnails)"},{key:"ffprobe",label:"ffprobe (media metadata)"}];for(let t=0;t<a.length;t++){let e=a[t],n=i[e.key];o+='<div class="retold-remote-settings-cap-row">',o+='<span class="retold-remote-settings-cap-label">'+e.label+"</span>",o+='<span class="'+(n?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(n?"Available":"Not found")+"</span>",o+="</div>"}o+='<div class="retold-remote-settings-cap-row" style="margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--retold-border);">',o+='<span class="retold-remote-settings-cap-label">Hashed filenames</span>',o+='<span class="'+(e.HashedFilenames?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(e.HashedFilenames?"Enabled":"Disabled")+"</span>",o+="</div>",o+="</div>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">AI File Sort</div>';let l=this.pict.providers["RetoldRemote-AISortManager"],d=e.AISortSettings||{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"};o+='<div class="retold-remote-settings-input-row">',o+='<label class="retold-remote-settings-input-label">AI Endpoint URL</label>',o+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortEndpoint" value="'+this._escapeAttr(d.AIEndpoint)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIEndpoint\', this.value)" placeholder="http://localhost:11434">',o+="</div>",o+='<div class="retold-remote-settings-input-row">',o+='<label class="retold-remote-settings-input-label">Model</label>',o+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortModel" value="'+this._escapeAttr(d.AIModel)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIModel\', this.value)" placeholder="llama3.1">',o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Provider</span>',o+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeAISetting('AIProvider', this.value)\">",o+='<option value="ollama"'+("ollama"===d.AIProvider?" selected":"")+">Ollama</option>",o+='<option value="openai"'+("openai"===d.AIProvider?" selected":"")+">OpenAI-compatible</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-input-row" style="margin-top: 8px;">',o+='<label class="retold-remote-settings-input-label">Naming Template</label>',o+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortTemplate" value="'+this._escapeAttr(d.NamingTemplate)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'NamingTemplate\', this.value)" placeholder="{artist}/{album}/{track} - {title}">';let c=l?l.getTemplatePreview(d.NamingTemplate):"";c&&(o+='<div class="retold-remote-settings-template-preview">Preview: '+this._escapeHTML(c)+"</div>"),o+="</div>",o+='<button class="retold-remote-settings-vlc-btn" id="RetoldRemote-AISortTestBtn" onclick="pict.views[\'RetoldRemote-SettingsPanel\'].testAIConnection()" style="margin-top: 8px;">',o+="Test Connection",o+="</button>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">VLC Streaming</div>',o+='<button class="retold-remote-settings-vlc-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].openModal()">',o+="VLC Protocol Setup",o+="</button>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Help</div>',o+='<button class="retold-remote-settings-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">',o+="Help (F1)",o+="</button>",o+="</div>",o+="</div>",t.innerHTML=o}changeTheme(t){let e=this.pict.providers["RetoldRemote-Theme"];e&&(e.applyTheme(t),this.pict.PictApplication.saveSettings(),this._renderSettingsContent())}changeSetting(t,e){let i=this.pict.AppData.RetoldRemote;if(i[t]=e,this.pict.PictApplication.saveSettings(),"gallery"===i.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}toggleHiddenFiles(t){this.pict.AppData.RetoldRemote.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings(),this.pict.PictApplication.syncHiddenFilesSetting(()=>{this.pict.PictApplication.loadFileList()})}toggleAutoplay(t,e){this.pict.AppData.RetoldRemote[t]=e,this.pict.PictApplication.saveSettings()}toggleDistractionFreeNav(t){let e=this.pict.AppData.RetoldRemote;if(e.DistractionFreeShowNav=t,this.pict.PictApplication.saveSettings(),e._distractionFreeMode){let e=document.querySelector(".retold-remote-viewer-header");e&&(e.style.display=t?"":"none")}}changeImageFitMode(t){let e=this.pict.views["RetoldRemote-ImageViewer"];if(e)e.setFitMode(t);else{this.pict.AppData.RetoldRemote.ImageFitMode=t,this.pict.PictApplication.saveSettings()}}changeSortField(t){this.pict.AppData.RetoldRemote.SortField=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeSortDirection(t){this.pict.AppData.RetoldRemote.SortDirection=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeMediaFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState&&(e.FilterState.MediaType=t),this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeAISetting(t,e){let i=this.pict.providers["RetoldRemote-AISortManager"];if(i){let o={};o[t]=e,i.updateSettings(o)}"NamingTemplate"===t&&this._renderSettingsContent()}testAIConnection(){let t=document.getElementById("RetoldRemote-AISortTestBtn");t&&(t.disabled=!0,t.textContent="Testing...");let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.testConnection()}_escapeAttr(t){return t?String(t).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"):""}_escapeHTML(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):""}_refilterGallery(){let t=this.pict.AppData.RetoldRemote,e=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e&&e.runFilterPipeline(),"gallery"===t.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}}r.default_configuration=n,e.exports=r},{"pict-view":76}],145:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"RetoldRemote-TopBar",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-TopBar",Template:'\n\t\t\t\t<div class="retold-remote-topbar">\n\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle" id="RetoldRemote-TopBar-SidebarToggle" onclick="pict.views[\'ContentEditor-Layout\'].toggleSidebar()" title="Toggle Sidebar"></button>\n\t\t\t\t\t<button class="retold-remote-topbar-df-toggle" id="RetoldRemote-TopBar-DFToggle" onclick="pict.views[\'ContentEditor-TopBar\'].toggleDistractionFree()" title="Distraction-free mode (d)"></button>\n\t\t\t\t\t<div class="retold-remote-topbar-location" id="RetoldRemote-TopBar-Location"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-info" id="RetoldRemote-TopBar-Info"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-actions">\n\t\t\t\t\t\t<button class="retold-remote-topbar-aisort-btn" id="RetoldRemote-TopBar-AISortBtn" onclick="pict.views[\'ContentEditor-TopBar\'].triggerAISort()" title="AI Sort (generate sort plan for current folder)" style="display:none;">Ai</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-addcoll-btn" id="RetoldRemote-TopBar-AddToCollectionBtn" onclick="pict.views[\'ContentEditor-TopBar\'].addToCollection(event)" title="Add to collection">★</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-favorites-btn" id="RetoldRemote-TopBar-FavoritesBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFavorite()" title="Toggle favorite (h)">♡</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle retold-remote-topbar-collections-btn" id="RetoldRemote-TopBar-CollectionsBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleCollections()" title="Toggle Collections panel (b)">★</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-filter-btn" id="RetoldRemote-TopBar-FilterBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFilterBar()" title="Toggle filter bar (/)">◢</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-TopBar",TemplateHash:"RetoldRemote-TopBar",DestinationAddress:"#ContentEditor-TopBar-Container"}]};class r extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this.updateSidebarToggleIcon(),this.updateDFToggleIcon(),this.updateLocation(),this.updateInfo(),this.updateFavoritesIcon()}updateSidebarToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-SidebarToggle");if(!t)return;let e=this.pict.providers["RetoldRemote-Icons"];t.innerHTML=e?e.getIcon("sidebar",18):"☰"}updateDFToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-DFToggle");t&&(t.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9" /><polyline points="9 21 3 21 3 15" /><polyline points="21 15 21 21 15 21" /><polyline points="3 9 3 3 9 3" /></svg>')}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree&&t._toggleDistractionFree()}updateLocation(){let t=document.getElementById("RetoldRemote-TopBar-Location");if(!t)return;this.pict.AppData.RetoldRemote;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",i=this.pict.providers["RetoldRemote-Icons"],o='<span class="retold-remote-topbar-home-crumb" onclick="pict.PictApplication.loadFileList(\'\')" title="Home">'+(i?i.getIcon("home",16):"/")+"</span>";if(!e)return void(t.innerHTML='<span class="retold-remote-topbar-location-inner">'+o+"</span>");let n=e.split("/").filter(t=>t);if(n.length<=1){let e=o;for(let t=0;t<n.length;t++){e+='<span class="retold-remote-topbar-sep">/</span>',e+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+n.slice(0,t+1).join("/")+"')\">"+n[t]+"</span>"}return void(t.innerHTML='<span class="retold-remote-topbar-location-inner">'+e+"</span>")}let r=i?i.getIcon("folder",16):"",s=i?i.getIcon("home",16):"/",a="";for(let t=n.length-1;t>=0;t--){let e=n.slice(0,t+1).join("/"),i=n[t]+"/",o="";t>0&&(o="/"+n.slice(0,t).join("/")+"/"),a+='<button class="retold-remote-topbar-overflow-item" onclick="pict.PictApplication.loadFileList(\''+e+"'); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",a+='<span class="retold-remote-topbar-overflow-item-icon">'+r+"</span>",a+=o?'<span class="retold-remote-topbar-overflow-item-label"><span class="retold-remote-topbar-overflow-item-prefix">'+o+"</span>"+i+"</span>":'<span class="retold-remote-topbar-overflow-item-label">'+i+"</span>",a+="</button>"}a+="<button class=\"retold-remote-topbar-overflow-item\" onclick=\"pict.PictApplication.loadFileList(''); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",a+='<span class="retold-remote-topbar-overflow-item-icon">'+s+"</span>",a+='<span class="retold-remote-topbar-overflow-item-label">Home</span>',a+="</button>";let l=n[n.length-1],d="";d+='<span class="retold-remote-topbar-breadcrumb-overflow">',d+='<button class="retold-remote-topbar-overflow-btn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleBreadcrumbDropdown()" title="Navigate to parent folders">☰</button>',d+='<div class="retold-remote-topbar-overflow-dropdown" id="RetoldRemote-BreadcrumbDropdown">',d+=a,d+="</div>",d+="</span>",d+='<span class="retold-remote-topbar-location-inner">',d+=o,d+='<span class="retold-remote-topbar-sep">/</span>',d+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+n.join("/")+"')\">"+l+"</span>",d+="</span>",t.innerHTML=d}toggleBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");if(t)if(t.classList.contains("open"))this.closeBreadcrumbDropdown();else{t.classList.add("open");let e=this,i=function(o){if(t.contains(o.target))return;let n=t.parentElement&&t.parentElement.querySelector(".retold-remote-topbar-overflow-btn");n&&n.contains(o.target)||(e.closeBreadcrumbDropdown(),document.removeEventListener("click",i,!0),document.removeEventListener("touchstart",i,!0))};setTimeout(function(){document.addEventListener("click",i,!0),document.addEventListener("touchstart",i,!0)},0),this._breadcrumbCloseHandler=i}}closeBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");t&&t.classList.remove("open"),this._breadcrumbCloseHandler&&(document.removeEventListener("click",this._breadcrumbCloseHandler,!0),document.removeEventListener("touchstart",this._breadcrumbCloseHandler,!0),this._breadcrumbCloseHandler=null)}toggleFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!t.FilterBarVisible,t.FilterBarVisible||(t.FilterPanelOpen=!1);let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),this.updateFilterIcon(),t.FilterBarVisible&&setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}updateFilterIcon(){let t=document.getElementById("RetoldRemote-TopBar-FilterBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-GalleryFilterSort"],o=i?i.getActiveFilterChips().length:0,n=e.FilterBarVisible||!1;t.classList.remove("filter-active","filter-bar-open"),o>0?(t.classList.add("filter-active"),t.innerHTML='◓<span class="retold-remote-topbar-filter-badge">'+o+"</span>",t.title=o+" active filter"+(o>1?"s":"")+" (/)"):n?(t.classList.add("filter-bar-open"),t.innerHTML="◢",t.title="Hide filter bar (/)"):(t.innerHTML="◢",t.title="Toggle filter bar (/)")}updateInfo(){this.updateAISortButton();let t=document.getElementById("RetoldRemote-TopBar-Info");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.FolderSummary;if("viewer"===e.ActiveMode){let i=e.GalleryItems||[],o=e.GalleryCursorIndex||0,n=i[o];if(n){let e=o+1+"/"+i.length;t.innerHTML="<span>"+e+'</span><span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-1"> · </span><span class="retold-remote-topbar-info-priority-1">'+this._escapeHTML(n.Name)+"</span>"}return}let o=e.GalleryItems||[],n=e.GalleryCursorIndex||0,r="";if(o.length>0&&(r=n+1+"/"+o.length),!i)return void(t.textContent=r);let s=[];i.Images>0&&s.push(i.Images+" images"),i.Videos>0&&s.push(i.Videos+" videos"),i.Audio>0&&s.push(i.Audio+" audio");let a=[];i.Folders>0&&a.push(i.Folders+" folders"),i.Documents>0&&a.push(i.Documents+" docs"),i.Other>0&&a.push(i.Other+" other");let l="";if(r&&(l+="<span>"+r+"</span>"),a.length>0){l+=(l?'<span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-3"> · </span>':"")+'<span class="retold-remote-topbar-info-priority-3">'+a.join(" · ")+"</span>"}if(s.length>0){l+=(l?'<span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-2"> · </span>':"")+'<span class="retold-remote-topbar-info-priority-2">'+s.join(" · ")+"</span>"}t.innerHTML=l||""}_escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):""}triggerAISort(){let t=this.pict.providers["RetoldRemote-AISortManager"];if(!t)return;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",i=document.getElementById("RetoldRemote-TopBar-AISortBtn");i&&(i.classList.add("generating"),i.textContent="..."),t.generateSortPlan(e,(t,e)=>{i&&(i.classList.remove("generating"),i.textContent="Ai")})}updateAISortButton(){let t=document.getElementById("RetoldRemote-TopBar-AISortBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.isAvailable()?t.style.display="":t.style.display="none"}toggleCollections(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}updateCollectionsIcon(){let t=document.getElementById("RetoldRemote-TopBar-CollectionsBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-Icons"],o=e.CollectionsPanelOpen,n=this.pict.views["ContentEditor-Layout"];if(n&&n.isMobileDrawer()){let t=document.querySelector(".content-editor-sidebar-tab.active");o=t&&"collections"===t.getAttribute("data-tab")}o?(t.classList.add("panel-open"),i&&"function"==typeof i.getIcon&&(t.innerHTML=i.getIcon("bookmark-filled",16))):(t.classList.remove("panel-open"),i&&"function"==typeof i.getIcon&&(t.innerHTML=i.getIcon("bookmark",16)))}toggleFavorite(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.toggleFavorite()}updateFavoritesIcon(){let t=document.getElementById("RetoldRemote-TopBar-FavoritesBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-CollectionManager"];e&&e.isFavorited()?(t.classList.add("is-favorited"),t.innerHTML="♥",t.title="Remove from favorites (h)"):(t.classList.remove("is-favorited"),t.innerHTML="♡",t.title="Add to favorites (h)")}addToCollection(t){this.pict.AppData.RetoldRemote;let e=this.pict.providers["RetoldRemote-CollectionManager"];if(!e)return;let i=e.getQuickAddTargetGUID();if(i){if(e.addCurrentFileToCollection(i))return}this.showAddToCollectionDropdown(t)}showAddToCollectionDropdown(t){let e=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"];this._closeAddToCollectionDropdown();let n=document.getElementById("RetoldRemote-TopBar-AddToCollectionBtn");n&&o.fetchCollections(()=>{let t=i.Collections||[],r=document.createElement("div");r.className="retold-remote-addcoll-dropdown",r.id="RetoldRemote-AddToCollection-Dropdown";let s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item retold-remote-addcoll-dropdown-new",s.textContent="+ New Collection...",s.onclick=()=>{e._closeAddToCollectionDropdown();let t=prompt("Collection name:");t&&t.trim()?o.createCollection(t.trim(),(t,e)=>{!t&&e&&o.addPendingOrCurrentToCollection(e.GUID)}):o.clearPendingClipContext()},r.appendChild(s);for(let i=0;i<t.length;i++){let n=t[i],s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item",s.textContent=n.Name||"Untitled",s.onclick=()=>{e._closeAddToCollectionDropdown(),o.addPendingOrCurrentToCollection(n.GUID)},r.appendChild(s)}n.style.position="relative",n.appendChild(r),setTimeout(()=>{document.addEventListener("click",e._boundCloseDropdown=t=>{r.contains(t.target)||t.target===n||e._closeAddToCollectionDropdown()})},10)})}_closeAddToCollectionDropdown(){let t=document.getElementById("RetoldRemote-AddToCollection-Dropdown");t&&t.remove(),this._boundCloseDropdown&&(document.removeEventListener("click",this._boundCloseDropdown),this._boundCloseDropdown=null);let e=this.pict.providers["RetoldRemote-CollectionManager"];e&&e.clearPendingClipContext()}}r.default_configuration=n,e.exports=r},{"pict-view":76}],146:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-VLCSetup",DefaultRenderable:"RetoldRemote-VLCSetup",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i),this._activePlatformTab=this._detectPlatform(),this._modalVisible=!1,this._boundKeyHandler=null}_detectPlatform(){let t="undefined"!=typeof navigator?navigator.userAgent:"";return/iPhone|iPad|iPod/i.test(t)||/Macintosh/i.test(t)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1?"ios":/Android/i.test(t)?"android":/Macintosh|Mac OS X/.test(t)?"macos":/Windows/.test(t)?"windows":"linux"}openModal(){if(this._modalVisible)return;this._modalVisible=!0;let t=document.createElement("div");t.className="retold-remote-vlc-modal-backdrop",t.id="RetoldRemote-VLCSetup-Backdrop",t.onclick=e=>{e.target===t&&this.closeModal()};let e=document.createElement("div");e.className="retold-remote-vlc-modal";let i=document.createElement("div");i.className="retold-remote-vlc-modal-header",i.innerHTML='<span class="retold-remote-vlc-modal-title">VLC Protocol Setup</span><button class="retold-remote-vlc-modal-close" onclick="pict.views[\'RetoldRemote-VLCSetup\'].closeModal()">X</button>';let o=document.createElement("div");o.className="retold-remote-vlc-modal-body",o.id="RetoldRemote-VLCSetup-Container",e.appendChild(i),e.appendChild(o),t.appendChild(e),document.body.appendChild(t),this._renderVLCSetupContent(),this._boundKeyHandler=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.closeModal())},document.addEventListener("keydown",this._boundKeyHandler,!0)}closeModal(){if(!this._modalVisible)return;this._modalVisible=!1;let t=document.getElementById("RetoldRemote-VLCSetup-Backdrop");t&&t.remove(),this._boundKeyHandler&&(document.removeEventListener("keydown",this._boundKeyHandler,!0),this._boundKeyHandler=null)}switchPlatformTab(t){this._activePlatformTab=t,this._renderVLCSetupContent()}_renderVLCSetupContent(){let t=document.getElementById("RetoldRemote-VLCSetup-Container");if(!t)return;let e=this._activePlatformTab,i="";i+='<div class="retold-remote-vlc-setup-section">',i+='<div class="retold-remote-vlc-setup-desc">',i+="Stream media directly in VLC from the browser. Press <b>v</b> in the media viewer to launch VLC with the current file.",i+="</div>",i+="</div>",i+='<div class="retold-remote-vlc-setup-status">',i+='<div class="retold-remote-vlc-setup-status-dot '+(this._detectPlatform()===e?"detected":"unknown")+'"></div>',i+="<span>Detected platform: <b>"+this._getPlatformLabel(this._detectPlatform())+"</b></span>",i+="</div>",i+='<div class="retold-remote-vlc-setup-platform-tabs">',i+=this._buildPlatformTab("ios","iOS",e),i+=this._buildPlatformTab("android","Android",e),i+=this._buildPlatformTab("macos","macOS",e),i+=this._buildPlatformTab("windows","Windows",e),i+=this._buildPlatformTab("linux","Linux",e),i+="</div>",i+=this._buildIOSContent(e),i+=this._buildAndroidContent(e),i+=this._buildMacOSContent(e),i+=this._buildWindowsContent(e),i+=this._buildLinuxContent(e),i+='<div class="retold-remote-vlc-setup-section">',i+='<div class="retold-remote-vlc-setup-section-title">Test</div>',i+='<div class="retold-remote-vlc-setup-desc">',i+="Click below to test whether the vlc:// protocol handler is registered. VLC should open.",i+="</div>",i+='<button class="retold-remote-vlc-setup-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].testProtocol()">Test VLC Protocol</button>',i+="</div>",t.innerHTML=i}_buildPlatformTab(t,e,i){let o="retold-remote-vlc-setup-platform-tab";return t===i&&(o+=" active"),'<button class="'+o+"\" onclick=\"pict.views['RetoldRemote-VLCSetup'].switchPlatformTab('"+t+"')\">"+e+"</button>"}_getPlatformLabel(t){return"ios"===t?"iOS":"android"===t?"Android":"macos"===t?"macOS":"windows"===t?"Windows":"Linux"}_buildIOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("ios"===t?" active":""))+'" data-platform="ios">';return e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (iOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC for iOS registers the vlc:// protocol handler automatically when installed. No additional setup is needed.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Installation</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Install <b>VLC for Mobile</b> from the App Store if you haven\'t already.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Tap the <b>Stream with VLC</b> button on any video or audio file. Safari will ask to open VLC — tap <b>Open</b>.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">If Safari shows "Cannot Open Page", VLC may not be installed or may need to be updated.</div>',e+="</div>",e+="</div>",e}_buildAndroidContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("android"===t?" active":""))+'" data-platform="android">';return e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Android)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC for Android registers the vlc:// protocol handler automatically when installed. No additional setup is needed.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Installation</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Install <b>VLC for Android</b> from the Google Play Store if you haven\'t already.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Tap the <b>Stream with VLC</b> button on any video or audio file. Your browser will ask to open VLC — tap <b>Open</b>.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">If your browser shows an error, VLC may not be installed or may need to be updated.</div>',e+="</div>",e+="</div>",e}_buildMacOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("macos"===t?" active":""))+'" data-platform="macos">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (macOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on macOS does not register a vlc:// protocol handler by default. ",e+="An AppleScript app bundle is needed to bridge vlc:// links to VLC. ",e+="Run the command below in Terminal to create and register the handler automatically.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Automatic Setup</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Copy and paste this into Terminal:",e+="</div>";let i=this._getMacSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyMacSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates an AppleScript at <code>/tmp/VLCProtocol.applescript</code> that handles vlc:// URLs</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Compiles it into an app bundle at <code>/Applications/VLCProtocol.app</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Adds the vlc:// URL scheme to the app\'s Info.plist</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">4</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers the protocol handler with macOS Launch Services</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC installed at /Applications/VLC.app and Python 3 (included with macOS).</div>',e+="</div>",e+="</div>",e}_buildWindowsContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("windows"===t?" active":""))+'" data-platform="windows">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Windows)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on Windows registers the vlc:// protocol handler during installation. ",e+="If it is not working, you can re-register it by saving and running the registry file below.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option A: Reinstall VLC</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Reinstall VLC and ensure "Register VLC as handler for vlc:// protocol" is checked during installation.</div>',e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option B: Registry File</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Save this as <code>vlc-protocol.reg</code> and double-click to import. ",e+="Adjust the VLC path if yours differs.",e+="</div>";let i=this._getWindowsRegFile();e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsReg()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option C: Batch Script</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Alternatively, save this as <code>vlc-protocol-setup.bat</code> and run as Administrator. ",e+="This creates a wrapper script that URL-decodes the vlc:// link before passing it to VLC.",e+="</div>";let o=this._getWindowsBatchScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(o)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsBatch()">Copy to Clipboard</button>',e+="</div>",e+="</div>",e}_buildLinuxContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("linux"===t?" active":""))+'" data-platform="linux">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Linux)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Register a vlc:// protocol handler using a .desktop file and xdg-mime. ",e+="Run the command below in a terminal.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup Command</div>';let i=this._getLinuxSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyLinuxSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a handler script at <code>~/.local/bin/vlc-protocol</code> that URL-decodes and opens VLC</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a .desktop file at <code>~/.local/share/applications/vlc-protocol.desktop</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers vlc:// as a URL scheme via <code>xdg-mime</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC and Python 3 installed.</div>',e+="</div>",e+="</div>",e}_getMacSetupScript(){return["# Create the AppleScript handler","cat > /tmp/VLCProtocol.applescript << 'EOF'","on open location theURL","\tset theURL to text 7 thru -1 of theURL","\tset theURL to do shell script \"python3 -c 'import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))' \" & quoted form of theURL",'\tdo shell script "open -a VLC " & quoted form of theURL',"end open location","EOF","","# Compile into app bundle","osacompile -o /Applications/VLCProtocol.app /tmp/VLCProtocol.applescript","","# Add vlc:// URL scheme to Info.plist",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0 dict" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","/usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:0:CFBundleURLName string 'VLC Protocol'\" \\"," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes:0 string vlc" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","","# Register with Launch Services","/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \\"," -f /Applications/VLCProtocol.app","",'echo "VLC protocol handler installed successfully."'].join("\n")}_getWindowsRegFile(){return["Windows Registry Editor Version 5.00","","[HKEY_CLASSES_ROOT\\vlc]",'@="URL:VLC Protocol"','"URL Protocol"=""',"","[HKEY_CLASSES_ROOT\\vlc\\shell]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open\\command]",'@="\\"C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe\\" \\"%1\\""'].join("\n")}_getWindowsBatchScript(){return["@echo off","REM VLC Protocol Handler Setup for Windows","REM Run this as Administrator","","REM Create the handler script",'mkdir "%APPDATA%\\VLCProtocol" 2>nul',"(","echo import sys, urllib.parse, subprocess","echo url = sys.argv[1] if len(sys.argv^) ^> 1 else ''","echo if url.startswith('vlc://'^): url = url[6:]","echo url = urllib.parse.unquote(url^)","echo subprocess.Popen(['C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe', url]^)",') > "%APPDATA%\\VLCProtocol\\handler.py"',"","REM Register the protocol in the registry",'reg add "HKCU\\Software\\Classes\\vlc" /ve /d "URL:VLC Protocol" /f','reg add "HKCU\\Software\\Classes\\vlc" /v "URL Protocol" /d "" /f','reg add "HKCU\\Software\\Classes\\vlc\\shell\\open\\command" /ve /d "pythonw \\"%APPDATA%\\VLCProtocol\\handler.py\\" \\"%%1\\"" /f',"","echo VLC protocol handler installed successfully.","pause"].join("\n")}_getLinuxSetupScript(){return["# Create handler script","mkdir -p ~/.local/bin","cat > ~/.local/bin/vlc-protocol << 'EOF'","#!/bin/bash",'URL="$1"','URL="${URL#vlc://}"','URL=$(python3 -c "import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))" "$URL")','exec vlc "$URL" &',"EOF","chmod +x ~/.local/bin/vlc-protocol","","# Create .desktop file","cat > ~/.local/share/applications/vlc-protocol.desktop << 'EOF'","[Desktop Entry]","Name=VLC Protocol Handler","Exec=bash -c '~/.local/bin/vlc-protocol %u'","Type=Application","NoDisplay=true","MimeType=x-scheme-handler/vlc;","EOF","","# Register the handler","xdg-mime default vlc-protocol.desktop x-scheme-handler/vlc","update-desktop-database ~/.local/share/applications/","",'echo "VLC protocol handler installed successfully."'].join("\n")}_copyToClipboard(t,e){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(t).then(()=>{this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}).catch(()=>{this._fallbackCopy(t,e)}):this._fallbackCopy(t,e)}_fallbackCopy(t,e){let i=document.createElement("textarea");i.value=t,i.style.position="fixed",i.style.left="-9999px",document.body.appendChild(i),i.select();try{document.execCommand("copy"),this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}catch(t){this.pict.providers["RetoldRemote-ToastNotification"].showToast("Failed to copy - please select and copy manually")}document.body.removeChild(i)}copyMacSetup(){this._copyToClipboard(this._getMacSetupScript(),"macOS setup script")}copyWindowsReg(){this._copyToClipboard(this._getWindowsRegFile(),"Registry file")}copyWindowsBatch(){this._copyToClipboard(this._getWindowsBatchScript(),"Batch script")}copyLinuxSetup(){this._copyToClipboard(this._getLinuxSetupScript(),"Linux setup script")}testProtocol(){let t=/Windows/.test(navigator.userAgent),e=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),i="https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4",o=t||e?"vlc://"+i:"vlc://"+encodeURIComponent(i),n=document.createElement("a");n.href=o,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}}r.default_configuration=n,e.exports=r},{"pict-view":76}],147:[function(t,e,i){const o=t("pict-view"),n=t("./VideoExplorer-Selection"),r=t("./VideoExplorer-CustomFrames"),s=t("./VideoExplorer-Preview"),a={ViewIdentifier:"RetoldRemote-VideoExplorer",DefaultRenderable:"RetoldRemote-VideoExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class l extends o{constructor(t,e,i){super(t,e,i),this._currentPath="",this._frameData=null,this._selectedFrameIndex=-1,this._frameCount=20,this._fullResFrames=!0,this._customFrames=[],this._selectionModeActive=!1,this._selectionStartTime=-1,this._selectionEndTime=-1,this._isSelectingRange=!1,this._isDraggingTimeline=!1,this._draggingHandle=null,this._fmt=null,this._provider=null}_getFmt(){return this._fmt||(this._fmt=this.pict.providers["RetoldRemote-FormattingUtilities"]),this._fmt}_getProvider(){return this._provider||(this._provider=this.pict.providers["RetoldRemote-Provider"]),this._provider}_buildFrameURL(t,e){return"/api/media/video-frame/"+encodeURIComponent(t)+"/"+encodeURIComponent(e)}_getPathParam(t){let e=this._getProvider();return e?e._getPathParam(t):encodeURIComponent(t)}_getClientX(t){return t.touches&&t.touches.length>0?t.touches[0].clientX:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0].clientX:"number"==typeof t.clientX?t.clientX:null}_getTimelineTimestamp(t){let e=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!e||!this._frameData||!this._frameData.Duration)return 0;let i=e.getBoundingClientRect(),o=this._getClientX(t);return null===o?0:Math.max(0,Math.min(1,(o-i.left)/i.width))*this._frameData.Duration}saveSelectionToCollection(){if(this._selectionStartTime<0||this._selectionEndTime<0)return;let t=Math.min(this._selectionStartTime,this._selectionEndTime),e=Math.max(this._selectionStartTime,this._selectionEndTime),i=this.pict.providers["RetoldRemote-CollectionManager"];if(!i)return;let o=i.getQuickAddTargetGUID();if(o)i.addVideoClipToCollection(o,t,e);else{i.setPendingClipContext({Type:"video-clip",Start:t,End:e});let o=this.pict.views["ContentEditor-TopBar"];o&&"function"==typeof o.showAddToCollectionDropdown&&o.showAddToCollectionDropdown()}}showExplorer(t,e,i){this.pict.AppData.RetoldRemote.ActiveMode="video-explorer",this._currentPath=t,this._frameData=null,this._selectedFrameIndex=-1,this._customFrames=[],this._selectionModeActive=!1,this._isSelectingRange=!1,this._isDraggingTimeline=!1,this._draggingHandle=null,"number"==typeof e&&e>=0&&"number"==typeof i&&i>=0?(this._selectionStartTime=e,this._selectionEndTime=i,this._selectionFromCaller=!0):(this._selectionStartTime=-1,this._selectionEndTime=-1,this._selectionFromCaller=!1),this._cleanupWindowListeners();let o=this._getProvider(),n="#/explore/"+(o?o.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",n):window.location.hash=n;let r=document.getElementById("RetoldRemote-Gallery-Container"),s=document.getElementById("RetoldRemote-Viewer-Container");r&&(r.style.display="none"),s&&(s.style.display="block");let a=t.replace(/^.*\//,""),l='<div class="retold-remote-vex">';l+='<div class="retold-remote-vex-header">',l+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()" title="Back to video (Esc)">← Back</button>',l+='<div class="retold-remote-vex-title">Video Explorer — '+this._getFmt().escapeHTML(a)+"</div>",l+="</div>",l+='<div class="retold-remote-vex-info" id="RetoldRemote-VEX-Info" style="display:none;"></div>',l+='<div class="retold-remote-vex-controls" id="RetoldRemote-VEX-Controls" style="display:none;">',l+="<label>Frames:</label>",l+='<select id="RetoldRemote-VEX-FrameCount" onchange="pict.views[\'RetoldRemote-VideoExplorer\'].onFrameCountChange(this.value)">',l+='<option value="10"'+(10===this._frameCount?" selected":"")+">10</option>",l+='<option value="20"'+(20===this._frameCount?" selected":"")+">20</option>",l+='<option value="40"'+(40===this._frameCount?" selected":"")+">40</option>",l+='<option value="60"'+(60===this._frameCount?" selected":"")+">60</option>",l+='<option value="100"'+(100===this._frameCount?" selected":"")+">100</option>",l+="</select>",l+='<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;">',l+='<input type="checkbox" id="RetoldRemote-VEX-FullRes"'+(this._fullResFrames?" checked":"")+" onchange=\"pict.views['RetoldRemote-VideoExplorer'].onFullResChange(this.checked)\">",l+="Full Res Frames</label>",l+='<button class="retold-remote-vex-refresh-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].refresh()">Refresh</button>',l+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 4px;"></span>',l+='<button class="retold-remote-vex-select-btn" id="RetoldRemote-VEX-SelectBtn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].toggleSelectionMode()">Select Range</button>',l+='<span class="retold-remote-vex-selection-info" id="RetoldRemote-VEX-SelectionInfo" style="display:none;"></span>',l+='<button class="retold-remote-vex-clear-btn" id="RetoldRemote-VEX-ClearBtn" style="display:none;" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].clearSelection()">Clear</button>',l+='<span id="RetoldRemote-VEX-GenerateControls" style="display:none;">',l+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 2px;"></span>',l+='<select class="retold-remote-vex-range-frame-select" id="RetoldRemote-VEX-RangeFrameCount">',l+='<option value="3">3</option>',l+='<option value="5" selected>5</option>',l+='<option value="10">10</option>',l+='<option value="20">20</option>',l+="</select>",l+='<button class="retold-remote-vex-generate-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].generateSelectionFrames()">Generate Frames</button>',l+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 2px;"></span>',l+='<button class="retold-remote-vex-save-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].saveSelectionToCollection()" title="Save segment to collection (s)">Save Segment</button>',l+="</span>",l+="</div>",l+='<div class="retold-remote-vex-body" id="RetoldRemote-VEX-Body">',l+='<div class="retold-remote-vex-loading">',l+='<div class="retold-remote-vex-loading-spinner"></div>',l+="Extracting frames from video...",l+="</div>",l+="</div>",l+='<div class="retold-remote-vex-timeline" id="RetoldRemote-VEX-Timeline" style="display:none;"></div>',l+="</div>",s&&(s.innerHTML=l);let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo(),this._fetchFrames(t)}_fetchFrames(t){let e=this,i="/api/media/video-frames?path="+this._getPathParam(t)+"&count="+this._frameCount;this._fullResFrames&&(i+="&width=1920&height=1080"),fetch(i).then(t=>t.json()).then(t=>{t&&t.Success?(e._frameData=t,e._renderFrames(),e._loadSavedCustomFrames()):e._showError(t?t.Error:"Unknown error")}).catch(t=>{e._showError(t.message)})}_renderFrames(){let t=this._frameData;if(!t)return;let e=document.getElementById("RetoldRemote-VEX-Info");if(e){let i="";i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Duration</span> <span class="retold-remote-vex-info-value">'+this._getFmt().escapeHTML(t.DurationFormatted)+"</span></span>",t.VideoWidth&&t.VideoHeight&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Resolution</span> <span class="retold-remote-vex-info-value">'+t.VideoWidth+"×"+t.VideoHeight+"</span></span>"),t.Codec&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Codec</span> <span class="retold-remote-vex-info-value">'+this._getFmt().escapeHTML(t.Codec)+"</span></span>"),t.FileSize&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Size</span> <span class="retold-remote-vex-info-value">'+this._getFmt().formatFileSize(t.FileSize)+"</span></span>"),i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Frames</span> <span class="retold-remote-vex-info-value">'+t.FrameCount+"</span></span>",e.innerHTML=i,e.style.display=""}let i=document.getElementById("RetoldRemote-VEX-Controls");i&&(i.style.display="");let o=document.getElementById("RetoldRemote-VEX-Body");if(o){let e='<div class="retold-remote-vex-grid">';for(let i=0;i<t.Frames.length;i++){let o=t.Frames[i];e+='<div class="retold-remote-vex-frame" id="retold-vex-frame-'+i+"\" onclick=\"pict.views['RetoldRemote-VideoExplorer'].selectFrame("+i+")\" ondblclick=\"pict.views['RetoldRemote-VideoExplorer'].openFrameFullsize("+i+')">',e+='<img src="'+this._buildFrameURL(t.CacheKey,o.Filename)+'" alt="Frame at '+this._getFmt().escapeHTML(o.TimestampFormatted)+'" loading="lazy">',e+='<div class="retold-remote-vex-frame-info">',e+='<span class="retold-remote-vex-frame-timestamp">'+this._getFmt().escapeHTML(o.TimestampFormatted)+"</span>",e+='<span class="retold-remote-vex-frame-index">#'+(o.Index+1)+"</span>",e+="</div>",e+="</div>"}e+="</div>",o.innerHTML=e}this._renderTimeline()}_renderTimeline(){let t=this._frameData;if(!t||!t.Duration)return;let e=document.getElementById("RetoldRemote-VEX-Timeline");if(!e)return;let i="";i+='<span class="retold-remote-vex-timeline-label">0:00</span>',i+='<div class="retold-remote-vex-timeline-column">',i+='<div class="retold-remote-vex-slider-track" id="RetoldRemote-VEX-SliderTrack"></div>',i+='<div class="retold-remote-vex-timeline-bar" id="RetoldRemote-VEX-TimelineBar">';for(let e=0;e<t.Frames.length;e++){let o=t.Frames[e],n=o.Timestamp/t.Duration*100;i+='<div class="retold-remote-vex-timeline-marker'+(e===this._selectedFrameIndex?" selected":"")+'" style="left:'+n.toFixed(2)+'%;" data-frame-index="'+e+'" title="'+this._getFmt().escapeHTML(o.TimestampFormatted)+'"></div>'}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let o=this._customFrames[e];i+='<div class="retold-remote-vex-timeline-marker custom" style="left:'+(o.Timestamp/t.Duration*100).toFixed(2)+'%;" title="'+this._getFmt().escapeHTML(o.TimestampFormatted)+'"></div>'}i+="</div>",i+="</div>",i+='<span class="retold-remote-vex-timeline-label">'+this._getFmt().escapeHTML(t.DurationFormatted)+"</span>",e.innerHTML=i,e.style.display="";let o=this,n=document.getElementById("RetoldRemote-VEX-TimelineBar");n&&(n.addEventListener("click",t=>{let e=t.target.closest(".retold-remote-vex-timeline-marker");if(e&&void 0!==e.dataset.frameIndex)return t.stopPropagation(),void o.selectFrame(parseInt(e.dataset.frameIndex,10));o._selectionModeActive||o.onTimelineClick(t)}),n.addEventListener("mousedown",t=>{0===t.button&&o._onSelectionDragStart(t)}),n.addEventListener("mousemove",t=>{o._onSelectionDragMove(t)}),n.addEventListener("touchstart",t=>{o._onSelectionDragStart(t)},{passive:!1}),n.addEventListener("touchmove",t=>{o._onSelectionDragMove(t)},{passive:!1}),o._cleanupWindowListeners(),o._boundDragEnd=t=>{o._onSelectionDragEnd(t)},window.addEventListener("mouseup",o._boundDragEnd),window.addEventListener("touchend",o._boundDragEnd),o._selectionModeActive&&n.classList.add("selecting")),this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._bindSliderHandleDrag()}selectFrame(t){if(this._selectedFrameIndex>=0){let t=document.getElementById("retold-vex-frame-"+this._selectedFrameIndex);t&&t.classList.remove("selected")}this._selectedFrameIndex=t;let e=document.getElementById("retold-vex-frame-"+t);e&&(e.classList.add("selected"),e.scrollIntoView({behavior:"smooth",block:"nearest"})),this._updateTimelineSelection()}_updateTimelineSelection(){let t=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!t)return;let e=t.querySelectorAll(".retold-remote-vex-timeline-marker");for(let t=0;t<e.length;t++)t===this._selectedFrameIndex?e[t].classList.add("selected"):e[t].classList.remove("selected")}onFrameCountChange(t){this._frameCount=parseInt(t,10)||20,this.refresh()}onFullResChange(t){this._fullResFrames=t,this.refresh()}refresh(){let t=document.getElementById("RetoldRemote-VEX-Body");t&&(t.innerHTML='<div class="retold-remote-vex-loading"><div class="retold-remote-vex-loading-spinner"></div>Extracting frames from video...</div>');let e=document.getElementById("RetoldRemote-VEX-Timeline");e&&(e.style.display="none"),this._selectedFrameIndex=-1,this._customFrames=[],this._fetchFrames(this._currentPath)}goBack(){if(this._cleanupWindowListeners(),this._currentPath){let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"video")}else{let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}}_showError(t){let e=document.getElementById("RetoldRemote-VEX-Body");e&&(e.innerHTML='<div class="retold-remote-vex-error"><div class="retold-remote-vex-error-message">'+this._getFmt().escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()">Back to Video</button></div>')}}Object.assign(l.prototype,n),Object.assign(l.prototype,r),Object.assign(l.prototype,s),l.default_configuration=a,e.exports=l},{"./VideoExplorer-CustomFrames":148,"./VideoExplorer-Preview":149,"./VideoExplorer-Selection":150,"pict-view":76}],148:[function(t,e,i){
|
|
205
|
+
const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-CollectionsPanel",DefaultRenderable:"RetoldRemote-CollectionsPanel",DefaultDestinationAddress:"#RetoldRemote-Collections-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-CollectionsPanel",Template:'<div class="retold-remote-collections-panel" id="RetoldRemote-CollectionsPanel-Root"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-CollectionsPanel",TemplateHash:"RetoldRemote-CollectionsPanel",DestinationAddress:"#RetoldRemote-Collections-Container"}]};class r extends o{constructor(t,e,i){super(t,e,i),this._draggedItemId=null}onAfterRender(){super.onAfterRender(),this.renderContent()}renderContent(){let t=document.getElementById("RetoldRemote-CollectionsPanel-Root");if(t)switch(this.pict.AppData.RetoldRemote.CollectionsPanelMode){case"detail":this._renderDetailMode(t);break;case"edit":this._renderEditMode(t);break;default:this._renderListMode(t)}}_renderListMode(t){let e=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"];t.innerHTML="";let n=document.createElement("div");n.className="retold-remote-collections-header";let r=document.createElement("div");r.className="retold-remote-collections-header-title",r.textContent="Collections";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="New Collection",s.textContent="+",s.onclick=()=>{let t=prompt("Collection name:");t&&t.trim()&&o.createCollection(t.trim(),(t,e)=>{!t&&e&&(i.CollectionsPanelMode="detail",o.fetchCollection(e.GUID))})},n.appendChild(r),n.appendChild(s),t.appendChild(n);let a=document.createElement("div");a.className="retold-remote-collections-search";let l=document.createElement("input");l.type="text",l.placeholder="Search collections...",l.value=i.CollectionSearchQuery||"",l.oninput=o=>{i.CollectionSearchQuery=o.target.value,e._renderCollectionCards(t.querySelector(".retold-remote-collections-body"))},a.appendChild(l),t.appendChild(a);let d=document.createElement("div");d.className="retold-remote-collections-body",t.appendChild(d),this._renderCollectionCards(d)}_renderCollectionCards(t){if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"],o=this.pict.providers["RetoldRemote-Icons"];t.innerHTML="";let n=i.searchCollections(e.CollectionSearchQuery);if(!n||0===n.length){let i=document.createElement("div");return i.className="retold-remote-collections-empty",i.textContent=e.CollectionSearchQuery?"No collections match your search.":"No collections yet. Click + to create one.",void t.appendChild(i)}for(let r=0;r<n.length;r++){let s=n[r],a=document.createElement("div");a.className="retold-remote-collection-card",a.onclick=()=>{e.CollectionsPanelMode="detail",i.fetchCollection(s.GUID)};let l=document.createElement("div");l.className="retold-remote-collection-card-icon",o&&"function"==typeof o.getIcon?l.innerHTML=o.getIcon("bookmark",18):l.textContent="☰";let d=document.createElement("div");d.className="retold-remote-collection-card-info";let c=document.createElement("div");c.className="retold-remote-collection-card-name",c.textContent=s.Name||"Untitled";let p=document.createElement("div");p.className="retold-remote-collection-card-meta",p.textContent=s.ItemCount+" item"+(1!==s.ItemCount?"s":""),d.appendChild(c),d.appendChild(p),a.appendChild(l),a.appendChild(d),t.appendChild(a)}}_renderDetailMode(t){let e=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"],n=i.ActiveCollection;if(t.innerHTML="",!n)return void(t.innerHTML='<div class="retold-remote-collections-empty">Loading...</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="Back to list",s.textContent="←",s.onclick=()=>{i.CollectionsPanelMode="list",i.ActiveCollectionGUID=null,i.ActiveCollection=null,e.renderContent()};let a=document.createElement("div");a.className="retold-remote-collections-header-title",a.textContent=n.Name||"Untitled";let l=document.createElement("button");l.className="retold-remote-collections-header-btn",l.title="Edit collection",l.textContent="✎",l.onclick=()=>{i.CollectionsPanelMode="edit",e.renderContent()},r.appendChild(s),r.appendChild(a),r.appendChild(l),t.appendChild(r);let d="operation-plan"===n.CollectionType;if(d){let e=document.createElement("div");e.className="retold-remote-collections-detail-controls retold-remote-collections-op-controls";let i=n.Items||[],r=0,s=0,a=0,l=0;for(let t=0;t<i.length;t++){let e=i[t].OperationStatus;"completed"===e?s++:"failed"===e?a++:"skipped"===e?l++:i[t].Operation&&r++}let d=document.createElement("div");d.className="retold-remote-collections-op-summary";let c=[];r>0&&c.push(r+" pending"),s>0&&c.push(s+" done"),a>0&&c.push(a+" failed"),l>0&&c.push(l+" skipped"),d.textContent=c.join(" · ")||"No operations",e.appendChild(d);let p=document.createElement("div");if(p.className="retold-remote-collections-op-buttons",r>0){let t=document.createElement("button");t.className="retold-remote-collections-op-execute-btn",t.textContent="Execute "+r+" Move"+(r>1?"s":""),t.onclick=()=>{t.disabled=!0,t.textContent="Moving...",o.executeCollectionOperations(n.GUID)},p.appendChild(t)}if(n.OperationBatchGUID&&s>0){let t=document.createElement("button");t.className="retold-remote-collections-op-undo-btn",t.textContent="Undo",t.onclick=()=>{t.disabled=!0,t.textContent="Undoing...",o.undoCollectionOperations(n.GUID)},p.appendChild(t)}e.appendChild(p),t.appendChild(e)}else{let e=document.createElement("div");e.className="retold-remote-collections-detail-controls";let r=document.createElement("select");r.className="retold-remote-collections-sort-select";let s=[{value:"manual",label:"Manual"},{value:"name",label:"Name"},{value:"modified",label:"Date Added"},{value:"type",label:"Type"}];for(let t=0;t<s.length;t++){let e=document.createElement("option");e.value=s[t].value,e.textContent=s[t].label,n.SortMode===s[t].value&&(e.selected=!0),r.appendChild(e)}r.onchange=t=>{o.sortActiveCollection(t.target.value,null)};let a=document.createElement("button");a.className="retold-remote-collections-sort-dir",a.textContent="desc"===n.SortDirection?"↓":"↑",a.title="desc"===n.SortDirection?"Descending":"Ascending",a.onclick=()=>{let t="desc"===i.ActiveCollection.SortDirection?"asc":"desc";o.sortActiveCollection(null,t)},e.appendChild(r),e.appendChild(a),t.appendChild(e)}let c=document.createElement("div");c.className="retold-remote-collections-body",t.appendChild(c),d?this._renderOperationItemList(c,n):this._renderItemList(c,n)}_renderItemList(t,e){let i=this,o=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-CollectionManager"]),n=e.Items||[];if(t.innerHTML="",0===n.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items yet. Browse files and add them to this collection.",void t.appendChild(e)}for(let r=0;r<n.length;r++){let s=n[r],a=document.createElement("div");if(a.className="retold-remote-collection-item",a.setAttribute("data-item-id",s.ID),"manual"===e.SortMode){let e=document.createElement("div");e.className="retold-remote-collection-item-drag",e.textContent="☰",e.draggable=!0,e.ondragstart=t=>{i._draggedItemId=s.ID,a.classList.add("dragging"),t.dataTransfer.effectAllowed="move"},e.ondragend=()=>{a.classList.remove("dragging"),i._draggedItemId=null;let e=t.querySelectorAll(".retold-remote-collection-item");for(let t=0;t<e.length;t++)e[t].classList.remove("drag-over")},a.appendChild(e)}a.ondragover=t=>{t.preventDefault(),t.dataTransfer.dropEffect="move",a.classList.add("drag-over")},a.ondragleave=()=>{a.classList.remove("drag-over")},a.ondrop=t=>{if(t.preventDefault(),a.classList.remove("drag-over"),i._draggedItemId&&i._draggedItemId!==s.ID){let t=e.Items||[],n=[];for(let e=0;e<t.length;e++)t[e].ID!==i._draggedItemId&&(t[e].ID===s.ID&&n.push(i._draggedItemId),n.push(t[e].ID));o.reorderItems(e.GUID,n)}};let l=document.createElement("div");l.className="retold-remote-collection-item-icon";let d=s.Path||"",c=d.replace(/^.*\./,"").toLowerCase(),p=this.pict.PictApplication._getMediaType(c);if("video-frame"===s.Type&&s.FrameCacheKey&&s.FrameFilename){let t=document.createElement("img");t.src="/api/media/video-frame/"+encodeURIComponent(s.FrameCacheKey)+"/"+encodeURIComponent(s.FrameFilename),t.alt="",t.loading="lazy",l.appendChild(t)}else if("image-crop"===s.Type&&s.CropRegion){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(d,48,48)),t.alt="",t.loading="lazy",l.appendChild(t)}else if("image"===p&&"file"===s.Type){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(d,48,48)),t.alt="",t.loading="lazy",l.appendChild(t)}else l.textContent=this._getTypeIcon(s.Type,p);let h=document.createElement("div");h.className="retold-remote-collection-item-name",h.textContent=s.Label||d.split("/").pop()||d,h.title=d;let u=document.createElement("div");u.className="retold-remote-collection-item-type",u.textContent=s.Type||"file";let m=document.createElement("button");m.className="retold-remote-collection-item-remove",m.title="Remove from collection",m.textContent="×",m.onclick=t=>{t.stopPropagation(),o.removeItemFromCollection(e.GUID,s.ID)};let f=r;a.onclick=()=>{if("folder"===s.Type||"folder-contents"===s.Type)i.pict.PictApplication.loadFileList(s.Path);else{let t=i.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._navigateToCollectionItem(s,f)}},a.appendChild(l),a.appendChild(h),a.appendChild(u),a.appendChild(m),t.appendChild(a)}}_renderOperationItemList(t,e){let i=this,o=this.pict.providers["RetoldRemote-CollectionManager"],n=e.Items||[];if(t.innerHTML="",0===n.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items in this sort plan.",void t.appendChild(e)}for(let r=0;r<n.length;r++){let s=n[r],a=document.createElement("div");a.className="retold-remote-collection-op-item";let l=s.OperationStatus||"pending";a.classList.add("op-status-"+l);let d=document.createElement("div");d.className="retold-remote-collection-op-status","completed"===l?(d.textContent="✓",d.title="Completed"):"failed"===l?(d.textContent="✗",d.title=s.OperationError||"Failed"):"skipped"===l?(d.textContent="—",d.title="Skipped"):(d.textContent="○",d.title="Pending");let c=document.createElement("div");c.className="retold-remote-collection-op-source";let p=s.Path||"";c.textContent=p.split("/").pop()||p,c.title=p;let h=document.createElement("div");h.className="retold-remote-collection-op-arrow",h.textContent="→";let u=document.createElement("div");u.className="retold-remote-collection-op-dest";let m=s.DestinationPath||"";u.textContent=m||"(no destination)",u.title=m,"pending"===l&&(u.style.cursor="pointer",u.onclick=t=>{t.stopPropagation(),i._startEditDestination(u,s,e)});let f=document.createElement("div");f.className="retold-remote-collection-op-badge",f.textContent=(s.Operation||"move").toUpperCase();let g=document.createElement("button");if(g.className="retold-remote-collection-item-remove",g.title="Skip this operation",g.textContent="×","pending"===l?g.onclick=t=>{t.stopPropagation(),o.skipItemOperation(s.ID)}:g.style.visibility="hidden","failed"===l&&s.OperationError){let t=document.createElement("div");t.className="retold-remote-collection-op-error",t.textContent=s.OperationError,a.appendChild(t)}a.appendChild(d),a.appendChild(c),a.appendChild(h),a.appendChild(u),a.appendChild(f),a.appendChild(g),t.appendChild(a)}}_startEditDestination(t,e,i){let o=this.pict.providers["RetoldRemote-CollectionManager"],n=document.createElement("input");n.type="text",n.className="retold-remote-collection-op-dest-input",n.value=e.DestinationPath||"";n.onblur=()=>{let i=n.value.trim();i&&i!==e.DestinationPath&&o.setItemDestination(e.ID,i),t.textContent=i||e.DestinationPath||"(no destination)",t.title=i||e.DestinationPath||""},n.onkeydown=i=>{"Enter"===i.key?(i.preventDefault(),n.blur()):"Escape"===i.key&&(i.preventDefault(),t.textContent=e.DestinationPath||"(no destination)",t.title=e.DestinationPath||"")},t.textContent="",t.appendChild(n),n.focus(),n.select()}_renderEditMode(t){let e=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"],n=i.ActiveCollection;if(t.innerHTML="",!n)return void(t.innerHTML='<div class="retold-remote-collections-empty">No collection selected.</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="Back to detail",s.textContent="←",s.onclick=()=>{i.CollectionsPanelMode="detail",e.renderContent()};let a=document.createElement("div");a.className="retold-remote-collections-header-title",a.textContent="Edit Collection",r.appendChild(s),r.appendChild(a),t.appendChild(r);let l=document.createElement("div");l.className="retold-remote-collections-body";let d=document.createElement("div");d.className="retold-remote-collections-edit",d.appendChild(this._createEditGroup("Name","input",n.Name||"","edit-name")),d.appendChild(this._createEditGroup("Description (Markdown)","textarea",n.Description||"","edit-description"));let c=this._createEditGroup("Cover Image Path","input",n.CoverImage||"","edit-cover"),p=this.pict.AppData.ContentEditor.CurrentFile;if(p){let t=document.createElement("button");t.className="retold-remote-collections-edit-btn",t.textContent="Use current file",t.style.marginTop="4px",t.style.fontSize="0.72rem",t.onclick=()=>{let t=document.getElementById("retold-remote-edit-cover");t&&(t.value=p)},c.appendChild(t)}d.appendChild(c),d.appendChild(this._createEditGroup("Tags (comma-separated)","input",(n.Tags||[]).join(", "),"edit-tags"));let h=document.createElement("div");h.className="retold-remote-collections-edit-actions";let u=document.createElement("button");u.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-primary",u.textContent="Save",u.onclick=()=>{let t=document.getElementById("retold-remote-edit-name"),e=document.getElementById("retold-remote-edit-description"),r=document.getElementById("retold-remote-edit-cover"),s=document.getElementById("retold-remote-edit-tags"),a={GUID:n.GUID,Name:t?t.value:n.Name,Description:e?e.value:n.Description,CoverImage:r?r.value:n.CoverImage,Tags:s?s.value.split(",").map(t=>t.trim()).filter(t=>t):n.Tags};o.updateCollection(a,t=>{if(!t){i.CollectionsPanelMode="detail",o.fetchCollection(n.GUID);let t=o._getToast();t&&t.show("Collection saved")}})};let m=document.createElement("button");m.className="retold-remote-collections-edit-btn",m.textContent="Cancel",m.onclick=()=>{i.CollectionsPanelMode="detail",e.renderContent()},h.appendChild(u),h.appendChild(m),d.appendChild(h);let f=document.createElement("button");f.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-danger",f.textContent="Delete Collection",f.onclick=()=>{confirm("Delete this collection? This cannot be undone.")&&o.deleteCollection(n.GUID)},d.appendChild(f),l.appendChild(d),t.appendChild(l)}_createEditGroup(t,e,i,o){let n=document.createElement("div");n.className="retold-remote-collections-edit-group";let r,s=document.createElement("div");return s.className="retold-remote-collections-edit-label",s.textContent=t,"textarea"===e?(r=document.createElement("textarea"),r.className="retold-remote-collections-edit-textarea"):(r=document.createElement("input"),r.className="retold-remote-collections-edit-input",r.type="text"),r.value=i,r.id="retold-remote-"+o,n.appendChild(s),n.appendChild(r),n}_getTypeIcon(t,e){switch(t){case"folder":case"folder-contents":return"📁";case"subfile":return"🗄";case"image-crop":return"✂";case"audio-clip":return"🎵";case"video-clip":case"video-frame":return"🎬"}switch(e){case"image":return"🖼";case"video":return"🎬";case"audio":return"🎵";default:return"📄"}}}r.default_configuration=n,e.exports=r},{"pict-view":88}],141:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-FileInfoPanel",DefaultRenderable:"RetoldRemote-FileInfoPanel",DefaultDestinationAddress:"#RetoldRemote-Info-Container",AutoRender:!1,CSS:"",DefaultTemplateRecordAddress:!1,Templates:[{Hash:"RetoldRemote-FileInfoPanel",Template:'<div class="retold-remote-info" id="RetoldRemote-Info-Body"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-FileInfoPanel",TemplateHash:"RetoldRemote-FileInfoPanel",DestinationAddress:"#RetoldRemote-Info-Container"}]};e.exports=class extends o{constructor(t,e,i){super(t,e,i),this._currentPath=null,this._currentMetadata=null,this._extracting=!1}onAfterRender(){this._refreshForCurrentFile()}_refreshForCurrentFile(){let t=this.pict.AppData.RetoldRemote,e="";if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.CurrentFile&&(e=this.pict.AppData.ContentEditor.CurrentFile),!e&&t.CurrentViewerFile&&(e=t.CurrentViewerFile),!e){let i=t.GalleryItems||[],o=t.GalleryCursorIndex||0;i.length>0&&i[o]&&i[o].Path&&(e=i[o].Path)}e?e===this._currentPath&&this._currentMetadata?this._renderMetadata(this._currentMetadata):(this._currentPath=e,this._currentMetadata=null,this._fetchMetadata(e,!1)):this._renderEmpty("No file selected")}_fetchMetadata(t,e){let i=this,o="/api/media/extended-metadata?path="+encodeURIComponent(t);e&&(o+="&extract=true",this._extracting=!0,this._renderSpinner()),fetch(o).then(t=>t.json()).then(e=>{i._extracting=!1,e&&e.Success?(i._currentMetadata=e,i.pict.AppData.RetoldRemote.CurrentFileMetadata=e,i._renderMetadata(e)):e&&!1===e.Cached?i._renderUncached(t):i._renderEmpty("Could not load metadata")}).catch(t=>{i._extracting=!1,i._renderEmpty("Error: "+t.message)})}extractMetadata(){!this._extracting&&this._currentPath&&this._fetchMetadata(this._currentPath,!0)}_getExtension(t){let e=(t||"").split("/").pop()||"",i=e.lastIndexOf(".");return i<1?"":e.substring(i)}_getHashForCurrentFile(){let t=this.pict.providers.RetoldRemote;if(t&&"function"==typeof t.getHashForPath){let e=t.getHashForPath(this._currentPath);if(e)return e}let e=this.pict.AppData.RetoldRemote.GalleryItems||[];for(let t=0;t<e.length;t++)if(e[t].Path===this._currentPath&&e[t].Hash)return e[t].Hash;return null}_triggerDownload(t,e){let i=document.createElement("a");i.href=t,i.download=e,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}downloadFile(){if(!this._currentPath)return;let t=this._currentPath.split("/").pop()||this._currentPath,e="/content/"+encodeURIComponent(this._currentPath);this._triggerDownload(e,t)}downloadHashedFile(){if(!this._currentPath)return;let t=this._getHashForCurrentFile();if(!t)return void this.fable.log.warn("No hash available for file: "+this._currentPath);let e=t+this._getExtension(this._currentPath),i="/content/"+encodeURIComponent(this._currentPath);this._triggerDownload(i,e)}_getInfoBody(){return document.getElementById("RetoldRemote-Info-Body")}_renderEmpty(t){let e=this._getInfoBody();e&&(e.innerHTML=`<div class="retold-remote-info-empty">${this._esc(t)}</div>`)}_renderSpinner(){let t=this._getInfoBody();t&&(t.innerHTML='<div class="retold-remote-info-spinner">Extracting metadata...</div>')}_renderUncached(t){let e=this._getInfoBody();if(!e)return;let i=t.split("/").pop()||t,o=t.substring(0,t.length-i.length),n=this.pict.AppData.RetoldRemote.GalleryItems||[],r=null;for(let e=0;e<n.length;e++)if(n[e].Path===t){r=n[e];break}let s="";s+=`<div class="retold-remote-info-filename">${this._esc(i)}</div>`,s+=`<div class="retold-remote-info-path">${this._esc(o)}</div>`,r&&(s+='<div class="retold-remote-info-section">',s+='<div class="retold-remote-info-section-title">Basic</div>',r.Size&&(s+=this._row("Size",this._formatSize(r.Size))),r.Type&&(s+=this._row("Type",r.Type)),r.Extension&&(s+=this._row("Extension",r.Extension)),s+="</div>"),s+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].extractMetadata()">Extract Metadata</button>',s+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadFile()" style="margin-top: 4px;">Download File</button>',s+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadHashedFile()" style="margin-top: 4px;">Download Hashed File</button>',e.innerHTML=s}_renderMetadata(t){let e=this._getInfoBody();if(!e)return;let i=(t.Path||"").split("/").pop()||t.Path,o=(t.Path||"").substring(0,(t.Path||"").length-i.length),n="";if(n+=`<div class="retold-remote-info-filename">${this._esc(i)}</div>`,n+=`<div class="retold-remote-info-path">${this._esc(o)}</div>`,n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Basic</div>',n+=this._row("Size",this._formatSize(t.FileSize)),n+=this._row("Category",t.Category||"unknown"),t.Extension&&(n+=this._row("Extension",t.Extension)),t.Modified&&(n+=this._row("Modified",this._formatDate(t.Modified))),t.Created&&(n+=this._row("Created",this._formatDate(t.Created))),t.MD5&&(n+='<div class="retold-remote-info-row">',n+='<span class="retold-remote-info-label">MD5</span>',n+=`<span class="retold-remote-info-value retold-remote-info-value-mono">${this._esc(t.MD5)}</span>`,n+="</div>"),n+="</div>",(t.FormatName||t.Duration)&&(n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Format</div>',t.FormatName&&(n+=this._row("Container",t.FormatName)),t.Duration&&(n+=this._row("Duration",this._formatDuration(t.Duration))),t.Bitrate&&(n+=this._row("Bitrate",this._formatBitrate(t.Bitrate))),n+="</div>"),t.Video){n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Video</div>';let e=t.Video;if(e.Codec){let t=e.Codec;e.Profile&&(t+=` (${e.Profile}`,e.Level&&(t+=` ${e.Level}`),t+=")"),n+=this._row("Codec",t)}e.Width&&e.Height&&(n+=this._row("Resolution",`${e.Width}×${e.Height}`)),e.FrameRate&&(n+=this._row("Frame Rate",this._formatFrameRate(e.FrameRate))),e.PixelFormat&&(n+=this._row("Pixel Format",e.PixelFormat)),e.ColorSpace&&(n+=this._row("Color Space",e.ColorSpace)),e.Bitrate&&(n+=this._row("Bitrate",this._formatBitrate(e.Bitrate))),n+="</div>"}if(t.Audio){n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Audio</div>';let e=t.Audio;if(e.Codec){let t=e.Codec;e.Profile&&(t+=` (${e.Profile})`),n+=this._row("Codec",t)}if(e.SampleRate&&(n+=this._row("Sample Rate",e.SampleRate+" Hz")),e.Channels){let t=e.ChannelLayout||e.Channels+" ch";n+=this._row("Channels",t)}e.Bitrate&&(n+=this._row("Bitrate",this._formatBitrate(e.Bitrate))),e.BitsPerSample&&(n+=this._row("Bit Depth",e.BitsPerSample+"-bit")),n+="</div>"}if(t.Image){let e=t.Image;if(n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Image</div>',e.Width&&e.Height&&(n+=this._row("Dimensions",`${e.Width}×${e.Height}`)),e.Format&&(n+=this._row("Format",e.Format)),e.Space&&(n+=this._row("Color Space",e.Space)),e.DPI&&(n+=this._row("DPI",e.DPI)),null!==e.HasAlpha&&void 0!==e.HasAlpha&&(n+=this._row("Alpha",e.HasAlpha?"Yes":"No")),n+="</div>",e.EXIF){let t=e.EXIF;if(t.Make||t.Model||t.ExposureTime||t.Software){if(n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">EXIF</div>',(t.Make||t.Model)&&(n+=this._row("Camera",((t.Make||"")+" "+(t.Model||"")).trim())),t.LensModel&&(n+=this._row("Lens",t.LensModel)),t.ExposureTime||t.FNumber||t.ISO){let e="";t.ExposureTime&&(e+=t.ExposureTime<1?`1/${Math.round(1/t.ExposureTime)}s`:t.ExposureTime+"s"),t.FNumber&&(e+=(e?" ":"")+`f/${t.FNumber}`),t.ISO&&(e+=(e?" ":"")+`ISO ${t.ISO}`),n+=this._row("Exposure",e)}t.FocalLength&&(n+=this._row("Focal Length",t.FocalLength+"mm")),t.DateTimeOriginal&&(n+=this._row("Date Taken",this._formatDate(t.DateTimeOriginal))),t.Software&&(n+=this._row("Software",t.Software)),n+="</div>"}}if(e.GPS){let t=e.GPS;if(n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">GPS</div>',null!==t.Latitude&&null!==t.Longitude){let e=parseFloat(t.Latitude).toFixed(6),i=parseFloat(t.Longitude).toFixed(6),o=t.Latitude>=0?"N":"S",r=t.Longitude>=0?"E":"W";n+=this._row("Latitude",`${Math.abs(e)}° ${o}`),n+=this._row("Longitude",`${Math.abs(i)}° ${r}`),null!==t.Altitude&&void 0!==t.Altitude&&(n+=this._row("Altitude",Math.round(t.Altitude)+"m")),n+='<div style="margin-top: 4px;">',n+=`<a class="retold-remote-info-gps-link" href="${`https://www.google.com/maps?q=${e},${i}`}" target="_blank" rel="noopener">Open in Maps ↗</a>`,n+="</div>"}n+="</div>"}}if(t.Document){let e=t.Document;n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Document</div>',e.PageCount&&(n+=this._row("Pages",e.PageCount)),e.Title&&(n+=this._row("Title",e.Title)),e.Author&&(n+=this._row("Author",e.Author)),e.Subject&&(n+=this._row("Subject",e.Subject)),e.Keywords&&(n+=this._row("Keywords",e.Keywords)),e.Creator&&(n+=this._row("Creator",e.Creator)),e.Producer&&(n+=this._row("Producer",e.Producer)),e.CreatedDate&&(n+=this._row("Created",this._formatDate(e.CreatedDate))),e.ModifiedDate&&(n+=this._row("Modified",this._formatDate(e.ModifiedDate))),n+="</div>"}if(t.Tags&&Object.keys(t.Tags).length>0){n+='<div class="retold-remote-info-section">',n+='<div class="retold-remote-info-section-title">Tags</div>';let e=Object.keys(t.Tags).sort();for(let i=0;i<e.length;i++){let o=e[i],r=t.Tags[o];n+='<div class="retold-remote-info-tag-row">',n+=`<span class="retold-remote-info-tag-key">${this._esc(o)}</span>`,n+=`<span class="retold-remote-info-tag-value">${this._esc(String(r))}</span>`,n+="</div>"}n+="</div>"}if(t.Chapters&&t.Chapters.length>0){n+='<div class="retold-remote-info-section">',n+=`<div class="retold-remote-info-section-title">Chapters (${t.Chapters.length})</div>`;for(let e=0;e<t.Chapters.length;e++){let i=t.Chapters[e];n+='<div class="retold-remote-info-chapter-row">',n+=`<span class="retold-remote-info-chapter-time">${this._formatDuration(i.StartTime)}</span>`,n+=`<span class="retold-remote-info-chapter-title">${this._esc(i.Title)}</span>`,n+="</div>"}n+="</div>"}n+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].extractMetadata()" style="margin-top: 8px;">Re-extract Metadata</button>',n+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadFile()" style="margin-top: 4px;">Download File</button>',n+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadHashedFile()" style="margin-top: 4px;">Download Hashed File</button>',e.innerHTML=n}_row(t,e){return`<div class="retold-remote-info-row"><span class="retold-remote-info-label">${this._esc(String(t))}</span><span class="retold-remote-info-value">${this._esc(String(e))}</span></div>`}_esc(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}_formatSize(t){if(!t&&0!==t)return"unknown";let e=parseInt(t,10);return e<1024?e+" B":e<1048576?(e/1024).toFixed(1)+" KB":e<1073741824?(e/1048576).toFixed(1)+" MB":(e/1073741824).toFixed(2)+" GB"}_formatDuration(t){if(!t&&0!==t)return"unknown";let e=Math.floor(t),i=Math.floor(e/3600),o=Math.floor(e%3600/60),n=e%60;return i>0?`${i}:${String(o).padStart(2,"0")}:${String(n).padStart(2,"0")}`:`${o}:${String(n).padStart(2,"0")}`}_formatBitrate(t){if(!t)return"unknown";let e=parseInt(t,10);return e<1e3?e+" bps":e<1e6?(e/1e3).toFixed(0)+" kbps":(e/1e6).toFixed(1)+" Mbps"}_formatFrameRate(t){if(!t)return"unknown";if("string"==typeof t&&t.includes("/")){let e=t.split("/"),i=parseFloat(e[0]),o=parseFloat(e[1]);if(o>0)return(i/o).toFixed(3).replace(/\.?0+$/,"")+" fps"}return t+" fps"}_formatDate(t){if(!t)return"unknown";try{let e=new Date(t);return isNaN(e.getTime())?String(t):e.toLocaleDateString()+" "+e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(e){return String(t)}}},e.exports.default_configuration=n},{"pict-view":88}],142:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-Gallery",DefaultRenderable:"RetoldRemote-Gallery-Grid",DefaultDestinationAddress:"#RetoldRemote-Gallery-Container",AutoRender:!1,CSS:"",Templates:[],Renderables:[]};class r extends o{constructor(t,e,i){super(t,e,i),this._intersectionObserver=null}renderGallery(){let t=document.getElementById("RetoldRemote-Gallery-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.GalleryItems||[],o=e.ViewMode||"list",n=e.ThumbnailSize||"medium",r=e.GalleryCursorIndex||0,s=document.getElementById("RetoldRemote-Gallery-Search"),a=s&&document.activeElement===s,l=a?s.selectionStart:0,d=a?s.selectionEnd:0,c=this._buildHeaderHTML(e.FilterState?e.FilterState.MediaType:"all");if(c+=this._buildFilterPanelHTML(),c+=this._buildFilterChipsHTML(),0===i.length){c+='<div class="retold-remote-empty">';let e=this.pict.providers["RetoldRemote-Icons"];if(c+='<div class="retold-remote-empty-icon"><span class="retold-remote-icon retold-remote-icon-xl">'+(e?e.getIcon("gallery-empty",96):"")+"</span></div>",c+="<div>Empty folder</div>",c+="</div>",t.innerHTML=c,a){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&(t.focus(),t.setSelectionRange(l,d))}return}if(c+="gallery"===o?this._buildGridHTML(i,n,r):this._buildListHTML(i,r),t.innerHTML=c,a){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&(t.focus(),t.setSelectionRange(l,d))}this._setupLazyLoading();let p=this.pict.providers["RetoldRemote-GalleryNavigation"];p&&p.recalculateColumns();let h=this.pict.views["ContentEditor-TopBar"];h&&h.updateFilterIcon&&h.updateFilterIcon()}_buildHeaderHTML(t){let e=this.pict.AppData.RetoldRemote;if(!e.FilterBarVisible)return"";let i=[{key:"all",label:"All"},{key:"images",label:"Images"},{key:"video",label:"Video"},{key:"audio",label:"Audio"},{key:"documents",label:"Docs"}],o='<div class="retold-remote-gallery-header">';o+='<div class="retold-remote-gallery-filter">';for(let e=0;e<i.length;e++){let n=i[e];o+='<button class="retold-remote-gallery-filter-btn'+(n.key===t?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].setFilter('"+n.key+"')\">"+n.label+"</button>"}o+="</div>",o+='<div class="retold-remote-gallery-sort">',o+='<select class="retold-remote-gallery-sort-select" id="RetoldRemote-Gallery-Sort" onchange="pict.views[\'RetoldRemote-Gallery\'].onSortChange(this.value)">';let n=[{value:"folder-first:asc",label:"Folders first"},{value:"name:asc",label:"Name A–Z"},{value:"name:desc",label:"Name Z–A"},{value:"modified:desc",label:"Newest modified"},{value:"modified:asc",label:"Oldest modified"},{value:"created:desc",label:"Newest created"},{value:"created:asc",label:"Oldest created"}],r=(e.SortField||"folder-first")+":"+(e.SortDirection||"asc");for(let t=0;t<n.length;t++){let e=n[t].value===r?" selected":"";o+='<option value="'+n[t].value+'"'+e+">"+n[t].label+"</option>"}o+="</select>",o+="</div>";let s=this.pict.providers["RetoldRemote-GalleryFilterSort"],a=s?s.getActiveFilterChips().length:0;o+='<button class="retold-remote-gallery-filter-btn retold-remote-gallery-filter-toggle'+(a>0?" has-filters":"")+'" onclick="pict.views[\'RetoldRemote-Gallery\'].toggleFilterPanel()">⚙ Filters',a>0&&(o+='<span class="retold-remote-gallery-filter-count">'+a+"</span>"),o+="</button>";let l=e.SearchQuery||"";o+='<input type="text" class="retold-remote-gallery-search" id="RetoldRemote-Gallery-Search" placeholder="Search files... (/)" value="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l)+'" oninput="pict.views[\'RetoldRemote-Gallery\'].onSearchInput(this.value)">';let d=e.SearchCaseSensitive||!1,c=e.SearchRegex||!1;return o+='<div class="retold-remote-gallery-search-options">',o+='<label class="retold-remote-gallery-search-option'+(d?" active":"")+'"><input type="checkbox" '+(d?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchCaseSensitiveChange(this.checked)\">Aa</label>",o+='<label class="retold-remote-gallery-search-option'+(c?" active":"")+'"><input type="checkbox" '+(c?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchRegexChange(this.checked)\">.*</label>",e._searchRegexError&&(o+='<span class="retold-remote-gallery-search-regex-error" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e._searchRegexError)+'">invalid regex</span>'),o+="</div>",o+="</div>",o}_buildFilterPanelHTML(){let t=this.pict.AppData.RetoldRemote;if(!t.FilterPanelOpen)return"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"],i=e?e.getAvailableExtensions():[],o=t.FilterState||{},n='<div class="retold-remote-filter-panel">';n+='<div class="retold-remote-filter-panel-grid">',n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">File Type</div>',n+='<div class="retold-remote-filter-ext-list">';let r=o.Extensions||[];for(let t=0;t<i.length;t++){let e=i[t];n+='<label class="retold-remote-filter-ext-item">',n+='<input type="checkbox" '+(0===r.length||r.indexOf(e.ext)>=0?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onExtensionToggle('"+e.ext+"', this.checked)\">",n+=" ."+e.ext+' <span class="retold-remote-filter-ext-count">('+e.count+")</span>",n+="</label>"}return n+="</div>",n+="</div>",n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">File Size</div>',n+='<div class="retold-remote-filter-row">',n+='<input type="number" class="retold-remote-filter-input" placeholder="Min KB" value="'+(null!==o.SizeMin&&void 0!==o.SizeMin?Math.round(o.SizeMin/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('min', this.value)\">",n+='<span class="retold-remote-filter-label">to</span>',n+='<input type="number" class="retold-remote-filter-input" placeholder="Max KB" value="'+(null!==o.SizeMax&&void 0!==o.SizeMax?Math.round(o.SizeMax/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('max', this.value)\">",n+='<span class="retold-remote-filter-label">KB</span>',n+="</div>",n+="</div>",n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">Modified Date</div>',n+='<div class="retold-remote-filter-row">',n+='<input type="date" class="retold-remote-filter-input" value="'+(o.DateModifiedAfter||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedAfter', this.value)\">",n+='<span class="retold-remote-filter-label">to</span>',n+='<input type="date" class="retold-remote-filter-input" value="'+(o.DateModifiedBefore||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedBefore', this.value)\">",n+="</div>",n+="</div>",n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">List Columns</div>',n+='<div class="retold-remote-filter-col-toggles">',n+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowExtension?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowExtension')\">Ext</button>",n+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowSize?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowSize')\">Size</button>",n+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowDate?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowDate')\">Date</button>",n+="</div>",n+="</div>",n+='<div class="retold-remote-filter-section">',n+='<div class="retold-remote-filter-section-title">Presets</div>',n+=this._buildPresetControlsHTML(),n+="</div>",n+='<div class="retold-remote-filter-actions">',n+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear All Filters</button>',n+="</div>",n+="</div>",n+="</div>",n}_buildPresetControlsHTML(){let t=this.pict.AppData.RetoldRemote.FilterPresets||[],e='<div class="retold-remote-filter-preset-row">';if(t.length>0){e+='<select class="retold-remote-filter-preset-select" id="RetoldRemote-Filter-PresetSelect" onchange="pict.views[\'RetoldRemote-Gallery\'].loadFilterPreset(this.value)">',e+='<option value="">Load preset...</option>';for(let i=0;i<t.length;i++)e+='<option value="'+i+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t[i].Name)+"</option>";e+="</select>",e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].deleteSelectedPreset()">✕</button>'}return e+='<input type="text" class="retold-remote-filter-preset-input" id="RetoldRemote-Filter-PresetName" placeholder="Preset name...">',e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].saveFilterPreset()">Save</button>',e+="</div>",e}_buildFilterChipsHTML(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(!t)return"";let e=t.getActiveFilterChips();if(0===e.length)return"";let i='<div class="retold-remote-filter-chips">';for(let t=0;t<e.length;t++){let o=e[t];i+='<span class="retold-remote-filter-chip">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(o.label)+" <button class=\"retold-remote-filter-chip-remove\" onclick=\"pict.views['RetoldRemote-Gallery'].removeFilterChip('"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(o.key)+"')\">×</button></span>"}return i+='<button class="retold-remote-filter-chip-clear" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear all</button>',i+="</div>",i}_buildGridHTML(t,e,i){let o='<div class="retold-remote-grid size-'+e+'">',n=this.pict.providers["RetoldRemote-Provider"],r=this.pict.providers["RetoldRemote-Icons"];for(let e=0;e<t.length;e++){let s=t[e],a=e===i?" selected":"",l=(s.Extension||"").toLowerCase(),d=this._getCategory(l,s.Type);if(o+='<div class="retold-remote-tile'+a+'" data-index="'+e+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+e+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+e+')">',o+='<div class="retold-remote-tile-thumb">',"folder"===s.Type)o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("folder",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Folder</span>';else if("archive"===s.Type)o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-archive",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Archive</span>';else if("image"===d&&n){let t=n.getThumbnailURL(s.Path,400,300);o+=t?'<img data-src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-image",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-image">'+l+"</span>"}else if("video"===d){if(n){let t=n.getThumbnailURL(s.Path,400,300);o+=t?'<img data-src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>"}else o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>";o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-video">Video</span>'}else"audio"===d?(o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-audio",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-audio">Audio</span>'):"document"===d?(o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-document">'+l+"</span>"):o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>";o+="</div>",o+='<div class="retold-remote-tile-label" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+"</div>","file"===s.Type&&void 0!==s.Size?o+='<div class="retold-remote-tile-meta">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(s.Size)+"</div>":"folder"===s.Type?o+='<div class="retold-remote-tile-meta">Folder</div>':"archive"===s.Type&&(o+='<div class="retold-remote-tile-meta">Archive'+(s.Size?" · "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(s.Size):"")+"</div>"),o+="</div>"}return o+="</div>",o}_buildListHTML(t,e){let i=this.pict.AppData.RetoldRemote,o=!1!==i.ListShowExtension,n=!1!==i.ListShowSize,r=!1!==i.ListShowDate,s='<div class="retold-remote-list">',a=this.pict.providers["RetoldRemote-Icons"];for(let i=0;i<t.length;i++){let l=t[i],d=i===e?" selected":"",c="";if(a&&(c='<span class="retold-remote-icon retold-remote-icon-sm">'+a.getIconForEntry(l,16)+"</span>"),s+='<div class="retold-remote-list-row'+d+'" data-index="'+i+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+i+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+i+')">',s+='<div class="retold-remote-list-icon">'+c+"</div>",s+='<div class="retold-remote-list-name" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name)+"\" ontouchstart=\"pict.views['RetoldRemote-Gallery']._onNameTouchStart(event, '"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name).replace(/'/g,"\\'")+"')\" ontouchend=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\" ontouchcancel=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\">"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name)+"</div>",o){let t="";"file"===l.Type||"archive"===l.Type?t=(l.Extension||"").replace(/^\./,"").toLowerCase():"folder"===l.Type&&(t=""),s+='<div class="retold-remote-list-ext">'+t+"</div>"}n&&("file"!==l.Type&&"archive"!==l.Type||void 0===l.Size?s+='<div class="retold-remote-list-size"></div>':s+='<div class="retold-remote-list-size">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(l.Size)+"</div>"),r&&(l.Modified?s+='<div class="retold-remote-list-date">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatShortDate(l.Modified)+"</div>":s+='<div class="retold-remote-list-date"></div>'),s+="</div>"}return s+="</div>",s}_setupLazyLoading(){this._intersectionObserver&&this._intersectionObserver.disconnect();let t=document.querySelectorAll(".retold-remote-tile-thumb img[data-src]");if(0!==t.length){this._intersectionObserver=new IntersectionObserver(t=>{for(let e=0;e<t.length;e++)if(t[e].isIntersecting){let i=t[e].target;i.src=i.getAttribute("data-src"),i.removeAttribute("data-src"),this._intersectionObserver.unobserve(i)}},{rootMargin:"200px"});for(let e=0;e<t.length;e++)this._intersectionObserver.observe(t[e])}}onTileClick(t){let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.moveCursor(t)}onTileDoubleClick(t){this.pict.AppData.RetoldRemote.GalleryCursorIndex=t;let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.openCurrent()}setFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState.MediaType=t;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}onSearchInput(t){this.pict.AppData.RetoldRemote.SearchQuery=t||"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchCaseSensitiveChange(t){this.pict.AppData.RetoldRemote.SearchCaseSensitive=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchRegexChange(t){this.pict.AppData.RetoldRemote.SearchRegex=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSortChange(t){let e=t.split(":"),i=this.pict.AppData.RetoldRemote;i.SortField=e[0],i.SortDirection=e[1]||"asc";let o=this.pict.providers["RetoldRemote-GalleryFilterSort"];o&&o.applyFilterSort(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}toggleFilterPanel(){let t=this.pict.AppData.RetoldRemote;t.FilterPanelOpen=!t.FilterPanelOpen,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}onExtensionToggle(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,o=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e)i.Extensions.length>0&&i.Extensions.push(t);else if(0===i.Extensions.length&&o){let e=o.getAvailableExtensions();i.Extensions=e.map(t=>t.ext).filter(e=>e!==t)}else i.Extensions=i.Extensions.filter(e=>e!==t);o&&o.applyFilterSort()}onSizeFilterChange(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,o=e&&""!==e?1024*parseInt(e,10):null;"min"===t?i.SizeMin=o:i.SizeMax=o;let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.applyFilterSort()}onDateFilterChange(t,e){this.pict.AppData.RetoldRemote.FilterState[t]=e||null;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}removeFilterChip(t){let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.removeFilter(t),e.applyFilterSort())}clearAllFilters(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];t&&(t.clearAllFilters(),t.applyFilterSort())}saveFilterPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetName");if(!t||!t.value.trim())return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.savePreset(t.value.trim()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}loadFilterPreset(t){if(""===t||null==t)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.loadPreset(parseInt(t,10)),e.applyFilterSort()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}deleteSelectedPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(!t||""===t.value)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.deletePreset(parseInt(t.value,10)),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}toggleListColumn(t){let e=this.pict.AppData.RetoldRemote,i=e[t];e[t]=!1===i,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}_onNameTouchStart(t,e){let i=this;this._clearLongPressTimer(),this._longPressTimer=setTimeout(function(){i._showLongPressTooltip(t,e)},500)}_onNameTouchEnd(t){this._clearLongPressTimer(),this._hideLongPressTooltip()}_clearLongPressTimer(){this._longPressTimer&&(clearTimeout(this._longPressTimer),this._longPressTimer=null)}_showLongPressTooltip(t,e){this._hideLongPressTooltip();let i=document.createElement("div");i.className="retold-remote-longpress-tooltip",i.textContent=e;let o=t.touches&&t.touches[0];o&&(i.style.left=Math.min(o.clientX,window.innerWidth-20)+"px",i.style.top=o.clientY-50+"px"),document.body.appendChild(i),this._longPressTooltipEl=i,t.preventDefault()}_hideLongPressTooltip(){this._longPressTooltipEl&&(this._longPressTooltipEl.parentNode&&this._longPressTooltipEl.parentNode.removeChild(this._longPressTooltipEl),this._longPressTooltipEl=null)}_getCategory(t,e){if("folder"===e)return"folder";if("archive"===e)return"archive";let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(i)return i.getCategory(t);let o=(t||"").replace(/^\./,"").toLowerCase();return"png"===o||"jpg"===o||"jpeg"===o||"gif"===o||"webp"===o?"image":"mp4"===o||"webm"===o||"mov"===o?"video":"mp3"===o||"wav"===o||"ogg"===o?"audio":"pdf"===o?"document":"other"}}r.default_configuration=n,e.exports=r},{"pict-view":88}],143:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-ImageExplorer",DefaultRenderable:"RetoldRemote-ImageExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i),this._currentPath="",this._osdViewer=null,this._dziData=null,this._osdLoaded=!1,this._loading=!1}showExplorer(t){let e=this.pict.AppData.RetoldRemote;if(e.ActiveMode="image-explorer",e.CurrentViewerFile=t,e.CurrentViewerMediaType="image",this._currentPath=t,this._dziData=null,this._loading=!1,this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let i=this.pict.providers["RetoldRemote-Provider"],o="#/explore-image/"+(i?i.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",o):window.location.hash=o;let n=document.getElementById("RetoldRemote-Gallery-Container"),r=document.getElementById("RetoldRemote-Viewer-Container");n&&(n.style.display="none"),r&&(r.style.display="block");let s=t.replace(/^.*\//,""),a='<div class="retold-remote-iex">';a+='<div class="retold-remote-iex-header">',a+='<button class="retold-remote-iex-nav-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].goBack()" title="Back (Esc)">← Back</button>',a+='<div class="retold-remote-iex-title">Image Explorer — '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s)+"</div>",a+='<div class="retold-remote-iex-actions">',a+='<button class="retold-remote-iex-action-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].viewInBrowser()" title="View in standard viewer">🖼 View</button>',a+="</div>",a+="</div>",a+='<div class="retold-remote-iex-info" id="RetoldRemote-IEX-Info" style="display:none;"></div>',a+='<div class="retold-remote-iex-body" id="RetoldRemote-IEX-Body">',a+='<div class="retold-remote-iex-loading" id="RetoldRemote-IEX-Loading">',a+="<div>Loading image…</div>",a+="</div>",a+='<div id="RetoldRemote-IEX-Viewer" style="display:none;"></div>',a+="</div>",a+='<div class="retold-remote-iex-controls" id="RetoldRemote-IEX-Controls" style="display:none;">',a+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomIn()" title="Zoom In (+)">+ Zoom In</button>',a+='<span class="retold-remote-iex-zoom-label" id="RetoldRemote-IEX-ZoomLabel">100%</span>',a+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomOut()" title="Zoom Out (-)">- Zoom Out</button>',a+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomHome()" title="Fit to view (0)">Fit</button>',a+='<span style="flex:1;"></span>',a+='<span id="RetoldRemote-IEX-Coords" style="color:var(--retold-text-dim);font-size:0.72rem;"></span>',a+="</div>",a+="</div>",r&&(r.innerHTML=a);let l=this.pict.views["ContentEditor-TopBar"];l&&l.updateInfo(),this._ensureOSDLoaded(()=>{this._probeAndShow(t)})}_ensureOSDLoaded(t){if("undefined"!=typeof OpenSeadragon)return this._osdLoaded=!0,t();let e=this,i=document.createElement("script");i.src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/4.1.1/openseadragon.min.js",i.onload=function(){e._osdLoaded=!0,t()},i.onerror=function(){e._showError("Failed to load OpenSeadragon library.")},document.head.appendChild(i)}_probeAndShow(t){if(this._loading)return;this._loading=!0;let e=this,i=this.pict.providers["RetoldRemote-Provider"],o=i?i._getPathParam(t):encodeURIComponent(t);fetch("/api/media/image-preview?path="+o).then(t=>t.json()).then(i=>{if(!i||!i.Success)return e._loading=!1,void(e._isRawExtension(t)?e._showRawUnsupported():e._showSimpleImage(t));if(Math.max(i.OrigWidth||0,i.OrigHeight||0)>4096)e._generateAndShowTiles(t,o,i);else if(e._loading=!1,e._dziData={Width:i.OrigWidth,Height:i.OrigHeight},e._showSimpleImageInfo(i.OrigWidth,i.OrigHeight),i.IsRawFormat&&i.CacheKey){let t="/api/media/image-preview-file/"+encodeURIComponent(i.CacheKey)+"/"+encodeURIComponent(i.OutputFilename);e._initSimpleViewer(null,t)}else e._initSimpleViewer(t)}).catch(()=>{e._loading=!1,e._showSimpleImage(t)})}_showSimpleImage(t){this._dziData={Width:0,Height:0},this._initSimpleViewer(t)}_isRawExtension(t){return!!{nef:!0,nrw:!0,cr2:!0,cr3:!0,crw:!0,arw:!0,srf:!0,sr2:!0,raf:!0,orf:!0,rw2:!0,rwl:!0,pef:!0,srw:!0,x3f:!0,"3fr":!0,fff:!0,iiq:!0,dcr:!0,kdc:!0,mrw:!0,erf:!0,raw:!0,dng:!0,heic:!0,heif:!0}[(t||"").replace(/^.*\./,"").toLowerCase()]}_showRawUnsupported(){let t=document.getElementById("RetoldRemote-IEX-Loading");t&&(t.innerHTML='<div style="padding: 2em; text-align: center; color: #999;">Raw image preview not available.<br>Install dcraw on the server for raw camera format support.</div>')}_showSimpleImageInfo(t,e){let i=document.getElementById("RetoldRemote-IEX-Info");if(!i)return;let o="";o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',o+='<span class="retold-remote-iex-info-value">'+t+" × "+e+" px</span></span>",o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',o+='<span class="retold-remote-iex-info-value">'+(t*e/1e6).toFixed(1)+" MP</span></span>",o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',o+='<span class="retold-remote-iex-info-value">Direct</span></span>',i.innerHTML=o,i.style.display=""}_initSimpleViewer(t,e){let i=document.getElementById("RetoldRemote-IEX-Loading"),o=document.getElementById("RetoldRemote-IEX-Viewer"),n=document.getElementById("RetoldRemote-IEX-Controls");i&&(i.style.display="none"),o&&(o.style.display="block"),n&&(n.style.display="");let r,s=this;if(e)r=e;else{let e=this.pict.providers["RetoldRemote-Provider"];r=e?e.getContentURL(t):"/content/"+encodeURIComponent(t)}this._osdViewer=OpenSeadragon({id:"RetoldRemote-IEX-Viewer",tileSources:{type:"image",url:r},prefixUrl:"",showNavigationControl:!1,showNavigator:!0,navigatorPosition:"BOTTOM_RIGHT",navigatorSizeRatio:.15,animationTime:.3,blendTime:.1,minZoomLevel:.1,maxZoomLevel:20,visibilityRatio:.5,constrainDuringPan:!1,gestureSettingsMouse:{scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!0,flickEnabled:!1},gestureSettingsTouch:{pinchToZoom:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25}}),this._osdViewer.addHandler("zoom",function(){s._updateZoomLabel()}),this._osdViewer.addHandler("open",function(){let t=s._osdViewer.world.getItemAt(0);if(t){let e=t.getContentSize();e&&(s._dziData={Width:e.x,Height:e.y})}s._updateZoomLabel()}),void 0!==OpenSeadragon.MouseTracker&&new OpenSeadragon.MouseTracker({element:o,moveHandler:function(t){s._updateCoords(t.position)}})}_generateAndShowTiles(t,e,i){let o=this,n=null;i&&i.CacheKey&&i.OutputFilename&&(n="/api/media/image-preview-file/"+encodeURIComponent(i.CacheKey)+"/"+encodeURIComponent(i.OutputFilename)),n&&(this._dziData={Width:i.OrigWidth,Height:i.OrigHeight},this._showPreviewInfo(i.OrigWidth,i.OrigHeight),this._initSimpleViewer(null,n)),fetch("/api/media/dzi?path="+e).then(t=>t.json()).then(e=>{if(o._loading=!1,!e||!e.Success)return void(n||o._showSimpleImage(t));if(o._dziData=e,o._showInfo(e),o._osdViewer){try{o._osdViewer.destroy()}catch(t){}o._osdViewer=null}let i=document.getElementById("RetoldRemote-IEX-Viewer");i&&(i.innerHTML=""),o._initViewer(e)}).catch(e=>{o._loading=!1,n||o._showSimpleImage(t)})}_showPreviewInfo(t,e){let i=document.getElementById("RetoldRemote-IEX-Info");if(!i)return;let o="";o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',o+='<span class="retold-remote-iex-info-value">'+t+" × "+e+" px</span></span>",o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',o+='<span class="retold-remote-iex-info-value">'+(t*e/1e6).toFixed(1)+" MP</span></span>",o+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',o+='<span class="retold-remote-iex-info-value retold-remote-iex-tiling-status">Preview — generating tiles…</span></span>',i.innerHTML=o,i.style.display=""}_showInfo(t){let e=document.getElementById("RetoldRemote-IEX-Info");if(!e)return;let i="";i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.Width+" × "+t.Height+" px</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Tile size:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.TileSize+" px</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Format:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.Format+"</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',i+='<span class="retold-remote-iex-info-value">'+(t.Width*t.Height/1e6).toFixed(1)+" MP</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',i+='<span class="retold-remote-iex-info-value">Tiled</span></span>',e.innerHTML=i,e.style.display=""}_initViewer(t){let e=document.getElementById("RetoldRemote-IEX-Loading"),i=document.getElementById("RetoldRemote-IEX-Viewer"),o=document.getElementById("RetoldRemote-IEX-Controls");e&&(e.style.display="none"),i&&(i.style.display="block"),o&&(o.style.display="");let n=this,r={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:"/api/media/dzi-tile/"+encodeURIComponent(t.CacheKey)+"/",Format:t.Format,Overlap:String(t.Overlap),TileSize:String(t.TileSize),Size:{Width:String(t.Width),Height:String(t.Height)}}};this._osdViewer=OpenSeadragon({id:"RetoldRemote-IEX-Viewer",tileSources:r,prefixUrl:"",showNavigationControl:!1,showNavigator:!0,navigatorPosition:"BOTTOM_RIGHT",navigatorSizeRatio:.15,animationTime:.3,blendTime:.1,minZoomLevel:.1,maxZoomLevel:20,visibilityRatio:.5,constrainDuringPan:!1,gestureSettingsMouse:{scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!0,flickEnabled:!1},gestureSettingsTouch:{pinchToZoom:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25}}),this._osdViewer.addHandler("zoom",function(t){n._updateZoomLabel()}),this._osdViewer.addHandler("open",function(){n._updateZoomLabel()}),void 0!==OpenSeadragon.MouseTracker&&new OpenSeadragon.MouseTracker({element:i,moveHandler:function(t){n._updateCoords(t.position)}})}_updateZoomLabel(){if(!this._osdViewer)return;let t=document.getElementById("RetoldRemote-IEX-ZoomLabel");if(t){let e=this._osdViewer.viewport.getZoom(!0),i=this._osdViewer.viewport.getHomeZoom(),o=Math.round(e/i*100);t.textContent=o+"%"}}_updateCoords(t){if(!this._osdViewer||!this._dziData)return;let e=document.getElementById("RetoldRemote-IEX-Coords");if(e)try{let i=this._osdViewer.viewport.pointFromPixel(t),o=this._osdViewer.viewport.viewportToImageCoordinates(i),n=Math.round(o.x),r=Math.round(o.y);n>=0&&n<=this._dziData.Width&&r>=0&&r<=this._dziData.Height?e.textContent=n+", "+r:e.textContent=""}catch(t){}}zoomIn(){if(this._osdViewer){let t=this._osdViewer.viewport.getZoom();this._osdViewer.viewport.zoomTo(1.5*t)}}zoomOut(){if(this._osdViewer){let t=this._osdViewer.viewport.getZoom();this._osdViewer.viewport.zoomTo(t/1.5)}}zoomHome(){this._osdViewer&&this._osdViewer.viewport.goHome()}goBack(){if(this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}viewInBrowser(){if(this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"image")}_showError(t){let e=document.getElementById("RetoldRemote-IEX-Loading");e&&(e.style.display="none");let i=document.getElementById("RetoldRemote-IEX-Body");if(i){let e=this.pict.providers["RetoldRemote-FormattingUtilities"];i.innerHTML='<div class="retold-remote-iex-error"><div class="retold-remote-iex-error-message">'+e.escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-iex-nav-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].goBack()">Back to Image</button></div>'}}}r.default_configuration=n,e.exports=r},{"pict-view":88}],144:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-ImageViewer",DefaultRenderable:"RetoldRemote-ImageViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i),this._zoomLevel=1,this._naturalWidth=0,this._naturalHeight=0,this._resizeHandler=null}initImage(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t)return;this._naturalWidth=t.naturalWidth,this._naturalHeight=t.naturalHeight,this._zoomLevel=1,this._applyDisplay(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler);let e=this,i=null;this._resizeHandler=function(){clearTimeout(i),i=setTimeout(function(){e._applyDisplay()},100)},window.addEventListener("resize",this._resizeHandler),this._showExploreButton()}_showExploreButton(){let t=document.getElementById("RetoldRemote-ImageExploreBtn");t&&(t.style.display="")}_getFitMode(){return this.pict.AppData.RetoldRemote.ImageFitMode||"fit"}setFitMode(t){this.pict.AppData.RetoldRemote.ImageFitMode=t,this._zoomLevel=1,this._applyDisplay(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}cycleFitMode(){let t;switch(this._getFitMode()){case"fit":t="auto";break;case"auto":t="original";break;default:t="fit"}this.setFitMode(t),this._showFitModeIndicator(t)}toggleZoom(){this._naturalWidth&&(1===this._zoomLevel?this._zoomLevel=2:this._zoomLevel=1,this._applyDisplay())}zoomIn(){this._zoomLevel=Math.min(1.25*this._zoomLevel,8),this._applyDisplay()}zoomOut(){this._zoomLevel=Math.max(this._zoomLevel/1.25,.25),this._applyDisplay()}zoomReset(){this._zoomLevel=1,this._applyDisplay()}_applyDisplay(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t||!this._naturalWidth)return;let e=t.parentElement;if(!e)return;let i=this._getBaseSize(e),o=Math.round(i.width*this._zoomLevel),n=Math.round(i.height*this._zoomLevel);t.style.maxWidth="none",t.style.maxHeight="none",t.style.objectFit="",t.style.width=o+"px",t.style.height=n+"px",t.style.transform="",this._zoomLevel>1||o>e.clientWidth||n>e.clientHeight?t.style.cursor="zoom-out":t.style.cursor="zoom-in"}_getBaseSize(t){let e=this._naturalWidth,i=this._naturalHeight,o=t.clientWidth,n=t.clientHeight;if(!o||!n)return{width:e,height:i};let r=e/i;switch(this._getFitMode()){case"fit":{let t=o,e=o/r;return e>n&&(e=n,t=n*r),{width:t,height:e}}case"auto":{if(e<=o&&i<=n)return{width:e,height:i};let t=o,s=o/r;return s>n&&(s=n,t=n*r),{width:t,height:s}}default:return{width:e,height:i}}}_showFitModeIndicator(t){let e={fit:"Fit to Window",auto:"Original if Smaller",original:"Original Size"}[t]||t;this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator(e,1200)}cleanup(){this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null)}}r.default_configuration=n,e.exports=r},{"pict-view":88}],145:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"RetoldRemote-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-Layout-Shell",Template:'\n\t\t\t\t<div id="ContentEditor-TopBar-Container"></div>\n\t\t\t\t<div class="content-editor-body">\n\t\t\t\t\t<div class="content-editor-sidebar-wrap" style="width: 250px;">\n\t\t\t\t\t\t<div class="content-editor-sidebar-inner">\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab active" data-tab="files" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="favorites" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'favorites\')">Favorites</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="info" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'info\')">Info</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="settings" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'settings\')">Settings</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab content-editor-sidebar-tab-collections" data-tab="collections" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'collections\')" style="display:none;">Collections</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="files" id="ContentEditor-Sidebar-Container"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="favorites" id="RetoldRemote-Favorites-Container" style="display:none">\n\t\t\t\t\t\t\t\t<div id="RetoldRemote-Favorites-Body"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="info" id="RetoldRemote-Info-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="settings" id="RetoldRemote-Settings-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="collections" id="RetoldRemote-Collections-MobilePane" style="display:none"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="content-editor-resize-handle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="RetoldRemote-Content-Container">\n\t\t\t\t\t\t<div id="RetoldRemote-Gallery-Container"></div>\n\t\t\t\t\t\t<div id="RetoldRemote-Viewer-Container"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="retold-remote-collections-wrap collapsed" id="RetoldRemote-Collections-Wrap" style="width: 300px;">\n\t\t\t\t\t\t<div class="retold-remote-collections-resize-handle"></div>\n\t\t\t\t\t\t<div class="retold-remote-collections-inner">\n\t\t\t\t\t\t\t<div id="RetoldRemote-Collections-Container"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-Layout-Shell",TemplateHash:"RetoldRemote-Layout-Shell",DestinationAddress:"#ContentEditor-Application-Container"}]};class r extends o{constructor(t,e,i){super(t,e,i),this._sidebarDragging=!1,this._collectionsDragging=!1}onAfterRender(){super.onAfterRender(),this.pict.CSSMap.injectCSS(),this._setupResizeHandle();let t=this.pict.AppData.RetoldRemote;if(t&&t.SidebarCollapsed){let t=document.querySelector(".content-editor-sidebar-wrap");t&&t.classList.add("collapsed")}if(!this.isMobileDrawer()&&t&&t.SidebarWidth){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.width=t.SidebarWidth+"px")}if(this.isMobileDrawer()&&t&&t.SidebarDrawerHeight){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.height=t.SidebarDrawerHeight+"px")}if(t&&t.CollectionsPanelOpen){let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px"))}this._setupCollectionsResizeHandle();let e=this;window.addEventListener("hashchange",()=>{e.pict.PictApplication.resolveHash()})}isMobileDrawer(){return window.innerWidth<=600}toggleSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t)return;t.classList.toggle("collapsed");let e=this.pict.AppData.RetoldRemote,i=t.classList.contains("collapsed");if(e.SidebarCollapsed=i,!i)if(this.isMobileDrawer()){let i=e.SidebarDrawerHeight||Math.round(.33*window.innerHeight);t.style.height=i+"px"}else e.SidebarWidth&&(t.style.width=e.SidebarWidth+"px");this.pict.PictApplication.saveSettings();let o=this.pict.providers["RetoldRemote-GalleryNavigation"];o&&setTimeout(()=>o.recalculateColumns(),250)}switchSidebarTab(t){if(document.querySelectorAll(".content-editor-sidebar-tab").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-tab")===t)}),document.querySelectorAll(".content-editor-sidebar-pane").forEach(e=>{e.style.display=e.getAttribute("data-pane")===t?"":"none"}),"settings"===t){let t=this.pict.views["RetoldRemote-SettingsPanel"];t&&t.render()}if("favorites"===t&&this.renderFavoritesList(),"info"===t){let t=this.pict.views["RetoldRemote-FileInfoPanel"];t&&t.render()}if("collections"===t){let t=document.getElementById("RetoldRemote-Collections-Container"),e=document.getElementById("RetoldRemote-Collections-MobilePane");t&&e&&!e.contains(t)&&e.appendChild(t);let i=this.pict.views["RetoldRemote-CollectionsPanel"];i&&i.render();let o=this.pict.providers["RetoldRemote-CollectionManager"];o&&o.fetchCollections()}else{let t=document.getElementById("RetoldRemote-Collections-Container"),e=document.querySelector(".retold-remote-collections-inner");t&&e&&!e.contains(t)&&e.appendChild(t)}}_setupResizeHandle(){let t=this,e=document.querySelector(".content-editor-resize-handle"),i=document.querySelector(".content-editor-sidebar-wrap");if(!e||!i)return;let o=0,n=0,r=0,s=0;function a(t){return t.touches&&t.touches.length>0?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}}function l(l){t._sidebarDragging=!0;let p=a(l);o=p.x,n=p.y,r=i.offsetWidth,s=i.offsetHeight,e.classList.add("dragging"),document.addEventListener("mousemove",d),document.addEventListener("mouseup",c),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",c),l.preventDefault()}function d(e){if(!t._sidebarDragging)return;let l=a(e);if(t.isMobileDrawer()){let t=s+(l.y-n),e=Math.round(.7*window.innerHeight);t=Math.max(80,Math.min(t,e)),i.style.height=t+"px"}else{let t=r+(l.x-o);t=Math.max(150,Math.min(t,600)),i.style.width=t+"px"}e.preventDefault()}function c(){t._sidebarDragging=!1,e.classList.remove("dragging"),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",c);let o=t.pict.AppData.RetoldRemote;t.isMobileDrawer()?o.SidebarDrawerHeight=i.offsetHeight:o.SidebarWidth=i.offsetWidth,t.pict.PictApplication.saveSettings();let n=t.pict.providers["RetoldRemote-GalleryNavigation"];n&&n.recalculateColumns()}e.addEventListener("mousedown",l),e.addEventListener("touchstart",l,{passive:!1}),e.addEventListener("dblclick",function(e){e.preventDefault(),t.toggleSidebar()})}toggleCollectionsPanel(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}renderFavoritesList(){let t=document.getElementById("RetoldRemote-Favorites-Body");if(!t)return;let e=this.pict.AppData.RetoldRemote.FavoritesCollection,i=this.pict.providers["RetoldRemote-Icons"];if(!e||!Array.isArray(e.Items)||0===e.Items.length)return void(t.innerHTML='<div class="retold-remote-favorites-empty"><div style="font-size:1.5rem; margin-bottom:8px; opacity:0.4;">♡</div>No favorites yet.<br>Tap ♡ or press <b>h</b> to favorite files.</div>');let o="";for(let t=0;t<e.Items.length;t++){let n=e.Items[t],r=n.Path||"",s=r.split("/").pop()||r,a=s.lastIndexOf(".")>=0?s.substring(s.lastIndexOf(".")):"",l="";i&&(l=i.getIconForEntry({Type:"folder"===n.Type?"folder":"file",Extension:a},16));let d=r.replace(/'/g,"\\'");o+='<div class="retold-remote-favorites-item" onclick="pict.PictApplication.navigateToFile(\''+d+"')\">",o+='<span class="retold-remote-favorites-item-icon">'+l+"</span>",o+='<span class="retold-remote-favorites-item-name" title="'+r+'">'+s+"</span>",o+="<button class=\"retold-remote-favorites-item-remove\" onclick=\"event.stopPropagation(); pict.providers['RetoldRemote-CollectionManager'].toggleFavorite('"+d+'\')" title="Remove from favorites">×</button>',o+="</div>"}t.innerHTML=o}_setupCollectionsResizeHandle(){let t=document.querySelector(".retold-remote-collections-resize-handle"),e=document.getElementById("RetoldRemote-Collections-Wrap");if(!t||!e)return;let i=this,o=0,n=0;function r(r){if(e.classList.contains("collapsed"))return;r.preventDefault(),i._collectionsDragging=!0,t.classList.add("dragging");let l=r.touches?r.touches[0].clientX:r.clientX;o=l,n=e.getBoundingClientRect().width,document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",a)}function s(t){if(!i._collectionsDragging)return;t.preventDefault();let r=t.touches?t.touches[0].clientX:t.clientX,s=o-r,a=Math.max(150,Math.min(600,n+s));e.style.width=a+"px"}function a(){if(!i._collectionsDragging)return;i._collectionsDragging=!1,t.classList.remove("dragging"),i.pict.AppData.RetoldRemote.CollectionsPanelWidth=e.getBoundingClientRect().width,i.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a);let o=i.pict.providers["RetoldRemote-GalleryNavigation"];o&&"function"==typeof o.recalculateColumns&&o.recalculateColumns()}t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1}),t.addEventListener("dblclick",function(t){t.preventDefault(),i.toggleCollectionsPanel()})}}r.default_configuration=n,e.exports=r},{"pict-view":88}],146:[function(t,e,i){const o=t("pict-view"),n=t("./MediaViewer-EbookViewer"),r=t("./MediaViewer-CodeViewer"),s={ViewIdentifier:"RetoldRemote-MediaViewer",DefaultRenderable:"RetoldRemote-MediaViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class a extends o{constructor(t,e,i){super(t,e,i),this._swipeStartX=0,this._swipeStartY=0,this._swipeTouchCount=0,this._swipeHandlers=null,this._dfExitHandlers=null}showMedia(t,e){let i=this.pict.AppData.RetoldRemote;i.ActiveMode="viewer",i.CurrentViewerFile=t,i.CurrentViewerMediaType=e,i.VideoMenuActive="video"===e;let o=document.getElementById("RetoldRemote-Gallery-Container"),n=document.getElementById("RetoldRemote-Viewer-Container");o&&(o.style.display="none"),n&&(n.style.display="block");let r=t.replace(/^.*\//,""),s=this.pict.providers["RetoldRemote-Provider"],a=s?s.getContentURL(t):"/content/"+encodeURIComponent(t),l='<div class="retold-remote-viewer">';if(l+='<div class="retold-remote-viewer-header">',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">← Back</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">‹ Prev</button>',l+='<div class="retold-remote-viewer-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next ›</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">ⓘ</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">▢</button>',l+="</div>",l+='<div class="retold-remote-viewer-body">',l+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(i._distractionFreeMode?"":' style="display:none"')+"></div>","image"===e)l+=this._buildImagePlaceholderHTML(r);else switch(e){case"video":l+=this._buildVideoHTML(a,r);break;case"audio":l+=this._buildAudioHTML(a,r);break;case"text":l+=this._buildTextHTML(a,r,t);break;case"document":l+=this._buildDocumentHTML(a,r,t);break;default:l+=this._buildFallbackHTML(a,r)}if(l+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',l+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Loading...</span></div>',l+="</div>",l+="</div>",l+="</div>",n&&(n.innerHTML=l),"image"===e&&this._probeAndShowImage(t,a,r),this._loadFileInfo(t),"text"===e&&this._loadCodeViewer(a,t),"document"===e){let e=t.replace(/^.*\./,"").toLowerCase();"epub"!==e&&"mobi"!==e||this._loadEbookViewer(a,t)}this._setupSwipeNavigation(),this._setupDFExitHotspot();let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo()}showDirectImage(t,e,i){let o=this.pict.AppData.RetoldRemote;o.ActiveMode="viewer",o.CurrentViewerFile=i||"",o.CurrentViewerMediaType="image",o.VideoMenuActive=!1;let n=document.getElementById("RetoldRemote-Gallery-Container"),r=document.getElementById("RetoldRemote-Viewer-Container");n&&(n.style.display="none"),r&&(r.style.display="block");let s=this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e),a='<div class="retold-remote-viewer">';a+='<div class="retold-remote-viewer-header">',a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">← Back</button>',a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">‹ Prev</button>',a+='<div class="retold-remote-viewer-title">'+s+"</div>",a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next ›</button>',a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">ⓘ</button>',a+='<button class="retold-remote-viewer-nav-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">▢</button>',a+="</div>",a+='<div class="retold-remote-viewer-body">',a+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(o._distractionFreeMode?"":' style="display:none"')+"></div>",a+='<img id="RetoldRemote-ImageViewer-Img" src="'+t+'" alt="'+s+"\" style=\"max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;\" onload=\"if (pict.views['RetoldRemote-ImageViewer']) pict.views['RetoldRemote-ImageViewer'].initImage();\" onclick=\"if (pict.views['RetoldRemote-ImageViewer']) pict.views['RetoldRemote-ImageViewer'].toggleZoom();\" />",a+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',a+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Frame: '+s+"</span></div>",a+="</div>",a+="</div>",a+="</div>",r&&(r.innerHTML=a),this._setupSwipeNavigation(),this._setupDFExitHotspot();let l=this.pict.views["ContentEditor-TopBar"];l&&l.updateInfo()}_setupSwipeNavigation(){this._cleanupSwipe();let t=document.querySelector(".retold-remote-viewer-body");if(!t)return;let e=this,i=function(t){e._swipeTouchCount=t.touches.length,1===t.touches.length&&(e._swipeStartX=t.touches[0].clientX,e._swipeStartY=t.touches[0].clientY)},o=function(t){if(1!==e._swipeTouchCount)return;let i=t.changedTouches[0].clientX,o=t.changedTouches[0].clientY,n=i-e._swipeStartX,r=o-e._swipeStartY;if(Math.abs(n)<50||Math.abs(r)>Math.abs(n))return;let s=document.querySelector(".retold-remote-viewer-body");if(s&&s.scrollWidth>s.clientWidth+2)return;let a=e.pict.providers["RetoldRemote-GalleryNavigation"];a&&(n<0?a.nextFile():a.prevFile())};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",o,{passive:!0}),this._swipeHandlers={element:t,touchstart:i,touchend:o}}_cleanupSwipe(){this._swipeHandlers&&(this._swipeHandlers.element.removeEventListener("touchstart",this._swipeHandlers.touchstart),this._swipeHandlers.element.removeEventListener("touchend",this._swipeHandlers.touchend),this._swipeHandlers=null)}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree(),this._updateDFControls()}_updateDFControls(){let t=this.pict.AppData.RetoldRemote._distractionFreeMode||!1,e=document.getElementById("RetoldRemote-DF-ExitHotspot");e&&(e.style.display=t?"":"none")}_setupDFExitHotspot(){this._cleanupDFExitHotspot();let t=document.getElementById("RetoldRemote-DF-ExitHotspot");if(!t)return;let e=this,i=function(){e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree()},o=0,n=function(t){let i=Date.now();if(i-o<300){t.preventDefault(),e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree(),o=0}else o=i};t.addEventListener("dblclick",i),t.addEventListener("touchend",n),this._dfExitHandlers={element:t,dblclick:i,touchend:n}}_cleanupDFExitHotspot(){this._dfExitHandlers&&(this._dfExitHandlers.element.removeEventListener("dblclick",this._dfExitHandlers.dblclick),this._dfExitHandlers.element.removeEventListener("touchend",this._dfExitHandlers.touchend),this._dfExitHandlers=null)}_buildImagePlaceholderHTML(t){return'<div id="RetoldRemote-ImagePlaceholder" style="display:flex;align-items:center;justify-content:center;height:100%;color:var(--retold-text-dim);font-size:0.85rem;">Loading '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t)+"…</div>"}_probeAndShowImage(t,e,i){let o=this,n=this.pict.providers["RetoldRemote-Provider"],r=n?n._getPathParam(t):encodeURIComponent(t);fetch("/api/media/image-preview?path="+r).then(t=>t.json()).then(n=>{if(!n||!n.Success)return void o._insertImageTag(e,i,!1);if(Math.max(n.OrigWidth||0,n.OrigHeight||0)>8192){let e=o.pict.views["RetoldRemote-ImageExplorer"];if(e)return void e.showExplorer(t)}if(n.NeedsPreview&&n.CacheKey){let t="/api/media/image-preview-file/"+encodeURIComponent(n.CacheKey)+"/"+encodeURIComponent(n.OutputFilename);return void o._insertImageTag(t,i,!0,n.OrigWidth,n.OrigHeight)}o._insertImageTag(e,i,!1)}).catch(()=>{o._insertImageTag(e,i,!1)})}_insertImageTag(t,e,i,o,n){let r=document.getElementById("RetoldRemote-ImagePlaceholder");if(!r||!r.parentElement)return;let s=this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e),a=document.createDocumentFragment(),l=document.createElement("img");l.src=t,l.alt=s,l.id="RetoldRemote-ImageViewer-Img",l.style.cssText="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;",l.onload=function(){pict.views["RetoldRemote-ImageViewer"].initImage()},l.onclick=function(){pict.views["RetoldRemote-ImageViewer"].toggleZoom()},a.appendChild(l);let d=document.createElement("button");if(d.className="retold-remote-image-explore-btn",d.id="RetoldRemote-ImageExploreBtn",d.style.display=i?"":"none",d.title="Open in deep-zoom explorer (e)",d.innerHTML="🔍 Explore",d.onclick=function(){pict.views["RetoldRemote-ImageExplorer"].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)},a.appendChild(d),i&&o&&n){let t=document.createElement("div");t.id="RetoldRemote-LargeImageBadge",t.className="retold-remote-image-large-badge",t.textContent=o+" × "+n+" px (preview)",a.appendChild(t)}r.parentElement.replaceChild(a,r)}_buildImageHTML(t,e){let i='<img src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'" style="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;" id="RetoldRemote-ImageViewer-Img" onload="pict.views[\'RetoldRemote-ImageViewer\'].initImage()" onclick="pict.views[\'RetoldRemote-ImageViewer\'].toggleZoom()">';return i+='<button class="retold-remote-image-explore-btn" id="RetoldRemote-ImageExploreBtn" style="display:none" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Open in deep-zoom explorer (e)">🔍 Explore</button>',i}_buildVideoHTML(t,e){let i=this.pict.AppData.RetoldRemote.ServerCapabilities||{},o=(this.pict.AppData.RetoldRemote.CurrentViewerFile,'<div class="retold-remote-video-action-menu" id="RetoldRemote-VideoActionMenu">');return o+='<div class="retold-remote-video-action-menu-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div>",i.ffmpeg&&(o+='<div id="RetoldRemote-VideoActionThumb" class="retold-remote-video-action-thumb-wrap"></div>',setTimeout(()=>{this.loadVideoMenuFrame()},0)),i.ffmpeg&&(o+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video"><span class="retold-remote-video-action-key">e</span>Explore Video Frames</button>'),o+='<button class="retold-remote-video-action-btn selected" onclick="pict.views[\'RetoldRemote-MediaViewer\'].playVideo()" title="Play video in browser"><span class="retold-remote-video-action-key">Space</span>Play in Browser</button>',i.ffmpeg&&(o+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].loadVideoMenuFrame()" title="Extract a frame from the midpoint of this video"><span class="retold-remote-video-action-key">t</span>Thumbnail</button>'),o+='<button class="retold-remote-video-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device"><span class="retold-remote-video-action-key">v</span>Stream with VLC</button>',o+="</div>",o}playVideo(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;e.replace(/^.*\//,"");let i=this.pict.providers["RetoldRemote-Provider"],o=i?i.getContentURL(e):"/content/"+encodeURIComponent(e),n=t.ServerCapabilities||{},r='<div class="retold-remote-video-wrap">';r+="<video controls"+(t.AutoplayVideo?" autoplay":"")+' preload="metadata" id="RetoldRemote-VideoPlayer"><source src="'+o+'">Your browser does not support the video tag.</video>',r+='<div class="retold-remote-video-stats" id="RetoldRemote-VideoStats">',r+='<span class="retold-remote-video-stat-label">Loading info...</span>',n.ffmpeg&&(r+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video">Explore Video</button>'),r+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device">Stream with VLC</button>',r+="</div>",r+="</div>";let s=document.getElementById("RetoldRemote-VideoActionMenu");s&&(s.outerHTML=r),t.VideoMenuActive=!1}loadVideoMenuFrame(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;let i=document.getElementById("RetoldRemote-VideoActionThumb");if(!i)return;i.innerHTML='<div class="retold-remote-video-action-thumb-loading">Extracting frame...</div>';let o=this.pict.providers["RetoldRemote-Provider"],n=o?o._getPathParam(e):encodeURIComponent(e);fetch("/api/media/video-frames?path="+n+"&count=1").then(t=>t.json()).then(i=>{if(t.CurrentViewerFile!==e)return;let o=document.getElementById("RetoldRemote-VideoActionThumb");if(o)if(i&&i.Frames&&i.Frames.length>0){let t=i.Frames[0],n="/api/media/video-frame/"+i.CacheKey+"/"+t.Filename;o.innerHTML='<img src="'+n+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.replace(/^.*\//,""))+'" onerror="this.parentNode.innerHTML=\'\'">'}else o.innerHTML=""}).catch(()=>{let t=document.getElementById("RetoldRemote-VideoActionThumb");t&&(t.innerHTML="")})}_buildAudioHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"],o='<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("music-note",64)+"</span>":"🎵")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div><audio controls"+(this.pict.AppData.RetoldRemote.AutoplayAudio?" autoplay":"")+' preload="metadata" id="RetoldRemote-AudioPlayer" style="width: 100%; max-width: 500px;"><source src="'+t+'">Your browser does not support the audio tag.</audio>';o+='<div style="margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;">';let n=this.pict.AppData.RetoldRemote.ServerCapabilities||{};return(n.ffprobe||n.ffmpeg)&&(o+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore waveform and extract segments from this audio">Explore Audio</button>'),o+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device (v)">Stream with VLC</button>',o+="</div>",o+="</div>",o}_buildDocumentHTML(t,e,i){let o=i.replace(/^.*\./,"").toLowerCase();if("pdf"===o)return'<iframe src="'+t+'" style="width: 100%; height: 100%; border: none;"></iframe>';if("epub"===o||"mobi"===o)return this._buildEbookHTML(t,e,i);let n=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(n?'<span class="retold-remote-icon retold-remote-icon-lg">'+n.getIcon("document-large",64)+"</span>":"📄")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Open in new tab</a></div>'}_buildFallbackHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("document-large",64)+"</span>":"📄")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Download / Open in new tab</a></div>'}_loadFileInfo(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"];i&&i.fetchMediaProbe(t,(t,i)=>{if(!i)return;let o=document.getElementById("RetoldRemote-FileInfo-Overlay");if(o){let t="";if(void 0!==i.Size&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Size</span><span class="retold-remote-fileinfo-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(i.Size)+"</span></div>"),i.Width&&i.Height&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Dimensions</span><span class="retold-remote-fileinfo-value">'+i.Width+" x "+i.Height+"</span></div>"),i.Duration){let e=Math.floor(i.Duration/60),o=Math.floor(i.Duration%60);t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Duration</span><span class="retold-remote-fileinfo-value">'+e+":"+(o<10?"0":"")+o+"</span></div>"}i.Codec&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Codec</span><span class="retold-remote-fileinfo-value">'+i.Codec+"</span></div>"),i.Format&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Format</span><span class="retold-remote-fileinfo-value">'+i.Format+"</span></div>"),i.Modified&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Modified</span><span class="retold-remote-fileinfo-value">'+new Date(i.Modified).toLocaleString()+"</span></div>"),i.Path&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Path</span><span class="retold-remote-fileinfo-value">'+i.Path+"</span></div>"),o.innerHTML=t}let n=document.getElementById("RetoldRemote-VideoStats");if(n){let t="";if(i.Duration){let e=Math.floor(i.Duration/60),o=Math.floor(i.Duration%60);t+='<span><span class="retold-remote-video-stat-label">Duration</span> <span class="retold-remote-video-stat-value">'+e+":"+(o<10?"0":"")+o+"</span></span>"}if(i.Width&&i.Height&&(t+='<span><span class="retold-remote-video-stat-label">Resolution</span> <span class="retold-remote-video-stat-value">'+i.Width+"×"+i.Height+"</span></span>"),i.Codec&&(t+='<span><span class="retold-remote-video-stat-label">Codec</span> <span class="retold-remote-video-stat-value">'+i.Codec+"</span></span>"),i.Bitrate){let e,o=i.Bitrate;e=o>=1e6?(o/1e6).toFixed(1)+" Mbps":o>=1e3?Math.round(o/1e3)+" kbps":o+" bps",t+='<span><span class="retold-remote-video-stat-label">Bitrate</span> <span class="retold-remote-video-stat-value">'+e+"</span></span>"}void 0!==i.Size&&(t+='<span><span class="retold-remote-video-stat-label">Size</span> <span class="retold-remote-video-stat-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(i.Size)+"</span></span>");let o=n.querySelector(".retold-remote-explore-btn"),r=o?o.outerHTML:"",s=n.querySelector(".retold-remote-vlc-btn"),a=s?s.outerHTML:"";n.innerHTML=t+r+a}})}}Object.assign(a.prototype,n),Object.assign(a.prototype,r),a.default_configuration=s,e.exports=a},{"./MediaViewer-CodeViewer":137,"./MediaViewer-EbookViewer":138,"pict-view":88}],147:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-SettingsPanel",DefaultRenderable:"RetoldRemote-SettingsPanel",DefaultDestinationAddress:"#RetoldRemote-Settings-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this._renderSettingsContent()}_renderSettingsContent(){let t=document.getElementById("RetoldRemote-Settings-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.ServerCapabilities||{},o='<div class="retold-remote-settings">';o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Appearance</div>',o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Theme</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeTheme(this.value)">';let n=this.pict.providers["RetoldRemote-Theme"];if(n){let t=n.getThemeList(),e=n.getCurrentTheme(),i="";for(let n=0;n<t.length;n++){let r=t[n];r.category!==i&&(i&&(o+="</optgroup>"),o+='<optgroup label="'+r.category+'">',i=r.category),o+='<option value="'+r.key+'"'+(r.key===e?" selected":"")+">"+r.name+"</option>"}i&&(o+="</optgroup>")}o+="</select>",o+="</div>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Gallery</div>',o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">View mode</span>',o+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ViewMode', this.value)\">",o+='<option value="gallery"'+("gallery"===e.ViewMode?" selected":"")+">Grid</option>",o+='<option value="list"'+("list"===e.ViewMode?" selected":"")+">List</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Thumbnail size</span>',o+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ThumbnailSize', this.value)\">",o+='<option value="small"'+("small"===e.ThumbnailSize?" selected":"")+">Small</option>",o+='<option value="medium"'+("medium"===e.ThumbnailSize?" selected":"")+">Medium</option>",o+='<option value="large"'+("large"===e.ThumbnailSize?" selected":"")+">Large</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Sort by</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortField(this.value)">',o+='<option value="folder-first"'+("folder-first"===e.SortField?" selected":"")+">Folders first</option>",o+='<option value="name"'+("name"===e.SortField?" selected":"")+">Name</option>",o+='<option value="modified"'+("modified"===e.SortField?" selected":"")+">Modified</option>",o+='<option value="created"'+("created"===e.SortField?" selected":"")+">Created</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Sort direction</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortDirection(this.value)">',o+='<option value="asc"'+("asc"===e.SortDirection?" selected":"")+">Ascending</option>",o+='<option value="desc"'+("desc"===e.SortDirection?" selected":"")+">Descending</option>",o+="</select>",o+="</div>";let r=e.FilterState&&e.FilterState.MediaType||"all";o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Media filter</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeMediaFilter(this.value)">',o+='<option value="all"'+("all"===r?" selected":"")+">All files</option>",o+='<option value="images"'+("images"===r?" selected":"")+">Images</option>",o+='<option value="video"'+("video"===r?" selected":"")+">Video</option>",o+='<option value="audio"'+("audio"===r?" selected":"")+">Audio</option>",o+='<option value="documents"'+("documents"===r?" selected":"")+">Documents</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Show hidden files</span>',o+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.ShowHiddenFiles?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleHiddenFiles(this.checked)\">",o+="</div>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Viewer</div>',o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Image fit mode</span>',o+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeImageFitMode(this.value)">',o+='<option value="fit"'+("fit"===e.ImageFitMode?" selected":"")+">Fit to window</option>",o+='<option value="auto"'+("auto"===e.ImageFitMode?" selected":"")+">Original if smaller</option>",o+='<option value="original"'+("original"===e.ImageFitMode?" selected":"")+">Original size</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Autoplay video</span>',o+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayVideo?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayVideo', this.checked)\">",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Autoplay audio</span>',o+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayAudio?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayAudio', this.checked)\">",o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Nav bar in distraction-free</span>',o+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.DistractionFreeShowNav?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleDistractionFreeNav(this.checked)\">",o+="</div>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Server Capabilities</div>',o+='<div class="retold-remote-settings-capabilities">';let s="Sharp (image thumbnails)";i.sharpMode&&(s="Sharp / "+i.sharpMode+" (image thumbnails)");let a=[{key:"sharp",label:s},{key:"imagemagick",label:"ImageMagick (image fallback)"},{key:"ffmpeg",label:"ffmpeg (video thumbnails)"},{key:"ffprobe",label:"ffprobe (media metadata)"}];for(let t=0;t<a.length;t++){let e=a[t],n=i[e.key];o+='<div class="retold-remote-settings-cap-row">',o+='<span class="retold-remote-settings-cap-label">'+e.label+"</span>",o+='<span class="'+(n?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(n?"Available":"Not found")+"</span>",o+="</div>"}o+='<div class="retold-remote-settings-cap-row" style="margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--retold-border);">',o+='<span class="retold-remote-settings-cap-label">Hashed filenames</span>',o+='<span class="'+(e.HashedFilenames?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(e.HashedFilenames?"Enabled":"Disabled")+"</span>",o+="</div>",o+="</div>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">AI File Sort</div>';let l=this.pict.providers["RetoldRemote-AISortManager"],d=e.AISortSettings||{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"};o+='<div class="retold-remote-settings-input-row">',o+='<label class="retold-remote-settings-input-label">AI Endpoint URL</label>',o+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortEndpoint" value="'+this._escapeAttr(d.AIEndpoint)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIEndpoint\', this.value)" placeholder="http://localhost:11434">',o+="</div>",o+='<div class="retold-remote-settings-input-row">',o+='<label class="retold-remote-settings-input-label">Model</label>',o+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortModel" value="'+this._escapeAttr(d.AIModel)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIModel\', this.value)" placeholder="llama3.1">',o+="</div>",o+='<div class="retold-remote-settings-row">',o+='<span class="retold-remote-settings-label">Provider</span>',o+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeAISetting('AIProvider', this.value)\">",o+='<option value="ollama"'+("ollama"===d.AIProvider?" selected":"")+">Ollama</option>",o+='<option value="openai"'+("openai"===d.AIProvider?" selected":"")+">OpenAI-compatible</option>",o+="</select>",o+="</div>",o+='<div class="retold-remote-settings-input-row" style="margin-top: 8px;">',o+='<label class="retold-remote-settings-input-label">Naming Template</label>',o+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortTemplate" value="'+this._escapeAttr(d.NamingTemplate)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'NamingTemplate\', this.value)" placeholder="{artist}/{album}/{track} - {title}">';let c=l?l.getTemplatePreview(d.NamingTemplate):"";c&&(o+='<div class="retold-remote-settings-template-preview">Preview: '+this._escapeHTML(c)+"</div>"),o+="</div>",o+='<button class="retold-remote-settings-vlc-btn" id="RetoldRemote-AISortTestBtn" onclick="pict.views[\'RetoldRemote-SettingsPanel\'].testAIConnection()" style="margin-top: 8px;">',o+="Test Connection",o+="</button>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">VLC Streaming</div>',o+='<button class="retold-remote-settings-vlc-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].openModal()">',o+="VLC Protocol Setup",o+="</button>",o+="</div>",o+='<div class="retold-remote-settings-section">',o+='<div class="retold-remote-settings-section-title">Help</div>',o+='<button class="retold-remote-settings-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">',o+="Help (F1)",o+="</button>",o+="</div>",o+="</div>",t.innerHTML=o}changeTheme(t){let e=this.pict.providers["RetoldRemote-Theme"];e&&(e.applyTheme(t),this.pict.PictApplication.saveSettings(),this._renderSettingsContent())}changeSetting(t,e){let i=this.pict.AppData.RetoldRemote;if(i[t]=e,this.pict.PictApplication.saveSettings(),"gallery"===i.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}toggleHiddenFiles(t){this.pict.AppData.RetoldRemote.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings(),this.pict.PictApplication.syncHiddenFilesSetting(()=>{this.pict.PictApplication.loadFileList()})}toggleAutoplay(t,e){this.pict.AppData.RetoldRemote[t]=e,this.pict.PictApplication.saveSettings()}toggleDistractionFreeNav(t){let e=this.pict.AppData.RetoldRemote;if(e.DistractionFreeShowNav=t,this.pict.PictApplication.saveSettings(),e._distractionFreeMode){let e=document.querySelector(".retold-remote-viewer-header");e&&(e.style.display=t?"":"none")}}changeImageFitMode(t){let e=this.pict.views["RetoldRemote-ImageViewer"];if(e)e.setFitMode(t);else{this.pict.AppData.RetoldRemote.ImageFitMode=t,this.pict.PictApplication.saveSettings()}}changeSortField(t){this.pict.AppData.RetoldRemote.SortField=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeSortDirection(t){this.pict.AppData.RetoldRemote.SortDirection=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeMediaFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState&&(e.FilterState.MediaType=t),this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeAISetting(t,e){let i=this.pict.providers["RetoldRemote-AISortManager"];if(i){let o={};o[t]=e,i.updateSettings(o)}"NamingTemplate"===t&&this._renderSettingsContent()}testAIConnection(){let t=document.getElementById("RetoldRemote-AISortTestBtn");t&&(t.disabled=!0,t.textContent="Testing...");let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.testConnection()}_escapeAttr(t){return t?String(t).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"):""}_escapeHTML(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):""}_refilterGallery(){let t=this.pict.AppData.RetoldRemote,e=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e&&e.runFilterPipeline(),"gallery"===t.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}}r.default_configuration=n,e.exports=r},{"pict-view":88}],148:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"RetoldRemote-TopBar",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-TopBar",Template:'\n\t\t\t\t<div class="retold-remote-topbar">\n\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle" id="RetoldRemote-TopBar-SidebarToggle" onclick="pict.views[\'ContentEditor-Layout\'].toggleSidebar()" title="Toggle Sidebar"></button>\n\t\t\t\t\t<button class="retold-remote-topbar-df-toggle" id="RetoldRemote-TopBar-DFToggle" onclick="pict.views[\'ContentEditor-TopBar\'].toggleDistractionFree()" title="Distraction-free mode (d)"></button>\n\t\t\t\t\t<div class="retold-remote-topbar-location" id="RetoldRemote-TopBar-Location"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-info" id="RetoldRemote-TopBar-Info"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-actions">\n\t\t\t\t\t\t<button class="retold-remote-topbar-aisort-btn" id="RetoldRemote-TopBar-AISortBtn" onclick="pict.views[\'ContentEditor-TopBar\'].triggerAISort()" title="AI Sort (generate sort plan for current folder)" style="display:none;">Ai</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-addcoll-btn" id="RetoldRemote-TopBar-AddToCollectionBtn" onclick="pict.views[\'ContentEditor-TopBar\'].addToCollection(event)" title="Add to collection">★</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-favorites-btn" id="RetoldRemote-TopBar-FavoritesBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFavorite()" title="Toggle favorite (h)">♡</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle retold-remote-topbar-collections-btn" id="RetoldRemote-TopBar-CollectionsBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleCollections()" title="Toggle Collections panel (b)">★</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-filter-btn" id="RetoldRemote-TopBar-FilterBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFilterBar()" title="Toggle filter bar (/)">◢</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-TopBar",TemplateHash:"RetoldRemote-TopBar",DestinationAddress:"#ContentEditor-TopBar-Container"}]};class r extends o{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this.updateSidebarToggleIcon(),this.updateDFToggleIcon(),this.updateLocation(),this.updateInfo(),this.updateFavoritesIcon()}updateSidebarToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-SidebarToggle");if(!t)return;let e=this.pict.providers["RetoldRemote-Icons"];t.innerHTML=e?e.getIcon("sidebar",18):"☰"}updateDFToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-DFToggle");t&&(t.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9" /><polyline points="9 21 3 21 3 15" /><polyline points="21 15 21 21 15 21" /><polyline points="3 9 3 3 9 3" /></svg>')}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree&&t._toggleDistractionFree()}updateLocation(){let t=document.getElementById("RetoldRemote-TopBar-Location");if(!t)return;this.pict.AppData.RetoldRemote;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",i=this.pict.providers["RetoldRemote-Icons"],o='<span class="retold-remote-topbar-home-crumb" onclick="pict.PictApplication.loadFileList(\'\')" title="Home">'+(i?i.getIcon("home",16):"/")+"</span>";if(!e)return void(t.innerHTML='<span class="retold-remote-topbar-location-inner">'+o+"</span>");let n=e.split("/").filter(t=>t);if(n.length<=1){let e=o;for(let t=0;t<n.length;t++){e+='<span class="retold-remote-topbar-sep">/</span>',e+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+n.slice(0,t+1).join("/")+"')\">"+n[t]+"</span>"}return void(t.innerHTML='<span class="retold-remote-topbar-location-inner">'+e+"</span>")}let r=i?i.getIcon("folder",16):"",s=i?i.getIcon("home",16):"/",a="";for(let t=n.length-1;t>=0;t--){let e=n.slice(0,t+1).join("/"),i=n[t]+"/",o="";t>0&&(o="/"+n.slice(0,t).join("/")+"/"),a+='<button class="retold-remote-topbar-overflow-item" onclick="pict.PictApplication.loadFileList(\''+e+"'); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",a+='<span class="retold-remote-topbar-overflow-item-icon">'+r+"</span>",a+=o?'<span class="retold-remote-topbar-overflow-item-label"><span class="retold-remote-topbar-overflow-item-prefix">'+o+"</span>"+i+"</span>":'<span class="retold-remote-topbar-overflow-item-label">'+i+"</span>",a+="</button>"}a+="<button class=\"retold-remote-topbar-overflow-item\" onclick=\"pict.PictApplication.loadFileList(''); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",a+='<span class="retold-remote-topbar-overflow-item-icon">'+s+"</span>",a+='<span class="retold-remote-topbar-overflow-item-label">Home</span>',a+="</button>";let l=n[n.length-1],d="";d+='<span class="retold-remote-topbar-breadcrumb-overflow">',d+='<button class="retold-remote-topbar-overflow-btn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleBreadcrumbDropdown()" title="Navigate to parent folders">☰</button>',d+='<div class="retold-remote-topbar-overflow-dropdown" id="RetoldRemote-BreadcrumbDropdown">',d+=a,d+="</div>",d+="</span>",d+='<span class="retold-remote-topbar-location-inner">',d+=o,d+='<span class="retold-remote-topbar-sep">/</span>',d+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+n.join("/")+"')\">"+l+"</span>",d+="</span>",t.innerHTML=d}toggleBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");if(t)if(t.classList.contains("open"))this.closeBreadcrumbDropdown();else{t.classList.add("open");let e=this,i=function(o){if(t.contains(o.target))return;let n=t.parentElement&&t.parentElement.querySelector(".retold-remote-topbar-overflow-btn");n&&n.contains(o.target)||(e.closeBreadcrumbDropdown(),document.removeEventListener("click",i,!0),document.removeEventListener("touchstart",i,!0))};setTimeout(function(){document.addEventListener("click",i,!0),document.addEventListener("touchstart",i,!0)},0),this._breadcrumbCloseHandler=i}}closeBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");t&&t.classList.remove("open"),this._breadcrumbCloseHandler&&(document.removeEventListener("click",this._breadcrumbCloseHandler,!0),document.removeEventListener("touchstart",this._breadcrumbCloseHandler,!0),this._breadcrumbCloseHandler=null)}toggleFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!t.FilterBarVisible,t.FilterBarVisible||(t.FilterPanelOpen=!1);let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),this.updateFilterIcon(),t.FilterBarVisible&&setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}updateFilterIcon(){let t=document.getElementById("RetoldRemote-TopBar-FilterBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-GalleryFilterSort"],o=i?i.getActiveFilterChips().length:0,n=e.FilterBarVisible||!1;t.classList.remove("filter-active","filter-bar-open"),o>0?(t.classList.add("filter-active"),t.innerHTML='◓<span class="retold-remote-topbar-filter-badge">'+o+"</span>",t.title=o+" active filter"+(o>1?"s":"")+" (/)"):n?(t.classList.add("filter-bar-open"),t.innerHTML="◢",t.title="Hide filter bar (/)"):(t.innerHTML="◢",t.title="Toggle filter bar (/)")}updateInfo(){this.updateAISortButton();let t=document.getElementById("RetoldRemote-TopBar-Info");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.FolderSummary;if("viewer"===e.ActiveMode){let i=e.GalleryItems||[],o=e.GalleryCursorIndex||0,n=i[o];if(n){let e=o+1+"/"+i.length;t.innerHTML="<span>"+e+'</span><span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-1"> · </span><span class="retold-remote-topbar-info-priority-1">'+this._escapeHTML(n.Name)+"</span>"}return}let o=e.GalleryItems||[],n=e.GalleryCursorIndex||0,r="";if(o.length>0&&(r=n+1+"/"+o.length),!i)return void(t.textContent=r);let s=[];i.Images>0&&s.push(i.Images+" images"),i.Videos>0&&s.push(i.Videos+" videos"),i.Audio>0&&s.push(i.Audio+" audio");let a=[];i.Folders>0&&a.push(i.Folders+" folders"),i.Documents>0&&a.push(i.Documents+" docs"),i.Other>0&&a.push(i.Other+" other");let l="";if(r&&(l+="<span>"+r+"</span>"),a.length>0){l+=(l?'<span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-3"> · </span>':"")+'<span class="retold-remote-topbar-info-priority-3">'+a.join(" · ")+"</span>"}if(s.length>0){l+=(l?'<span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-2"> · </span>':"")+'<span class="retold-remote-topbar-info-priority-2">'+s.join(" · ")+"</span>"}t.innerHTML=l||""}_escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):""}triggerAISort(){let t=this.pict.providers["RetoldRemote-AISortManager"];if(!t)return;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",i=document.getElementById("RetoldRemote-TopBar-AISortBtn");i&&(i.classList.add("generating"),i.textContent="..."),t.generateSortPlan(e,(t,e)=>{i&&(i.classList.remove("generating"),i.textContent="Ai")})}updateAISortButton(){let t=document.getElementById("RetoldRemote-TopBar-AISortBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.isAvailable()?t.style.display="":t.style.display="none"}toggleCollections(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}updateCollectionsIcon(){let t=document.getElementById("RetoldRemote-TopBar-CollectionsBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-Icons"],o=e.CollectionsPanelOpen,n=this.pict.views["ContentEditor-Layout"];if(n&&n.isMobileDrawer()){let t=document.querySelector(".content-editor-sidebar-tab.active");o=t&&"collections"===t.getAttribute("data-tab")}o?(t.classList.add("panel-open"),i&&"function"==typeof i.getIcon&&(t.innerHTML=i.getIcon("bookmark-filled",16))):(t.classList.remove("panel-open"),i&&"function"==typeof i.getIcon&&(t.innerHTML=i.getIcon("bookmark",16)))}toggleFavorite(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.toggleFavorite()}updateFavoritesIcon(){let t=document.getElementById("RetoldRemote-TopBar-FavoritesBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-CollectionManager"];e&&e.isFavorited()?(t.classList.add("is-favorited"),t.innerHTML="♥",t.title="Remove from favorites (h)"):(t.classList.remove("is-favorited"),t.innerHTML="♡",t.title="Add to favorites (h)")}addToCollection(t){this.pict.AppData.RetoldRemote;let e=this.pict.providers["RetoldRemote-CollectionManager"];if(!e)return;let i=e.getQuickAddTargetGUID();if(i){if(e.addCurrentFileToCollection(i))return}this.showAddToCollectionDropdown(t)}showAddToCollectionDropdown(t){let e=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"];this._closeAddToCollectionDropdown();let n=document.getElementById("RetoldRemote-TopBar-AddToCollectionBtn");n&&o.fetchCollections(()=>{let t=i.Collections||[],r=document.createElement("div");r.className="retold-remote-addcoll-dropdown",r.id="RetoldRemote-AddToCollection-Dropdown";let s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item retold-remote-addcoll-dropdown-new",s.textContent="+ New Collection...",s.onclick=()=>{e._closeAddToCollectionDropdown();let t=prompt("Collection name:");t&&t.trim()?o.createCollection(t.trim(),(t,e)=>{!t&&e&&o.addPendingOrCurrentToCollection(e.GUID)}):o.clearPendingClipContext()},r.appendChild(s);for(let i=0;i<t.length;i++){let n=t[i],s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item",s.textContent=n.Name||"Untitled",s.onclick=()=>{e._closeAddToCollectionDropdown(),o.addPendingOrCurrentToCollection(n.GUID)},r.appendChild(s)}n.style.position="relative",n.appendChild(r),setTimeout(()=>{document.addEventListener("click",e._boundCloseDropdown=t=>{r.contains(t.target)||t.target===n||e._closeAddToCollectionDropdown()})},10)})}_closeAddToCollectionDropdown(){let t=document.getElementById("RetoldRemote-AddToCollection-Dropdown");t&&t.remove(),this._boundCloseDropdown&&(document.removeEventListener("click",this._boundCloseDropdown),this._boundCloseDropdown=null);let e=this.pict.providers["RetoldRemote-CollectionManager"];e&&e.clearPendingClipContext()}}r.default_configuration=n,e.exports=r},{"pict-view":88}],149:[function(t,e,i){const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-VLCSetup",DefaultRenderable:"RetoldRemote-VLCSetup",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:""};class r extends o{constructor(t,e,i){super(t,e,i),this._activePlatformTab=this._detectPlatform(),this._modalVisible=!1,this._boundKeyHandler=null}_detectPlatform(){let t="undefined"!=typeof navigator?navigator.userAgent:"";return/iPhone|iPad|iPod/i.test(t)||/Macintosh/i.test(t)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1?"ios":/Android/i.test(t)?"android":/Macintosh|Mac OS X/.test(t)?"macos":/Windows/.test(t)?"windows":"linux"}openModal(){if(this._modalVisible)return;this._modalVisible=!0;let t=document.createElement("div");t.className="retold-remote-vlc-modal-backdrop",t.id="RetoldRemote-VLCSetup-Backdrop",t.onclick=e=>{e.target===t&&this.closeModal()};let e=document.createElement("div");e.className="retold-remote-vlc-modal";let i=document.createElement("div");i.className="retold-remote-vlc-modal-header",i.innerHTML='<span class="retold-remote-vlc-modal-title">VLC Protocol Setup</span><button class="retold-remote-vlc-modal-close" onclick="pict.views[\'RetoldRemote-VLCSetup\'].closeModal()">X</button>';let o=document.createElement("div");o.className="retold-remote-vlc-modal-body",o.id="RetoldRemote-VLCSetup-Container",e.appendChild(i),e.appendChild(o),t.appendChild(e),document.body.appendChild(t),this._renderVLCSetupContent(),this._boundKeyHandler=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.closeModal())},document.addEventListener("keydown",this._boundKeyHandler,!0)}closeModal(){if(!this._modalVisible)return;this._modalVisible=!1;let t=document.getElementById("RetoldRemote-VLCSetup-Backdrop");t&&t.remove(),this._boundKeyHandler&&(document.removeEventListener("keydown",this._boundKeyHandler,!0),this._boundKeyHandler=null)}switchPlatformTab(t){this._activePlatformTab=t,this._renderVLCSetupContent()}_renderVLCSetupContent(){let t=document.getElementById("RetoldRemote-VLCSetup-Container");if(!t)return;let e=this._activePlatformTab,i="";i+='<div class="retold-remote-vlc-setup-section">',i+='<div class="retold-remote-vlc-setup-desc">',i+="Stream media directly in VLC from the browser. Press <b>v</b> in the media viewer to launch VLC with the current file.",i+="</div>",i+="</div>",i+='<div class="retold-remote-vlc-setup-status">',i+='<div class="retold-remote-vlc-setup-status-dot '+(this._detectPlatform()===e?"detected":"unknown")+'"></div>',i+="<span>Detected platform: <b>"+this._getPlatformLabel(this._detectPlatform())+"</b></span>",i+="</div>",i+='<div class="retold-remote-vlc-setup-platform-tabs">',i+=this._buildPlatformTab("ios","iOS",e),i+=this._buildPlatformTab("android","Android",e),i+=this._buildPlatformTab("macos","macOS",e),i+=this._buildPlatformTab("windows","Windows",e),i+=this._buildPlatformTab("linux","Linux",e),i+="</div>",i+=this._buildIOSContent(e),i+=this._buildAndroidContent(e),i+=this._buildMacOSContent(e),i+=this._buildWindowsContent(e),i+=this._buildLinuxContent(e),i+='<div class="retold-remote-vlc-setup-section">',i+='<div class="retold-remote-vlc-setup-section-title">Test</div>',i+='<div class="retold-remote-vlc-setup-desc">',i+="Click below to test whether the vlc:// protocol handler is registered. VLC should open.",i+="</div>",i+='<button class="retold-remote-vlc-setup-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].testProtocol()">Test VLC Protocol</button>',i+="</div>",t.innerHTML=i}_buildPlatformTab(t,e,i){let o="retold-remote-vlc-setup-platform-tab";return t===i&&(o+=" active"),'<button class="'+o+"\" onclick=\"pict.views['RetoldRemote-VLCSetup'].switchPlatformTab('"+t+"')\">"+e+"</button>"}_getPlatformLabel(t){return"ios"===t?"iOS":"android"===t?"Android":"macos"===t?"macOS":"windows"===t?"Windows":"Linux"}_buildIOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("ios"===t?" active":""))+'" data-platform="ios">';return e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (iOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC for iOS registers the vlc:// protocol handler automatically when installed. No additional setup is needed.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Installation</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Install <b>VLC for Mobile</b> from the App Store if you haven\'t already.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Tap the <b>Stream with VLC</b> button on any video or audio file. Safari will ask to open VLC — tap <b>Open</b>.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">If Safari shows "Cannot Open Page", VLC may not be installed or may need to be updated.</div>',e+="</div>",e+="</div>",e}_buildAndroidContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("android"===t?" active":""))+'" data-platform="android">';return e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Android)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC for Android registers the vlc:// protocol handler automatically when installed. No additional setup is needed.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Installation</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Install <b>VLC for Android</b> from the Google Play Store if you haven\'t already.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Tap the <b>Stream with VLC</b> button on any video or audio file. Your browser will ask to open VLC — tap <b>Open</b>.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">If your browser shows an error, VLC may not be installed or may need to be updated.</div>',e+="</div>",e+="</div>",e}_buildMacOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("macos"===t?" active":""))+'" data-platform="macos">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (macOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on macOS does not register a vlc:// protocol handler by default. ",e+="An AppleScript app bundle is needed to bridge vlc:// links to VLC. ",e+="Run the command below in Terminal to create and register the handler automatically.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Automatic Setup</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Copy and paste this into Terminal:",e+="</div>";let i=this._getMacSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyMacSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates an AppleScript at <code>/tmp/VLCProtocol.applescript</code> that handles vlc:// URLs</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Compiles it into an app bundle at <code>/Applications/VLCProtocol.app</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Adds the vlc:// URL scheme to the app\'s Info.plist</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">4</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers the protocol handler with macOS Launch Services</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC installed at /Applications/VLC.app and Python 3 (included with macOS).</div>',e+="</div>",e+="</div>",e}_buildWindowsContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("windows"===t?" active":""))+'" data-platform="windows">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Windows)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Windows requires a protocol handler to open vlc:// links. ",e+="Choose one of the options below to register the handler.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option A: Reinstall VLC</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Reinstall VLC and ensure "Register VLC as handler for vlc:// protocol" is checked during installation.</div>',e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option B: Registry File</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Save this as <code>vlc-protocol.reg</code> and double-click to import. ",e+="Adjust the VLC path if yours differs.",e+="</div>";let i=this._getWindowsRegFile();e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsReg()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option C: Batch Script</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Alternatively, save this as <code>vlc-protocol-setup.bat</code> and run as Administrator. ",e+="This creates a handler script and registers the vlc:// protocol automatically.",e+="</div>";let o=this._getWindowsBatchScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(o)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsBatch()">Copy to Clipboard</button>',e+="</div>",e+="</div>",e}_buildLinuxContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("linux"===t?" active":""))+'" data-platform="linux">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Linux)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Register a vlc:// protocol handler using a .desktop file and xdg-mime. ",e+="Run the command below in a terminal.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup Command</div>';let i=this._getLinuxSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyLinuxSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a handler script at <code>~/.local/bin/vlc-protocol</code> that URL-decodes and opens VLC</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a .desktop file at <code>~/.local/share/applications/vlc-protocol.desktop</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers vlc:// as a URL scheme via <code>xdg-mime</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC and Python 3 installed.</div>',e+="</div>",e+="</div>",e}_getMacSetupScript(){return["# Create the AppleScript handler","cat > /tmp/VLCProtocol.applescript << 'EOF'","on open location theURL","\tset theURL to text 7 thru -1 of theURL","\tset theURL to do shell script \"python3 -c 'import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))' \" & quoted form of theURL",'\tdo shell script "open -a VLC " & quoted form of theURL',"end open location","EOF","","# Compile into app bundle","osacompile -o /Applications/VLCProtocol.app /tmp/VLCProtocol.applescript","","# Add vlc:// URL scheme to Info.plist",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0 dict" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","/usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:0:CFBundleURLName string 'VLC Protocol'\" \\"," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes:0 string vlc" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","","# Register with Launch Services","/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \\"," -f /Applications/VLCProtocol.app","",'echo "VLC protocol handler installed successfully."'].join("\n")}_getWindowsRegFile(){return["Windows Registry Editor Version 5.00","","[HKEY_CLASSES_ROOT\\vlc]",'@="URL:VLC Protocol"','"URL Protocol"=""',"","[HKEY_CLASSES_ROOT\\vlc\\shell]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open\\command]","@=\"powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command \\\"$u='%1'; if($u.StartsWith('vlc://')){$u=$u.Substring(6)}; $u=[System.Uri]::UnescapeDataString($u); $u=$u.TrimEnd('/'); Start-Process -FilePath 'C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe' -ArgumentList $u\\\"\""].join("\n")}_getWindowsBatchScript(){return["@echo off","REM VLC Protocol Handler Setup for Windows","REM Run this as Administrator","","REM Create the handler directory",'mkdir "%APPDATA%\\VLCProtocol" 2>nul',"","REM Write the PowerShell handler script","(","echo $url = $args[0]","echo if ^($url -and $url.StartsWith^('vlc://'^)^) { $url = $url.Substring^(6^) }","echo $url = [System.Uri]::UnescapeDataString^($url^)","echo $url = $url.TrimEnd^('/'^)","echo if ^($url^) { Start-Process 'C:\\Program Files\\VideoLAN\\VLC\\vlc.exe' -ArgumentList $url }",') > "%APPDATA%\\VLCProtocol\\handler.ps1"',"","REM Register the protocol in the registry",'reg add "HKCU\\Software\\Classes\\vlc" /ve /d "URL:VLC Protocol" /f','reg add "HKCU\\Software\\Classes\\vlc" /v "URL Protocol" /d "" /f','reg add "HKCU\\Software\\Classes\\vlc\\shell\\open\\command" /ve /d "powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File \\"%APPDATA%\\VLCProtocol\\handler.ps1\\" \\"%%1\\"" /f',"","echo VLC protocol handler installed successfully.","pause"].join("\n")}_getLinuxSetupScript(){return["# Create handler script","mkdir -p ~/.local/bin","cat > ~/.local/bin/vlc-protocol << 'EOF'","#!/bin/bash",'URL="$1"','URL="${URL#vlc://}"','URL=$(python3 -c "import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))" "$URL")','exec vlc "$URL" &',"EOF","chmod +x ~/.local/bin/vlc-protocol","","# Create .desktop file","cat > ~/.local/share/applications/vlc-protocol.desktop << 'EOF'","[Desktop Entry]","Name=VLC Protocol Handler","Exec=bash -c '~/.local/bin/vlc-protocol %u'","Type=Application","NoDisplay=true","MimeType=x-scheme-handler/vlc;","EOF","","# Register the handler","xdg-mime default vlc-protocol.desktop x-scheme-handler/vlc","update-desktop-database ~/.local/share/applications/","",'echo "VLC protocol handler installed successfully."'].join("\n")}_copyToClipboard(t,e){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(t).then(()=>{this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}).catch(()=>{this._fallbackCopy(t,e)}):this._fallbackCopy(t,e)}_fallbackCopy(t,e){let i=document.createElement("textarea");i.value=t,i.style.position="fixed",i.style.left="-9999px",document.body.appendChild(i),i.select();try{document.execCommand("copy"),this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}catch(t){this.pict.providers["RetoldRemote-ToastNotification"].showToast("Failed to copy - please select and copy manually")}document.body.removeChild(i)}copyMacSetup(){this._copyToClipboard(this._getMacSetupScript(),"macOS setup script")}copyWindowsReg(){this._copyToClipboard(this._getWindowsRegFile(),"Registry file")}copyWindowsBatch(){this._copyToClipboard(this._getWindowsBatchScript(),"Batch script")}copyLinuxSetup(){this._copyToClipboard(this._getLinuxSetupScript(),"Linux setup script")}testProtocol(){let t=/Windows/.test(navigator.userAgent),e=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),i="https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4",o=t||e?"vlc://"+i:"vlc://"+encodeURIComponent(i),n=document.createElement("a");n.href=o,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}}r.default_configuration=n,e.exports=r},{"pict-view":88}],150:[function(t,e,i){const o=t("pict-view"),n=t("./VideoExplorer-Selection"),r=t("./VideoExplorer-CustomFrames"),s=t("./VideoExplorer-Preview"),a={ViewIdentifier:"RetoldRemote-VideoExplorer",DefaultRenderable:"RetoldRemote-VideoExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class l extends o{constructor(t,e,i){super(t,e,i),this._currentPath="",this._frameData=null,this._selectedFrameIndex=-1,this._frameCount=20,this._fullResFrames=!0,this._customFrames=[],this._selectionModeActive=!1,this._selectionStartTime=-1,this._selectionEndTime=-1,this._isSelectingRange=!1,this._isDraggingTimeline=!1,this._draggingHandle=null,this._fmt=null,this._provider=null}_getFmt(){return this._fmt||(this._fmt=this.pict.providers["RetoldRemote-FormattingUtilities"]),this._fmt}_getProvider(){return this._provider||(this._provider=this.pict.providers["RetoldRemote-Provider"]),this._provider}_buildFrameURL(t,e){return"/api/media/video-frame/"+encodeURIComponent(t)+"/"+encodeURIComponent(e)}_getPathParam(t){let e=this._getProvider();return e?e._getPathParam(t):encodeURIComponent(t)}_getClientX(t){return t.touches&&t.touches.length>0?t.touches[0].clientX:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0].clientX:"number"==typeof t.clientX?t.clientX:null}_getTimelineTimestamp(t){let e=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!e||!this._frameData||!this._frameData.Duration)return 0;let i=e.getBoundingClientRect(),o=this._getClientX(t);return null===o?0:Math.max(0,Math.min(1,(o-i.left)/i.width))*this._frameData.Duration}saveSelectionToCollection(){if(this._selectionStartTime<0||this._selectionEndTime<0)return;let t=Math.min(this._selectionStartTime,this._selectionEndTime),e=Math.max(this._selectionStartTime,this._selectionEndTime),i=this.pict.providers["RetoldRemote-CollectionManager"];if(!i)return;let o=i.getQuickAddTargetGUID();if(o)i.addVideoClipToCollection(o,t,e);else{i.setPendingClipContext({Type:"video-clip",Start:t,End:e});let o=this.pict.views["ContentEditor-TopBar"];o&&"function"==typeof o.showAddToCollectionDropdown&&o.showAddToCollectionDropdown()}}showExplorer(t,e,i){let o=this.pict.AppData.RetoldRemote;o.ActiveMode="video-explorer",o.CurrentViewerFile=t,o.CurrentViewerMediaType="video",this._currentPath=t,this._frameData=null,this._selectedFrameIndex=-1,this._customFrames=[],this._selectionModeActive=!1,this._isSelectingRange=!1,this._isDraggingTimeline=!1,this._draggingHandle=null,"number"==typeof e&&e>=0&&"number"==typeof i&&i>=0?(this._selectionStartTime=e,this._selectionEndTime=i,this._selectionFromCaller=!0):(this._selectionStartTime=-1,this._selectionEndTime=-1,this._selectionFromCaller=!1),this._cleanupWindowListeners();let n=this._getProvider(),r="#/explore/"+(n?n.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",r):window.location.hash=r;let s=document.getElementById("RetoldRemote-Gallery-Container"),a=document.getElementById("RetoldRemote-Viewer-Container");s&&(s.style.display="none"),a&&(a.style.display="block");let l=t.replace(/^.*\//,""),d='<div class="retold-remote-vex">',c=o.ServerCapabilities||{};d+='<div class="retold-remote-vex-header">',d+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()" title="Back (Esc)">← Back</button>',d+='<div class="retold-remote-vex-title">Video Explorer — '+this._getFmt().escapeHTML(l)+"</div>",d+='<div class="retold-remote-vex-actions">',d+='<button class="retold-remote-vex-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].playInBrowser()" title="Play in browser (Space)">▶ Play</button>',d+='<button class="retold-remote-vex-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream with VLC (v)">▶ VLC</button>',(c.ffmpeg||c.ffprobe)&&(d+='<button class="retold-remote-vex-action-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.views[\'RetoldRemote-VideoExplorer\']._currentPath)" title="Explore audio track">♫ Audio</button>'),d+="</div>",d+="</div>",d+='<div class="retold-remote-vex-info" id="RetoldRemote-VEX-Info" style="display:none;"></div>',d+='<div class="retold-remote-vex-controls" id="RetoldRemote-VEX-Controls" style="display:none;">',d+="<label>Frames:</label>",d+='<select id="RetoldRemote-VEX-FrameCount" onchange="pict.views[\'RetoldRemote-VideoExplorer\'].onFrameCountChange(this.value)">',d+='<option value="10"'+(10===this._frameCount?" selected":"")+">10</option>",d+='<option value="20"'+(20===this._frameCount?" selected":"")+">20</option>",d+='<option value="40"'+(40===this._frameCount?" selected":"")+">40</option>",d+='<option value="60"'+(60===this._frameCount?" selected":"")+">60</option>",d+='<option value="100"'+(100===this._frameCount?" selected":"")+">100</option>",d+="</select>",d+='<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;">',d+='<input type="checkbox" id="RetoldRemote-VEX-FullRes"'+(this._fullResFrames?" checked":"")+" onchange=\"pict.views['RetoldRemote-VideoExplorer'].onFullResChange(this.checked)\">",d+="Full Res Frames</label>",d+='<button class="retold-remote-vex-refresh-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].refresh()">Refresh</button>',d+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 4px;"></span>',d+='<button class="retold-remote-vex-select-btn" id="RetoldRemote-VEX-SelectBtn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].toggleSelectionMode()">Select Range</button>',d+='<span class="retold-remote-vex-selection-info" id="RetoldRemote-VEX-SelectionInfo" style="display:none;"></span>',d+='<button class="retold-remote-vex-clear-btn" id="RetoldRemote-VEX-ClearBtn" style="display:none;" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].clearSelection()">Clear</button>',d+='<span id="RetoldRemote-VEX-GenerateControls" style="display:none;">',d+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 2px;"></span>',d+='<select class="retold-remote-vex-range-frame-select" id="RetoldRemote-VEX-RangeFrameCount">',d+='<option value="3">3</option>',d+='<option value="5" selected>5</option>',d+='<option value="10">10</option>',d+='<option value="20">20</option>',d+="</select>",d+='<button class="retold-remote-vex-generate-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].generateSelectionFrames()">Generate Frames</button>',d+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 2px;"></span>',d+='<button class="retold-remote-vex-save-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].saveSelectionToCollection()" title="Save segment to collection (s)">Save Segment</button>',d+="</span>",d+="</div>",d+='<div class="retold-remote-vex-body" id="RetoldRemote-VEX-Body">',d+='<div class="retold-remote-vex-loading">',d+='<div class="retold-remote-vex-loading-spinner"></div>',d+="Extracting frames from video...",d+="</div>",d+="</div>",d+='<div class="retold-remote-vex-timeline" id="RetoldRemote-VEX-Timeline" style="display:none;"></div>',d+="</div>",a&&(a.innerHTML=d);let p=this.pict.views["ContentEditor-TopBar"];p&&p.updateInfo(),this._fetchFrames(t)}_fetchFrames(t){let e=this,i="/api/media/video-frames?path="+this._getPathParam(t)+"&count="+this._frameCount;this._fullResFrames&&(i+="&width=1920&height=1080"),fetch(i).then(t=>t.json()).then(t=>{t&&t.Success?(e._frameData=t,e._renderFrames(),e._loadSavedCustomFrames()):e._showError(t?t.Error:"Unknown error")}).catch(t=>{e._showError(t.message)})}_renderFrames(){let t=this._frameData;if(!t)return;let e=document.getElementById("RetoldRemote-VEX-Info");if(e){let i="";i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Duration</span> <span class="retold-remote-vex-info-value">'+this._getFmt().escapeHTML(t.DurationFormatted)+"</span></span>",t.VideoWidth&&t.VideoHeight&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Resolution</span> <span class="retold-remote-vex-info-value">'+t.VideoWidth+"×"+t.VideoHeight+"</span></span>"),t.Codec&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Codec</span> <span class="retold-remote-vex-info-value">'+this._getFmt().escapeHTML(t.Codec)+"</span></span>"),t.FileSize&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Size</span> <span class="retold-remote-vex-info-value">'+this._getFmt().formatFileSize(t.FileSize)+"</span></span>"),i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Frames</span> <span class="retold-remote-vex-info-value">'+t.FrameCount+"</span></span>",e.innerHTML=i,e.style.display=""}let i=document.getElementById("RetoldRemote-VEX-Controls");i&&(i.style.display="");let o=document.getElementById("RetoldRemote-VEX-Body");if(o){let e='<div class="retold-remote-vex-grid">';for(let i=0;i<t.Frames.length;i++){let o=t.Frames[i];e+='<div class="retold-remote-vex-frame" id="retold-vex-frame-'+i+"\" onclick=\"pict.views['RetoldRemote-VideoExplorer'].selectFrame("+i+")\" ondblclick=\"pict.views['RetoldRemote-VideoExplorer'].openFrameFullsize("+i+')">',e+='<img src="'+this._buildFrameURL(t.CacheKey,o.Filename)+'" alt="Frame at '+this._getFmt().escapeHTML(o.TimestampFormatted)+'" loading="lazy">',e+='<div class="retold-remote-vex-frame-info">',e+='<span class="retold-remote-vex-frame-timestamp">'+this._getFmt().escapeHTML(o.TimestampFormatted)+"</span>",e+='<span class="retold-remote-vex-frame-index">#'+(o.Index+1)+"</span>",e+="</div>",e+="</div>"}e+="</div>",o.innerHTML=e}this._renderTimeline()}_renderTimeline(){let t=this._frameData;if(!t||!t.Duration)return;let e=document.getElementById("RetoldRemote-VEX-Timeline");if(!e)return;let i="";i+='<span class="retold-remote-vex-timeline-label">0:00</span>',i+='<div class="retold-remote-vex-timeline-column">',i+='<div class="retold-remote-vex-slider-track" id="RetoldRemote-VEX-SliderTrack"></div>',i+='<div class="retold-remote-vex-timeline-bar" id="RetoldRemote-VEX-TimelineBar">';for(let e=0;e<t.Frames.length;e++){let o=t.Frames[e],n=o.Timestamp/t.Duration*100;i+='<div class="retold-remote-vex-timeline-marker'+(e===this._selectedFrameIndex?" selected":"")+'" style="left:'+n.toFixed(2)+'%;" data-frame-index="'+e+'" title="'+this._getFmt().escapeHTML(o.TimestampFormatted)+'"></div>'}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let o=this._customFrames[e];i+='<div class="retold-remote-vex-timeline-marker custom" style="left:'+(o.Timestamp/t.Duration*100).toFixed(2)+'%;" title="'+this._getFmt().escapeHTML(o.TimestampFormatted)+'"></div>'}i+="</div>",i+="</div>",i+='<span class="retold-remote-vex-timeline-label">'+this._getFmt().escapeHTML(t.DurationFormatted)+"</span>",e.innerHTML=i,e.style.display="";let o=this,n=document.getElementById("RetoldRemote-VEX-TimelineBar");n&&(n.addEventListener("click",t=>{let e=t.target.closest(".retold-remote-vex-timeline-marker");if(e&&void 0!==e.dataset.frameIndex)return t.stopPropagation(),void o.selectFrame(parseInt(e.dataset.frameIndex,10));o._selectionModeActive||o.onTimelineClick(t)}),n.addEventListener("mousedown",t=>{0===t.button&&o._onSelectionDragStart(t)}),n.addEventListener("mousemove",t=>{o._onSelectionDragMove(t)}),n.addEventListener("touchstart",t=>{o._onSelectionDragStart(t)},{passive:!1}),n.addEventListener("touchmove",t=>{o._onSelectionDragMove(t)},{passive:!1}),o._cleanupWindowListeners(),o._boundDragEnd=t=>{o._onSelectionDragEnd(t)},window.addEventListener("mouseup",o._boundDragEnd),window.addEventListener("touchend",o._boundDragEnd),o._selectionModeActive&&n.classList.add("selecting")),this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._bindSliderHandleDrag()}selectFrame(t){if(this._selectedFrameIndex>=0){let t=document.getElementById("retold-vex-frame-"+this._selectedFrameIndex);t&&t.classList.remove("selected")}this._selectedFrameIndex=t;let e=document.getElementById("retold-vex-frame-"+t);e&&(e.classList.add("selected"),e.scrollIntoView({behavior:"smooth",block:"nearest"})),this._updateTimelineSelection()}_updateTimelineSelection(){let t=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!t)return;let e=t.querySelectorAll(".retold-remote-vex-timeline-marker");for(let t=0;t<e.length;t++)t===this._selectedFrameIndex?e[t].classList.add("selected"):e[t].classList.remove("selected")}onFrameCountChange(t){this._frameCount=parseInt(t,10)||20,this.refresh()}onFullResChange(t){this._fullResFrames=t,this.refresh()}refresh(){let t=document.getElementById("RetoldRemote-VEX-Body");t&&(t.innerHTML='<div class="retold-remote-vex-loading"><div class="retold-remote-vex-loading-spinner"></div>Extracting frames from video...</div>');let e=document.getElementById("RetoldRemote-VEX-Timeline");e&&(e.style.display="none"),this._selectedFrameIndex=-1,this._customFrames=[],this._fetchFrames(this._currentPath)}goBack(){this._cleanupWindowListeners();let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}playInBrowser(){this._cleanupWindowListeners();let t=this.pict.views["RetoldRemote-MediaViewer"];t&&(t.showMedia(this._currentPath,"video"),t.playVideo())}_showError(t){let e=document.getElementById("RetoldRemote-VEX-Body");e&&(e.innerHTML='<div class="retold-remote-vex-error"><div class="retold-remote-vex-error-message">'+this._getFmt().escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()">Back to Video</button></div>')}}Object.assign(l.prototype,n),Object.assign(l.prototype,r),Object.assign(l.prototype,s),l.default_configuration=a,e.exports=l},{"./VideoExplorer-CustomFrames":151,"./VideoExplorer-Preview":152,"./VideoExplorer-Selection":153,"pict-view":88}],151:[function(t,e,i){
|
|
206
206
|
/**
|
|
207
207
|
* VideoExplorer — Custom Frames Mixin
|
|
208
208
|
*
|
|
@@ -216,7 +216,7 @@ const o=t("pict-view"),n={ViewIdentifier:"RetoldRemote-CollectionsPanel",Default
|
|
|
216
216
|
*
|
|
217
217
|
* @license MIT
|
|
218
218
|
*/
|
|
219
|
-
e.exports={generateSelectionFrames:function(){if(this._selectionStartTime<0||this._selectionEndTime<0)return;let t=Math.min(this._selectionStartTime,this._selectionEndTime),e=Math.max(this._selectionStartTime,this._selectionEndTime),i=document.getElementById("RetoldRemote-VEX-RangeFrameCount"),o=i?parseInt(i.value,10):5;o<1&&(o=5);let n=this._frameData;if(!n||!n.CacheKey)return;let r=[];if(1===o)r.push(t+(e-t)/2);else{let i=(e-t)/(o-1);for(let e=0;e<o;e++)r.push(t+i*e)}let s=this,a=this._getPathParam(this._currentPath);for(let t=0;t<r.length;t++){let e=r[t],i="retold-vex-gen-"+Date.now()+"-"+t;s._insertFramePlaceholder(e,i);let o="/api/media/video-frame-at?path="+a+"&cacheKey="+encodeURIComponent(n.CacheKey)+"×tamp="+e.toFixed(3);s._fullResFrames&&(o+="&width=1920&height=1080"),function(t,e){fetch(o).then(t=>t.json()).then(e=>{if(!e||!e.Success)throw new Error(e?e.Error:"Extraction failed.");s._customFrames.push(e);let i=document.getElementById(t);if(i){let t=s._buildFrameURL(n.CacheKey,e.Filename),o=s._getFmt().escapeHTML(e.Filename).replace(/'/g,"\\'"),r=s._getFmt().escapeHTML(e.TimestampFormatted).replace(/'/g,"\\'");i.ondblclick=function(){pict.views["RetoldRemote-VideoExplorer"].openCustomFrameFullsize(o,r)},i.style.cursor="pointer",i.innerHTML='<img src="'+t+'" alt="Frame at '+s._getFmt().escapeHTML(e.TimestampFormatted)+'" loading="lazy"><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s._getFmt().escapeHTML(e.TimestampFormatted)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>'}s._renderTimeline()}).catch(i=>{let o=document.getElementById(t);o&&(o.innerHTML='<div class="retold-remote-vex-frame-loading">Failed: '+s._getFmt().escapeHTML(i.message)+'</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s._getFmt().formatTimestamp(e)+'</span><span class="retold-remote-vex-frame-index">error</span></div>')})}(i,e)}},onTimelineClick:function(t){let e=this._frameData;if(!e||!e.Duration||!e.CacheKey)return;let i=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!i)return;let o=i.getBoundingClientRect(),n=t.clientX-o.left,r=Math.max(0,Math.min(1,n/o.width))*e.Duration,s=this,a="/api/media/video-frame-at?path="+this._getPathParam(this._currentPath)+"&cacheKey="+encodeURIComponent(e.CacheKey)+"×tamp="+r.toFixed(3);this._fullResFrames&&(a+="&width=1920&height=1080");let l="retold-vex-custom-"+Date.now();this._insertFramePlaceholder(r,l),fetch(a).then(t=>t.json()).then(t=>{if(!t||!t.Success)throw new Error(t?t.Error:"Extraction failed.");s._customFrames.push(t);let i=document.getElementById(l);if(i){let o=s._buildFrameURL(e.CacheKey,t.Filename),n=s._getFmt().escapeHTML(t.Filename).replace(/'/g,"\\'"),r=s._getFmt().escapeHTML(t.TimestampFormatted).replace(/'/g,"\\'");i.ondblclick=function(){pict.views["RetoldRemote-VideoExplorer"].openCustomFrameFullsize(n,r)},i.style.cursor="pointer",i.innerHTML='<img src="'+o+'" alt="Frame at '+s._getFmt().escapeHTML(t.TimestampFormatted)+'" loading="lazy"><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s._getFmt().escapeHTML(t.TimestampFormatted)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>'}s._renderTimeline()}).catch(t=>{let e=document.getElementById(l);e&&(e.innerHTML='<div class="retold-remote-vex-frame-loading">Failed: '+s._getFmt().escapeHTML(t.message)+'</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s._getFmt().formatTimestamp(r)+'</span><span class="retold-remote-vex-frame-index">error</span></div>')})},_loadSavedCustomFrames:function(){let t=this,e=this._getPathParam(this._currentPath);fetch("/api/media/video-explorer-state?path="+e).then(t=>t.json()).then(e=>{if(!e||!e.Success||!e.State)return;if(t._selectionFromCaller?(t._selectionFromCaller=!1,t._renderSelectionOverlay(),t._renderSliderHandles(),t._updateSelectionInfo()):"number"==typeof e.State.SelectionStartTime&&e.State.SelectionStartTime>=0&&"number"==typeof e.State.SelectionEndTime&&e.State.SelectionEndTime>=0&&(t._selectionStartTime=e.State.SelectionStartTime,t._selectionEndTime=e.State.SelectionEndTime,t._renderSelectionOverlay(),t._renderSliderHandles(),t._updateSelectionInfo()),!Array.isArray(e.State.CustomFrames)||0===e.State.CustomFrames.length)return;let i=e.State.CustomFrames;for(let e=0;e<i.length;e++){let o=i[e],n=o.CacheKey||(t._frameData?t._frameData.CacheKey:""),r=t._buildFrameURL(n,o.Filename);t._customFrames.push(o),t._insertRestoredCustomFrame(o,r)}t._renderTimeline()}).catch(t=>{})},_insertFrameAtPosition:function(t,e){let i=document.querySelector(".retold-remote-vex-grid");if(!i)return;let o=null,n=i.children;for(let t=0;t<n.length;t++){let i=n[t],r=i.querySelector(".retold-remote-vex-frame-timestamp");if(r){if(this._parseTimestamp(r.textContent)>e){o=i;break}}}o?i.insertBefore(t,o):i.appendChild(t)},_insertRestoredCustomFrame:function(t,e){let i=document.createElement("div");i.className="retold-remote-vex-frame custom-frame";let o=this._getFmt().escapeHTML(t.Filename).replace(/'/g,"\\'"),n=this._getFmt().escapeHTML(t.TimestampFormatted).replace(/'/g,"\\'");i.style.cursor="pointer",i.ondblclick=function(){pict.views["RetoldRemote-VideoExplorer"].openCustomFrameFullsize(o,n)},i.innerHTML='<img src="'+e+'" alt="Frame at '+this._getFmt().escapeHTML(t.TimestampFormatted)+'" loading="lazy"><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+this._getFmt().escapeHTML(t.TimestampFormatted)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>',this._insertFrameAtPosition(i,t.Timestamp)},_insertFramePlaceholder:function(t,e){let i=document.createElement("div");i.className="retold-remote-vex-frame custom-frame",i.id=e,i.innerHTML='<div class="retold-remote-vex-frame-loading">Extracting...</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+this._getFmt().formatTimestamp(t)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>',this._insertFrameAtPosition(i,t),i.scrollIntoView({behavior:"smooth",block:"nearest"})},_parseTimestamp:function(t){if(!t)return 0;let e=t.trim().split(":");return 3===e.length?3600*parseInt(e[0],10)+60*parseInt(e[1],10)+parseInt(e[2],10):2===e.length?60*parseInt(e[0],10)+parseInt(e[1],10):parseFloat(t)||0}}},{}],
|
|
219
|
+
e.exports={generateSelectionFrames:function(){if(this._selectionStartTime<0||this._selectionEndTime<0)return;let t=Math.min(this._selectionStartTime,this._selectionEndTime),e=Math.max(this._selectionStartTime,this._selectionEndTime),i=document.getElementById("RetoldRemote-VEX-RangeFrameCount"),o=i?parseInt(i.value,10):5;o<1&&(o=5);let n=this._frameData;if(!n||!n.CacheKey)return;let r=[];if(1===o)r.push(t+(e-t)/2);else{let i=(e-t)/(o-1);for(let e=0;e<o;e++)r.push(t+i*e)}let s=this,a=this._getPathParam(this._currentPath);for(let t=0;t<r.length;t++){let e=r[t],i="retold-vex-gen-"+Date.now()+"-"+t;s._insertFramePlaceholder(e,i);let o="/api/media/video-frame-at?path="+a+"&cacheKey="+encodeURIComponent(n.CacheKey)+"×tamp="+e.toFixed(3);s._fullResFrames&&(o+="&width=1920&height=1080"),function(t,e){fetch(o).then(t=>t.json()).then(e=>{if(!e||!e.Success)throw new Error(e?e.Error:"Extraction failed.");s._customFrames.push(e);let i=document.getElementById(t);if(i){let t=s._buildFrameURL(n.CacheKey,e.Filename),o=s._getFmt().escapeHTML(e.Filename).replace(/'/g,"\\'"),r=s._getFmt().escapeHTML(e.TimestampFormatted).replace(/'/g,"\\'");i.ondblclick=function(){pict.views["RetoldRemote-VideoExplorer"].openCustomFrameFullsize(o,r)},i.style.cursor="pointer",i.innerHTML='<img src="'+t+'" alt="Frame at '+s._getFmt().escapeHTML(e.TimestampFormatted)+'" loading="lazy"><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s._getFmt().escapeHTML(e.TimestampFormatted)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>'}s._renderTimeline()}).catch(i=>{let o=document.getElementById(t);o&&(o.innerHTML='<div class="retold-remote-vex-frame-loading">Failed: '+s._getFmt().escapeHTML(i.message)+'</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s._getFmt().formatTimestamp(e)+'</span><span class="retold-remote-vex-frame-index">error</span></div>')})}(i,e)}},onTimelineClick:function(t){let e=this._frameData;if(!e||!e.Duration||!e.CacheKey)return;let i=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!i)return;let o=i.getBoundingClientRect(),n=t.clientX-o.left,r=Math.max(0,Math.min(1,n/o.width))*e.Duration,s=this,a="/api/media/video-frame-at?path="+this._getPathParam(this._currentPath)+"&cacheKey="+encodeURIComponent(e.CacheKey)+"×tamp="+r.toFixed(3);this._fullResFrames&&(a+="&width=1920&height=1080");let l="retold-vex-custom-"+Date.now();this._insertFramePlaceholder(r,l),fetch(a).then(t=>t.json()).then(t=>{if(!t||!t.Success)throw new Error(t?t.Error:"Extraction failed.");s._customFrames.push(t);let i=document.getElementById(l);if(i){let o=s._buildFrameURL(e.CacheKey,t.Filename),n=s._getFmt().escapeHTML(t.Filename).replace(/'/g,"\\'"),r=s._getFmt().escapeHTML(t.TimestampFormatted).replace(/'/g,"\\'");i.ondblclick=function(){pict.views["RetoldRemote-VideoExplorer"].openCustomFrameFullsize(n,r)},i.style.cursor="pointer",i.innerHTML='<img src="'+o+'" alt="Frame at '+s._getFmt().escapeHTML(t.TimestampFormatted)+'" loading="lazy"><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s._getFmt().escapeHTML(t.TimestampFormatted)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>'}s._renderTimeline()}).catch(t=>{let e=document.getElementById(l);e&&(e.innerHTML='<div class="retold-remote-vex-frame-loading">Failed: '+s._getFmt().escapeHTML(t.message)+'</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s._getFmt().formatTimestamp(r)+'</span><span class="retold-remote-vex-frame-index">error</span></div>')})},_loadSavedCustomFrames:function(){let t=this,e=this._getPathParam(this._currentPath);fetch("/api/media/video-explorer-state?path="+e).then(t=>t.json()).then(e=>{if(!e||!e.Success||!e.State)return;if(t._selectionFromCaller?(t._selectionFromCaller=!1,t._renderSelectionOverlay(),t._renderSliderHandles(),t._updateSelectionInfo()):"number"==typeof e.State.SelectionStartTime&&e.State.SelectionStartTime>=0&&"number"==typeof e.State.SelectionEndTime&&e.State.SelectionEndTime>=0&&(t._selectionStartTime=e.State.SelectionStartTime,t._selectionEndTime=e.State.SelectionEndTime,t._renderSelectionOverlay(),t._renderSliderHandles(),t._updateSelectionInfo()),!Array.isArray(e.State.CustomFrames)||0===e.State.CustomFrames.length)return;let i=e.State.CustomFrames;for(let e=0;e<i.length;e++){let o=i[e],n=o.CacheKey||(t._frameData?t._frameData.CacheKey:""),r=t._buildFrameURL(n,o.Filename);t._customFrames.push(o),t._insertRestoredCustomFrame(o,r)}t._renderTimeline()}).catch(t=>{})},_insertFrameAtPosition:function(t,e){let i=document.querySelector(".retold-remote-vex-grid");if(!i)return;let o=null,n=i.children;for(let t=0;t<n.length;t++){let i=n[t],r=i.querySelector(".retold-remote-vex-frame-timestamp");if(r){if(this._parseTimestamp(r.textContent)>e){o=i;break}}}o?i.insertBefore(t,o):i.appendChild(t)},_insertRestoredCustomFrame:function(t,e){let i=document.createElement("div");i.className="retold-remote-vex-frame custom-frame";let o=this._getFmt().escapeHTML(t.Filename).replace(/'/g,"\\'"),n=this._getFmt().escapeHTML(t.TimestampFormatted).replace(/'/g,"\\'");i.style.cursor="pointer",i.ondblclick=function(){pict.views["RetoldRemote-VideoExplorer"].openCustomFrameFullsize(o,n)},i.innerHTML='<img src="'+e+'" alt="Frame at '+this._getFmt().escapeHTML(t.TimestampFormatted)+'" loading="lazy"><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+this._getFmt().escapeHTML(t.TimestampFormatted)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>',this._insertFrameAtPosition(i,t.Timestamp)},_insertFramePlaceholder:function(t,e){let i=document.createElement("div");i.className="retold-remote-vex-frame custom-frame",i.id=e,i.innerHTML='<div class="retold-remote-vex-frame-loading">Extracting...</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+this._getFmt().formatTimestamp(t)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>',this._insertFrameAtPosition(i,t),i.scrollIntoView({behavior:"smooth",block:"nearest"})},_parseTimestamp:function(t){if(!t)return 0;let e=t.trim().split(":");return 3===e.length?3600*parseInt(e[0],10)+60*parseInt(e[1],10)+parseInt(e[2],10):2===e.length?60*parseInt(e[0],10)+parseInt(e[1],10):parseFloat(t)||0}}},{}],152:[function(t,e,i){
|
|
220
220
|
/**
|
|
221
221
|
* VideoExplorer — Frame Preview Mixin
|
|
222
222
|
*
|
|
@@ -229,7 +229,7 @@ e.exports={generateSelectionFrames:function(){if(this._selectionStartTime<0||thi
|
|
|
229
229
|
*
|
|
230
230
|
* @license MIT
|
|
231
231
|
*/
|
|
232
|
-
e.exports={openFrame:function(t){if(!this._frameData||!t)return;let e=t.CacheKey||this._frameData.CacheKey,i=this._buildFrameURL(e,t.Filename),o=t.TimestampFormatted+" · "+("regular"===t.Type?"#"+((t.Index||0)+1):"custom");this._showFramePreview(i,o,t.Type,t.Index)},openFrameFullsize:function(t){if(!this._frameData||!this._frameData.Frames[t])return;let e=this._frameData.Frames[t];this.openFrame({Type:"regular",Index:t,Filename:e.Filename,TimestampFormatted:e.TimestampFormatted,CacheKey:this._frameData.CacheKey})},openCustomFrameFullsize:function(t,e){if(!this._frameData)return;let i=-1,o=this._frameData.CacheKey;for(let e=0;e<this._customFrames.length;e++)if(this._customFrames[e].Filename===t){i=e,this._customFrames[e].CacheKey&&(o=this._customFrames[e].CacheKey);break}this.openFrame({Type:"custom",Index:i,Filename:t,TimestampFormatted:e,CacheKey:o})},_buildAllFramesList:function(){let t=[];if(this._frameData&&this._frameData.Frames)for(let e=0;e<this._frameData.Frames.length;e++){let i=this._frameData.Frames[e];t.push({Type:"regular",Index:e,Timestamp:i.Timestamp,TimestampFormatted:i.TimestampFormatted,Filename:i.Filename,Label:i.TimestampFormatted+" · #"+(i.Index+1)})}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let i=this._customFrames[e];t.push({Type:"custom",Index:e,Timestamp:i.Timestamp,TimestampFormatted:i.TimestampFormatted,Filename:i.Filename,CacheKey:i.CacheKey||null,Label:i.TimestampFormatted+" · custom"})}return t.sort((t,e)=>t.Timestamp-e.Timestamp),t},_showFramePreview:function(t,e,i,o){this._previewType=i,this._previewIndex=o;let n=this._buildAllFramesList();this._previewAllFrames=n,this._previewPosition=0;for(let t=0;t<n.length;t++)if(n[t].Type===i&&n[t].Index===o){this._previewPosition=t;break}let r=this,s=document.createElement("div");s.className="retold-remote-vex-preview-backdrop",s.id="RetoldRemote-VEX-Preview",s.onclick=t=>{t.target===s&&r.closeFramePreview()};let a="";a+='<div class="retold-remote-vex-preview-header">',a+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].closeFramePreview()" title="Back (Esc)">← Back</button>',a+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].previewPrevFrame()" title="Previous (←)">‹ Prev</button>',a+='<div class="retold-remote-vex-preview-title" id="RetoldRemote-VEX-PreviewTitle">'+this._getFmt().escapeHTML(e)+"</div>",a+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].previewNextFrame()" title="Next (→)">Next ›</button>',a+="</div>",a+='<div class="retold-remote-vex-preview-body" id="RetoldRemote-VEX-PreviewBody">',a+='<img src="'+t+'" alt="'+this._getFmt().escapeHTML(e)+'">',a+="</div>",s.innerHTML=a,document.body.appendChild(s),this._previewKeyHandler=t=>{switch(t.key){case"Escape":t.preventDefault(),t.stopImmediatePropagation(),r.closeFramePreview();break;case"ArrowLeft":case"k":t.preventDefault(),t.stopImmediatePropagation(),r.previewPrevFrame();break;case"ArrowRight":case"j":t.preventDefault(),t.stopImmediatePropagation(),r.previewNextFrame()}},document.addEventListener("keydown",this._previewKeyHandler)},closeFramePreview:function(){let t=document.getElementById("RetoldRemote-VEX-Preview");t&&t.remove(),this._previewKeyHandler&&(document.removeEventListener("keydown",this._previewKeyHandler),this._previewKeyHandler=null)},previewPrevFrame:function(){!this._previewAllFrames||this._previewPosition<=0||(this._previewPosition--,this._updatePreviewFrame())},previewNextFrame:function(){!this._previewAllFrames||this._previewPosition>=this._previewAllFrames.length-1||(this._previewPosition++,this._updatePreviewFrame())},_updatePreviewFrame:function(){let t=this._previewAllFrames[this._previewPosition];if(!t||!this._frameData)return;let e=this._frameData.CacheKey;"custom"===t.Type&&t.CacheKey&&(e=t.CacheKey);let i=this._buildFrameURL(e,t.Filename),o=document.getElementById("RetoldRemote-VEX-PreviewBody");o&&(o.innerHTML='<img src="'+i+'" alt="'+this._getFmt().escapeHTML(t.Label)+'">');let n=document.getElementById("RetoldRemote-VEX-PreviewTitle");n&&(n.textContent=t.Label),this._previewType=t.Type,this._previewIndex=t.Index,"regular"===t.Type&&this.selectFrame(t.Index)}}},{}],
|
|
232
|
+
e.exports={openFrame:function(t){if(!this._frameData||!t)return;let e=t.CacheKey||this._frameData.CacheKey,i=this._buildFrameURL(e,t.Filename),o=t.TimestampFormatted+" · "+("regular"===t.Type?"#"+((t.Index||0)+1):"custom");this._showFramePreview(i,o,t.Type,t.Index)},openFrameFullsize:function(t){if(!this._frameData||!this._frameData.Frames[t])return;let e=this._frameData.Frames[t];this.openFrame({Type:"regular",Index:t,Filename:e.Filename,TimestampFormatted:e.TimestampFormatted,CacheKey:this._frameData.CacheKey})},openCustomFrameFullsize:function(t,e){if(!this._frameData)return;let i=-1,o=this._frameData.CacheKey;for(let e=0;e<this._customFrames.length;e++)if(this._customFrames[e].Filename===t){i=e,this._customFrames[e].CacheKey&&(o=this._customFrames[e].CacheKey);break}this.openFrame({Type:"custom",Index:i,Filename:t,TimestampFormatted:e,CacheKey:o})},_buildAllFramesList:function(){let t=[];if(this._frameData&&this._frameData.Frames)for(let e=0;e<this._frameData.Frames.length;e++){let i=this._frameData.Frames[e];t.push({Type:"regular",Index:e,Timestamp:i.Timestamp,TimestampFormatted:i.TimestampFormatted,Filename:i.Filename,Label:i.TimestampFormatted+" · #"+(i.Index+1)})}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let i=this._customFrames[e];t.push({Type:"custom",Index:e,Timestamp:i.Timestamp,TimestampFormatted:i.TimestampFormatted,Filename:i.Filename,CacheKey:i.CacheKey||null,Label:i.TimestampFormatted+" · custom"})}return t.sort((t,e)=>t.Timestamp-e.Timestamp),t},_showFramePreview:function(t,e,i,o){this._previewType=i,this._previewIndex=o;let n=this._buildAllFramesList();this._previewAllFrames=n,this._previewPosition=0;for(let t=0;t<n.length;t++)if(n[t].Type===i&&n[t].Index===o){this._previewPosition=t;break}let r=this,s=document.createElement("div");s.className="retold-remote-vex-preview-backdrop",s.id="RetoldRemote-VEX-Preview",s.onclick=t=>{t.target===s&&r.closeFramePreview()};let a="";a+='<div class="retold-remote-vex-preview-header">',a+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].closeFramePreview()" title="Back (Esc)">← Back</button>',a+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].previewPrevFrame()" title="Previous (←)">‹ Prev</button>',a+='<div class="retold-remote-vex-preview-title" id="RetoldRemote-VEX-PreviewTitle">'+this._getFmt().escapeHTML(e)+"</div>",a+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].previewNextFrame()" title="Next (→)">Next ›</button>',a+="</div>",a+='<div class="retold-remote-vex-preview-body" id="RetoldRemote-VEX-PreviewBody">',a+='<img src="'+t+'" alt="'+this._getFmt().escapeHTML(e)+'">',a+="</div>",s.innerHTML=a,document.body.appendChild(s),this._previewKeyHandler=t=>{switch(t.key){case"Escape":t.preventDefault(),t.stopImmediatePropagation(),r.closeFramePreview();break;case"ArrowLeft":case"k":t.preventDefault(),t.stopImmediatePropagation(),r.previewPrevFrame();break;case"ArrowRight":case"j":t.preventDefault(),t.stopImmediatePropagation(),r.previewNextFrame()}},document.addEventListener("keydown",this._previewKeyHandler)},closeFramePreview:function(){let t=document.getElementById("RetoldRemote-VEX-Preview");t&&t.remove(),this._previewKeyHandler&&(document.removeEventListener("keydown",this._previewKeyHandler),this._previewKeyHandler=null)},previewPrevFrame:function(){!this._previewAllFrames||this._previewPosition<=0||(this._previewPosition--,this._updatePreviewFrame())},previewNextFrame:function(){!this._previewAllFrames||this._previewPosition>=this._previewAllFrames.length-1||(this._previewPosition++,this._updatePreviewFrame())},_updatePreviewFrame:function(){let t=this._previewAllFrames[this._previewPosition];if(!t||!this._frameData)return;let e=this._frameData.CacheKey;"custom"===t.Type&&t.CacheKey&&(e=t.CacheKey);let i=this._buildFrameURL(e,t.Filename),o=document.getElementById("RetoldRemote-VEX-PreviewBody");o&&(o.innerHTML='<img src="'+i+'" alt="'+this._getFmt().escapeHTML(t.Label)+'">');let n=document.getElementById("RetoldRemote-VEX-PreviewTitle");n&&(n.textContent=t.Label),this._previewType=t.Type,this._previewIndex=t.Index,"regular"===t.Type&&this.selectFrame(t.Index)}}},{}],153:[function(t,e,i){
|
|
233
233
|
/**
|
|
234
234
|
* VideoExplorer — Selection Mixin
|
|
235
235
|
*
|
|
@@ -243,5 +243,5 @@ e.exports={openFrame:function(t){if(!this._frameData||!t)return;let e=t.CacheKey
|
|
|
243
243
|
*
|
|
244
244
|
* @license MIT
|
|
245
245
|
*/
|
|
246
|
-
e.exports={toggleSelectionMode:function(){this._selectionModeActive=!this._selectionModeActive;let t=document.getElementById("RetoldRemote-VEX-SelectBtn");t&&(this._selectionModeActive?t.classList.add("active"):t.classList.remove("active"));let e=document.getElementById("RetoldRemote-VEX-TimelineBar");e&&(this._selectionModeActive?e.classList.add("selecting"):e.classList.remove("selecting"))},setSelectionStart:function(t){this._selectionStartTime=t,this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},setSelectionEnd:function(t){this._selectionEndTime=t,this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},clearSelection:function(){this._selectionStartTime=-1,this._selectionEndTime=-1,this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},_renderSelectionOverlay:function(){let t=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!t)return;let e=t.querySelector(".retold-remote-vex-timeline-selection");if(e&&e.remove(),this._selectionStartTime<0||this._selectionEndTime<0||!this._frameData||!this._frameData.Duration)return;let i=Math.min(this._selectionStartTime,this._selectionEndTime),o=Math.max(this._selectionStartTime,this._selectionEndTime),n=this._frameData.Duration,r=i/n*100,s=(o-i)/n*100,a=document.createElement("div");a.className="retold-remote-vex-timeline-selection",a.style.left=r.toFixed(2)+"%",a.style.width=s.toFixed(2)+"%",t.appendChild(a)},_updateSelectionInfo:function(){let t=document.getElementById("RetoldRemote-VEX-SelectionInfo"),e=document.getElementById("RetoldRemote-VEX-ClearBtn"),i=document.getElementById("RetoldRemote-VEX-GenerateControls");if(!t)return;if(this._selectionStartTime<0||this._selectionEndTime<0)return t.style.display="none",e&&(e.style.display="none"),void(i&&(i.style.display="none"));let o=Math.min(this._selectionStartTime,this._selectionEndTime),n=Math.max(this._selectionStartTime,this._selectionEndTime),r=n-o,s=this._getFmt(),a='<span class="retold-remote-vex-selection-info-label">Selection:</span> '+s.formatTimestamp(o)+" – "+s.formatTimestamp(n)+" ("+s.formatTimestamp(r)+")";t.innerHTML=a,t.style.display="",e&&(e.style.display=""),i&&(i.style.display="")},_onSelectionDragStart:function(t){if(!this._selectionModeActive)return;if(t.target.closest(".retold-remote-vex-timeline-marker"))return;t.preventDefault(),this._isDraggingTimeline=!0;let e=this._getTimelineTimestamp(t);this._selectionStartTime=e,this._selectionEndTime=e,this._renderSelectionOverlay()},_onSelectionDragMove:function(t){this._isDraggingTimeline&&(t.preventDefault(),this._selectionEndTime=this._getTimelineTimestamp(t),this._renderSelectionOverlay())},_onSelectionDragEnd:function(t){if(!this._isDraggingTimeline)return;this._isDraggingTimeline=!1,Math.abs(this._selectionEndTime-this._selectionStartTime)<.5&&(this._selectionStartTime=-1,this._selectionEndTime=-1),this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},_cleanupWindowListeners:function(){this._boundDragEnd&&(window.removeEventListener("mouseup",this._boundDragEnd),window.removeEventListener("touchend",this._boundDragEnd),this._boundDragEnd=null)},_renderSliderHandles:function(){let t=document.getElementById("RetoldRemote-VEX-SliderTrack");if(!t)return;if(t.innerHTML="",this._selectionStartTime<0||this._selectionEndTime<0||!this._frameData||!this._frameData.Duration)return void(t.style.display="none");t.style.display="";let e=this._frameData.Duration,i=Math.min(this._selectionStartTime,this._selectionEndTime)/e*100,o=Math.max(this._selectionStartTime,this._selectionEndTime)/e*100,n=document.createElement("div");n.className="retold-remote-vex-slider-handle",n.id="RetoldRemote-VEX-HandleStart",n.style.left=i.toFixed(2)+"%",n.title="Drag to adjust selection start",t.appendChild(n);let r=document.createElement("div");r.className="retold-remote-vex-slider-handle",r.id="RetoldRemote-VEX-HandleEnd",r.style.left=o.toFixed(2)+"%",r.title="Drag to adjust selection end",t.appendChild(r)},_bindSliderHandleDrag:function(){let t=document.getElementById("RetoldRemote-VEX-SliderTrack");if(!t)return;let e=this;t.addEventListener("mousedown",t=>{0===t.button&&e._onSliderDragStart(t)}),t.addEventListener("touchstart",t=>{e._onSliderDragStart(t)},{passive:!1})},_onSliderDragStart:function(t){let e=t.target;if(!e.classList.contains("retold-remote-vex-slider-handle"))return;if(t.preventDefault(),t.stopPropagation(),"RetoldRemote-VEX-HandleStart"===e.id)this._draggingHandle="start";else{if("RetoldRemote-VEX-HandleEnd"!==e.id)return;this._draggingHandle="end"}e.classList.add("dragging");let i=this,o=t=>{i._onSliderDragMove(t)},n=t=>{i._onSliderDragEnd(t),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n),window.addEventListener("touchmove",o,{passive:!1}),window.addEventListener("touchend",n)},_onSliderDragMove:function(t){if(!this._draggingHandle)return;t.preventDefault();let e=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!e||!this._frameData||!this._frameData.Duration)return;let i=e.getBoundingClientRect(),o=this._getClientX(t);if(null===o)return;let n=Math.max(0,Math.min(1,(o-i.left)/i.width)),r=n*this._frameData.Duration;"start"===this._draggingHandle?this._selectionStartTime=r:this._selectionEndTime=r;let s=document.getElementById("start"===this._draggingHandle?"RetoldRemote-VEX-HandleStart":"RetoldRemote-VEX-HandleEnd");s&&(s.style.left=(100*n).toFixed(2)+"%"),this._renderSelectionOverlay(),this._updateSelectionInfo()},_onSliderDragEnd:function(t){if(!this._draggingHandle)return;let e=document.getElementById("start"===this._draggingHandle?"RetoldRemote-VEX-HandleStart":"RetoldRemote-VEX-HandleEnd");e&&e.classList.remove("dragging"),this._draggingHandle=null,Math.abs(this._selectionEndTime-this._selectionStartTime)<.5&&(this._selectionStartTime=-1,this._selectionEndTime=-1),this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},_saveState:function(){if(!this._currentPath)return;let t={Path:this._currentPath,SelectionStartTime:this._selectionStartTime,SelectionEndTime:this._selectionEndTime};fetch("/api/media/video-explorer-state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).catch(()=>{})}}},{}]},{},[
|
|
246
|
+
e.exports={toggleSelectionMode:function(){this._selectionModeActive=!this._selectionModeActive;let t=document.getElementById("RetoldRemote-VEX-SelectBtn");t&&(this._selectionModeActive?t.classList.add("active"):t.classList.remove("active"));let e=document.getElementById("RetoldRemote-VEX-TimelineBar");e&&(this._selectionModeActive?e.classList.add("selecting"):e.classList.remove("selecting"))},setSelectionStart:function(t){this._selectionStartTime=t,this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},setSelectionEnd:function(t){this._selectionEndTime=t,this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},clearSelection:function(){this._selectionStartTime=-1,this._selectionEndTime=-1,this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},_renderSelectionOverlay:function(){let t=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!t)return;let e=t.querySelector(".retold-remote-vex-timeline-selection");if(e&&e.remove(),this._selectionStartTime<0||this._selectionEndTime<0||!this._frameData||!this._frameData.Duration)return;let i=Math.min(this._selectionStartTime,this._selectionEndTime),o=Math.max(this._selectionStartTime,this._selectionEndTime),n=this._frameData.Duration,r=i/n*100,s=(o-i)/n*100,a=document.createElement("div");a.className="retold-remote-vex-timeline-selection",a.style.left=r.toFixed(2)+"%",a.style.width=s.toFixed(2)+"%",t.appendChild(a)},_updateSelectionInfo:function(){let t=document.getElementById("RetoldRemote-VEX-SelectionInfo"),e=document.getElementById("RetoldRemote-VEX-ClearBtn"),i=document.getElementById("RetoldRemote-VEX-GenerateControls");if(!t)return;if(this._selectionStartTime<0||this._selectionEndTime<0)return t.style.display="none",e&&(e.style.display="none"),void(i&&(i.style.display="none"));let o=Math.min(this._selectionStartTime,this._selectionEndTime),n=Math.max(this._selectionStartTime,this._selectionEndTime),r=n-o,s=this._getFmt(),a='<span class="retold-remote-vex-selection-info-label">Selection:</span> '+s.formatTimestamp(o)+" – "+s.formatTimestamp(n)+" ("+s.formatTimestamp(r)+")";t.innerHTML=a,t.style.display="",e&&(e.style.display=""),i&&(i.style.display="")},_onSelectionDragStart:function(t){if(!this._selectionModeActive)return;if(t.target.closest(".retold-remote-vex-timeline-marker"))return;t.preventDefault(),this._isDraggingTimeline=!0;let e=this._getTimelineTimestamp(t);this._selectionStartTime=e,this._selectionEndTime=e,this._renderSelectionOverlay()},_onSelectionDragMove:function(t){this._isDraggingTimeline&&(t.preventDefault(),this._selectionEndTime=this._getTimelineTimestamp(t),this._renderSelectionOverlay())},_onSelectionDragEnd:function(t){if(!this._isDraggingTimeline)return;this._isDraggingTimeline=!1,Math.abs(this._selectionEndTime-this._selectionStartTime)<.5&&(this._selectionStartTime=-1,this._selectionEndTime=-1),this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},_cleanupWindowListeners:function(){this._boundDragEnd&&(window.removeEventListener("mouseup",this._boundDragEnd),window.removeEventListener("touchend",this._boundDragEnd),this._boundDragEnd=null)},_renderSliderHandles:function(){let t=document.getElementById("RetoldRemote-VEX-SliderTrack");if(!t)return;if(t.innerHTML="",this._selectionStartTime<0||this._selectionEndTime<0||!this._frameData||!this._frameData.Duration)return void(t.style.display="none");t.style.display="";let e=this._frameData.Duration,i=Math.min(this._selectionStartTime,this._selectionEndTime)/e*100,o=Math.max(this._selectionStartTime,this._selectionEndTime)/e*100,n=document.createElement("div");n.className="retold-remote-vex-slider-handle",n.id="RetoldRemote-VEX-HandleStart",n.style.left=i.toFixed(2)+"%",n.title="Drag to adjust selection start",t.appendChild(n);let r=document.createElement("div");r.className="retold-remote-vex-slider-handle",r.id="RetoldRemote-VEX-HandleEnd",r.style.left=o.toFixed(2)+"%",r.title="Drag to adjust selection end",t.appendChild(r)},_bindSliderHandleDrag:function(){let t=document.getElementById("RetoldRemote-VEX-SliderTrack");if(!t)return;let e=this;t.addEventListener("mousedown",t=>{0===t.button&&e._onSliderDragStart(t)}),t.addEventListener("touchstart",t=>{e._onSliderDragStart(t)},{passive:!1})},_onSliderDragStart:function(t){let e=t.target;if(!e.classList.contains("retold-remote-vex-slider-handle"))return;if(t.preventDefault(),t.stopPropagation(),"RetoldRemote-VEX-HandleStart"===e.id)this._draggingHandle="start";else{if("RetoldRemote-VEX-HandleEnd"!==e.id)return;this._draggingHandle="end"}e.classList.add("dragging");let i=this,o=t=>{i._onSliderDragMove(t)},n=t=>{i._onSliderDragEnd(t),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n),window.addEventListener("touchmove",o,{passive:!1}),window.addEventListener("touchend",n)},_onSliderDragMove:function(t){if(!this._draggingHandle)return;t.preventDefault();let e=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!e||!this._frameData||!this._frameData.Duration)return;let i=e.getBoundingClientRect(),o=this._getClientX(t);if(null===o)return;let n=Math.max(0,Math.min(1,(o-i.left)/i.width)),r=n*this._frameData.Duration;"start"===this._draggingHandle?this._selectionStartTime=r:this._selectionEndTime=r;let s=document.getElementById("start"===this._draggingHandle?"RetoldRemote-VEX-HandleStart":"RetoldRemote-VEX-HandleEnd");s&&(s.style.left=(100*n).toFixed(2)+"%"),this._renderSelectionOverlay(),this._updateSelectionInfo()},_onSliderDragEnd:function(t){if(!this._draggingHandle)return;let e=document.getElementById("start"===this._draggingHandle?"RetoldRemote-VEX-HandleStart":"RetoldRemote-VEX-HandleEnd");e&&e.classList.remove("dragging"),this._draggingHandle=null,Math.abs(this._selectionEndTime-this._selectionStartTime)<.5&&(this._selectionStartTime=-1,this._selectionEndTime=-1),this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._saveState()},_saveState:function(){if(!this._currentPath)return;let t={Path:this._currentPath,SelectionStartTime:this._selectionStartTime,SelectionEndTime:this._selectionEndTime};fetch("/api/media/video-explorer-state",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).catch(()=>{})}}},{}]},{},[116])(116)});
|
|
247
247
|
//# sourceMappingURL=retold-remote.min.js.map
|