trix_embed 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38ead3fd6cca0b10aca5f45b5602da75b8674b3c71a22ac5d9140c23ce7ceabe
4
- data.tar.gz: 95691446e65997da2a828c6bf48e714c958fc0819f81e039ea7301f717f9b342
3
+ metadata.gz: 5f7abc64715dcc1e575675138a5cf792a89a4951e27161c32862b89059ca7029
4
+ data.tar.gz: 9b806cc265a65c0392b4425b7ce66b2ce59423d46c66f890b50a2b6b48d29892
5
5
  SHA512:
6
- metadata.gz: 2d33ed333f7125d7cd932781b28b7c740859ea271d3dc00e2b5006ac12f9818408873518aa5d3c17b9be431f3c29b3103c32fb71275cf67b34af6961c2419236
7
- data.tar.gz: a86192046fc34ba9b3b69f8851de2723307a3c9d2e43856ba20eb8a4c06a5efed24f07eaeb493eb6abf8a83dcc0d63c913635f4bae1ee9d7581e48552a8b301d
6
+ metadata.gz: 7e5ae0dd08c075dba23b21d02b5a6c5f061358dd47e80960227f4c6844e7b20a68ecdda319592d0c5c4eda347abb40e5ea6e460010aee4dadfee4b176be6f3b5
7
+ data.tar.gz: ea1fe438ce1aea670dd812fd1ed39c8fce315a3f7087c2be0608d31db9d139a415431e39e2756a1c30985f69ae4cf2ac1534928d6ed0ca9c16b9eb142faaabc4
data/README.md CHANGED
@@ -1,15 +1,41 @@
1
1
  # Trix Embed
2
2
 
3
- A Stimulus controller to safely embed external media in the Trix editor.
3
+ #### Take control over what external links and embedded media is permitted in the Trix editor via copy/paste
4
+
5
+ <!-- Tocer[start]: Auto-generated, don't remove. -->
6
+
7
+ ## Table of Contents
8
+
9
+ - [Setup](#setup)
10
+ - [Features](#features)
11
+ - [Allow / Block Lists](#allow--block-lists)
12
+ - [Template Overrides](#template-overrides)
13
+ - [Basic Usage](#basic-usage)
14
+ - [Allow Lists](#allow-lists)
15
+ - [Block Lists](#block-lists)
16
+ - [Sponsors](#sponsors)
17
+ - [Developing](#developing)
18
+ - [Releasing](#releasing)
19
+ - [License](#license)
20
+
21
+ <!-- Tocer[finish]: Auto-generated, don't remove. -->
22
+
23
+ ## Dependencies
24
+
25
+ - [ActionText](https://github.com/rails/rails/tree/main/actiontext)
26
+ - [Stimulus](https://github.com/hotwired/stimulus)
27
+ - [Trix](https://github.com/basecamp/trix)
4
28
 
5
29
  ## Setup
6
30
 
7
31
  ```sh
8
- yarn add @hotwired/stimulus trix trix-embed
32
+ bundle add trix_embed
33
+ yarn add trix-embed@$(bundle show trix_embed | ruby -ne 'puts $_.split(/-/).last')
9
34
  ```
10
35
 
11
36
  ```js
12
- import 'trix'
37
+ import Trix from 'trix'
38
+ import "@rails/actiontext"
13
39
  import { Application, Controller } from '@hotwired/stimulus'
14
40
  import TrixEmbed from 'trix-embed'
15
41
 
@@ -17,18 +43,93 @@ const application = Application.start()
17
43
  TrixEmbed.initialize({ application, Controller, Trix })
18
44
  ```
19
45
 
20
- ## Usage
21
-
22
- ```html
23
- <form>
24
- <input id="content" name="content" type="hidden">
25
- <trix-editor id="editor" input="content"
26
- data-controller="trix-embed"
27
- data-action="trix-paste->trix-embed#paste"
28
- data-trix-embed-hosts-value='["example.com", "test.com"]'>
29
- </trix-editor>
30
- </form>
31
- ```
46
+ ## Features
47
+
48
+ ### Allow / Block Lists
49
+
50
+ Configure allow and/or block lists for external links and embedded media in your Trix editors.
51
+
52
+ __⚠︎ Block lists have precendence!__
53
+
54
+ - allowed link hosts
55
+ - blocked link hosts
56
+ - allowed media hosts
57
+ - blocked media hosts
58
+
59
+ _Note that you can also use wildcards `*` in any of lists._
60
+
61
+ ### Template Overrides
62
+
63
+ TODO: document...
64
+
65
+ ## Basic Usage
66
+
67
+ ### Allow Lists
68
+
69
+ - Allow everything
70
+
71
+ ```html
72
+ <form>
73
+ <input id="content" name="content" type="hidden">
74
+ <trix-editor id="editor" input="content"
75
+ data-controller="trix-embed"
76
+ data-trix-embed-allowed-link-hosts-value='["*"]'
77
+ data-trix-embed-allowed-media-hosts-value='["*"]'>
78
+ </trix-editor>
79
+ </form>
80
+ ```
81
+
82
+ - Allow links to all hosts and allow media (images, videos, etc.) from the following hosts: `vimeo.com, voomly.com, youtube.com`
83
+
84
+ ```html
85
+ <form>
86
+ <input id="content" name="content" type="hidden">
87
+ <trix-editor id="editor" input="content"
88
+ data-controller="trix-embed"
89
+ data-trix-embed-allowed-link-hosts-value='["*"]'
90
+ data-trix-embed-allowed-media-hosts-value='["vimeo.com", "voomly.com", "youtube.com"]'>
91
+ </trix-editor>
92
+ </form>
93
+ ```
94
+
95
+ ### Block Lists
96
+
97
+ - Block everything
98
+
99
+ ```html
100
+ <form>
101
+ <input id="content" name="content" type="hidden">
102
+ <trix-editor id="editor" input="content"
103
+ data-controller="trix-embed"
104
+ data-trix-embed-block-link-hosts-value='["*"]'
105
+ data-trix-embed-block-media-hosts-value='["*"]'>
106
+ </trix-editor>
107
+ </form>
108
+ ```
109
+
110
+ ...or simply.
111
+
112
+ ```html
113
+ <form>
114
+ <input id="content" name="content" type="hidden">
115
+ <trix-editor id="editor" input="content" data-controller="trix-embed">
116
+ </trix-editor>
117
+ </form>
118
+ ```
119
+
120
+ - Block links to the following hosts: `4chan.org, 8chan.net, thepiratebay.org`
121
+ and block media (images, videos, etc.) from the following hosts: `deviantart.com, imgur.com, tumblr.com`
122
+
123
+ ```html
124
+ <form>
125
+ <input id="content" name="content" type="hidden">
126
+ <trix-editor id="editor" input="content"
127
+ data-controller="trix-embed"
128
+ data-trix-embed-blocked-link-hosts-value='["4chan.org", "8chan.net", "thepiratebay.org"]'
129
+ data-trix-embed-blocked-media-hosts-value='["deviantart.com", "imgur.com", "tumblr.com"]'>
130
+ </trix-editor>
131
+ </form>
132
+ ```
32
133
 
33
134
  ## Sponsors
34
135
 
@@ -46,45 +147,17 @@ TrixEmbed.initialize({ application, Controller, Trix })
46
147
  ```sh
47
148
  git clone https://github.com/hopsoft/trix_embed.git
48
149
  cd trix_embed
49
- yarn
50
- yarn build
51
- yarn dev
150
+ bin/dev
52
151
  ```
53
- ### Docker
54
-
55
- This project supports a fully Dockerized development experience.
56
-
57
- 1. Simply run the following commands to get started.
58
-
59
- ```sh
60
- git clone -o github https://github.com/hopsoft/trix_embed.git
61
- cd trix_embed
62
- ```
63
-
64
- ```sh
65
- docker compose up -d # start the envionment (will take a few minutes on 1st run)
66
- open http://localhost:3000 # in a browser
67
- ```
68
-
69
- And, if you're using the [containers gem (WIP)](https://github.com/hopsoft/containers).
70
-
71
- ```sh
72
- containers up # start the envionment (will take a few minutes on 1st run)
73
- open http://localhost:3000 # in a browser
74
- ```
75
-
76
- 1. Edit files using your preferred tools on the host machine.
77
-
78
- 1. That's it!
79
152
 
80
153
  ## Releasing
81
154
 
82
155
  1. Run `yarn` and `bundle` to pick up the latest
83
- 1. Bump version number at `lib/trix_embed/version.rb`. Pre-release versions use `.preN`
84
- 1. Run `yarn build`
156
+ 1. Bump version numbers at `lib/trix_embed/version.rb` and `package.json` _(make sure they match)_. Pre-release versions use `.preN`
157
+ 1. Run `yarn build` - *builds both the Ruby gem and the NPM package*
85
158
  1. Commit and push changes to GitHub
86
159
  1. Run `rake release`
87
- 1. Run `yarn publish --no-git-tag-version --access public`
160
+ 1. Run `yarn publish --new-version X.X.X --no-git-tag-version --access public`
88
161
  1. Yarn will prompt you for the new version. Pre-release versions use `-preN`
89
162
  1. Commit and push changes to GitHub
90
163
  1. Create a new release on GitHub ([here](https://github.com/hopsoft/trix_embed/releases)) and generate the changelog for the stable release for it
@@ -1,22 +1,5 @@
1
- var G=Object.defineProperty,X=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var Y=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var M=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,U=(n,e)=>{for(var t in e||(e={}))Y.call(e,t)&&M(n,t,e[t]);if(P)for(var t of P(e))Z.call(e,t)&&M(n,t,e[t]);return n},N=(n,e)=>X(n,Q(e));var S=(n,e,t)=>(M(n,typeof e!="symbol"?e+"":e,t),t);var A={name:"AES-GCM",length:256},ee=!0,te=["encrypt","decrypt"];async function re(){let e=["encrypt","decrypt"];return await crypto.subtle.generateKey(A,!0,e)}async function ie(n){let e=await crypto.subtle.exportKey("jwk",n);return JSON.stringify(e)}async function O(n){let e=JSON.parse(n);return await crypto.subtle.importKey("jwk",e,A,ee,te)}async function ne(n,e){let t=new TextEncoder().encode(String(n)),i=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt(N(U({},A),{iv:i}),e,t),o={ciphertext:btoa(String.fromCharCode(...new Uint8Array(r))),iv:btoa(String.fromCharCode(...i))};return btoa(JSON.stringify(o))}async function oe(n,e){let t=JSON.parse(atob(n)),i=new Uint8Array(atob(t.ciphertext).split("").map(s=>s.charCodeAt(0))),r=new Uint8Array(atob(t.iv).split("").map(s=>s.charCodeAt(0))),o=await crypto.subtle.decrypt(N(U({},A),{iv:r}),e,i);return new TextDecoder().decode(o)}async function v(){let n=await re(),e=await ie(n);return btoa(e)}async function b(n,e=[]){let t=await O(atob(n));return Promise.all(e.map(i=>ne(i,t)))}async function K(n,e=[]){let t=await O(atob(n));return Promise.all(e.map(i=>oe(i,t)))}async function $(n=[]){let e=await v(),t=await b(e,n);return console.log(`data-trix-embed-key-value="${e}"`),console.log(`data-trix-embed-hosts-value='${JSON.stringify(t)}'`),{key:e,encryptedValues:t}}function h(n,e=t=>{}){try{let t=new URL(String(n).trim());return e&&e(t),t}catch(t){console.info(`Failed to parse URL! value='${n}']`)}return null}function V(n,e=t=>{}){let t=null;return h(n,i=>t=i.host),t&&e&&e(t),t}function se(n){let e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,r=>r.nodeValue.includes("http")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT),i;for(;i=t.nextNode();)i.nodeValue.split(/\s+/).filter(r=>r.startsWith("http")).forEach(r=>h(r,o=>{e.includes(o.href)||e.push(o.href)}));return e}function ae(n){let e=[];return n.src&&h(n.src,i=>e.push(i.href)),n.href&&h(n.href,i=>{e.includes(i.href)||e.push(i.href)}),n.querySelectorAll("[src], [href]").forEach(i=>{h(i.src||i.href,r=>{e.includes(r.href)||e.push(r.href)})}),e}function R(n,e=[]){let t=!1;return V(n,i=>t=!!e.find(r=>i.includes(r))),t}function I(n){return n.reduce((e,t)=>(V(t,i=>{e.includes(i)||e.push(i)}),e),[])}function q(n){let e=ae(n),t=se(n);return[...new Set([...e,...t])]}var D={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",heic:"image/heic",heif:"image/heif",ico:"image/x-icon",jp2:"image/jp2",jpeg:"image/jpeg",jpg:"image/jpeg",jxr:"image/vnd.ms-photo",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp"};var ce=D,le=["animate","animateMotion","animateTransform","area","audio","base","embed","feDisplacementMap","feImage","feTile","filter","font-face-uri","iframe","image","link","object","script","source","track","use","video"],de=["audio","embed","iframe","img","input","script","source","track","video","frame","frameset","object","picture","use"],F=le.concat(de);function J(n){return!!Object.values(D).find(e=>e===H(n))}function H(n){let e;if(h(n,r=>e=r),!e)return null;let t=e.pathname.lastIndexOf(".");if(!t)return null;let i=e.pathname.substring(t+1);return ce[i]}var T=class{constructor(e){S(this,"protectSubmit",e=>{let t=this.controller.formElement,i=e.target.closest("form");i&&i.action===t.action&&i.method===t.method&&i!==t&&e.preventDefault()});this.controller=e,e.element.addEventListener("trix-file-accept",t=>t.preventDefault())}protect(){if(!this.controller.formElement)return;let e=this.controller.formElement,t=this.controller.inputElement,i=`${e.method}${e.action}`;document.removeEventListener("submit",handlers[i],!0),handlers[i]=this.protectSubmit.bind(this),document.addEventListener("submit",handlers[i],!0),new MutationObserver((o,s)=>{o.forEach(a=>{var x;let{addedNodes:u,target:d,type:p}=a;switch(p){case"attributes":((x=d.closest("form"))==null?void 0:x.action)===e.action&&(d.id===t.id||d.name===t.name)&&d.remove();break;case"childList":u.forEach(l=>{var y;l.nodeType===Node.ELEMENT_NODE&&(l.tagName.match(/^form$/i)&&l.action===e.action&&l.remove(),((y=d.closest("form"))==null?void 0:y.action)===e.action&&(l.id===t.id||l.name===t.name)&&l.remove())});break}})}).observe(document.body,{attributeFilter:["id","name"],attributes:!0,childList:!0,subtree:!0})}cleanup(){let e=this.controller.element,t=this.controller.inputElement,i=this.controller.toolbarElement;t==null||t.remove(),i==null||i.remove(),e==null||e.remove()}};var E=class{constructor(e){var t;this.controller=e,this.base=this.obfuscate([location.pathname,(t=this.controller.element.closest("[id]"))==null?void 0:t.id].join("/"))}split(e){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}obfuscate(e){var r;let t=[...e].map(o=>o.charCodeAt(0));return[(r=this.split(t)[1])==null?void 0:r.reverse(),t[0]].flat().join("")}read(e){return sessionStorage.getItem(this.generateStorageKey(e))}write(e,t){return sessionStorage.setItem(this.generateStorageKey(e),t)}remove(e){return sessionStorage.removeItem(this.generateStorageKey(e))}generateStorageKey(e){let t=[...this.obfuscate(e)],[i,r]=this.split(t);return btoa(`${i}/${this.base}/${r}`)}};var me={header:"<h1></h1>",iframe:"<iframe></iframe>",image:"<img></img>",error:`
2
- <div>
3
- <h1>Copy/Paste Info</h1>
4
- <h3>The pasted content includes media from unsupported hosts.</h3>
5
-
6
- <h2>Prohibited Hosts / Domains</h2>
7
- <ul data-list="prohibited-hosts">
8
- <li>Media is only supported from allowed hosts.</li>
9
- </ul>
10
-
11
- <h2>Allowed Hosts / Domains</h2>
12
- <ul data-list="allowed-hosts">
13
- <li>Allowed hosts not configured.</li>
14
- </ul>
15
- </div>
16
- `,exception:`
17
- <div style='background-color:lightyellow; color:red; border:solid 1px red; padding:20px;'>
18
- <h1>Unhandled Exception!</h1>
19
- <p>Show a programmer the message below.</p>
20
- <pre style="background-color:darkslategray; color:whitesmoke; padding:10px;"><code></code></pre>
21
- </div>
22
- `};function z(n){let e=document.createElement("template");return e.innerHTML=me[n],e}var w=class{constructor(e){this.controller=e,this.initializeTempates()}initializeTempates(){["error","exception","header","iframe","image"].forEach(t=>this.initializeTemplate(t))}initializeTemplate(e){let t;this.controller[`has${e.charAt(0).toUpperCase()+e.slice(1)}TemplateValue`]&&(t=document.getElementById(this.controller[`${e}TemplateValue`])),this[`${e}Template`]=t||z(e)}renderHeader(e){let t=this.headerTemplate.content.firstElementChild.cloneNode(!0),i=t.tagName.match(/h1/i)?t:t.querySelector("h1");return i.innerHTML=e,t.outerHTML}renderLinks(e=["https://example.com","https://test.com"]){return e=e.filter(i=>{let r=!1;return h(i,o=>r=!0),r}).sort(),e.length?`<ul>${e.map(i=>`<li><a href='${i}'>${i}</a></li>`).join("")}</ul><br>`:void 0}renderEmbed(e="https://example.com"){let t;if(J(e)){t=this.imageTemplate.content.firstElementChild.cloneNode(!0);let i=t.tagName.match(/img/i)?t:t.querySelector("img");i.src=e}else{t=this.iframeTemplate.content.firstElementChild.cloneNode(!0);let i=t.tagName.match(/iframe/i)?t:t.querySelector("iframe");i.src=e}return t.outerHTML}renderEmbeds(e=["https://example.com","https://test.com"]){if(e!=null&&e.length)return e.map(t=>this.renderEmbed(t))}renderErrors(e=["https://example.com","https://test.com"],t=[]){if(!(e!=null&&e.length))return;let i=this.errorTemplate.content.firstElementChild.cloneNode(!0),r=i.querySelector('[data-list="prohibited-hosts"]'),o=i.querySelector('[data-list="allowed-hosts"]');if(r){let s=I(e).sort();s.length&&(r.innerHTML=s.map(a=>`<li>${a}</li>`).join(""))}return o&&t.length&&(o.innerHTML=t.map(s=>`<li>${s}</li>`).join("")),i.outerHTML}renderException(e){let t=this.exceptionTemplate.content.firstElementChild.cloneNode(!0),i=t.querySelector("code");return i.innerHTML=e.message,t.outerHTML}};var ue={Controller:null,Trix:null};function B(n=ue){var i;let{Controller:e,Trix:t}=n;return i=class extends e{async connect(){var r;this.store=new E(this),this.guard=new T(this),await this.rememberConfig(),this.paranoid&&this.guard.protect(),(r=this.toolbarElement.querySelector('[data-trix-button-group="file-tools"]'))==null||r.remove(),window.addEventListener("beforeunload",()=>this.disconnect())}disconnect(){this.paranoid&&this.guard.cleanup(),this.forgetConfig()}async paste(r){let{html:o,string:s,range:a}=r.paste,u=o||s||"",d=this.buildPastedTemplate(u),p=d.content.firstElementChild,l=this.sanitizePastedElement(p).innerHTML.trim(),y=q(p);if(!y.length)return;r.preventDefault(),this.editor.setSelectedRange(a);let C=await this.hosts,f=new w(this);try{let g=y.filter(c=>H(c));Array.from(d.content.firstElementChild.querySelectorAll("iframe")).forEach(c=>{g.includes(c.src)||g.push(c.src)});let k=g.filter(c=>R(c,C)),W=g.filter(c=>!k.includes(c)),j=y.filter(c=>!g.includes(c)),L=j.filter(c=>R(c,C)),_=j.filter(c=>!L.includes(c)),m;if(m=W,m.length&&await this.insert(f.renderErrors(m,C.sort())),m=_,m.length&&(await this.insert(f.renderHeader("Pasted URLs")),await this.insert(f.renderLinks(m),{disposition:"inline"})),m=k,m.length&&(m.length>1&&await this.insert(f.renderHeader("Embedded Media")),await this.insert(f.renderEmbeds(m))),m=L,m.length&&await this.insert(f.renderEmbeds(L)),k[0]===l||L[0]===l)return this.editor.insertLineBreak();l.length&&(await this.insert(f.renderHeader("Pasted Content",l)),this.editor.insertLineBreak(),this.insert(l,{disposition:"inline"}))}catch(g){this.insert(f.renderException(g))}}buildPastedTemplate(r){let o=document.createElement("template");return o.innerHTML=`<div>${r.trim()}</div>`,o}sanitizePastedElement(r){r=r.cloneNode(!0),r.querySelectorAll(F.join(", ")).forEach(a=>a.remove());let o=r.querySelectorAll("*"),s=r.innerHTML.match(/\r\n|\n|\r/g)||[];return(s.length?o.length/s.length:0)<=.1&&(r.innerHTML=r.innerHTML.replaceAll(/\r\n|\n|\r/g,"<br>")),r}insertAttachment(r,o={delay:0}){let{delay:s}=o;return new Promise(a=>{setTimeout(()=>{let u=new t.Attachment({content:r,contentType:"application/vnd.trix-embed"});this.editor.insertAttachment(u),a()},s)})}insertHTML(r,o={delay:0}){let{delay:s}=o;return new Promise(a=>{setTimeout(()=>{this.editor.insertHTML(r),this.editor.moveCursorInDirection("forward"),this.editor.insertLineBreak(),this.editor.moveCursorInDirection("backward"),a()},s)})}insert(r,o={delay:0,disposition:"attachment"}){let{delay:s,disposition:a}=o;return r!=null&&r.length?new Promise(u=>{setTimeout(()=>{if(typeof r=="string")return a==="inline"?this.insertHTML(r,{delay:s}).then(u):this.insertAttachment(r,{delay:s}).then(u);if(Array.isArray(r))return a==="inline"?r.reduce((d,p,x)=>d.then(this.insertHTML(p,{delay:s})),Promise.resolve()).then(u):r.reduce((d,p,x)=>d.then(this.insertAttachment(p,{delay:s})),Promise.resolve()).then(u);u()})}):Promise.resolve()}get editor(){return this.element.editor}get toolbarElement(){let r=this.element.previousElementSibling;return r!=null&&r.tagName.match(/trix-toolbar/i)?r:null}get inputElement(){return document.getElementById(this.element.getAttribute("input"))}get formElement(){return this.element.closest("form")}get paranoid(){return!!this.store.read("paranoid")}get key(){try{return JSON.parse(this.store.read("key"))[2]}catch(r){}}get hosts(){try{return K(this.key,JSON.parse(this.store.read("hosts")))}catch(r){return[]}}get reservedDomains(){return["example.com","test.com","invalid.com","example.cat","nic.example","example.co.uk"]}async rememberConfig(){let r=await v(),o=await b(r,this.reservedDomains),s=await b(r,this.hostsValue);this.store.write("key",JSON.stringify([o[0],o[1],r,o[2]])),this.element.removeAttribute("data-trix-embed-key-value"),this.store.write("hosts",JSON.stringify(s)),this.element.removeAttribute("data-trix-embed-hosts-value"),this.paranoidValue!==!1&&(this.store.write("paranoid",JSON.stringify(o.slice(3))),this.element.removeAttribute("data-trix-embed-paranoid"))}forgetConfig(){this.store.remove("key"),this.store.remove("hosts"),this.store.remove("paranoid")}},S(i,"values",{validTemplate:String,errorTemplate:String,headerTemplate:String,iframeTemplate:String,imageTemplate:String,hosts:Array,paranoid:{type:Boolean,default:!0}}),i}var he={application:null,Controller:null,Trix:null};function pe(n=he){let{application:e,Controller:t,Trix:i}=n;e.register("trix-embed",B({Controller:t,Trix:i}))}self.TrixEmbed={initialize:pe,generateKey:v,encryptValues:b,generateKeyAndEncryptValues:$};var qe=self.TrixEmbed;export{qe as default};
1
+ /*
2
+ trix-embed 0.0.4 (MIT)
3
+ Copyright © 2023 Nate Hopkins (hopsoft) <natehop@gmail.com>
4
+ */
5
+ const _0x12cdbf=_0x17dc;(function(_0x34bd8f,_0x5f33b){const _0xd015=_0x17dc,_0x4c67ba=_0x34bd8f();while(!![]){try{const _0x16602c=-parseInt(_0xd015(0x153))/0x1+parseInt(_0xd015(0x238))/0x2*(parseInt(_0xd015(0x215))/0x3)+parseInt(_0xd015(0x1ac))/0x4*(parseInt(_0xd015(0x11c))/0x5)+-parseInt(_0xd015(0x174))/0x6*(parseInt(_0xd015(0xfa))/0x7)+parseInt(_0xd015(0x1b7))/0x8*(-parseInt(_0xd015(0x1df))/0x9)+parseInt(_0xd015(0x1e1))/0xa+parseInt(_0xd015(0x1f6))/0xb*(parseInt(_0xd015(0x1e3))/0xc);if(_0x16602c===_0x5f33b)break;else _0x4c67ba['push'](_0x4c67ba['shift']());}catch(_0x544f77){_0x4c67ba['push'](_0x4c67ba['shift']());}}}(_0x4ab0,0x6a32c));var ge=Object[_0x12cdbf(0x212)],be=Object[_0x12cdbf(0x1fe)],ye=Object['getOwnPropertyDescriptors'],_=Object[_0x12cdbf(0x196)],xe=Object['prototype'][_0x12cdbf(0x131)],we=Object[_0x12cdbf(0x18e)][_0x12cdbf(0x100)],N=(_0x5b6837,_0x5052e3,_0x451882)=>_0x5052e3 in _0x5b6837?ge(_0x5b6837,_0x5052e3,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x451882}):_0x5b6837[_0x5052e3]=_0x451882,E=(_0x580a2f,_0x39ec3b)=>{const _0x40cefc=_0x12cdbf;for(var _0x52627f in _0x39ec3b||(_0x39ec3b={}))xe[_0x40cefc(0x14a)](_0x39ec3b,_0x52627f)&&N(_0x580a2f,_0x52627f,_0x39ec3b[_0x52627f]);if(_){for(var _0x52627f of _(_0x39ec3b))we[_0x40cefc(0x14a)](_0x39ec3b,_0x52627f)&&N(_0x580a2f,_0x52627f,_0x39ec3b[_0x52627f]);}return _0x580a2f;},L=(_0x3f34d7,_0x1463b3)=>be(_0x3f34d7,ye(_0x1463b3)),G=(_0x8740a8,_0x35696a,_0x51c078)=>(N(_0x8740a8,typeof _0x35696a!=_0x12cdbf(0x195)?_0x35696a+'':_0x35696a,_0x51c078),_0x51c078),X={'version':_0x12cdbf(0x1f9)},R={'name':_0x12cdbf(0x232),'length':0x100},ve=!0x0,Ee=[_0x12cdbf(0x178),_0x12cdbf(0x189)];async function Le(){const _0x2e3b2f=_0x12cdbf;let _0x2e0d9e=[_0x2e3b2f(0x178),_0x2e3b2f(0x189)];return await crypto['subtle'][_0x2e3b2f(0x1dd)](R,!0x0,_0x2e0d9e);}async function Te(_0x5d868f){const _0x57673c=_0x12cdbf;let _0x12cb5c=await crypto[_0x57673c(0x213)][_0x57673c(0x21a)](_0x57673c(0x169),_0x5d868f);return JSON[_0x57673c(0x234)](_0x12cb5c);}async function Q(_0x2a9ed6){const _0x3994bb=_0x12cdbf;let _0x53a9ad=JSON[_0x3994bb(0x13b)](_0x2a9ed6);return await crypto['subtle'][_0x3994bb(0x110)](_0x3994bb(0x169),_0x53a9ad,R,ve,Ee);}async function Se(_0x35df03,_0x27f7b0){const _0x3a42fd=_0x12cdbf;let _0x257316=new TextEncoder()[_0x3a42fd(0x17a)](String(_0x35df03)),_0x21662b=crypto[_0x3a42fd(0x1a1)](new Uint8Array(0xc)),_0x2d872b=await crypto[_0x3a42fd(0x213)][_0x3a42fd(0x178)](L(E({},R),{'iv':_0x21662b}),_0x27f7b0,_0x257316),_0x13da89={'ciphertext':btoa(String[_0x3a42fd(0x140)](...new Uint8Array(_0x2d872b))),'iv':btoa(String['fromCharCode'](..._0x21662b))};return btoa(JSON[_0x3a42fd(0x234)](_0x13da89));}async function ke(_0x269aa3,_0x39363a){const _0x507051=_0x12cdbf;let _0x5cbe07=JSON['parse'](atob(_0x269aa3)),_0xa26d28=new Uint8Array(atob(_0x5cbe07[_0x507051(0x1f2)])[_0x507051(0x18c)]('')[_0x507051(0x1e4)](_0x2cd71=>_0x2cd71[_0x507051(0xf9)](0x0))),_0x11ad61=new Uint8Array(atob(_0x5cbe07['iv'])[_0x507051(0x18c)]('')[_0x507051(0x1e4)](_0x55bd5e=>_0x55bd5e['charCodeAt'](0x0))),_0x2d328a=await crypto['subtle'][_0x507051(0x189)](L(E({},R),{'iv':_0x11ad61}),_0x39363a,_0xa26d28);return new TextDecoder()[_0x507051(0x122)](_0x2d328a);}async function T(){let _0x5d2d07=await Le(),_0x276e3c=await Te(_0x5d2d07);return btoa(_0x276e3c);}async function x(_0x54ff64,_0x12fa69=[]){const _0x3a689b=_0x12cdbf;let _0x131318=await Q(atob(_0x54ff64));return Promise[_0x3a689b(0x14b)](_0x12fa69[_0x3a689b(0x1e4)](_0x2109db=>Se(_0x2109db,_0x131318)));}async function Y(_0x4946b9,_0x4ef7a6=[]){const _0x26412e=_0x12cdbf;let _0x96e033=await Q(atob(_0x4946b9));return Promise[_0x26412e(0x14b)](_0x4ef7a6['map'](_0x408686=>ke(_0x408686,_0x96e033)));}async function Z(_0x1ea6b1=[]){const _0x23b39e=_0x12cdbf;let _0x43febf=await T(),_0x1cf157=await x(_0x43febf,_0x1ea6b1);return console['log'](_0x23b39e(0x11b)+_0x43febf+'\x22'),console[_0x23b39e(0x15f)](_0x23b39e(0x209)+JSON[_0x23b39e(0x234)](_0x1cf157)+'\x27'),{'key':_0x43febf,'encryptedValues':_0x1cf157};}var ee=_0x5910d4=>Math[_0x12cdbf(0x133)](Math[_0x12cdbf(0x1b5)]()*_0x5910d4),w=(_0xe7e72f,_0x6efeec=null)=>{const _0xf2fe11=_0x12cdbf;let _0x576d32=[..._0xe7e72f];_0x6efeec===_0xf2fe11(0x14b)&&(_0x6efeec=_0x576d32[_0xf2fe11(0x23c)]);let _0x7467c8=_0x576d32['length'],_0x3f45f6=[],_0x44c158=new Set();for(;_0x3f45f6[_0xf2fe11(0x23c)]<_0x6efeec;){let _0x55bf2d=ee(_0x7467c8);for(;_0x44c158['has'](_0x55bf2d);)_0x55bf2d=ee(_0x7467c8);_0x44c158[_0xf2fe11(0xf8)](_0x55bf2d),_0x3f45f6[_0xf2fe11(0x198)](_0x576d32[_0x55bf2d]);}return typeof _0x6efeec==_0xf2fe11(0x11a)?_0x3f45f6:_0x3f45f6[0x0];};function b(_0x56e429,_0x3b040f=_0x1b0745=>{}){const _0x568e4f=_0x12cdbf;try{let _0xb3cc2f=new URL(String(_0x56e429)['trim']());return _0xb3cc2f&&_0x3b040f&&_0x3b040f(_0xb3cc2f),_0xb3cc2f;}catch(_0x45df91){console[_0x568e4f(0x145)](_0x568e4f(0x1ad)+_0x56e429+'\x27]');}return null;}function te(_0xdd2e10,_0x2cc796=_0x48f570=>{}){const _0x2bf10b=_0x12cdbf;var _0x143cb7;let _0xfd0dcf=(_0x143cb7=b(_0xdd2e10))==null?void 0x0:_0x143cb7[_0x2bf10b(0x12f)];return _0xfd0dcf&&_0x2cc796&&_0x2cc796(_0xfd0dcf),_0xfd0dcf;}function C(_0x7697a9){const _0x8682f0=_0x12cdbf;return document['createTreeWalker'](_0x7697a9,NodeFilter[_0x8682f0(0x1dc)],_0x5e4d9d=>_0x5e4d9d['nodeValue']['match'](/http/gi)?NodeFilter[_0x8682f0(0x1c2)]:NodeFilter[_0x8682f0(0x115)]);}function Ae(_0x37f440){const _0x4d8b8e=_0x12cdbf;let _0x3ec98b=new Set(),_0x4f60c4=C(_0x37f440),_0x113b0e;for(;_0x113b0e=_0x4f60c4[_0x4d8b8e(0x216)]();)_0x113b0e[_0x4d8b8e(0x228)][_0x4d8b8e(0x18c)](/\s+/)['filter'](_0x105016=>_0x105016[_0x4d8b8e(0x161)]('http'))[_0x4d8b8e(0x229)](_0x4acb38=>b(_0x4acb38,_0x38f8cd=>_0x3ec98b[_0x4d8b8e(0xf8)](_0x38f8cd[_0x4d8b8e(0x1ee)])));return[..._0x3ec98b];}function U(_0x3b8a48){const _0x484ee2=_0x12cdbf;if(_0x3b8a48[_0x484ee2(0x1d5)]){let _0x316987=_0x3b8a48[_0x484ee2(0x1d5)]['trim']();if(_0x316987[_0x484ee2(0x23c)])return _0x316987;}if(_0x3b8a48[_0x484ee2(0x1ee)]){let _0x52579c=_0x3b8a48[_0x484ee2(0x1ee)]['trim']();if(_0x52579c[_0x484ee2(0x23c)])return _0x52579c;}return'';}function Re(_0x3c3f9e){const _0x52d9ee=_0x12cdbf;let _0xa4955f=new Set();return _0x3c3f9e[_0x52d9ee(0x1d5)]&&b(_0x3c3f9e[_0x52d9ee(0x1d5)],_0x38ab76=>_0xa4955f[_0x52d9ee(0xf8)](_0x38ab76[_0x52d9ee(0x1ee)])),_0x3c3f9e[_0x52d9ee(0x1ee)]&&b(_0x3c3f9e[_0x52d9ee(0x1ee)],_0x4345be=>_0xa4955f[_0x52d9ee(0xf8)](_0x4345be['href'])),_0x3c3f9e['querySelectorAll'](_0x52d9ee(0x109))['forEach'](_0x186631=>b(U(_0x186631),_0x301584=>_0xa4955f[_0x52d9ee(0xf8)](_0x301584[_0x52d9ee(0x1ee)]))),[..._0xa4955f];}function O(_0x4ec968,_0x41f7dd=[],_0x1e526e=[]){const _0x185edf=_0x12cdbf;let _0x38890a=te(_0x4ec968);return _0x1e526e[_0x185edf(0x1a9)]('*')||_0x1e526e[_0x185edf(0xfe)](_0x1fa016=>_0x38890a[_0x185edf(0x1d8)](_0x1fa016))?!0x1:!!(_0x41f7dd[_0x185edf(0xfe)](_0x450ee4=>_0x38890a['endsWith'](_0x450ee4))||_0x41f7dd[_0x185edf(0x1a9)]('*')&&(_0x38890a||_0x4ec968[_0x185edf(0x161)]('data:')||_0x4ec968['startsWith'](_0x185edf(0x221))||_0x4ec968[_0x185edf(0x161)](_0x185edf(0x16b))));}function re(_0x4a3735){const _0x36f3ea=_0x12cdbf;return[..._0x4a3735[_0x36f3ea(0x1be)]((_0x4bc6cc,_0x1836bb)=>(te(_0x1836bb,_0x5a972e=>_0x4bc6cc[_0x36f3ea(0xf8)](_0x5a972e)),_0x4bc6cc),new Set())];}function ie(_0x2ac3c8){let _0x4d434d=Re(_0x2ac3c8),_0x105c70=Ae(_0x2ac3c8);return[...new Set([..._0x4d434d,..._0x105c70])];}var ne={'attachment':'trix-embed/attachment'},se={'avif':_0x12cdbf(0x1a3),'bmp':'image/bmp','gif':_0x12cdbf(0x1ec),'heic':_0x12cdbf(0x1eb),'heif':'image/heif','ico':_0x12cdbf(0x1ed),'jp2':_0x12cdbf(0x15b),'jpeg':_0x12cdbf(0x1bb),'jpg':_0x12cdbf(0x1bb),'jxr':_0x12cdbf(0x11e),'png':'image/png','svg':'image/svg+xml','tif':'image/tiff','tiff':_0x12cdbf(0x1e7),'webp':'image/webp'},Ue=se,Me=[_0x12cdbf(0x15e),_0x12cdbf(0x1db),_0x12cdbf(0x21e),_0x12cdbf(0x1fc),'audio',_0x12cdbf(0x1d2),_0x12cdbf(0x1f4),_0x12cdbf(0x15a),_0x12cdbf(0x17b),_0x12cdbf(0x200),_0x12cdbf(0x19d),_0x12cdbf(0x193),_0x12cdbf(0x22b),_0x12cdbf(0x1e9),'link','object',_0x12cdbf(0x1ca),_0x12cdbf(0x10b),_0x12cdbf(0x18a),'use','video'],Ne=['audio','embed','iframe',_0x12cdbf(0x210),_0x12cdbf(0x233),_0x12cdbf(0x1ca),_0x12cdbf(0x10b),_0x12cdbf(0x18a),_0x12cdbf(0x118),_0x12cdbf(0x1cf),_0x12cdbf(0x101),_0x12cdbf(0x12c),_0x12cdbf(0x1e0),_0x12cdbf(0x186)],ae=_0x12cdbf(0x1b9),oe=_0x12cdbf(0x1f1),le=Me[_0x12cdbf(0x1b8)](Ne);function ce(_0x15f10f){const _0x4d121f=_0x12cdbf;return!!Object['values'](se)[_0x4d121f(0xfe)](_0x5155f5=>_0x5155f5===P(_0x15f10f));}function P(_0x2df8ed){const _0xc385b=_0x12cdbf;let _0xe14954;if(_0xe14954=b(_0x2df8ed),!_0xe14954)return null;let _0x212474=_0xe14954[_0xc385b(0x208)][_0xc385b(0x15d)]('.');if(!_0x212474)return null;let _0x94b9c3=_0xe14954[_0xc385b(0x208)][_0xc385b(0x219)](_0x212474+0x1);return Ue[_0x94b9c3];}var j,H,me=new Set(),Ce=ae+'[data-controller~=\x22trix-embed\x22]';function he(_0x1dc2cf){const _0x25a0df=_0x12cdbf;var _0x50ed6e;let {method:_0x455735,action:_0x45383f}=_0x1dc2cf||{};return _0x45383f=((_0x50ed6e=b(_0x45383f))==null?void 0x0:_0x50ed6e['pathname'])||_0x45383f,(_0x455735+':'+_0x45383f)[_0x25a0df(0x11d)]()['toLowerCase']();}function _0x17dc(_0x465c2b,_0x447cba){const _0x4ab083=_0x4ab0();return _0x17dc=function(_0x17dc3d,_0x1eb2ce){_0x17dc3d=_0x17dc3d-0xf8;let _0xbd6a07=_0x4ab083[_0x17dc3d];return _0xbd6a07;},_0x17dc(_0x465c2b,_0x447cba);}function ue(_0x1d766c,_0x1c4eea){const _0x4d98ba=_0x12cdbf;if(!_0x1d766c)return;let _0x437df4=he(_0x1d766c);me[_0x4d98ba(0xf8)]({'key':_0x437df4,'form':_0x1d766c,'input':_0x1c4eea});}function Oe(_0x6ac4a5){const _0x104578=_0x12cdbf;var _0x486c61;let _0x1f0168=he(_0x6ac4a5),_0x896732=[...me]['filter'](_0x385987=>_0x385987[_0x104578(0x1c4)]===_0x1f0168);if(!_0x896732[_0x104578(0x23c)])return!0x0;if(_0x6ac4a5[_0x104578(0x148)])return!0x1;if(_0x6ac4a5[_0x104578(0x179)](Ce))return!0x0;let _0xb3a374=new FormData(_0x6ac4a5),_0x54a4c8=((_0x486c61=b(_0x6ac4a5[_0x104578(0x223)]))==null?void 0x0:_0x486c61[_0x104578(0x1de)])||new URLSearchParams();return!_0x896732['map'](_0x5826d7=>_0x5826d7[_0x104578(0x233)])['map'](_0x53798d=>!(_0x53798d[_0x104578(0x16c)]&&(_0xb3a374[_0x104578(0x1ea)](_0x53798d[_0x104578(0x16c)])||_0x54a4c8[_0x104578(0x1ea)](_0x53798d[_0x104578(0x16c)]))||_0x53798d['id']&&(_0xb3a374[_0x104578(0x1ea)](_0x53798d['id'])||_0x54a4c8['has'](_0x53798d['id']))))['includes'](!0x1);}function de(_0x1ef7d1){const _0xa8b41c=_0x12cdbf;Oe(_0x1ef7d1[_0xa8b41c(0x20a)])||_0x1ef7d1['preventDefault']();}function F(_0x4f4cab){const _0x478824=_0x12cdbf;_0x4f4cab[_0x478824(0x17e)](_0x478824(0x124),de,!0x0),_0x4f4cab[_0x478824(0x19b)](_0x478824(0x124),de,!0x0);}function Pe(){const _0x26f7dc=_0x12cdbf;if(j)return;let _0x4fdd1a=Document[_0x26f7dc(0x18e)][_0x26f7dc(0x1f7)];j={'value':function(){const _0x5f558d=_0x26f7dc;let _0x57eefc=_0x4fdd1a['apply'](this,arguments);try{String(arguments[0x0])[_0x5f558d(0x1a6)]()===_0x5f558d(0x170)&&F(_0x57eefc);}catch(_0x3de65a){}return _0x57eefc;},'configurable':!0x1},Object[_0x26f7dc(0x212)](Document[_0x26f7dc(0x18e)],_0x26f7dc(0x1f7),j);}function D(_0x21f23c=0x0){const _0x537034=_0x12cdbf;if(!document[_0x537034(0x194)]&&_0x21f23c<0xa)return setTimeout(()=>D(_0x21f23c+0x1),0x32);H||(H=new MutationObserver(_0x5544aa=>_0x5544aa[_0x537034(0x229)](_0x3e4209=>_0x3e4209['addedNodes']['forEach'](_0x305e6a=>{_0x305e6a instanceof HTMLFormElement&&F(_0x305e6a);}))),H['observe'](document['body'],{'childList':!0x0,'subtree':!0x0}));}addEventListener(_0x12cdbf(0x1ae),()=>D()),Pe(),D(),document['querySelectorAll'](_0x12cdbf(0x1d7))[_0x12cdbf(0x229)](_0x13b127=>F(_0x13b127));function _0x4ab0(){const _0x34cff9=['searchParams','1149777VTtQqo','picture','8680720ERAnKK','toLowerCase','9012GIIpBV','map','read','[id]','image/tiff','www.embed.localhost','image','has','image/heic','image/gif','image/x-icon','href','big','rememberConfig','action-text-attachment','ciphertext','inputElement','embed','prohibited','15620AvRbnO','createElement','data-trix-embed-prohibited','0.0.4','firstElementChild','Content\x20includes\x20links\x20or\x20media\x20from\x20restricted\x20protocols\x20or\x20prohibited\x20hosts.','area','insertLineBreak','defineProperties','allowedHosts','feTile','formElement','extractLabelFromElement','size','tagName','toolbar','obfuscate','flat','pathname','data-trix-embed-hosts-value=\x27','target','alt','textContent','error','<br>','address','img','Prohibited\x20Link:','defineProperty','subtle','TrixEmbed','3vdMcbG','nextNode','setSelectedRange','warning','substring','exportKey','allowpaymentrequest','finally','insertAttachment','animateTransform','hostsValueDescriptors','sort','news:','link','action','Prohibited\x20Hosts','inline','https://example.com','createTemplateElement','nodeValue','forEach','loading','iframe','div','blockedHosts','[data-trix-action=\x22link\x22]','<li>Not\x20configured</li>','trix-embed','\x0a\x20\x20\x20\x20<div\x20data-trix-embed\x20data-trix-embed-warning>\x0a\x20\x20\x20\x20\x20\x20<h1>{{header}}</h1>\x0a\x20\x20\x20\x20\x20\x20<h3>{{subheader}}</h3>\x0a\x0a\x20\x20\x20\x20\x20\x20<h2>{{prohibited.header}}</h2>\x0a\x20\x20\x20\x20\x20\x20<ul>{{prohibited.hosts}}</ul>\x0a\x0a\x20\x20\x20\x20\x20\x20<h2>{{allowed.header}}</h2>\x0a\x20\x20\x20\x20\x20\x20<ul>{{allowed.hosts}}</ul>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20','AES-GCM','input','stringify','querySelectorAll','element','attachment','197092jCDOth','sanitizePastedElement','paste','xml:lang','length','http','Copy/Paste\x20Warning','Value','add','charCodeAt','32312lvFTBA','insertNewlines','replace','sub','find','previousElementSibling','propertyIsEnumerable','frameset','beforeunload','<li>','HostsValue','string','https://test.com','replaceAll','www.trix.test','[src],\x20[href]','(Embedded\x20Above)','source','trix.embed.test','allowedMediaHosts','embed.localhost','editor','importKey','blockquote','resolve','title','Prohibited\x20URL:','FILTER_SKIP','embedded','figcaption','video','renderEmbed','number','data-trix-embed-key-value=\x22','3105qRpyNl','trim','image/vnd.ms-photo','Prohibited\x20Media:','allowedLinkHosts','del','decode','ceil','submit','beforeFetchResponse','<a\x20href=\x27{{url}}\x27>{{label}}</a>','reservedDomains','default','referrerpolicy','template','</div>','object','dfn','securityHosts','host','kbd','hasOwnProperty','obscurityHosts','floor','trix.test','sup','sgid','\x0a\x20\x20\x20\x20<div\x20data-trix-embed>\x0a\x20\x20\x20\x20\x20\x20<img\x20src=\x27{{src}}\x27\x20loading=\x27lazy\x27></img>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20','data-trix-embed','connect','reconnect','parse','Allowed\x20Media:','removeItem','small','filesize','fromCharCode','controller','closest','data-trix-embed-warning','time','info','abbr','blockedMediaHosts','trixEmbedPasting','trix-paste','call','all','span','www.embed.local','data-trix-embed-paranoid-value','match','render','strong','getAttribute','793277JZVkhH','cite','disconnect','onBeforeUnload','innerHTML','figure','</li>','feDisplacementMap','image/jp2','replacement','lastIndexOf','animate','log','content','startsWith','then','join','guard','data-controller','ins','data-trix-embed-error','TemplateValue','jwk','protect','tel:','name','lang','catch','write','FORM','caption','www.embed.test','embed.test','804amQYjj','renderWarnings','allowfullscreen','All','encrypt','querySelector','encode','feImage','www.trix.localhost','Failed\x20to\x20get\x20\x27','removeEventListener','Unhandled\x20Exception!','pre','toolbarElement','trix-file-accept','onBeforeFetchResponse','generateStorageKey','replaceWith','use','forgetConfig','cloneNode','decrypt','track','trix.invalid','split','templates','prototype','embed.example','getElementById','preventDefault','paranoid','font-face-uri','body','symbol','getOwnPropertySymbols','renderError','push','sanitize','remove','addEventListener','store','filter','trix.localhost','embed.invalid','valueDescriptorMap','getRandomValues','sandbox','image/avif','[data-trix-button-group=\x22file-tools\x22]','previewable','toUpperCase','www.embed.example','<div>','includes','initializeTemplate','setAttribute','2092LKvzmA','Failed\x20to\x20parse\x20URL!\x20value=\x27','load','\x0a\x20\x20\x20\x20<div\x20data-trix-embed>\x0a\x20\x20\x20\x20\x20\x20<iframe\x20src=\x27{{src}}\x27\x20loading=\x27lazy\x27\x20referrerpolicy=\x27no-referrer\x27\x20scrolling=\x27no\x27></iframe>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20','removeAttribute','www.trix.invalid','presentation','data-trix-embed-','bind','random','insertHTML','32lMqWJk','concat','trix-editor','www.trix.example','image/jpeg','slice','data-blob-url-template','reduce','turbo:before-fetch-response','replacements','blockedLinkHosts','FILTER_ACCEPT','insert','key','height','code','initializeTempates','values','createAttachment','script','preventAttachments','setItem','reverse','onPaste','frame','filename','acronym','base','isArray','renderEmbeds','src','attributes','form','endsWith','register','www.trix.local','animateMotion','SHOW_TEXT','generateKey'];_0x4ab0=function(){return _0x34cff9;};return _0x4ab0();}var S=class{constructor(_0x5a8783){const _0x19d70f=_0x12cdbf;this[_0x19d70f(0x141)]=_0x5a8783;}[_0x12cdbf(0x1cb)](){const _0x1271de=_0x12cdbf;var _0x48c5ee,_0x338fa6,_0x3aab99,_0x44206c,_0x7b2c9;(_0x48c5ee=this[_0x1271de(0x10f)])==null||_0x48c5ee[_0x1271de(0x1b0)]('data-direct-upload-url'),(_0x338fa6=this[_0x1271de(0x10f)])==null||_0x338fa6['removeAttribute'](_0x1271de(0x1bd)),(_0x3aab99=this[_0x1271de(0x10f)])==null||_0x3aab99[_0x1271de(0x19b)](_0x1271de(0x182),_0x1f09b5=>_0x1f09b5[_0x1271de(0x191)](),!0x0),(_0x7b2c9=(_0x44206c=this[_0x1271de(0x205)])==null?void 0x0:_0x44206c[_0x1271de(0x179)](_0x1271de(0x1a4)))==null||_0x7b2c9['remove']();}async['preventLinks'](){const _0x3ff850=_0x12cdbf;var _0x53fd85,_0x5b3e6a;let _0x1c08b6=await this[_0x3ff850(0x141)][_0x3ff850(0x120)];!(await this[_0x3ff850(0x141)][_0x3ff850(0x1c1)])['length']&&_0x1c08b6[_0x3ff850(0x1a9)]('*')||(_0x5b3e6a=(_0x53fd85=this[_0x3ff850(0x205)])==null?void 0x0:_0x53fd85[_0x3ff850(0x179)](_0x3ff850(0x22e)))==null||_0x5b3e6a[_0x3ff850(0x19a)]();}[_0x12cdbf(0x16a)](_0x1659ee=0x0){const _0x2c0b5f=_0x12cdbf;if(!this[_0x2c0b5f(0x205)]&&_0x1659ee<0xa)return setTimeout(()=>this[_0x2c0b5f(0x16a)](_0x1659ee+0x1),0x19);this['preventAttachments'](),this['preventLinks'](),this[_0x2c0b5f(0x1d7)]&&ue(this[_0x2c0b5f(0x1d7)],this['input']);}get['editor'](){return this['controller']['element'];}get[_0x12cdbf(0x205)](){const _0x30a9f7=_0x12cdbf;return this[_0x30a9f7(0x141)][_0x30a9f7(0x181)];}get[_0x12cdbf(0x1d7)](){const _0x5a5981=_0x12cdbf;return this[_0x5a5981(0x141)][_0x5a5981(0x201)];}get[_0x12cdbf(0x233)](){const _0x42a1d7=_0x12cdbf;return this[_0x42a1d7(0x141)][_0x42a1d7(0x1f3)];}},k=class{constructor(_0x546bf3){const _0x288aab=_0x12cdbf;var _0x5aa9a1,_0x34f32a,_0xc70288;let _0x7f7ef7=[location[_0x288aab(0x208)],(_0x34f32a=b((_0x5aa9a1=_0x546bf3['formElement'])==null?void 0x0:_0x5aa9a1[_0x288aab(0x223)]))==null?void 0x0:_0x34f32a['pathname'],(_0xc70288=_0x546bf3[_0x288aab(0x236)][_0x288aab(0x142)](_0x288aab(0x1e6)))==null?void 0x0:_0xc70288['id']];this['controller']=_0x546bf3,this['identifier']=_0x7f7ef7[_0x288aab(0x19d)](_0x355494=>_0x355494&&_0x355494['length'])[_0x288aab(0x163)]('/')[_0x288aab(0xfc)](/\/{2,}/g,'/'),this[_0x288aab(0x1d2)]=this[_0x288aab(0x206)](this['identifier']);}['split'](_0x1acc36){const _0x409f30=_0x12cdbf;let _0x4c7e39=Math[_0x409f30(0x123)](_0x1acc36[_0x409f30(0x23c)]/0x2);return[_0x1acc36['slice'](0x0,_0x4c7e39),_0x1acc36[_0x409f30(0x1bc)](_0x4c7e39)];}[_0x12cdbf(0x206)](_0x1afa9c){const _0x1ef5a2=_0x12cdbf;var _0x1778ff;let _0x135f63=[..._0x1afa9c][_0x1ef5a2(0x1e4)](_0x3c99ed=>_0x3c99ed[_0x1ef5a2(0xf9)](0x0));return[(_0x1778ff=this[_0x1ef5a2(0x18c)](_0x135f63)[0x1])==null?void 0x0:_0x1778ff[_0x1ef5a2(0x1cd)](),_0x135f63[0x0]][_0x1ef5a2(0x207)]()[_0x1ef5a2(0x163)]('');}[_0x12cdbf(0x1e5)](_0x3eb52a){const _0x182ade=_0x12cdbf;return sessionStorage['getItem'](this[_0x182ade(0x184)](_0x3eb52a));}[_0x12cdbf(0x16f)](_0x2eca6b,_0x379b0b){const _0x61044f=_0x12cdbf;return sessionStorage[_0x61044f(0x1cc)](this[_0x61044f(0x184)](_0x2eca6b),_0x379b0b);}[_0x12cdbf(0x19a)](_0x236ae7){const _0x3ffaf1=_0x12cdbf;return sessionStorage[_0x3ffaf1(0x13d)](this[_0x3ffaf1(0x184)](_0x236ae7));}[_0x12cdbf(0x184)](_0x24ba11){const _0x5152ed=_0x12cdbf;let _0x38975a=[...this[_0x5152ed(0x206)](_0x24ba11)],[_0x3bd51c,_0x294c1d]=this[_0x5152ed(0x18c)](_0x38975a);return btoa(_0x3bd51c+'/'+this[_0x5152ed(0x1d2)]+'/'+_0x294c1d);}},V={'link':_0x12cdbf(0x126),'embedded':'\x0a\x20\x20\x20\x20<span>\x0a\x20\x20\x20\x20\x20\x20<strong>{{label}}</strong>\x0a\x20\x20\x20\x20\x20\x20<span>{{description}}</span>\x0a\x20\x20\x20\x20\x20\x20<del>{{url}}</del>\x0a\x20\x20\x20\x20</span>\x0a\x20\x20','prohibited':'\x0a\x20\x20\x20\x20<span>\x0a\x20\x20\x20\x20\x20\x20<strong>{{label}}</strong>\x0a\x20\x20\x20\x20\x20\x20<span>{{description}}</span>\x0a\x20\x20\x20\x20\x20\x20<del>{{url}}</del>\x0a\x20\x20\x20\x20</span>\x0a\x20\x20','error':'\x0a\x20\x20\x20\x20<div\x20data-trix-embed\x20data-trix-embed-error>\x0a\x20\x20\x20\x20\x20\x20<h1>{{header}}</h1>\x0a\x20\x20\x20\x20\x20\x20<pre><code>{{error.stack}}</code></pre>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20','iframe':_0x12cdbf(0x1af),'image':_0x12cdbf(0x137),'warning':_0x12cdbf(0x231)},je=[oe,'a',_0x12cdbf(0x146),_0x12cdbf(0x1d1),_0x12cdbf(0x20f),'b',_0x12cdbf(0x1ef),_0x12cdbf(0x111),'br',_0x12cdbf(0x154),_0x12cdbf(0x1c6),'dd',_0x12cdbf(0x121),_0x12cdbf(0x12d),_0x12cdbf(0x22c),'dl','dt','em',_0x12cdbf(0x117),_0x12cdbf(0x158),'h1','h2','h3','h4','h5','h6','hr','i',_0x12cdbf(0x22b),_0x12cdbf(0x210),_0x12cdbf(0x166),_0x12cdbf(0x130),'li','ol','p',_0x12cdbf(0x180),'samp',_0x12cdbf(0x13e),_0x12cdbf(0x14c),_0x12cdbf(0x151),_0x12cdbf(0xfd),_0x12cdbf(0x135),_0x12cdbf(0x144),'tt','ul','var'],He=['abbr','allow',_0x12cdbf(0x176),_0x12cdbf(0x21b),_0x12cdbf(0x20b),_0x12cdbf(0x171),_0x12cdbf(0x154),'content-type','credentialless','csp',_0x12cdbf(0x138),_0x12cdbf(0x167),_0x12cdbf(0x1f8),_0x12cdbf(0x143),'datetime',_0x12cdbf(0x1d0),_0x12cdbf(0x13f),_0x12cdbf(0x1c5),_0x12cdbf(0x1ee),_0x12cdbf(0x16d),_0x12cdbf(0x22a),_0x12cdbf(0x16c),_0x12cdbf(0x1b2),_0x12cdbf(0x1a5),_0x12cdbf(0x129),_0x12cdbf(0x1a2),_0x12cdbf(0x136),_0x12cdbf(0x1d5),'srcdoc',_0x12cdbf(0x113),'url','width',_0x12cdbf(0x23b)],A=class{constructor(_0x11989c){const _0x5f2d63=_0x12cdbf;this['controller']=_0x11989c,this[_0x5f2d63(0x1c7)]();}['sanitize'](_0x41395e){const _0x485ee7=_0x12cdbf;let _0x54378a=document[_0x485ee7(0x1f7)](_0x485ee7(0x12a));_0x54378a[_0x485ee7(0x157)]=_0x485ee7(0x1a8)+_0x41395e+_0x485ee7(0x12b);let _0x4e2a1f=_0x54378a[_0x485ee7(0x160)][_0x485ee7(0x1fa)];return[_0x4e2a1f][_0x485ee7(0x1b8)]([..._0x4e2a1f[_0x485ee7(0x235)]('*')])['forEach'](_0x583644=>{const _0x1177fe=_0x485ee7;je[_0x1177fe(0x1a9)](_0x583644[_0x1177fe(0x204)]['toLowerCase']())?[..._0x583644[_0x1177fe(0x1d6)]][_0x1177fe(0x229)](_0x5a970c=>{const _0x53c762=_0x1177fe;He[_0x53c762(0x1a9)](_0x5a970c['name'][_0x53c762(0x1e2)]())||_0x583644[_0x53c762(0x1b0)](_0x5a970c[_0x53c762(0x16c)]);}):_0x583644['remove']();}),_0x4e2a1f[_0x485ee7(0x157)];}[_0x12cdbf(0x1c7)](){this['templates']=V,Object['keys'](V)['forEach'](_0x3ec14a=>this['initializeTemplate'](_0x3ec14a));}[_0x12cdbf(0x1aa)](_0xe4078){const _0xc4654c=_0x12cdbf;var _0x271706,_0x287c11;let _0x2cbc14=_0xe4078+_0xc4654c(0x168),_0x44c57a=this[_0xc4654c(0x141)][_0x2cbc14],_0x25e3e2=_0x44c57a?(_0x287c11=(_0x271706=document['getElementById'](_0x44c57a))==null?void 0x0:_0x271706['innerHTML'])==null?void 0x0:_0x287c11[_0xc4654c(0x11d)]():null;return this[_0xc4654c(0x141)][_0x2cbc14]=null,_0x25e3e2&&(this[_0xc4654c(0x18d)][_0xe4078]=_0x25e3e2),this['templates'][_0xe4078];}[_0x12cdbf(0x150)](_0x8a1db,_0x1ce989={}){const _0x44a01a=_0x12cdbf;return this[_0x44a01a(0x18d)][_0x8a1db]['replace'](/{{(.*?)}}/g,(_0x36b412,_0x564917)=>_0x564917[_0x44a01a(0x18c)]('.')[_0x44a01a(0x1be)]((_0x5342d8,_0x44c44a)=>_0x5342d8[_0x44c44a],_0x1ce989));}[_0x12cdbf(0x119)](_0x5d91ac=_0x12cdbf(0x226)){const _0x45f30c=_0x12cdbf;let _0x1dd45a=ce(_0x5d91ac)?this[_0x45f30c(0x150)](_0x45f30c(0x1e9),{'src':_0x5d91ac}):this[_0x45f30c(0x150)](_0x45f30c(0x22b),{'src':_0x5d91ac});return this[_0x45f30c(0x199)](_0x1dd45a);}['renderEmbeds'](_0x457186=[_0x12cdbf(0x226),_0x12cdbf(0x106)]){const _0x1a7093=_0x12cdbf;if(_0x457186!=null&&_0x457186[_0x1a7093(0x23c)])return _0x457186[_0x1a7093(0x1e4)](_0x1adac8=>this['renderEmbed'](_0x1adac8));}[_0x12cdbf(0x175)](_0x24503f=[_0x12cdbf(0x226),_0x12cdbf(0x106)],_0x51db71=[],_0x39d4ec=[]){const _0x431ef9=_0x12cdbf;if(_0x24503f!=null&&_0x24503f[_0x431ef9(0x23c)])return _0x51db71=[..._0x51db71][_0x431ef9(0x220)](),_0x51db71[_0x431ef9(0x1a9)]('*')&&(_0x51db71=[_0x431ef9(0x177)]),_0x39d4ec=[...new Set([..._0x39d4ec,...re(_0x24503f)])][_0x431ef9(0x220)](),_0x39d4ec['includes']('*')&&(_0x39d4ec=['All']),this[_0x431ef9(0x150)](_0x431ef9(0x218),{'header':_0x431ef9(0x23e),'subheader':_0x431ef9(0x1fb),'prohibited':{'header':_0x431ef9(0x224),'hosts':_0x39d4ec['length']?_0x39d4ec[_0x431ef9(0x1e4)](_0x290e09=>_0x431ef9(0x103)+_0x290e09+_0x431ef9(0x159))[_0x431ef9(0x163)](''):_0x431ef9(0x22f)},'allowed':{'header':'Allowed\x20Hosts','hosts':_0x51db71[_0x431ef9(0x23c)]?_0x51db71[_0x431ef9(0x1e4)](_0x5749e7=>_0x431ef9(0x103)+_0x5749e7+_0x431ef9(0x159))[_0x431ef9(0x163)](''):_0x431ef9(0x22f)}});}['renderError'](_0x1e344b){const _0x1279e7=_0x12cdbf;return this[_0x1279e7(0x150)]('error',{'header':_0x1279e7(0x17f),'subheader':'Report\x20this\x20problem\x20to\x20a\x20software\x20engineer.','error':_0x1e344b});}};function pe(_0x2fdcde={'Controller':null,'Trix':null}){const _0x3a5699=_0x12cdbf;var _0x38fb47;let {Controller:_0x15e84d,Trix:_0x3c92f6}=_0x2fdcde;return _0x38fb47=class extends _0x15e84d{[_0x3a5699(0x139)](){const _0x496932=_0x3a5699;this['onPaste']=this[_0x496932(0x23a)][_0x496932(0x1b4)](this),this[_0x496932(0x236)][_0x496932(0x19b)]('trix-paste',this[_0x496932(0x1ce)],!0x0),this[_0x496932(0x183)]=this[_0x496932(0x125)][_0x496932(0x1b4)](this),addEventListener(_0x496932(0x1bf),this[_0x496932(0x183)],!0x0),this['onBeforeUnload']=this[_0x496932(0x187)][_0x496932(0x1b4)](this),addEventListener('beforeunload',this[_0x496932(0x156)],!0x0),this[_0x496932(0x19c)]=new k(this),this[_0x496932(0x164)]=new S(this),!this[_0x496932(0x1c4)]&&this[_0x496932(0x1f0)]()[_0x496932(0x162)](()=>{const _0x5a4e99=_0x496932;this[_0x5a4e99(0x192)]&&this[_0x5a4e99(0x164)][_0x5a4e99(0x16a)]();});}[_0x3a5699(0x13a)](){const _0xc75235=_0x3a5699;let _0x5e5937=this[_0xc75235(0x236)]['getAttribute'](_0xc75235(0x165))||'',_0x2e0adf=new Set(_0x5e5937[_0xc75235(0x18c)]('\x20'));_0x2e0adf[_0xc75235(0xf8)](_0xc75235(0x230)),this['element'][_0xc75235(0x1ab)](_0xc75235(0x165),[..._0x2e0adf][_0xc75235(0x163)]('\x20')[_0xc75235(0x11d)]());}[_0x3a5699(0x155)](){const _0x46f234=_0x3a5699;this[_0x46f234(0x236)]['removeEventListener'](_0x46f234(0x149),this[_0x46f234(0x1ce)],!0x0),removeEventListener('turbo:before-fetch-response',this[_0x46f234(0x183)],!0x0),removeEventListener(_0x46f234(0x102),this[_0x46f234(0x156)],!0x0),this['reconnect']();}[_0x3a5699(0x125)](_0xe99b20){const _0x22e0c1=_0x3a5699;try{_0xe99b20[_0x22e0c1(0x20a)]['querySelectorAll'](_0x22e0c1(0x1b9))[_0x22e0c1(0x1a9)](this['element'])&&this[_0x22e0c1(0x187)]();}catch(_0x197237){}}async['paste'](_0x5620e7){const _0x5a8302=_0x3a5699;this['formElement']&&(this[_0x5a8302(0x201)][_0x5a8302(0x148)]=!0x0);try{let {html:_0x5c09b3,string:_0x43856c,range:_0x15f76d}=_0x5620e7[_0x5a8302(0x23a)],_0x36b6fb=_0x5c09b3||_0x43856c||'',_0x4da7d6=this[_0x5a8302(0x227)](_0x36b6fb),_0x96b4cf=ie(_0x4da7d6);if(!_0x96b4cf[_0x5a8302(0x23c)])return;_0x5620e7[_0x5a8302(0x191)](),this[_0x5a8302(0x10f)][_0x5a8302(0x217)](_0x15f76d);let _0xbcfb92=new A(this);try{let _0x4f514f=await this[_0x5a8302(0x10d)],_0x3c7d42=await this[_0x5a8302(0x147)],_0x19411c=new Set(_0x96b4cf[_0x5a8302(0x19d)](_0x368938=>P(_0x368938)));[..._0x4da7d6['querySelectorAll']('iframe')][_0x5a8302(0x229)](_0x58df39=>_0x19411c[_0x5a8302(0xf8)](_0x58df39[_0x5a8302(0x1d5)])),_0x19411c=[..._0x19411c];let _0x586e7b=_0x19411c[_0x5a8302(0x19d)](_0x3d88c6=>O(_0x3d88c6,_0x4f514f,_0x3c7d42)),_0x59b30c=_0x19411c[_0x5a8302(0x19d)](_0x3586d4=>!_0x586e7b[_0x5a8302(0x1a9)](_0x3586d4)),_0x534f7e=await this[_0x5a8302(0x120)],_0x2359ef=await this[_0x5a8302(0x1c1)],_0x4e938c=_0x96b4cf['filter'](_0x3e0636=>!_0x19411c['includes'](_0x3e0636)),_0x192410=_0x4e938c['filter'](_0x19b8a2=>O(_0x19b8a2,_0x534f7e,_0x2359ef)),_0x274e93=_0x4e938c[_0x5a8302(0x19d)](_0x386149=>!_0x192410['includes'](_0x386149));if(_0x59b30c[_0x5a8302(0x23c)]||_0x274e93[_0x5a8302(0x23c)]){let _0x21f70c=[...new Set([..._0x59b30c,..._0x274e93])],_0x1612bc=[...new Set([..._0x4f514f,..._0x534f7e])][_0x5a8302(0x19d)](_0x366a14=>!this['reservedDomains'][_0x5a8302(0x1a9)](_0x366a14)),_0x4c69c3=[...new Set([..._0x3c7d42,..._0x2359ef])]['filter'](_0x45a169=>!this[_0x5a8302(0x127)][_0x5a8302(0x1a9)](_0x45a169));console[_0x5a8302(0x15f)](_0x5a8302(0x1ff),_0x1612bc),console[_0x5a8302(0x15f)](_0x5a8302(0x22d),_0x4c69c3),await this[_0x5a8302(0x1c3)](_0xbcfb92[_0x5a8302(0x175)](_0x21f70c,_0x1612bc,_0x4c69c3));}if(_0x586e7b[_0x5a8302(0x23c)]&&await this[_0x5a8302(0x1c3)](_0xbcfb92[_0x5a8302(0x1d4)](_0x586e7b)),_0x96b4cf[_0x5a8302(0x23c)]===0x1&&_0x586e7b[_0x5a8302(0x23c)]===0x1)return;let _0x488b3e=this[_0x5a8302(0x239)](_0x4da7d6,{'renderer':_0xbcfb92,'validMediaURLs':_0x586e7b,'validLinkURLs':_0x192410})['innerHTML'][_0x5a8302(0x11d)]();_0x488b3e[_0x5a8302(0x23c)]&&await this[_0x5a8302(0x1c3)](_0x488b3e,{'disposition':_0x5a8302(0x225)});}catch(_0x196b5b){this[_0x5a8302(0x1c3)](_0xbcfb92[_0x5a8302(0x197)](_0x196b5b));}}finally{this[_0x5a8302(0x201)]&&delete this['formElement'][_0x5a8302(0x148)];}}[_0x3a5699(0x227)](_0xca9736){const _0x2ae319=_0x3a5699;let _0xf2fee3=document[_0x2ae319(0x1f7)](_0x2ae319(0x12a));return _0xf2fee3[_0x2ae319(0x157)]=_0x2ae319(0x1a8)+_0xca9736['trim']()+'</div>',_0xf2fee3[_0x2ae319(0x160)][_0x2ae319(0x1fa)];}[_0x3a5699(0x202)](_0x25e100,_0x43222d={'default':null}){const _0x344d2d=_0x3a5699;let _0x2c3671=_0x25e100[_0x344d2d(0x113)];return _0x2c3671&&_0x2c3671[_0x344d2d(0x23c)]||(_0x2c3671=_0x25e100[_0x344d2d(0x20c)]['trim'](),_0x2c3671&&_0x2c3671['length'])?_0x2c3671:_0x43222d[_0x344d2d(0x128)];}['sanitizePastedElement'](_0x5cb9d0,_0x2adf68={'renderer':null,'validMediaURLs':[],'validLinkURLs':[]}){const _0x1eb8f1=_0x3a5699;let {renderer:_0x2601cd,validMediaURLs:_0x26e694,validLinkURLs:_0xab85e}=_0x2adf68;_0x5cb9d0=_0x5cb9d0[_0x1eb8f1(0x188)](!0x0);let _0x10bdec=C(_0x5cb9d0),_0x1378ea=[],_0x4ba3f0;for(;_0x4ba3f0=_0x10bdec[_0x1eb8f1(0x216)]();)_0x4ba3f0[_0x1eb8f1(0x1c0)]=_0x4ba3f0[_0x1eb8f1(0x1c0)]||new Set(),_0x1378ea[_0x1eb8f1(0x198)](_0x4ba3f0),_0x4ba3f0['nodeValue'][_0x1eb8f1(0x18c)](/\s+/)[_0x1eb8f1(0x19d)](_0x5ab6bf=>_0x5ab6bf[_0x1eb8f1(0x161)](_0x1eb8f1(0x23d)))[_0x1eb8f1(0x229)](_0x3f54a3=>{const _0x3e59bf=_0x1eb8f1;var _0x5a056a;let _0x2ee716=(_0x5a056a=b(_0x3f54a3))==null?void 0x0:_0x5a056a[_0x3e59bf(0x1ee)],_0x516f2f=_0xab85e[_0x3e59bf(0x1a9)](_0x2ee716)||_0xab85e[_0x3e59bf(0x1a9)](_0x2ee716)?_0x2601cd[_0x3e59bf(0x150)](_0x3e59bf(0x222),{'url':_0x2ee716,'label':_0x2ee716}):_0x2601cd[_0x3e59bf(0x150)](_0x3e59bf(0x1f5),{'url':_0x2ee716,'label':_0x3e59bf(0x114),'description':''});_0x4ba3f0['replacements'][_0x3e59bf(0xf8)]({'match':_0x3f54a3,'replacement':_0x516f2f});});return _0x1378ea[_0x1eb8f1(0x229)](_0x38846d=>{const _0x36470b=_0x1eb8f1;if(!_0x38846d[_0x36470b(0x1c0)][_0x36470b(0x203)])return;let _0x3c4b1f=_0x38846d[_0x36470b(0x228)];[..._0x38846d[_0x36470b(0x1c0)]][_0x36470b(0x220)]((_0x25c5b7,_0x3e527e)=>_0x3e527e[_0x36470b(0x14f)][_0x36470b(0x23c)]-_0x25c5b7[_0x36470b(0x14f)][_0x36470b(0x23c)])['forEach'](_0x256106=>_0x3c4b1f=_0x3c4b1f['replaceAll'](_0x256106[_0x36470b(0x14f)],_0x256106[_0x36470b(0x15c)])),_0x38846d[_0x36470b(0x185)](this[_0x36470b(0x227)](_0x3c4b1f));}),_0x5cb9d0[_0x1eb8f1(0x235)]('a')['forEach'](_0x173458=>{const _0xc168e3=_0x1eb8f1;let _0x3a8592=U(_0x173458),_0x2c04b3=this[_0xc168e3(0x202)](_0x173458,{'default':_0x3a8592}),_0x3f6faf=_0xab85e[_0xc168e3(0x1a9)](_0x3a8592)?_0x2601cd['render']('link',{'url':_0x3a8592,'label':_0x2c04b3}):_0x2601cd['render'](_0xc168e3(0x1f5),{'url':_0x3a8592,'label':_0xc168e3(0x211),'description':'('+_0x2c04b3+')'});_0x173458[_0xc168e3(0x185)](this[_0xc168e3(0x227)](_0x3f6faf));}),_0x5cb9d0[_0x1eb8f1(0x235)](le[_0x1eb8f1(0x163)](',\x20'))['forEach'](_0x34a936=>{const _0x1f8866=_0x1eb8f1;let _0x1bac09=U(_0x34a936),_0xb134a1=this['extractLabelFromElement'](_0x34a936,{'default':_0x1bac09}),_0x3cb5e7=_0x26e694['includes'](_0x1bac09)?_0x2601cd[_0x1f8866(0x150)](_0x1f8866(0x116),{'url':_0x1bac09,'label':_0x1f8866(0x13c),'description':_0x1f8866(0x10a)}):_0x2601cd[_0x1f8866(0x150)](_0x1f8866(0x1f5),{'url':_0x1bac09,'label':_0x1f8866(0x11f),'description':''});_0x34a936[_0x1f8866(0x185)](this[_0x1f8866(0x227)](_0x3cb5e7));}),_0x5cb9d0['innerHTML'][_0x1eb8f1(0x107)](/(\n|\r|\f|\v)+/g,_0x1eb8f1(0x20e)),_0x5cb9d0;}[_0x3a5699(0x1c9)](_0x370669){const _0x316120=_0x3a5699;return new _0x3c92f6['Attachment']({'content':_0x370669,'contentType':ne[_0x316120(0x237)]});}[_0x3a5699(0xfb)](_0x35720f=0x1,_0x48cb0d={'delay':0x1}){let {delay:_0x255324}=_0x48cb0d;return new Promise(_0x1e8260=>{setTimeout(()=>{const _0x54ba1b=_0x17dc;for(let _0x544825=0x0;_0x544825<_0x35720f;_0x544825++)this['editor'][_0x54ba1b(0x1fd)]();_0x1e8260();},_0x255324);});}[_0x3a5699(0x21d)](_0x57d975,_0x3c9363={'delay':0x1}){let {delay:_0x34ad95}=_0x3c9363;return new Promise(_0x301cd7=>{setTimeout(()=>{const _0x3acdfa=_0x17dc;this[_0x3acdfa(0x10f)][_0x3acdfa(0x21d)](this[_0x3acdfa(0x1c9)](_0x57d975)),this[_0x3acdfa(0xfb)](0x1,{'delay':_0x34ad95})['finally'](_0x301cd7);},_0x34ad95);});}['insertHTML'](_0x433c25,_0x17255e={'delay':0x1}){let {delay:_0x18fddc}=_0x17255e;return new Promise(_0x34b9eb=>{setTimeout(()=>{const _0x3297f0=_0x17dc;this[_0x3297f0(0x10f)][_0x3297f0(0x1b6)](_0x433c25),this[_0x3297f0(0xfb)](0x1,{'delay':_0x18fddc})[_0x3297f0(0x21c)](_0x34b9eb);},_0x18fddc);});}[_0x3a5699(0x1c3)](_0x4e6f81,_0x570fc1={'delay':0x1,'disposition':'attachment'}){const _0x26d8e3=_0x3a5699;let {delay:_0xbad883,disposition:_0x5877f8}=_0x570fc1;return _0x4e6f81!=null&&_0x4e6f81[_0x26d8e3(0x23c)]?new Promise(_0x1bb7ac=>{setTimeout(()=>{const _0x25f913=_0x17dc;if(typeof _0x4e6f81==_0x25f913(0x105))return _0x5877f8==='inline'?this[_0x25f913(0x1b6)](_0x4e6f81,{'delay':_0xbad883})[_0x25f913(0x16e)](_0x369156=>this[_0x25f913(0x197)](_0x369156))[_0x25f913(0x21c)](_0x1bb7ac):this[_0x25f913(0x21d)](_0x4e6f81,{'delay':_0xbad883})[_0x25f913(0x16e)](_0x4a7cea=>this[_0x25f913(0x197)](_0x4a7cea))[_0x25f913(0x21c)](_0x1bb7ac);if(Array[_0x25f913(0x1d3)](_0x4e6f81)){let _0x5da9df=_0x5877f8===_0x25f913(0x225)?_0x4e6f81[_0x25f913(0x1e4)](_0x4f0a5f=>this[_0x25f913(0x1b6)](_0x4f0a5f,{'delay':_0xbad883+0x1})):_0x4e6f81[_0x25f913(0x1e4)](_0x421eec=>this[_0x25f913(0x21d)](_0x421eec,{'delay':_0xbad883+0x1}));return Promise[_0x25f913(0x14b)](_0x5da9df)[_0x25f913(0x16e)](_0x54e167=>this[_0x25f913(0x197)](_0x54e167))[_0x25f913(0x21c)](_0x1bb7ac);}_0x1bb7ac();});}):Promise[_0x26d8e3(0x112)]();}get[_0x3a5699(0x10f)](){const _0x27e1ba=_0x3a5699;return this[_0x27e1ba(0x236)][_0x27e1ba(0x10f)];}get[_0x3a5699(0x181)](){const _0x5c9b51=_0x3a5699;let _0x5adbd8=this['element'][_0x5c9b51(0x152)](_0x5c9b51(0x205)),_0x5cffd6=_0x5adbd8?document[_0x5c9b51(0x190)](_0x5adbd8):null;if(!_0x5cffd6){let _0x34826b=this[_0x5c9b51(0x236)][_0x5c9b51(0xff)];_0x5cffd6=_0x34826b!=null&&_0x34826b[_0x5c9b51(0x204)]['match'](/trix-toolbar/i)?_0x34826b:null;}return _0x5cffd6;}get[_0x3a5699(0x201)](){const _0x341d4d=_0x3a5699;return this[_0x341d4d(0x236)][_0x341d4d(0x142)]('form');}get['inputElement'](){const _0x482b4e=_0x3a5699;var _0x1f3e4e;let _0x17ca0c=this[_0x482b4e(0x236)][_0x482b4e(0x152)](_0x482b4e(0x233));return _0x17ca0c?(_0x1f3e4e=this[_0x482b4e(0x201)])==null?void 0x0:_0x1f3e4e[_0x482b4e(0x179)]('#'+_0x17ca0c):null;}get[_0x3a5699(0x192)](){const _0x4abd5c=_0x3a5699;return!!this[_0x4abd5c(0x19c)][_0x4abd5c(0x1e5)]('paranoid');}get[_0x3a5699(0x1c4)](){const _0x46d293=_0x3a5699;try{return JSON[_0x46d293(0x13b)](this[_0x46d293(0x19c)][_0x46d293(0x1e5)](_0x46d293(0x1c4)))[0x2];}catch(_0x1c703b){return null;}}get['hostsValueDescriptors'](){const _0xd6583c=_0x3a5699;return Object[_0xd6583c(0x1c8)](this[_0xd6583c(0x1a0)])[_0xd6583c(0x19d)](_0x54651c=>_0x54651c['name']['endsWith'](_0xd6583c(0x104)));}get[_0x3a5699(0x127)](){const _0x31c4a3=_0x3a5699;return[_0x31c4a3(0x18f),_0x31c4a3(0x19f),'embed.local',_0x31c4a3(0x10e),_0x31c4a3(0x173),'trix.embed.example','trix.embed.invalid','trix.embed.local','trix.embed.localhost',_0x31c4a3(0x10c),'trix.example',_0x31c4a3(0x18b),'trix.local',_0x31c4a3(0x19e),_0x31c4a3(0x134),_0x31c4a3(0x1a7),'www.embed.invalid',_0x31c4a3(0x14d),_0x31c4a3(0x1e8),_0x31c4a3(0x172),_0x31c4a3(0x1ba),_0x31c4a3(0x1b1),_0x31c4a3(0x1da),_0x31c4a3(0x17c),_0x31c4a3(0x108)];}['rememberConfig'](){return new Promise(async _0x532651=>{const _0x483374=_0x17dc;let _0x48d16d,_0x2d535c=await T();_0x48d16d=await x(_0x2d535c,w(this[_0x483374(0x127)],0x3)),this[_0x483374(0x19c)]['write'](_0x483374(0x1c4),JSON[_0x483374(0x234)]([_0x48d16d[0x0],_0x48d16d[0x1],_0x2d535c,_0x48d16d[0x2]])),this['paranoidValue']!==!0x1&&(_0x48d16d=await x(_0x2d535c,w(this[_0x483374(0x127)],0x4)),this[_0x483374(0x19c)][_0x483374(0x16f)]('paranoid',JSON[_0x483374(0x234)](_0x48d16d))),this[_0x483374(0x236)][_0x483374(0x1b0)](_0x483374(0x14e)),this['hostsValueDescriptors'][_0x483374(0x229)](async _0x204b4d=>{const _0x494f5a=_0x483374;let {name:_0x4e3a1a}=_0x204b4d,_0x5d8851=_0x4e3a1a[_0x494f5a(0x1bc)](0x0,_0x4e3a1a[_0x494f5a(0x15d)](_0x494f5a(0x23f))),_0x150715=this[_0x4e3a1a];_0x150715['length']<0x4&&(_0x150715=_0x150715[_0x494f5a(0x1b8)](w(this[_0x494f5a(0x127)],0x4-_0x150715[_0x494f5a(0x23c)]))),this[_0x494f5a(0x19c)]['write'](_0x5d8851,JSON[_0x494f5a(0x234)](await x(_0x2d535c,_0x150715))),this['hasOwnProperty'](_0x5d8851)||Object[_0x494f5a(0x212)](this,_0x5d8851,{'get':async()=>{const _0x5e972c=_0x494f5a;try{return(await Y(this['key'],JSON[_0x5e972c(0x13b)](this[_0x5e972c(0x19c)]['read'](_0x5d8851))))['filter'](_0x203285=>!this[_0x5e972c(0x127)][_0x5e972c(0x1a9)](_0x203285));}catch(_0x6790c1){return console[_0x5e972c(0x20d)](_0x5e972c(0x17d)+_0x5d8851+'\x27!',_0x6790c1),[];}}}),this[_0x494f5a(0x236)][_0x494f5a(0x1b0)](_0x494f5a(0x1b3)+_0x204b4d[_0x494f5a(0x1c4)]);}),_0x48d16d=await x(_0x2d535c,w(this[_0x483374(0x127)],0x4)),this[_0x483374(0x19c)]['write']('securityHosts',_0x48d16d),_0x48d16d=await x(_0x2d535c,w(this[_0x483374(0x127)],0x4)),this[_0x483374(0x19c)]['write'](_0x483374(0x132),_0x48d16d),_0x532651();});}['forgetConfig'](){const _0x475077=_0x3a5699;var _0x469f06,_0x2b37d6,_0x33d9c7,_0x8f4ca9;try{(_0x469f06=this[_0x475077(0x19c)])==null||_0x469f06[_0x475077(0x19a)](_0x475077(0x1c4)),(_0x2b37d6=this[_0x475077(0x19c)])==null||_0x2b37d6[_0x475077(0x19a)]('paranoid'),this[_0x475077(0x21f)][_0x475077(0x229)](async _0x2c9219=>{const _0x2753ac=_0x475077;var _0x1e62f1;let {name:_0x102a7b}=_0x2c9219,_0x2de8ee=_0x102a7b['slice'](0x0,_0x102a7b['lastIndexOf']('Value'));(_0x1e62f1=this[_0x2753ac(0x19c)])==null||_0x1e62f1[_0x2753ac(0x19a)](_0x2de8ee);}),(_0x33d9c7=this[_0x475077(0x19c)])==null||_0x33d9c7[_0x475077(0x19a)](_0x475077(0x12e)),(_0x8f4ca9=this[_0x475077(0x19c)])==null||_0x8f4ca9[_0x475077(0x19a)](_0x475077(0x132));}catch(_0x5398a1){}}},G(_0x38fb47,'values',{'embeddedTemplate':String,'errorTemplate':String,'iframeTemplate':String,'imageTemplate':String,'linkTemplate':String,'prohibitedTemplate':String,'warningTemplate':String,'allowedLinkHosts':Array,'blockedLinkHosts':Array,'allowedMediaHosts':Array,'blockedMediaHosts':Array,'paranoid':{'type':Boolean,'default':!0x0}}),_0x38fb47;}var fe=!0x1,Fe={'application':null,'Controller':null,'Trix':null};function De(_0xd6d3f9=Fe){const _0x1289c8=_0x12cdbf;if(fe)return;let {application:_0xfd005e,Controller:_0x383c0f,Trix:_0x39ea74}=_0xd6d3f9;_0xfd005e[_0x1289c8(0x1d9)](_0x1289c8(0x230),pe({'Controller':_0x383c0f,'Trix':_0x39ea74})),fe=!0x0;}self[_0x12cdbf(0x214)]=L(E({},X),{'encryptValues':x,'generateKey':T,'generateKeyAndEncryptValues':Z,'initialize':De});var Tt=self['TrixEmbed'];export{Tt as default};
@@ -1 +1 @@
1
- {"inputs":{"app/javascript/encryption.js":{"bytes":4095,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"app/javascript/urls.js":{"bytes":2818,"imports":[],"format":"esm"},"app/javascript/media.js":{"bytes":3331,"imports":[{"path":"app/javascript/urls.js","kind":"import-statement","original":"./urls"}],"format":"esm"},"app/javascript/guard.js":{"bytes":2028,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"app/javascript/store.js":{"bytes":952,"imports":[],"format":"esm"},"app/javascript/templates.js":{"bytes":997,"imports":[],"format":"esm"},"app/javascript/renderer.js":{"bytes":4072,"imports":[{"path":"app/javascript/urls.js","kind":"import-statement","original":"./urls"},{"path":"app/javascript/media.js","kind":"import-statement","original":"./media"},{"path":"app/javascript/templates.js","kind":"import-statement","original":"./templates"}],"format":"esm"},"app/javascript/controller.js":{"bytes":9317,"imports":[{"path":"app/javascript/encryption.js","kind":"import-statement","original":"./encryption"},{"path":"app/javascript/urls.js","kind":"import-statement","original":"./urls"},{"path":"app/javascript/media.js","kind":"import-statement","original":"./media"},{"path":"app/javascript/guard.js","kind":"import-statement","original":"./guard"},{"path":"app/javascript/store.js","kind":"import-statement","original":"./store"},{"path":"app/javascript/renderer.js","kind":"import-statement","original":"./renderer"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"app/javascript/index.js":{"bytes":548,"imports":[{"path":"app/javascript/encryption.js","kind":"import-statement","original":"./encryption"},{"path":"app/javascript/controller.js","kind":"import-statement","original":"./controller"}],"format":"esm"}},"outputs":{"app/assets/builds/trix-embed.js":{"imports":[],"exports":["default"],"entryPoint":"app/javascript/index.js","inputs":{"app/javascript/encryption.js":{"bytesInOutput":1346},"app/javascript/urls.js":{"bytesInOutput":973},"app/javascript/media.js":{"bytesInOutput":846},"app/javascript/guard.js":{"bytesInOutput":1285},"app/javascript/store.js":{"bytesInOutput":688},"app/javascript/templates.js":{"bytesInOutput":897},"app/javascript/renderer.js":{"bytesInOutput":1780},"app/javascript/controller.js":{"bytesInOutput":4300},"app/javascript/index.js":{"bytesInOutput":274}},"bytes":12893}}}
1
+ {"inputs":{"app/javascript/metadata.js":{"bytes":86,"imports":[],"format":"esm"},"app/javascript/encryption.js":{"bytes":4095,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"app/javascript/enumerable.js":{"bytes":517,"imports":[],"format":"esm"},"app/javascript/urls.js":{"bytes":3338,"imports":[],"format":"esm"},"app/javascript/media.js":{"bytes":3618,"imports":[{"path":"app/javascript/urls.js","kind":"import-statement","original":"./urls"}],"format":"esm"},"app/javascript/forms.js":{"bytes":3377,"imports":[{"path":"app/javascript/media.js","kind":"import-statement","original":"./media"},{"path":"app/javascript/urls.js","kind":"import-statement","original":"./urls"}],"format":"esm"},"app/javascript/guard.js":{"bytes":1211,"imports":[{"path":"app/javascript/forms.js","kind":"import-statement","original":"./forms"}],"format":"esm"},"app/javascript/store.js":{"bytes":1219,"imports":[{"path":"app/javascript/urls.js","kind":"import-statement","original":"./urls"}],"format":"esm"},"app/javascript/templates.js":{"bytes":1235,"imports":[],"format":"esm"},"app/javascript/renderer.js":{"bytes":5087,"imports":[{"path":"app/javascript/urls.js","kind":"import-statement","original":"./urls"},{"path":"app/javascript/media.js","kind":"import-statement","original":"./media"},{"path":"app/javascript/templates.js","kind":"import-statement","original":"./templates"}],"format":"esm"},"app/javascript/controller.js":{"bytes":16611,"imports":[{"path":"app/javascript/enumerable.js","kind":"import-statement","original":"./enumerable"},{"path":"app/javascript/encryption.js","kind":"import-statement","original":"./encryption"},{"path":"app/javascript/urls.js","kind":"import-statement","original":"./urls"},{"path":"app/javascript/media.js","kind":"import-statement","original":"./media"},{"path":"app/javascript/guard.js","kind":"import-statement","original":"./guard"},{"path":"app/javascript/store.js","kind":"import-statement","original":"./store"},{"path":"app/javascript/renderer.js","kind":"import-statement","original":"./renderer"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"app/javascript/index.js":{"bytes":669,"imports":[{"path":"app/javascript/metadata.js","kind":"import-statement","original":"./metadata"},{"path":"app/javascript/encryption.js","kind":"import-statement","original":"./encryption"},{"path":"app/javascript/controller.js","kind":"import-statement","original":"./controller"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"app/assets/builds/trix-embed.js":{"imports":[],"exports":["default"],"entryPoint":"app/javascript/index.js","inputs":{"app/javascript/metadata.js":{"bytesInOutput":24},"app/javascript/encryption.js":{"bytesInOutput":1346},"app/javascript/enumerable.js":{"bytesInOutput":229},"app/javascript/urls.js":{"bytesInOutput":1203},"app/javascript/media.js":{"bytesInOutput":935},"app/javascript/forms.js":{"bytesInOutput":1352},"app/javascript/guard.js":{"bytesInOutput":1002},"app/javascript/store.js":{"bytesInOutput":835},"app/javascript/templates.js":{"bytesInOutput":969},"app/javascript/renderer.js":{"bytesInOutput":2505},"app/javascript/controller.js":{"bytesInOutput":7987},"app/javascript/index.js":{"bytesInOutput":311}},"bytes":19212}}}