From 77d225c163e3d07e076a9fd69a266daf301678fb Mon Sep 17 00:00:00 2001 From: Akash Singh Date: Wed, 20 Mar 2024 10:34:03 +0530 Subject: [PATCH] UI improvements Signed-off-by: Akash Singh --- CHANGELOG.md | 3 + README.md | 3 + out/compiled/Record.css | 2 +- out/compiled/Record.css.map | 4 +- out/compiled/Record.js | 1232 +++++++++++++++++++++++++++- out/compiled/Record.js.map | 2 +- out/compiled/Test.css | 2 +- out/compiled/Test.css.map | 4 +- out/compiled/Test.js | 1274 ++++++++++++++++++++++++++++- out/compiled/Test.js.map | 2 +- package.json | 2 +- scripts/keploy_record_script.log | 33 + scripts/keploy_test_script.log | 773 +++++++++++++++++ sidebar/sidebar.js | 11 +- webviews/components/Record.svelte | 52 +- webviews/components/Test.svelte | 50 +- 16 files changed, 3399 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c958150..9eeb932 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +# [2.6.0] - 2024-03-20 +- UI Improvements + # [2.5.0] - 2024-03-16 - Added Support for Flags diff --git a/README.md b/README.md index fef784e..eda7af6 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ Keploy-VsCode offers the following features: ## Release Notes +### 2.6.0 +- UI Improvements + ### 2.5.0 - Added Support for Flags diff --git a/out/compiled/Record.css b/out/compiled/Record.css index df09f20..32b6885 100644 --- a/out/compiled/Record.css +++ b/out/compiled/Record.css @@ -1,3 +1,3 @@ -#flagsDiv.svelte-1f9onjn,#upperOutputDiv.svelte-1f9onjn{display:grid;grid-template-columns:1fr 1fr;place-items:center}.keploylogo.svelte-1f9onjn{width:50%}#startRecordingButton.svelte-1f9onjn{margin:20px auto}button.svelte-1f9onjn{margin:10px;width:75%;border-radius:5px;border:none}#selectFolderDiv.svelte-1f9onjn,#appCommandDiv.svelte-1f9onjn{display:grid;place-items:center}#selectFolderDiv.svelte-1f9onjn{margin:20px}input.svelte-1f9onjn{width:95%;margin:10px}#selectflags.svelte-1f9onjn{width:2fr;margin:auto 0}#generatedRecordCommand.svelte-1f9onjn{margin:0 auto;text-align:center}#navigateHomeButton.svelte-1f9onjn{width:20%;font-size:small;text-align:center;margin:0}#stopRecordingButton.svelte-1f9onjn{width:75%;background-color:red;margin:10px auto}#startRecordingButton.svelte-1f9onjn:disabled{background-color:rgb(80, 79, 79)}#recordStatus.svelte-1f9onjn{text-align:center;display:none;margin:20px;font-weight:bold}#recordedTestCases.svelte-1f9onjn{display:grid;grid-template-columns:1fr;place-items:center}.loader.svelte-1f9onjn{display:none} +#flagsDiv.svelte-1kl0a9n,#upperOutputDiv.svelte-1kl0a9n{display:grid;grid-template-columns:1fr 1fr;place-items:center}#flagsDiv.svelte-1kl0a9n{margin:10px}#lowerHR.svelte-1kl0a9n{display:none}.keploylogo.svelte-1kl0a9n{width:40%}#outputDiv.svelte-1kl0a9n{font-size:medium}#startRecordingButton.svelte-1kl0a9n{margin:20px auto}button.svelte-1kl0a9n{margin:10px;width:75%;border-radius:5px;border:none}#selectFolderDiv.svelte-1kl0a9n,#appCommandDiv.svelte-1kl0a9n{display:grid;place-items:center}#selectFolderDiv.svelte-1kl0a9n{margin:0 20px}input.svelte-1kl0a9n{width:95%;margin:10px}#selectflags.svelte-1kl0a9n{width:2fr;margin:auto 0}#generatedRecordCommand.svelte-1kl0a9n{margin:0 auto;text-align:center}#navigateHomeButton.svelte-1kl0a9n{width:20%;font-size:small;text-align:center;margin:0}#stopRecordingButton.svelte-1kl0a9n{width:75%;background-color:red;margin:10px auto}#startRecordingButton.svelte-1kl0a9n:disabled{background-color:rgb(80, 79, 79)}#recordStatus.svelte-1kl0a9n{text-align:center;display:none;margin:20px;font-weight:bold}#recordedTestCases.svelte-1kl0a9n{display:grid;grid-template-columns:1fr;place-items:center}.loader.svelte-1kl0a9n{display:none}button.svelte-1kl0a9n{font-size:small} /*# sourceMappingURL=Record.css.map */ \ No newline at end of file diff --git a/out/compiled/Record.css.map b/out/compiled/Record.css.map index 23c6e7b..80271f1 100644 --- a/out/compiled/Record.css.map +++ b/out/compiled/Record.css.map @@ -5,8 +5,8 @@ "Record.svelte" ], "sourcesContent": [ - "\n\n\n Home \n\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n\n
\n
\n
\n \n

Command

\n
\n
\n

keploy record

\n
\n
\n \n

\n
\n
\n\n\n\n" + "\n\n\n Home \n
\n
\n \n

Command

\n
\n
\n

keploy record

\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n

\n
\n\n\n\n" ], "names": [], - "mappings": "AAiIE,wBAAS,CACT,8BAAgB,CACd,OAAO,CAAE,IAAI,CACb,qBAAqB,CAAE,GAAG,CAAC,GAAG,CAC9B,WAAW,CAAE,MACf,CACA,0BAAY,CACV,KAAK,CAAE,GACT,CACA,oCAAsB,CACpB,MAAM,CAAE,IAAI,CAAC,IACf,CACA,qBAAO,CACL,MAAM,CAAE,IAAI,CACZ,KAAK,CAAE,GAAG,CACV,aAAa,CAAE,GAAG,CAClB,MAAM,CAAE,IACV,CACA,+BAAgB,CAChB,6BAAe,CACb,OAAO,CAAE,IAAI,CACb,WAAW,CAAE,MACf,CACA,+BAAiB,CACf,MAAM,CAAE,IACV,CAEA,oBAAM,CACJ,KAAK,CAAE,GAAG,CACV,MAAM,CAAE,IACV,CACA,2BAAa,CACX,KAAK,CAAE,GAAG,CACV,MAAM,CAAE,IAAI,CAAC,CACf,CACA,sCAAwB,CACtB,MAAM,CAAE,CAAC,CAAC,IAAI,CACd,UAAU,CAAE,MACd,CACA,kCAAoB,CAClB,KAAK,CAAE,GAAG,CACV,SAAS,CAAE,KAAK,CAChB,UAAU,CAAE,MAAM,CAClB,MAAM,CAAE,CACV,CACA,mCAAqB,CACnB,KAAK,CAAE,GAAG,CACV,gBAAgB,CAAE,GAAG,CACrB,MAAM,CAAE,IAAI,CAAC,IACf,CACA,oCAAqB,SAAU,CAC7B,gBAAgB,CAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAClC,CACA,4BAAc,CACZ,UAAU,CAAE,MAAM,CAClB,OAAO,CAAE,IAAI,CACb,MAAM,CAAE,IAAI,CACZ,WAAW,CAAE,IACf,CACA,iCAAmB,CACjB,OAAO,CAAE,IAAI,CACb,qBAAqB,CAAE,GAAG,CAC1B,WAAW,CAAE,MACf,CACA,sBAAQ,CACN,OAAO,CAAE,IACX" + "mappings": "AAiIE,wBAAS,CACT,8BAAgB,CACd,OAAO,CAAE,IAAI,CACb,qBAAqB,CAAE,GAAG,CAAC,GAAG,CAC9B,WAAW,CAAE,MACf,CACA,wBAAU,CACR,MAAM,CAAE,IACV,CACA,uBAAQ,CACN,OAAO,CAAE,IACX,CACA,0BAAY,CACV,KAAK,CAAE,GACT,CACA,yBAAW,CACT,SAAS,CAAE,MACb,CACA,oCAAsB,CACpB,MAAM,CAAE,IAAI,CAAC,IACf,CACA,qBAAO,CACL,MAAM,CAAE,IAAI,CACZ,KAAK,CAAE,GAAG,CACV,aAAa,CAAE,GAAG,CAClB,MAAM,CAAE,IACV,CACA,+BAAgB,CAChB,6BAAe,CACb,OAAO,CAAE,IAAI,CACb,WAAW,CAAE,MACf,CACA,+BAAiB,CACf,MAAM,CAAG,CAAC,CAAC,IACb,CAEA,oBAAM,CACJ,KAAK,CAAE,GAAG,CACV,MAAM,CAAE,IACV,CACA,2BAAa,CACX,KAAK,CAAE,GAAG,CACV,MAAM,CAAE,IAAI,CAAC,CACf,CACA,sCAAwB,CACtB,MAAM,CAAE,CAAC,CAAC,IAAI,CACd,UAAU,CAAE,MACd,CACA,kCAAoB,CAClB,KAAK,CAAE,GAAG,CACV,SAAS,CAAE,KAAK,CAChB,UAAU,CAAE,MAAM,CAClB,MAAM,CAAE,CACV,CACA,mCAAqB,CACnB,KAAK,CAAE,GAAG,CACV,gBAAgB,CAAE,GAAG,CACrB,MAAM,CAAE,IAAI,CAAC,IACf,CACA,oCAAqB,SAAU,CAC7B,gBAAgB,CAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAClC,CACA,4BAAc,CACZ,UAAU,CAAE,MAAM,CAClB,OAAO,CAAE,IAAI,CACb,MAAM,CAAE,IAAI,CACZ,WAAW,CAAE,IACf,CACA,iCAAmB,CACjB,OAAO,CAAE,IAAI,CACb,qBAAqB,CAAE,GAAG,CAC1B,WAAW,CAAE,MACf,CACA,sBAAQ,CACN,OAAO,CAAE,IACX,CACA,qBAAM,CACJ,SAAS,CAAE,KACb" } \ No newline at end of file diff --git a/out/compiled/Record.js b/out/compiled/Record.js index 0098563..af80808 100644 --- a/out/compiled/Record.js +++ b/out/compiled/Record.js @@ -1,2 +1,1232 @@ -var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function o(e){e.forEach(t)}function r(e){return"function"==typeof e}function d(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function a(e){e.parentNode&&e.parentNode.removeChild(e)}function u(e){return document.createElement(e)}function s(e){return document.createTextNode(e)}function i(){return s(" ")}function f(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function m(e,t){e.value=null==t?"":t}let p;function g(e){p=e}function v(e){(function(){if(!p)throw new Error("Function called outside component initialization");return p})().$$.on_mount.push(e)}const h=[],y=[];let $=[];const b=[],_=Promise.resolve();let E=!1;function j(e){$.push(e)}const x=new Set;let B=0;function C(){if(0!==B)return;const e=p;do{try{for(;B-1===e.indexOf(o)?t.push(o):n.push(o))),n.forEach((e=>e())),$=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function L(e,t){-1===e.$$.dirty[0]&&(h.push(e),E||(E=!0,_.then(C)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const o=n.length?n[0]:t;return h.ctx&&s(h.ctx[e],h.ctx[e]=o)&&(!h.skip_bound&&h.bound[e]&&h.bound[e](o),y&&L(d,e)),t})):[],h.update(),y=!0,o(h.before_update),h.fragment=!!u&&u(h.ctx),l.target){if(l.hydrate){const e=function(e){return Array.from(e.childNodes)}(l.target);h.fragment&&h.fragment.l(e),e.forEach(a)}else h.fragment&&h.fragment.c();l.intro&&(($=d.$$.fragment)&&$.i&&(w.delete($),$.i(b))),function(e,n,d){const{fragment:l,after_update:c}=e.$$;l&&l.m(n,d),j((()=>{const n=e.$$.on_mount.map(t).filter(r);e.$$.on_destroy?e.$$.on_destroy.push(...n):o(n),e.$$.on_mount=[]})),c.forEach(j)}(d,l.target,l.anchor),C()}var $,b;g(v)}class T{$$=void 0;$$set=void 0;$destroy(){F(this,1),this.$destroy=e}$on(t,n){if(!r(n))return e;const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const e=o.indexOf(n);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function A(e,t,n){const o=e.slice();return o[1]=t[n],o}function O(e){let t,n,o,r=e[1]+"";return{c(){t=u("option"),n=s(r),t.__value=o=e[1],m(t,t.__value)},m(e,o){c(e,t,o),l(t,n)},p(e,d){1&d&&r!==(r=e[1]+"")&&function(e,t){t=""+t,e.data!==t&&(e.data=t)}(n,r),1&d&&o!==(o=e[1])&&(t.__value=o,m(t,t.__value))},d(e){e&&a(t)}}}function P(t){let n,o,r,d,s,p,g,v,h,y,$,b,_,E,j,x,B,C,I,w=k(Object.keys(t[0])),F=[];for(let e=0;eSelect Project Folder ',s=i(),p=u("div"),p.innerHTML=' ',g=i(),v=u("div"),h=u("div"),y=u("select"),$=u("option"),$.textContent="Select Flag";for(let e=0;e',E=i(),j=u("button"),j.textContent="Start Recording",x=i(),B=u("hr"),C=i(),I=u("div"),I.innerHTML='

Command

keploy record

',f(o,"id","navigateHomeButton"),f(o,"class","homebutton svelte-1f9onjn"),f(d,"id","selectFolderDiv"),f(d,"class","svelte-1f9onjn"),f(p,"id","appCommandDiv"),f(p,"class","svelte-1f9onjn"),$.__value="",m($,$.__value),$.disabled=!0,$.selected=!0,f(y,"id","selectflags"),f(y,"class","svelte-1f9onjn"),f(h,"id","flags"),f(_,"id","flagValue"),f(v,"id","flagsDiv"),f(v,"class","svelte-1f9onjn"),f(j,"id","startRecordingButton"),j.disabled="true",f(j,"class","svelte-1f9onjn"),f(I,"id","outputDiv")},m(e,t){c(e,n,t),l(n,o),l(n,r),l(n,d),l(n,s),l(n,p),l(n,g),l(n,v),l(v,h),l(h,y),l(y,$);for(let e=0;e{document.getElementById("recordProjectFolder").addEventListener("input",(()=>{document.getElementById("recordProjectFolder").value&&document.getElementById("recordCommand").value&&(document.getElementById("startRecordingButton").disabled=!1)})),document.getElementById("recordCommand").addEventListener("input",(()=>{document.getElementById("recordProjectFolder").value&&document.getElementById("recordCommand").value&&(document.getElementById("startRecordingButton").disabled=!1)})),document.getElementById("recordCommand").addEventListener("input",(()=>{document.getElementById("generatedRecordCommand").innerText=`keploy record -c "${document.getElementById("recordCommand").value}"`}));document.getElementById("selectflags").addEventListener("change",(()=>e()));function e(){const e=document.getElementById("selectflags");var t=e.options[e.selectedIndex].value;console.log("selectedFlag : "+t);const r=document.getElementById("flagValueInput").value;console.log("flagValue : "+r),n(0,o[t]=r,o),console.log(o),function(){let e=`keploy record -c "${document.getElementById("recordCommand").value}"`;for(const[t,n]of Object.entries(o))n&&(e+=` --${t}="${n}"`);document.getElementById("generatedRecordCommand").innerText=e}()}document.getElementById("flagValueInput").addEventListener("input",(()=>e()))})),[o]}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");return new class extends T{constructor(e){super(),R(this,e,S,P,d,{})}}({target:document.body})}(); +var app = (function () { + 'use strict'; + + /** @returns {void} */ + function noop() {} + + /** @returns {void} */ + function add_location(element, file, line, column, char) { + element.__svelte_meta = { + loc: { file, line, column, char } + }; + } + + function run(fn) { + return fn(); + } + + function blank_object() { + return Object.create(null); + } + + /** + * @param {Function[]} fns + * @returns {void} + */ + function run_all(fns) { + fns.forEach(run); + } + + /** + * @param {any} thing + * @returns {thing is Function} + */ + function is_function(thing) { + return typeof thing === 'function'; + } + + /** @returns {boolean} */ + function safe_not_equal(a, b) { + return a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function'; + } + + let src_url_equal_anchor; + + /** + * @param {string} element_src + * @param {string} url + * @returns {boolean} + */ + function src_url_equal(element_src, url) { + if (element_src === url) return true; + if (!src_url_equal_anchor) { + src_url_equal_anchor = document.createElement('a'); + } + // This is actually faster than doing URL(..).href + src_url_equal_anchor.href = url; + return element_src === src_url_equal_anchor.href; + } + + /** @returns {boolean} */ + function is_empty(obj) { + return Object.keys(obj).length === 0; + } + + /** @type {typeof globalThis} */ + const globals = + typeof window !== 'undefined' + ? window + : typeof globalThis !== 'undefined' + ? globalThis + : // @ts-ignore Node typings have this + global; + + /** + * @param {Node} target + * @param {Node} node + * @returns {void} + */ + function append(target, node) { + target.appendChild(node); + } + + /** + * @param {Node} target + * @param {Node} node + * @param {Node} [anchor] + * @returns {void} + */ + function insert(target, node, anchor) { + target.insertBefore(node, anchor || null); + } + + /** + * @param {Node} node + * @returns {void} + */ + function detach(node) { + if (node.parentNode) { + node.parentNode.removeChild(node); + } + } + + /** + * @returns {void} */ + function destroy_each(iterations, detaching) { + for (let i = 0; i < iterations.length; i += 1) { + if (iterations[i]) iterations[i].d(detaching); + } + } + + /** + * @template {keyof HTMLElementTagNameMap} K + * @param {K} name + * @returns {HTMLElementTagNameMap[K]} + */ + function element(name) { + return document.createElement(name); + } + + /** + * @param {string} data + * @returns {Text} + */ + function text(data) { + return document.createTextNode(data); + } + + /** + * @returns {Text} */ + function space() { + return text(' '); + } + + /** + * @param {Element} node + * @param {string} attribute + * @param {string} [value] + * @returns {void} + */ + function attr(node, attribute, value) { + if (value == null) node.removeAttribute(attribute); + else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value); + } + + /** + * @param {Element} element + * @returns {ChildNode[]} + */ + function children(element) { + return Array.from(element.childNodes); + } + + /** + * @returns {void} */ + function set_input_value(input, value) { + input.value = value == null ? '' : value; + } + + /** + * @template T + * @param {string} type + * @param {T} [detail] + * @param {{ bubbles?: boolean, cancelable?: boolean }} [options] + * @returns {CustomEvent} + */ + function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) { + return new CustomEvent(type, { detail, bubbles, cancelable }); + } + + /** + * @typedef {Node & { + * claim_order?: number; + * hydrate_init?: true; + * actual_end_child?: NodeEx; + * childNodes: NodeListOf; + * }} NodeEx + */ + + /** @typedef {ChildNode & NodeEx} ChildNodeEx */ + + /** @typedef {NodeEx & { claim_order: number }} NodeEx2 */ + + /** + * @typedef {ChildNodeEx[] & { + * claim_info?: { + * last_index: number; + * total_claimed: number; + * }; + * }} ChildNodeArray + */ + + let current_component; + + /** @returns {void} */ + function set_current_component(component) { + current_component = component; + } + + function get_current_component() { + if (!current_component) throw new Error('Function called outside component initialization'); + return current_component; + } + + /** + * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM. + * It must be called during the component's initialisation (but doesn't need to live *inside* the component; + * it can be called from an external module). + * + * If a function is returned _synchronously_ from `onMount`, it will be called when the component is unmounted. + * + * `onMount` does not run inside a [server-side component](https://svelte.dev/docs#run-time-server-side-component-api). + * + * https://svelte.dev/docs/svelte#onmount + * @template T + * @param {() => import('./private.js').NotFunction | Promise> | (() => any)} fn + * @returns {void} + */ + function onMount(fn) { + get_current_component().$$.on_mount.push(fn); + } + + const dirty_components = []; + const binding_callbacks = []; + + let render_callbacks = []; + + const flush_callbacks = []; + + const resolved_promise = /* @__PURE__ */ Promise.resolve(); + + let update_scheduled = false; + + /** @returns {void} */ + function schedule_update() { + if (!update_scheduled) { + update_scheduled = true; + resolved_promise.then(flush); + } + } + + /** @returns {void} */ + function add_render_callback(fn) { + render_callbacks.push(fn); + } + + // flush() calls callbacks in this order: + // 1. All beforeUpdate callbacks, in order: parents before children + // 2. All bind:this callbacks, in reverse order: children before parents. + // 3. All afterUpdate callbacks, in order: parents before children. EXCEPT + // for afterUpdates called during the initial onMount, which are called in + // reverse order: children before parents. + // Since callbacks might update component values, which could trigger another + // call to flush(), the following steps guard against this: + // 1. During beforeUpdate, any updated components will be added to the + // dirty_components array and will cause a reentrant call to flush(). Because + // the flush index is kept outside the function, the reentrant call will pick + // up where the earlier call left off and go through all dirty components. The + // current_component value is saved and restored so that the reentrant call will + // not interfere with the "parent" flush() call. + // 2. bind:this callbacks cannot trigger new flush() calls. + // 3. During afterUpdate, any updated components will NOT have their afterUpdate + // callback called a second time; the seen_callbacks set, outside the flush() + // function, guarantees this behavior. + const seen_callbacks = new Set(); + + let flushidx = 0; // Do *not* move this inside the flush() function + + /** @returns {void} */ + function flush() { + // Do not reenter flush while dirty components are updated, as this can + // result in an infinite loop. Instead, let the inner flush handle it. + // Reentrancy is ok afterwards for bindings etc. + if (flushidx !== 0) { + return; + } + const saved_component = current_component; + do { + // first, call beforeUpdate functions + // and update components + try { + while (flushidx < dirty_components.length) { + const component = dirty_components[flushidx]; + flushidx++; + set_current_component(component); + update(component.$$); + } + } catch (e) { + // reset dirty state to not end up in a deadlocked state and then rethrow + dirty_components.length = 0; + flushidx = 0; + throw e; + } + set_current_component(null); + dirty_components.length = 0; + flushidx = 0; + while (binding_callbacks.length) binding_callbacks.pop()(); + // then, once components are updated, call + // afterUpdate functions. This may cause + // subsequent updates... + for (let i = 0; i < render_callbacks.length; i += 1) { + const callback = render_callbacks[i]; + if (!seen_callbacks.has(callback)) { + // ...so guard against infinite loops + seen_callbacks.add(callback); + callback(); + } + } + render_callbacks.length = 0; + } while (dirty_components.length); + while (flush_callbacks.length) { + flush_callbacks.pop()(); + } + update_scheduled = false; + seen_callbacks.clear(); + set_current_component(saved_component); + } + + /** @returns {void} */ + function update($$) { + if ($$.fragment !== null) { + $$.update(); + run_all($$.before_update); + const dirty = $$.dirty; + $$.dirty = [-1]; + $$.fragment && $$.fragment.p($$.ctx, dirty); + $$.after_update.forEach(add_render_callback); + } + } + + /** + * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`. + * @param {Function[]} fns + * @returns {void} + */ + function flush_render_callbacks(fns) { + const filtered = []; + const targets = []; + render_callbacks.forEach((c) => (fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c))); + targets.forEach((c) => c()); + render_callbacks = filtered; + } + + const outroing = new Set(); + + /** + * @param {import('./private.js').Fragment} block + * @param {0 | 1} [local] + * @returns {void} + */ + function transition_in(block, local) { + if (block && block.i) { + outroing.delete(block); + block.i(local); + } + } + + /** @typedef {1} INTRO */ + /** @typedef {0} OUTRO */ + /** @typedef {{ direction: 'in' | 'out' | 'both' }} TransitionOptions */ + /** @typedef {(node: Element, params: any, options: TransitionOptions) => import('../transition/public.js').TransitionConfig} TransitionFn */ + + /** + * @typedef {Object} Outro + * @property {number} r + * @property {Function[]} c + * @property {Object} p + */ + + /** + * @typedef {Object} PendingProgram + * @property {number} start + * @property {INTRO|OUTRO} b + * @property {Outro} [group] + */ + + /** + * @typedef {Object} Program + * @property {number} a + * @property {INTRO|OUTRO} b + * @property {1|-1} d + * @property {number} duration + * @property {number} start + * @property {number} end + * @property {Outro} [group] + */ + + // general each functions: + + function ensure_array_like(array_like_or_iterator) { + return array_like_or_iterator?.length !== undefined + ? array_like_or_iterator + : Array.from(array_like_or_iterator); + } + + /** @returns {void} */ + function mount_component(component, target, anchor) { + const { fragment, after_update } = component.$$; + fragment && fragment.m(target, anchor); + // onMount happens before the initial afterUpdate + add_render_callback(() => { + const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); + // if the component was destroyed immediately + // it will update the `$$.on_destroy` reference to `null`. + // the destructured on_destroy may still reference to the old array + if (component.$$.on_destroy) { + component.$$.on_destroy.push(...new_on_destroy); + } else { + // Edge case - component was destroyed immediately, + // most likely as a result of a binding initialising + run_all(new_on_destroy); + } + component.$$.on_mount = []; + }); + after_update.forEach(add_render_callback); + } + + /** @returns {void} */ + function destroy_component(component, detaching) { + const $$ = component.$$; + if ($$.fragment !== null) { + flush_render_callbacks($$.after_update); + run_all($$.on_destroy); + $$.fragment && $$.fragment.d(detaching); + // TODO null out other refs, including component.$$ (but need to + // preserve final state?) + $$.on_destroy = $$.fragment = null; + $$.ctx = []; + } + } + + /** @returns {void} */ + function make_dirty(component, i) { + if (component.$$.dirty[0] === -1) { + dirty_components.push(component); + schedule_update(); + component.$$.dirty.fill(0); + } + component.$$.dirty[(i / 31) | 0] |= 1 << i % 31; + } + + // TODO: Document the other params + /** + * @param {SvelteComponent} component + * @param {import('./public.js').ComponentConstructorOptions} options + * + * @param {import('./utils.js')['not_equal']} not_equal Used to compare props and state values. + * @param {(target: Element | ShadowRoot) => void} [append_styles] Function that appends styles to the DOM when the component is first initialised. + * This will be the `add_css` function from the compiled component. + * + * @returns {void} + */ + function init( + component, + options, + instance, + create_fragment, + not_equal, + props, + append_styles = null, + dirty = [-1] + ) { + const parent_component = current_component; + set_current_component(component); + /** @type {import('./private.js').T$$} */ + const $$ = (component.$$ = { + fragment: null, + ctx: [], + // state + props, + update: noop, + not_equal, + bound: blank_object(), + // lifecycle + on_mount: [], + on_destroy: [], + on_disconnect: [], + before_update: [], + after_update: [], + context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), + // everything else + callbacks: blank_object(), + dirty, + skip_bound: false, + root: options.target || parent_component.$$.root + }); + append_styles && append_styles($$.root); + let ready = false; + $$.ctx = instance + ? instance(component, options.props || {}, (i, ret, ...rest) => { + const value = rest.length ? rest[0] : ret; + if ($$.ctx && not_equal($$.ctx[i], ($$.ctx[i] = value))) { + if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value); + if (ready) make_dirty(component, i); + } + return ret; + }) + : []; + $$.update(); + ready = true; + run_all($$.before_update); + // `false` as a special case of no DOM component + $$.fragment = create_fragment ? create_fragment($$.ctx) : false; + if (options.target) { + if (options.hydrate) { + // TODO: what is the correct type here? + // @ts-expect-error + const nodes = children(options.target); + $$.fragment && $$.fragment.l(nodes); + nodes.forEach(detach); + } else { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment && $$.fragment.c(); + } + if (options.intro) transition_in(component.$$.fragment); + mount_component(component, options.target, options.anchor); + flush(); + } + set_current_component(parent_component); + } + + /** + * Base class for Svelte components. Used when dev=false. + * + * @template {Record} [Props=any] + * @template {Record} [Events=any] + */ + class SvelteComponent { + /** + * ### PRIVATE API + * + * Do not use, may change at any time + * + * @type {any} + */ + $$ = undefined; + /** + * ### PRIVATE API + * + * Do not use, may change at any time + * + * @type {any} + */ + $$set = undefined; + + /** @returns {void} */ + $destroy() { + destroy_component(this, 1); + this.$destroy = noop; + } + + /** + * @template {Extract} K + * @param {K} type + * @param {((e: Events[K]) => void) | null | undefined} callback + * @returns {() => void} + */ + $on(type, callback) { + if (!is_function(callback)) { + return noop; + } + const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); + callbacks.push(callback); + return () => { + const index = callbacks.indexOf(callback); + if (index !== -1) callbacks.splice(index, 1); + }; + } + + /** + * @param {Partial} props + * @returns {void} + */ + $set(props) { + if (this.$$set && !is_empty(props)) { + this.$$.skip_bound = true; + this.$$set(props); + this.$$.skip_bound = false; + } + } + } + + /** + * @typedef {Object} CustomElementPropDefinition + * @property {string} [attribute] + * @property {boolean} [reflect] + * @property {'String'|'Boolean'|'Number'|'Array'|'Object'} [type] + */ + + // generated during release, do not modify + + /** + * The current version, as set in package.json. + * + * https://svelte.dev/docs/svelte-compiler#svelte-version + * @type {string} + */ + const VERSION = '4.2.12'; + const PUBLIC_VERSION = '4'; + + /** + * @template T + * @param {string} type + * @param {T} [detail] + * @returns {void} + */ + function dispatch_dev(type, detail) { + document.dispatchEvent(custom_event(type, { version: VERSION, ...detail }, { bubbles: true })); + } + + /** + * @param {Node} target + * @param {Node} node + * @returns {void} + */ + function append_dev(target, node) { + dispatch_dev('SvelteDOMInsert', { target, node }); + append(target, node); + } + + /** + * @param {Node} target + * @param {Node} node + * @param {Node} [anchor] + * @returns {void} + */ + function insert_dev(target, node, anchor) { + dispatch_dev('SvelteDOMInsert', { target, node, anchor }); + insert(target, node, anchor); + } + + /** + * @param {Node} node + * @returns {void} + */ + function detach_dev(node) { + dispatch_dev('SvelteDOMRemove', { node }); + detach(node); + } + + /** + * @param {Element} node + * @param {string} attribute + * @param {string} [value] + * @returns {void} + */ + function attr_dev(node, attribute, value) { + attr(node, attribute, value); + if (value == null) dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute }); + else dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value }); + } + + /** + * @param {Element} node + * @param {string} property + * @param {any} [value] + * @returns {void} + */ + function prop_dev(node, property, value) { + node[property] = value; + dispatch_dev('SvelteDOMSetProperty', { node, property, value }); + } + + /** + * @param {Text} text + * @param {unknown} data + * @returns {void} + */ + function set_data_dev(text, data) { + data = '' + data; + if (text.data === data) return; + dispatch_dev('SvelteDOMSetData', { node: text, data }); + text.data = /** @type {string} */ (data); + } + + function ensure_array_like_dev(arg) { + if ( + typeof arg !== 'string' && + !(arg && typeof arg === 'object' && 'length' in arg) && + !(typeof Symbol === 'function' && arg && Symbol.iterator in arg) + ) { + throw new Error('{#each} only works with iterable values.'); + } + return ensure_array_like(arg); + } + + /** + * @returns {void} */ + function validate_slots(name, slot, keys) { + for (const slot_key of Object.keys(slot)) { + if (!~keys.indexOf(slot_key)) { + console.warn(`<${name}> received an unexpected slot "${slot_key}".`); + } + } + } + + /** + * Base class for Svelte components with some minor dev-enhancements. Used when dev=true. + * + * Can be used to create strongly typed Svelte components. + * + * #### Example: + * + * You have component library on npm called `component-library`, from which + * you export a component called `MyComponent`. For Svelte+TypeScript users, + * you want to provide typings. Therefore you create a `index.d.ts`: + * ```ts + * import { SvelteComponent } from "svelte"; + * export class MyComponent extends SvelteComponent<{foo: string}> {} + * ``` + * Typing this makes it possible for IDEs like VS Code with the Svelte extension + * to provide intellisense and to use the component like this in a Svelte file + * with TypeScript: + * ```svelte + * + * + * ``` + * @template {Record} [Props=any] + * @template {Record} [Events=any] + * @template {Record} [Slots=any] + * @extends {SvelteComponent} + */ + class SvelteComponentDev extends SvelteComponent { + /** + * For type checking capabilities only. + * Does not exist at runtime. + * ### DO NOT USE! + * + * @type {Props} + */ + $$prop_def; + /** + * For type checking capabilities only. + * Does not exist at runtime. + * ### DO NOT USE! + * + * @type {Events} + */ + $$events_def; + /** + * For type checking capabilities only. + * Does not exist at runtime. + * ### DO NOT USE! + * + * @type {Slots} + */ + $$slot_def; + + /** @param {import('./public.js').ComponentConstructorOptions} options */ + constructor(options) { + if (!options || (!options.target && !options.$$inline)) { + throw new Error("'target' is a required option"); + } + super(); + } + + /** @returns {void} */ + $destroy() { + super.$destroy(); + this.$destroy = () => { + console.warn('Component was already destroyed'); // eslint-disable-line no-console + }; + } + + /** @returns {void} */ + $capture_state() {} + + /** @returns {void} */ + $inject_state() {} + } + + if (typeof window !== 'undefined') + // @ts-ignore + (window.__svelte || (window.__svelte = { v: new Set() })).v.add(PUBLIC_VERSION); + + /* webviews/components/Record.svelte generated by Svelte v4.2.12 */ + + const { Object: Object_1, console: console_1 } = globals; + const file = "webviews/components/Record.svelte"; + + function get_each_context(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[1] = list[i]; + return child_ctx; + } + + // (112:8) {#each Object.keys(flags) as flag} + function create_each_block(ctx) { + let option; + let t_value = /*flag*/ ctx[1] + ""; + let t; + let option_value_value; + + const block = { + c: function create() { + option = element("option"); + t = text(t_value); + option.__value = option_value_value = /*flag*/ ctx[1]; + set_input_value(option, option.__value); + add_location(option, file, 112, 10, 3520); + }, + m: function mount(target, anchor) { + insert_dev(target, option, anchor); + append_dev(option, t); + }, + p: function update(ctx, dirty) { + if (dirty & /*flags*/ 1 && t_value !== (t_value = /*flag*/ ctx[1] + "")) set_data_dev(t, t_value); + + if (dirty & /*flags*/ 1 && option_value_value !== (option_value_value = /*flag*/ ctx[1])) { + prop_dev(option, "__value", option_value_value); + set_input_value(option, option.__value); + } + }, + d: function destroy(detaching) { + if (detaching) { + detach_dev(option); + } + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block.name, + type: "each", + source: "(112:8) {#each Object.keys(flags) as flag}", + ctx + }); + + return block; + } + + function create_fragment(ctx) { + let body; + let a; + let t1; + let div2; + let div0; + let img; + let img_src_value; + let t2; + let h40; + let t4; + let div1; + let h41; + let t6; + let hr0; + let t7; + let div3; + let button0; + let t9; + let input0; + let t10; + let div4; + let button1; + let t12; + let input1; + let t13; + let div7; + let div5; + let select; + let option; + let t15; + let div6; + let input2; + let t16; + let button2; + let t18; + let hr1; + let t19; + let div8; + let t20; + let button3; + let t22; + let h3; + let t23; + let div9; + let each_value = ensure_array_like_dev(Object.keys(/*flags*/ ctx[0])); + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); + } + + const block = { + c: function create() { + body = element("body"); + a = element("a"); + a.textContent = "Home"; + t1 = space(); + div2 = element("div"); + div0 = element("div"); + img = element("img"); + t2 = space(); + h40 = element("h4"); + h40.textContent = "Command"; + t4 = space(); + div1 = element("div"); + h41 = element("h4"); + h41.textContent = "keploy record"; + t6 = space(); + hr0 = element("hr"); + t7 = space(); + div3 = element("div"); + button0 = element("button"); + button0.textContent = "Select Project Folder"; + t9 = space(); + input0 = element("input"); + t10 = space(); + div4 = element("div"); + button1 = element("button"); + button1.textContent = "Enter App Command"; + t12 = space(); + input1 = element("input"); + t13 = space(); + div7 = element("div"); + div5 = element("div"); + select = element("select"); + option = element("option"); + option.textContent = "Select Flag"; + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t15 = space(); + div6 = element("div"); + input2 = element("input"); + t16 = space(); + button2 = element("button"); + button2.textContent = "Start Recording"; + t18 = space(); + hr1 = element("hr"); + t19 = space(); + div8 = element("div"); + t20 = space(); + button3 = element("button"); + button3.textContent = "Stop Recording"; + t22 = space(); + h3 = element("h3"); + h3.innerHTML = ``; + t23 = space(); + div9 = element("div"); + attr_dev(a, "id", "navigateHomeButton"); + attr_dev(a, "class", "homebutton svelte-1kl0a9n"); + add_location(a, file, 69, 2, 2355); + attr_dev(img, "class", "keploylogo svelte-1kl0a9n"); + if (!src_url_equal(img.src, img_src_value = "https://avatars.githubusercontent.com/u/92252339?s=200&v=4")) attr_dev(img, "src", img_src_value); + attr_dev(img, "alt", "Keploy Logo"); + add_location(img, file, 72, 6, 2471); + add_location(h40, file, 77, 6, 2617); + attr_dev(div0, "id", "upperOutputDiv"); + attr_dev(div0, "class", "svelte-1kl0a9n"); + add_location(div0, file, 71, 4, 2439); + attr_dev(h41, "id", "generatedRecordCommand"); + attr_dev(h41, "class", "svelte-1kl0a9n"); + add_location(h41, file, 80, 6, 2683); + attr_dev(div1, "id", "recordCommandDiv"); + add_location(div1, file, 79, 4, 2649); + attr_dev(div2, "id", "outputDiv"); + attr_dev(div2, "class", "svelte-1kl0a9n"); + add_location(div2, file, 70, 2, 2414); + attr_dev(hr0, "id", "upperHR"); + add_location(hr0, file, 84, 2, 2761); + attr_dev(button0, "id", "selectRecordFolderButton"); + attr_dev(button0, "class", "secondary svelte-1kl0a9n"); + add_location(button0, file, 86, 4, 2814); + attr_dev(input0, "type", "text"); + attr_dev(input0, "id", "recordProjectFolder"); + attr_dev(input0, "name", "projectFolder"); + attr_dev(input0, "placeholder", "Enter Manual Path"); + attr_dev(input0, "class", "svelte-1kl0a9n"); + add_location(input0, file, 89, 4, 2917); + attr_dev(div3, "id", "selectFolderDiv"); + attr_dev(div3, "class", "svelte-1kl0a9n"); + add_location(div3, file, 85, 2, 2783); + attr_dev(button1, "id", "enterAppCommandButton"); + button1.disabled = "true"; + attr_dev(button1, "class", "secondary svelte-1kl0a9n"); + add_location(button1, file, 97, 4, 3085); + attr_dev(input1, "type", "text"); + attr_dev(input1, "id", "recordCommand"); + attr_dev(input1, "name", "recordCommand"); + attr_dev(input1, "placeholder", "Enter App Command"); + attr_dev(input1, "class", "svelte-1kl0a9n"); + add_location(input1, file, 100, 4, 3197); + attr_dev(div4, "id", "appCommandDiv"); + attr_dev(div4, "class", "svelte-1kl0a9n"); + add_location(div4, file, 96, 2, 3056); + option.__value = ""; + set_input_value(option, option.__value); + option.disabled = true; + option.selected = true; + add_location(option, file, 110, 8, 3411); + attr_dev(select, "id", "selectflags"); + attr_dev(select, "class", "svelte-1kl0a9n"); + add_location(select, file, 109, 6, 3377); + attr_dev(div5, "id", "flags"); + add_location(div5, file, 108, 4, 3354); + attr_dev(input2, "type", "text"); + attr_dev(input2, "id", "flagValueInput"); + attr_dev(input2, "placeholder", "Enter Value"); + attr_dev(input2, "class", "svelte-1kl0a9n"); + add_location(input2, file, 117, 6, 3631); + attr_dev(div6, "id", "flagValue"); + add_location(div6, file, 116, 4, 3604); + attr_dev(div7, "id", "flagsDiv"); + attr_dev(div7, "class", "svelte-1kl0a9n"); + add_location(div7, file, 107, 2, 3330); + attr_dev(button2, "id", "startRecordingButton"); + button2.disabled = "true"; + attr_dev(button2, "class", "svelte-1kl0a9n"); + add_location(button2, file, 120, 2, 3721); + attr_dev(hr1, "id", "lowerHR"); + attr_dev(hr1, "class", "svelte-1kl0a9n"); + add_location(hr1, file, 121, 2, 3798); + attr_dev(div8, "class", "loader svelte-1kl0a9n"); + attr_dev(div8, "id", "loader"); + add_location(div8, file, 122, 2, 3820); + attr_dev(button3, "id", "stopRecordingButton"); + attr_dev(button3, "class", "svelte-1kl0a9n"); + add_location(button3, file, 123, 4, 3863); + attr_dev(h3, "id", "recordStatus"); + attr_dev(h3, "class", "svelte-1kl0a9n"); + add_location(h3, file, 124, 4, 3924); + attr_dev(div9, "id", "recordedTestCases"); + attr_dev(div9, "class", "svelte-1kl0a9n"); + add_location(div9, file, 125, 4, 3957); + add_location(body, file, 68, 0, 2346); + }, + l: function claim(nodes) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + m: function mount(target, anchor) { + insert_dev(target, body, anchor); + append_dev(body, a); + append_dev(body, t1); + append_dev(body, div2); + append_dev(div2, div0); + append_dev(div0, img); + append_dev(div0, t2); + append_dev(div0, h40); + append_dev(div2, t4); + append_dev(div2, div1); + append_dev(div1, h41); + append_dev(body, t6); + append_dev(body, hr0); + append_dev(body, t7); + append_dev(body, div3); + append_dev(div3, button0); + append_dev(div3, t9); + append_dev(div3, input0); + append_dev(body, t10); + append_dev(body, div4); + append_dev(div4, button1); + append_dev(div4, t12); + append_dev(div4, input1); + append_dev(body, t13); + append_dev(body, div7); + append_dev(div7, div5); + append_dev(div5, select); + append_dev(select, option); + + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(select, null); + } + } + + append_dev(div7, t15); + append_dev(div7, div6); + append_dev(div6, input2); + append_dev(body, t16); + append_dev(body, button2); + append_dev(body, t18); + append_dev(body, hr1); + append_dev(body, t19); + append_dev(body, div8); + append_dev(body, t20); + append_dev(body, button3); + append_dev(body, t22); + append_dev(body, h3); + append_dev(body, t23); + append_dev(body, div9); + }, + p: function update(ctx, [dirty]) { + if (dirty & /*Object, flags*/ 1) { + each_value = ensure_array_like_dev(Object.keys(/*flags*/ ctx[0])); + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(select, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + }, + i: noop, + o: noop, + d: function destroy(detaching) { + if (detaching) { + detach_dev(body); + } + + destroy_each(each_blocks, detaching); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function instance($$self, $$props, $$invalidate) { + let { $$slots: slots = {}, $$scope } = $$props; + validate_slots('Record', slots, []); + + let flags = { + "config-path": "", + "delay": "", + "passThroughPorts": "", + "path": "", + "proxyport": "", + "debug": "" + }; + + onMount(() => { + document.getElementById("recordProjectFolder").addEventListener("input", () => { + if (document.getElementById("recordProjectFolder").value && document.getElementById("recordCommand").value) { + document.getElementById("startRecordingButton").disabled = false; + } + }); + + document.getElementById("recordCommand").addEventListener("input", () => { + if (document.getElementById("recordProjectFolder").value && document.getElementById("recordCommand").value) { + document.getElementById("startRecordingButton").disabled = false; + } + }); + + //change the value of the generatedRecordCommand when the recordCommand is filled + document.getElementById("recordCommand").addEventListener("input", () => { + document.getElementById("generatedRecordCommand").innerText = `keploy record -c "${document.getElementById("recordCommand").value}"`; + }); + + const selectFlagsElement = document.getElementById("selectflags"); + selectFlagsElement.addEventListener("change", () => handleFlagValueChange()); + const flagValueInput = document.getElementById("flagValueInput"); + flagValueInput.addEventListener("input", () => handleFlagValueChange()); + + function handleFlagValueChange() { + const e = document.getElementById("selectflags"); + var selectedFlag = e.options[e.selectedIndex].value; + console.log("selectedFlag : " + selectedFlag); + const flagValue = document.getElementById("flagValueInput").value; + console.log("flagValue : " + flagValue); + $$invalidate(0, flags[selectedFlag] = flagValue, flags); + console.log(flags); + updateGeneratedCommand(); + } + + function updateGeneratedCommand() { + let currentCommand = `keploy record -c "${document.getElementById("recordCommand").value}"`; + + for (const [flag, value] of Object.entries(flags)) { + if (value) { + currentCommand += ` --${flag}="${value}"`; + } + } + + document.getElementById("generatedRecordCommand").innerText = currentCommand; + } + }); + + const writable_props = []; + + Object_1.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1.warn(` was created with unknown prop '${key}'`); + }); + + $$self.$capture_state = () => ({ onMount, flags }); + + $$self.$inject_state = $$props => { + if ('flags' in $$props) $$invalidate(0, flags = $$props.flags); + }; + + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } + + return [flags]; + } + + class Record extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance, create_fragment, safe_not_equal, {}); + + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "Record", + options, + id: create_fragment.name + }); + } + } + + const app = new Record({ + target: document.body, + }); + + return app; + +})(); //# sourceMappingURL=Record.js.map diff --git a/out/compiled/Record.js.map b/out/compiled/Record.js.map index d273da3..a1a93aa 100644 --- a/out/compiled/Record.js.map +++ b/out/compiled/Record.js.map @@ -1 +1 @@ -{"version":3,"file":"Record.js","sources":["../../node_modules/svelte/src/runtime/internal/utils.js","../../node_modules/svelte/src/runtime/internal/dom.js","../../node_modules/svelte/src/runtime/internal/lifecycle.js","../../node_modules/svelte/src/runtime/internal/scheduler.js","../../node_modules/svelte/src/runtime/internal/transitions.js","../../node_modules/svelte/src/runtime/internal/each.js","../../node_modules/svelte/src/runtime/internal/Component.js","../../webviews/components/Record.svelte","../../node_modules/svelte/src/runtime/internal/disclose-version/index.js","../../node_modules/svelte/src/shared/version.js","../../webviews/pages/Record.ts"],"sourcesContent":["/** @returns {void} */\nexport function noop() {}\n\nexport const identity = (x) => x;\n\n/**\n * @template T\n * @template S\n * @param {T} tar\n * @param {S} src\n * @returns {T & S}\n */\nexport function assign(tar, src) {\n\t// @ts-ignore\n\tfor (const k in src) tar[k] = src[k];\n\treturn /** @type {T & S} */ (tar);\n}\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n/**\n * @param {any} value\n * @returns {value is PromiseLike}\n */\nexport function is_promise(value) {\n\treturn (\n\t\t!!value &&\n\t\t(typeof value === 'object' || typeof value === 'function') &&\n\t\ttypeof (/** @type {any} */ (value).then) === 'function'\n\t);\n}\n\n/** @returns {void} */\nexport function add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nexport function run(fn) {\n\treturn fn();\n}\n\nexport function blank_object() {\n\treturn Object.create(null);\n}\n\n/**\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function run_all(fns) {\n\tfns.forEach(run);\n}\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\n/** @returns {boolean} */\nexport function safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';\n}\n\nlet src_url_equal_anchor;\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nexport function src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\tif (!src_url_equal_anchor) {\n\t\tsrc_url_equal_anchor = document.createElement('a');\n\t}\n\t// This is actually faster than doing URL(..).href\n\tsrc_url_equal_anchor.href = url;\n\treturn element_src === src_url_equal_anchor.href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element_srcset\n * @param {string | undefined | null} srcset\n * @returns {boolean}\n */\nexport function srcset_url_equal(element_srcset, srcset) {\n\tconst element_urls = split_srcset(element_srcset.srcset);\n\tconst urls = split_srcset(srcset || '');\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n\n/** @returns {boolean} */\nexport function not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\n/** @returns {boolean} */\nexport function is_empty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n/** @returns {void} */\nexport function validate_store(store, name) {\n\tif (store != null && typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nexport function subscribe(store, ...callbacks) {\n\tif (store == null) {\n\t\tfor (const callback of callbacks) {\n\t\t\tcallback(undefined);\n\t\t}\n\t\treturn noop;\n\t}\n\tconst unsub = store.subscribe(...callbacks);\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * https://svelte.dev/docs/svelte-store#get\n * @template T\n * @param {import('../store/public.js').Readable} store\n * @returns {T}\n */\nexport function get_store_value(store) {\n\tlet value;\n\tsubscribe(store, (_) => (value = _))();\n\treturn value;\n}\n\n/** @returns {void} */\nexport function component_subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(subscribe(store, callback));\n}\n\nexport function create_slot(definition, ctx, $$scope, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n\treturn definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;\n}\n\nexport function get_slot_changes(definition, $$scope, dirty, fn) {\n\tif (definition[2] && fn) {\n\t\tconst lets = definition[2](fn(dirty));\n\t\tif ($$scope.dirty === undefined) {\n\t\t\treturn lets;\n\t\t}\n\t\tif (typeof lets === 'object') {\n\t\t\tconst merged = [];\n\t\t\tconst len = Math.max($$scope.dirty.length, lets.length);\n\t\t\tfor (let i = 0; i < len; i += 1) {\n\t\t\t\tmerged[i] = $$scope.dirty[i] | lets[i];\n\t\t\t}\n\t\t\treturn merged;\n\t\t}\n\t\treturn $$scope.dirty | lets;\n\t}\n\treturn $$scope.dirty;\n}\n\n/** @returns {void} */\nexport function update_slot_base(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tslot_changes,\n\tget_slot_context_fn\n) {\n\tif (slot_changes) {\n\t\tconst slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n\t\tslot.p(slot_context, slot_changes);\n\t}\n}\n\n/** @returns {void} */\nexport function update_slot(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tdirty,\n\tget_slot_changes_fn,\n\tget_slot_context_fn\n) {\n\tconst slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n\tupdate_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\n\n/** @returns {any[] | -1} */\nexport function get_all_dirty_from_scope($$scope) {\n\tif ($$scope.ctx.length > 32) {\n\t\tconst dirty = [];\n\t\tconst length = $$scope.ctx.length / 32;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdirty[i] = -1;\n\t\t}\n\t\treturn dirty;\n\t}\n\treturn -1;\n}\n\n/** @returns {{}} */\nexport function exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\n/** @returns {{}} */\nexport function compute_rest_props(props, keys) {\n\tconst rest = {};\n\tkeys = new Set(keys);\n\tfor (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];\n\treturn rest;\n}\n\n/** @returns {{}} */\nexport function compute_slots(slots) {\n\tconst result = {};\n\tfor (const key in slots) {\n\t\tresult[key] = true;\n\t}\n\treturn result;\n}\n\n/** @returns {(this: any, ...args: any[]) => void} */\nexport function once(fn) {\n\tlet ran = false;\n\treturn function (...args) {\n\t\tif (ran) return;\n\t\tran = true;\n\t\tfn.call(this, ...args);\n\t};\n}\n\nexport function null_to_empty(value) {\n\treturn value == null ? '' : value;\n}\n\nexport function set_store_value(store, ret, value) {\n\tstore.set(value);\n\treturn ret;\n}\n\nexport const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\n\nexport function action_destroyer(action_result) {\n\treturn action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\n/** @param {number | string} value\n * @returns {[number, string]}\n */\nexport function split_css_unit(value) {\n\tconst split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n\treturn split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];\n}\n\nexport const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n","import { contenteditable_truthy_values, has_prop } from './utils.js';\n\nimport { ResizeObserverSingleton } from './ResizeObserverSingleton.js';\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\n\n/**\n * @returns {void}\n */\nexport function start_hydrating() {\n\tis_hydrating = true;\n}\n\n/**\n * @returns {void}\n */\nexport function end_hydrating() {\n\tis_hydrating = false;\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {(index: number) => number} key\n * @param {number} value\n * @returns {number}\n */\nfunction upper_bound(low, high, key, value) {\n\t// Return first index of value larger than input value in the range [low, high)\n\twhile (low < high) {\n\t\tconst mid = low + ((high - low) >> 1);\n\t\tif (key(mid) <= value) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\thigh = mid;\n\t\t}\n\t}\n\treturn low;\n}\n\n/**\n * @param {NodeEx} target\n * @returns {void}\n */\nfunction init_hydrate(target) {\n\tif (target.hydrate_init) return;\n\ttarget.hydrate_init = true;\n\t// We know that all children have claim_order values since the unclaimed have been detached if target is not \n\n\tlet children = /** @type {ArrayLike} */ (target.childNodes);\n\t// If target is , there may be children without claim_order\n\tif (target.nodeName === 'HEAD') {\n\t\tconst my_children = [];\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tconst node = children[i];\n\t\t\tif (node.claim_order !== undefined) {\n\t\t\t\tmy_children.push(node);\n\t\t\t}\n\t\t}\n\t\tchildren = my_children;\n\t}\n\t/*\n\t * Reorder claimed children optimally.\n\t * We can reorder claimed children optimally by finding the longest subsequence of\n\t * nodes that are already claimed in order and only moving the rest. The longest\n\t * subsequence of nodes that are claimed in order can be found by\n\t * computing the longest increasing subsequence of .claim_order values.\n\t *\n\t * This algorithm is optimal in generating the least amount of reorder operations\n\t * possible.\n\t *\n\t * Proof:\n\t * We know that, given a set of reordering operations, the nodes that do not move\n\t * always form an increasing subsequence, since they do not move among each other\n\t * meaning that they must be already ordered among each other. Thus, the maximal\n\t * set of nodes that do not move form a longest increasing subsequence.\n\t */\n\t// Compute longest increasing subsequence\n\t// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n\tconst m = new Int32Array(children.length + 1);\n\t// Predecessor indices + 1\n\tconst p = new Int32Array(children.length);\n\tm[0] = -1;\n\tlet longest = 0;\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst current = children[i].claim_order;\n\t\t// Find the largest subsequence length such that it ends in a value less than our current value\n\t\t// upper_bound returns first greater value, so we subtract one\n\t\t// with fast path for when we are on the current longest subsequence\n\t\tconst seq_len =\n\t\t\t(longest > 0 && children[m[longest]].claim_order <= current\n\t\t\t\t? longest + 1\n\t\t\t\t: upper_bound(1, longest, (idx) => children[m[idx]].claim_order, current)) - 1;\n\t\tp[i] = m[seq_len] + 1;\n\t\tconst new_len = seq_len + 1;\n\t\t// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n\t\tm[new_len] = i;\n\t\tlongest = Math.max(new_len, longest);\n\t}\n\t// The longest increasing subsequence of nodes (initially reversed)\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst lis = [];\n\t// The rest of the nodes, nodes that will be moved\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst to_move = [];\n\tlet last = children.length - 1;\n\tfor (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n\t\tlis.push(children[cur - 1]);\n\t\tfor (; last >= cur; last--) {\n\t\t\tto_move.push(children[last]);\n\t\t}\n\t\tlast--;\n\t}\n\tfor (; last >= 0; last--) {\n\t\tto_move.push(children[last]);\n\t}\n\tlis.reverse();\n\t// We sort the nodes being moved to guarantee that their insertion order matches the claim order\n\tto_move.sort((a, b) => a.claim_order - b.claim_order);\n\t// Finally, we move the nodes\n\tfor (let i = 0, j = 0; i < to_move.length; i++) {\n\t\twhile (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) {\n\t\t\tj++;\n\t\t}\n\t\tconst anchor = j < lis.length ? lis[j] : null;\n\t\ttarget.insertBefore(to_move[i], anchor);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @returns {void}\n */\nexport function append(target, node) {\n\ttarget.appendChild(node);\n}\n\n/**\n * @param {Node} target\n * @param {string} style_sheet_id\n * @param {string} styles\n * @returns {void}\n */\nexport function append_styles(target, style_sheet_id, styles) {\n\tconst append_styles_to = get_root_for_style(target);\n\tif (!append_styles_to.getElementById(style_sheet_id)) {\n\t\tconst style = element('style');\n\t\tstyle.id = style_sheet_id;\n\t\tstyle.textContent = styles;\n\t\tappend_stylesheet(append_styles_to, style);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {ShadowRoot | Document}\n */\nexport function get_root_for_style(node) {\n\tif (!node) return document;\n\tconst root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n\tif (root && /** @type {ShadowRoot} */ (root).host) {\n\t\treturn /** @type {ShadowRoot} */ (root);\n\t}\n\treturn node.ownerDocument;\n}\n\n/**\n * @param {Node} node\n * @returns {CSSStyleSheet}\n */\nexport function append_empty_stylesheet(node) {\n\tconst style_element = element('style');\n\t// For transitions to work without 'style-src: unsafe-inline' Content Security Policy,\n\t// these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API.\n\t// Using the hash for the empty string (for an empty tag) works in all browsers except Safari.\n\t// So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */.\n\t// The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari.\n\tstyle_element.textContent = '/* empty */';\n\tappend_stylesheet(get_root_for_style(node), style_element);\n\treturn style_element.sheet;\n}\n\n/**\n * @param {ShadowRoot | Document} node\n * @param {HTMLStyleElement} style\n * @returns {CSSStyleSheet}\n */\nfunction append_stylesheet(node, style) {\n\tappend(/** @type {Document} */ (node).head || node, style);\n\treturn style.sheet;\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @returns {void}\n */\nexport function append_hydration(target, node) {\n\tif (is_hydrating) {\n\t\tinit_hydrate(target);\n\t\tif (\n\t\t\ttarget.actual_end_child === undefined ||\n\t\t\t(target.actual_end_child !== null && target.actual_end_child.parentNode !== target)\n\t\t) {\n\t\t\ttarget.actual_end_child = target.firstChild;\n\t\t}\n\t\t// Skip nodes of undefined ordering\n\t\twhile (target.actual_end_child !== null && target.actual_end_child.claim_order === undefined) {\n\t\t\ttarget.actual_end_child = target.actual_end_child.nextSibling;\n\t\t}\n\t\tif (node !== target.actual_end_child) {\n\t\t\t// We only insert if the ordering of this node should be modified or the parent node is not target\n\t\t\tif (node.claim_order !== undefined || node.parentNode !== target) {\n\t\t\t\ttarget.insertBefore(node, target.actual_end_child);\n\t\t\t}\n\t\t} else {\n\t\t\ttarget.actual_end_child = node.nextSibling;\n\t\t}\n\t} else if (node.parentNode !== target || node.nextSibling !== null) {\n\t\ttarget.appendChild(node);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @param {Node} [anchor]\n * @returns {void}\n */\nexport function insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor || null);\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @param {NodeEx} [anchor]\n * @returns {void}\n */\nexport function insert_hydration(target, node, anchor) {\n\tif (is_hydrating && !anchor) {\n\t\tappend_hydration(target, node);\n\t} else if (node.parentNode !== target || node.nextSibling != anchor) {\n\t\ttarget.insertBefore(node, anchor || null);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {void}\n */\nexport function detach(node) {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element(name) {\n\treturn document.createElement(name);\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @param {string} is\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element_is(name, is) {\n\treturn document.createElement(name, { is });\n}\n\n/**\n * @template T\n * @template {keyof T} K\n * @param {T} obj\n * @param {K[]} exclude\n * @returns {Pick>}\n */\nexport function object_without_properties(obj, exclude) {\n\tconst target = /** @type {Pick>} */ ({});\n\tfor (const k in obj) {\n\t\tif (\n\t\t\thas_prop(obj, k) &&\n\t\t\t// @ts-ignore\n\t\t\texclude.indexOf(k) === -1\n\t\t) {\n\t\t\t// @ts-ignore\n\t\t\ttarget[k] = obj[k];\n\t\t}\n\t}\n\treturn target;\n}\n\n/**\n * @template {keyof SVGElementTagNameMap} K\n * @param {K} name\n * @returns {SVGElement}\n */\nexport function svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n/**\n * @param {string} data\n * @returns {Text}\n */\nexport function text(data) {\n\treturn document.createTextNode(data);\n}\n\n/**\n * @returns {Text} */\nexport function space() {\n\treturn text(' ');\n}\n\n/**\n * @returns {Text} */\nexport function empty() {\n\treturn text('');\n}\n\n/**\n * @param {string} content\n * @returns {Comment}\n */\nexport function comment(content) {\n\treturn document.createComment(content);\n}\n\n/**\n * @param {EventTarget} node\n * @param {string} event\n * @param {EventListenerOrEventListenerObject} handler\n * @param {boolean | AddEventListenerOptions | EventListenerOptions} [options]\n * @returns {() => void}\n */\nexport function listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function prevent_default(fn) {\n\treturn function (event) {\n\t\tevent.preventDefault();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopPropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_immediate_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopImmediatePropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function self(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.target === this) fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function trusted(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.isTrusted) fn.call(this, event);\n\t};\n}\n\n/**\n * @param {Element} node\n * @param {string} attribute\n * @param {string} [value]\n * @returns {void}\n */\nexport function attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_attributes(node, attributes) {\n\t// @ts-ignore\n\tconst descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n\tfor (const key in attributes) {\n\t\tif (attributes[key] == null) {\n\t\t\tnode.removeAttribute(key);\n\t\t} else if (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key === '__value') {\n\t\t\t/** @type {any} */ (node).value = node[key] = attributes[key];\n\t\t} else if (\n\t\t\tdescriptors[key] &&\n\t\t\tdescriptors[key].set &&\n\t\t\talways_set_through_set_attribute.indexOf(key) === -1\n\t\t) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_svg_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tattr(node, key, attributes[key]);\n\t}\n}\n\n/**\n * @param {Record} data_map\n * @returns {void}\n */\nexport function set_custom_element_data_map(node, data_map) {\n\tObject.keys(data_map).forEach((key) => {\n\t\tset_custom_element_data(node, key, data_map[key]);\n\t});\n}\n\n/**\n * @returns {void} */\nexport function set_custom_element_data(node, prop, value) {\n\tconst lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first\n\tif (lower in node) {\n\t\tnode[lower] = typeof node[lower] === 'boolean' && value === '' ? true : value;\n\t} else if (prop in node) {\n\t\tnode[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\n/**\n * @param {string} tag\n */\nexport function set_dynamic_element_data(tag) {\n\treturn /-/.test(tag) ? set_custom_element_data_map : set_attributes;\n}\n\n/**\n * @returns {void}\n */\nexport function xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @returns {string}\n */\nexport function get_svelte_dataset(node) {\n\treturn node.dataset.svelteH;\n}\n\n/**\n * @returns {unknown[]} */\nexport function get_binding_group_value(group, __value, checked) {\n\tconst value = new Set();\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.add(group[i].__value);\n\t}\n\tif (!checked) {\n\t\tvalue.delete(__value);\n\t}\n\treturn Array.from(value);\n}\n\n/**\n * @param {HTMLInputElement[]} group\n * @returns {{ p(...inputs: HTMLInputElement[]): void; r(): void; }}\n */\nexport function init_binding_group(group) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\treturn {\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\t_inputs.forEach((input) => group.push(input));\n\t\t},\n\t\t/* remove */ r() {\n\t\t\t_inputs.forEach((input) => group.splice(group.indexOf(input), 1));\n\t\t}\n\t};\n}\n\n/**\n * @param {number[]} indexes\n * @returns {{ u(new_indexes: number[]): void; p(...inputs: HTMLInputElement[]): void; r: () => void; }}\n */\nexport function init_binding_group_dynamic(group, indexes) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _group = get_binding_group(group);\n\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\n\tfunction get_binding_group(group) {\n\t\tfor (let i = 0; i < indexes.length; i++) {\n\t\t\tgroup = group[indexes[i]] = group[indexes[i]] || [];\n\t\t}\n\t\treturn group;\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction push() {\n\t\t_inputs.forEach((input) => _group.push(input));\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction remove() {\n\t\t_inputs.forEach((input) => _group.splice(_group.indexOf(input), 1));\n\t}\n\treturn {\n\t\t/* update */ u(new_indexes) {\n\t\t\tindexes = new_indexes;\n\t\t\tconst new_group = get_binding_group(group);\n\t\t\tif (new_group !== _group) {\n\t\t\t\tremove();\n\t\t\t\t_group = new_group;\n\t\t\t\tpush();\n\t\t\t}\n\t\t},\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\tpush();\n\t\t},\n\t\t/* remove */ r: remove\n\t};\n}\n\n/** @returns {number} */\nexport function to_number(value) {\n\treturn value === '' ? null : +value;\n}\n\n/** @returns {any[]} */\nexport function time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\n/**\n * @param {Element} element\n * @returns {ChildNode[]}\n */\nexport function children(element) {\n\treturn Array.from(element.childNodes);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {void}\n */\nfunction init_claim_info(nodes) {\n\tif (nodes.claim_info === undefined) {\n\t\tnodes.claim_info = { last_index: 0, total_claimed: 0 };\n\t}\n}\n\n/**\n * @template {ChildNodeEx} R\n * @param {ChildNodeArray} nodes\n * @param {(node: ChildNodeEx) => node is R} predicate\n * @param {(node: ChildNodeEx) => ChildNodeEx | undefined} process_node\n * @param {() => R} create_node\n * @param {boolean} dont_update_last_index\n * @returns {R}\n */\nfunction claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) {\n\t// Try to find nodes in an order such that we lengthen the longest increasing subsequence\n\tinit_claim_info(nodes);\n\tconst result_node = (() => {\n\t\t// We first try to find an element after the previous one\n\t\tfor (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// Otherwise, we try to find one before\n\t\t// We iterate in reverse so that we don't go too far back\n\t\tfor (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t} else if (replacement === undefined) {\n\t\t\t\t\t// Since we spliced before the last_index, we decrease it\n\t\t\t\t\tnodes.claim_info.last_index--;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// If we can't find any matching node, we create a new one\n\t\treturn create_node();\n\t})();\n\tresult_node.claim_order = nodes.claim_info.total_claimed;\n\tnodes.claim_info.total_claimed += 1;\n\treturn result_node;\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @param {(name: string) => Element | SVGElement} create_element\n * @returns {Element | SVGElement}\n */\nfunction claim_element_base(nodes, name, attributes, create_element) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Element | SVGElement} */\n\t\t(node) => node.nodeName === name,\n\t\t/** @param {Element} node */\n\t\t(node) => {\n\t\t\tconst remove = [];\n\t\t\tfor (let j = 0; j < node.attributes.length; j++) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) {\n\t\t\t\t\tremove.push(attribute.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove.forEach((v) => node.removeAttribute(v));\n\t\t\treturn undefined;\n\t\t},\n\t\t() => create_element(name)\n\t);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_svg_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, svg_element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Text}\n */\nexport function claim_text(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Text} */\n\t\t(node) => node.nodeType === 3,\n\t\t/** @param {Text} node */\n\t\t(node) => {\n\t\t\tconst data_str = '' + data;\n\t\t\tif (node.data.startsWith(data_str)) {\n\t\t\t\tif (node.data.length !== data_str.length) {\n\t\t\t\t\treturn node.splitText(data_str.length);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode.data = data_str;\n\t\t\t}\n\t\t},\n\t\t() => text(data),\n\t\ttrue // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n\t);\n}\n\n/**\n * @returns {Text} */\nexport function claim_space(nodes) {\n\treturn claim_text(nodes, ' ');\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Comment}\n */\nexport function claim_comment(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Comment} */\n\t\t(node) => node.nodeType === 8,\n\t\t/** @param {Comment} node */\n\t\t(node) => {\n\t\t\tnode.data = '' + data;\n\t\t\treturn undefined;\n\t\t},\n\t\t() => comment(data),\n\t\ttrue\n\t);\n}\n\nfunction get_comment_idx(nodes, text, start) {\n\tfor (let i = start; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * @param {boolean} is_svg\n * @returns {HtmlTagHydration}\n */\nexport function claim_html_tag(nodes, is_svg) {\n\t// find html opening tag\n\tconst start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0);\n\tconst end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1);\n\tif (start_index === -1 || end_index === -1) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\n\tinit_claim_info(nodes);\n\tconst html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n\tdetach(html_tag_nodes[0]);\n\tdetach(html_tag_nodes[html_tag_nodes.length - 1]);\n\tconst claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n\tif (claimed_nodes.length === 0) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\tfor (const n of claimed_nodes) {\n\t\tn.claim_order = nodes.claim_info.total_claimed;\n\t\tnodes.claim_info.total_claimed += 1;\n\t}\n\treturn new HtmlTagHydration(is_svg, claimed_nodes);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data_contenteditable(text, data) {\n\tdata = '' + data;\n\tif (text.wholeText === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @param {string} attr_value\n * @returns {void}\n */\nexport function set_data_maybe_contenteditable(text, data, attr_value) {\n\tif (~contenteditable_truthy_values.indexOf(attr_value)) {\n\t\tset_data_contenteditable(text, data);\n\t} else {\n\t\tset_data(text, data);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_input_value(input, value) {\n\tinput.value = value == null ? '' : value;\n}\n\n/**\n * @returns {void} */\nexport function set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_style(node, key, value, important) {\n\tif (value == null) {\n\t\tnode.style.removeProperty(key);\n\t} else {\n\t\tnode.style.setProperty(key, value, important ? 'important' : '');\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_option(select, value, mounting) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nexport function select_value(select) {\n\tconst selected_option = select.querySelector(':checked');\n\treturn selected_option && selected_option.__value;\n}\n\nexport function select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), (option) => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\n\n/**\n * @type {boolean} */\nlet crossorigin;\n\n/**\n * @returns {boolean} */\nexport function is_crossorigin() {\n\tif (crossorigin === undefined) {\n\t\tcrossorigin = false;\n\t\ttry {\n\t\t\tif (typeof window !== 'undefined' && window.parent) {\n\t\t\t\tvoid window.parent.document;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcrossorigin = true;\n\t\t}\n\t}\n\treturn crossorigin;\n}\n\n/**\n * @param {HTMLElement} node\n * @param {() => void} fn\n * @returns {() => void}\n */\nexport function add_iframe_resize_listener(node, fn) {\n\tconst computed_style = getComputedStyle(node);\n\tif (computed_style.position === 'static') {\n\t\tnode.style.position = 'relative';\n\t}\n\tconst iframe = element('iframe');\n\tiframe.setAttribute(\n\t\t'style',\n\t\t'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n\t\t\t'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'\n\t);\n\tiframe.setAttribute('aria-hidden', 'true');\n\tiframe.tabIndex = -1;\n\tconst crossorigin = is_crossorigin();\n\n\t/**\n\t * @type {() => void}\n\t */\n\tlet unsubscribe;\n\tif (crossorigin) {\n\t\tiframe.src = \"data:text/html,\";\n\t\tunsubscribe = listen(\n\t\t\twindow,\n\t\t\t'message',\n\t\t\t/** @param {MessageEvent} event */ (event) => {\n\t\t\t\tif (event.source === iframe.contentWindow) fn();\n\t\t\t}\n\t\t);\n\t} else {\n\t\tiframe.src = 'about:blank';\n\t\tiframe.onload = () => {\n\t\t\tunsubscribe = listen(iframe.contentWindow, 'resize', fn);\n\t\t\t// make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n\t\t\t// see https://github.com/sveltejs/svelte/issues/4233\n\t\t\tfn();\n\t\t};\n\t}\n\tappend(node, iframe);\n\treturn () => {\n\t\tif (crossorigin) {\n\t\t\tunsubscribe();\n\t\t} else if (unsubscribe && iframe.contentWindow) {\n\t\t\tunsubscribe();\n\t\t}\n\t\tdetach(iframe);\n\t};\n}\nexport const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'content-box'\n});\nexport const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'border-box'\n});\nexport const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton(\n\t{ box: 'device-pixel-content-box' }\n);\nexport { ResizeObserverSingleton };\n\n/**\n * @returns {void} */\nexport function toggle_class(element, name, toggle) {\n\t// The `!!` is required because an `undefined` flag means flipping the current state.\n\telement.classList.toggle(name, !!toggle);\n}\n\n/**\n * @template T\n * @param {string} type\n * @param {T} [detail]\n * @param {{ bubbles?: boolean, cancelable?: boolean }} [options]\n * @returns {CustomEvent}\n */\nexport function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * @param {string} selector\n * @param {HTMLElement} parent\n * @returns {ChildNodeArray}\n */\nexport function query_selector_all(selector, parent = document.body) {\n\treturn Array.from(parent.querySelectorAll(selector));\n}\n\n/**\n * @param {string} nodeId\n * @param {HTMLElement} head\n * @returns {any[]}\n */\nexport function head_selector(nodeId, head) {\n\tconst result = [];\n\tlet started = 0;\n\tfor (const node of head.childNodes) {\n\t\tif (node.nodeType === 8 /* comment node */) {\n\t\t\tconst comment = node.textContent.trim();\n\t\t\tif (comment === `HEAD_${nodeId}_END`) {\n\t\t\t\tstarted -= 1;\n\t\t\t\tresult.push(node);\n\t\t\t} else if (comment === `HEAD_${nodeId}_START`) {\n\t\t\t\tstarted += 1;\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t} else if (started > 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\treturn result;\n}\n/** */\nexport class HtmlTag {\n\t/**\n\t * @private\n\t * @default false\n\t */\n\tis_svg = false;\n\t/** parent for creating node */\n\te = undefined;\n\t/** html tag nodes */\n\tn = undefined;\n\t/** target */\n\tt = undefined;\n\t/** anchor */\n\ta = undefined;\n\tconstructor(is_svg = false) {\n\t\tthis.is_svg = is_svg;\n\t\tthis.e = this.n = null;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tthis.h(html);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @param {HTMLElement | SVGElement} target\n\t * @param {HTMLElement | SVGElement} anchor\n\t * @returns {void}\n\t */\n\tm(html, target, anchor = null) {\n\t\tif (!this.e) {\n\t\t\tif (this.is_svg)\n\t\t\t\tthis.e = svg_element(/** @type {keyof SVGElementTagNameMap} */ (target.nodeName));\n\t\t\t/** #7364 target for